-
Notifications
You must be signed in to change notification settings - Fork 0
Game Tick System
The Ad Astra game engine works on the prinicple of a game 'tick'. There are two types of game ticks, microtick and a tick. A microtick is usually used for updating progress indicators and smoother movement at the start of turns. No game chaging actions should happen on a microtick.
A tick is the ad-astra verson of a turn from turn based games. Except, in AdAstra all turns happen simulatiously and all events occour on each tick.
The GameClock (adastra.engine.GameClock) calls the tick method of the Galaxy (adastra.engine.Galaxy) which in turn calls the tick method of all sectors, which in turn calls the tick method of all assets in those sectors. If the assets have sub-components (buildings on planets for example) it is the assets reponsablity to pass the tick on to the sub-components. This is simliar to how swing does repainting.
The gameClock recives the clock from a timer, as gameClock implements timerTask, at present SectorController on the client is creating the timer and game envroment. This is only for debug purposes and is not the final game design.
The same happens for a microtick except it is the microtick methods which are called not the tick methods. A tick should take resonable mesures to ensure that the game is in the 'true' state as represnted by the ticks.