Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

That fire effect is a light and uses the particle system combined. So, you would set the light depth of the object, and the depth of the particle system.

Deleted 1 year ago

I watched your tutorial on normalized depth sorting, and decided to change my depth according to it. So now all my objects have positive depth with depth = room_height - bbox_bottom + 100 (except for lighting engine which is -100). 

If I set depth of le_light_fire to -1 and part_system_depth(particle_system,-1), it does not draw the particles over the ordinary objects with positive depth.

I also tried a depth that is BELOW the lighting system itself (-100) just as a test. If I set the depth of le_light_fire to -200 and part_system_depth(particle_system,-200), it does not draw the particles over the ordinary objects with positive depth.

Ah, I was looking through things and it is the regular instance variable depth that needs changed along with the particle system.

I have it setup to use layers which work well for drawing over things.  

I'll modify things for the next update, and until then set the instance "depth" variable in the effects object as you would any instance.

Yep. That fixed it.  Also, you don't have to change the depth of the particle system or the le_light_fire, just the le_effects object.

Only problem with this set up is now all of my particle effects depth are determined by a single abstract object that may need different depths depending on what is using it to make the particle effects.

It's possible to make multiple particle objects and put them on different layers.  That would require keeping track of their id of course.

Now that static variables are really easy to use I might try to add another setup I use for "depth" based particles.  Basically it's a static array of particle systems that gets cycled through and the depth changes.

It's just annoying that entire particle systems in GM are assigned a single depth or layer.


I would be interested in trying out the static array method, since I've mostly done away with layers and moved to the depth sorting you propose in your tutorial. 

There really should be an easier way to do all of this. GM is supposed to be an easy engine to develop on, but some things....