Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (7th_zorro, Quad, VoroneTZ, 1 invisible), 623 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
Tip of the Week #9: Gravity and Jumping? No Problem! #425263
06/30/13 21:11
06/30/13 21:11
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline OP
Senior Expert
Superku  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
A new Tip of the Week, learn how to create a robust gravity and jumping code (that works on low framerates, too)!



http://opserver.de/pwik7/index.php?title=Tip_of_the_Week

Last edited by Superku; 12/23/13 11:39.

"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Tip of the Week #9: Gravity and Jumping? No Problem! [Re: Superku] #425264
06/30/13 21:49
06/30/13 21:49
Joined: May 2008
Posts: 2,113
NRW/Germany
alibaba Offline
Expert
alibaba  Offline
Expert

Joined: May 2008
Posts: 2,113
NRW/Germany
Wow! You are just awesome!!

This was one of the most annoying problems which occured during developement, but now it´s solved thanks to you laugh


Professional Edition
A8.47.1
--------------------
http://www.yueklet.de
Re: Tip of the Week #9: Gravity and Jumping? No Problem! [Re: alibaba] #425265
06/30/13 22:07
06/30/13 22:07
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Kartoffel Offline
Expert
Kartoffel  Offline
Expert

Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Whenever I tried to create a player script I had huge problems with gravity and jumping grin
... so this is just perfect.

Thaks a lot laugh


POTATO-MAN saves the day! - Random
Re: Tip of the Week #9: Gravity and Jumping? No Problem! [Re: Kartoffel] #425273
07/01/13 11:42
07/01/13 11:42
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline OP
Senior Expert
Superku  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Thanks guys, I'm glad you find it useful!


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Tip of the Week #9: Gravity and Jumping? No Problem! [Re: Superku] #425326
07/02/13 20:15
07/02/13 20:15
Joined: Sep 2003
Posts: 9,859
F
FBL Offline
Senior Expert
FBL  Offline
Senior Expert
F

Joined: Sep 2003
Posts: 9,859
using c_trace after c_move is a very good hint.

However I had huge problems getting a proper time corrected jump.
What I did in the end was introducind a jump timer. This timer increments to a certain value and during that time I apply a z-force (which has to be big enough to overcome gravity). Then I used vec_acclerate to get a speed out of my force vector and handed it over to c_move.

Not sure if this is the correct solution, but it seemed to eliminate all my framerate dependencies.

Re: Tip of the Week #9: Gravity and Jumping? No Problem! [Re: FBL] #428970
09/06/13 10:17
09/06/13 10:17
Joined: Jun 2010
Posts: 590
California
Ruben Offline
User
Ruben  Offline
User

Joined: Jun 2010
Posts: 590
California
Superku: When I click on either of your three links, I am forwarded to some website called "Compact Dictionary of the Infinite", at this link:

*any website*

I don't think this is the website you intended your links to be connected to, is it?

Last edited by rayp; 09/06/13 15:03. Reason: removed link
Re: Tip of the Week #9: Gravity and Jumping? No Problem! [Re: Ruben] #428996
09/06/13 14:38
09/06/13 14:38
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
it is now nwiki5 instead of mwiki4


Visit my site: www.masterq32.de
Re: Tip of the Week #9: Gravity and Jumping? No Problem! [Re: MasterQ32] #428998
09/06/13 14:50
09/06/13 14:50
Joined: Jul 2008
Posts: 2,107
Germany
rayp Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,107
Germany
@Ruben
Added a working link in SuperKu's first post above.


Acknex umgibt uns...zwischen Dir, mir, dem Stein dort...
"Hey Griswold ... where u gonna put a tree that big ?"
1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected
rayp.flags |= UNTOUCHABLE;
Re: Tip of the Week #9: Gravity and Jumping? No Problem! [Re: rayp] #434459
12/19/13 07:05
12/19/13 07:05
Joined: Jun 2013
Posts: 108
Alberta, Canada
C
CanadianDavid Offline
Member
CanadianDavid  Offline
Member
C

Joined: Jun 2013
Posts: 108
Alberta, Canada
Works nicely except do you know why the player can go through ceilings and off the map when walking up slopes or stairs? See the attached map and walk to the end of the map. It is possible to jump off the map as well as jump onto the platform. I presume it is due to manually adjusting the my.z, circumventing collision detection.

Attached Files
bug.zip (91 downloads)
Re: Tip of the Week #9: Gravity and Jumping? No Problem! [Re: CanadianDavid] #434464
12/19/13 07:52
12/19/13 07:52
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline OP
Senior Expert
Superku  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Thanks for noticing that, I've updated the code (wiki download link) and improved it in 1-2 other situations.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Tip of the Week #9: Gravity and Jumping? No Problem! [Re: Superku] #434482
12/19/13 10:58
12/19/13 10:58
Joined: Jun 2013
Posts: 108
Alberta, Canada
C
CanadianDavid Offline
Member
CanadianDavid  Offline
Member
C

Joined: Jun 2013
Posts: 108
Alberta, Canada
Thanks! The code works even better! One more thing I noticed is that there can be some circumstances where downward speed is applied until the maximum downward speed is reached (-90 in the example code) which would be undesirable. In the attached image I have created another dummy entity that does nothing but act like an obstacle. The player can jump above it and hang off the other entity, accumulating downward speed that is not applied until the player moves off.

Attached Files shot_0.jpg
gravity.zip (130 downloads)
Re: Tip of the Week #9: Gravity and Jumping? No Problem! [Re: CanadianDavid] #434483
12/19/13 11:15
12/19/13 11:15
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline OP
Senior Expert
Superku  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
You will encounter at least 100 other problems with this or with any other movement code/ basis this short. Movement codes are not simply using a single or two provided engine functions but oftentimes consist of tens of thousands lines of code.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Tip of the Week #9: Gravity and Jumping? No Problem! [Re: Superku] #434484
12/19/13 11:27
12/19/13 11:27
Joined: Jun 2013
Posts: 108
Alberta, Canada
C
CanadianDavid Offline
Member
CanadianDavid  Offline
Member
C

Joined: Jun 2013
Posts: 108
Alberta, Canada
It's really not a problem at all; I'm just posting my results with this code. Thank you for sharing!

Re: Tip of the Week #9: Gravity and Jumping? No Problem! [Re: CanadianDavid] #434490
12/19/13 13:22
12/19/13 13:22
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline OP
Senior Expert
Superku  Offline OP
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Feel free to add your discoveries and fixes to the wiki article (I think adding it at the bottom of the article would be best)!


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Tip of the Week #9: Gravity and Jumping? No Problem! [Re: Superku] #478246
09/25/19 08:16
09/25/19 08:16
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Since there are no working links (at least I couldn't find any), here is the gravity code (the latest one I have) hosted on my webpage:
Download link

PS: thank you jcl for not even trying to run back acknex wiki.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Page 1 of 2 1 2

Moderated by  adoado, checkbutton, mk_1, Perro 

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