Genetic AI Project

Great project, sometimes it’s fascinating just watching AIs play. I am trying your Mod, but I have some questions:

Do the settings I make when I go through the “Play Now” options matter? Or are they reset anyways by your Mod?
What does tracking an AI do?
When I hit ctrl-shift-x and it starts does my player (the one with my name) get one of the AI's from the AI Selector Screen?
Does this AI then get recorded when the game is over?
Should I be playing in MP mode (I am trying it in single player)?
Should I have auto-save off?
I read earlier that this can be run in the back ground, does this just mean minimized?
 
Well, after installing this Mod I get a strange error message (see image). Could this be related to the Mod Launcher I am using? I never got this error before installing this Mod. It continues on to launch OK.
 

Attachments

  • Mod error.jpg
    Mod error.jpg
    114.4 KB · Views: 116
Craterus22 said:
Awesome! (keep in mind that conquered cities with wonders may mess up 3rd city stat)
Also - don't forget Quick game Legendary Cities are 25k!
Yup, and on Epic and Marathon they're more. That's all sorted - I actually use the amount of culture the city has divided by the culture it needs to be legendary.

Craterus22 said:
Also - I tried using my radearth64x40 map for a session (using the play scenerio option)- it worked fantastic the first time through (one complete game), but then on the next attempt at the map - all of the improvements (roads mines etc) were still there and no civ units (settlers, etc.) were generated resulting in zero scores (don't worry stopped it before game "finished") - NOT A high priority of course - just some feedback... perhaps you can let us select number of games to play automated?
It doesn't do scenarios unfortunetly. Scenarios are one of the long term aims (you could set a quick one up to optimise a specific area of the AI).
Craterus22 said:
Also not a priority - I would love to save hall of fame scores (they should be saved in the GenAi mod HOF folder) and replays, but none are generated - a function of the automation code? Curious if it is easily modable... not something i would epect you to solve as most people probably wouldn't be interested in it.
Might be quick, might not be - will take a look.

Craterus22 said:
edit - with aidata6 I noticed one of he ai's had the civ in "strike" mode for nearly the entire game - do you have a "strike" flag to measure this? Would be indicative of a civ that can not manage money.
I don't detect it, but it'll show up on the final score. It is another indicater I could use to weed out bad AIs early.
Craterus22 said:
edit (question) - Are you including Team Firaxis in the requirment for 8 games? I just noticed that because of some things I am doing (leaving team firaxis out of early game setups) that nearly every ai has more than 8 games played EXCEPT for Team Firaxis.
Yes, though in the 2nd generation it's redundant - it ships with all the games played. This is probably a bad idea - IMO it should play in each generation as a control on the others to make sure nothing is straying to far from the norm.
Craterus22 said:
edit (question2) - Have you thought about trying having your program record (or emulate) human player moves for the people that are playing against your AI? IE - Scoring human player fitness... and then trying to generate stats to use in new AI's?
Much easier said then done. You also are assuming that the human is better then the AI (which may not always be true). What may be possible is to run a script while the human is playing to analyse each choice and decide if the AI would have done it. If not, it would be possible to influence the AI to be more likely to do it. Unfortunetly this sort of thing is sorted on a case-by-case basis for each value, so would take me absolutely ages to write in (~1200 values in there).
 
suspendinlight said:
Well I'm trying the new generation out and one thing I noticed is that the time between turns seems noticeably longer than it was. I could just be crazy, but I sort of timed the turns and they seem to be running a few seconds slower. Could this be some of those additional AI routines you added?
Nothing is fundamentally different. The game core is the same as it was for 0.285 - the only real thing that's changed is the way I store and handle data, which only should effect starting loading times... and that should be a very small difference.
 
PatrickDockens said:
Do the settings I make when I go through the “Play Now” options matter? Or are they reset anyways by your Mod?
The settings will be set as you set them for all of the games that it does in that run.
PatrickDockens said:
What does tracking an AI do?
Nothing much yet, and it's a tiny bit glitchy. The idea is that it saves it on your computer so that it is preserved between generations. It also makes it easier to keep track of (because of the name change), and I was thinking of adding some additional stat-logging on tracked AIs which could display in the corner of the screen while the game was playing.
PatrickDockens said:
When I hit ctrl-shift-x and it starts does my player (the one with my name) get one of the AI's from the AI Selector Screen?
Yes. It should be the top one in the active AI list.
PatrickDockens said:
Does this AI then get recorded when the game is over?
As soon as one player wins the data is recorded to a file. If you stop half way through the game the game doesn't count for anything.
PatrickDockens said:
Should I be playing in MP mode (I am trying it in single player)?
Nope, single player mode is good. I don't think the AI autoplay would work too well in MP.
PatrickDockens said:
Should I have auto-save off?
There is no point in having it on - it just slows the game down, however it can be a pain to keep having to switch it on and off, so it's your choice. As far as I am aware it doesn't break anything (although there were some reports that it might), it just slows the game down.
PatrickDockens said:
I read earlier that this can be run in the back ground, does this just mean minimized?
Yes.

As for the error message - I'd guess it's something to do with the mod launcher you have running. If it has incorrectly initialised it'll either refuse to go into autoplay mode, or it will give you an AI load error. As it hasn't done either I would assume that it's working fine. I would suggest, just to make sure, that you check the AI data file after running one or more games. If it has been editted at all then it's fine.
 
I am fascinated by this project a few questions... Sorry if they have been asked.

In theory, if we are running an AI in a real game would it be able to adapt to SDK mod changes, for example new tags
(Dales Combat, Roger's Flying, Impaler's Work) or is this something you would have to patch in, those new tags.

I assume it would take some genetic passes for it to weed out what it cant do with them. If it was able to recognize this.

Secondly just for benchmarking. Do you have a theoretical Fitness Level for Firaxis's AI?
 
suspendinlight said:
Well I'm trying the new generation out and one thing I noticed is that the time between turns seems noticeably longer than it was. I could just be crazy, but I sort of timed the turns and they seem to be running a few seconds slower. Could this be some of those additional AI routines you added?
The Great Apple said:
Nothing is fundamentally different. The game core is the same as it was for 0.285 - the only real thing that's changed is the way I store and handle data, which only should effect starting loading times... and that should be a very small difference.

Just a little more feedback - I am also seeing a significant slow down. 285 would go so fast through the early game that the graphics could not keep up... Now it seems much slower (admittedly I did not get out a stop watch), but it seemed 3-4 secs longer - maybe not a big deal (maybe it is though - how many turns is it for a game? 500? 3x500=1500/60=25 minutes?)


Also - I love that you use various robots from scifi for names - any chance that you could use a naming convention that would give us an indication of what generation it is (or do you do that already)? Maybe you can include a code for how many times it has won various victories in previous games too?

example -
R2D2-Gen2M-s10u2
Generation 2 Mutant (maybe B for a breeder?)
10 Space victories
2 UN victories

This mod makes me want to learn this programming language...
 
The Great Apple said:
Much easier said then done. You also are assuming that the human is better then the AI (which may not always be true). What may be possible is to run a script while the human is playing to analyse each choice and decide if the AI would have done it. If not, it would be possible to influence the AI to be more likely to do it. Unfortunetly this sort of thing is sorted on a case-by-case basis for each value, so would take me absolutely ages to write in (~1200 values in there).

That wasn't really where I was going (sorry it was late) - didnt choose good words... ;)

I guess what I was thinking was that if you score human fitness (besides being just cool) you could then use the fitness scores to automatically generate the 1200 values that create an AI.

As your AI gets more generations you will have a database of likely values for a particular fitness score (some values might have a wider range than others, but I hope I am being somewhat clearer now).

This might be where my confusion lay - Is this the fitness score generated or is it based on performance?


also -

"You also are assuming that the human is better then the AI"
Don't most people beat the AI on Noble? i can't remember the last time I lost a game when I was trying to win (sometimes I like to just hit return 50-100 times in a row to see if I can win after my initial build out-you might be surprised on how easy that is against Team Firaxis)

ps - keep up the great work - this mod could be going places


TheBoatman said:
I uploaded AIdata04, it run overnight so it is slightly more games than recommended (17-18 per AI). AI with catapult armies set to AI_AIR_DEFENSE was the craziest - I imagined catapults trying to shoot down a plane.
but catapults should be better at knocking down fighters than arrows, right? ;)
 
