View Full Version : Improve performance with Limit Worker mod


idragon
Oct 20, 2010, 01:51 PM
Hi Guys,

I have a decent PC, but due to horrible publisher (2k) CIV 5 was released unfinished, unpolished, etc, you know the story.

A great mate did some tests and found one of the problems of the optimization, more details here: http://forums.2kgames.com/forums/showthread.php?t=94139 and here: http://forums.2kgames.com/forums/showthread.php?t=94687

A player with the name "Perkus" made a mod to limit the workers to 1, by improving their movement and construction time, i tweaked that a little, but the original topic is here: http://forums.2kgames.com/forums/showpost.php?p=1227896&postcount=28

I am reposting this for people that i didnt found out this fix, while waiting for patch that should be in game in the release candidate FFS!


What this mod do?

Limits all civs and civ states to 1 worker. In my case the worker unit has 4 movement units, and most of the things takes 3 turns to build, besides road. Check the xml.

To install:

Copy the folder in the archive to the Mods folder in your My Documents/Sid Meyer Fail Civ 5/. Go in game to you the mods browser and install "Limit Workers for Faster AI Turns (v 1)".

File to download: http://www.mmorpg-center.com/links/click.php?id=32

Hope it helps, i am not even sure about the upcoming patch on turn time, so yeah...

Many thanks to: Azzer007, Perkus and Sombrus for making this possible
Cheerios

温柔的杀你
Oct 21, 2010, 09:01 PM
could you please tell us how to change the xml to limit the worker ?

Generals3
Oct 22, 2010, 02:27 AM
While i think limiting CS workers to 1 is nice i don't think it's good for all civs even if they're faster . I think it will be extremely tedious to build railroad networks with only one worker. Isn't it possible to make a 3 worker limit for normal civs?

ShadowoftheDark
Oct 22, 2010, 04:37 AM
While i think limiting CS workers to 1 is nice i don't think it's good for all civs even if they're faster . I think it will be extremely tedious to build railroad networks with only one worker. Isn't it possible to make a 3 worker limit for normal civs?

+1. Having multiple cities with several improvements needed to work on is quite slow when you have 1 worker doing the road and the improvements at the same time.

Puer
Oct 22, 2010, 01:23 PM
Open just second link from first post: http://forums.2kgames.com/forums/showthread.php?t=94687
and you see that you must change this to increase workers:
<MaxPlayerInstances>1</MaxPlayerInstances>
1 = one worker can be build only
3 = 3 workers can be build
etc

btw, you can always capture slaves ...

Panda_Power
Oct 22, 2010, 07:31 PM
Wow! The game is so much faster with just one worker each and now there's real incentive to go after those barbarian camps to get and keep the workers they've captured from other civs.

Thanks for this!:)

alpaca
Oct 23, 2010, 04:24 PM
/me wants source code access... so workers are the new but improved trade route recalculation resource hog :mischief:

Taneda Sant˘ka
Oct 24, 2010, 08:23 PM
What would be the code to limit one worker per city owned ? Or even, one worker per city founded around the whole world ?

idragon
Oct 24, 2010, 09:18 PM
After u install the mod, go to the MODS folder, and find Limit Workerd mod. There, there is xml file named: Limit Workers.xml

Open that with a decent xml editor, like notepad plus and edit as you want:

Example:

As you will see below by replacing MaxPlayerInstance number, u limit the workers population for each civilization, in this case 2.

<!-- Limit each civ's building of workers to a maximum -->
<UnitClasses>
<Update>
<Where Type="UNITCLASS_WORKER"/>
<Set MaxPlayerInstances="2" />
</Update>
</UnitClasses>
<!-- Speed up worker movement speed -->
<Units>
<Update>
<Where Class="UNITCLASS_WORKER"/>
<Set Moves="3" />
</Update>
</Units>
<!-- Speed up build times for tile improvements & other work. Note that 200 = 1 turn, 300 = 2 turns, 400 = 3 turns, etc.! -->
<Builds>
<Update>
<Where Type="BUILD_ROAD"/>
<Set Time="500" />
</Update>

