This week, I added the capability for units to deal damage to each other in turn-based combat, as well as functions for winning or losing the battle. The manager uses the same general system as shooter combat regarding post-combat. That is to say, it checks whether or not any “Parent_Enemy” objects exist after a brief delay (which has been included to let them be spawned in without issue). Enemy AI is currently primitive, but hopefully I can refine it moving forward so that they actually make meaningful decisions in combat; as of now, it only does the basic attack.
Moreover, I modified enemy stats and action options to be universal across both turn-based and top-down gameplay; each instance pulls from the same stat block and move pool. This is accomplished in the same manner through which all player objects share the same stats: a single parent object with macros determining stats and move options. Bullet patterns will be hardcoded in shooter gameplay, so the latter only applies to turn-based combat.

I also developed a fix for a strange bug that prevented turns from progressing properly. From what I can gather, the turn cycle moved so quickly that it kept overwriting actions that units were in the middle of performing––multiple times, this had the result of units “forgetting they were dying” and continuing to fight with 0 HP, never leaving the turn order. My current solution to this is a timer that must run out before the turn-end events can process and which resets at the start of every “unit turn”. 120 in-game ticks is probably a little high, but it’s time enough for all the affected events to play out safely.
Finally, I devised a damage calculation formula which will eventually be used universally across both gameplay styles. It has not been implemented yet at this time, but for posterity, I have provided my pseudocode notes from this week and last week at the bottom of this entry. Please note that the implementation of this formula is NOT a top priority at this time; I have taken notes on it and hope to add it in if time permits, but for now, my goal remains to have the game in a playable state before I start going for extra style. As stated in class, it is for this very same reason that I am currently holding off on the visual elements like art. My modus operandi for this project is, has been, and will for the foreseeable future remain as follows: I would rather have an ugly game that works correctly than a pretty game that doesn’t do what I want it to.

Leave a comment