After adding a few fixes to some long-standing bugs with basic positioning math, I started working on probably the most important part of the game: the enemies.
This included allowing multiple enemies to appear on a map, and have the enemies loaded from the Map Data rather than hardcoded with test values. The first problem this caused was that every enemy apparently, even though seperate entities, shared the same “random” numbers for decisions due to their AI being processed less than a few milliseconds apart. This caused all enemies on the map to do the exact same thing, moving in the exact same direction and distance, at the same time, kinda like syncronized swimming. Luckily, it got better.
So after fixing that, I decided to enhance the core AI beyond roaming… after all our enemies need to actually attack the player for the game to be fun. By design the kittri has the basic “Bite”, “Headbutt”, and “Flee” actions when the player is within their detection range. Surpisingly, I managed to implement all of these with few errors. There’s something goofy going on though I think if the enemy changes its mind while doing another action, where its position vector goes into the realm of imaginary numbers… I haven’t pinpointed when and where that happens just yet. Also the collisions are still a little loose for the Headbutt action I think, but nothing a little tweaking of numbers can’t fix.
The best part of all this though is the way I implemented “Bite”. I basically made an EnemyWeapon object independant of all other objects displayed, which not only properly handles “invisible” collisions like biting (which will be animated on the enemy rather than throwing some graphic out), it also allows missile weapons such as bullets to shoot out, with trajectory and all. Basically all possible attack zones are covered with this simple object, so future battle designs will be easy to pull off. The only reason “Headbutt” is giving me trouble is that it’s a specialized form of contact damage which already has a collision routine… I’ll figure it out I’m just tired right now.
Sorry no screenshot tonight, nothing really has changed graphically just yet. I have started working on actual animations for Arashi and the kittris… hope it doesn’t take too long to do the basic stuff.



