Kawa-oneechan / Noxico

An erotic roguelike, basically.
http://helmet.kafuka.org/noxico
Other
28 stars 6 forks source link

Goals, Needs, Drives #2

Open Kawa-oneechan opened 5 years ago

Kawa-oneechan commented 5 years ago

(Reposting from Bitbucket)

Recently, I commented out the whole scheduler subsystem pending a more Lua-friendly replacement. Here's what I came up with:

Given no profession or goal, a character will wander around as current.

A character's stats will change over time, as would the player's.

Characters can have goals assigned, by the game or by their stats.

Goals have associated task lists. These tasks can themself contain tasks, being stored and managed as token trees, and any given subtree may cancel out.

For example, the "go to sleep" goal might be subdivided like this:

  1. get undressed
    1. do we have an assigned closet? if not, cancel this task -- that is, cancel "getting undressed", not cancel "going to sleep".
    2. go to the closet.
    3. undress and stash clothes.
  2. go to bed
    1. do we have an assigned bed? if not, is there a free bed nearby? if still not, cancel this task.
    2. go to the bed
  3. lay down and sleep.

Later, the "wake up" goal might be subdivided like this:

  1. stand up
  2. get dressed
    1. do we have an assigned closet? if not, cancel this task.
      1. go to the closet.
      2. pick out an outfit and equip it.

These two would be assigned at due time by the game, and might be adjusted by both random chance and personality traits.

Other goals may include "manage shop", "get off", "look for the player", "hunt for the player"...

Open question

How do we store these tasks, both in definition and as character data? How much of it is scripted? Perhaps all BoardChar would have a script run every time they get to make a move and that script processes their task Token, adding, removing, and replacing them as needed? That'd mean we'd have no more use of the Motor enum -- wandering and hunting would be handled by the task script, and standing still just equals having no task at all. never mind that we don't use Motor at all. But anyway basically the entirety of BoardChar:ActuallyMove() and BoardChar.Hunt() would be reduced to a script?

Kawa-oneechan commented 5 years ago

While talking about this on Discord, I figured the task lists might be simply text tokens that map to Lua scripts, so the gotosleep token invokes goals/gotosleep.lua or something like that.