Legacy GM Isometric Depth Question

mar_cuz

Member
Hi GMC,

Sorry I know this is an age old question. I'm working on an isometric game and I want the player to walk in front of and behind tiles. I know the depth = -y trick. But that only works if I use objects and I want to use tiles. My rooms are going to be quite big with a lot of other objects and I don't want to bog the system down with a zillion objects if I don't have to. I read a little on depth ordering but it seems quite complex for me to do so I was hoping there is an easier way I can have the player walk in front of and behind tiles.

Thanks in advance.
 
F

Falconsoft-Industries

Guest
I use layers, to deal with those sorts of issues when doing tile sets. ;) Hope I helped, oh with the layers make them different depths.
 
P

ph101

Guest
I know the depth = -y trick. But that only works if I use objects and I want to use tiles.
False! On GMS 1.4 you can add tiles with a specific depth using tile_add(background, left, top, width, height, x, y, depth); and via this you can store the tile id so you can alter it, change depth or position etc later. I didn't realise tiles could have depth when I started out on my isometric game and had a zillion objects like you worried about and it was indeed a big error. Also yes you can just use -y or possibly perferably -x-y for your tile depths. I'm assuming you are using a 2d grid or set up and and projecting it into isometric space too, you should be. There is in fact an isometric tutorial with gm 1.4 which can help get you started too..

edit. Thats the easy answer. You want to talk about getting moving sprites to appear infront/behind of tiles without clipping? A bit more complex, but "solved" long ago, at least one sort-of easy implementation of it. It may not be needed but you can try rewriting this so called 'Filmation' technique:

http://bannalia.blogspot.co.uk/2008/02/filmation-math.html
 
Last edited by a moderator:
A

Arkid

Guest
I use layers, to deal with those sorts of issues when doing tile sets. ;) Hope I helped, oh with the layers make them different depths.
No that wouldnt work on the isometric depth.:( You would have to add a layer for every 32 pixels of the room or whatever the unit of tiles be. Im never tried doing that so i guess I cant help much.:oops:
 
J

joqlepecheur

Guest
Is your game randomly generated content or crafted by hand ?
What is your native resolution and the size of the cells on the grid ?

You could have every row of tiles have its own depth?
Maybe make a mix of tiles and objects ?
 

mar_cuz

Member
Is your game randomly generated content or crafted by hand ?
What is your native resolution and the size of the cells on the grid ?

You could have every row of tiles have its own depth?
Maybe make a mix of tiles and objects ?
Hi I'm crafting content by hand. Movement is free movement in 8 directions. I don't use a grid though with objects I keep them to a 64x32 base for their scale to be the same. Native resolution is 1920x1080 with 64x32 cells
 
J

joqlepecheur

Guest
Ok.

Maybe you have a screenshot or mock-up of your project ?
 
J

joqlepecheur

Guest
oh it's tricky, you have height as well.
I'd say go with objects. If they have no collision and code you will be fine, and you can cut off instances outside screen to save process

Now it's time to reflect on ph101 reply :)
 

mar_cuz

Member
oh it's tricky, you have height as well.
I'd say go with objects. If they have no collision and code you will be fine, and you can cut off instances outside screen to save process

Now it's time to reflect on ph101 reply :)
Thanks for the input. I'm thinking objects might have to be the way to go as well but they will need code for depth and they will have collisions so my rooms may have to smaller and I will have to deactivate instances outside the view.
 
Top