Author Topic: The benefits of walk-behind masks vs multilayered setting  (Read 174 times)

Crimson Wizard

  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Lifetime Achievement Award Winner
    • Crimson Wizard worked on a game that was nominated for an AGS Award!

I am very curious about whether classic walk-behind masks has any practical advantage, even if in particular situations, over making multi-layered rooms (e.g. using objects). And whether such advantage is related to how AGS deals with masks (specific to workflow).

The main reason I am asking is that I noticed that tzachs's new developed engine supports walk-behind masks as an option, although the engine itself has 3d-texture rendering, so this seem to be a support of "legacy method" rather than actual necessity. So this is both a concern and curiosity on my side (not a big deal, but supporting extra features means spending extra effort).

AFAIK, the origin of this method comes from peculiarities of software rendering and system limits of old times. Walk-behinds could be used to optimize drawing a bit, and also save some space both on disk and memory.
But in a contemporary engine which uses textures it has zero advantage over adding extra layer to the room (as an object of sorts): it still has to be a separate texture to be drawn above characters.
Even in AGS, when you run game with Direct3D or OpenGL renderer, the engine "cuts out" the "walk-behind" piece of background onto a separate image, partially duplicating room image in memory.

So, there is seem to be no benefit from the program's or perfomance perspective anymore.

Is there any benefit from game designer's or artist's perspective?

I don't have much experience here, so my view on this is mostly speculative. One good thing about walk-behind maks I know is that you can make one fast assuming you have a right tool to do so , which may be useful if you are prototyping room with a flat background. On the bad side, annoying thing about masks is that you have to constantly keep it updated with background graphic: if an object on background changes in shape even by a pixel - the mask has to be synchronized again; so this might be counter-productive in the long run. Another thing is that walk-behind masks don't work with antialiasing or half-transparency.
In the abscence of a tool that allows you to draw masks and save them in engine's format, you would have to keep mask as a separate image (or as a layer in your background image document), so you are having multiple images anyway.

What is your view on walk-behind masks?
« Last Edit: 10 Mar 2018, 21:32 by Crimson Wizard »


    • Mandle worked on a game that was nominated for an AGS Award!
Just from my gut really:

When I first started using AGS as a newbie and read the first tutorial on how walkbehind masks work (the one with that SpaceQuest/Aliens style background) that encouraged me to try to make a game because it looked like something I could do with zero coding experience at that time, which I did within a week as a class project with my students: "My Very First Adventure"

It was so magical for me at that time to see the character walking behind the trees that the kids had glued onto the craft paper backgrounds and they gasped as well when they saw that in the finished game.

So yeah, not a very technical answer, but simple mechanics like walkbehinds might draw more people to an engine as newbies. They may leave this option behind later on when they understand how to do multi-layered backgrounds with objects but as a stepping-stone to get to that point walkbehind masks might be valuable.

I know they were for me, and I still get a kick out of them.


  • Rottwheelers
  • When life hands you lemons, combine them with the mop
    • I can help with AGS tutoring
    • Best Innovation Award Winner 2016, for improving and extending the AGS scripting language
    • I can help with proof reading
    • I can help with scripting
    • Gurok worked on a game that was nominated for an AGS Award!
      Gurok worked on a game that won an AGS Award!
I think walkbehinds are an attempt to emulate (or improve upon) SCI's priority lines. I don't use them for two reasons:
 - Direct3D quirks
 - No way to specify alpha


  • Cavefish
  • Fleeing the Cylon tyrrany...
    • Cassiebsg worked on a game that was nominated for an AGS Award!
Actually I use it most of the time. It just saves on importing new sprites and keeping the sprite counter lower (and thus a slightly less huge sprite file size... and since that one is limited to 2Gb... (roll) ). Though I would just prefer to use objects as that saves a lot of boring painting with a clunky system (only one undo for one). But then I would also be faced with the object limits...(roll)
There are those who believe that life here began out there...


  • AGS Baker
  • Mittens Knight
  • Return once more to the Two Kingdoms!
    • I can help with publishing
    • I can help with story design
    • Radiant worked on a game that was nominated for an AGS Award!
      Radiant worked on a game that won an AGS Award!
I think the main benefit is from the artist's experience, as an artist has the option to work in a single layer instead of multiple. I'm sure not all artists do that, but having the option would be a good thing.

Furthermore, working with large objects in the editor is rather awkward; it's easier to work with walkbehinds and use small objects where needed. I use objects instead of walkbehinds only where transparency is needed (which is pretty rare) or when they need to animate in a way that multiple room backgrounds don't cover.