ColePowered Games Ltd.
  • Navigation
    • Shadows of Doubt
    • Concrete Jungle
    • Older Projects
    • Jobs
    • Bug Report/Support
    • Contact
  • Search Icon
Search Icon

ColePowered Games Ltd.

The Game development adventures of Cole Jefferies.

Shadows of Doubt DevBlog #8: Simulating a City

Shadows of Doubt DevBlog #8: Simulating a City

September 15, 2018 colej Comments 0 Comment

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.

In this dev blog, I’ll discuss the challenge of creating and simulating the population of the city.

At the core of this project is the simulation of 100s of little citizens, all going about their daily routines. They all have jobs, places to be, things they like doing, and favourite places to eat and drink. Most of them will happily go about their day while you play, unaffected by the grisly murders happening elsewhere in the city. You’ll likely never interact with 90% of them. Yet they’re essential to the game because they are the hay in your needle-in-a-haystack search.

The average citizen currently makes to about 4 – 10 different journeys every day. A typical day might involve getting up and going for a coffee at the cafe down the street from their apartment before going to work. They’ll have lunch at the pizza place in the shopping mall, then back to work. After work they may visit the local sports bar before finally heading back home, picking up some groceries on the way.

Citizens’ needs for caffeine are actually simulated too!

Simulating 100s of the above would be a hugely intensive task for a system to handle in real time. That’s why I’ve chosen not to handle it in real-time. Instead, the game needs a brief period of calculation time before the start of each day (typically no more than 10 -15 seconds depending on the population count). During this time their activities for the day are chosen and mapped out for them. This way I can have the number of citizens I want without it being too demanding on the system. Of course, they can deviate from this if the situation calls for it, and their altered routine can be calculated by the game in real time as there will never be more than a handful of citizens requiring deviations. For example, if they find a dead body in their apartment they may not worry quite so much about getting to work on time!

In addition to having a routine and places to go, they also need to record what/who they’ve seen. This is in case they are relevant to one of your investigations and you decide to question them. Most ‘memories’ the citizens form are sightings- these are triggered by a global check that loops through travelling citizens and checks if they can see one another:

The green lines represent citizens seeing each other, the red ones means they have met/are familiar with each other.

Citizens can also see into windows across the street adjacent to their own if the light is on- this means in certain circumstances you may wish to question the occupants of an apartment in an adjacent building for example. It’s systems like this that can help broaden the logical options available to the player, and hopefully makes the open-ended detective work satisfying!

Citizen memories start off by being pretty much 100% accurate, but over time they become fuzzier. How long memories last depends on a large variety of factors- for example, if and how well they know the other person, their visual distinctiveness, whether they were behaving strangely, how good the citizen’s memory is in general (can be affected by age), and even the alertness level of the witness.

As memories fade, time accuracy is reduced up until the point the memory is lost completely, and therefore won’t surface when you question someone. This creates a natural time pressure within your investigation- you’re going to want to discover and question your witnesses as efficiently as possible so their memories are fresh in their mind and you can get the most accurate picture of what happened.

You may need to be wary. If the citizens know their presence at a certain place looks bad for them (they may have been near the scene of the crime and have no witnesses to back them up) they may actually choose to lie or bend the truth to avoid being treated as suspicious, even if they actually are innocent! Most innocent citizens will be more inclined to tell the truth however. Lying is whole other kettle of fish that I still need to explore in detail to find what works.

You’re not always going to need to go to searching for witnesses either. After a press release and appeal for information, you may get witnesses reaching out to you. Spending more of your resources in getting the word out about your investigation may increase the chance of this. It’s your case and it’s completely down to you how you want to handle it! Freedom in this respect is this game’s killer feature.

Twitter
Follow
Facebook
RSS

Development Blog, Police Department Game, Shadows of Doubt

Post navigation

NEXT
Shadows of Doubt DevBlog #9: Inspiration Diary
PREVIOUS
Shadows of Doubt DevBlog #7: There’s been a (Procedurally Generated) Murder!

Leave a Reply Cancel reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About

Indie Games developer, currently working on detective simulator game ‘Shadows of Doubt’. I also made Concrete Jungle.

Twitter
Facebook
Instagram
YouTube
IndieDB

Development Blog

  • Shadows of Doubt
  • Concrete Jungle

Previously on ColePowered…

  • October 2022 (1)
  • March 2022 (1)
  • December 2021 (1)
  • October 2021 (1)
  • August 2021 (1)
  • July 2021 (1)
  • June 2021 (1)
  • May 2021 (1)
  • January 2021 (1)
  • October 2020 (1)
  • July 2020 (2)
  • March 2020 (2)
  • January 2020 (1)
  • December 2019 (1)
  • November 2019 (1)
  • September 2019 (1)
  • August 2019 (1)
  • April 2019 (1)
  • March 2019 (2)
  • February 2019 (3)
  • January 2019 (1)
  • November 2018 (1)
  • October 2018 (2)
  • September 2018 (1)
  • August 2018 (1)
  • July 2018 (3)
  • June 2018 (2)
  • April 2018 (1)
  • August 2017 (1)
  • May 2017 (1)
  • March 2017 (1)
  • January 2017 (1)
  • December 2016 (1)
  • September 2016 (2)
  • August 2016 (1)
  • September 2015 (3)
  • August 2015 (1)
  • July 2015 (1)
  • June 2015 (3)
  • May 2015 (4)
  • April 2015 (4)
  • March 2015 (4)
  • February 2015 (4)
  • January 2015 (4)
  • December 2014 (5)
  • November 2014 (3)
  • October 2014 (3)
  • August 2014 (1)
  • July 2014 (1)
  • June 2014 (1)
  • May 2014 (2)
  • March 2014 (3)
  • September 2013 (2)
  • July 2013 (3)
  • June 2013 (3)
  • May 2013 (2)
  • April 2013 (4)
  • March 2013 (4)
  • January 2013 (1)
  • December 2012 (1)
  • November 2012 (2)
  • October 2012 (1)
  • August 2012 (1)
  • July 2012 (2)
  • June 2012 (2)
  • April 2012 (4)
  • March 2012 (2)
  • February 2012 (3)
  • January 2012 (3)
  • December 2011 (2)
  • November 2011 (4)
  • October 2011 (2)
© 2023   Copyright. All Rights Reserved. Designed by Freepik