Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
1 registered members (Grant), 999 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
General question / theory: standing on moving platforms #291971
09/29/09 12:52
09/29/09 12:52
Joined: Oct 2007
Posts: 306
Austria
A
Alan Offline OP
Senior Member
Alan  Offline OP
Senior Member
A

Joined: Oct 2007
Posts: 306
Austria
Hi there,

this time I have a more theoretical question. Let's assume we have a game which allows the user to move around a character in 3D space (like in a jump'n'run, a shooter, an adventure...). Now, this character encounters a moving platform. If the platform is moving downwards, the character will be forced to follow because of the rules of gravity. But what about a platform going upwards? Will the character automatically go up as well or will he eventually even *prevent* the platform from going up by just standing on it? I haven't done any experiments on that yet, though.

And how about platforms which move forwards/backwards/left/right? The character on them will stand still even when the "ground" beneath his feet is moving around, so he will fall off the platform sooner or later. How would you avoid this problem, respectively how would you force the player to move if the ground under his feet is moving?

Greets,

Alan

Re: General question / theory: standing on moving platforms [Re: Alan] #291975
09/29/09 13:42
09/29/09 13:42
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
With question one, make sure the lift has a higher "push" value than the player.
This way, the lift is "pushing" harder than the player can, so the player
will be 'pushed' out of the way (ie up).
But the players gravity code must be processed AFTER the lift code each frame.
This is just theory for me too. Ive never implemented anything like this yet.

And question two. I dont know if this is the 'best' way, but heres how I would do it.
This is applicable to both vertical and horizontal platforms.
1> Give the platform a "type" marker skill to indicate its a platform.
2> Give the platform a "travelled" vector skill to say how far it travelled SINCE THE LAST FRAME, not total distance.
3> Have the platforms action update the "travelled" vector every frame.
4> Have the players gravity code check if the player is 'touching' an entity with the platform skill on,
and if it is, then move the player by the amount in the platforms "travelled' vector.

Hope this is of some help.


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: General question / theory: standing on moving platforms [Re: EvilSOB] #291982
09/29/09 14:31
09/29/09 14:31
Joined: Oct 2007
Posts: 306
Austria
A
Alan Offline OP
Senior Member
Alan  Offline OP
Senior Member
A

Joined: Oct 2007
Posts: 306
Austria
@EvilSOB: So that's what this "push" stuff is good for... pretty cool ^^
Your idea for moving platforms sounds good as well, I will try that one if I should ever get this far with my JnR!

Greets,


Alan

Re: General question / theory: standing on moving platforms [Re: Alan] #292051
09/29/09 21:11
09/29/09 21:11
Joined: Jul 2004
Posts: 1,710
MMike Offline
Serious User
MMike  Offline
Serious User

Joined: Jul 2004
Posts: 1,710
My try would be:

Check for collision, if Positive, return dist from player to plataform target.z, store that dist.
and vector_add(player.x, stored vector);


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

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