Skip to content

Development source guide ยท workspace 0.1.0

Build worlds and game systems

The engine provides reusable ingredients, but your game must connect them into playable behavior. A noise function is not an explorable world by itself; a physics library is not a complete character controller; a document describing an economy is not a working shop.

Start with objects and components

In the first scene, the cube is an entity carrying a transform and a mesh index. That same composition approach lets a game associate an object with its own health, identity, movement or interaction state.

A practical object workflow is:

  1. Define what the object needs to do.
  2. Give it only the state required for that behavior.
  3. Make an update or interaction read that state and change it.
  4. Connect the visible or audible feedback.
  5. Check creation, interaction and removal, not just the initial display.

The entity system provides creation, removal, component access and queries. It does not impose a complete scene hierarchy, prefab editor or automatic serialization of every custom component.

Choose the world ingredients you need

Goal Available ingredient Integration you still own
Seeded variation Noise functions including Perlin, fBm, warp, Worley and ridge patterns Terrain rules, mesh creation, collision and the relationship between seed and saved progress
Distance-based detail An explicit distance-ring subdivision/LOD tool Choosing levels, creating the corresponding geometry and updating it at sensible times
Physical objects Optional rigid-body physics and the application's body integration Body creation, collision settings, movement policy and game consequences
Character collision Capsule movement against collision meshes with ground, wall and ceiling results Player controls, animation, gameplay rules and response to collision
World atmosphere Clock, weather and environment-related tools Applying them to visuals, sound, schedules and rules
Agent-like movement Daily schedules, flocking and guard-related ingredients Meaningful NPC goals, permissions, interaction and game-specific behavior

Begin with one small visible area. Check that its collision matches its geometry before making a larger generator. A stable seed helps repeat the starting layout, but it does not automatically save changes a player makes afterward.

Connect simulation and movement tools

For a driving or populated-world game, reusable vehicle, traffic and road-network tools are implemented. They do not automatically create a drivable scene or import a road map.

  • Vehicle simulation takes a specification, body, controls and environment. Its step advances a fixed 1/60 second and can report impacts, shifts, landing, wreck and drift outcomes. The game connects collision, input, visuals and consequences. Do not blindly pass a variable render delta as though this were a variable-time movement helper.
  • Traffic simulation needs your road network, density zones, world time and sampling/environment callbacks. The game decides how its agents appear and interact with the player.
  • Road-network tools construct nodes and edges, mark one-way routes/signals and find routes. A route result is not rendered road geometry; invalid endpoints can return no route.
  • Grid pathfinding needs the game's navigation rules and an expansion budget. A failed search can still return a best-effort partial path. Check the success result before claiming an agent reached its destination; nonempty output alone is not success.
  • Tween tools interpolate values for objects or UI using selected easing. The game applies the result; there is no automatic animation editor or generic CLI timeline.

Begin with one vehicle, agent or transition and verify its inputs and outcome before adding a larger simulation. Daily place/time schedules are distinct from a general delayed/repeating combat-task scheduler; do not substitute a design sketch for an implemented timing system.

Networking material is currently design sketches rather than a ready engine multiplayer/authentication/replication service. The local control harness is a different facility and is not evidence of multiplayer support.

Add physics deliberately

The scaffold does not enable the application's optional physics feature. Enabling a library feature is only the first step: the game must create bodies and connect them to the entities it renders.

For a source example, the engine checkout includes an application example with a floor and 200 dynamic cubes. From the working folder used in this guide:

cargo run --manifest-path ./engine-source/code/Cargo.toml -p app --example cubes --features physics

The intended result is the example's simulated cube scene, with Escape requesting exit. This command and outcome are source-supported, not run for this guide. It is an example of integration, not a recommended performance budget or a guarantee for your driver.

Warning. Do not copy the first tutorial's transform movement onto a physics-driven entity and assume both states will agree. Read the movement ownership explanation first.

Make content data-driven where useful

The reusable data loader reads JSON arrays of rows. Rows need nonempty string IDs. Game code defines the schema and reads the result; the loader does not decide what a monster, road, item or conversation means.

For a game-defined table, an author might write:

[
  { "id": "training-target", "health": 10, "reward": 1 }
]

This is an illustrative content row, not a built-in engine schema. To use it, the game must define and validate health and reward, load the table through its asset path and implement the behavior that consumes those values.

The loader can report missing or unknown fields, wrong types, invalid enum values and out-of-range numbers. Read the reported file, row and field together. Fix the data or the intended schema rather than hiding a validation error behind an unrelated default.

Ordered source tables can overlay earlier rows by ID. Their fields merge shallowly; this is not a recursive merge of every nested object. A row with "remove": true removes an existing row, and removing an unknown row is an error. The first source is required; later overlay files can be absent.

Tip. Optional values need an explicit game policy. Convenience readers returning zero, an empty string or false are not evidence that those defaults are good gameplay values.

Separate mechanics from design examples

The engine's design material includes substantial ideas for combat, skill curves, currency drops, shops, trading, farming, housing and dialogue. Much of that material is expressed as sketches over a game's own world model.

Do not assume a new project contains those systems, or try undocumented generic commands such as spawning enemies or teleporting because a design sketch mentions them. The general harness accepts device-style inputs and inspection commands, not every proposed gameplay operation.

An existing game may implement a dialogue graph or world configuration format. Those formats belong to that game's loader unless you explicitly reuse and integrate it. Copying its JSON file into another project's data folder will not supply that implementation.

Grow one complete interaction at a time

For each new mechanic, connect input, state change, feedback, failure behavior and persistence policy. A useful sequence is movement, one interaction, one consequence, then saving the necessary progress. Keep the specification aligned with what is actually playable.

When a rule is unclear, use state inspection to observe a narrow experiment. When progress must survive a restart, design the save boundary rather than treating a default debugging snapshot as a full game save.