How long is a game tick?

From OHRRPGCE-Wiki

Jump to: navigation, search

A game tick, one internal cycle, is a refreshment of the screen contents and user inputs, plotscripts, etc. Every tick, non-stationary heroes and npcs move a number of pixels equal to their speed. An npc moving at speed 5 will move 5 pixels, and therefore take 4 ticks to move one tile.

Normally, GAME.EXE runs at a steady 18.2 ticks per second, the default rate of the DOS timer. However, the timer can foul up if you minimise and then restore GAME.EXE under windows (which also fouls up game time), or if you have lots of scripts running or alot of animated tiles or npcs on screen at once.

When you use the plotscripting command wait(n), your script stops running until n ticks have passed.

Note that the contents of the key buffer available to plotscripts are only refreshed once a tick. A while loop which contains no wait commands and wants the user to press a key will loop forever, never detecting any keypresses. Such a loop needs a wait command.

Personal tools