Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
2 registered members (TipmyPip, 1 invisible), 18,731 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Good at maths? #168094
11/18/07 14:34
11/18/07 14:34
Joined: Nov 2007
Posts: 14
F
FiskFisk33 Offline OP
Newbie
FiskFisk33  Offline OP
Newbie
F

Joined: Nov 2007
Posts: 14
ok, i have problems here, im trying to make this fps-independent
Code:

c_move(the_penguin, nullvector, vector(0,0,-(fall_length)), IGNORE_ME | IGNORE_PASSABLE);
if (heightcheck > the_penguin.z)
{
if ((heightcheck - the_penguin.z) < fall_length)
{
fall_length = 0;
}
fall_length += (fall_speed / 1 ) * time_step; // Heres A Desperate attempt :p
}
else
{
fall_length = 0.1;
}
heightcheck = the_penguin.z;


this code is executed once every frame...

Any ideas?

Re: Good at maths? [Re: FiskFisk33] #168095
11/18/07 17:12
11/18/07 17:12
Joined: Nov 2007
Posts: 14
F
FiskFisk33 Offline OP
Newbie
FiskFisk33  Offline OP
Newbie
F

Joined: Nov 2007
Posts: 14
Let me simplify

Code:

while(1)
{
If (in the air)
{
Variable += 0.1 * time_step
}
Else
{
variable = 0
}
wait(1)
}
move.z -variable



and i cant figure out how to make it fps indepenant

Re: Good at maths? [Re: FiskFisk33] #168096
11/18/07 20:02
11/18/07 20:02
Joined: Nov 2007
Posts: 14
F
FiskFisk33 Offline OP
Newbie
FiskFisk33  Offline OP
Newbie
F

Joined: Nov 2007
Posts: 14
Thanx for the help
no really, i am not mad / annoyed / anything like that, i am in no position to be that

Anyway, i've come up with the solution
Code:

while(1)
{
If (in the air)
{
Variable += 0.1 * time_step
}
Else
{
variable = 0
}
wait(1)
}
move.z -(variable / ((1 / time_step) * 0.55))



i realized that the iverted value of time_step equals how many times bigger the framerate is than 16fps: if the framerate is 160 then 1 / time_step = 10.

Last edited by FiskFisk33; 11/18/07 20:02.
Re: Good at maths? [Re: FiskFisk33] #168097
11/18/07 20:45
11/18/07 20:45
Joined: Jul 2007
Posts: 959
nl
F
flits Offline
User
flits  Offline
User
F

Joined: Jul 2007
Posts: 959
nl
time_step = 16 and you could try time_frame


"empty"
Re: Good at maths? [Re: flits] #168098
11/18/07 20:54
11/18/07 20:54
Joined: Nov 2007
Posts: 14
F
FiskFisk33 Offline OP
Newbie
FiskFisk33  Offline OP
Newbie
F

Joined: Nov 2007
Posts: 14
Quote:

time_step = 16



huh?
time_step = The duration of the last frame cycle in ticks, i.e. sixteenths of a second. On a frame rate of 16 fps both variables have a value of 1. On a frame rate of 160 fps both variables have a value of 0.1. isnt it?

thanx for the time_frame tip

Last edited by FiskFisk33; 11/18/07 20:54.
Re: Good at maths? [Re: FiskFisk33] #168099
11/19/07 13:26
11/19/07 13:26
Joined: Nov 2007
Posts: 14
F
FiskFisk33 Offline OP
Newbie
FiskFisk33  Offline OP
Newbie
F

Joined: Nov 2007
Posts: 14
Whoops, sry for the typo error, the typo error.
the move.z is supposed to be inside the while


Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1