idragon
Oct 24, 2010, 09:21 PM
Unfortunately while this helps a lot towards speed, the game still has tons of problems.

On my e6750 dual core, 4gb Ram 800mhz, 1680x1050 (medium details, yeah lol, it works with full detail AA but maybe i get some increase in speed), and 5670 with 1gb DDR4, 775, 1050 i believe, Win 7-64bits, still is a hog.

Fortunately i moded my game so now i play with a decent speed on a large map with 8 civs, and 5 civ states, and Limit Worker mod to 2.

idragon
Oct 24, 2010, 09:24 PM
+1. Having multiple cities with several improvements needed to work on is quite slow when you have 1 worker doing the road and the improvements at the same time.

Limit the workers to 2 or 3, preferably 2, but remember with this mod, it increase the building speed, and movement speed, so overall tweaked is like before, but with a boost in speed.

I laugh my ass off, how we the player must fix this BETA, and pay for it. FFS!

Next CIV game i will pirate it, until i am sure it runs well, and its decent.

dfn
Oct 26, 2010, 12:56 AM
What would be the code to limit one worker per city owned ? Or even, one worker per city founded around the whole world ?
++;

Anyone know the answer to the above question?

alpaca
Oct 27, 2010, 05:35 AM
++;

Anyone know the answer to the above question?

Yes, you need dll access for it. Unless there's some crafty Lua way, that is.

Perkus
Oct 27, 2010, 12:16 PM
Heh, I'm the guy who put this mod together @ threw it up on the 2k forums. I didn't get any feedback whatsoever on it over there, so I pretty much dropped the idea. I don't find the speed so bad personally to need it - I only play smaller maps. I had no idea this had been posted & is being used here! Cool, so it wasn't a total waste of time after all. Thanks, idragon, for putting it up here.

Anyway, in my experience this has been improved a ton in patch .62, so I didn't think this was necessary at all any more.

And no, there is no simple way to code it to be based on the number of cities you have. You can raise the limit to 2 or 3, and speed up the work done easily enough by editing the XML file.

dfn
Oct 27, 2010, 12:46 PM
Ok cool, thanks for the replies.

Unearthly
Oct 27, 2010, 02:48 PM
I tried it with 2 workers and it seems the AI has more unimproved tiles than normal. I turned it on because I wanted to play a large map, which even with a good PC (i7 920@3.8, GTX 480) slows down at the end game. I hadn't tried since the new patch though, maybe I will.

idragon
Oct 29, 2010, 04:07 AM
Heh, I'm the guy who put this mod together @ threw it up on the 2k forums. I didn't get any feedback whatsoever on it over there, so I pretty much dropped the idea. I don't find the speed so bad personally to need it - I only play smaller maps. I had no idea this had been posted & is being used here! Cool, so it wasn't a total waste of time after all. Thanks, idragon, for putting it up here.

Anyway, in my experience this has been improved a ton in patch .62, so I didn't think this was necessary at all any more.

And no, there is no simple way to code it to be based on the number of cities you have. You can raise the limit to 2 or 3, and speed up the work done easily enough by editing the XML file.

With the latest patch i saw an improvement in speed Perkus, but not by a lot. I still need to use the mod to actually have a good speed on 7 civs and 8 civ states after turn 300.

As for improvements i use 2 limit mod, and usually most of the cities of the AI have all improvements.

Thanks for the mod btw.

温柔的杀你
Nov 01, 2010, 09:50 PM
I found out that the workers of AIs were easily captured, and a lot of fields were not improved. I change the worker to the combat unit, and can not be captured any more, but they may be killed during war. I have an idea, if the worked is killed during war, the AI can produce one more, but I don't know how to make it come true, can someone kindly tell me how to do this?

rf900
Nov 02, 2010, 02:23 AM
I have an idea, if the worked is killed during war, the AI can produce one more, but I don't know how to make it come true, can someone kindly tell me how to do this?

