Shadows of Doubt DevBlog #10: Gameplay Loop
Shadows of Doubt is a first person detective 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.
The last few weeks have been super busy and very productive. I’ve worked through a lot of gameplay mechanics that were in a really early/rough state in previous posts, and I’m closing in on a proper gameplay loop that I’m happy with.
This has been a very, very long time coming! A lot of things on this project have seemed just around the corner for a while now, only for me to reach them and move the goalposts. Hopefully, it should be different this time.
In my first playable iteration of the gameplay loop the AI serial killer will pick an acquaintance to kill, then hide the murder weapon (always a knife at this point) in their apartment. You’ll be able to explore the crime scene and gather various information such as blood, fingerprints and DNA evidence. It will be possible to implicate the killer by finding the knife and linking this with fingerprint information from them as well as blood information from the victim. You’ll be able to find where to look by questioning suspects and following their leads.
It sounds pretty straightforward, right? It’s about as simple as a case like this would get. What makes it hard is that the above needs to happen using completely non-scripted game systems. The victim can be killed anywhere by anyone, with any other citizen maybe or maybe not seeing or hearing anything. And I need systems in place to stop that breaking.
I’ve had the city and the citizen daily routines working for quite a while now. The groundwork started with the murder. The murder needs to happen relatively quickly- in fact, it’s simulated when the city loads up, as otherwise there would be a lot of waiting around by the player. As soon as the city is loaded the game will begin simulating a day at its maximum simulation speed, which is about x60, and will continue until someone is killed. The killer essentially tails their victim until they are alone and then does the deed. Immediately after they will carry the knife back to their apartment.
The next thing that needs to happen is that a citizen needs to find the body and report it to the police (you). This poses some problems. What if the victim lives alone and nobody else has any reason to stumble upon the body? For this and similar reasons, I’ve had to build some failsafe systems so that the body always gets discovered in a reasonable time. The first one is that citizens will notice signs of forced entry and deviate from their daily routines to investigate. They can also hear ‘suspicious’ sounds such as the scream when someone is killed- again they will go and investigate. My final, catch-all scenario is that the body begins to smell (gruesome I know). So eventually other citizens in the building will be able to smell it and go and investigate. So far, in admittedly limited testing, the body has always been found.
As soon as someone finds it you’ll get a message with an address, along with the name of who found it. Every ‘thing’ in Shadows has it’s own case file window. This is basically the collected information for that thing. Citizens, addresses, buildings, and objects are all represented through their own folder window, and every time you discover new information you’ll be able to access it through that. You’ll also be able to ‘pin’ them, creating your classic detective corkboard. Separate to these, ‘facts’ link two or more evidence folders together, and are represented by the string. You can mouse over any of these to gain a clearer idea of what that represents. They are the building blocks of the detective mechanics. More on this later!
The citizen who found the body will wait around outside for up to a couple of hours, while you and/or your detectives visit the crime scene.
As soon as you enter, the scene is automatically secured and no regular citizen can enter it until you open it back up. You can find the body, the stab wound on the body, as well as signs of forced entry on the door if there are any. I’m hoping to expand on this massively in the future, but for now, it’s about getting the absolute basics working.
The only way to get information about the victim right now is to send them to the coroner for a post-mortem, so you’ll want to do that. The coroner is independent of your department, and the report will take about 2 in-game hours but you’ll get critical blood, DNA and fingerprint information as well as a fairly accurate time of death. You’ll need this information to start building your case, but in the meantime, you can start asking questions!
This is what I’m working on this week- the questioning system is pretty easy to grasp. You can simply walk up to any citizen, introduce yourself and then ask about where they were and who they saw when the crime occurred. They’ll have a higher chance of remembering people they know or citizens who were out-of-place or acting suspiciously (for example seeing a stranger in their building who doesn’t live there). There’s no actual dialog, but everything they tell you will be recorded on a timeline interface you to review. Because this timeline interface is inside the suspect’s folder window, you can easily bring up another and then compare two different timelines to more easily compare. Not only this but you can also bring up the map interface where their routes will actually be plotted with the path they took. It’s all about representing this data visually. The goal is to make visualizing events and when they happened as easy as possible.
At the core of the game is what I’m calling my ‘incrimination system’. This is a system that allows both the ‘game’ and the player to track your investigation. It also gives a solid feedback value to your progress. This should really help drive the game, and not leave you wondering how well you’re doing (a lot of detective games end up doing this as it’s really hard for the game to know what the player is thinking). With this interface, the goal is essentially to try and direct the flow of ‘incrimination’ to a suspect. Incrimination comes from sources (so for example in this case the stab wound). Facts/connections will allow that incrimination to transfer to other items of evidence. The fact the stab wound was found on the body will transfer incrimination to the body. The fact that the body was found at an address will transfer to that. If you discover who lives at that address, then some will transfer to that. But each fact/connection has a certain amount of reliability that will limit the amount of incrimination transferred. In the above image, you can see the amount of incrimination being transferred by how red the string is, how reliable that connection is by the string’s width, and the direction of the transfer by the animation. All of these details are able to be clarified upon mouse over. It will require a lot of tweaking and adjusting, but I’m really pleased with how this system is working so far.
When you think you have the right suspect, it’s time to pay them a visit to track down that knife. The knife is the only ‘smoking gun’ that will provide enough evidence for a conviction for now. It’s pretty easy to find someone’s address: Either question someone who knows them well enough, look in the city’s directory (there may be a couple of people by the same surname though), or if you happen to know the correct building, you can research its list of residents. This is a small example of the gameplay opening up a bit- I want to add lots of different ways of getting information so that the player can forge their own investigation techniques.
You can go knock on their door and ask to have search access of course, but they won’t let you without a warrant if they have something to hide! A search warrant in Shadows is possible to obtain for anywhere but costs a lot of resources (paperwork) as well as time to acquire. While that’s happening the suspect could catch on and move or destroy the weapon (admittedly this can’t happen yet but I shall expand on these scenarios in the future of course).
So what’s left to do? Well, I hope this is where the game will get really interesting- you can go rogue and sneak into their apartment. It’s possible to research where your suspect works (even their favorite places to eat, drink and socialize). You can gain a pretty decent idea of when they won’t be home, and then lockpick your way into their apartment or immersive-sim your way in through an air vent! Of course, this is completely illegal- but in a game set in a dystopian world you’re probably not going to want to play good cop all the time, or at the very least be a chaotic good cop!
You won’t be able to use any evidence you find against them in your case for the moment, but crucially you’ll know if you’ve got the right person. It’s then just a case of keeping an eye on them and getting that search warrant.
Of course, you don’t want to get caught breaking the law. There’s no combat in the game so you won’t run the risk of death, but instead, you’ll be escorted from the premises and reprimanded. Penalties can include decreased police budget, negative traits for your detectives and bad press. Most of these aren’t in the game yet and won’t make the build I’m working towards, but you get the idea.
That’s what I’ve got planned for the basic game loop. Hopefully, you’ll be able to get a sense for the game’s potential. In the next few weeks, I hope to get this functional and record a gameplay video. See you then!