NPCs….

This week I worked on NPCs (non-playable characters). They are basically the other survivors in the city.

NPC AI is based on zombie AI. It runs in a modular behavioral hierarchy. Right now NPCs can perform many different actions. They can wander, give the player attention, attack the player, attack zombies, flee, talk, etc.

If they’re near the player, they can shout phrases in small, floating speech bubbles. These phrases can be greetings, cries for help, taunts, etc.

You can initiate a full chat with an NPC, by walking close to it and pressing the chat icon that pops up in the top right of the screen. In these full chats you can respond to what the NPC says and essentially have a little conversation with them. Certain responses you give will trigger a positive reaction in the NPC, other responses will trigger a negative one. You can also ask the NPC to follow you, or trade with you. If you anger the NPC too much while talking to him, he will attack you.

NPCs will also attack you if you purposely attack them, and if nearby NPCs see this altercation, they will gang up attack you as well.

The full NPC chat system is based on a dialog tree editor that I wrote, which uses Helium for its schematic view. Here is a scaled-down image of a complex dialog tree created for generic NPCs found outside of the sewers:

The blue boxes are branch nodes that are seed-locked to each NPC, so NPCs will “respond” to a player’s dialog choice predictable at that point in the tree. The rest of the branches are chosen at random to keep conversations unique. Green lines represent conversational choices that trigger a positive reaction in the NPC. Red lines represent negative reactions. If you insult/threaten an NPC too much during a conversation, he will attack you.

 

4 Responses to “NPCs….”

  1. karel says:

    Now your game is on my “must have” list. The player can choose to be evil .

    The destructible environment + NPC adds a quite good strategic element to the game. When you are in trouble you can use NPC for your benefit. Hit him a couple of time and he will drops down. Next thing you know all the zombie mob is around him and this gives you the window of opportunity to escape.

    This is not just a typical everyday zombie shooter game anymore. 🙂

  2. Fawzi says:

    You’re a crazy genius Tyson, I’m glad you’re taking advantage of it. lol 😛

  3. Ziboo says:

    Hey Tyson,

    I’m wondering how did you use Helium with Unity ?
    I thought it was just for 3dsmax ?

    Keep going the game looks great !
    Any Android version ? 😀

  4. Tyson Ibele says:

    @ Ziboo:

    I used Helium inside 3dsmax, then wrote an exporter to export the node data into a usable form within Unity 🙂

    Android version will happen if iOS version does well.

Log in or Register

Leave a Reply to Ziboo Cancel reply

Your email address will not be published. Required fields are marked *