1 of 20

Labs 5 – Dungeon & Rogue-like

Procedural Content Generation for Computer Games

Vojtěch Černý

cerny@gamedev.cuni.cz

2 of 20

Prerequisites

  • Windows / Mac / Linux
  • Java 8+
  • (Recommended) IntelliJ IDEA
    • Community edition suffices
    • As a student you can get Ultimate by just entering your student number

3 of 20

The Task

This homework has two parts, worth 6 points total:

  • Part 1 – dungeon generator
  • Part 2 – roguelike game (using the dungeon generator)

Given: 24. 4. 2026

Deadline: 15. 5. 2026

As always, aim for at least GameJAM quality

4 of 20

Codebase

Start with the roguelike repo

  • JVM target only for now, but will support JS targets in the future
    • If you use Kotlin for this task, you will have a browser build then
  • Sources are in src/jvmMain/kotlin/cz/cuni/gamedev/nail123
  • It uses Zircon for tileset management
  • Check out the Wiki - LOTS OF COOL GUIDEs there…

There are two Gradle tasks (run by ./gradlew <task>)

  • renderPng – will generate a PNG file into the out directory
  • playGame – lets you explore the dungeon with a character

Try running them (first run will fail!).

5 of 20

Variants

You should pick one of the following options:

1) write your own (non-trivial) generator

2) tweak Wave Function Collapse

Java or Kotlin:

  • to work in Java, change defaultWorld in GameConfig to SampleJavaWorld

6 of 20

Variant 1 – generate own dungeon

  • Generate a dungeon (of rooms and corridors)
  • Use something non-trivial – see examples below

Forbidden methods

Using noise

Using cellular automata

Acceptable methods

Approaches from lecture 5:

  • Binary division
  • Maze-first / maze-last

Graph / Shape grammars (may be hard)

or anything creative, write me if you have an idea, if it’s non-trivial I will accept it

7 of 20

Variant 1 - How to

  • Modify world/worlds/SampleWorld.kt
  • You can check DungeonWorld.kt or WaveFunctionCollapsedWorld.kt for some inspiration

8 of 20

Variant 1 - Criteria

  • Working generator with rooms – 1 pts
  • Corridors – 1pt
  • Exit (stairs) placed reachably, but far away from player – 1 pt
    • Easy when using Pathfinding.kt::floodFill

9 of 20

Variant 2 – tweak Wave Function Collapse

10 of 20

Variant 2 – tweak Wave Function Collapse (WFC)

  • The repository contains a wave function generator for levels in

world/worlds/WaveFunctionCollapsedWorld1, using

world/builders/wavefunctioncollapse/WFCAreaBuilder

  • As source, it uses levels/wfc_sample.txt
  • It has 2 weaknesses:
    • It creates rooms not connected to the dungeon
    • It creates too many cycles
  • Add a post-processing step, to:
    • Reconnect floating rooms to the rest of the dungeon
    • Have less cycles (e.g. fill some corridors)

11 of 20

Variant 2 - How to

  • Modify world/worlds/WaveFunctionCollapsedWorld.kt
    • or Java world/worlds/WaveFunctionCollapsedJavaWorld.java
  • Use this world in GameConfig.kt

  • Add a post-processing step to the buildLevel function
  • You can also modify resources/levels/wfc_sample.txt
    • It may help with the cycles

  • Hint - Pathfinding::floodFill might be a useful function

12 of 20

Variant 2 - Criteria

  • Adding connectivity to all areas – 2pts
  • Removing cycles – 1pts

13 of 20

Part 2 – The Task

You should implement a (simple) rogue-like/rogue-lite game.

Features you should aim for:

  • Turn-based RPG
  • Procedural environment (using Part 1)
  • (Optional) Permadeath

You should also use non-trivial PCG for one other component of the game:

  • e.g. items, enemies, quests, …

14 of 20

Part 2 – Codebase

Continue from Part 1 – build your game on top of your dungeon generator.

You should create your own fork of the repository and work in reasonably small commits.

Both gradle tasks should still be the main approach:

  • renderPng – will generate a PNG file into the out directory
  • playGame – lets you explore the dungeon with a character

15 of 20

Part 2 – Criteria

Playable game, with some amount of challenge and content – 2 pts

  • GameJAM quality, try to make it fun

Additional PCG component – 1 pts

1 bonus point, if you add at least one of:

  • story
  • sidequests
  • class selection
  • music + sfx

16 of 20

Bonus point

Get your own tileset

  • recommended 16x16px, otherwise adjust constants in GameConfig.kt
  • find a suitable one for a whole roguelike (with monsters, items, …)

Howto:

  • create a folder in the tilesets directory, add as png in there
  • add metadata tileinfo.yml
    • follow the kenney_superscaled_16x16 tileset example, or see documentation
  • modify tiles constants in roguelike/tiles/GameTiles.kt
  • 1 bonus point

17 of 20

Bonus points

  • Find a tileset with 47 tiles autotiling and adjust the tiling in GameTiles.kt so it works

  • 2 bonus points

18 of 20

Submission details

  • Submit via this form
  • Submit:
    • link to your fork of the project (or zipped)
      • Don’t forget to have comments in your code!
    • 3 screenshots (rendered via renderPng gradle task)
    • describe your approach
    • describe what you have tried, what worked or didn’t, the problems you faced
    • how much time you spent with the project (will not be part of evaluation)
  • Deadline is 15. 5. 2026
    • If you need more time, talk/write to me before the deadline

19 of 20

Questions / Problems

  • You can always e-mail me at cerny@gamedev.cuni.cz
  • I’m also frequently online at Discord https://discord.gg/4nfAzG

20 of 20

Q & A

Vojtěch Černý

cerny@gamedev.cuni.cz