GameMaker background depth

Z

zendraw

Guest
how do you set a background`s depth? i have a room 16k in height and i set a solid objects depth to room height and it disapears and i suspect it goes behind the background layer.
 

vdweller

Member
Game Maker 2's Z-buffer spazzes out at around +-16K, either force the legacy system or put limits in your min/max depth
 

ophelius

Member
Game Maker 2's Z-buffer spazzes out at around +-16K, either force the legacy system or put limits in your min/max depth
Is it exactly +- 16000, or 16384 since internally GM is probably using a signed 16-bit variable for those limits.
So if his level is 16000 high, there might be room enough for 384 depths behind it
 

O.Stogden

Member
Is it exactly +- 16000, or 16384 since internally GM is probably using a signed 16-bit variable for those limits.
So if his level is 16000 high, there might be room enough for 384 depths behind it
The manual says don't exceed -16000 or +16000, so I would guess it's exactly.
 

vdweller

Member
Is it exactly +- 16000, or 16384 since internally GM is probably using a signed 16-bit variable for those limits.
So if his level is 16000 high, there might be room enough for 384 depths behind it
IMPORTANT! There is a minimum and maximum layer depth of -16000 to 16000. Anything placed on a layer outside that range will not be drawn although all events will still run as normal.
 
Z

zendraw

Guest
lol so theyr not behind the background but simply not drawn becouse of limitations.well this pretty much throws big overworlds out the window with -y as depth system.
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
There is nothing stopping you manually sorting things... Like, have a controller object and then manually draw everything in that based on it's y position. Alternatively, if I remember rightly, there is a GPU function that will actually permit you to draw stuff outside of the +/-16000 range, as it's required for imported legacy GM 1.4 projects... can't remember what it is right now though... :8

PS: Interesting thread on this here on the forum: https://forum.yoyogames.com/index.p...rity-list-nested-list-grid-binary-list.13425/
 
Z

zendraw

Guest
the only reasonable solution is to base the depth on the view position.
-(y-camera_y);
atleast for instances around the view, the rest can go to 0

what you suggest, dealing with data structures... that is a nono, opens up more work then nececery.
 
Top