Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Morgana retro Dungeon Crawler (uses Tilengine)
#19
I'm glad it worked Smile

Yes, timing units is somewhat inconsistent. A bit of history: at first I intended timing to be units agnostic. You just had to match the units in TLN_DrawFrame() call, with the units in the sequence description. But then I added the ability load sequences embedded in Tiled tilemap's tsx files, that are expressed in milliseconds, and internally convert them to frames assuming a rate of 60 fps. This allowed me to load these sequences easily, but that's not always right.
  • Working in frames has the advantage that they're deterministic, all frames have same duration and equally spaced, but the speed depends on refresh rate
  • Working in absolute time (milliseconds) has the advantage that speed doesn't depend on refresh rate, but the resulting animation can have some jitter, as there isn't an integer relationship between milliseconds and frames.
Classic systems worked with fixed rate displays (TVs or arcade monitors) usually at 60 Hz (or 50 Hz in Europe), so frame units were the standard because they're more predictable. Even today 60 Hz is the standard frame rate. That's why I tend to use frames in Tilengine too.

For your animations, for converting milliseconds to frames:

frame = milliseconds*60/1000;
Reply


Messages In This Thread
WOW!!! - by PerspexSphinx - 11-19-2019, 07:39 AM
Morgana game (uses Tilengine) - by JaumeAlcazo - 01-02-2020, 04:23 AM
RE: First video of Morgana game (uses Tilengine) - by megamarc - 02-07-2020, 08:22 AM

Forum Jump:


Users browsing this thread: 11 Guest(s)