How to make the AI stop sending workers to distant mines

Asked by Mikko Merikivi on 2013-10-09

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

English Edit question
Stratagus Edit question
No assignee Edit question
Solved by:
Mikko Merikivi
Last query:
Last reply:

This question was reopened

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.

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):