Skip to content

Acid

Acid is a domain-specific programming language for procedural 2D tile-based content generation, in addition to generation of animations and polygonal mutations through use of a simple but expressive syntax.

The name "Acid" is an acronym, specifically: Abstract Computational Imaging and Development Tool, where the T is omitted for semantic convenience.


An example is as follows, the code draws a square at (100, 100) on the screen, rotates it 90 degrees anti-clockwise, and animates its mutation into a circle. The final operator indicates the end of the transition chain.

Interpolation animations are executed automatically.

with animation

square {
    pos {
        x: 100,
        y: 100
    }
}   -> x2
    -> rotate90a
    -> circle!

A more complex example is observable below.


The code used to produce the above output is as follows:


with animation

method draw_explosion_particle($x, $y, $newX, $newY) {
    circle { pos { x: $x, y: $y } }
        -> x2
        -> circle {
            pos {
                x: $newX,
                y: $newY
            }
        }
        -> square {
            pos {
                x: 10,
                y: 20
            }
        }!
}

set_rand_range(0, 2500)

repeat (115) {
    draw_explosion_particle(rand(), rand(), rand(), rand())
}

PCG can be carried out through use of the following syntax, the outputs are TMX or CSV tilemaps that can be used as maps in 2D games (this could be top-down, isometric, or side-scrolling).

For example:

with tile

tile grass  = bit(24)
tile water  = bit(25)
tile rock   = bit(26)
tile path   = bit(30)
tile wall   = bit(31)

rows {
    1 * rock -> 20 * path
    3 * wall -> 17 * grass
}

xrows !mirror {
    4 * rock -> 4 * grass
}