Liquorice
From DoomWiki.org
Liquorice is a system for constructing levels by writing algorithms to describe the geometry. A Liquorice program is a series of instructions to move a virtual "turtle" or "pen", which define the walls, floors, rooms and monsters as it goes. Liquorice was closely inspired by WadC, and was written by Jon Dowland.
Liquorice is an embedded domain-specific language (eDSL) within the pure functional programming language Haskell.
Similar to WadC, Liquorice's strength is with structures that can be procedurally generated: a function can be written to create a pillar, for example, and then invoked any number of times to create many pillars.
Example script[edit]
The following script generates a triangular Sector with a different texture on each Sidedef.
-- simple example, triangle (for orientation); unique texture per line import Liquorice.Monad import Liquorice.Render main = buildWad "example1.wad" $ runWadL $ do mid "ZZWOLF1" draw 128 0 mid "ZZWOLF2" draw 0 128 turnaround mid "ZZWOLF3" draw 128 128 rightsector 0 128 160 turnaround step 64 32 thing
In comparison to WadC[edit]
In WadC the current state of the map is being constructed in the "background" and does not provide the user with direct access to those data structures. Once a Line is placed, it is permanent. In comparison, a Liquorice user has access to the complete context at all times, and can modify existing structures. The example birds.hs, a conversion of a similar WadC program birds.wl, include geometric structures which are impossible to construct in WadC.
As Liquorice is a library within Haskell, the user can use all of Haskell and other libraries in the construction of their maps. In particular, infix numerical operators (1 + 2) are much more convenient than Polish notation in WadC (add(1,2)).
WadC is reasonably mature software with a GUI for development. Liquorice is experimental and requires the user to be familiar with Haskell and have a Haskell development environment installed.
External links[edit]
- Liquorice at GitHub
- birds.hs, conversion of WadC's birds.wl
- birds.zip, output of above with nodes added