Craterus22 said:
Just a little more feedback - I am also seeing a significant slow down. 285 would go so fast through the early game that the graphics could not keep up... Now it seems much slower (admittedly I did not get out a stop watch), but it seemed 3-4 secs longer - maybe not a big deal (maybe it is though - how many turns is it for a game? 500? 3x500=1500/60=25 minutes?)
Right. I'm noticing the very early game that the early game is going slower than it was in .285. It was something like this in the pre-medieval eras:
Pre .285 = ~10sec/turn
.285 = ~7sec/turn
.29 = ~13sec/turn

Also, the new generation AIs seem better in general and many are quite agressive. There were maybe only one or two out of 18 this time setting stupid flags like work boats with AI_CITY_DEFENSE.
 
I like this idea. The weak AI has been the one thing holding back all civ games. I would glady go back to playing civ1 if someone developed a decent AI for it.

Can i ask what has come out of this so far? are you seeing the results of an improved AI? I will try to download your mod and run it a few times to contribute.

Keep up the good work.

-Apparat
 
Apparat said:
I like this idea. The weak AI has been the one thing holding back all civ games. I would glady go back to playing civ1 if someone developed a decent AI for it.

Can i ask what has come out of this so far? are you seeing the results of an improved AI? I will try to download your mod and run it a few times to contribute.

