The "State" Concept and Data Structure
Zac Adam-MacEwen edited this page 2025-02-19 19:18:08 -04:00

The following variables all need to be tracked for gameplay to be meaningful and linear. For certain stretch features it may be useful for all of this data to be in a structure; right now we're using the term relatively loosely to refer to the "Data Structure" as a whole rather than struct.

  • AGE will be the integer number of days since the egg hatched. The point at which this is incremented is arbitrary. When the pet wakes up in the morning may be the sanest choice.
  • ACT is an integer showing certain states. It is both an indicator of what life state the PET is in and a modifying value for certain other features like hunger/fun progression. Defined values are currently:
    • 0 if asleep
    • 1 if awake
    • 2 if sick
    • 3 if egg
  • HUNGER_FUN, a byte wherein the upper nibble represents the pet's hunger score and the lower nibble is their fun score, with 0 being empty and 15 being satisfied.
  • Discipline, a byte containing the discipline score. Used as part of the evolution calculation.
  • Naughty, a byte functionally bounded to 100, which is the chance of the pet "misbehaving" (throwing a meaningless alert)
  • ID, a character specifying which stage of life the pet is in.
  • Health_Byte, a byte used to hold various "health" elements used to calculate the result of the function determining if a pet should be set as sick, including tracking how "dirty" and "heavy" the pet is.
    • Lowest two bits used to indicate number of times the pet has pooped, to a maximum of 4, since the last time it was bathed.
  • screen, an integer value describing what screen we are on, whether it is the default/idle screen, clock display, or a specific menu, etc.