Tween .vs Delta timing for frame limiting

Blitz3D Forums/Blitz3D Beginners Area/Tween .vs Delta timing for frame limiting

CodeOrc(Posted 2009) [#1]
as the title says, whats the best way to set FPS..tween, delta, other?


Zethrax(Posted 2009) [#2]
I started out using delta timing and then switched to render tweening for a FPS game engine I've been working on for years.

My experience with delta timing was that it's a micro-management nightmare. It's very finicky to get right. There are many games and apps that I've used that have timing and movement issues which I'd guess are caused by issues with their delta timing implementation (JFK's FPS games, and the Decorator texturing tool are some that I've noticed these issues with). In my opinion, delta timing is a hand grenade with the pin pulled - it will probably blow up in your face sooner or later.

Render tweening is a much easier solution to implement overall. It's largely set-and-forget. It provides a fixed timestep between logic updates, which is required by some equations, and which is easier to plan around. The only real issue with it is the fact that there is no built in method provided to stop interpolation occurring when you want to make abrupt changes in position, etc, without interpolating (when teleporting an object, for example), but you can work around this by structuring your game so that these sort of changes occur immediately before the CaptureWorld command.

Personally, I give render tweening the thumbs-up and delta timing the thumbs-down, though others may disagree.


Naughty Alien(Posted 2009) [#3]
..as Bill said..


jfk EO-11110(Posted 2009) [#4]
issues

Please specify. I mean, other than jumping speed and height issues :)

I vote for delta. But I never really became very familar with tweening. I was able to do everything required with delta, and if there have been any issues, then most likely only because I accidently included some bugs.


Kryzon(Posted 2009) [#5]
The Tween method is the way to go if you are planning on syncronizing 3D animation with a soundtrack, for example (not separate sounds, but one entire soundtrack as one single channel played right when you start the animation. It syncs perfectly).

Might be of interest:
http://blitzbasic.com/Community/posts.php?topic=82365


Zethrax(Posted 2009) [#6]
Please specify. I mean, other than jumping speed and height issues :)


Abrupt changes in speed and position for moving objects is the usual telltale for delta timing issues. I noticed this in particular with the enemy soldiers running around outside in your FPS demo 2 (the one where terrorists have taken control of the White House). Every now and then I'd see a running soldier speed up 10 times or so.

You'll probably notice the inconsistancies caused by delta timing issues more on older, underpowered systems that choke up more.

I think you'd find it worth your while to switch your FPS engine to use render tweening, JFK. You get a fixed timestep, set and forget timing, and less potential bug fodder.


Kryzon(Posted 2009) [#7]
Or you can implement both functionalities and let the developer\user choose what to use.


Zeotrope(Posted 2009) [#8]
Is the castle demo still the benchmark on all FPS Limiting?

Or has is changed?

From the standpoint of a almost completed 3D Shooter, is it hard to implement the FPS Limiting at the end of the project? Or is it a pain in the bum?


Gabriel(Posted 2009) [#9]
Is the castle demo still the benchmark on all FPS Limiting?

More or less. I think there is a slightly revised version in the code archives.

From the standpoint of a almost completed 3D Shooter, is it hard to implement the FPS Limiting at the end of the project? Or is it a pain in the bum?

Pain in the bum if you go with delta timing. Render Tweening is a five minute job, as all the hard work is done for you automagically in UpdateWorld.


QuickSilva(Posted 2009) [#10]
What about 2D games though? What is the best method for them?

Jason.


ervin(Posted 2009) [#11]
What about 2D games though? What is the best method for them?

As part of writing Sabre Wulf (my still incomplete entry in the 2008 Retro Remakes competition), I toyed with render tweening, delta timing and fixed update logic (set to 60fps).

As it is a 2D game (despite having something of a 3D feel), it needs to be super-smooth.
In a first-person or third-person game, 30fps is often enough, and a bit of jitteriness isn't a problem. But in a 2D game, you really want to hit 60fps and stay there.

Both tweening and delta gave the odd jitter for some reason, whereas fixed update logic is rock solid.
Of course, running it on a slow computer causes slowdown, both in terms of framerate and game logic.


jfk EO-11110(Posted 2009) [#12]
your FPS demo 2

That's about ten years old. I agree, there have been some horrible bugs. Latest release is demo 8, with most issues fixed.

The music sync thing is a good point. Especially when you're thinking about dynamic event-triggered soundtrack arrangement with a consistent beat.


Gabriel(Posted 2009) [#13]
Both tweening and delta gave the odd jitter for some reason, whereas fixed update logic is rock solid.

Tweening *is* fixed update logic. How did you do tweening without a fixed update?


ervin(Posted 2009) [#14]
Yes, I guess my terminilogy is wrong. :o)
Erm... WaitTimer logic is what I'm talking about.