debugging and ranked sessions

now that the macro is mostly in place and now that we already have a decent bunch of basic strategies and counters implemented, it is time for some debugging. basic spawn and swamp still.

since the last post there have been roughly 50 commits (of various sizes and impact), around 200 ranked games and countless test games.

while i was noticing some small and some large flaws in the micro logic, i was focussed on not implementing new ideas, but rather fixing the macro stuff.

so what happened?

better creep detection

a set of bugs were related to the whole counter spawning idea. since detection of the hostile strategy is crucial, it helped a lot to fix some of the errors. i added a bunch more types of creeps and their respective counters, and also split up how the types are defined. instead of just having a CreepType enum, i now keep that info on the CreepType and the respective speed of the creep. speed is defined as ratio of move and other parts (as in the theoretical movement speed on plains) for a given creep, so a [ATTACK,MOVE] creep has a speed value of 1, a [ATTACK, MOVE, MOVE, MOVE, MOVE, MOVE] 0.2.

this allows plays to make better decisions for body generation, since we now can react to actual values instead of just defining “fast” and “slow” creeps.

starting the civilian creep code refactoring

i moved a bunch of code for civilian creeps around. i am still not entirely sure how to best organize these civilian creeps (plays are really designed around military only), but this clean up was overdue and while it did not help in game one bit, it helped keeping the code base clean.

better body generator

i adjusted the body generator a bit. it now deals better with things like bodypart ratios and speed, since i can now pass values for those ratios instead of passing patterns that get repeated x times. basically, making life a bit easier.

adjusting container strategy

i made the bot go for the middle containers much less, saving the energy for the workers. instead of just always spawning mid workers that can potentially get picked off easily, the bot tries to be smarter about judging whether it actually has enough control over the middle before spawning them.

dealing with bunkers / forts

bunker detection was adjusted, dealing with bunkers got better. i adjusted targeting to properly pick a wall or rampart to destroy to get to the opponents spawn. there was also an edge case where my creeps refused to hit ramparts that did not cover anything, so the bot would get stuck on the way to a spawn when only ramparts were built.

defense fixes

helping the other guy win turns out copy pasting code sometimes results in bugs, who knew! in this picture you can see my creeps helping the opponent kill my spawn. why are they doing this? well, squads have a given target position. for defense squads that target position is my own spawn. then, when unsuccessfully trying to find a target to hit creeps use the target position not just for movement but also check whether the target position tile has something to hit on it. thats great, but it is also missing something: a check whether whatever is on the target tile is actually hostile…

another big bug in my defense squad code was a lack of focus. even with hostiles basically hitting my spawn the members of the defense squad could get stuck trying to chase some other thing in the middle instead of getting back to defend…

“play 10 rating games”

after all the fixing was done i started hitting the play button a bunch. seems like i stabilized around 2000 rating with these few fixes, an easy 200+ rating boost.

next up i definitely need to rework micro (moving down the list from the last post). there is a lot of potential there, now that the basic macro stuff is mostly in place.

stats

  • commit: 27df4260939b03f3e7a121c7f4114e54705353d5
  • ctf: rank #9, v30
  • sas: rank #42, v51