> I dont agree. If mine is able to mine 9x from 10 attempts - it is fine and no 
> need to hurry.
> AI checks availability of workers for considered upgraded mine, so if 
> situation is: a mine first time fails to mine and there are no workers for 
> upgraded mine - what should be the action?

Well, humanplayer would do the exact same thing - if message is
triggered and the building is updgradeable, check if the worker has
enough experience before upgrading.


> BTW, I am working on your code, I had to add quite a lot of code on AI side, 
> and the more I work on it the more I think this is not the best design.

How would be repeating the checks to find out whether a mine is empty in
the AI a better design? The only thing this messages gives you is the 5%
mark, and the rest would need to be coded anyway, even if you calculate
the 5% mark in the AI itself or am I wrong?


> productions site sends messages for all types of productionsites every time 
> the production fails - this is too many messages, and AI has to catch them, 
> find out if it is the right receiver, filter out non-mines, and finally 
> iterate over mines to find the right one. So much code, and (CPU) overhead in 
> comparison to may actual design.

If you would treat only mines, sure. Productionsites have a property
ismine() anyway, which is easy to check for.

You can also use these messages to check if a quarry or fisher's hut etc
need dismantling, so it's not just for mines. So, once you have finished
the mines, you could work on these as well, and then you will need these
messages. E.g. a quarry (aihints: stoneproducer=true, is_basic=true;
!ismine()) can always be dismantled when this message triggers, no
further checks needed.

-- 
https://code.launchpad.net/~widelands-dev/widelands/tibor-ai5/+merge/228762
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/tibor-ai5.

_______________________________________________
Mailing list: https://launchpad.net/~widelands-dev
Post to     : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp

Reply via email to