I think that with the global limit of 1 unit, if it is killed or capture then you can build another one as you no longer have one. I guess the AI is smart enough to build another worker once he has lost one.

ShadowoftheDark
Nov 02, 2010, 03:50 AM
Has anyone had any issues where the game hangs after you captured your 3rd worker?

CurseUppl
Nov 02, 2010, 09:35 AM
How are you guys even getting the mod to work? I place it in the mods folder and enable it in the game but whenever I run a quick game, it lets me build as many workers as I want... Nor do they have the movement bonus, etc.

Nvm, got it :D

Is there any way to get this working for multiplayer?

Perkus
Nov 02, 2010, 01:07 PM
Why wouldn't it work for multiplayer? Did you try it?

Panda_Power
Nov 06, 2010, 07:31 AM
I thought you couldn't use mods and DLC with multiplayer...have they changed it?

Perkus
Nov 06, 2010, 04:30 PM
I thought you couldn't use mods and DLC with multiplayer...have they changed it?

I doubt it. Sorry, I didn't realize you couldn't mod multiplayer at all, I've never tried to play that way.

The Rusty Gamer
Nov 11, 2010, 05:07 PM
Could you be limited to one worker per x number of cities or somesuch?

Another thought, if the number of workers is a problem for game performance, why not find a way to limit the graphics for workers? Would that help?

Would there be a way to impelment the public works system re Call To Power? That would bypass the problem alltogether.

Perkus
Nov 11, 2010, 05:39 PM
@The Rusty Gamer:
1) I'm using the MaxPlayerInstances unit property to enforce the limit. It was only designed for restricting the building of spaceship components. To the best of my modding knowledge, you can't change this limit on the fly. It can only be set when mods are first loaded. And it's a simple maximum per civ, there's no way to make it vary with number of cities. We'd need full C++ code access.

2 )I don't think worker graphics contribute to the problem, I think it's the inefficient AI algorithms.

3) I'm not familiar with Call to Power, sorry.

The Rusty Gamer
Nov 11, 2010, 05:51 PM
Ok, well, if you can only have one worker then perhaps you need to be able to upgrade it to a more efficient worker as time goes on. New techs would create more advanced worker units which you could upgrade your worker to. Eventually, it may just take 1 turn to complete a task and the unit may be able to move just about any number of spaces per turn.

Call To Power has a public works system whereby you generate public work points and then spend them on improvements. No worker unit needed. This has been quite a debate among the civ community, which system is better. Public works certainly requires a lot less micro management and thereby less processing.

Perkus
Nov 11, 2010, 06:25 PM
Are you aware that I already massively reduced the time required to make improvements? It takes only 1-2 turns for most common improvements now. You can already get ways of speeding up workers in the game currently (wonders, policies) if that is important to you. With a couple of these, it might reduce even the 2 turn improvements to just 1 turn. I could decrease worker speed further easily enough with certain technology markers, yes. If anybody has played with this mod on far enough to have specific suggestions, let me know.

I gave the workers speed 4 to begin with, and with roads and railroads they should be able to get around relatively quickly on land, at least. I don't know how I could go about speed them up even further with tech or eras. You can speed up embarked movement, and you can speed up entire "domains" (land/air/sea), but I don't know if I can speed up a specific unit. I would probably need to introduce faster modern versions of workers, as some other mods have done.

It might be more playable with a limit of 2 workers instead of one. That's easy for anyone to edit in the mod's xml.

Any major system overhaul like this public works system will definitely require modding access to the C++ codebase, which is supposed to be made available in the future.

kelmen
Dec 07, 2010, 03:46 AM
suggest make this sticky till the issue been addressed in (official) patch?

and rename the title like "dirty fix for extremely slow game issue"

btw, does this fix the late game crashing issues too?

The Rusty Gamer
Dec 07, 2010, 04:42 PM
Is it going slow even with quad core in the realm of 2.8GHz processors?