Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (7th_zorro, howardR), 1,001 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Getting Stuck on Ledges [Re: Valdsator] #385736
10/23/11 00:06
10/23/11 00:06
Joined: Aug 2008
Posts: 482
B
bart_the_13th Offline
Senior Member
bart_the_13th  Offline
Senior Member
B

Joined: Aug 2008
Posts: 482
Originally Posted By: Valdsator
Originally Posted By: Redeemer
That would work great, except ellipsoids are ALWAYS used for entity vs. world interactions. The POLYGON flag only affects entity vs. entity interactions.
Yeah, I've already tried this (my actual model is just a cube, since it's an FPS), but all entity vs. level collisions are ellipsoid based. I don't think there's a way to get around that, so I need to find a way to prevent the playing getting stuck, or simply fix the problem quickly whenever it happens.

ah, yes, it seems the engine force it to be ellipsoid.
Ok, how about level vs level collision? Build a simple level consist of a cube, and use that as the entity?

Re: Getting Stuck on Ledges [Re: bart_the_13th] #385738
10/23/11 00:41
10/23/11 00:41
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Quote:
Ok, how about level vs level collision? Build a simple level consist of a cube, and use that as the entity?

No matter what you do, c_move is based on c_trace with USE_BOX and that uses ellipsoid ("me") vs. polygonal (all other objects+blocks) detection.

@Valdsator: When c_move hits something (HIT_TARGET), check where target is located. If (target.z < ent.z && target.z > ent.z+ent.min_z), then you will need to move your entity in the direction (f.i.) of the vector pointing from target to ent.z, that is

vec_diff(temp,ent.z,target);
temp.z = 0; // disable vertical movement
var ent_size = vec_length(vector(maxv(ent.max_x,-ent.min_x),maxv(ent.max_y,-ent.min_y),0));
vec_normalize(temp,ent_size-vec_length(temp)); // should be correct, give it a try
c_move(ent,nullvector,temp,...);


"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: Getting Stuck on Ledges [Re: Superku] #385741
10/23/11 03:20
10/23/11 03:20
Joined: Mar 2009
Posts: 186
V
Valdsator Offline OP
Member
Valdsator  Offline OP
Member
V

Joined: Mar 2009
Posts: 186
I just rewrote the vertical movement system which works fine now. Basically I used USE_BOX, and made the c_trace start from the middle of the entity, and have it's z size be as much as the entity. This way, the 2 ellipsoids (the bounding box, and the c_trace) would basically make a rectangular box on the bottom.



Blue = Bounding Box
Red = c_trace

It's obviously a bit more complex than that (some bugs showed up), but I took care of it all. The only problem I have with this method is that if the player jumps, he can climb up ledges which are a tad high, but all that does is get rid of the need for a crouch jump, which I'm willing to sacrifice. tongue

Thanks for all the help!

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