How to make the AI stop sending workers to distant mines

Asked by Mikko Merikivi

This happens at least in Aleona's Tales as well as Battle for Mandicor in 2.2.7. The AI will send workers to random mines all over the map, even if they are within enemy territory or a hundred tiles away from a depot. Since I'm interested in developing a good AI, I'd like to disable this functionality since that can be a real drag on the AI's economy, especially in the early game in which the consequences for a poorly managed economy can be devastating. So, is there a way to disable that? Or could you point me to the function that makes the AI do this?

Question information

Language:
English Edit question
Status:
Solved
For:
Stratagus Edit question
Assignee:
No assignee Edit question
Solved by:
Mikko Merikivi
Solved:
Last query:
Last reply:
Revision history for this message
Andre Novellino Gouvêa (andre-ng) said :
#1

I have also noticed this issue (and others have mentioned it as well in the forums). As far as I know, it is something that cannot be solved by editing the Lua AI scripts, one would probably need to look into the Stratagus source itself.

Revision history for this message
Mikko Merikivi (mikkommm) said :
#2

I decided to look for an answer myself by bzr reverting to versions of Stratagus between 2.2.7 and latest trunk and in revision 8560 the problem is solved. Here's the diff and you can apply it to 2.2.7 by hand (the file has changed a little bit by this point but not too much):

https://bazaar.launchpad.net/~stratagus/stratagus/trunk/revision/8560