Inspiration My project was born from a love for classic social deduction games like Among Us and Werewolf. I wanted to take that core tension of "who can I trust?" and wrap it in a unique, high-fidelity 2.5D world. The goal was to create a game that felt as smooth as a native app but lived entirely in the browser, accessible to anyone with a link.

What it does The Primitive Peer pits a team of Time Travelers against a hidden Caveman intruder.

Time Travelers must complete 7 unique technical tasks (Fixing Relays, Aligning Satellite Dishes, Cooling Reactors) scattered across a detailed map to secure a team victory. The Caveman must use stealth and environmental hazards to eliminate the travelers before their work is finished. Dead players (Ghosts) remain active in the game, invisibly completing their remaining tasks to help their team cross the finish line. How I built it I built the entire game from scratch using Vanilla JavaScript and Node.js:

Real-Time Sync: I used Socket.io to manage the bi-directional communication between the server and players, ensuring sub-100ms latency for movement and interactions. Custom 2.5D Renderer: I utilized the HTML5 Canvas API to draw a dynamic world layer-by-layer. We implemented a custom "top-down 3D" perspective for every object on the map. Authoritative Server: To prevent cheating, the Node.js server acts as the "source of truth," validating every kill, vote, and task completion. Challenges I ran into One of the biggest hurdles was the Coordinate Geometry required for a 3000x3000px world. I faced several bugs where map objects like benches and reactor cores were slightly offset or clipping into walls.

I had to implement a precise AABB (Axis-Aligned Bounding Box) collision system to ensure players couldn't walk through solid furniture. I used the standard Euclidean distance formula to calculate proximity for tasks:

$$d = \sqrt{(x_{player} - x_{task})^2 + (y_{player} - y_{task})^2}$$

I then checked if the player was within the interaction radius $r$: $$d \le r$$

Messing up these offsets even by a few pixels meant players would get "stuck" or couldn't reach their tasks.

Accomplishments that I'm proud of Game Design: This is the very first game that I have created. It is also one of the largest projects I have worked on solo. Ghost Mechanics: Allowing dead players to continue playing and contributing to a team win via task completion. Performance: The game maintains a steady 60 FPS even with multiple players and a fully decorated map. What I learned I learned the intricacies of building a Browser-Based Game Engine. This involved understanding the game loop (via requestAnimationFrame), managing state synchronization across multiple clients, and high-performance canvas rendering. We now have a deep appreciation for the math behind 2D world-building.

Built With

Share this project:

Updates