Shadows of Doubt DevBlog #7: There’s been a (Procedurally Generated) Murder!
Shadows of Doubt is a first person detective simulation game set in a procedurally generated and fully simulated city. As head of the police detective department, it’s your job to organise your sleuths and track down AI serial killers before they strike again! Read previous dev blog entries here.
Last update I had made some progress on the first-person game world and these last few weeks have continued that trend. I’m enjoying working with voxels so much that switching to 3D modeling for the game actually feels like a nice break from the programming, so it’s a win-win situation as far as development is concerned! It’s why the graphics suggest the game is further ahead than it is. Since the last update, the biggest implementation is a basic character model, complete with walking animation.
Originally, I had planned to make the characters as 2D billboard sprites in a 3D world (think original Doom). However, after some experimentation, I decided to try and make a character model using voxels and the same technique I’m using for, well, everything else. Turns out 3D voxel modes are actually way easier- for several reasons: The first being that it’s much less time consuming to animate compared to drawing every single frame for every animation for at least 4 different directions in 2D. Secondly, although obviously right now the city is pretty non-diverse with my basic film noir white detective, I have big plans for having all shapes, skin tones, hair colours, and hairstyles etc. Building the character models in a way that is easily segmented into head, torso, and legs means this diversity among characters will be possible, and that’s super easy to do with voxels.
The walking animation was achieved by making different leg meshes for each’ frame’ of animation. This achieves a stop-motion-like effect. Since the legs are symmetrical, I was able to save time and resources by simply mirroring the mesh in the latter half of the walk cycle to complete the animation. I then added some subtle transform movement of the torso and head meshes using Unity’s built-in in animation editor. It’s by no means final, but honestly, it’s better than I was hoping floor (I don’t have a lot of experience in 3D animation at all, and I was dreading the task making all those billboard sprites).
But wait there’s more! This week I’ve also made some doors for the game. Doors in Shadows of Doubt will be able to be closed, open, locked, unlocked, lockpicked, destroyed and keyholes peeked-through. I’ve only got the first couple of things on that list working so far, but the implementation was relatively painless, and it all seems to be working as planned for now.
I mentioned in my last post, one of the limitations of having a procedural world is not being able to bake lighting. I’ve already come up with some culling techniques for expensive real-time shadows and illumination. One nice advantage is though, I can have dynamic lights being visible through cracks under doors- a very noir-esque way of telling if the light is on in the room within. This actually happened by accident first of all due to wonky door positioning on my part, but I’m absolutely keeping it!
Lastly, bringing this blog entry up-to-date with my current focus- crime scenes! This is one of the biggest challenges of the game as murders need to be able to occur anywhere and leave behind logical clues. In other words, I don’t just have to place some clue objects and a few blood spatter decals around- I actually have to simulate what happened and have the game generate the objects and placements using that. I have yet to really dive into the simulation aspect, I’m just getting the basics down for now.
Most importantly though, the player drops little yellow crime scene placards when you inspect a clue at a crime scene. Priorities.