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 approximately 18.2 ticks per second (originally the default rate of the DOS timer). However, the game can slow down if you have lots of graphics on screen, and so on.

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.