Generic selectors
Exact matches only
Search in title
Search in content
Search in project

Hunger, warmth and any other survival stats


For all those who have wanted hunger, warmth and other survival stats in their games, Atavism now provides the type of stat known as Vitality Stats. These stats allow a change in the value over time (known as a shift) with actions that can be set upon reaching the minimum or maximum value (such as the player/mob dying).

对于那些在游戏中想要饥饿,温暖和其他生存统计数据的人来说,Atavism现在提供了称为Vitality Stats的统计类型。这些统计数据允许随着时间的推移改变值(称为班次),可以在达到最小值或最大值时设置动作(例如玩家/暴徒死亡)。

For example, a hunger stat can be set with a max of 100, and a min of 0. The stat can be set to increase by 2 every 6 seconds, with death occurring when hunger reaches 100. If the player doesn’t eat some food (or have some effect applied) that decreases their hunger, they will die in 300 seconds (5 minutes).


There are 3 steps in setting up a Vitality stat: Creating the max stat, creating the vitality stat, and setting the stat on the character template.


Creating the Max Stat

创建Max Stat

A max-stat needs to be set up to control the maximum value of the vitality stat. Open the Stat plugin in the Atavism Editor and create a new stat with type Base Stat. I generally put the word “max” in the max-stat name to help identify it. Leave Stat Function as none and ignore the Mob Values.

需要设置max-stat来控制活力统计的最大值。在Atavism编辑器中打开Stat插件,并使用Base Stat类型创建一个新的stat。我通常在max-stat名称中加上“max”这个词来帮助识别它。将Stat Function保留为none并忽略Mob值。

Example max stat:

示例max stat:

Creating the Vitality Stat


The vitality stat setup involves setting the shift data (how much the stat changes by itself over time), the requirements for the shift to occur, and what happens when the min/max values are reached.


To create a vitality stat, open the stat plugin in the Atavism Editor and set its type to Vitality Stat. Set the minimum value you want (generally 0) and set the Max Stat to the stat created in the step above. If the stat should only effect players then tick the Player Only check box (most Vitality stats will be player only, otherwise you will have random mobs and NPC’s dying). Set the Shift value to how much the stat will change each update, and if the stat can be reversed (such as breath going back up when you are out of water) then set the Reverse Value. Now set the Shift Interval to how often (in seconds) you want the stat to update.

要创建活力统计,请在Atavism编辑器中打开stat插件,并将其类型设置为Vitality Stat。设置所需的最小值(通常为0),并将Max Stat设置为上一步中创建的stat。如果统计数据应仅影响玩家,则勾选“仅限玩家”复选框(大多数活力统计数据仅限玩家,否则您将有随机小怪和NPC死亡)。将Shift值设置为每次更新时统计数据的变化量,以及是否可以反转统计数据(例如当您离开水面时呼吸恢复),然后设置反向值。现在将Shift Interval设置为您希望stat更新的频率(以秒为单位)。

Note: Reverse mode is not functional yet and will be included in the next update.


Set the On Min Hit and/or On Max Hit to what should happen when the stat reaches either its minimum or maximum. By default the only option at the moment is death. The system is designed for more options to be added in the future.

将On Min Hit和/或On Max Hit设置为当stat达到其最小值或最大值时应该发生的情况。默认情况下,目前唯一的选择是死亡。该系统旨在为将来添加更多选项。

The last part for the Vitality Stat setup is the requirements. Requirements can be set so stats only update when certain states are true for the player, such as the player is alive, or not in combat. The current version provides only these two options with support for new requirements to be added in. If the stat update is to run all the time, add no requirements. Click Save Data and the only task left is setting up the stat for your character templates.

Vitality Stat设置的最后一部分是要求。可以设置要求,以便统计数据仅在玩家的某些状态为真时更新,例如玩家处于活着状态,或者不在战斗中。当前版本仅提供这两个选项,并支持添加新要求。如果要始终运行stat更新,请不添加任何要求。单击“保存数据”,剩下的唯一任务是设置角色模板的统计信息。

Example vitality stat:

Explanation: The hunger stat goes up by 2 every 10 seconds and when it reaches the max value (which is 100) they will die.



Setting the Stat on the Character Template


The stat now needs to be set on each character template that has been created in the Player Character Setup plugin.


Open the Player Character Setup Plugin and for each template scroll down to the new stats and set their values. Be careful when setting the base value for the vitality stat on the character as it can result in instant death (and character creation issues) if it triggers the onMin or onMax events (for example, if the onMax action is death and the starting value for the vitality stat is equal to the max value).


Example stat values on my character template:


Other ideas

From here you may want to offer ways for players to prevent their death from a vitality stat such as adding items that can be consumed that decrease the stat or giving them abilities they can activate. These ideas can be achieved using Stat Effects that modify the value of the vitality stat.

As Atavism development continues the plan is to add many new states and onMin/onMax actions to provide better gameplay. One example is warmth that can be increased while near certain objects (fires) and decreases when outside and based on the weather. Any adventurous programmers should be able to achieve results like this already using the base that has been programmed in.


从这里你可能想要为玩家提供一些方法,以防止他们死于活力统计,例如添加可以消耗的物品,减少统计数据或赋予他们可以激活的能力。可以使用修改活力统计值的Stat Effects来实现这些想法。

随着Atavism的发展继续,该计划将添加许多新状态和onMin / onMax动作,以提供更好的游戏玩法。一个例子是在靠近某些物体(火灾)时可以增加的温度,在外面并且根据天气减少的温度。任何喜欢冒险的程序员都应该能够使用已经编程的基础来实现这样的结果。