Worker Automation

TyloniusFunk

Chieftain
Joined
Jul 30, 2006
Messages
8
Hi, I'm considering implementing some changes to worker automation via the SDK. What I'd like from the community is suggestions as to what the automation fails at now and how it should be different. This could be as simple as 'more cottages, less farms', or as complex as you feel the automation is bad. After I start getting into the code a bit I'll post a guide outlining how vanilla worker automation is currently making it's decisions.
 
Some random thoughts:

Worker automation can't tell if you're planning a SE or CE, which leads it to build too many farms if you're going for straight cottages, and not enough if you're trying for specialists.

Workers do a good job in general of hooking up resources in a timely manner.

They seem to love building lumber mills. This may be because I don't let them chop forests because they can never know when I want the chop to come in.

They don't know which cities are economy and which are production, so improvements may be suboptimal in some cases - maybe they build a mine on a river-hill when you're financial instead of a windmill (I haven't personally observed this as I hardly ever automate until late game).

They don't know to cottage resources in certain circumstances.

There's no way for an automated worker to ask "Hey hey, can I chop down this tree and put up a cottage"


Just my random thoughts.
 
I'm fairly new to this game but i only automate workers to build trade networks, this saves me time from not having to concentrate on building roads. I usually build wat i want for the city first then i automate everything after that.
Oh yea, it's important that u make sure automated workers leave old improvements alone.
 
Is there a command to make all automated workers unautomate?
 
rustydusty10 said:
Oh yea, it's important that u make sure automated workers leave old improvements alone.
I agree to that. Putting a farm down over a town is a bit much. I mean I know its my own fault for occasionally letting the little guys run wild when my empire gets too big to micromanage them but come on now.
 
Krikkitone said:
I generally automate (with leave old improvements, and often leave Forests) after the first 2 or 3 Workers...them I use to go around and 'optimize' cities.


Where's that option if you dont mind my asking?
 
iamdanthemansta said:
Is there a command to make all automated workers unautomate?

I think you can hold down alt while clicking on a worker- this selects all workers - then put them to sleep - f - then you can scroll throught them with the / key.
 
more cottages less farms. Also worker automation would be more appealing if you could save the bonus hammers produced by chopping until you needed them (up to a limit) then you wouldn't have to worry so much about the timing of a chop rush. Also if you could automate a worker but leave him assigned to a specific city, he would then unautomate and ask for orders when he ran out of things to do.
 
I don't think you'll be able to improve automation until its possible to program a way for the game to recognize (or for you to classify) what "type" of city you're running. That way it'd go for maximum economic potential in a "pure commerce" city, a bit of everything in a "mutt" city, hammers in a production city, etc. Until then, it just tries to make everything a "mutt" city.
 
snipafist said:
I don't think you'll be able to improve automation until its possible to program a way for the game to recognize (or for you to classify) what "type" of city you're running. That way it'd go for maximum economic potential in a "pure commerce" city, a bit of everything in a "mutt" city, hammers in a production city, etc. Until then, it just tries to make everything a "mutt" city.
That is one of the big problems. The human wouldn't know that the worker AI wants to make the city a commerce city, and the worker AI wouldn't know that the human wants to make the city a production city. Very easy to mess up with rather frustrating results.

The only way to get signals from the human ATM is by using the city governor options, and I believe the worker AI already uses these to determine what type of improvements to build around the cities. AFAIK one in every 4 squares is a pre-determined "commerce plot" (when both co-ords are even IIRC), and this plot will pretty much always have a commerce boosting improvement on it.

Oh, and the AI uses the automation code by default. Are you planning on improving the AI automation, or purely the human automation?

EDIT: I missed your post in C&C a while back. Looks like you are planning on improving the AI as well. I've done a small amount of work on the way the AI uses emphasis values, and have a way of testing their performance against the standard AI which I'm planning to release as a standalone mod in a few days.
 
Precisely. You'd need to modify the city governor interface to make it work. Perhaps with 3 different sliders for production, commerce, and food that would add up to 10. A good mutt city would probably run 4, 3, and 3, respectively, but a commerce center would obviously have a maxed out (or nearly maxed) commerce slider. The AI would then go to work optimizing commerce (and planting farms where needed if that optimizes the commerce output throughout the whole fat cross, but otherwise leaving food improvements out). I can't imagine it would be easy, but it'd be an appreciated feature.
 
Whew, tough cookie this.
I reckon it'll be impossible to make worthwhile worker automation without similar changes to city governors, or at least without them being in tune with a 'smart' governor. The number of rules to implement will no doubt also be substantial.

Nonetheless, here are a few suggestions off the top of my head (not sure inhowfar they are realistic):
- Let workers pre-chop. Rather than having them build useless roads for lack of better work, let them chop forests up to 1 turn from actual chopping.
- Do not let them build useless roads, as they are very fond of doing with their current implementation. Have them build roads on hills and forests only if they really cannot do anything else (see previous rule) and let them interconnect cities/resources. Interconnection should be based on shortest-route first, and through forest or on hills as a secondary rule.
- When running Representiation + having built Pyramids and/or running Caste System, have them build food-oriented improvements primarily, unless the city can attain 20+ base hammers (a number I pulled out of my hat, mind). Otherwise, let them focus on building enough food-oriented improvement to fully sustain the nearby city, then primarily cottages.
- When the nearby city is building a wonder, let them chop trees unless this leaves less than 2 margin on health (again a number I pulled out of my hat) When the nearby city is building anything that would fully benefit from a chop (i.e. no overflow, as this may not fit the player's strategy) let them chop, again respecting the margin.
- Have fully automated workers focus on cities with the worst improved tiles/potential city size ratio first.
- Never let workers improve a tile that can be reached by an enemy civ in a single turn (taking maximal road movement and unit speed of enemy civs into account), unless the player is at peace with all nearby civs of course.
- Never let them chop tundra forests, except when the tile has river access. Have them lumbermill tundra forests instead, but with a low priority.
- Only have them build windmills when a mine or cottage would impede growth in the long run.
- Only let them build watermills when there are no other means to increase food yield or to 'balance out' total food yield. Note that ice/desert watermills should be low-priority, food should come first (typically cities with such tiles are low on food)
- Have them balance out between food yield and workshops on potential 20+ base hammer cities, such that the city can work the maximum number of tiles with the best hammer yield possible. Don't let them build workshops elsewhere, except perhaps when the nearby city has less than, say, 5 hammer output total.
- When railroads are available, have them focus on interconnecting cities first (shortest-route), then railing mines and finally railing lumbermills; preferrably let them combine these where possible. Don't let them rail other tiles as it is quite pointless.
- Let them cottage grassland hills (more often) when it benefits the city. Current implementation rarely, if ever, appears to do that.

That's pretty much how I let my workers improve tiles barring anticipation, which is obviously impossible to implement.
 
I guess the worker improvements could be tailored to the city type by defining it a minimum number of expected surplus food (X), a minimum number of hammers (Y), and a minimum number of commerce, which I guess should be 0. (X and Y affected by city size.)

So if your food/hammer/commerce priorities are set to off:off:off, then the tile improvements must be built such that optimal tile selection can give the city the following resources: X+a : Y+a : 0+a where a is some average distrubution of extra resources.

Instead if food is prioritized (1:0:0), then X+b : Y : 0 is the mimimum expected resources, where b is all the extra resources possible, etc.

Also, if for some reason you want to micro-manage your tile allocation, then you can leave the priorities on, just switch the governor off, so the workers will still do their stuff.

In fact, for all I know, maybe the game's AI already does this, and just needs to be tweaked. *shrugs*
 
hard to tell exactly without looking into the sdk for how it works right now but:

- i would like a "temporary" automation, something like automatically improve specials then ask, or ask when all useful trade routes are done...
- using the governors option from the nearest city is good, but what if the governor is not activated? You should not be able to automate workers when governor's options are not selected. Meaning the automated workers would improve automated cities' tiles only.
 
One way of improving automated workers would be to give the user more
control over them:

Add options - workers don't destroy Cottage, Hamlet, Village, Town.
workers don't destroy Farms.
workers don't destroy Mines.
etc.

This should be somewhat simpler than redoing everything.

I mostly like worker automation and late in the game if a windmill would be better than mine I'm happy to let the automated working change it. I just
hate when they farm over my cottages.
 
Back
Top Bottom