Thanks for the feedback :3
I remember that Advance Wars and Fire Emblem have more of a bold font. Have you tried that and see how it fits in?
Not yet, but it's something I'll probably experiment with at some point.
The idea for genetic AI here sounds interesting, but I wonder if you're really using the right tool for the right job.
It might not be.
Compared to other optimisation algorithms they are also horrifically inefficient.
Agreed.
The clear benefit I would have thought you could get from using them in game AI would be to give the AI the appearance of learning over time and adapting to the player's tactics. But it seems like you're not using them in this way - you're treating each unit's move as a separate optimisation problem and running the GA only on that without reference to anything else, correct?
No, and I believe that I'm doing what you suggest. Maybe I should have explained better how things are currently working.
Here's a couple of diagrams that go into more technical detail about the AI:
The AI has a set of variables that I'm calling AI Parameters:
Each AI Parameter has a corresponding Fitness Function, these basically attribute a score that ranges from 0 to 1 to each move that a program creates:
The AI Parameters combined with the Fitness Functions help classify a given program:
This ends up shapping behaviour without telling the unit what to do exactly. A bigger percentage attributed to the Recon parameters, for instance, will have the unit roaming about the terrain trying to uncover foggy tiles. While having more in the Attack will encourage agressive behaviours (more proximity to enemy tiles, more attacks, etc.)
Every time the CPU starts a turn it defines how much of a percentage it is going to attribute to each parameter:
This is done by polling past records of turns and selecting the turns with the higher fitness for a given GameState. By GameState I mean how the CPU is perceiving the game in a current turn: How much units do the CPU has? How much enemy units do I see? How many tiles are uncovered? etc.
After I get a sample of turns filtered by the GameState, I use the AI Parameters for the ones with the best fitness and randomize them a little. The ammount of variance I use when randomizing the Parameters is a function of how many records I have on my database. I'm doing this because I believe that I can have a bigger confidence in the results as the number of recordings increase.
Generating the Unit movement is standard GA practice:
Here, too, I have a datatable with programs used in past turns. These are used to get some inter-generational evolution to complement the regular intra-generational one provided by a GA cycle. I filter the datatable by the GameState and randomly pick a program with the ones with the bigger average fitness having a bigger chance to be selected.
After this particular program is evaluated I record its performance back to the datatable.
The best program to come out from the GA cycle is recorded on the datatable as well.
After the turn is done I record the performance of every unit averaging the fitness by its UnitType:
The process is repeated in the next turn.
There are still improvements to be made. For example, I'm thinking about slashing the past performance of units when the CPU loses a structure or the entire game, so that whatever behaviour was incentived in the past turns will be less so in future games.
Despite being aware of its limitations I still consider this to be a good framework.
- The dirt/grass/water tiles a very "grainy" when compared
to AW style. They could be more plain and have less contrast
so that the units and buildings stand out more.
Could you provide me with an edit so I can see what you mean? I used unsaturated colours on the tiles and black outlining on the units to make them stand out.
- I like these little tanks and planes, but since every army
uses their own gfx for those, not only differently coloured
ones, why not make them look more like what they're supposed
to represent?
Small tile size and not very good pixelling skills make that a bit hard, I'm affraid.
I guess the triple-propeller airplane is the
Ju 52? What is the one with two engines? If it's He 111 then
glass front is in order. Tanks and armored cars look nothing
like the usual german vehicles and the soldiers could use
proper german helmets at the expense of smaller body to fit
into their tile size.
Here's the two planes alongside reference pics I used while making them:
Sorry for the long post and thanks again for the feedback :3