24 hour recap (just like everyone else :P)
So it’s been 24 hours since Ludum Dare started and I furiously started hammering away at my keyboard, hoping my facerolling would somehow end up with a playable thing on the screen. A lot can happen in that time, so I’d like to share what my first half of the journey has been like so far. Both good and bad.
The good:
- My choice of tech. Lua is a wonderful language for getting things done quickly, and with the work I put in before Ludum Dare started, I was able to get simple things up and running in an extremely short time. (or at least what felt like an extremely short time) Adding new features and putting the various bits and bobs my game needs together has been an absolute pleasure and very easy. It has only taken me a couple tries for each thing to get something most of the way, if not all of the way to where it needs to be. SDL2 is also a fantastic library to build on top of, and puts in basically all the features I need. I don’t even need to create bitmap fonts, because I can just generate all the glyphs I need at runtime, in any size, color, etc.
- Choosing to do a top-down perspective for my game has been great. While the perspective is wonky for putting together the graphics, the basic movement mechanics were basically done within a few minutes.
- Low-resolution graphics + blocks for all the things = simple collision and almost no performance penalty for drawing. Make the code ALL the sloppy, and still get away with it.
- Working with code I wrote the entirety of makes it so easy to do things. I don’t have to look up some method to do something for me, or scour the internet for some odd/subtle bug/feature, I know everything that is available at all times. I can even go modify it quickly and easily, because I know every line. This doesn’t outweigh the benefit of really knowing an existing engine, but it is a nice benefit as I don’t really know that much about most engines out there, and that could cause me to take a very long time to implement something that only took me a few minutes with my own code.
- Using mixins with a bunch of reusable components/entities. I need to throw up some debug walls quickly, and don’t have any graphics? Mix in the ColoredRect component, and I’m good to go. I need a bunch of animations for my main character? Animated takes care of that. Very nice indeed.
The bad:
- Using my own handrolled “engine”/code definitely adds a lot of complexity to getting from the start of wanting to do something, to having finished that thing. I have to craft all of it by hand, right then. Not only does this take time, but it adds bugs. I didn’t have a library which can lay out lines of text for me, so I had to make my own for speech bubbles, and they don’t handle word separation correctly. It will just jump to the next line in the middle of a word, or not correctly align words in the middle of the bubble, etc. As a bonus, some of those bugs actually help with the general theme of what I’m going for, so it isn’t ALL bad.
- Not having a premade camera system/collision system sucks. Especially with a limitation of SDL2 where it won’t draw images outside of the window’s area, causing me to have to track two global variables and add them to every entity before drawing them. Also the massive performance drain of brute forcing collision detection, ugh.
- Without optimized game loops, collision, etc., it’s easy to run into massive performance issues. I’ve had my collision take greater then 30ms (when I shoot for 16ms) per frame, causing huge slowdowns. On top of that, with my current schema of disabling garbage collection in Lua so that I can manually ask it to collect garbage every few frames, but only when time is available, I can hit problems where enough time is taken that the system decides it doesn’t have enough time to collect garbage, and pile up garbage infinitely. It hasn’t been too uncommon to see my game start taking 700+MB of memory suddenly, because it didn’t have enough time to let Lua reclaim memory.
At this point, I believe the game is largely “feature complete”, in the sense that I don’t really need to put together many more features in order to finish making it. I largely need to make a bunch of assets, define all the levels, and put together some rudimentary story. Hopefully it all turns out relatively interesting, and I can complete everything I want before the time runs out tomorrow. Honestly the full game is still going to be pretty darn simple. If I get lucky, it might even have some fighting mechanics at the end, if you can even find the actual end 
On the topic of this year’s theme “Beneath the Surface”, I went a little bit less literal. My game has nothing to do with subterranean exploring or the deep ocean, but instead is going to have a main part of the game you play, with something hidden “beneath the surface” that you have to find. You might get subtle hints while playing the game as to what’s really going on, but you might have to pay attention to see them.