时间
跳转到导航
跳转到搜索
海狸的一天有24小时,对应现实时间460秒[1]。游戏的昼夜系统时长固定:白天16小时,夜晚8小时。
游戏提供了三种游戏速度,分别对应1倍、3倍、7倍速[2]。
实际上,由于各种影响因素(比如CPU性能限制),游戏中的一天会更长。但理论上,三档速度下一天的现实世界时长(分钟)为:7:40、2:33和1:06。
游戏中各项工作均需要花费时间。在游戏数值设计中,工作时长以游戏内小时和天来设定(如XXXTimeInHours、XXXTimeInDays),不是现实时间。
游戏属性
游戏中的时间由`TimeSystemConfigurator.prefab`设置。
重要的设置项有:
_hoursPassedOnNewGame: 4 _configuredDayLengthInSeconds: 460 _configuredDaytimeLengthInUnits: 16 _configuredNighttimeLengthInUnits: 8
其中 _hoursPassedOnNewGame,设置了开始游戏时的时间偏移,如:4表示游戏开始于天亮后4小时。
其中 _configuredDayLengthInSeconds,设置了一天的长度(秒)
其中 _configuredDaytimeLengthInUnits 和 _configuredNighttimeLengthInUnits 设置了白天和黑夜的比例。比如,游戏中计算白天、黑夜时长的方式位于 DayNightCycle.cs,细节为:
int num = _configuredDaytimeLengthInUnits + _configuredNighttimeLengthInUnits; _daytimeLengthInSeconds = _configuredDaytimeLengthInUnits / num * _configuredDayLengthInSeconds; _nighttimeLengthInSeconds = _configuredNighttimeLengthInUnits / num * _configuredDayLengthInSeconds;
- ↑ 在游戏解包后,文件 TimeSystemConfigurator.prefab 中 _configuredDayLengthInSeconds = 460
- ↑ 游戏倍速的间接依据:
- 游戏解包后 SpeedControlPanel.asset 中,几项m_Properties的值为Speed0、Speed1、Speed3、Speed7。
- 在10x10无海狸自定义地图中,实测一天时间约为:三速66s、二速155s、一速464s。以460s作为基准,分别对应6.96倍速,2.97倍速,0.99倍速。
- featureupvote中的讨论