Physics behavior with a varied frame rate

For questions about using Classic.

Post » Sat Mar 21, 2009 2:23 am

[quote="nightofgrim":1kvfg0ip]I understand the advantages of the timedelta system, but the ability to skip frames as an alternative would still be very nice.[/quote:1kvfg0ip]

Frame skipping is for frame-based logic.
You CAN do frame-skipping if you reallyreallyreally want it.
Here's how:

*EDIT* UPLOADING WORKING .CAP TOMORROW *EDIT*

then put all your logic inside a loop that recalculates for each 'elapsed' frame.
Then you're ready to welcome unsmoothness into your life. You know, if you reallyreallyreally want to.

edit: don't smite me ashley :P
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Post » Sat Mar 21, 2009 10:50 pm

I still recommend using timedelta with a minimum FPS setting, calculated with your max speed and minimum object size so things can't go trough each other. But if you INSIST, here's how to do frame-based logic in construct with frameskipping: [url:2ig38fjh]http://www.udec.cl/~jfuente_alba/frameskip.cap[/url:2ig38fjh]

Shows frameskip. Has a fixed FPS of 5, change it to see how frameskipping behaves under different conditions.

Note how setting no fixed FPS or setting 60FPS the animation still looks choppy, as it is frame based and limited to the set maximum.

I've set it up to run at 30fps with frameskipping, change the in the events 30 to set it to other speeds.

EDIT: Remember, if your game has complex events slowing it down, this won't help at all. It may even freeze, as you'll be looping and making it slower each time.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Previous

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 4 guests