Jump to content
MakeWebGames

Recommended Posts

Posted

Hello everyone!

I wanted to share a project I've been working on recently. Like many people here, I grew up playing classic browser mafia games and always loved the core gameplay loops (Crimes, Casino, PvP, etc).

Instead of using the traditional MCCodes architecture, I decided to build the project with a modern full-stack setup while keeping the classic gameplay feeling.

So far the project is built with the following stack:

• Node.js
• Prisma ORM
• Express.js
• PostgreSQL
• React (Fetch API)
• Tailwind CSS

The goal is to create a modern browser-based mafia game with smoother UI interactions and a more scalable backend.

Some of the things I’m focusing on:

  • Modern backend architecture using Node.js + Prisma

  • Clean API structure with Express

  • React-based frontend for dynamic UI

  • Tailwind CSS for a responsive modern interface

  • PostgreSQL database for reliability and scalability

I'm still actively working on new features and improving the overall gameplay experience.

Below is a preview of the current example profile UI.

Would love to hear feedback from other developers here!

image.thumb.png.4aec5aee00bdc240b256400ad91f043a.png

  • Like 1
  • 8 months later...
Posted

Nice progress. One thing I'd be curious about with this stack: how are you handling concurrency on PvP actions, e.g. two players hitting each other at the same time? With Prisma on Postgres, are you leaning on interactive transactions with row locks, or an optimistic version column? Classic mafia games tend to pick up stat duplication bugs from race conditions, so I'd be interested whether that's something you're designing for before adding more features.

Posted
2 hours ago, David Williams said:

Nice progress. One thing I'd be curious about with this stack: how are you handling concurrency on PvP actions, e.g. two players hitting each other at the same time? With Prisma on Postgres, are you leaning on interactive transactions with row locks, or an optimistic version column? Classic mafia games tend to pick up stat duplication bugs from race conditions, so I'd be interested whether that's something you're designing for before adding more features.

That's a really good point, and concurrency is definitely something worth designing for early, especially in a PvP-based mafia game.

I've structured the combat system around dedicated CombatSession and CombatAction models, with individual action records tracking damage, health after each action, turn numbers, and other combat details.

I'm also using database-level unique constraints to prevent duplicate post-fight actions and reward records for the same combat session. The schema is designed with auditability and data integrity in mind.

That said, I'm also looking carefully at race conditions when multiple actions target the same character. I agree that relying only on application-level checks isn't sufficient.

The next important layer is ensuring atomic combat updates through PostgreSQL transactions, with appropriate row-level locking or optimistic concurrency control where needed, so simultaneous attacks, stat updates, and reward distribution cannot produce inconsistent results.

I'd rather get the integrity of the combat and economy systems right before scaling up with more features.

On 11/11/2026 at 8:06 PM, João Morais said:

Howdy @rockwood, the design has come a long way :exciting: - very nice work! Can you share the URL for the game? I'd like to give it a try. 

The game is currently in the testing phase. Once testing is complete, it will be officially released. Stay tuned—it’s coming soon!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...