Bringing Life to the City


As you explore the City of Abominations you'll undoubtedly notice civilians who look something like the woman in the picture below. The artists on this game have done a great job giving us sprites to use to convey our city's aesthetic to players. However, a bunch of lifeless sprites staring back at you doesn't make for a very engaging gameplay experience. One thing we needed to do breathe some life into the people scattered around the city. This was one feature that Melissa Chodziutko helped me to tackle.

When I was tasked with programming our civilians I decided to give them two primary states. The first state is called wander. When a civilian NPC is in this state they will randomly move between five points at stochastically defined intervals of time. The five points which the civilian moves between are defined at the moment they are instantiated into the game world. The first point is the exact point at which they spawn. The other four points are all the points immediately adjacent to them by a factor of one (1) unit in the game world. The civilian waits for a random amount of time within a range defined by the designer before picking their next target point and moving to it. The civilian will always move back to their origin (original spawn point) before moving to one of the adjacent four points.

The second type of state a civilian can be in is called panic. The panic state is triggered when a character the civilian considers hostile (which can include the player and monsters) comes too close to the civilian. When the civilian enters the panic state, all of their other behaviors are suspended and they will move in a direction opposite to the position of the threat. Whether the civilian travels primarily horizontally or primarily vertically is dependent on the orientation of the threat. The civilian's motion in the panic state is also someone erratic. They maintain a generally consistent path, but with slightly zigzagging movements to simulate confusion. How long the civilian remains in the panic state can be defined by the designer. The timer that tracks whether the civilian should be panicking is reset whenever a hostile character is identified to be within the radius that triggers the state. After the civilian stops panicking, they will return to their origin and continue their routine unless sent into a panic again.

The sprites that make up the animations which make the civilians feel realistic were provided by the talented artists of the team. The controller which ties them all together was created by Melissa and is referenced in the script.

Get City of Abominations (2021)

Leave a comment

Log in with itch.io to leave a comment.