Need help getting AI to build my Polders

AgentMackerel

Chieftain
Joined
Jul 4, 2014
Messages
1
Greetings. I am as new as I can be to this forum, and only slightly less new to the entire Civ 5 modding thing. As this seems to be the place to be for help regarding modding, I require some help.

I've recently released a mod, Real Polders. In this mod, I've edited the Dutch Polder UI to be allowed on coast and lakes instead of marshes and flood plains.

--- --- --- ---

It is all working fine and dandy. Embarked workers build the new Polders. I did run into a problem where the workers stayed embarked after the Polder was finished, allowing them to sail through the adjacent land. This bug has been fixed with some Lua scripting.

However, the next problem I ran into was getting the AI to build the damn things. They refuse to do so completely. (By which I mean both enemy AI and friendly automated workers, which I assume use the same rules)

An embarked worker floating on a valid tile gets the 'Build Polder' button. However the 'We recommend you build a Polder here' notification is not present. An oddity is that if I allow Workboats to build polders, the recommendation does show up. However an automated Workboat will still not build a Polder.

--- --- --- ---

I have read more threads on this forum that I can count but I have failed to find a solution to this problem. Can anyone help me?
 
Have you made new UnitAI and Unit_Build instructions for these new polders?

My first option would be to assign BUILD_POLDER to UNIT_WORKBOAT as well as, or instead of, UNIT_WORKER. That should at least tell the AI that polders can be built by workboats.

You could also try giving workers the same AI as workboats. I am assuming that all workers will not be assigned their normal tasks when they are embarked and will only 'work' on dry land.

The database has a number of tables assigned to AI. Try modding some of those values to see what happens. The tables I would look at would include:
Unit_AITypes
Unit_Builds
UnitAIInfos

There could be others, those are just the ones I can recall.
 
(Partly) the same problem as why the AI never recommends Samurai to build fishing boats - the code checks by domain type - land units only look for things to do on land, sea units only on sea.

Giving a workboat the build option won't work as you can't build workboats in lakes (10 or less water tiles), only seas/oceans

Only options are a) fix the DLL (or use a DLL that does already) or b) take control of the workers via Lua - identify the polder target, manually embark the AI worker, build the polder for the AI, then move the worker back to land and dis-embark them
 
Top Bottom