Genetic AI Project

The Great Apple said:
Attached is a collection of the best 18 AIs from generation 3. These aren't for testing, but if anybody wants to play some single player games against different AIs these are the ones to go for.

Thanks alot! I play quick games which can usually be done in a few hours. Just to confirm - we should not bother sending in data for performance against human data?


ps - low priority- perhaps bestai name could equal "no pop-up to send in data" in geneticai mod?
 
I've got a .30 set of data that has been going for a few hours. Should I switch to .31 or continue this?
 
Quitch said:
How do you disable autosaving? I can't find the option.

I assume "running in the background" means minimising it?

you can also press control-A (or maybe alt-A, i can't remember.)
 
Can we just extract a new version of the mod over the old or should we delete the existing one first?

Please find my first (0.3) results attached. That was quick, I'll get a "big" file this time :)

It doesn't want to upload the DeadAI file, but I suppose that's because it's empty.

I've grabbed data set 79.
 

Attachments

Ta. If it's empty don't worry about it.

All new versions should work with all old datasets. Extracting it over the old should work fine, though deleting will be safest.

EDIT: :eek:

T-800-3136 - Score: 5004

EDIT 2: Hmm. A closer look shows that it scored 28544 on one duel map. I would suggest running larger map sizes for more representitive results - duel tends to skew quite violently. If you do want to play duel I suggest you keep the same settings for the whole set, and it'll then get normalized when going through the filter.
 
The Great Apple said:
Attached is a collection of the best 18 AIs from generation 3. These aren't for testing, but if anybody wants to play some single player games against different AIs these are the ones to go for. You still can't load/save, so you'll just have to minimize when you stop playing, or play in one sitting. Have fun!

Oh. You'll have to rename it AIData.txt for it to work. Apart from that use as normal. I should have update the code to be able to find it, but I didn't... Next time!

Worked fine regarding play - a few errors though.

These errors occured on my radearth map (partially reproduced it on a custom map)... ai was assigned as expected - played with no problems until end game.

at end game the play function for the replay map would not work
the graph top5 cites and other screens did not have any data (all worked in game though)
hall of fame assigned a near zero score for a different civ (not the one I played the game with - played inca - score was assigned to india)

could these errors be associated with the automation code (even thought it was not on)?

EDIT - custom map worked when there was a player loss before time expired
EDIT2 - second time with custom map auto restarted after time victory by ai without showing victory screens



comment on AI - they all seemed to be a little too eager to trade tech (even had someone GIVE me tech when I was in third place).
EDIT - more comments on AI behavior
cities built within three squares (good-sample pic was of score leader)
multiple stack (good) attacks
correct use of cats
multiple city attack

note: I noticed only near religious spread (not spreading to a city across the planet) was that a mod or perhaps just limited by my current trade?

note2: losing replay attached - lost two cities after initiating war with a massive stack
 

Attachments

  • genai sample.JPG
    genai sample.JPG
    174 KB · Views: 145
  • Craterus_AD-1465_1.zip
    Craterus_AD-1465_1.zip
    91.3 KB · Views: 74
The Great Apple said:
Also, while I was about it, I spotted (and fixed) an AI cheat. When checking the danger range the AI would check for units in plots that it couldn't see. This has been fixed both in the original AI code and the altered danger range code.

I would recommend you leave in this AI cheat.

Removing it will cause the AI to play worse.

A human player can look into fog and make a reasonable guess as to whether there might be units there, using all sorts of meta information (barbarian history, war status, what cities are in that direction, etc). The AI just cannot do that (at least without a major revamp).

This 'fix' will make all AIs much more vulnerable to attacks out of the fog.

Purists may not like that the AI cheats in order to play well, but the reality is that little cheats like this (looking only 2 tiles into fog for safety) cause the computer AI to seem to be a lot smarter than it really is, while if balanced correctly, do not give it too much of an unfair advantage.

Sure, if it was looking 50 tiles, it would be a bad thing, but 2 tiles, that seems like a fair compromise.

-Iustus
 
On the general methodology, I would suggest that you want to see how a particular AI plays against itself, not only against other AIs.

So I would suggest the following changes:

  1. In each game, represent each AI twice
  2. Fill the last 0-3 slots with Firaxis AI.
    • zero in the case of a game with 2 civs
    • one in the case of a game with 3 civs
    • two Firaxis AIs if there are an even number of civs
    • three Firaxis AIs if there are an odd number of civs

The biggest change of course would be the ability to handle more than one civ using the same AI, the rest is pretty simple.

You already mentioned something about ensuring that the Firaxis AI was always represented, I am not sure if you got this in yet, but thats basically what #2 is above (also filling in the odd spot with Firaxis AI).

Another way to go would be to have all AIs be the Firaxis AI except for one new AI you were testing. This might give some more productive early results. Then you could start having the later generation AIs face each other, once you were outperforming the Firaxis AI. Or some middle ground where half the AIs are the default Firaxis AI.

Of course, the end goal is to outperform the Firaxis AI vs a human player, but as you mention, that is a lot harder to test.

-Iustus
 
I apologise for the multiple posts in a row, each is a completely different subject.

Since you are already changing this code, I thought you might want to pick up this fix to AI_bestTech

There is a simple copy and paste bug which causes the AI to miscalculate the value of various techs when deciding what tech to research next.

Assuming these constants are ones that you change in your AI datasets, you probably want to pick up the fix.

-Iustus
 
Iustus said:
On the general methodology, I would suggest that you want to see how a particular AI plays against itself, not only against other AIs.

So I would suggest the following changes:

  1. In each game, represent each AI twice
  2. Fill the last 0-3 slots with Firaxis AI.
    • zero in the case of a game with 2 civs
    • one in the case of a game with 3 civs
    • two Firaxis AIs if there are an even number of civs
    • three Firaxis AIs if there are an odd number of civs

The biggest change of course would be the ability to handle more than one civ using the same AI, the rest is pretty simple.

You already mentioned something about ensuring that the Firaxis AI was always represented, I am not sure if you got this in yet, but thats basically what #2 is above (also filling in the odd spot with Firaxis AI).
The Firaxis AI is represented in each dataset, but not in each match. It could be put in each match, but I'm not sure it would improve the clarity of the data any.

Also, I'm not quite sure how finding out how an AI plays against itself would help - you'd surely just end up with results which would show that an AI was as good as itself...
Iustus said:
Another way to go would be to have all AIs be the Firaxis AI except for one new AI you were testing. This might give some more productive early results. Then you could start having the later generation AIs face each other, once you were outperforming the Firaxis AI. Or some middle ground where half the AIs are the default Firaxis AI.
One of the big troubles with this is the amount of extra time it would take. If every player except one was a default AI then, on a standard map, getting data for each individual AI would take 7 times longer, which is a rather big jump for what I'm not sure would be much clearer results. I might tweak it so that the Firaxis AI plays in more games, but I'm not convinced it'll help much.


Thanks for the fix BTW - I'll stick it in the next version for both the vanilla and new AIs.
 
Craterus22 said:
Worked fine regarding play - a few errors though.

These errors occured on my radearth map (will try to reproduce it on a custom map note2: tomorrow)... ai was assigned as expected - played with no problems until end game.

at end game the play function for the replay map would not work
the graph top5 cites and other screens did not have any data (all worked in game though)
hall of fame assigned a near zero score for a different civ (not the one I played the game with - played inca - score was assigned to india)

could these errors be associated with the automation code (even thought it was not on)?

EDIT - custom map works
Yeah, I think it might be something to do with the automation code. I had it set to restart the game upon victory even if autoplay was off (for testing). I'll disable that.


Craterus22 said:
comment on AI - they all seemed to be a little too eager to trade tech (even had someone GIVE me tech when I was in third place).
EDIT - more comments on AI behavior
cities built within three squares (good-sample pic was of score leader)
multiple stack (good) attacks
correct use of cats
multiple city attack
Well that's good. City packing has probably got something to do with how score is determined. Lots of packed cities will give you a high population as well as maximising land area... which will beef up the score. It should also cripple the AI economy, but on a packed map this would have less of an effect as there aren't many cities anyway.

The best solution I can think of at the moment is to tweak the way that fitness is calculated to be less dependant on population (or more dependant on techs maybe). I'm not sure it's really something that needs fixing though - if the AI economy is going to go down the pan then they'll lose out in the long run.
Craterus22 said:
note: I noticed only near religious spread (not spreading to a city across the planet) was that a mod or perhaps just limited by my current trade?
Religion spread hasn't been changed. Must have been at your end.
 
I have a suggestion for how to figure out which characteristics help the AI most, so you can try to create new ones with better combos, rather than completely random. You need some data analysis - run some regressions of scores on various attributes, see which attributes predict scores best. I would theoretically volunteer to do this if you're interested....
 
Im sorry if this bug has been posted earlier in the thread though i dont have the time for the timebeing to read through it all.

http://img119.imageshack.us/img119/943/geneticaierrorfa8.jpg

This bug seam to be happening fairly often for me so far i have only complted one game out of 5 the rest 4 have stoped with this crash after you press ok you exit the program and find you self back stright to windows. It seams quite random in nature since it happens on diffrent turns as well usualy earlier then this in the game. Im qlue less.

Regards
 
The Great Apple said:
Well that's good. City packing has probably got something to do with how score is determined. Lots of packed cities will give you a high population as well as maximising land area... which will beef up the score. It should also cripple the AI economy, but on a packed map this would have less of an effect as there aren't many cities anyway.

The best solution I can think of at the moment is to tweak the way that fitness is calculated to be less dependant on population (or more dependant on techs maybe). I'm not sure it's really something that needs fixing though - if the AI economy is going to go down the pan then they'll lose out in the long run.

Trust me - i wasn't complaining. As long as you also reward (and punish) financial performance - it should work out. Also, I typically put 10ai on a small map and 6ai on a tiny map, so it generally is pretty tight (the pic above could have been the result of being hemmed in by other civs). It also allows quick military build-ups if the ai also will build in tight areas occasionally.

Also - I don't want it to impact your other work, but I hope that you are able to squeeze in some playabilty fixes (non-auto restart) and eventually the save issue. It was really fun to play against the ai (even along with Team Firaxis). Small or Tiny Quick games play quick.


The Firaxis AI is represented in each dataset, but not in each match. It could be put in each match, but I'm not sure it would improve the clarity of the data any.

Also, I'm not quite sure how finding out how an AI plays against itself would help - you'd surely just end up with results which would show that an AI was as good as itself...

One of the big troubles with this is the amount of extra time it would take. If every player except one was a default AI then, on a standard map, getting data for each individual AI would take 7 times longer, which is a rather big jump for what I'm not sure would be much clearer results. I might tweak it so that the Firaxis AI plays in more games, but I'm not convinced it'll help much.
Actually this is something like I was going to suggest earlier (I was manually testing allgenai with same leader in my early tests), but i agree that it would add many iterations to your testing. Maybe that kind of test (mult firaxis vs genai) could be conducted on the bestai file? That way you could have two stages of testing for each generation (first stage - best of the genai are determined, second stage - best genai performer vs team firaxis). And since the second stage would only be a single file - you should get many more copies of the information since your test team will be focusing on it.

But in the end it may only be a waste of time if you are also not testing all civ leaders as well... especially since that information won't really affect your breeding process (all the genai's in the best file have allready been determined successful enough to move forward). You got to work with what you have - and I think with the limited data cycles you have, it is probably more worthwhile to just let the genai to slug it out without team firaxis at all. It is broad strokes time in the data process - I think it may be worthwhile to start worrying about outperforming TF after a few(?) more generations.

I do think however that each ai should get time at each civ leader multiple times though (genaiX vs genaiX with different leaders on mirrored start maps)... hopefully as more and more data is collected - the data will show some correlation down the road.

Keep up the good work!
 
Here are some testing results. I did noble, normal time, continents, standard and 7 people, except a few times I did huge with 12. This was with version .30 and I was almost done when .31 came out so I decided not to switch.
 

Attachments

I nabbed dataset 81 and am busy running it on my system at home.

Standard world size.
Tilted axis map with random land masses.
No technology trading.
Raging barbarians.
Both Epic and Marathon modes.

It has been running all night and seems to have a number of results. I will let it run today while I am at work and then post the result either tonight or tomorrow AM.

One AI had only built one city by 1500 AD. Very strange.

Conlan
 
Wazdix said:
Im sorry if this bug has been posted earlier in the thread though i dont have the time for the timebeing to read through it all.

http://img119.imageshack.us/img119/943/geneticaierrorfa8.jpg
People have mentioned a similar error, but I have no idea what's causing it. I take it you don't get this error when playing Civ normally?

Until I can reproduce it there is little I can do unfortunetly.
 
Back
Top Bottom