Documentation / Tile Tick Core RPG / Programmer

Ticks & Movement

How the 0.6 second gameplay clock, pathfinding, movement authority, run energy, occupancy, and client presentation fit together.

Gameplay cadence and movement are separate from NGO's network tick. RPG logic resolves on TickManager; NGO transports and replicates state at its own rate.

The gameplay clock

using GreenCloakGames.TileTickMovement.Tick;
using UnityEngine;

public sealed class MyTickSystem : MonoBehaviour
{
    private void OnEnable()
    {
        if (TickManager.Instance != null)
            TickManager.Instance.OnTick += HandleTick;
    }

    private void OnDisable()
    {
        if (TickManager.Instance != null)
            TickManager.Instance.OnTick -= HandleTick;
    }

    private void HandleTick(long tick)
    {
        // Authoritative gameplay work belongs here when running on authority.
    }
}

TickManager defaults to a 0.6 second interval, increments a monotonic long, catches up missed ticks after frame spikes, and exposes pause/step support. On a pure client, NetworkTickSynchronizer pauses the local gameplay tick and exposes the replicated server clock for presentation.

Movement request flow

Owner input chooses destination
NetworkPlayer submits intent
Server validates player/readiness
PlayerMovementAuthority resolves surface
ServerOccupancyService checks destination
MovementMotor pathfinds
MovementMotor advances on gameplay ticks
ReplicatedMovementView presents result

PlayerMovementAuthority

This is intentionally transport-agnostic. It receives a validated MovementCommandRequest, resolves the requested surface against GridManager, checks occupancy, and calls the existing MovementMotor. It does not accept a client-provided path or final transform.

Run state: movement orders do not toggle running. RunEnergyController owns authoritative run state through its dedicated request path.

Do not bypass the motor

Combat chase, interaction approach, minimap click-to-move, and travel arrival should converge on the same movement/grid authority. Writing directly to transforms or creating a second pathfinder will bypass occupancy, layered-surface resolution, nearest-reachable fallback, and tick timing.

When Update is appropriate

Use Update() for client presentation such as interpolation, cursor/UI behavior, camera work, or animation smoothing. Use the gameplay tick for rules whose timing must stay deterministic with combat, skilling, movement, or server simulation.