← Journal

How True MP NPC Became a Real Project Zomboid Player Without a Client

The first breakthrough was not smarter AI. It was a genuine server-owned IsoPlayer that vanilla clients could see without a fake login, socket, or headless client.

The assumption we had to break

This was the question that started True MP NPC:

Can a dedicated server own a real Project Zomboid player even though there is no game client behind it?

Normally multiplayer ties several things together:

login
  ↓
network connection
  ↓
IsoPlayer
  ↓
replication
  ↓
player persistence

For True MP NPC I wanted to keep the important part — the actual IsoPlayer — without pretending that a human-owned client existed somewhere.

That sounds simple until you start following all the assumptions Project Zomboid makes about multiplayer players.

The NPC is an actual IsoPlayer

The server creates a genuine zombie.characters.IsoPlayer.

It gets a real OnlineID and exists in the PZ world as a player-shaped character.

But several things are deliberately missing:

UdpConnection      none
Steam login        none
headless client    none
player DB account  none
client-side mod    none

The first milestone wasn't even movement.

It was proving that this object could be created, registered, ticked and removed cleanly without contaminating structures that belong to real connected players.

Creating an NPC is easy if you're willing to leave broken state behind.

Removing it and ending up with the same connection and player-database state you started with was the more useful test.

Then a vanilla client had to see it

Once the server could own the NPC, the next question was whether an entirely unmodified Project Zomboid client could see it.

This was the important discovery:

The connection receiving information about a remote player does not have to belong to the player being represented.

The server already knows how to describe one IsoPlayer to somebody else's connection.

So instead of manufacturing a fake network connection for Alice, the server can describe Alice directly to real player's real connection.

Conceptually:

Alice's server-owned IsoPlayer
        ↓
vanilla player representation
        ↓
a real player's UdpConnection
        ↓
the vanilla client renders Alice

Alice never becomes a fake packet source.

Movement follows the same principle.

The authoritative position belongs to the server-owned IsoPlayer. Vanilla player update data can be built from that state and sent outward to whichever real clients need to see the NPC.

Standing still was only the start

The first successful result was basically a stationary remote player.

From there the same body gradually gained more of the things a real survivor needs:

  • physical walking;
  • smooth movement;
  • WALK, RUN and SNEAK;
  • same-floor navigation;
  • collision;
  • real door interaction;
  • entering and leaving buildings;
  • windows;
  • low fences;
  • COME_HERE;
  • FOLLOW;
  • GO_TO_TILE;
  • STOP;
  • speech;
  • health and damage interaction.

Later came persistent Homes, autonomous behavior, real inventory, backpacks, two-way vanilla Trade and eventually physical world activity even with zero humans connected.

All of those systems continued using the same genuine IsoPlayer.

There was no point where I replaced the NPC with a custom humanoid actor because the real player body had become inconvenient.

So what actually is a True NPC?

The shortest version is probably this:

YES
✓ genuine zombie.characters.IsoPlayer
✓ real OnlineID
✓ real position in the PZ world
✓ real inventory
✓ real clothing and equipment
✓ real collision and navigation
✓ visible to vanilla multiplayer clients

NO
✗ NPC UdpConnection
✗ fake/headless PZ client
✗ fake Steam account
✗ NPC player-database account
✗ required client-side True MP NPC mod

That last point is still one of my favorite parts of the project.

Someone joining the server doesn't need to know how any of this works. Their ordinary Project Zomboid client receives player information through protocol it already understands.

There's still a huge amount left to build. Combat, full survival behavior, scavenging and social systems all introduce their own problems.

But the architectural question that started the project has an answer now.

You don't necessarily need to build something that looks like a Project Zomboid player.

The server can own an actual one.

The goal was never just to create a convincing player-shaped actor. It was to find out how far a real Project Zomboid player body can go when the server itself becomes the one playing it.

Keep reading

Browse every field note