8 Home
Hector Kio edited this page 2017-09-18 01:53:39 -04:00

Advanced NPC mod

Advanced NPC is a mod for Minetest that aims to add slightly smart NPCs to the game. The ultimate goal of this mod is to use it together with the mg_villages to create live villages.

This wiki will be used to hold the documentation of the mod for both users and developers.

Current roadmap

Version 1.0

NPCs has the following abilities:

  • Inventory: a 16 slot custom inventory, with methods to add, check and remove items.
  • Flags: a simple table that can hold different variables. They can be used to drive events.
  • Actions: a queue that can contain a set of specific actions that execute at fixed timer interval.

Phase 1: Gifts and relationships: In progress

  • NPCs should be able to receive items
  • NPCs will have favorite and disliked items
  • Giving an NPC their favorite or disliked item will affect positively/negatively their relationship with that player.
  • Eventually, an NPC can fall in love with that player and marry him/her
  • Relationships among NPCs should be possible too. This will be for another phase.

Phase 2: Dialogues: Complete

  • NPCs should be able to perform complex dialogues:
    • Use yes/no or multiple option dialogue boxes to interact with player
    • Answers and responses by player
  • Specific dialogues on certain flags (so that events can change what an NPC says)

Phase 3: Trading: Complete

  • NPCs should be able to trade, either buy or sell items to/from player and other NPCs
    • There are two types of traders: casual and dedicated.
      • Casual traders are normal NPC which occasionaly make buy or sell offers to the player
      • Dedicated traders are traders that, when talked to, always make buy and sell offers. They have a greater variety too.
  • NPCs will also be able to have custom trade offers, useful for example, for repairing tools. For this version, only sell custom trades are supported (NPC selling to player) with up to 4 payment items accepted.

Phase 4: Actions: Complete

  • NPCs should be able to use chests, furnaces, doors, beds and sit on "sittable" nodes
  • NPCs should be able to walk to specific places. Should also be able to open doors, fence gates and any other type of openable node while going to a place.
  • NPCs should have the ability to identify nodes that belong to him/her, and recall them

Phase 5: Schedules and fundamental jobs: In progress

  • NPCs should be able to perform different activities depending on the time of the day. For instance, a NPC could be farming during the morning, selling its product on the afternoon, and comfortable sitting at home during the night.
    • A schedule will consist of a table of hours and an activity that the NPC will perform once it is that time of the day
    • Hours will be consistent with the /time command, therefore hours should be close to 1 min in real life
    • Activities will be and array of actions/tasks
    • An NPC can have more than one schedule. but for the first version, only the first one will be executed.
  • Add the fundamental jobs, which are:
    • Mining
    • Wood cutting
    • Farming
    • Cooking
      • NOTE: Jobs may be left for another version

Phase 6: Advanced spawners for villages

  • Support for mg_villages mod by Sokomine
    • Identify, on medieval villages, houses that NPC can live on.
    • Identify the amount of NPC that the house can support
    • Spawn NPCs and assign them a bed. Detect sharable objects (chest, furnace, benches)
    • Assign them random schedules based on the type of building they spawn.

Version 2.0

Phase 7: Make NPCs scriptable

Phase 8: Improve NPCs pathfinding, allow them to go upstairs.

Phase 9: Improve NPCs so that they can tame and own farm animals

Phase 10: Improve NPCs so that they can run on carts, boats and (maybe) horses

Version 3.0

Phase 11: Integrate with commerce mod

Phase 12: Improve relationships for obtaining more benefits from a married NPC

Phase 13: Improve AI to include support for house families

Phase 14: Improve AI to create village communities