Delta Time VS FrameRate(tweening)
Blitz3D Forums/Blitz3D Programming/Delta Time VS FrameRate(tweening)
| ||
I am at a dilema, is using Delta time better than having a routine do catch up?Repeat elapsed=MilliSecs()-time Until elapsed ticks=elapsed/period tween#=Float(elapsed Mod period)/Float(period) If tick>7 Then tick=7 ; At least let the computer catch up! For k=1 To ticks ;If k=ticks Then CaptureWorld() time=time+period UpdateWorld() GameTimer = (GameTimer + 1) Mod (UPS / 2) ; do my game stuff Next of delta time moveentity box, x * deltatime, y * deltatime, 0 it seems to me that doing delta time your making the processor do more calculations per frames? |
| ||
I'd go for deltatime method. I think it's alot easier. Might just be me, but i can never get the animation right with render tweening :o) |
| ||
DeltaTime. I've had issues with render tweening. It's been so long ago that I decided but I know I did a number of tests to decide. |
| ||
Deltatime results in a much simpler program. The only drawbacks are that it makes it extremely difficult to playback demos of gameplay... One cannot simply record keyboard input and assume the rest of the simulation will run the same every time... and it makes some kinds of multiplayer setups more difficult to code. |
| ||
ah. it is a multiplay game.. in stead of ease, Would the tweening method be more effective on the processor? i want to keep the processor time down |
| ||
I've really had no issues with either, but I think Render Tweening has proven slightly smoother for me. It's less typing too ( I'm lazy, sue me. ) |
| ||
Sybixsus, Lazy ?? yeah but i bet you didn't get a trophy in being lazy.. I did! LOL I have found tween to be a realy nice effect. thanks for the point of views guys. |
| ||
Neo: I said only in certain kinds of multiplayer. You do not have to code your multiplayer in such a way that it requires the simulation to run identically on every PC. I coded a perfectly good tank game with multiplayer which used deltatime. I did have an issue with bullets that could bounce off walls... On one PC a bullet might hit a corner and bounce, while on another it would miss the corner and continue moving in a straight line... But if you don't have bullets bouncing off walls, you won't have that issue. :-) The problem was the bullet locations were not updated by the server, so if they went wrong at some point, they stayed wrong. One solution that would require little extra bandwidth would be to simply have the server determine if a bullet bounces off a wall and then send out an update to its location and trajectory when that happens. |
| ||
Deltatime and the use of true VSYNC will calcualte as much as required IMHO. |
| ||
coded a perfectly good tank game with multiplayer which used deltatime Yes but it required the framerate to stay above a certain level if I remember correctly. This is fine for some games. Personally, I think tweening is the way to go ... keep the actual logic frame independent. |
| ||
"Yes but it required the framerate to stay above a certain level if I remember correctly." That is not true. And if it were true, there is nothing to prevent one from calculating extra physics frames in between actual rendereed frames. You can divide the time by 10 and calcualte the physics 10 times between frames if you want to to make the physics smoother. |
| ||
Personaly i always used and still use frame tweening. The only issues with it is when you create new objects as they dont arrive to the position they should be until the next frame. but that can be worked arround anyhow. I really do like having a steady gamelogic rate |
| ||
i must admit, FrameTween does work for me too. I just wanted to know which one was more efficient on the processor i assume Frametween bcos CaptureWorld() function, tho i dont know much about how it captures. haha. |
| ||
does animation get affected by rendertweening much? |
| ||
tweening makes everything smoother and was designed for slower pcs. Basically, you'd update the logic and collisions 30 frames a second, but the the game would draw independantly. See castle demo. It's pretty cool I went with tweening because deltatime was just too much bloody bother. |