Win rate

I decided to make a smaller test to see how much Edai actually won. I ran 30 consecutive matches, and Edai only lost 5 of them, resulting in a 83.3% win rate.
I started measuring when the rules had been purged, and I decided to do 30 matches so that it would be purged once more.
The first 15 matches resulted in 13 wins and 2 losses.
The second 15 resulted in 12 wins and 3 losses.

I will also make some tests after I have scrambled the rules, to see how fast it can find something useful again.

Crunch Time

The last few days before milestone 3.
I’m currently mostly debugging and balancing it all now, there are of course some features I wanted to implement, but didn’t find time to.

Now a score screen pops up when either AI has won, a victory screen for when Edai wins, and a defeat screen when Edai lose. This helps with Match time scoring, and I have also implemented a few different mathematical algorithms that calculates score when Edai wins fast (higher score, lower if it takes long), and loses slowly (if Edai managed to survive for long, a higher score is rewarded for used rules, and punished if it loses fast).

The rulebook is now purged every 15 matches (resets the weights of all rules to 0), to encourage other rules to surface, as well as possibly increase the rate at which the AI changes tactics if the old ones are not working very well.

I have also tried to come up with something that I call a “pessimistic function”, a function that analyzes how bad something works, and only punishes. But I haven’t been able to figure one out. I wanted one because pretty much all the other functions are quite rewarding, and I wanted something that could punish a rule quite harshly if it did bad.

Last, but not least, Edai is winning quite a lot now, I don’t have any actual numbers, but it feels like it’s around 50% now. Compared to before when it only won like 5 games in about 50 or so.

Progress update

I have implemented some more analyzing functions to determine how good Edai is doing. I also realized yesterday that time also is a factor that can determine if the rule composition is good or not. The AI does not necessarily need to win if it is playing against a human player. As long as it is a pretty long match, because that will most likely result in a fun and interesting match, that was kind of hard for the player.

I think I also managed to make Edai defend a bit better, as you could see in the first video I uploaded (this one), it did not help out with units stationed in the base even though the base was being attacked. I noticed that the default AI did a better job at that, so i looked through its script, and the only difference I really found was that the first thing it did was to set a few units (2 assault units) as defenders. That seemed to make all units that wasn’t currently attacking, help out if the base was attacked. So I did that myself, I set one unit of the first attacking units in the script to defenders. It seems to a better job at defending now. Although it does not work perfectly all the time…

Continue reading

Progress report and some project changes

I have implemented a simple match analyzer that just analyzes how many kills and deaths each unit got during the match, and then uses that to re-weight the rule related to that unit. I have also been thinking about how I should expand the analyzation module by adding more analyzation methods. A few came to my mind today and I will start implementing one of them tomorrow. I want to make the analyzation/weighting module as reactive as possible, so that it doesn’t take to long for the AI to change it’s tactics if the player start doing different things than he/she used to.

On another note, Edai has managed to win three matches against the Default AI, though by chance, since the analyzation/weighting module hadn’t been implemented yet. But it showed me that my LUA generator was able to generate a script that could beat the Default AI.

Regarding the “project changes”, I’m thinking about removing the part where Edai is able to learn new tactics from it’s opponent. This because I feel it will not contribute with anything in this game. Though I may just implement a simpler tactics analyzer that generates a new rule, just for the sake of doing it… Even though it will not noticeably change anything in the game.

Analyzation Module

I’ve started with the analyzation module since my last post. I’ve not gotten much done in the past week since I have been busy with other school related things. But I have managed to figure out how I should analyze the AI’s performance in a game. At least on a simpler level. I still have to / want to figure out a few more ways to analyze how it is performing. It will, at least to begin with, analyze a unittype’s kills and deaths, to determine how effective it is. I will most likely also ad in something that keeps track of which unit is good against what, and from that help determine which units that should be chosen for the script.

I have also found some smaller bugs in my LUA generation script, one where turrets were put in a force (attacking or defending), this didn’t affect anything as far as I know, but I found it illogical. I also found a bug where the second attacking force wasn’t ordered to attack in the unit production loop in the script.

 

Milestone 2

Today I’ve reached milestone 2 of my project. I have uploaded the source code of the project up until now, along with a presentation, a system design and a video. It can all be found here.

I will probably upload all my future videos on YouTube or something equivalent and then embed it here, since the current solution isn’t working very well…

Testvideo and LUA generation

Decided I wanted to try and upload a video for the blog, it’s just a minute long video showing my modified AI in blue and the default AI in red. I’ve also sped up the game play a bit there, so it wont take so long to see the results of my changes.
I will upload more videos later as well. I used GLC, since I’m working in Linux, to capture the video, and that is partially the reason I wanted to try to upload a video, just to see if there for some reason would be some sort of problem with the captured and re encoded video on the blog.

 

I think I’m done with the LUA generation, it’ll need some balancing and I’m sure I will change it a few times later. But it is now working pretty much as I originally intended, and I will now start working on the weighing system and the analyzation system (the one that only will analyze how each unit performs).

EDIT: Since some seem to have trouble watching the video, I will temporarily provide a direct link to the video as well. I will look in to this though… Link here.