Post-mortem - Day 1

Another Ludum Dare and the first time doing a post-mortem! Its the third LD for me, and I always tell myself that I don't want to overscope and stress myself out, and still end up doing so.

When the theme landed on a nice 8am saturday morning, I had a few ideas in mind (I like my platformer x breakout idea), but I had always wanted to tackle this idea that was in the back of my mind: what if you could explore the buildings you created in Sim City? The idea was borne out of a friend's lament that there aren't many games like Actraiser which combine two separate genres like simulation and action (technically the sim phase is more bullet hell... but anywhoo) Ignoring all sensibility of scope, I settled on the idea:

A cross between city simulation and first person shooter/exploration it is!

citysimbg.png

Let the games begin!

Settled on a downsized version of the idea beforehand, but I certainly underestimated the scope of the work involved. Given the scope, I defaulted to using Unity which I am more familiar with. The gameplay loop would mainly require switching between city planning and first person view. To incentivise first person view and exploration, I knew I wanted buildings to be explorable and have stuff in them, and I also wanted players to somehow relate to the inhabitants of their city, so I settled on income being provided by getting up close and personal to citizens (just like in real life). In terms of buildings, I intentionally limited it to 4 buildings of various sizes. I still had a vague idea of the city sim aspects though, as I didn't want to make it too complicated to understand (and program). Here's a inside slice of the office building: cutoutexample.png

I didn't intend it to look like Minecraft (well the LD keynote might have influenced it), but I landed on a voxel artstyle as it would be much easier to develop for in 3D, and I planned on using MagicaVoxel for the very first time! It was easy enough to pick up and use and I tested the whole workflow to Unity. Everything was working well. Later on came the challenge though - making transparent windows. (I was misled by those pretty Magicavoxel renders with glass effects...)

After doing a few test builds, I finally settled on the structure for a building as follows - The full model with windows as the parent - provides the collision, with mesh renderer being turned off - The cutout model with windows removed as the child - material set to opaque and can be switched to transparent - The model with only windows as another child - material set to transparent buildingexample.png

Where it went wrong

A wrong turn I took early on - I fixated on the idea of buildings being destructible, although it wasn't really core to the central idea. I really, really wanted to have the voxels collapse like a nice stack of cubes (powered by Unity physics) and explored various solutions: - I considered procedural generation of the meshes - however without a ready solution I wasn't able to scratch the surface of such an endeavor. - The next step was to just convert everything into cubes. However I needed to figure out a way to read MagicaVoxel files into sets of 3D arrays for dynamic generation of cubes.There appeared to be some solutions online for converting vox files to integer arrays however I just didn't have the time to explore them in depth. - An alternative was to specify the array of cubes individually in a data file, but the thought of creating huge arrays manually wasn't very appealing... - Tried generating cubes on the fly by checking for collisions with the meshcollider - however cubes that were embedded within the mesh didn't collide at all. - Another idea considered was splitting the chunks in magicavoxel manually. Could have been possible, but the chunks would still be concave. - Finally, I used blender destructible meshes, which wasn't a pretty solution as that caused havoc with the Magicavoxel textures, and the chunks were in a mess. Running out of precious time, I went for this. So the end result: buildings are a little chunky (as I wanted them to be destructible and turn into cubes) and when destroyed they look pretty meh. And there's a bunch of junk code sitting in the source now. Ugh uglymesh.png

Guess I should've just went for the easy solution right at the start, but I wasted precious hours on something as inane as destruction. *Lesson learnt * - focus on getting to a basic gameplay state ASAP!

I ended the first day without too much gameplay and just a bunch of placeholders strewn about the game. At least I had the city building aspect down. Even had the sweet animation of the building growing up from the ground in a voxel-like fashion (just like in real life). citysim.GIF

Also slapped in the Unity first person controller and a voxel gun (modelled after a previous game jam entry!) citysim2a.gif

Next, its Day 2... roads and finally, some gameplay!

Thanks for reading so far, if you have any great ideas on how to better tackle the above conundrums, comments are more than welcome, oh and do check out the game here!