Platform courses

Build 3D platformer courses of floating islands with parcels, checkpoints, a delivery goal, hub doors, lives and medals: platform_courses documents, settings, events, hooks.

Source: module-kits:kits/world_platforms/usage/en.mdView Markdown source

Also read offline — CLI: grip-forge docs world-platformsMCP tool: gripforge_docs { "topic": "world-platforms" }

Floating platform courses in your game (world.platforms) #

What it is for #

world.platforms lays out a platformer course of floating islands: collectible parcels, optional stamps, checkpoints, a delivery goal judged with medals, and a hub whose doors open levels once a counter is reached. It also supports lives, deaths caused by other kits, and surfaces other kits add (falling platforms, pads). Colliders and progress never depend on the art bound to its slots. The character itself comes from other kits.

Turn it on #

gripforge_gamekit_install   { project_id: "gkp_…", id: "world.platforms" }
gripforge_gamekit_configure { project_id: "gkp_…", id: "world.platforms",
                              config: { "courseId": "sky_courier", "lives": 3, "fallY": -12 } }

It requires physics.rigidbody, physics.port and game.engine. It is meant to run with the platformer character and action input kits. A project without courses plays the shipped Sky Courier campaign (three courses).

First example #

<!-- test: kits/game_engine/host/tests/world_platforms.rs::a_project_without_courses_plays_the_sky_courier_campaign --> Call the service in a project without course documents:

{ "op": "call", "service": "world.platforms", "method": "start", "args": ["mist_lighthouse"] }

course answers the sky_courier document at first, courses lists three, lives answers -1 (lives not counted). After start("mist_lighthouse") the variable course.index is 2 and course.total is 12 parcels.

Settings and defaults #

SettingTypeDefaultMeaning
courseIdstringsky_courierCourse played at the start (the first when unknown).
pickupobjectradius 1, height 1.3, offset 0.65Reach of a parcel or stamp, metres.
checkpointobjectradius 2, height 0.3, lift 0.06Landing tolerance and respawn lift.
goalobjectradius 1.8, height 0.35Delivery zone.
fallYnumber-9Below this height the player returns to the last checkpoint.
defaultParnumber60Express medal time of a course without parTime, seconds.
islandThicknessnumber0.8Island collider thickness, metres.
islandAssetnumber8Authored width of the island asset; instances scale by width over this.
landmarkobjectwidth 1.3, height 2.6Landmark collider footprint.
livesinteger0Lives per run when the course gives none; 0 means not counted.
doorobjectradius 1.4, height 1.5Reach of a hub door.

All of these are moddable.

Services, events, variables and data #

  • world.platforms (service): start(id), next(), reset(), hub() (false when there is no hub), kill(cause) (a death from any kit, counted as a fall and a life), lives(), course(), courses(), collected(), respawnPoint(), needMet(need), setSurface(id, surface), supports().
  • course.started (event): a run started from its spawn.
  • course.pickup and course.stamp (events): payload { id, count }.
  • course.checkpoint (event): payload { id }; it is now the respawn point.
  • course.respawn (event): back at the checkpoint after a death; cause is absent for a fall.
  • course.finished (event): payload { seconds, falls }.
  • course.failed (event): the last life was lost.
  • course.door and course.door_locked (events): a hub door started its course, or its need does not hold.
  • course.lives, course.collected, course.total, course.seconds (variables).
  • platform_courses (collection): { id, name, spawn, goal, platforms, pickups, stamps?, kind?, doors?, goalNeed?, lives?, parTime?, theme? }. A platforms entry has id, at, width (2 to 50) and optionally depth, checkpoint, landmark (windmill or lighthouse) and trees (0 to 4). kind is hub or level. A door has id, at, course, label? and need { var, count } on any numeric variable.

Hooks and modding #

HookMutableAsked when
course.collectnonea parcel or stamp is about to be collected
course.reachnonea new checkpoint island is about to become the respawn point
course.entercoursea hub door is about to start its course (a tap may send it elsewhere)
course.deliverseconds, fallsthe course is about to finish (a time bonus, a forgiven fall)
course.recoverx, y, zafter a death, before the return to the checkpoint

All are cancellable. A mod can also add platform_courses documents and change the moddable settings.

{ "id": "forgive_falls", "hook": "course.deliver", "priority": 0, "set": { "falls": 0 } }

Engines #

The same rules run on the web and the native Rust player; Godot, Unity and Unreal ship equivalent deliveries. The new hub, lives and surfaces rules (1.5) and the hooks (1.6) are available on the web and Rust runtimes.

When it does not do what you expect #

  • A parcel is not collected: the player is outside pickup reach, or a course.collect tap cancelled it.
  • The goal does nothing: not every parcel is collected, or goalNeed does not hold.
  • A hub door stays shut: its need does not hold; course.door_locked is emitted once per approach.
  • The player falls forever: fallY is below the course.

Limits #

No character controller: use a platformer character kit. A course holds at most 100 platforms, 100 parcels and 32 hub doors.

Versions #

Kit 1.6.2. 1.6.0 added the hooks, 1.5.0 the hub, lives and surfaces, 1.4.0 the attachment to game.engine scenes.