Cult of Personality (CoP) is 5-8 player online multiplayer social deception game ala Among Us. Players play as a Cultist, working with their peers to perform a forbidden ritual, or a disillusioned Defector, trying to stop them using deceit, possession, and murder!

Our development cycle lasted 2 years full-time, and our Steam release was Oct 26th, 2023!

Team Composition

  • Engineer, Designer (My role)
  • Pixel Artist, Designer
  • Capsule Artist
  • Tools Programmer

Project highlights

Media

Showing off CoP at M+Dev 2023

Gameplay Recording from an October 2023 beta test

Custom Netcode

One of the core features of CoP is player-on-player “possession.” A dead Defector (think Traitor from Among Us) has the ability to temporarily gain control of living cultists, and can force them to do suspicious things like sabotage objectives, or attack their allies. An extra wrinkle is that possessed players can try to resist the possession by holding directional inputs that oppose the possessors.

Possessing Player Perspective Possessed Player Perspective
Left: Possessor perspective Right: Possessed perspective

Making sure you could “fake” the movement of a possessed player - and therefore pretend to be possessed - was also super important to the Deception aspect of the game.

Those requirements led me to build CoP’s netcode, with server authority and client rollback, from scratch on top of Steamworks P2P. Thankfully there are tons of awesome resources on this stuff. Some of the most important for CoP were the Gaffer On Games articles about transport layer best practices, and this GDC talk about Overwatch’s netcode. Hoping to write a deeper dive about it soon!

Hierarchical State Machines

Because it was important for CoP to support responsive, predicted actions on client, we needed to be able to rewind a player’s state, then re-play inputs for players in case of a missed prediction. We also needed to ensure separation between input source, and actor state, to allow control swapping when possession happens, and for AI controlled NPC’s like bats.

All that factored into my decision to represent actor state with Hierarchical State Machines. I definitely recommend the whole book, but Robert Nystrom’s Game Programming Patterns was the jumping off point for my HSM implementation. There are also some super neat bonuses to HSM’s, like situational behavior changes (holding death triggers for a round-end animation) being relatively painless, and super tiny state serialization.

Technical Articles

More in-depth articles about some techniques I used in CoP!

Torch HSM

Networked HSMs

Read Article

Spelunky Transition Gif

Floor Transition System

Read Article