Gamestudio Links
Zorro Links
Newest Posts
Newbie Questions
by fairtrader. 12/05/23 14:22
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
2 registered members (3run, AndrewAMD), 623 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Problems with player movement (Framerate + Collision Box) [Re: Rondidon] #356526
02/02/11 16:53
02/02/11 16:53
Joined: Nov 2010
Posts: 96
Vienna
S
Schubido Offline
Junior Member
Schubido  Offline
Junior Member
S

Joined: Nov 2010
Posts: 96
Vienna
Muffel said
Quote:

So you have to multiply the speed with the time to get the distance.


This explanation of the problem was correct - it seems he just forgot to write it in the code.

Change the line

player_movedist[2] = player_z_speed;
to
player_movedist[2] = player_z_speed*time_step;
(= multiply speed with time)

Re: Problems with player movement (Framerate + Collision Box) [Re: Schubido] #356531
02/02/11 17:16
02/02/11 17:16
Joined: Aug 2002
Posts: 2,183
Germany, BaW�
Rondidon Offline OP
Expert
Rondidon  Offline OP
Expert

Joined: Aug 2002
Posts: 2,183
Germany, BaW�
Result:

player_z_speed=15*time_frame; //Player jumps much higher at low framerate. Same as in the beginning

-------------------------

player_z_speed=5; //Player jumps lower at low framerate. It`s strange.

Re: Problems with player movement (Framerate + Collision Box) [Re: xxxxxxx] #356533
02/02/11 17:34
02/02/11 17:34
Joined: May 2009
Posts: 5,367
Caucasus
3run Online
Senior Expert
3run  Online
Senior Expert

Joined: May 2009
Posts: 5,367
Caucasus
@xxxxxxx: You can't change BBOX manually without setting it's FAT and NARROW!
@Rondidon: I can send you a framerate independent movement with jumping if you need me to, just send me PM.
About BBOX (TESTED):
Code:
action hero()
{
	my.eflags |= FAT | NARROW;
	wait(1);
	vec_set(my.min_x,vector(-15,-15,-35)); // PLAY WITH NUMBERS
	vec_set(my.max_x,vector(15,15,35)); // X Y Z
	//while loop and so on...
}

Have no idea (and no time to check) about framerate problem you have, but as I said, can send working one.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Problems with player movement (Framerate + Collision Box) [Re: 3run] #356538
02/02/11 17:45
02/02/11 17:45
Joined: Jan 2011
Posts: 797
Da wo du nicht bist! Muhahaha!
xxxxxxx Offline
User
xxxxxxx  Offline
User

Joined: Jan 2011
Posts: 797
Da wo du nicht bist! Muhahaha!
Do you tryed it? c_setminmax set FAT and NARROW!
mfg
xxxxxxx


Es ist immer wieder erstaunlich, dass Leute die riesen Scripte schreiben die einfachsten sachen nicht können zb. mich mit SIEBEN x zu schreiben! tongue
Re: Problems with player movement (Framerate + Collision Box) [Re: 3run] #356539
02/02/11 17:46
02/02/11 17:46
Joined: Aug 2002
Posts: 2,183
Germany, BaW�
Rondidon Offline OP
Expert
Rondidon  Offline OP
Expert

Joined: Aug 2002
Posts: 2,183
Germany, BaW�
It`s maybe stange, but with this values the code is 98% framerate independant. Same jump hight at 5FPS and 80FPS. Maybe the Acknex engine confuses the time_frame and time_step variables in huge projects with many simultan functions and many entities? Hm.

player_movevector[2]=4+4*time_frame;

@3Run I try to get my own to work without bugs. But if I really get stuck anywhere, I`ll PM you wink Thanks.

@xxxxxxx Yes and it seems to work. Thanks very much. I forgot to set those flags when I tried to setup the collision box manually like 3Run said.

Thank you very much. I really appreciate your help!

Re: Problems with player movement (Framerate + Collision Box) [Re: Rondidon] #356558
02/02/11 19:00
02/02/11 19:00
Joined: Nov 2010
Posts: 96
Vienna
S
Schubido Offline
Junior Member
Schubido  Offline
Junior Member
S

Joined: Nov 2010
Posts: 96
Vienna
I thought that "player_movedist[2] = player_z_speed*time_step;" would be precise enough. Obviously not - it does not take into account the decreasing speed within time_step. So the precise formula would be:

player_movedist[2] = player_z_speed*time_step - gravitation*time_step*time_step/2;

and set player_z_speed to a value independend of time_step.

Page 2 of 2 1 2

Gamestudio download | chip programmers | 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