MORE WAS LOST IN CUBA

View Original

Inspiration has to catch you working


Weekly Summary

It was a pretty busy week in general with work and life-admin but I still managed to squeeze in quite a few hours of development time. I made quite a bit of progress - one new action, a pretty significant refactor and started planning/designing a new feature - and also managed to fix a fair amount of bugs! I’m still focusing in sustainable progress so I didn’t stress out when I couldn’t work any given day; instead opting to work “late” a couple days and compensating for missed hours on the weekend (again, without over-doing it).


Work Log

Total Time: 14 hours

  • Features (4 Hours): Finished up the Drop action, so transport units can actually drop the units the loaded with the Pickup action. Aside from that, I started designing the Fire action which allows artillery units to “fire” on a tile that is up to X tiles away from them - inflicting damage directly to any squads, structures or roads that are in it. After “brainstorming” possible implementations, pruning all of the terrible ideas and deciding on a way forward, I started writing up all the tests for the new feature. This workflow has helped me incredibly with getting stuff done, ensuring implementation is exactly how I wanted it to be and guaranteeing I don’t break anything in the future while adding new code.

  • Refactoring (5 Hours): Finishing the drop action up revealed an “issue” that caused units created by the player (ex: by dropping or dividing a squad) to not be able to move or perform actions until the following turn. This was a pretty significant oversight (since most of the core game-play is planning and moving units) so I decided to jump on that with priority. Managed to complete work on it during the week and test it thoroughly.

  • Fixes (4 Hours): Fixed an issue by which an individual unit could be in multiple squads at the same time. Also spotted and fixed an issue that allowed for “Drop”, “Pickup” and “Divide” actions to work as cloning machines (if a squad had 10 infantry units you could, for example, divide it into 2 squads with 10 infantry units each). Finally, had to deal with quite a few “bugs” derived from the refactor mentioned above (for instance, Energy was being shared between multiple squads, causing one squad to lose energy points if a different squad moved). As usual, added regression tests for all of that too.

  • Chores (1 Hour): The refactor touched a big chunk of the codebase so I also took it as an opportunity to add tests for things that didn’t have them yet. I managed to add full test suites for the ArmyManager, ActionPhase and Divide action since I already had to add tests for the refactor regardless.


Progress

  • Drop action is done, tested and working!

  • Started designing the Fire ability.

  • Units created by performing a “Divide” or “Drop” can now move and perform actions from the get-go

  • 28 new tests + 13 regression tests.

  • Fixed 2 old bugs as well as a few new ones introduced by the refactor.


Issues

  • As stated at the beginning, it was a pretty busy week so I did have to sacrifice something. I didn’t make any progress on the research/learning this week.

  • While starting work on the Fire action I fell into a bit of an “over-complication” spiral. I wasted a couple of hours trying to abstract a ton of code to create a “scalable”, “future-proof” and “simple” solution for dealing damage to things other than squads (ie: structures, roads and cities; which aren’t even coded yet). Thankfully I remembered YAGNI and KISS and moved on to a simpler implementation.


Next Week

The Fire action is pretty straight forward so I expect to have it done early on during the week. After that’s done, like I already mentioned last week, I’ll move on to the “Build” ability for engineers which will be quite a bit more complicated and potentially take me a couple weeks (or more) to complete. See y’all next time!