Sons of Camelot: Depth Tables

  • By default in GM all objects have depth 0.
  • In case of equal depth, "tie", the newest object will prevail and will be above the oldest one.
  • Positive depth numbers mean distant instances,  far away from player (in other words, "into" the screen). 
  • Negative depth numbers mean near instances, close to the player (in other words, "de profundidad indican instancia cercana al jugador (es decir, más cerca, towards "outside" the screen).
  • Then virtual controls (phones,tablets), must be great negative numbers (i.e. -9999).

You can choose depth when "building" the object, in CREATE event, in this case depth won't change during the game. Also you can choose depth in every frame, in STEP event, in this case every frame depth will be updated, it's changed during the game.

We use to match depth with the negative "y" value, as in physical screen, y=0 means upper part, when going down "y" increases. That way, if an object it's moving up and down, depth is going also up and down:
In that case put in STEP event:   depth = -y;

Example: Depth table, 1st round "Blood Bros" game
Cart, Common enemy (away)-200
Common enemy-250
Horse enemy, Bonus-300
Rolling barrel-325
Enemy bullets-350
Player bullets-400
Player sight-450
Barrel (defense player)-475
Interface (lifes, score, etc)-9999

In this table, I choose depth values to show you how it works. That means values could start i.e. in 0 and going up to higher negative values. Also could start in 0 for interface and then going up in positive values, higher when further away. Doesn't matter your system.

To understand this, let's see this "Blood Bros" screen:


Players (indian and cowboy) are closest to us, closest to physical screen, that means, its depth values are higher "negative " values than the other objects. In my table -9999.
After them, we found defense barrels and players sights. Its depth value are lower then the player one, but "lower" then the others.  In my table -500.
After them, enemies and Rolling barrel.
After them.... etc

Above all (including players) is the Interface, in this case no problem, is just an arcade game, no on-screen controls. but in a mobile game, controls must have the highest negative value.

I choose a similar table for "Sons of Camelot".

Biggest diference: on screen controls. Depth = -9999.
Same for score, life, etc.