9.0 Level making
New editor workflow: The native tools use a
.toulevel.json project file. You do not edit the JSON
by hand: the command-line tool creates it, and the editor changes
it together with the attribute image. The JSON is source data;
the exported .lev is what the game loads. Launching
tou-level-editor without arguments presents Open,
New Normal, and New GG choices. Open accepts either an editable
JSON project or an existing compiled .lev. Importing a
level extracts its embedded JPEG payloads and reconstructs the
attribute TGA beside a new JSON project. The commands below remain
useful for scripts and exact custom dimensions.
Important note:
- All the TGA-pictures (targa) that you need in level making must
be saved in 24-bit format without any kind of packing (compression).
- All the JPEGs must be saved in truecolor format (so not in greycolor
format). And their extension must be JPG, not jpeg.
Native editor: new normal level
- Draw the visible level in Photoshop, Krita, or another image
editor and save it as a true-color JPEG. This picture is the
final stage artwork.
- From the TOU directory, create the project. The optional last
argument adds a parallax JPEG:
level-editor\tou-level-compiler.exe new projects\my-level\my-level.toulevel.json projects\my-level\my-level.jpg [projects\my-level\my-level-parallax.jpg]
- Open
my-level.toulevel.json with
tou-level-editor.
- Paint collision and material behavior in Terrain. Add
single-point gameplay objects in Objects, and configure
the level in Rules.
- Press Save to update the project and its generated
-attributes.tga. Use Check to catch overlaps,
invalid links, missing assets, and runtime limits. Press
Export to create
my-level.lev beside the project.
- Copy the exported file to
levels/my-level.lev,
restart TOU so it rescans levels, and test it in a match.
The visible JPEG and attribute map must have identical dimensions.
Keep the project JSON, JPEG, attribute TGA, and optional parallax
together as the editable source for the level.
The editor starts with a 9-pixel terrain brush so dragging is
immediately visible. The bottom strip shows the current size and
mouse controls for each tab. Use Brush - or [ to
reduce it as far as the exact 1-pixel brush needed for detail work;
right-click picks an existing attribute, middle-drag pans, and the
mouse wheel zooms.
Legacy source files
The Jungle fixture remains a useful example of the old workflow:
jungle.jpg, jungle.tga,
junglep.jpg, and jungle.txt. The native
project replaces the hand-edited TXT and COLPICK steps.
The legacy workflow was:
- Draw the level's graphics and save the picture in jpeg-format.
The extension of this file must be jpg. Example: Jungle.jpg
- Draw the attribute map for your level and save the picture in
24-bit uncompressed TGA-format. The name of this file must be
the level's name. Example: Jungle.tga
- Draw the parallax background for your level if you want to,
and save it in jpeg-format. The extension of this file must be
jpg and the name of the file must be the level's name +"P".
Example: Junglep.jpg
- Go to makelev-directory and open the "normal.txt"
with notepad. Answer to the questions it has and "save as"
it as your level's config file. Example: Jungle.txt
More info on attribute map:
This "attribute map" tells the game where are repair
places, burning material, explosive material, water and so on. To
see what an attribute map looks like, take a look at the jungle.tga.
I think you'll get a pretty good picture about attribute maps then.
Open colors.png from makelev-directory, to know which attribute
map colors correspond to which land types. Just use the color picker-tool
and select the attribute map colors from colors.png. Some
of the colors are better explained here:
- Repair that never destroys (and you can't repair in it).
This is a repair place that always remains in level. You can change
weapons in there and land there after your team has won, but you
can't repair your ship there. (then why is it called repair? don't
ask!)
- Burning2 (ashes remain). This is used in "the jungle"
when the palm trees burn. It leaves a dark trunk after burning.
- Air (transparent). Everything that is drawn with this
color (black) in attribute map, is transparent in the game.
- Air (non-transparent). To create walls in level that
you can fly through, use this color. Not used in Tou's original
levels.
- Air streams. These air streams are very powerful.
You can use some sort of spray tool to make less effective air
streams.
- Normal land under water. Use these "under water"-stuffs
if you want that when this wall destroys, it will create water.
Look at the bottom of "the jungle". If you shoot the
wall there, it won't create air but water.
Note: You can make only single-coloured water! This is because
of the running water and waves, that would look ugly if the water
had colors. To define the water color, fill up the config-file.
Also note: Make sure you use sharp brush when drawing and not smooth
brush. Examples below:
|
Wrong way
|
|
Right way
|
 |
|
 |
Turrets, mines, gates, and other objects
Use the editor's Objects tab. Each marker is one point in
the attribute map; select a type, click to add it, drag to move it,
and edit its properties below the list. Do not draw a line of
markers unless you genuinely want hundreds of overlapping objects.
Gates do not have a free-standing sprite that you place in the
artwork. The marker is an anchor. At runtime TOU creates a moving
wall at that coordinate and renders gate graphics 58/59 over it.
Style selects the wall behavior, Facing controls its
orientation, Team owns it, and Graphics selects the
normal/mirrored gate artwork. Linked pair creates a second,
opposite-facing segment one pixel beside the first and links their
motion. Leave enough clear space around the anchor for the wall to
move. The editor shows graphics 58/59 at that coordinate and keeps
the labeled anchor and movement axis visible while it is selected;
none of this artwork needs to be painted into the JPEG.
The turret preview follows its Style, Team, and
Direction properties using the same seven sprite families and
team-color transformation as the runtime. Turrets are previewed in
both the object selector and at their placed map coordinates.
More info on parallax background:
Parallax can be any size if it's smaller or equally sized with
the actual level. I mean, both width and height must be smaller
or equal, not just the total area.
The editor stores metadata, rules, asset paths, placements, and GG
settings in a .toulevel.json project. Use the Rules and
GG tabs instead of editing the old converter's TXT config by hand.
Legacy conversion
The historical converter accepted the old JPG/TGA/TXT set. New
projects should use the native editor's Export button or
tou-level-compiler build project.toulevel.json output.lev.
Maximum level size:
Both width and height must be less than 8000 pixels. By the way,
a 8000x8000 map would take 196 megabytes of memory!
Info on memory usage:
I strongly suggest keeping your level's width less than 2034 pixels!
The heigh can be whatever you want.
First choose what you are creating
- A GG theme is a directory below
ggstuff.
TOU discovers it directly and can generate different full maps
from that theme every match. This is the common way to add a new
look to the dynamic GG level list.
- A custom GG level is a
.lev recipe that pins
dimensions, a theme, a seed/settings set, and an authored
constraint map. The game still generates its visible artwork at
load time, but the author controls its boundaries and special
regions.
Native editor: new custom GG level
Create a project with a size and an existing theme directory name:
level-editor\tou-level-compiler.exe new-gg projects\my-gg\my-gg.toulevel.json 1280 720 "the earth"
Open the JSON in the editor. Paint the constraint/attribute map in
Terrain, change the theme, shape, densities, and seed in
GG, then Save and Export. Add sign records in the GG list
and paint GG sign location where each sign may appear. The
canvas is the editable behavior/constraint map. Click
Preview (or press P) to overlay terrain generated by
the actual game runtime. A fixed seed reproduces the same layout;
zero asks the runtime for a tick-derived seed.
A GG project does not need a visual JPEG: the selected theme builds
the visible terrain at load time. Paint named constraints such as
repair regions and GG sign locations on the attribute layer, then
edit repair/sign densities and up to 16 two-line sign records in
the GG tab. Custom GG parallax is intentionally unsupported.
Native theme workflow
- Press Ctrl+N in a GG project, or run
tou-level-compiler new-theme ggstuff "my theme". This creates
the directory and a starter info.txt.
- Edit its
info.txt. That file controls generator and
rendering behavior for the theme.
- Replace at least
s1.tga (terrain filler mask) and
t1.jpg (ground texture). Use Krita/Photoshop for these
assets; the level editor does not attempt to replace an art tool.
- Start TOU again. The directory itself is discovered as a dynamic
GG entry. Test several generated sizes and seeds before shipping.
- Optionally use the theme name in a custom GG project created by
tou-level-compiler new-gg.
All the tgas you draw here must be 24-bit tgas without compression!
And all the jpegs must have the extension "jpg".
Theme asset details
The scaffolded directory name becomes the theme name. Its generated
info.txt documents every recovered generator setting.
Then to the pictures. Look at the pictures in other GG themes.
They will tell you much of how it's done.
You only have to draw two pictures to get your GG theme working:
s1.tga and t1.jpg. S1.tga tells the shape of the filler (usually
quite round and small) and t1.jpg is the theme's texture. After
you have drawn those, go test your new GG theme! :)
1. Shapes
Name these as s1.tga, s2.tga, s3.tga and so
on. These will fill the level. If you have more than one of these,
the generator uses them randomly. Black color does not fill, any
other color will.
2. Textures
You can only have one texture. Name it t1.jpg.
3. Lawn (optional)
Lawn looks cool but it's optional. If you want grass, name it l1.tga.
You can also have l2.tga and l3.tga and so on, and the game will
use them randomly. But who bothers to have more than one lawn bitmap?
:)
4. Repair (optional)
You don't have to draw repairs, but then your theme doesn't have
any repair places. Name this d1.tga. If you want lots different
looking repairs, name them d2.tga, d3.tga and so on.
5. Sign (optional)
Name: x1.tga. If you want many different looking signs in
one level, name them x2.tga, x3.tga and so on.
6. Additional
pictures (optional)
Name: p1.tga, p2.tga, p3.tga and so on. Have
lots of these.
7. Extra shapes
(optional)
These will fill the bottom of the ground blocks. Name: sd1.tga,
sd2.tga and so on.
8. Parallax background (optional)
This is a texture also. Save it as px1.jpg. If you don't
have your own parallax, the GG will use your normal texture as parallax,
scale it to half the size and darken it a bit.
9. Extra textures (optional)
Look at "Rocky mountains"-theme. t2.tga tells
what shaped the rocks are. Use unique color for every rock you draw.
t3.tga (optional, even if you have t2.tga) tells where are
the trashes, that shouldn't be in the texture's 'borders' (real
fine tuning, you probably don't want to bother! I did though).
10. Explosive texture (optional)
In some GG levels there can be explosive land.
Explosive land is textured as normal ground if you don't have this
texture. Name: ex1.jpg
|