Post:General Info: Logic and Hunger - 05/23/2012 - 23:21

From Elanthipedia
Jump to navigation Jump to search
General Info: Logic and Hunger · on 05/23/2012 11:21 PM CDT 282
Warning. Details and numbers incoming. For those who enjoy a 'behind the scenes' perspective, this should be up your alley.

There are three separate timer mechanics, and I don't want them to be confused. For simplicity, the term 'caravan' below applies to caravans and pack animals unless otherwise noted.

1) The caravan is auto stabled if you are lying dead in the same room as your caravan for ~35 minutes.
2) The caravan is auto stabled if you are offline for ~60 minutes.
3) The hunger/starvation effect.

I did make an update last night that if you ARE lying dead in the same spot as your caravan, it cannot starve to death. A passerby will feed it to keep it alive while you are dead, if you are in the room with it. If you leave it sitting and go hunting and die somewhere away from the animal/caravan, then standard hunger mechanics apply, and it can starve to death.

OLD LOGIC:

Under the old system, each time the caravan acted, this was its logic:

1) Ensure the hunger effect is being tracked (no processing of said effect, just ensuring the caravan is aware of its hunger).

2) Determine if the owner is online or offline. If offline, slow it to act once per minute and reset the offline tracker (upon first noticing owner is offline). Each minute after that initial one, the offline tracker is increased by 1. At 61 minutes, the caravan gets tired of waiting around and is shipped off to the stables. Hunger tracking continued to function -- it could starve while waiting on you.

3) If the owner returns from being offline, the caravan clears the offline tracker and stands around waiting on the owner to be with it (if you logged while not with it). Hunger continues to function. When you return to where the caravan is, you get the 'snorts in irritation' or 'Shall the caravan begin to move again' message. It's waiting on your command at that point, and still only acting once a minute.

4) There was weird, broken logic in this step: If the owner is dead (anywhere, not just in the room with it) and it's only acting once a minute (which was never set), then call to the run away mechanics. The run away mechanics make it act once a minute, make it stop whatever it was doing (stand still), and give a message -- but it would never actually make the caravan run away. Unless you went offline while dead in the room with it to force the act-once-per-minute mechanic, then none of this would ever have been triggered, and it was only messaging if it did.

5) Movement -- either following the owner or moving along an auto route.

NEW LOGIC:

For the most part, it mirrors the old, it's just based around cleaner coding. Each time the caravan acts now, this is the logic:

1) No functional changes -- ensure the caravan is aware of its hunger status.

2) No functional changes -- If owner is offline, the caravan acts once a minute for 60 minutes. At 61, if the owner hasn't returned yet, it goes to the stables. Hunger continues to function during this process -- it can starve if you left it hungry.

3) No functional changes -- tracker is reset if you come back online, and it stands around waiting for you to join it and give it a command. Hunger continues to function.

4) Made to work -- If the owner is dead and in the same room with the caravan, it will message and call to the run away mechanics. The run away mechanics increase the dead owner tracker once a minute up to ~35 minutes and gives a message. If you're still sitting there as a corpse at the end, the driver gives up and heads to the stables. If you're dead while with the caravan, your caravan won't starve while waiting on you to live. If you die elsewhere away from the caravan -- it doesn't care and will do whatever it was doing until it starves to death if you don't get back to it.

5) No functional changes -- it follows the owner or leads along an auto route.

HUNGER MECHANIC:

Unless noted above, hunger checks pulse at fairly regular intervals independent from the normal actions (movement, milling about, etc) of the caravan. There are technically 13 stages of hunger, including death and decay, noted below. In most messaging cases, messages only happen if you're with your caravan.

1) Messaging.
2) Nothing.
3) Nothing.
4) Nothing.
5) Messaging. Pack animals will jerk on reins to pull you from hiding. Both stop following or leading until you tell them to do so again. 6) No messaging, but stops moving until you tell it to do so again.
7) Same as 5.
8) Same as 6. Also forces it to slow down.
9) Same as 6. If you're with it, it will also knock you down and remove you from hiding. Forces it to slow down.
10) Messaging. It refuses to move until fed.
11) It gets flagged as "starving", stops acting, and will refuse further TELL attempts to make it move.
12) Messaging. The animal dies. You can't feed it or command it anymore.
13) Messaging. The animal decays away and the driver hauls your personal belongings (not contract/commod crates) back to the guild.

With no feeding offered, there are 15 minutes (900 seconds) between each stage except 12 going to 13, which is just shy of 2 minutes. At that point, it's dead so it doesn't matter anymore. So, 11 sets of 15 minutes of hunger = 165 minutes on average before a caravan will starve to death...just shy of 3 hours.

Different foods can provide different timers from the point of feeding. For simplicity, these numbers are for using standard foraged grass. When you give it to the caravan, it reduces the hunger stage by 1 and resets the timer loosely based on the amount of grass (count it): 1 part sets an 800 second timer for for pack animals and 500 for caravans; 2 or more parts sets the timer to 1000 seconds for pack animals and 800 for caravans.

Some foods will reduce the hunger by more than one stage at a time, but they also add a shorter timer (roughly 1.5 minutes) than grass. Different foods also use different amounts/parts for effectiveness. Grain, for example, provides a stronger effect for 5+ parts than if it were just 1-4 parts.

No matter what you feed it, though, if the stage advances after a feeding, then standard 15 minute intervals resume until you feed it again. In other words, feeding is a one-time replacement to the standard 15 minute stage timer.

Feedbags: Using a feedbag with sufficient amounts inside it will reset a caravan to stage 1 hunger. If you don't have enough inside to fully reduce it to stage 1, it'll reduce to whatever you DO have food for. In both cases, it establishes the standard 15 minute timer without regard for what food was in it.




There you go. I don't think there's any new information in there, but this is how the three timers work currently with as much detail as I can give.

This message was originally posted in The Traders \ Game Master and Official Announcements, by DR-ZADRAES on the play.net forums.