Keep up the good work.

-Apparat

We are (sorry make that TGA is ;) ) VERY early in the process - I *think* we are just starting to get into gen2 ai...

It is unknown how many generations it will take to see some real changes to AI - though my experience right now is that there are SOME really bad AI's in the bunch right now (which will be eliminated as number of games played are increased - so the more people we get to generate games the better)... hopefully we can generate some AI's that can win without the spacerace victory.
 
One game finished, next started. Everyone have contact with everyone else right from the start for some reason (still using 0.28.5)

I got stopping and starting again to work on a third attempt. Don't know what was different.
 
As promised - a report on the winners and losers. I've compiled this by taking the best AIs from generation 1, and comparing each variables average thorught the AIs with the default AI. There is a chance that it just could be random noise.

Good AIs had these main changes:

City found values: Cities on coastal land on continents/islands with no other cities of that player are favoured more (value of 462 from 400).

Technology: Map trading technology favoured more if on an island by yourself (400 - 466).

Technology: Tech to give defensive pack favoured more (400 - 462).

Technology: Tech which gives route when no techs with routes have been researched yet favoured more (The Wheel) (800 - 923)

Technology: Tech which allows production of agressive units if the AI is planning a war favoured more (800 - 924)

Technology: Tech which allows production of counter attack units if the AI is planning a war favoured more (600 - 692)

Technology: Tech which allows production of CITY_SPECIAL unit AIs if the AI is planning a war favoured more (800- 925)

Technology: Tech which allows production of air attack unit AIs if the AI is planning a war favoured more (200 - 232)

Unit Value: Value determining how good an air attack unit is based on it's range increased (200 - 233)

Unit movement priotrity: Priority of moving onto goody huts increased (100000 - 115195)

Bad AIs had these main changes:

None spotted by my filter. I tried decreasing the accuracy, but then there were hundreds of results. Nothing conclusive.


You'll notice that all the good AI things went up from default rather then down. This was due to a glitch in my filter script while mutating the first set of AIs. Was fixed for the second set.
 
Ket said:
In theory, if we are running an AI in a real game would it be able to adapt to SDK mod changes, for example new tags
(Dales Combat, Roger's Flying, Impaler's Work) or is this something you would have to patch in, those new tags.

I assume it would take some genetic passes for it to weed out what it cant do with them. If it was able to recognize this.
If the mods had separate AI decision algorithms then a few alterations would have to be made to the script to incorperate them, if not, then it should work fine. It would need a few runs (when I say a few, I really have no idea how many a few is - maybe 10 at a very rough guess) to optimise to the mod, but I would expect it to be pretty good without the further optimisations.

Ket said:
Secondly just for benchmarking. Do you have a theoretical Fitness Level for Firaxis's AI?
Nok. Taking the results in I've seen average scores for sets vary from ~5000 to ~2000. It really depends heavily on the map type, size, and speed. When I analyse the datasets I normalize the results from each dataset so that they all have the same average fitness.
The Team Firaxis AI that has gone out with the 2nd generation has all the games played with it combined in, so you can see an average there (IIRC it's ~2900).
 
snarko said:
One game finished, next started. Everyone have contact with everyone else right from the start for some reason (still using 0.28.5)
I thought I'd ironed that out...

Were any unexpected parts of the map exposed?
 
The Great Apple said:
I thought I'd ironed that out...

Were any unexpected parts of the map exposed?

No not that I could see. But I didn't look all that much.
 
The Great Apple said:
As promised - a report on the winners and losers. I've compiled this by taking the best AIs from generation 1, and comparing each variables average thorught the AIs with the default AI. There is a chance that it just could be random noise.

Good AIs had these main changes:
...
Thanks for the report. Those mostly seem reasonable. I am surprised there are not more boosts to agressiveness. In my games, some of the AIs turned out to be quite agressive and were successful at taking over large parts of the world, but I may be the exception due to the high number of civs. I guess there could also be an eqaul number of agressive civs who started the wrong war at the wrong time.

What does the "City Found Values" mean? Am I interpreting it right to mean the AIs are more likely to found "colonies" on the coasts of far off islands and continents?

Also, any clue what an AI_SPECIAL unit is?
 
Back
Top Bottom