Genetic AI Project

Man, got a suggestion for you, why in place of the game runs automaticly from the end of 1 to the begining of other, wich is causing a lot of bizarre bugs, it just ask us in the end(or begining) what we want to do? Like.."How much games in a row you want to play?" Then you can choose yourself from 1 till 25(its all no?), then its good for who doesnt have the time to let all 25 games playing directly and it would be good that would reduce that bizarre bugs of flags and such if you putted only like 2 games in a row or only 1 by 1 :P

And other thing, the progran that you will use to compare the best AIs, would he ignore rank 0?? Because lol, all the CIVs that was participateing o the game that i stopped in the middle got rank 0 in that game, so if your program dont ignore it, it can be a problem and would make wrong results..

And so then, I can download and install normally the patch .26 and use my old AI data no? good ^^
 
I have installed v0.26. I have AIData.txt in My Games/Civ4/Mods/GeneticAI folder, but DoM screen shows AILoadError.

EDIT: thanks for the fix
 
TheBoatman said:
I have installed v0.26. I have AIData.txt in My Games/Civ4/Mods/GeneticAI folder, but DoM screen shows AILoadError.
That's my fault (what do you expect). It's also something I can fix. Replace GeneticAI/Assets/Python/GeneticAIStorage.py with the file inside the attached zip.

I'll take a look at the barbarian thing.
 

Attachments

Arlborn said:
And other thing, the progran that you will use to compare the best AIs, would he ignore rank 0?? Because lol, all the CIVs that was participateing o the game that i stopped in the middle got rank 0 in that game, so if your program dont ignore it, it can be a problem and would make wrong results..
Rank 0 means the player has won. The data won't be saved unless there is a winner, so stopping half way through should be alright... as long as nobody won. Even then, only one civ should be rank 0.
Arlborn said:
And so then, I can download and install normally the patch .26 and use my old AI data no? good ^^
Yes.
 
The Great Apple said:
Rank 0 means the player has won. The data won't be saved unless there is a winner, so stopping half way through should be alright... as long as nobody won. Even then, only one civ should be rank 0.
Yes.

Ah ok...And what rank 1 means then? 0.o

And good to know cuz the rank 0 I was mostly takeing off of the games in begining LOL
 
Arlborn said:
Ah ok...And what rank 1 means then? 0.o

And good to know cuz the rank 0 I was mostly takeing off of the games in begining LOL
It starts at 0. It's slightly crazy. I'll update the display to be more intuative.

Patch .27 released. This should fix the bug with the players not being at war with the barbs. It also has a new data loading system. In future the AIData.txt files will be AIDataxx.txt (ie. AIData16.txt). This should help keep them seperate better. Old data files will still load fine.

First person to spot something wrong with this gets a bunny.
 
Yet another question, this time concerning difficulty levels: currently, the GeneticAI games running in the background are on monarch level. This puts the AI that takes over for the player at a starting and production disadvantage. Will this be considered in the evalution?

Also, I think that the average score is a dangerous indicator for fitness. A below-average AI that plays against 5 incompetent ones will get a higher score than an above-average ones that plays against 5 average ones. At the moment, my 'Team Firaxis' AI has a higher fitness than your Aaron the AI.
 
Teg_Navanis said:
Yet another question, this time concerning difficulty levels: currently, the GeneticAI games running in the background are on monarch level. This puts the AI that takes over for the player at a starting and production disadvantage. Will this be considered in the evalution?
Probably a good idea to put it on noble. I'll force it in the next version. (In other words, no, I hadn't considered it - should have too much of an effect on the overall dataset).
Teg_Navanis said:
Also, I think that the average score is a dangerous indicator for fitness. A below-average AI that plays against 5 incompetent ones will get a higher score than an above-average ones that plays against 5 average ones. At the moment, my 'Team Firaxis' AI has a higher fitness than your Aaron the AI.
That's why each AI plays 8 times against a random set of opponents. This should help keep it sane. Also, the filter program normalizes the scores of the datasets so that all the datasets have the same average fitness over their 20 AIs. As certain aspects, such as the mapsize, can have a large influence on fitness this should give a much fairer relative fitness.

Aaron has 8 games under his belt, so his fitness is likely to be quite accurate - I bet Firaxis just got lucky ;)
 
I've forbidden autosaving, lowered the graphics and the autoplay works fine now. I 'solved' the barbarian problem by playing few more civs than recommended for the maptype.

Just out of curiosity:
Which aspects of AI can the mutations affect?
Will they ever for long time goals?
Like "let's go for conquest this game" or "let's make CS slingshot"?
Or should AI find out that it is advantageous to discover BW quickly, build barracks, build axemen while chopping and whipping and stop being peaceful (in separate mutations)?
Do you preset the new generations with a certain aim?
(hope this is not a business secret)
 
TheBoatman said:
Just out of curiosity:
Which aspects of AI can the mutations affect?
Pretty much everything. The value of a unit, the amount of defenders to build, the relative values of commerce, food and hammers in different situations... mostly how much it values different things.

I've started to implement some alternative algorithms which will change the logic of how the AI does things and there will be 4 or 5 of them when I start doing 2nd generation AIs.

TheBoatman said:
Will they ever for long time goals?
Like "let's go for conquest this game" or "let's make CS slingshot"?
Not directly at the moment. However, it is plausable that one of them might stumble upon it by accident.
TheBoatman said:
Or should AI find out that it is advantageous to discover BW quickly, build barracks, build axemen while chopping and whipping and stop being peaceful (in separate mutations)?
This is very possible.
TheBoatman said:
Do you preset the new generations with a certain aim?
No. There is some code to keep AIs which are the best at achieving (or nearly achieving) certain victory types alive. Hopefully this should have the result of breeding the AIs who are able to get different forms of victory.
 
