Delta

All topics about ZGameEditor goes here.

Moderator: Moderators

User avatar
Kjell
Posts: 1882
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

Hej Ville,

Input is indeed the desired velocity. The *1000 constant is used to convert DeltaTime to milliseconds ( therefore the Inertia has to be in the range of 30< to even be noticed, since it's set against the Delta in ms ), while the *-1 is to get the correct exponential curve.

When you'd want to use this formula for something like jph's vehicle rotation, you'd have a input of -1 ( or -0.25, whatever speed you want ) on Left, +1 on Right , and 0 on both or none. For the movement you'd do the same regarding input, but the actual use depends on if you want a Astroids approach, or have the Velocity tied to the current orientation. For the first ..

Code: Select all

Velocity.X += (sin(Rotation.Y*Pi*2)*Input-Velocity.X)*(1-exp(DeltaTime*-1000/Inertia));
Concerning my ZGE endeavor, I actually started out with a 3rd person action game, but quickly found out that the platform is not ready to host such project yet ( Raycast / Character Animation ). So I switched to a First Person platform / puzzle type of game, although I nearly went with a vertical shooter altogether when having to find a work-around* for the Nth time :P But I might go there once my first ZGE production is done :wink:

*And my favorite work-around thus far has to be a old-skool password save system as writing to files is not supported as of yet. 8)

Kind Regards,
Kjell
User avatar
VilleK
Site Admin
Posts: 2277
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

Thanks for the explanation Kjell.

Your project sounds interesting. Hopefully you will find techniques and have the energy to make all the workarounds needed to realize your vision in ZGE.

Jph: Don't let the math get in the way for your creativity, if you have problems understanding this then just work like you have done so far, the deltatime bits can be fixed afterwards.

Math can feel like a brick-wall for me sometimes. Kjell you are clearly more gifted in that department :)
User avatar
Kjell
Posts: 1882
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

Hej,

This is the biggest downside of PC game development, not knowing what kind of system players will attempt running you game on. However, once ZGE will have the option to limit the framerate to a desired ceiling, you can take the simpler / non-deltatime dependant approach. Many console games that don't push their host platform to the extreme, take this route as the desired framerate will be met under all circumstances. And even when a situation occurs that requires more horse power then the console can put to the table ( bad coding / design ), the game simply slows down a little during the rampage.

In any case, if you don't want to bother with DeltaTime, wait for a ZGE release that has the possibility to limit the framerate, and just provide minimum system requirements with your release. This is the way it has been for most ( offline ) PC games for decades.

Regards,
K
Post Reply