[freeciv-ai] Re: Patch Army
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
En/na Gregory Berkolaiko ha escrit:
Quoting Jordi Negrevernis i Font <jorneg@xxxxxxxxxxx>:
I read it. I am impressed by quantity, but not really impressed by quality.
Yes, maybe is not a good design but it ins't a waste of time and
resources.Look at the time to process the AI handling code for units and
the time in the army patch.
Design could be much better. Cycling through all army units every time you need
to know the number of units in the army is, to put it mildly, wasteful. And the
patch is full of it.
The flip-flop of the army can be because i use the real_map_distance
instead of warmap and because every ten turns the ai reevaluates the
objectives and, maybe, does choose a far away one.
I tested it too, in a couple of games. When it works, it is nice. :) Most of
the time it didn't :( There were two main problems:
1. There was no path to the selected target, so the army would march out of
it's base and then march back in, ad infinitum. This can be fixed rather easily
by clever use of path-finding.
Yes are right. This is a problem. I did not want to mess the ai unit
handling code, so there are units attacking on it way.
2. There were not enough units willing to join the army. However, there were
many units on the continent doing brave solitary attacks. Also the units who
did join the armies, were split between two armies with the same target, base
The second is the more fundamental problem.
So, which is your idea? You want to modify the patch and have a new
c file or just modify the general ai code?
Hopefully this will increase modularity of the AI. Please comment on this
general design and on how it could be split into "projects". Then we can put
tenders on the projects ;)
Personally, I would first clean up and sort the code responsible for calling
different advisors and merging their opinions.