Система тиков

From Vintage Story Wiki
Revision as of 06:50, 21 February 2022 by Mirotworez (talk | contribs) (Created page with "== Общее == По умолчанию сервер случайным образом проверяет блоки по всему миру каждые 50 мс. Отмеч...")
Other languages:

Эта страница проверялась в последний раз для версии Vintage Story 1.15.


Общее

По умолчанию сервер случайным образом проверяет блоки по всему миру каждые 50 мс. Отмечает радиус фрагмента вокруг игрока. Для каждого фрагмента случайным образом выбираются 16 блоков. У каждого блока спрашивают, хочет ли он получить игровой тик. Если он говорит «да», то местоположение блока будет поставлено в очередь для отметки. Каждый блок решает, что происходит, когда он получает тик, и это различно для каждого блока. Большинство блоков не получают тики. Ниже приведено краткое описание каждого блока, который получает тики, и того, что они делают.

This is not to be confused with the general server tick rate of 33.33ms.

Blocks that tick

Block Behavior Condition Probability
Soil Grows by 1 stage If grass is surrounding it. Can be 1 block above or 1 block below. 1.0
Crops Grows by 1 stage and cycles back to 1 when fully grown Has to be placed during world gen 0.05
Lava Burns combustible items nearby 3 block radius around the air directly above lava. 4 block radius above that. 3 blocks above that. Lava is 1200 degrees. The block temperature

drops by 100 degrees for each meter away from lava. If the block's burn temperature is lower than the temperature at that block position then the block will burn when lava is ticked.

1.0

How long does it take

Since blocks tick at random it's not entirely deterministic how long it will take for a block to receive a tick. However, here is some information to predict about when it should tick.

Every 50ms the server ticks chunks around the player. By default this is a 3 chunk radius including the chunk the player is currently standing in. That means each chunk ticks 20 times per second. Each tick loop, 16 blocks will be ticked. There are 32,768 blocks in a chunk. So that means there is a probability of 16/32768=0.00048828125 of ticking each time or 1/2048. So it will take on average 2048 tick loops for a particular block to tick. Blocks are ticked 20 times per second so it will take on average 2048/20=102.4 seconds for a block to tick.

Configuration

You can change the rate at which the server ticks by editing values in the serverconfig.json file.

Property Controls Default
RandomTickDistance How many chunks around the player to tick 3
RandomTickSamples The number of blocks to tick each loop 16
RandomTickInterval How often the tick loop runs in milliseconds 50
MaxRandomTicks Max queued ticks to process each loop. You shouldn't ever need to touch this 10000

Commands

You can tick a block via the /tickblock command. For example, to tick the block you are standing on you can run the following: /tickblock ~0 ~-1 ~0

Icon Sign.png

Wondering where some links have gone?
The modding navbox is going through some changes! Check out Navigation Box Updates for more info and help finding specific pages.

Modding
Modding Introduction Getting Started Пакет тем
Content Modding Content Mods Developing a Content Mod Basic Tutorials Intermediate Tutorials Advanced Tutorials Content Mod Concepts
Code Modding Code Mods Setting up your Development Environment
Property Overview ItemEntityBlockBlock BehaviorsBlock ClassesBlock EntitiesBlock Entity BehaviorsWorld properties
Workflows & Infrastructure Modding Efficiency TipsMod-engine compatibilityMod ExtensibilityVS Engine
Additional Resources Community Resources Modding API Updates Programming Languages List of server commandsList of client commandsClient startup parametersServer startup parameters
Example ModsAPI DocsGitHub Repository