New Entry, New Format
Weekly Summary
For the past 4 weeks I’ve had Fridays off, this meant I’ve been able to have one day a week were I just put my head down and worn on the game (sadly, that’s not the case anymore). I’ve made a lot of progress this past couple of months, hope I can keep it up. Anyway, this week went great! Added two new actions, refactored quite a bit of code, fix a couple of old bugs (and added regression tests for them) and added more and more tests!
Work Log
Total Time: 19 hours
Features (10 Hours): Created the Pickup and Drop actions. These abilities are specific to transport units and they basically do what they say in the box: they allow players to load and unload units. Transports allow units to move faster than their given movement speed but deal no damage and put loaded units at “risk”: if a transport is destroyed while loaded with units, all units inside the transport are destroyed too. The Pickup action is 100% completed (logic, UI, interface and testing) and the Drop action is just pending some minor fixes.
Refactoring (4 Hours): The big one here is that units are now actual individuals rather than numbers. Were before a squads units would be little more than a number attached to the attributes for a unit type (ie: a squad has 100 units with “Infantry” attributes); now, squads actually contain a list of Individuals with the attributes for a unit type (ie: a squad has 100 “Infantry” Individuals with their own name, age, gender, experience, political affiliation, etc…). Aside from this there was quite a bit of cleanup across the board (getting rid of unnecessary logs, renaming a few things, reorganizing a bit of code) and the creation of “Constants” to get rid of magic numbers/strings. This last point has helped greatly with having a single source of truth for values like movement, attack, unit type strings, etc…
Fixes (2 Hours): Had to fix issues with “Divide” and “Merge” actions that arose from the implementation of the transport abilities (TLDR: needed some specific logic for when dividing/merging loaded transports). Also fixed an issue by which “ghosts” for squads (the indicator of what a squad is going to do/where it’s going to move) were not “interactable” which effectively made units be locked after performing any action (independently of the action points they had remaining).
Chores (1 Hour): Had a couple dependencies that were outdated in the project so I decided to upgrade them. The upgrade required modifying a bit of code and updating some legacy functionality we were using, nothing major.
Learning (2 Hours): A couple months ago I started reading “Reluctant Warriors” by James Matthews, which gives a lot of insight into the actual composition of both armies. Even though both sides spun a tale of “volunteers fighting for their beliefs”, armies relied heavily on conscripts to fight the war: regular people that just found themselves in one side of the conflict or the other, didn’t believe strongly in any cause and were mainly concerned about their family, their personal safety and their economic stability. The book is incredibly interesting and is giving a lot of ideas for the game and heavily guiding implementation and design; this week I specifically read about morale in both armies: how they handled morale, motivated soldiers, what initiatives they each took and what “beliefs” they tried to implant in conscripts minds.
Progress
Pickup ability is now done, tested and working!
Drop ability is almost complete.
Units are now actual individuals rather than numbers.
37 new tests.
General fixes and improvements.
Issues
Minor problems implementing the movement logic for the “Drop” and “Pickup” actions: when a squad only contains transport units, it’s movement is equal to the transport units’ movement. However, while planning, if a “Pickup” happened before a “Movement” action we weren’t properly using the transport unit movement value (even if the pickup would load all units in the squad). This took a bit to wrap my head around and implement in a solid way which wasn’t error-prone or confusing. Managed to make it work in the end and added a few regression tests for it.
Next Week
I expect to finish the “Drop” action pretty early in the week and move on to the “Fire” ability for artillery units. If I managed to finish that up then I’ll probably start with the “Build” ability for engineers (which might take some more time since it’s a significant feature and requires quite a bit of new logic). I’ll explain more about that when I get to it.