Voodoo script

A voodoo script is a design pattern often featured in modern Doom mapping.

Doom does not naturally feature any sort of scripting language, and while advanced source ports have implemented various languages, many Doom mappers have wanted to add more interactivity to their maps without being forced to tie their WAD to that particular source port. After the release of the BOOM source port, mappers soon discovered that if they placed a voodoo doll on a sector with a scrolling floor, the voodoo doll could trigger linedefs on its own as it was scrolled along the floor.

Ingenious design of the scrolling floor, and removable obstacles placed in the way of the voodoo doll, could result in more complex behavior. Mappers soon also realized they could apply this trick to existing Doom-engine games that featured scrolling floors, such as Heretic, Hexen, and Strife.

Voodoo scripts can also be used, to a more limited extent, in vanilla Doom without using carrying sectors. This requires other means to force the doll to move horizontally, such as damage from an exploding barrel destroyed by a crusher. To prevent the player from noticing the sudden damage, further tricks must be employed, making them much harder to use than the conveyor-belt approach.

The discovery of Mikoportals in 2018 introduced the possibility of voodoo scripts in vanilla Doom through a BOOM-like conveyor belt effect.

Advantages
Voodoo scripts operate as an ersatz visual scripting language, where all logic is effectively encoded into the design of the map itself. This makes it compelling for many map authors who are comfortable with creating a voodoo script but would not feel comfortable trying to learn and use a "real" embedded scripting language.

Making the voodoo script a part of the map also makes it impossible for it to be severed from the map itself, and they cannot be obfuscated, as with ACS bytecode.

Disadvantages
As voodoo scripts are just carefully designed map geometry, there is no real internal "state" of the script that can be examined or debugged during the design process. The voodoo script can break silently due to any number of unseen factors, from user error to game engine bugs. They are particularly sensitive to minute differences in physics handling between ports, such as ZDoom's scrolling floor speed sometimes differing from other BOOM-derived source ports. Designing a reliable voodoo script may require an iterative trial-and-error process needing manual tests on every target platform and source port.

Voodoo scripts will not work in deathmatch mode because deathmatch starts are used in place of player starts required to trigger linedefs. In co-op multiplayer, repeating actions can introduce a problem on how to asynchronously reset the script to allow another player to execute it.

A Voodoo script often uses the player1 object. If this voodoo script is used to implement giving the player damage, it is always player1 that gets the damage. This results in coop games where player2 walks into the electric arc, and player1 gets the damage (or gets killed). Doom Legacy has implemented menu selected alternatives, such as detecting which player last triggered an action, and routing the voodoo damage to that player instead.