TheBoatman said:
Just out of curiosity:
Which aspects of AI can the mutations affect?
Will they ever for long time goals?
Like "let's go for conquest this game" or "let's make CS slingshot"?
Or should AI find out that it is advantageous to discover BW quickly, build barracks, build axemen while chopping and whipping and stop being peaceful (in separate mutations)?
Do you preset the new generations with a certain aim?
(hope this is not a business secret)

If it's based on a true genetic model (which as far as I can see it is), the mutations at the lowest possible level - in this case the weightings used for various decisions and the values placed on certain types of resource.

If CS slingshots and BW rushes are indeed the ideal approach, then combinations of values that lead toward that will tend to have better results. These successful AI's will then be used to make the next generation and will be even more likely to use one of the "ideal" strategies. After a few generations, you may well see the AI tending to slingshot to Civil Service (though I'm not sure that the values mutated can actually increase the chances of building the Oracle? The value for that is in XML outside the "strictly-AI" code)
 
TheBoatman said:
I've forbidden autosaving, lowered the graphics and the autoplay works fine now. I 'solved' the barbarian problem by playing few more civs than recommended for the maptype.

Just out of curiosity:
Which aspects of AI can the mutations affect?
Will they ever for long time goals?
Like "let's go for conquest this game" or "let's make CS slingshot"?
Or should AI find out that it is advantageous to discover BW quickly, build barracks, build axemen while chopping and whipping and stop being peaceful (in separate mutations)?
Do you preset the new generations with a certain aim?
(hope this is not a business secret)

These are some good questions - but I suspect that since Firaxis chose not to program in goal selection for AI that it would be difficult to do as an addon (which was why I was hoping we could train AI for a particular set of traits - a warmongering/unit producing ai for a militant civ, a finance building ai for a finance civ, etc.)

ps - the counters for the datasets are really messed up - maybe you should consider making a list totalling how many responses you have recieved for each data set? That way people can look at the list and work on the ones that have the least amount of data received? Will try new version sometime before noon.
 
Vehem said:
(though I'm not sure that the values mutated can actually increase the chances of building the Oracle? The value for that is in XML outside the "strictly-AI" code)
It can. When deciding upon the best building it takes the stats from the building, multiplies each by factor, and adds up all the results to find the building value. In this case the stat would be "Does it give a free tech", and the factor it is multiplied is one of the traits being evolved.
 
The Great Apple said:
No. There is some code to keep AIs which are the best at achieving (or nearly achieving) certain victory types alive. Hopefully this should have the result of breeding the AIs who are able to get different forms of victory.
I'm quite afraid that it's impossible to win peacefully when there is a really good warmonger on the map. (experience from multiplayer) But there may be a tactic that humans haven't found out yet.
 
The AI still uses Firaxis code structure, what values is sums up and how it sums them dont change, only the weights. Likewise the AI dosn't have any kind of "master plan" such as a human might have. Its thinking is totaly compartmentalized, each City each unit independently desides what to do, though it might draw upon empire wide data to do so. I feel that this is the ultimate limiting factor on the AI, its inability to truely make a plan and then have that plan influence every subsequent desision made. To implement a planning AI would require a near total re-write of all the AI code which is beyond the scope of this mod, someday such a re-write might be possible at which point genetic learning could also improve its performace.
 
TheBoatman said:
I'm quite afraid that it's impossible to win peacefully when there is a really good warmonger on the map. (experience from multiplayer) But there may be a tactic that humans haven't found out yet.
I would imagine it depends on the map size and type. if you play continents with one peaceful tech-trading set of Civs, and one warlike set of Civs the peaceful set are likely going to win. They'll just out-tech the others.

IIRC tech-trading is usually disabled in mutliplayer. This favours warlike Civs greatly.
 
There seems to be a problem with the UN. I don't have a screen, but I stopped the game once during a UN vote and the window popped up. It said everyone had abstained in the vote for Sec. General and they all had zero votes available.
 
suspendinlight said:
There seems to be a problem with the UN. I don't have a screen, but I stopped the game once during a UN vote and the window popped up. It said everyone had abstained in the vote for Sec. General and they all had zero votes available.
Have a bunny!

Is this with the latest version?
 
TheBoatman said:
Or should AI find out that it is advantageous to discover BW quickly, build barracks, build axemen while chopping and whipping and stop being peaceful (in separate mutations)?
The Great Apple said:
This is very possible.
Are you saying you think there are values of the parameters you're learning that would cause effective early Axeman rushes? Roughly what values of what parameters?
 
Jet said:
Are you saying you think there are values of the parameters you're learning that would cause effective early Axeman rushes? Roughly what values of what parameters?
I'd guess the parameters that control how many CITY_ATTACK AIs a player builds in relation to other AIs, how likely a player is to go for bronze working (lots of factors there), and how likely for the AI to declare war early. They'd all have to go up - I don't know in what ratios, but if one of these AIs hits about the right ratio and performs one successfully it should score highly, and new AIs should breed off it to perfect the tactic.

Of course, there would then probably be a strain of AIs that breeds to defend against an early axeman rush, such a rush may become no longer viable, and the axman rush strain may die out.... and then the defensive strain dies and the axeman rush strain comes back up again. This is alot of generations in though.
 
Back
Top Bottom