documentation for level builders: docs index, step-by-step guide, file format reference (wad, geometry, objects, textures, audio, testlevel chapters, engine limits), strat vm and script language with the arena as worked example, tools overview, developer notes; readme rewritten as project front page with screenshots; review notes moved to notes/dev

This commit is contained in:
MineTec committed 2026-11-07 16:14:40 +01:00
1 parent 00b2880d67
commit 624718b893
41 files changed
+2175 -259

No files matched your search

+126
View File
@@ -0,0 +1,126 @@
# Build your own level
A step-by-step path from "I have the game" to "my friends are playing my level". Each step is short
and links to the chapter of the [editor manual](../manual/index.md) that has the details.
The manual is also built into the editor: press **F1** over any panel, tool or dialog.
| Step | |
|---|---|
| 1 | [Set up LlamaMod](#1-set-up-llamamod) |
| 2 | [Learn the editor in ten minutes](#2-learn-the-editor-in-ten-minutes) |
| 3 | [Plan the level](#3-plan-the-level) |
| 4 | [Build the ground](#4-build-the-ground) |
| 5 | [Start, checkpoints and the exit](#5-start-checkpoints-and-the-exit) |
| 6 | [Objects, enemies and cameras](#6-objects-enemies-and-cameras) |
| 7 | [Look and feel: textures, fog, music, light](#7-look-and-feel-textures-fog-music-light) |
| 8 | [Play-test](#8-play-test) |
| 9 | [Share it](#9-share-it) |
| 10 | [Go further](#10-go-further) |
Before you start, skim [Design rules](design-rules.md): the numbers (jump distances, draw
distance) and the handful of rules that keep the game from crashing.
![The level editor](../img/editor.jpg)
## 1. Set up LlamaMod
1. Get **your own copy** of the game: the CD or an ISO image of it (*The Emperor's New Groove* PC,
2000; German: *Ein Königreich für ein Lama*). LlamaMod contains no game files.
2. Download the **full** package for Windows or Linux, unpack it and start `LlamaMod.exe` /
`./LlamaMod` (Linux needs Wine to run the game). Or build it from source – see the
[main README](../../README.md#build-from-source).
3. The first-start wizard copies the game into LlamaMod's data folder. The original CD or ISO is
never changed.
4. Click **Play** once to check that the unmodded game runs.
Manual: [Installing LlamaMod and the first start](../manual/02-installing.md).
## 2. Learn the editor in ten minutes
Click **Level Editor** in LlamaMod and follow
[Your first level in 10 minutes](../manual/tutorial-first-level.md): a new level from the
*Island* template, a ramp, a coin trail, play it. Then read
[Introduction and concepts](../manual/01-introduction.md) – tiles, brushes, objects, zones, base
levels, chapters – and [Navigating the viewport](../manual/04-navigation.md).
## 3. Plan the level
* **New or edited?** A *new level* starts empty on a **base level** (default: Village 1) that
provides the object types, textures, sky, fog and music. *Editing an original level* changes the
real Village, River … in place ([tutorial](../manual/tutorial-original-level.md)).
* **Choose the base by its objects.** Only the base's object types are available directly; more
can be imported from any world ([Importing objects](../manual/09-objects.md#importing-objects-from-other-worlds)).
* **Size.** The village grid is 96 × 96 cells; the llama is 0.6 tall and jumps about 1.3 cells.
A small, dense level plays better than a big empty one – the draw distance is only 8–16 cells.
* **Where it goes.** New levels live in the hidden world 9, *TestLevel*, on chapter 1 or 32–49
([why](../reference/testlevel.md)). The editor picks a free chapter.
## 4. Build the ground
* **Brushes** (B) draw boxes, ramps, stairs, cylinders and more; they are cut into tiles when the
level is built ([Building geometry](../manual/06-geometry.md)).
* **Tiles** (T) place the base level's own tile models for an original look.
* **Meshes** from Blender or any 3D program come in as OBJ or glTF
([Importing meshes](../manual/07-meshes.md), [Blender tutorial](../manual/tutorial-blender.md)).
* **Collision** (K) decides what is solid: walls, floors, invisible walls, death floors, the exit
floor. The llama cannot step up even small edges – use slopes, or walls without collision.
![A level exported as glTF and opened in Blender](../img/gltf-blender.jpg)
## 5. Start, checkpoints and the exit
Use the one-click setups in the Objects panel ([Objects](../manual/09-objects.md#one-click-setups)):
* **Player start** – the llama plus its start camera node behind it. Keep the space behind the
llama free, or the camera jumps aside.
* **Checkpoint** – where the llama respawns after a fall.
* **Exit** – a LevelDoor *and* a floor with collision material 16 in the same grid cell. Without
that floor the exit does nothing ([why](../reference/objects.md#the-exit-leveldoor--certain)).
Its target is the next level; in TestLevel never "world finished" (7, 7, 7).
* **Death plane** – a death floor below everything, so falling off respawns instead of falling
forever.
## 6. Objects, enemies and cameras
* Place coins with the **Coin tool** (O), anything else from **Assets → Objects**
([Objects](../manual/09-objects.md)).
* Enemies and moving things often need a **waypoint chain** – some guards even need a pair of
waypoint boxes and an event bit, or the game removes them. The Inspector and *Check for problems*
tell you ([Waypoints](../manual/10-waypoints.md)).
* **Cameras**: camera zones, cut scenes and the start camera
([Cameras and triggers](../manual/11-cameras-triggers.md)).
* Change how an object behaves – a number in its script or a whole new type: see
[Strats](../strats/README.md) and [manual chapter 22](../manual/22-strats.md).
## 7. Look and feel: textures, fog, music, light
* **Textures**: the base's textures, imported PNG/JPG pictures, painting onto faces, flip-book
animations ([Textures](../manual/08-textures.md)).
* **Environment zones** set fog (= draw distance), sky colour and **music**; teleport zones move
the player between areas ([Environment](../manual/12-environment.md),
[music ids](../reference/audio.md#music)).
* **Light**: tiles get baked vertex colours (*Bake lighting*), lights only light objects.
* **Visibility regions** hide areas the camera cannot see – needed for big levels
([Visibility](../manual/13-visibility.md)).
## 8. Play-test
**F5** builds the level and starts the game directly in it; **Shift+F5** starts at the camera
position. *Check for problems* (also run on every build) lists errors and warnings – double-click
one to select the culprit. **Escape** in the game quits straight back to the editor.
Manual: [Building, problems and play-testing](../manual/15-build-play.md).
## 9. Share it
**File → Save** writes a small `.llamalevel` project: only your changes, no game data. Send that
file; the receiver copies it into LlamaMod's `levels` folder (or opens it in the editor and uses
*Level → Add to LlamaMod…*), ticks it in the *Levels* category and clicks *Apply*. It is built from
their own game copy. Manual: [Sharing levels](../manual/17-sharing.md).
## 10. Go further
* Build levels from code instead of the mouse: [Levels from scripts](levels-in-code.md).
* Understand the data: [Reference](../reference/README.md).
* Write object behaviour: [Strats](../strats/README.md) and the
[Alligator Arena walkthrough](../strats/arena.md).
* All tools at a glance: [Tools](../tools.md).
+48
View File
@@ -0,0 +1,48 @@
# Design rules
The numbers and rules that matter when you design a level for this engine. Background and sources:
[Engine facts and limits](../reference/engine-limits.md).
## Sizes to design with
| | |
|---|---|
| one grid cell | 1 unit |
| llama | 0.6 tall, walks 1.1 units/s |
| jump up | ≤ 0.35 (0.5 fails) |
| jump across, with a run-up | ~1.3 (from standing much less) |
| easy parkour | gaps 0.3 with +0.2 height, platforms ≥ 1.5 long |
| steps without jumping | none – use slopes or walls without collision |
| draw distance | the fog end of the zone: 8–16 cells in the originals |
| objects visible | within ~12.5 units of the llama |
![The Test World's gallery: every figure of the game on a pedestal](../img/testworld-gallery.jpg)
## Rules that keep the level working
1. **One player start**, with nothing solid right behind the llama (start camera).
2. **Exit = LevelDoor + floor with collision material 16 in the same cell.** Target (1, 9,
chapter) in TestLevel – never (7, 7, 7).
3. **A death floor or death plane** under every place the llama can fall to.
4. **A checkpoint** before every hard part.
5. **TestLevel chapter 1 or 32–49** for new levels.
6. **Guards and box walkers need their waypoint boxes** (and guards an event bit someone sets),
or the game removes them.
7. **Every area must be visible from where the camera is**: with visibility regions, check the
masks (*Check for problems* reports regions nothing can see).
8. **Stay within the budget**: 16 MB level memory, 127 texture pages, 128 sounds – the import
preview and *Check for problems* show where you are.
The editor and both level builders enforce the data-level rules (tiles inside the grid, vertex
colours, type fields, collision cells) automatically. *Check for problems* reports the rest.
## Good habits
* **Play-test often** (F5). The engine is unforgiving and a small change can stop the exit or
hide an area.
* **Look at the originals.** Open an original level in the editor and see how it builds doors,
cameras and enemy paths; the [debug view mod](../tools.md#debug-view) shows collision and
invisible objects in the running game.
* **Keep levels compact.** Short sight lines hide the draw distance and keep the frame rate up.
* **Copy numbers** (speeds, parameters, waypoint fields) from original objects that already do
what you want.
+93
View File
@@ -0,0 +1,93 @@
# Levels from scripts
Besides the editor, a level can be described as a short script that a **level builder** turns
into a complete WAD: geometry made of boxes, ramps, stairs, trees and sea, objects placed by type
name, lighting baked automatically. There are two builders with the same ideas:
| Builder | Language | Used by |
|---|---|---|
| [`tools/levelbuild.py`](../../tools/levelbuild.py) | Python 3 (numpy, Pillow) | the original test world [`levels/testwelt.py`](../../levels/testwelt.py), the jump lab [`levels/sprunglabor.py`](../../levels/sprunglabor.py) |
| [`levelbuild/LevelBuilder.java`](../../src/main/java/com/eliasmueller/llamamod/levelbuild/LevelBuilder.java) | Java (`LevelScript`) | the Test World mod ([`mods/testworld/`](../../src/main/java/com/eliasmueller/llamamod/mods/testworld/)), the [Alligator Arena](../strats/arena.md), the editor's brushes |
Both start from a **base level** (default Village 1): its object code, textures and sound are
kept; geometry, tile grid, vertex colours, objects and waypoints are generated from scratch. Full
documentation of the Python builder, the measured physics and the test world:
[notes/levelbau.md](../../notes/levelbau.md).
## A Python level
```python
LEVEL_ARGS = dict(name='MyLevel', seed=7)
def build(L):
L.sea(0, 0, 60, 60, y=-2.0, kill=(6, 4, 54, 56)) # sea + death plane
L.box(14, 12, 26, 24, -0.4, 0, top='stein', side='stein') # a stone plaza
L.stairs(26, 18, 29, 22, 0, 1.5, 3, '+x') # stairs up to the east
L.box(29, 17, 33, 23, 0, 1.5, top='gras', side='erde')
L.player(20, 14.5, rot=0) # facing +z
L.checkpoint(17, 18.5)
L.coins([(27, 20), (28, 20)])
L.strat('Bunny', 31, 20)
L.box(31, 21, 32, 22, 1.5, 1.56, top='platte', side='stein', mat=16) # exit floor
L.exit(31.5, 21.5) # LevelDoor in the same cell
```
```bash
python3 tools/levelbuild.py my_level.py out/my_level.wad # build
python3 tools/levelbuild.py --types # object types of the base
python3 tools/levelbuild.py --textures tex.png # texture names and a contact sheet
```
Coordinates are game units: x east, y up, z = grid row ("south"); angles in degrees, 0° faces +z.
Building blocks: `floor`, `box`, `platform`, `pillar`, `ramp`, `stairs`, `fence`, `tree`, `sea`,
`quad`, `collider`, `obj` (an OBJ file), `height_at`. The exit needs a floor with collision
material 16 in its cell – the test world uses `box(..., mat=16)` under the door.
The Python tools have a few **hard-coded paths** at the top of the scripts (`WADS`, `MODWAD` in
`levelbuild.py`, `CD_WADS` in `debugviz.py`, `PREFIX` in `lamatest.py`) that point into the original
author's Wine setup; use `--base <cd>/wads/t1l1m001.wad` or adjust them. `--install` only works with
that setup – with LlamaMod, use a Java level or the editor instead.
## A Java level
Implement [`LevelScript`](../../src/main/java/com/eliasmueller/llamamod/levelbuild/LevelScript.java):
```java
public final class MyLevel implements LevelScript {
@Override public String levelName() { return "My Level"; }
@Override public void build(LevelBuilder l) {
l.sea(0, 0, 40, 40, -1.5, new double[] {7, 7, 33, 33});
l.floor(10, 10, 30, 30, 0, "grass");
l.box(18, 24, 22, 25, 0, 0.06, o().top("pattern_purple").mat(16)); // exit floor
l.player(20, 12, 0);
l.checkpoint(12, 12);
l.exit(20.5, 24.5, null, null, new int[] {1, 9, 32});
l.coins(List.of(new double[] {20, 16}, new double[] {20, 18}));
}
}
```
`buildWad(baseWad, wads, opts)` returns the WAD. To ship it, write a small
[mod](../developers.md#writing-a-mod) whose `apply` writes `wads/T1L9M0nn.wad` (chapter 1 or
32–49) and a loading picture – [`ArenaMod`](../../src/main/java/com/eliasmueller/llamamod/mods/arena/ArenaMod.java)
is a complete example. Texture names are English here (`grass`, `stone`, `sand`, `inca`, …) and are
matched by picture on the chosen base.
## The editor from the command line
The editor's project format can be scripted too:
```bash
llamamod --editor-new my.llamalevel t1l1m001 --name "My level" # new project on a base
llamamod --editor-import t1l2m001 jungle.llamalevel # an original level as a project
llamamod --editor-build my.llamalevel out.wad # build the WAD
llamamod --import-level my.llamalevel # install as a level mod
```
## Seeing the result without the game
* [`tools/geom_export.py`](../../tools/geom_export.py) `level.wad outdir --collision --objects`
writes OBJ files, texture pages and two preview images.
* [`tools/vorschau/`](../../tools/vorschau/) renders labelled overviews with Blender (Eevee).
* In the game: the test harness, see [Tools](../tools.md#testing-in-the-game).