Skip to content

Instantly share code, notes, and snippets.

@alcatrazEscapee
Last active July 11, 2019 21:47
Show Gist options
  • Save alcatrazEscapee/fff9fef9691bc2c9a840054c8cf9cc8f to your computer and use it in GitHub Desktop.
Save alcatrazEscapee/fff9fef9691bc2c9a840054c8cf9cc8f to your computer and use it in GitHub Desktop.

TFC Time Systems Design Doc

Vanilla Systems

  1. World Total Time
  • Incremented on every server tick
  • T=0 is the beginning of the world
  1. World Time
  • Incremented on every server tick IF game rule doDaylightCycle is true
  • Incremented when players sleep
  • T=0 is the beginning of the world

TFC Systems

  1. World Total Time
  • Incremented on every server tick
  • T=0 is the beginning of the world

Examples:

  • Decay of heat over time on IItemHeat
  • Delay between gulps when drinking (10 ticks)
  • Time required for a pit kiln to complete (8 hours)
  • Time required for alcohol to ferment in a barrel (72 hours)
  1. "Logged On Player Time"
  • Incremented on every server tick IF at least one player is logged on to the server
  • Incremented when players sleep
  • T=0 is the beginning of the world

Examples:

  • Food Expiration Dates
  • Crop Growth Timers (4 days)
  • Sapling Growth Timers (8-12 days)
  • Animal Aging (1 year = 96 days by default)
  1. "Calendar Time"
  • Incremented on every server tick IF game rule doDaylightCycle is true
  • Incremented when players sleep
  • Incremented/Decremented by changing month length
  • Incremented/Decremented by changing the time via command
  • T=0 is 1000-01-01 00:06:00 (January 1, Year 1000, 6 AM)

Examples:

  • Temperature calculations (month based)
  • Precipitation (snow vs rain)
  • Visual Displays for systems that otherwise use the above systems (i.e. food expiration will display a Calendar Time, but internally use a "Logged On Player Time")
  • Seasonal grass color changes
  • Seasonal blooming of wild flowers

Configuration Options + Things to Consider

Month Length:

  • When changed, affects Calendar Time. Date will remain constant.
  • Modifiable via /timetfc command
  • Default length is 8 days. Configurable within a range.
  • Configuration options should be measured in either units of TICKS, or DAYS (which will be converted to ticks later)

Time Values

  • i.e. Pit Kiln Completion Time, Crop Growth Time, Food Decay Time
  • Modifiable via config file
  • When changed, affects all current or new objects, based on the individual implementation. (i.e. Pit Kilns use a tick/count down model, so only new ones will be affected. Crops use a start date/check model, so existing crops will update as well
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment