Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, dr_panther), 1,282 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Movement: Ledge-grabbing and climbing #338049
08/15/10 13:07
08/15/10 13:07
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,

I would like to improve the movement code I'm currently using by adding a few new features. Grabbing the ledge of a block of stone or a plattform during a jump or fall (and then climbing upon the grabbed object) is a feature which can be seen very often in various 3D Jump'n'Run and Adventure games (Super Mario 64, Banjo Tooie, Tomb Raider, Uncharted...), so I have been wondering: how do you actually get this done...?

Is there any tutorial or code piece for something like this?

The main problem is detecting an edge in 3D space which is actually suitable for grabbing and climbing. I would have tried to do two traces, approximately from the position of the player entity's eyes to a position a few quants away in positive local x direction. Then do a second trace in the same direction a few quants above. If the lower trace hits something in a short and the upper trace hits something in a larger distance (using an experimental offset value) then we have an edge in front of us.
In side-view, the situation would look like this:

Code:
side-view:
(vertical dashes = wall)
            |
         ---|
         |<----- upper trace (length: 5)
         ---|<-- lower trace (length: 2)
            |
            |



But these are two traces more to do during each frame. Also, if the player entity is moving downwards too fast, it is possible that the critical areas of a surface will never be scanned for edges and therefore the grabbing points will not be detected. Also, this would enable the player entity to grab edges which I do not intend to be used for climbing (e.g. on an enemy entity) - any alternative ideas?


Greets,



Alan

Re: Movement: Ledge-grabbing and climbing [Re: Alan] #338056
08/15/10 13:32
08/15/10 13:32
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Is this what you need? Sorry if not, if yes PM me, will be happy to help laugh
Download link


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Movement: Ledge-grabbing and climbing [Re: 3run] #338072
08/15/10 14:45
08/15/10 14:45
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,

yes, this is exactly what I meant! Just had a quick look over the code and I quickly found this part:

Code:
result = c_trace(my.x,vector(my.x + 30 * cos(my.pan), my.y + 30 * sin(my.pan), my.z),IGNORE_PASSABLE|IGNORE_SPRITES|IGNORE_MODELS); 
if(trace_hit){trace_center = 1;}else{trace_center = 0;}
///
result = c_trace(my.x,vector(my.x + 30 * cos(my.pan), my.y + 30 * sin(my.pan), my.z + 70),IGNORE_PASSABLE|IGNORE_SPRITES|IGNORE_MODELS); 
if(trace_hit){trace_head = 1;}else{trace_head = 0;}
if(trace_head == 0 && trace_center == 1)
{...}



This is essentially exactly what I tried to say with my ascii-draft. I tried to run it and it seems to work pretty good! Can't believe that it is basically this simple ^_^

Thanks, this will be a great help to me!!



Alan

Re: Movement: Ledge-grabbing and climbing [Re: Alan] #338133
08/16/10 05:02
08/16/10 05:02
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
I'm so happy that this was useful my friend laugh Check my website, you can register there and as me for help any time laugh I'll be happy to help. Good luck.


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Movement: Ledge-grabbing and climbing [Re: 3run] #338174
08/16/10 12:46
08/16/10 12:46
Joined: Mar 2009
Posts: 146
USA
P
paracharlie Offline
Member
paracharlie  Offline
Member
P

Joined: Mar 2009
Posts: 146
USA
I needed that also, lol... Thank you so much 3run!


A8 Commercial

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