try online view source 2025
This is my second attempt at a 2D rewriting system, this time with an entire web editor for arranging and drawing rules. Making an editor with decent UX is a big task and there is a lot of work left, including initial documentation, but it feels promising. I've made multiple small games with it, including a remake of my '>' game.
Here are a few similar projects that are worth checking out, some of which I discovered while working on this project: PuzzleScript CellPond MarkovJunior imagegram pix64
download prototype/ view source 2024
I have spent years prototyping puzzle game ideas with PuzzleScript, a browser-based game engine for making small, grid-based puzzle games. The game logic is implemented through rewrite rules, which are fairly unusual when coming from most programming languages. Here's an example of a simple rule:
[ > Player | Crate ] -> [ > Player | > Crate ]
Rules are applied anywhere in the grid and by default duplicated to all four directions. They look for a pattern on the left side and replace it with the pattern on the right side. There are no variables, no math operators. Surprisingly complex behavior can be achieved with just a few rules. I was wondering about ways to expand and simultaneously simplify this system - how expressive and general can rewrite rules get? This prototype is an attempt to create such a system.
The 2d rewriting prototype is implemented in Lua using LÖVE. Unlike PuzzleScript, there are no cells, no objects and sprites, no special syntax for drawing. Instead of a grid of cells with objects, an image is directly rewritten by rules that look for certain patters of white and black pixels. The system is Turing-complete and can be used for turn based or real-time games with multiple levels, generative art and so on.
More detail would currently be out of date very quickly, but I'm happy to answer questions about the project. Feel free to join me on the Nova Discord at discord.nova-lang.net. Nova is another rewriting language I discovered early in the development of this project, and strangely powerful yet even more minimal in a way.