putting the new framework to the test

my next idea was to intensively work on terrain analysis. i was looking at a whole bunch of papers, testing various algorithms. how do you integrate swamps the best into your analysis? how much influence should the tiny obstacles that sometimes appear on maps have on region generation? how unreadable can all these researchers make their code? 😅

i decided to put all that off for now! it was time to just hit ranked a bit and to check out how well the framework works in practice.

preparations

first, some prep work was needed. group detection for hostiles needed visuals again, i also plugged the squad/cluster system into my visuals.

basic visuals at work

some of the colors still might need revising for a better overview, for example the blue lines indicate both location targets for military creeps but also objectives for civilians. but it is good enough at giving a decent overview of what the bot is thinking at a glance.

i also added an insight into the strategic layer. this saves me a bit more from actually reading logs.

strategy overview

i guess the strategy engine info is a bit redundant here, since every arena will pretty much just have one. but what if i decide to implement a troll strategy engine! see, vital information after all. “strats” are just the currently detected hostile strategy and the strategy the bot is executing. then i list all the currently active plays with their respective squads/clusters (if any).

playing a few games

so what i have now is:

  • a bot framework that is (hopefully) decent
  • a lot of hacky code for basic gameplay ported from my old stuff into the new framework
  • a rating of around 1550 that i reached before with said hacky code

time to hit play in basic spawn and swamp! (it is the arena that has the most code ported to the new framework, so it is my most active one)

changes and lessons from this session

since micro is my bots major weakness currently, as expected a lot of the changes were simple adjustments to that. one of the major bugs i noticed was that instead of adding a range of 0-20 to my cost matrices i added a range of 0-200 depending on the expected damage for certain tiles. this basically meant that my creeps were overly cautious around anything that could even slightly damage them. it also lead to a lot of hitting the max cost and making a tile unpathable, which resulted in creeps trying to move around “invisible obstacles” in very odd ways.

next up i noticed a bunch of targeting errors, but targeting (and i guess combat in general) will be overhauled soon ™️ anyway. in fact, one of my next posts will probably be about the combat code refactor and about designing a combat simulator for micro decision making.

one of the major bugs i fixed was an insistance on hitting creeps over structures, which sometimes resulted in my creeps chasing a random creep when they had a perfect opportunity to damage the opponents spawn.

lastly i fixed a number of strategy errors. a fairly large number of draws came in due to a fairly large number of bunker bots (how do they even gain rating?) at this elo range. basically my bunker detection was not as sharp as it could have been. for example it relied on the spawn being unreachable before. some “bunkers” just surrounded the spawn partially. since my “we can just throw everything at them now, yolo” trigger hit fairly late, i basically ran out of time on these “bunkers”.

the squads got better at picking their fights and retreating single creeps in case they are low. the logic behind this is currently still super naive and it is sometimes annoying to watch, which is a major factor for my motivation to work on a micro overhaul very soon. cohesion is also still a major issue and results in bad decision making since the code partially assumes melee heals are available more than they are at the spacing the creeps are at.

oh - one more thing i fixed was an defensive overreaction: when the need for a base defense was detected, the defensive play just requested ALL creeps to assist. basically whenever any hostile creep stepped to close towards my corner of the map, all my creeps would rush back and try and defend… well, since this is not CTF, i adjusted this a bit towards a more appropiate response. 😅

results

as i was typing this post i had games running in the background. seems like my rating settled around 1660 now, so a solid 100ish points increase for some minor changes. good fun 😊

i noticed that i was most annoyed with bad micro decision making, so i think i will report on combat code progress more over the next few posts. the new framework proved useful, making changes worked out very smoothly. what i still need to think about is how i want to handle civilian creeps, maybe i will just move them into the “plays” that military creeps use. another major update i need to implement is how i request creep bodies. countering certain “creep builds” alone can easily win games, so having the option to dynamically adjust bodies in a less hardcoded way than i have now will be a priority.

i also thought for future nostalgia reasons i will end each post with the current bot versions i have out and the repos current commit id (which will not help anyone but me, but i will do it anyways). so here goes:

stats

  • commit: 11f5e8ebf31ede646c5a7820c4689398096fc458
  • ctf: rank #9, v30
  • sas: rank #82, v34