Welcome Guest [Log In] [Register]
We hope you enjoy your visit.


You're currently viewing the Ultimate 3D Community as a guest. This means that you can only read posts, but can not create posts or topics by yourself. To be able to post you need to register. Then you can participate in the community active and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.

Join our community!

If you are already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
frame skipping or something; how to make it lag not slow.
Topic Started: Oct 20 2010, 09:38 PM (164 Views)
The-CH1P
Member Avatar
The-CH1P!
[ *  *  * ]
i wonder if its possible for u3d to skipp frames when the fps goes under its max..

so when you have a max/normal fps on 60 for the game and you are running 30, it skipps every other frame or something
to make the game still be in normal pace and not go slomo(but laggy)....

basically like regular lag in cs or most other 3d games.
I make games...

Formerly known as tjolle.
Offline Profile Quote Post Goto Top
 
Despellanion
Member Avatar
Forum God
[ *  *  *  *  *  * ]
Well, there's always the simple solution:
Code:
 

global.time_factor=100/max(30,fps);
speed2=1*global.time_factor;
Offline Profile Quote Post Goto Top
 
The-CH1P
Member Avatar
The-CH1P!
[ *  *  * ]
ok... now, where am i supoosed to add that... i tried in create for controll and step for that... but no change, game still goes slow when fps goes under 60
I make games...

Formerly known as tjolle.
Offline Profile Quote Post Goto Top
 
The-CH1P
Member Avatar
The-CH1P!
[ *  *  * ]
and i dont mean, "I want the game to run 60fps when its at 30 fpsDUH DUH" no i mean that i want the game to lag/hack, not literally slow down.
I make games...

Formerly known as tjolle.
Offline Profile Quote Post Goto Top
 
Despellanion
Member Avatar
Forum God
[ *  *  *  *  *  * ]
Oh, I thought you wanted to speed up when the game was at low frame rates. Sorry, I can't help you much there.
Offline Profile Quote Post Goto Top
 
steve56716
Advanced Member
[ *  *  * ]
Sorry to post on a 2 montrh old thread, but this can be done with very little coding. It will come at a cost though :think:
Copy and paste the below code in the end step of the control object, just before the transmit and render part

if skipping_frame=1 or fps=0
{exit}
frame_skip+=min(1,room_speed/fps)
frame_skip-=1
while(frame_skip>=1)
{
skipping_frame=1
with(all)
{event_perform(ev_step,0)}
frame_skip-=1
}
skipping_frame=0

it will make the game catch up by performing the step event again for every object, but all coding for all the objects would have to be in the step event for it to work right. or a piece of code each objects that would do a manual check for so say a keyboard button with the above code at the beginning

if control.skipping_frame=0
{exit}

Hopes this helps! :whistle:
Offline Profile Quote Post Goto Top
 
« Previous Topic · Questions about Ultimate 3D · Next Topic »
Add Reply