Hi,

> Gesendet: Samstag, 10. Oktober 2015 um 06:23 Uhr
> Von: "Michael T. Pope" <mp...@computer.org>
>
> I take the point of having AI that is aimed at particular stages of the
> game.  I just do not think you can easily break out that functionality.
> Whatever you do, you need to implement the abstract routines of AIPlayer.
> What we have in EuropeanAIPlayer is pretty minimal in most places ---
> the only place with any depth is support for AIColony/s doing the best they
> can with their and some limited global resources, and some attempt to
> globally allocate units.  As it stands if you want a "war AI", I would
> recommend just a big "switch (getAIOperatingMode()) { case WAR: ... }" in
> the main EuropeanAI routine:-).

I did a little experimentation and could significantly cut down on the code,
I'd just have to reimplement choosing/buying/moving/using goods/units in some
other way. :p

I read up on how Behavior Trees and I think they are a promising way of
structuring AI:
http://www.gamasutra.com/blogs/ChrisSimpson/20140717/221339/Behavior_trees_for_AI_How_they_work.php
I started by implementing the basic node types for one. I still need to try
reimplementing parts of the AI with these, which will take some time.

> >>[Comparing AIs]
> 
> I have two ugly scripts.  bigtest.sh runs <game> <N> times to 1700,
> collects the results (with bin/fclogscore.sh and bin/fsgscore.sh) and
> prints a summary. lots.sh runs bigtest with a standard 8-player very hard
> game on a moderate sized auto-generated map 10 times, then a standard
> medium difficulty 8-player game on the Caribbean map (to increase
> competition for resources) 10 times, then repeats the two games but
> playing one turn then save-quit-reload (so as to *really* exercise the
> serialization).  This takes my decent-but-old 4-core PC about 13 hours.  I
> like to do this before committing any non-obviously-correct patch, as the
> AI is quite sensitive to mistakes --- if you can see that while the
> average number of transports per game was 1000 the day before but now it
> is 500, something is amiss.  One day soon I will put up some pretty graphs
> of how the tests have performed over time.

Interesting. I saw some of the script files are in bin directory in git.
Considering I found when normally running the game a large part of the used
time is from drawcalls and you run headless, 13h is a pretty long time.
Might be worth profiling + optimizing some parts?

> > > Indeed, some time back we had two AI implementations, but one had many
> > > less bugs and performed much better so we dropped the other.
> > 
> > I discovered goals are unused atm, I guess they remained from the second AI.
> 
> Actually no, that is incomplete code that Michael was working on.  It
> might have become a third AI:-).  I still hope he will one day get back to
> it.

I did look through the history and goals are not from Michael, the are a part
of an ExperimentalAI, which got written by abartels in 2009 and remained when
that AI was incompletely deleted shortly after, then forgotten.

Michael added server.ai.ProductionCache and CacheEntryComparator in git.7541ed01
for future use, which got never used, because little later they were forgotten
already and common.model.ProductionCache got added and used.
I think, these 2 can be deleted?

There is even more dead code in common.model.mission, which may be what you
were thinking of what Micheal started with and IR#200 is referring to.
These got activated once, then shortly after deactivated without deletion,
until some unspecified problems with the missions would be fixed.
Are these worth keeping for the moment?


Greetings,

wintertime

------------------------------------------------------------------------------
_______________________________________________
Freecol-developers mailing list
Freecol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freecol-developers

Reply via email to