Before stage 1
Before you start
By the end
Nothing is built in this post. By its end you'll know:
- what to install, and what to keep beside you;
- how to read a step: what the bold words, the tables and the colours mean;
- the two habits every later post leans on: making a script from the repo's file, and changing a value while the game runs.
What you need
- Godot 4.7. This was checked on 4.7.2.
- Blender 3.0 or newer. Leela is a
.blendfile, and Godot imports those by running Blender. - This repository beside you (a clone, or its page on GitHub), for three things: Leela's model and texture, the scripts, and the look's shaders.
How the steps are written
- Everything the editor is for is done in the editor: scenes, nodes, materials, the environment, collision shapes, project settings, the input map, autoloads, import settings and groups. You'll never be asked to type a
.tscn, a.tresorproject.godot. - Bold words are what the editor shows. "Inspector: Fog → Depth Begin" means the section Fog, then the property Depth Begin. Some sections have a checkbox on their header (Fog, Glow, Shadow and others), a box marked On at its right end: ticking it switches that feature on and lets the section open.
- A slot that holds a resource (a mesh, a shape, a material, an environment) reads
<empty>until it has one. "New → BoxMesh" means: click the slot, and in the menu that opens choose BoxMesh from the list under the heading New. Click a filled slot to open what's in it, there in the Inspector, in a box of its own. The small arrow at the slot's right end has the rest: Load..., Save As..., Clear. - Colours are given as the three numbers the file stores (0 to 1) and as a hex code. The quick way is the hex code: click the colour, type the code into Hex (it's selected, ready) and press Enter, then Esc to shut the picker. To give the exact numbers, press the small # button beside Hex: the field becomes Expr and takes
Color(0.16,0.15,0.21). Type that with no spaces: in the editor the clips were recorded in, a space shut the picker. - Sizes are in metres. The floor's top is y = 0, and forwards is −Z, as everywhere in Godot.
Scripts and shaders
These are the one thing that is code, and you don't have to invent any of it. Every script you make ends up the same as the file of that name in this repository.
- In the FileSystem dock, right-click the folder → Create New → Script.... If the folder isn't there yet, make it first: right-click
res://→ Create New → Folder.... - In Create Script, the Path already has the folder, and the
new_scriptin it is selected: type the script's name over it and press Create. Leave the rest as it comes. - It opens in the script editor with a template in it. Replace all of that with the repo's file: type it along as you read the walk-through, or paste it whole (click in the script, Ctrl+A, Ctrl+V) and read along. Ctrl+S saves it.
proc/second_order.gd, made this way: the folder, the script, the template it comes with, and the repo's file pasted over it (copied from the repo beforehand). Saved, it's the repo's file byte for byte.Each walk-through goes by idea, not top to bottom, and quotes the lines that carry the idea. The quotes are copied from the repo's files, tabs and all, and each has the file's name and line numbers over it. A line that only says # ... (// ... in a shader) marks where lines were left out.
The shaders and the look's scripts came from Wagee, the owner's other game, so those you copy in as files (stage 3 and stage 6 say which) and read what they do.
Trying values while the game runs
This is how you find out what a number does, and the posts ask you to do it often.
- Run the game. While it runs, two buttons show at the top of the Scene dock: Remote and Local.
- Press Remote. The dock now shows the running game's nodes, not the saved scene's: a node called
root, and under it the autoloads (from stage 6 on) andMain. OpenMainwith the small arrow beside it. (Local takes you back to the saved scene.) - Click a node there. The Inspector shows its live values: change one and the game changes at once. While a node's selected, the game draws an orange box round it. That's the editor's mark, not part of the picture (the eye on the Game toolbar, Toggle Selection Visibility, is its switch).
- For a node with a script, the Inspector begins with two sections the saved scene doesn't show. Members is the script's own variables, and Constants its constants. The script's
@exportvariables come after those, under the script's name, and can be a long scroll down. The quick way to one is to type its name into Filter Properties, at the top of the Inspector.
Nothing you change this way is saved. Stop the game and it's as it was. When you find a value you like, set it on the node in the saved scene.
Where the game shows. As the editor comes, the game runs inside the Game workspace (at the top, beside Script), and that workspace pops out as a window of its own for as long as the game runs. To keep it in the main window, between the docks, as the clips show it:
- Press Game at the top of the editor.
- Press the ⋮ at the right end of its toolbar (its tooltip is Game Window Options).
- Untick Make Game Workspace Floating on Next Play.
The clip in stage 8 begins with exactly that.
The clips
Some steps are easier to watch than to read: a dialog with a dozen controls, a drag from one dock to another. Those have a short clip beside the written steps.
- A clip shows the step being done, not its result. Each is a recording of the Godot 4.7.2 editor doing that step, on a project that is where the posts have got to by then.
- There's no sound. A ring marks each click, and a label at the bottom names each key that's pressed.
- To read a small label, use the player's full-screen button. Each clip is 1600 × 900.
- The written steps stay the reference. A clip shows one way through. The tables beside it have every value, and the reasons.
- Your editor will look a little different. The clips were recorded on a Linux machine with no graphics card, in a small window:
- Dialogs open inside the main window there. Yours float as windows of their own (unless you've switched on the editor's single-window mode).
- The 3D view is drawn by software. Its grid comes out as blocky bands, where yours has fine lines, and it's slow: where the editor kept the recording waiting, the wait is cut out, and a game running in a clip moves in jerks.
- The docks are narrower than on a full-size screen, so some names are cut short.
How this was checked says how the clips were made, and which of the posts' claims were seen in a real editor, which were measured, and which are still only read from Godot's source.
Checkpoint
There's nothing to run. Before stage 1, check you have:
- Godot 4.7 installed.
- Blender 3.0 or newer installed, and you know where its program is. Stage 1 asks.
- This repository on your disk, with
misc/Blends/Leela.blendin it.