Building an GTA-inspired open world crime game solo - showcasing the systems I've built in Godot 4.6

I’ve been building a top-down 2D open-world crime game solo in Godot 4.6 called
Lawfare: El Huevon. Wanted to share the technical systems I’ve built for anyone
interested in how these work.

NPC AI — Finite State Machine with full personality system

▎ NPCs have a complete FSM (IDLE, WANDER, FLEE, CONVERSE, CONFRONT, ENGAGE, SCRIPTED).
Each NPC is randomly assigned a personality at spawn — FRIENDLY, NEUTRAL, RUDE, or VIOLENT - which dictates their dialogue pool, social tendencies, combat behavior, and how quickly they escalate. NPCs remember past interactions and retain that context across states.

▎ NPC Group Conversations
NPCs organically form small groups, walk to a shared meeting point, and hold turn-based conversations with topic threading and beat matching. Hostile NPCs can snap mid-conversation and walk away. The system uses an NPCManager coordinator, so individual NPCs don’t need to know about each other directly.

▎ Gang Squad System
NPCs belong to factions with defined territories. When one squad member is threatened, nearby members are alerted and engage together. Members patrol within their territory bounds via a SquadController that hands out navmesh-snapped patrol points.

▎ Cover System
NPCs in ENGAGE state search for CoverPoint nodes, score them by proximity, alignment with the threat, and flanking angle relative to allies already engaged. They cycle between crouching behind cover and popping up to fire, with suppression mechanics that force them back down when bullets pass nearby.

▎ Layered Paperdoll Character System
Both the player and NPCs use a fully layered AnimatedSprite2D paperdoll system — body parts, clothing, weapons, and muzzle flash are all separate animated layers composited at runtime. NPCs get randomized appearances at spawn.

▎ Traffic System
NPC cars follow directional lane nodes with waypoints, respect traffic lights via a phase-based intersection system, queue behind each other with car-ahead detection, and avoid pedestrians. No global traffic manager — lanes and intersections are self-contained nodes.

▎ Hitscan Shooting with full combat stats
Player shooting uses hitscan with recoil, crit rolls, damage variance, armor mitigation (WoW-style diminishing returns formula), suppression, and a cover system that differentiates low cover (crouch to hide) from high cover (blocks everyone).

▎ Vehicle System
Vehicles use owner-based access control, support sirens and headlights as optional nodes, and use a sprite rotation pattern (not 8-directional animations) with a correctly pivoted hitbox.

▎ Quest & Inventory System
Full quest lifecycle (NEW → IN_PROGRESS → COMPLETED/CANCELED) with objectives and item rewards. 30-slot drag-and-drop inventory with equipment slots and gear stat bonuses.

▎ Combat Music System
Dynamic music that fades in on combat events and decays out after 8 seconds of no activity. BGM pauses at the current position and resumes when combat ends.

Happy to go deep on any of these systems.

7 Likes

Devlogs are here: https://x.com/LawfareGame

The idea of an open world is wonderful. But why crime, specifically? Couldn’t it be a simulator of everyday life? Something like The Sims series, which has stagnated in its development. But a crime theme could be included as part of it.

It would be interesting to read about it. But, unfortunately, X is blocked in our country. Are you considering using Mastodon?

It looks great! I love the style, really evokes a gritty futuristic vibe, and the speaking NPCs give more of a sense of a living world than the first two GTA games.

Looking forward to trying a demo :slight_smile:

1 Like

This looks amazing! Very elaborate
I love the art style.

1 Like