-
Notifications
You must be signed in to change notification settings - Fork 0
02 4 Quick Start Advanced Dungeons and Dragons
This page explains the game-level override used for Advanced Dungeons and Dragons.
{usb_root}\boosted\Advanced Dungeons and Dragons_boost.toml
This example highlights the main ideas behind a more involved game-specific setup:
- A game-specific default layout built around a custom screen design
- A second alternate layout you can switch to from the menu
- Using
game_infoto show live status art outside the game view - Using
play_statsto remember major items you have found during the run - Adding game-specific layout choices into the shared layouts menu
This game config is doing more than the simpler examples.
Instead of only placing the game on screen, it builds a themed information layout around the game and updates that layout while you play.
At a high level, it does five things:
- switches this game to the
run_and_guninput map - reads several live values from memory using
game_info - tracks key item progress using
play_stats - starts in a custom storyboard-style layout
- adds menu entries so you can switch between storyboard view and portal view
This game uses:
input.mapping = "run_and_gun"That means the game is using the shared alternate control map defined in the base config instead of the default mapping.
This config reads several values directly from memory through game_info.
The important ones for the layout are:
arrow_countlivesdifficultylocationused_itemlast_itemmountain_color
Some of these are also given labels.
That matters because labeled values can be dropped straight into filenames. For example, Sprint Boost can build filenames like:
loc_dungeon_blue_boat.pngloc_map_key_easy.png
This lets the layout swap artwork automatically as the game state changes.
This config also turns on play_stats and tracks when the player has found important items:
- boat
- axe
- key
- crown
This is different from raw game_info.
-
game_infois the live state right now -
play_statslets the layout remember progress you made during the run
That is useful here because the right side of the storyboard layout shows item panels based on whether those key items have been found.
The current default layout is:
[display]
default_layout = "adnd_storyboard_layout"This is the main “play with information around the edges” view.
The layout combines:
- a large centered game view
- an asymmetric game border to make the frame sit better in the parchment design
- a parchment-style image overlay with a transparent center
- live arrow count artwork
- live location artwork that changes based on where you are and what you are carrying
- a lives panel
- item progress panels for boat, axe, key, and crown
This layout uses the game element border in a more deliberate way than the simpler examples.
The border is not just decoration. It helps the game image sit correctly inside the surrounding artwork.
In this layout:
- the game is scaled with
aspect = "integer_scale"for a cleaner pixel look - the border uses different right and bottom adjustments
-
center_on = "bordered_frame"means the full bordered result is what gets centered
That combination gives the game area a slightly shifted framed look that matches the parchment presentation better than a plain centered rectangle would.
This is the key idea behind the layout: several image elements change automatically based on game state.
The quiver art uses the live arrow count:
source = "{gv.assets_images}/adnd/a_{gi.arrow_count}.png"
fallback = "{gv.assets_images}/adnd/a_10plus.png"This lets Sprint Boost show a matching arrow image while you play.
The location art is even more dynamic. It uses labeled values like location, mountain color, difficulty, and used item to choose the correct image.
That means the layout can show a different panel for things like:
- dungeon vs. map
- different mountain colors
- different carried items
- different map difficulty views
This is a good example of using filenames plus labels to avoid hard-coding lots of separate layout rules.
The layout also shows:
- lives remaining
- whether the boat has been found
- whether the axe has been found
- whether the key has been found
- whether the crown has been found
That gives the player a quick status board without covering the main gameplay area.
The parchment bezel image uses a large transparent middle so the gameplay can show through.
That makes it a good candidate for:
trim_transparent_edges = true
transparent_region_optimization = trueIn simple terms, this helps Sprint Boost draw that kind of artwork more efficiently.
This game also keeps a second layout called adnd_portal.
Portal view is simpler than the storyboard layout.
It focuses on:
- a styled game window
- a themed frame image
- the live arrow count display
This gives the player a lighter alternate presentation while still keeping the most useful helper information.
This config adds two game-specific items to the shared Standard Layouts menu:
[menu.menus.standard_layouts.item8]
label = "Storyboard View"
action = { command = "switch_layout", layout = "adnd_storyboard_layout" }
[menu.menus.standard_layouts.item9]
label = "Portal View"
action = { command = "switch_layout", layout = "adnd_portal" }That extends the shared base menu instead of replacing it.
So this game keeps all the normal shared layout options, then adds two AD&D-specific ones.
Tip
When adding game-level menu items, start at item9 and work downward (item9, item8, and so on).
That reduces the chance of colliding with future shared menu items added by the base config.
This example is useful because it shows how a game-specific config can become a real companion layout, not just a simple overlay.
The main takeaways are:
- use
game_infofor live values the game is not showing clearly enough - use
play_statsfor progress you want to remember during the run - use image filename substitutions and labels to swap themed art automatically
- use multiple layouts when one game benefits from both a detailed view and a simpler alternate view
- extend shared menus instead of replacing them
Continue to another game example: