Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Pb: "Play object" and forced-timing

Author
Message
Kelebrindae
21
Years of Service
User Offline
Joined: 15th Sep 2003
Location: Where cheeses are scarier than dragons.
Posted: 30th Jul 2004 00:17
Hi! Here's my problem:

In my code, I use forced-timing. This means that the sync rate is set to zero. I store the duration of each loop, and the variations of this duration give me a factor which allow me to "weight" each movement of the existing objects. This way, a fast computer will have a higher framerate than a slow one, but my objects won't move faster, but more smoothly.

Then, I noticed a problem with the "play object" command: it seems to be "framerate-related". An animation sequence will be faster if the framerate is high. And, of course, this is bad in forced-timing: animation speed should be "time-related" (its duration, in seconds or milliseconds, should never change).

Maybe I could use the "set object speed" command to modulate the animation speed? And this, at each loop to accomodate the framerate variations?

Please, if anyone already had this problem, could you tell me how to solve it?

Thanks a lot!

Ideas: memories of things which did not occur yet...
Kentaree
22
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Clonmel, Ireland
Posted: 30th Jul 2004 00:36
There is a command called set object frame, which lets you manually select a frame in an objects animation sequence, so you could manually manage the animation, based on your program's timing.

AMD Athlon XP2800+
GeForce FX5200 128MB
1024MB DDR 333MHz RAM
Kelebrindae
21
Years of Service
User Offline
Joined: 15th Sep 2003
Location: Where cheeses are scarier than dragons.
Posted: 30th Jul 2004 01:05
Yes, it's a good idea. I'll try it. Thanks a lot!

But by default, the "set object frame" doesn't perform interpolation between the former frame and the new one. So, the animation could become choppy.

There's a "set object interpolation" to use in conjonction with "set object frame", but it's based on framerate, just like "play object" => same problem...

Another idea ?

Ideas: memories of things which did not occur yet...
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 30th Jul 2004 05:33
In the source box I put a useful post somebody brought up on the subject.

Crazy Donut Productions, Current Project: Project Starbuks
Sony stole our name!
AsriCE
22
Years of Service
User Offline
Joined: 10th Jan 2003
Location: Brunei
Posted: 30th Jul 2004 15:44
Halo,

Kelebrindae, I believe the corrrect term for the method you are using is called "Independent Frame-Rate Movement". Forced timing is a method which you control how many times a function is to be called per-frame.

Back to subject, you said you store the duration for the loops and it computes the duration which is the "Factor", am I right? So then I believe that this factor is your "DeltaTime", which you multiply to the velocity to give it's position.

eq 1:


So then, why don't you just use the "Set Object Speed" command and multiply it by the DeltaTime, just as you would with moving all other objects?

eq 2:


I use this method with my previous two projects, and it works perfectly. But I don't know if your algorithm is the same as mine. Maybe you can post your code so we can help you more.

AsriCE Crew,
- Adi

There's only one hope.
Kelebrindae
21
Years of Service
User Offline
Joined: 15th Sep 2003
Location: Where cheeses are scarier than dragons.
Posted: 30th Jul 2004 18:44
Thanks a lot, guys!

I should be able to fix the problem, now...

Ideas: memories of things which did not occur yet...

Login to post a reply

Server time is: 2025-05-25 16:31:47
Your offset time is: 2025-05-25 16:31:47