Forums » General Pantheon Discussion

Dynamic NPC Merchants AI

    • 53 posts
    October 20, 2017 7:33 PM PDT

    Very RAW notes from various game design documents I've generated, but contains several possible ideas.

    Dynamic NPCs that remember characters and what they've done. (see notes in other games developed)

    PC Attributes that the NPC would remember or note:
    Character class or profession.
    Character level. (approximate) Now and last time they met.
    Noted the type of the last 5 unusual item Bought or Sold. What kind a deal was made, hard bargain or quick.
    What jobs/quest were done for the NPC. Can the PC be trusted for delivery jobs?
    NPCs will tell other NPCs in the area if the PC steals or attacks them.

    PC has individual, local, area, global reputation.
    Individual: The NPC tracks each PC.
    Local: Average of all the NPCs that have dealt with the PC.
    Area: Maintained by the Area DB. Affected by major quest and other area wide activities.
    Global: Part of the PCs profile

    Each NPC has it's own SQLite data base file. It has an entry for each PC. If it gets too large, a megabyte or so,
    then the most inactive PCs are pruned to make room.
    There is also a general pruning process to weed out inactive PCs.
    NPCs will barter for non-trivial items. Buy or Sell.
    NPCs offer the going rate for common items. Posted prices.

    Tasks/Quests
    Collection/Harvest
    "I need N of item X and I'll offer you Y for each up to Z of them. After that I'll buy at the going rate."
    PC can ask for more and try to barter. This can lowers their INDIVIDUAL_REP though.
    There may be time conditions. Failing can lower their INDIVIDUAL_REP.
    Success increases their INDIVIDUAL_REP.

    Ideas for the Dynamic NPC Merchant
    NPC information
    A right click on a NPC is used for considering the NPC. The con request returns basic information about the
    NPC as if they were viewed from a distance. The information is based on the PCs experience, level, talents,
    skills, and the NPCs level, dress, skills, talents, etc.
    A low level PC will have difficulty assessing the characteristics of a high level NPC. A higher level PC will
    perceive a clearer picture of the NPC attitude and capabilities.

    NPC Interaction and Reaction Value (RV)
    An NPC should be aware of it's immediate surroundings. If a PC, unknown to the NPC and loaded with
    weapons, walks into the NPCs area, the NPC should con as wary or cautious. If, however, the NPC has
    had numerous friendly dealings with the PC, then they may con as friendly.
    When a PC first interacts with an NPC, the PC is added to the NPCs contacts list. This list starts with a
    reaction value (RV) based on the NPCs biases to the PCs profession, race, etc. The value goes up or down
    based on the PCs actions. The value also tends towards neutral over time. So, the reaction value may first
    start out a little negative because of biases, go positive due to good actions by the PC, and then diminish
    to zero over time because the PC has been away a long time.
    Answers to questions by the PC should also be based on the RV. Just talking in a civil manner to the NPC
    will raise the RV to a limited value. This value will, however, get you better answers. If you just walk in
    and ask "What is a Giant Snake"?, the answer may be "A bigger snake.". If you have the minimum RV, the
    answer may be "Giant Snakes are about 20 feet long and can bite through that cloth armor of yours easily.".

    NPC Question Answers
    Answers to questions by the PC should are affected by the RV. The answers are also qualified by the NPC
    as follows:
    1. Requests for QUEST information will be denied PC that are not the minimum level needed for the
    QUEST. The NPC will also mention the minimum skills needed for the QUEST.
    2.

    NPCs have both global general and specific knowledge. They can answer simple questions of:
    Where is [location]
    Where can I buy [item]
    Where is [NPC]
    What is [item]
    Bracketed [ ] text of a NPCs talk can lead to further inquiry also.

    Not all NPCs have the same knowledge base. The armor merchant can tell you that grade 7 ballistic armor
    can be bought on Cerise III, but may not know where you can get a miniature vibra blade.

    NPC Death
    NPCs as positions of responsibility within the world. If they are killed, another NPC is hired to take their
    place. QUESTs are linked to the position, not the named NPC. NPCs holding a position that makes them
    targets for assassination will have a certain level of protection around them at all times. A NPC that is
    killed that would normally not be a target, like a shopkeeper, may have a temporarily raised level of
    protection.

    • 510 posts
    October 20, 2017 8:03 PM PDT

    Love this idea - well done.  If this is not implemented yet - I say shelve it.  Let's not start anything new until we get coreGame up and running.  But I sure do like how you're thinking man.  Great job!

    I'm happy with the old school merchant mining system that hasn't been available in most games. That is a step in the right direction and easy to implement. What you propose seems like it is going overboard.


    This post was edited by VR-Mod1 at October 22, 2017 2:01 AM PDT
    • 1120 posts
    October 21, 2017 8:11 AM PDT

    I like where your head is at!  I just feel like this would take forever to implement in a game that is already half done!

    I love the idea of becoming a merchant superstar. 

    • 3852 posts
    October 21, 2017 10:04 AM PDT

    I agree good ideas. I also agree if not already being worked on let us not see attention diverted from things necessary to get to pre-alpha, alpha, beta and (whispers in awe at the thought) release.

    Priorities need to be getting Pantheon out the door in good enough shape to succeed. Anything better than good enough to succeed is wonderful but not at the expense of delaying release.

    Firstly. as time goes by, people (including investors) go bye if they decide (even if incorrectly) that the game is vaporware.

    Secondly, after a successful release, more money comes in to be used for improvements as well as maintanance and expansions. 

    The key word is successful - I don't begrudge a second of the time it may take to make Pantheon good enough to succeed.

    • 53 posts
    October 21, 2017 7:46 PM PDT

    I fully agree that there should be no impact to current development. This concept, that I have played around with for almost 20 years, has always been seen as a drop-in module. Hence the reference to using SQLite so as not to impact the main data base.

    Implimentation is not really that difficult once you have a link or handle to the PC's properties, which the Perception system seems to already provide. Since we are aways from release, I plan to code up a demo reel in Unity by hacking their 3D game tutorial that has a Merchant and simple inventory system. A few tables and decision trees are all that are needed. Key words are used so full parsing is not needed. If it's viable, maybe it could be in an expansion.

    I do think this type of NPC, and not all have to have this capability, can add that extra bit to the enhance emersion quality to the game invironment.

    Sidenote: In talking with the devs at TwitchCon, an expansion of the idea is to give Guards a little AI also. They could then answer question from newbees about the area outside the gate or offer suggestions. "You know Warrior, you're not likely to come back in one piece or at all if you hunt in this area with just that cloth armor. You may want to try the south gate area first." or maybe "Good luck. You'll need it if all you have is a Short Sword to hunt nearby."

    • 1281 posts
    October 22, 2017 9:12 AM PDT

    gelfzin said:

    I fully agree that there should be no impact to current development. This concept, that I have played around with for almost 20 years, has always been seen as a drop-in module. Hence the reference to using SQLite so as not to impact the main data base.

    Implimentation is not really that difficult once you have a link or handle to the PC's properties, which the Perception system seems to already provide. Since we are aways from release, I plan to code up a demo reel in Unity by hacking their 3D game tutorial that has a Merchant and simple inventory system. A few tables and decision trees are all that are needed. Key words are used so full parsing is not needed. If it's viable, maybe it could be in an expansion.

    I do think this type of NPC, and not all have to have this capability, can add that extra bit to the enhance emersion quality to the game invironment.

    Sidenote: In talking with the devs at TwitchCon, an expansion of the idea is to give Guards a little AI also. They could then answer question from newbees about the area outside the gate or offer suggestions. "You know Warrior, you're not likely to come back in one piece or at all if you hunt in this area with just that cloth armor. You may want to try the south gate area first." or maybe "Good luck. You'll need it if all you have is a Short Sword to hunt nearby."

    I really like this idea.  My concern is lower-to-mid range computers.  They might not handle SQLite very well.  Maybe a toggle for "smart AI" or something.  As much as I like it, I'm not sure that they would implement something like this because of the ways it could be used to facilitate cheating and them stating that they want to make the client "as dumb as possible".

    • 53 posts
    October 22, 2017 2:54 PM PDT

    The SQlite files are server side files, not local. The SQLite engine is also server side. SQLite is used in many Android phone and tablet apps for local databases, as such, it's fairly light weight and is a good candidate for a module. I've used it for server side processing on several PHP driven sites for quick, low transaction rate, database support.

    It is only a suggested way to impliment this AI concept.