King and Country Postmortem

title.png For this Ludum Dare @JamesOliverMusic and I put together a game called King and Country! I also continued my tradition of getting my own game's name incorrect on the submission page... :rolling_eyes: I normally make pixel art action games so I wanted to try something different. This time, we decided on a strategy game where you have to help the king escape a castle under siege. The enemies are too numerous to fight them all, so you have to strategically use the knights you have to run interference. Sure, sometimes they die, but SACRIFICES MUST BE MADE to insure the safety of the king.

We work well together since I do all the code and art while he takes care of the music and sound effects. This was our second Ludum Dare working together plus some jams in between and since we can both work independently the process was extremely smooth.

@JamesOliverMusic and I are ~5 hours apart so by the time we were able to brainstorm and come up with a plan we were already 18 hours into the competition (about 3:00 Saturday EST). Losing all the time was painful especially when making a strategy game.

Originally the game was going to have some real time combat element, but that was scrapped very early on when I realized how complicated the systems were becoming. So in the final version the battles are fought automatically. attacking.gif

Timeline

Day 1

Friday night. I got the theme at 9:00 and brainstormed for 3 hours. I came up with a bunch of ideas, none of which I liked. Crap.

Day 2

I had a meeting in the morning and spent the morning brainstorming with @JamesOliverMusic trying to come up with an idea. He proposed a castle under siege and after some discussion we ended up with King and Country! I got started working at 3:00 PM on Saturday, almost 18 hours after the theme was announced. By the evening I had most of the systems finished but all the art was just placeholders.

Day 3

I lost another couple hours in the morning to other obligations. Then again in the evening when we had company come over. I basically worked on the art finished up the systems for 6 hours and ended up going to bed at 1 AM.

Day 4

Monday. I worked. I put another 3 hours in the evening and crammed in as much polish as I could and submitted about 20 minutes before the submission hour started.

Here’s the post-mortem in the Good, Bad and Ugly format.

The Good king.png

The art style - I knew that I wasn't going to have a lot of time for art. I wanted something clean and simple with a hopefully nice aesthetic. I made everything in Inkscape which let me quickly and easily scale and modify it, which was good because I didn't decide on a resolution until late in development.

The music - I think it fits with the game perfectly. It builds from suspenseful during the planning to frantic and epic during the Battle phase before returning back for the planning.

The Bad raider.png

Code - I normally write some fairly clean code during jams that is easily extensible. This time I knew I wouldn’t have as much time so I hard coded a bunch of stuff that came back to bite me. Normally I expect the pain of bad code to come after the jam is over when it doesn't matter as much, but not this time.

One nasty bug - I got caught on a bug that was driving me crazy. My game would randomly crash with null pointer exceptions, but I could never recreate it. I don't mind bugs during a jam, especially on some of the more complex systems I had in the game, but this one made the game unplayable so it had to be fixed. It ended up being my own fault. When a unit dies in battle I would kill it, which removed it from all the arrays and locations in the game. But the unit was still present on the board, just invisible. So when you draw the selection box you would catch the dead unit and move it along with the live ones, which would place it in a new room. Then a battle on the room would have a different number of alive units vs total units which caused the crash. I could have went through and done actual garbage collection or coded around it, but I had already wasted so much time that I just move their invisible dead bodies up to -1000,-1000 in the game. If you scroll all the way up there and click on them, then scroll back down to the board and move them you deserve the crash.

The Ugly knight.png

The systems - This game has a crazy amount of systems all running independently, none of which my engine supplied and I had to code from scratch. The castle was a collection of nodes, so I needed heatmap pathfinding. The selection of multiple units is all coded from scratch. The movement and arranging of units is all scratch. The battle screen and relationship to the board units is all scratch. I think this is my most complicated, system heavy Ludum Dare entry yet, and if it is all working well nobody even notices.

Overall this was a great Ludum Dare and I had a ton of fun participating.

The game is here if you want to play: https://ldjam.com/events/ludum-dare/43/for-the-king win.gif