Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/engine/hud.md
Original file line number Diff line number Diff line change
Expand Up @@ -1060,6 +1060,13 @@ colour, while `hit_shake` is above zero, each row moves right by a random share
**Improvement:** OpenReliant writes the ball's pixels into an image each frame, in the same way, and
draws the image with the rest of the display, so it scales with it.

**Improvement:** a mod's `powerball.png` can be a whole multiple of 256 by 256
([Modding](../guide/modding.md#pictures)). The ball's tables are then worked out at that multiple,
for the ball's pixels and the texture's alike, and the scroll and the shake grow by the same
factor, so the ball is as sharp as its picture. Each of the original's rows still takes one random
shake, which moves every row of pixels that stands for it, and the colours are the same at any
size.

## The launch's date

From the drop of the player's launch from the Reliant to its end ([Launches](launch.md#the-date)),
Expand Down
10 changes: 10 additions & 0 deletions docs/engine/loadout.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,16 @@ The panels' textures are 256 by 256 (`panels.zig`), their text written into them

The panels are added, so their black is clear and the room shows through.

**Improvement:** a mod's `fpanels.png` can be a whole multiple of 256 by 256
([Modding](../guide/modding.md#pictures)). The panels' textures are then as many times as large,
and so is everything drawn on them: each of the original's pixels is a square of the texture's, and
the text is drawn from the outline fonts that stand in for `ld_handel.fnt` and `handels.fnt`
([Outline fonts](../formats/fnt.md#outline-fonts)). A bitmap glyph's strokes are drawn in the colour
of the remap's fullest level and fade through the other levels at their edges, so an outline glyph
is drawn in the fullest level's colour, on an edge one of the original's pixels wide in the colour
of the faintest: the figures in green on a dark edge, and the titles in black edged in green.
Without outline fonts (`--bitmap-fonts`), the bitmap glyphs are magnified.

### The figures

`loadout_load` works out each ship's figures as it loads (`bars.zig`): speed, acceleration, agility, shield power, shield recharge and armour as bars of 3 to 10 segments, placing each ship's figure between the least and the most of the fighters the ITAC lists (`loadout_ship_bars_init`, `0x00426600`; `range_scale`, `0x004504F0`), its afterburner fuel in seconds, and its crew. The missiles' figures are worked out the same way, and the missile page's info panel shows them.
Expand Down
9 changes: 6 additions & 3 deletions docs/formats/fnt.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,17 @@ renders the glyphs ([Platform](../port/platform.md#fonts)).
([Modding](../guide/modding.md#fonts)). Otherwise Newtown, which is built into OpenReliant
([`deps/newtown`](../../deps/newtown/README.md)), replaces the original Handel Gothic fonts:
`optfnt.fnt` and `smlfnt2.fnt`, the large and small menu fonts; `itacbig.fnt` and `itacsml.fnt`,
the ITAC fonts; `blufont.fnt`, the flight display font; and `ld_handel.fnt`, the loadout tooltip
font. A `.fnt` file in a mod is drawn from its bitmaps.
- **Palette fonts.** The flight display font and the loadout tooltip font are drawn through a
the ITAC fonts; `blufont.fnt`, the flight display font; and `ld_handel.fnt` and `handels.fnt`, the
loadout's fonts. A `.fnt` file in a mod is drawn from its bitmaps.
- **Palette fonts.** The flight display font and the loadout's fonts are drawn through a
palette, with each pixel of a glyph in its own colour. For these fonts, the ink is the brightest
colour their digits and letters use, and each colour counts as partial coverage by how close it
is to the ink, since the bitmap's pixels fade towards black where the glyph covers them less.
Outline glyphs are drawn in the ink colour, and a glyph that uses colours the digits and letters
don't use, such as a symbol, keeps its bitmap.
- **The loadout's panels.** The loadout writes its panels' text into their textures, through remaps
of their own. Outline fonts draw it only in panels larger than the original's, from a mod's larger
picture, in the colours of the remap ([Loadout](../engine/loadout.md#the-panels)).
- **Weight.** Newtown's strokes are made as heavy as the bitmap font's. OpenReliant makes them
wider or narrower (FreeType's `FT_Outline_Embolden`) until its digits and letters, drawn at eight
times the size with capitals of the same height, cover as many pixels as the bitmap font's. The
Expand Down
26 changes: 20 additions & 6 deletions docs/guide/modding.md
Original file line number Diff line number Diff line change
Expand Up @@ -621,17 +621,26 @@ files, as is the loadout's backdrop. To replace one, add a PNG with its name, su
bars beyond it.
- **Opaque.** Pictures are drawn without their alpha channel, like the original pictures.

A few TGA pictures are read pixel by pixel at their original size. A PNG replaces one of these only
if it has the same size; otherwise it's skipped, with a message in the log
([#509](https://github.com/OpenReliant/openreliant/issues/509)):
Two TGA pictures are read pixel by pixel as data, one pixel for each star or for each colour of
the sky. A PNG replaces one of these only if it has the same size; otherwise it's skipped, with a
message in the log:

| Picture | Size | What it is |
|---|---|---|
| `fpanels.tga` | 256x256 | The loadout's panels |
| `powerball.tga` | 256x256 | The flight display's power ball |
| `space.tga` | 360x360 | The star map |
| `starref12.tga` | 256x256 | The sky colours |

Two more are drawn pixel by pixel at their picture's size. A PNG for one of these can be the
original's size or a whole multiple of it, the same across and down, up to 8192 pixels; another
size is skipped, with a message in the log. At 1024x1024, `fpanels.png` draws the loadout's panels
four times as sharp, with their text in the outline fonts ([Fonts](#fonts)), and `powerball.png`
draws the flight display's power ball four times as sharp.

| Picture | Size | What it is |
|---|---|---|
| `fpanels.tga` | 256x256 | The loadout's panels, the buttons and the scrollers |
| `powerball.tga` | 256x256 | The flight display's power ball |

**Improvement:** the original only draws its interface pictures at their original size, and
stretches its backgrounds to fit the screen.

Expand All @@ -649,7 +658,8 @@ fonts](../formats/fnt.md#outline-fonts)):
| `itacbig.fnt` | The ITAC's large text, and the titles of the CD player and the simulator pod |
| `itacsml.fnt` | The ITAC's small text |
| `blufont.fnt` | The flight display's text: readouts, clock, windows and objectives |
| `ld_handel.fnt` | The loadout's tooltip |
| `ld_handel.fnt` | The loadout's tooltip, and the titles and ship names on its panels |
| `handels.fnt` | The figures on the loadout's info panel |
| `font_01.fnt` | The developers' text on the main menu |

- **Layout.** The game lays out text using the bitmap font's character widths, which don't change.
Expand All @@ -661,6 +671,9 @@ fonts](../formats/fnt.md#outline-fonts)):
- **Colour.** The flight display's font and the loadout tooltip's font are drawn through palettes. A
mod's font for them is drawn in the colour of the bitmap font's letters, and glyphs the bitmap
font draws in other colours, such as symbols, keep their bitmaps.
- **The loadout's panels.** The panels keep their bitmap text at the original's size. With a larger
`fpanels.png` ([Pictures](#pictures)), their text is drawn from the outline fonts at the panels'
size instead.
- **Weight and outline.** A mod's font is drawn at its normal weight. Each character gets a black
outline one bitmap pixel wide, like the text in the original.
- **Built in.** OpenReliant draws all text except the developers' text with Newtown, a public domain
Expand Down Expand Up @@ -1454,6 +1467,7 @@ A script's messages and errors follow its mod's name, as above;
| `skipping the mod <archive>: checking <file> failed: ...` | The archive doesn't match its checksum: download it again, or pack it again with `--checksum` ([Checksums](#checksums)) |
| `<mod>: mod.ini: the <kind> '<name>' ...` | The entry the message names, and what it says is wrong ([New ships, guns, missiles and pilots](#new-ships-guns-missiles-and-pilots), [Game variables](#game-variables)) |
| `skipping the picture that replaces <name>: it's <size>, and the original is <size>` | That picture must keep the original's size ([Pictures](#pictures)) |
| `skipping the picture that replaces <name>: it's <size>, and it must be a whole multiple of the original's <size>, at most 8192 pixels across` | That picture must be the original's size or a whole multiple of it ([Pictures](#pictures)) |
| `<set>: shape <n> is cut short: its rows run past the end of its block, so it draws nothing` | The set's file is broken at that shape: make the set again, or give a picture in its place ([Shapes](#shapes)) |
| `the <map> of <texture> is left out: it is <size> and its picture <size>` | A map must be the same size as its texture ([Material maps](#material-maps)) |
| `the <map> of <texture> is left out: it has <n> mipmap levels and its picture <n>` | Save the DDS or KTX2 map with all its mipmaps, as many as the picture has ([Compression](#compression)) |
Expand Down
6 changes: 2 additions & 4 deletions docs/guide/what-mods-can-do.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ the mods screen ([The mods screen](modding.md#the-mods-screen)).
| Give surfaces normal, material and glow maps, lit as today's games light them | [Material maps](modding.md#material-maps) | |
| Draw the ships differently in the loadout | [Textures in the loadout](modding.md#textures-in-the-loadout) | |
| Replace the interface's shapes, sharp at any window size | [Shapes](modding.md#shapes) | |
| Replace the screens' backgrounds, widescreen ones included | [Pictures](modding.md#pictures) | |
| Replace the screens' backgrounds, widescreen ones included, and the loadout's panels and the power ball at a multiple of their size | [Pictures](modding.md#pictures) | |
| Replace the interface's fonts with TrueType or OpenType fonts | [Fonts](modding.md#fonts) | |
| Change how surfaces are lit, with GLSL surface and lighting functions | [Surface and lighting functions](scripting.md#surface-and-lighting-functions) | [`cel-shading`](../../examples/mods/cel-shading) |
| Draw post effects over the frame | [Post effects](scripting.md#post-effects) | [`crt`](../../examples/mods/crt) |
Expand Down Expand Up @@ -122,9 +122,7 @@ These are planned, each in an issue:
- Campaigns of more than 28 missions ([#987](https://github.com/OpenReliant/openreliant/issues/987))
- Post effects that read the scene's depth ([#633](https://github.com/OpenReliant/openreliant/issues/633))
- KTX2 files with Basis Universal data ([#637](https://github.com/OpenReliant/openreliant/issues/637))
- The loadout's panels and the power ball at any size
([#509](https://github.com/OpenReliant/openreliant/issues/509))
- Outline fonts for the loadout panels' text and the flight display's small fonts
- Outline fonts for the flight display's small fonts
([#520](https://github.com/OpenReliant/openreliant/issues/520))
- The game's models exported with all their detail levels and parts
([#697](https://github.com/OpenReliant/openreliant/issues/697))
Expand Down
Loading
Loading