Skip to content

effekt-community/effektive-blocks

 
 

Repository files navigation

Note

This is a community-maintained fork of a MIT-licensed student project in the Effective Programming with Effects course in winter semester 2025/2026. Be warned that this is not an officially endorsed project, the code in this repository may be not idiomatic Effekt.

The original repository is https://github.com/Plixo2/effektive-blocks

Effektive Blocks

Map generation using wave function collapse in Effekt

Example

Animation

Installation & Building

Prerequisites

  • A valid Effekt installation (version >= 0.59)
  • A web browser (e.g. Firefox, Chrome)
  • A Tile and Ruleset (explained in the web interface)

Building

effekt --backend js-web src/main.effekt

Depending on your setup and effekt version, you might need to adjust optimizations to speed up compilation:

effekt --max-inline-size 10 --backend js-web src/main.effekt
Building with NIX

You can also use Nix to manage dependencies and build the project:

nix develop
nix run
nix build

Running

After building, you can open the out/main.html file in your browser:

Interface

Usage

Provide the following inputs in the web interface:

  • Tileset
    Image that contains all the tiles you want to use in your map, arranged in a grid. (e.g. 4x6 tiles)

  • Ruleset
    Image that defines which tiles can be placed next to each other based on their edge colors.

    The Ruleset image and the Tileset image should have the same amount of rows and columns. You can find a example tileset and ruleset in the examples folder.

  • Pixels per Tile
    Defines how many pixels wide and high each tile is in the tileset (e.g. 32x32 pixels)

  • Grid dimensions
    Defines the world size you want to generate.

  • Speed
    Defines how fast the automatic generation should be

  • Manual mode
    If enabled, you can choose which tile to collapse next manually by clicking on it.

These instructions are also available in the web interface.

Testing

You can run the tests using:

effekt --max-inline-size 10 --backend js src/test.effekt

Make sure you have the canvas module installed, as it is required for the tests to run:

npm install canvas

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Nix 100.0%