Skip to content

DayZ Studio 0.1.0-alpha.6 - NPCs with a life of their own

Pre-release
Pre-release

Choose a tag to compare

@github-actions github-actions released this 22 Oct 13:53
· 7 commits to main since this release

NPCs with a life of their own

Until now an NPC stood on one spot and waited for players to talk to it. This alpha gives NPCs their own 👤 NPCs tab and a node graph for how they behave: they walk patrols, wander, keep a daily routine, react when you come near, say things, wave, sit by the fire, follow you, lead you somewhere - and you can script your own behaviours too.

🧪 Still an alpha. Please tell us what breaks or confuses you.

Already on an earlier alpha? DayZ Studio will offer this update by itself when it starts (or File ▸ ⟳ Check for updates). Your projects, keys, workspace profiles and map data are kept.

Your NPCs move house: NPCs you made inside quests ("Talk to NPC") are turned into NPCs of the new tab the first time you open a project. Their quests use them exactly as before - but their look, position and behaviour are now edited in the NPCs tab.

Running a server with a mod you made? Rebuild it and update it on your server to give your players the new NPCs.


What's new

👤 The NPCs tab (Alt + 5, next to Quests). Every NPC is one character with:

  • its look - face, outfit, clothes, weapon or tool in hands,
  • its place - where it stands on the map (drag it there), which way it faces,
  • its faction and trader (if it runs a store),
  • its behaviour - a node graph, built like a quest.

Quests now pick an NPC in their "Talk to NPC" node, so one character can give several quests. NPCs no quest uses still spawn and live their routine - a sentry, a wandering scavenger, a guard.

🧠 Behaviour: events start actions. Drag nodes into the graph and wire them up:

  • Events start a chain: Spawned, Player comes near, Talked to, Hostile player seen, Time of day, Condition.
  • Activities go on until something replaces them: Patrol, Wander, Stand at, Follow player, Escort to, Guard.
  • Steps run one after another: Walk to, Wait, Face player, Say, Emote, Give item, Set server variable, Leave.
  • Flow: Only if (a condition) and Random (variety).

A few things you can build in a minute:

  • A camp sentry with a schedule - Time of day 6–20 → Patrol, Time of day 20–6 → Stand at the fire (sit by the fire).
  • A friendly greeter - Player comes near → Face player → Emote: wave → Say "Welcome to the camp."
  • A guide - Talked to → Say "Follow me" → Escort to the road → Give item → Walk back → Wander.

🚶 Patrols that look right. NPCs walk straight between waypoints, wait at each one, loop or go back and forth, walk or jog, and turn to face where they're going. They stop and turn to you when you're within 3 m, so you can always talk to them - and the talk prompt, conversations and trade screen follow them wherever their route takes them.

🗨 Say lines and 👋 emotes. What an NPC says floats above its head for players nearby. 19 emotes from the game: wave, point, thumbs up, come here, nod, shake head, clap, shrug, salute, dance, sit, sit by the fire and more. An NPC sitting by the fire stands up before it waves, then sits back down.

🐾 Follow and 🧭 escort. An NPC can follow the player who talked to it (and call after them if they run off), or lead them somewhere, waiting whenever they fall behind.

🧩 Your own NPC nodes. Advanced users can write NPC steps and events in Enforce Script: right-click the graph ▸ Make your own node…. An NPC event is checked every second for each player nearby (e.g. "a player holds a flare"); an NPC step gets the NPC and the player who started the chain. Four examples to start from.

🏕 Try it in the Showcase. File ▸ Templates & examples ▸ Showcase now has four NPCs: Mirek sits by the fire and waves you over, the Bandit Boss guards the road, Vlad patrols the camp by day and sits by the fire at night, and Olga walks you to the road if you ask her.

🗺 On the map. Every NPC shows with its name; the one you're editing shows its patrol route, wander area and destinations. Click to select, drag to move, double-click to open its graph.

For veterans and modders: the technical details
  • Data: project.npcs holds the characters; a quest's Talk to NPC node points at one with npcId, and the NPC's settings are mirrored into it so exports work as before. Behaviour graphs are exported to quests.json as brains; NPCs no quest uses go into npcs.
  • Runtime: one DSBrain per character, ticked once a second - event detection (per player, with cooldowns), a step queue (every wire runs in order; Random picks one) and the current activity. A HumanCommandScript walks and turns NPCs nobody controls: the engine only turns such a character within half a circle of its last SetOrientation, so NPCs face each new leg first, and walking uses the script's own translation (the walk animation's root motion drifts).
  • Emotes: upper-body gestures via AddCommandModifier_Action over the movement command (the NPC is stood up first), full-body ones via StartCommand_Action with the emote's own stance mask. A gesture is over when its callback returns to "no state" or its action finishes - then the script hands the character back, since nothing else would start its next command.
  • Say: RPC 77430016 → a world-anchored text widget on each nearby player's screen, following the NPC by network id.
  • Custom NPC nodes: two new custom-node kinds - cnb_* (static void CNB_X(PlayerBase npc, PlayerBase player, array<string> args)) and cne_* (static bool CNE_X(PlayerBase npc, PlayerBase player, …)); DSCustom always carries RunNpcNode / CheckNpcNode.
  • Graph editor: the quest editor and the NPC editor now share one engine (js/grapheditor.js).
  • Play-test trace: the progress log lists every event and step each NPC runs, and each NPC's gesture state.

Known issues

  • Talked to works on NPCs no quest uses; an NPC that gives quests talks through its quest conversations.
  • Not yet tried in a live game: Follow giving up, the Guard node, Hostile player seen, Condition, Walk to, Wait, Random, Leave. They're built - please tell us if one misbehaves.
  • NPCs walk in straight lines and don't path around walls - put a waypoint at every corner. One that gets stuck for a few seconds is moved on to its next point.
  • Still from earlier alphas: the docked game window hasn't been tested in every workspace layout; the four views can't float in their own window yet; with Nahimic audio software the installer may close right after starting (run it again).

DayZ Studio is a free, fan-made tool and is not affiliated with Bohemia Interactive.