NPCs Progress Report

by SDGNelson

Posted on September 23, 2016

This week I've been working on the backend/functionality for NPCs and I'm quite happy about the amount of progress so far!

Characters are created with a new object type where you specify all the clothes, gear, equipped items, hair, etc you want them to have and then can be placed in the level editor. They have plenty of unique idle animations, look around, inspect their items and will look at you when you're standing next to them or talking to them so they aren't static like most objects!

You then create a Dialogue which will be opened when the character is spoken to. The dialogue contains a list of potential messages for the NPC to say, and a list of clickable responses which chain together more dialogues. The text is animated and can have pauses inserted for emotional moments, although it can be skipped with F or disabled entirely in the options menu:

Now here's where it gets interesting: Every message and response is optionally given a list of Conditions and Rewards. Conditions limit when something can happen for example the player has to have the Police skillset, or their reputation has to be less than -20, or they need a special access pass item they were given from a quest.

To give you a lot of options with this there's a Flags system which is stored per-player and can track information for you like the player's karma with a group, whether they said something to someone or how many times they performed an action. Most NPCs will use this in one way or another, but the biggest I have planned is to allow you to rank up through the Coalition as you do more quests to help out.

Rewards then allow you to give the player items/experience/reputation and/or set these flags which can then be checked by conditions.

The Quests system is built on top of these Conditions/Rewards, and can be given to the player as a reward. There is a new list in the information tab which shows all of your quests and lets you inspect them to check your progress:

NPCs can also run stores which buy/sell specific items for XP points:
Note: This menu especially still needs a bit of work

Another main thing I did this week was bring back the reputation system. It's now determined by who the aggressor was: if you attacked first your rep will decrease and vice versa. You can also boost your rep by healing other players. Reputation is shown in the chat, playerlist and when looking directly at someone, and is titled/color coded as their score gets larger. Unfortunately it's tricky to determine whether a kill was offensive/defensive, so if this doesn't work out very well it can easily be adjusted more similarly to 2.0.

The rest of today and probably a bit on the weekend I'll still be polishing up these features, for example adding item icons to the quest details, fixing bugs, improving the UI and more options for conditions/rewards. My goal/plan for next week is to start on the actual content with an NPC base in the waters of Southern Russia for next Friday!

You might also like...