SOLVED Isometric (2.5D) Jump Collision Issue

hughrock18

Member
I am attempting to produce an isometric game that allows the player to jump on multiple "z heights" of platforms.

I have a setup that ALMOST works, but I am clearly missing something. The code is very lengthy and riddled with scripts (to replace commonly used lines and/or blocks).

So instead of going through the hassle of putting my code up here, I would like to know if anyone has any links, details, information, or anything about another functional 2.5d jump collision system or tutorial explaining it (in depth).

The "almost" working system I have has no problem taking me to any z_height and establishing that new z_height as the new "ground level". The player walks around the top of my blocks and falls off the edges EXACTLY the way I would want them to. My problem becomes apparent when I try to get the player to jump to another block at different z_height. The new z_height is set as the "ground level", but I can't jump back on top of the first block, and the "ground level" frequently (but not always) gets stuck at the 2nd z_height. All of these problems where there were none just before adding a single block at a different z_height.

I feel like I don't have a proper grasp on collision functions and how they interact when colliding with multiple instances at once (combined with considering the z pos and how to get the game to understand that you can go over one object and under another at the same time).

Anyway, I'll reiterate: I would like to know if anyone has any links, details, information, or anything about another functional 2.5d jump collision system or tutorial explaining it (in depth). Anything and everything is very much appreciated!

Thanks.
 

Joe Ellis

Member
Using the "ground level" is a good technique, it seems like you need to reset ground level at the start of the script, to 100000 or something lower than everything, then each step it gets the highest it's currently colliding with
 

hughrock18

Member
Using the "ground level" is a good technique, it seems like you need to reset ground level at the start of the script, to 100000 or something lower than everything, then each step it gets the highest it's currently colliding with
I figured something to that effect. What is the best way to cycle through colliding instances to check for the one I need to interact with?

Also, my actual player object never leaves the emulated "absolute floor" (ground level 0 - a "higher" depth from the ground is read as negatives - so (-1) is "higher" than (0) and nothing is "lower" than (0)). Instead, the player sprite is just drawn with the z_height taken into consideration "above" the actual object. With all objects being drawn like this, every object that is directly above another are all overlapping at the same x,y pos. I was thinking that when the player object collides with one of these "object stacks" it could use the one of the collision_list functions to make a list of said objects and cycle through the list to determine which object has the appropriate z_height, etc.. Is that the best way to get data for 2.5d jumping, or is there another "more efficient" way to do it?
 

Joe Ellis

Member
I'm really not sure about the depth sorting, maybe @RujiK can help you out, I know he's done all that kind of stuff really well.

For getting the list of colliding instances\multiple instances to run the same code on
I use this technique:

GML:
var _id = id, l, num = 0, i = 0, ins;

with object_to_check_collision_for
{
if place_meeting(x, y, _id)
{l[++num] = id}
}

repeat num
{
ins = l[++i]

//do code here

}
 

hughrock18

Member
I'm really not sure about the depth sorting, maybe @RujiK can help you out, I know he's done all that kind of stuff really well.

For getting the list of colliding instances\multiple instances to run the same code on
I use this technique:

GML:
var _id = id, l, num = 0, i = 0, ins;

with object_to_check_collision_for
{
if place_meeting(x, y, _id)
{l[++num] = id}
}

repeat num
{
ins = l[++i]

//do code here

}
Thank you for the quick reply. I'll seek RujiK out and see what I can figure out.
 
Top