Engine interop
Usage guide for Godot, Unity, Unreal and native developers: call any kit service, receive kit events and hooks, read their values in place without JSON, and serve a capability from your engine in place of a kit (your own terrain answers world.ground, the third-person kit stands on it), with the contract of the services each kit consumes.
Kits and your engine, both ways #
GripForge kits are Rust bricks that talk to each other only through capabilities: a kit that needs the ground asks the capability world.ground, it does not know which brick answers. Your engine is a brick like the others. Everything works in both directions, on every engine:
| You want to… | Godot (GDScript) | Unity (C#) | Unreal (C++ / Blueprint) | Bevy (Rust) | C (gfkits.h) |
|---|---|---|---|---|---|
| call a kit | call_service | CallService | CallService | call_with, kit_call | gfk_call |
| listen to a kit's events | watch + game_event | Watch + gameEvent | Watch + OnGameEvent | watch + MessageReader<KitEvent> | gfk_events_watch, gfk_events_take |
| change a kit's decision (hook) | tap_hook | TapHook | TapHook / TapHookEvent | tap_kit_hook | gfk_hook_tap |
| serve a capability yourself | provide_service | Provide | ProvideService | provide_ground, provide_kit_resource, provide_kit_service | gfk_provide |
The last line is what lets the choice you made in your engine — your own terrain, your own camera, your own inventory screen — keep working: the kits use your brick exactly as they would use a kit.
Plug in your own brick (serve a capability) #
What happens #
- You give the host an object for a capability (
world.ground). - When a kit calls
world.ground.groundY(x, z), the host calls the methodgroundYof your object withx, zand gives its return value back to the kit. has_service("world.ground")answers true for every kit: the kits that only use the capability when it exists switch it on by themselves.
Give it before starting the game when a kit needs it at mount time (the third-person kit asks world.ground.defaultSpawn when it places the player). Given later, it is used from the next call. It stays across a reload of the game and a stop / start of the host, until you remove it.
In place of a kit or beside it. By default your brick replaces a kit that serves the same capability (your choice wins; the kit keeps running for its other capabilities). Pass replace = false to only fill a gap: a kit that serves the capability answers, yours answers when none does.
Rules for the provider. It runs on the game thread, inside the step of the host: answer quickly and do not call the host back from it (the call is refused). Return a plain value: a number, a string, a boolean, an array or a dictionary. Calls whose arguments are all numbers (groundY(x, z), made often) reach your engine without any JSON.
Declare it in your project #
Serving a capability at run time is half of it: the project must also say that your game serves it. Otherwise the resolver of the kits installs a provider kit (world.scene_ground, world.terrain), and removing that kit removes the kits that need it (character.first_person, interaction.system…). Declare the capability provided by the host, as the engine host already provides physics.character:
gripforge game-host gkp_… add world.ground # your game serves world.ground
gripforge game-host gkp_… add world.ground --remove-kit world.scene_ground # and the provider kit goes, alone
gripforge game-host gkp_… # what the game serves itself
gripforge game-host gkp_… remove world.ground # back to a kit (its default provider returns)
From an agent (MCP): gripforge_game_host_provides { project_id, add: ["world.ground"] }, or remove the kit with gripforge_gamekit_remove { project_id, id: "world.scene_ground", host_provides: ["world.ground"] }. When you remove a kit that other kits need, the refusal lists in details.hostable the capabilities your game could serve instead.
In the project document it is one field: "hostProvides": ["world.ground"] (any version) or ["[email protected]"]. With it, the kits that require world.ground are satisfied without a provider kit, none is added or removed for it, and the lockfile names host as its provider. A kit that serves the same capability still answers while it is installed: remove it, or serve yours in place of it (replace).
If a kit asks a declared capability while your game serves nothing for it (given too late, or not at all), the host logs one warning naming the capability and how to serve it; the kit runs without it until you provide it.
Godot: your own terrain under the third-person kit #
A complete example: a Godot terrain (any mesh with collisions) and the third-person kit, without world.terrain and without a ray of your own. This is the scene of the test wrappers/demo/godot/tests/provide_service_test.gd.
# my_terrain.gd — on the node of your terrain
extends Node3D
@export var heightmap: Image # or read your terrain resource, or cast into your own physics world
func height_at(x: float, z: float) -> float:
return 3.0 # replace with your terrain's height at (x, z)
# world.ground, the methods the kits call (camelCase as in the contract; ground_y also works)
func groundY(x: float, z: float) -> float:
return height_at(x, z)
func defaultSpawn() -> Dictionary:
return {"position": [0.0, height_at(0.0, 0.0), 0.0], "yaw": 0.0}
func bounds() -> Dictionary:
return {"min": [-500.0, 0.0, -500.0], "max": [500.0, 50.0, 500.0]}
# main.gd
@onready var host: GfGameHost = $GfGameHost
@onready var terrain = $MyTerrain
func _ready() -> void:
host.provide_service("world.ground", terrain) # before start(): the spawn already asks it
host.load_game("res://game/my.game.json")
host.start()
The capsule of the player moves through the physics of Godot (physics: "engine", the default), which already sees the collisions of your terrain; world.ground tells the kit where the ground is when it places the player (spawn, scene entry, respawn). In the lockfile, the capability is resolved to the host: "capabilities": { "world.ground": { "provider": "host" } } — no kit has to be installed for it.
Other forms:
host.provide_service("world.ground", terrain, false) # only when no kit serves world.ground
host.provide_service("camera.look", func(method, args): return my_camera.call(method, args)) # a Callable
host.unprovide_service("world.ground") # the kit answers again, if any
print(host.provided_services()) # [{ "capability": "world.ground", "replace": true }]
Unity #
using GripForge.Kits;
public class MyTerrain : MonoBehaviour, IGfService, IGfNumberService
{
public GfGameHost host;
float HeightAt(double x, double z) => Terrain.activeTerrain.SampleHeight(new Vector3((float)x, 0, (float)z));
void Awake() => host.Provide("world.ground", this); // before StartGame
// Calls whose arguments are all numbers: no JSON.
public bool ServeNumbers(string method, double[] args, out double result)
{
result = 0;
if (method != "groundY") return false;
result = HeightAt(args[0], args[1]);
return true;
}
// Any other call: the arguments and the answer as JSON text.
public string Serve(string method, string argsJson) => method switch
{
"defaultSpawn" => $"{{\"position\":[0,{HeightAt(0, 0)},0],\"yaw\":0}}",
_ => throw new GfServiceRefused($"no method {method}"),
};
}
A delegate works too: host.Provide("world.ground", (method, args) => …) answers any value of the GfJson model. host.Unprovide("world.ground") removes it, host.Provided() lists what Unity serves.
Unreal (C++ and Blueprint) #
Implement the interface IGfServiceProvider on any object — a C++ class or a Blueprint (Class Settings → Interfaces → GfServiceProvider) — and give it to the host or the component:
// MyTerrainActor.h
UCLASS()
class AMyTerrainActor : public AActor, public IGfServiceProvider
{
GENERATED_BODY()
public:
virtual FString Serve_Implementation(const FString& Method, const FString& ArgsJson) override;
virtual bool ServeNumbers_Implementation(const FString& Method, const TArray<double>& Args, double& Result) override;
};
// MyTerrainActor.cpp
bool AMyTerrainActor::ServeNumbers_Implementation(const FString& Method, const TArray<double>& Args, double& Result)
{
if (Method != TEXT("groundY") || Args.Num() < 2) return false;
Result = HeightAt(Args[0], Args[1]); // your landscape's height (a line trace, a heightmap…)
return true;
}
FString AMyTerrainActor::Serve_Implementation(const FString& Method, const FString& ArgsJson)
{
if (Method == TEXT("defaultSpawn"))
return FString::Printf(TEXT("{\"position\":[0,%f,0],\"yaw\":0}"), HeightAt(0, 0));
return FString(); // no value: null
}
// Before StartGame:
GameComponent->ProvideService(TEXT("world.ground"), TerrainActor);
In a Blueprint, implement the events Serve (and optionally ServeNumbers) of the interface, then call Provide Service on the GfGameComponent with your actor. UnprovideService removes it, ProvidedServices lists them. The calls come typed by default: implement ServeValue to get the arguments without JSON (see « Read in place » below); a provider that only has Serve keeps working, its arguments then come as JSON.
Bevy (Rust) #
A Bevy game links the kits as a Rust crate, gripforge-kithost-bevy (kits/game_engine/bevy): no C library, no text between your game and the kits. Arguments go as typed values (Arg::Num, Arg::Str, Arg::Vec3), answers come back typed (Reply, Ret) and are read in place through accessors (Val, KitPayload); a to_json() exists on the accessors for a tool or a debug print, never on the way. groundY(x, z) goes from the kit to your resource and back as two numbers and one number.
use bevy::prelude::*;
use gfkits_bevy::*;
#[derive(Resource)]
struct MyTerrain { /* your heightfield */ }
impl GroundService for MyTerrain {
fn ground_y(&self, x: f64, z: f64) -> Option<f64> { Some(self.height_at(x, z)) }
fn default_spawn(&self) -> Option<GroundSpawn> {
Some(GroundSpawn { position: [0.0, self.height_at(0.0, 0.0), 0.0], yaw: 0.0 })
}
}
App::new()
.add_plugins((MinimalPlugins, KitsPlugin::new(my_game).watch("player.*")))
.provide_ground::<MyTerrain>(Provide::Replace) // world.ground, read in place in your resource
.add_systems(Startup, spawn_my_terrain) // the kits are mounted after Startup (KitsSet::Mount)
.run();
provide_ground::<T>()servesworld.groundfrom a resource implementingGroundService;provide_kit_resource::<T>(capability, mode)serves any capability from a resource implementingKitService(fn serve(&self, call: &ServiceCall) -> Result<Reply, String>);provide_kit_service(capability, mode, closure)serves it from a closure.ServiceCallreads the arguments (num(i),text(i),vec3(i)) and the game's resources (resource::<R>()) in place.Provide::Replace(default) wins over a kit that serves the same capability;Provide::Besideonly fills a gap. Given before the mount, the kits see it from their mount; given later (KitGame::provide), from the next call. It stays across a reload;KitGame::unprovideremoves it,KitGame::providedlists them.- The game is mounted in
PostStartupand steps inUpdatewith Bevy'sTime(KitsSet::Mount,KitsSet::Step).KitGameis a non-send resource (NonSendMut<KitGame>); in an exclusive system,world.kit_call(...)andworld.with_kits(...)lend the world to the providers that read a resource. - Your Bevy terrain still needs a collision for the kits' physics (the kits run their own Rapier world: give it a static shape with
game.host_mut().physics.add_static_box(...)). - Test:
kits/game_engine/bevy/tests/own_terrain.rs(a terrain resource servesworld.ground, the third-person player spawns on it, walks and stays grounded; events and a hook tap in the same app).
C and other native hosts #
static int32_t my_ground(void* user, const char* method, size_t method_len, const char* args, size_t args_len,
const double* nums, size_t nums_len, GfkReply* reply) {
if (method_len == 7 && memcmp(method, "groundY", 7) == 0 && nums_len == 2) {
gfk_reply_number(reply, my_height(nums[0], nums[1]));
return 0;
}
if (method_len == 12 && memcmp(method, "defaultSpawn", 12) == 0) {
const char* a = "{\"position\":[0,3,0],\"yaw\":0}";
gfk_reply_json(reply, a, strlen(a));
return 0;
}
const char* why = "\"no such method\"";
gfk_reply_json(reply, why, strlen(why));
return 1; /* refused: the kit gets the reason */
}
gfk_provide(NULL, "world.ground", 12, 1 /* replace a kit */, my_ground, my_state); /* before gfk_game_create */
gfk_game_create(json, len, &game);
When every argument is a number, args is null and the numbers come in nums; otherwise args is the JSON array of the arguments and nums is null. gfk_unprovide removes a service, gfk_provided lists them.
Call a kit #
Every service of every installed kit is callable from the engine, with the method names and arguments of the kit's API reference (grip-forge docs <kit>, MCP gripforge_kit_api):
var hp = host.call_service("combat.health", "get", ["player"])
host.call_service("inventory.items", "give", ["herb", 1])
var pos = host.CallService("character.control", "position", new List<object>());
FString Pos = Host->CallService(TEXT("character.control"), TEXT("position"), TEXT("[]"));
// Bevy: typed arguments, the answer read in place.
let pos = game.call_vec3("character.control", "position", &[])?;
let hp = game.call_number("combat.health", "get", &[Arg::Str("player")])?;
A call made from the engine reaches your own provided services too: call_service("world.ground", "groundY", [0, 0]) answers what your terrain answers.
Listen to a kit #
Events. Watch a pattern, then receive the matching events after each step:
host.watch("combat.*")
host.game_event.connect(func(topic, payload, event): print(topic, payload))
Unity: host.Watch("combat.*") and the C# event gameEvent; Unreal: Watch and the Blueprint event OnGameEvent. Bevy: KitsPlugin::new(game).watch("combat.*"), then a system with MessageReader<KitEvent> after KitsSet::Step; the payload is read in place (event.payload.num("amount")), moved out of the kit host, not copied.
Hooks. A hook is a decision of a kit that the game may change before it applies (the damage of a hit, the speed of a jump). Tap it and answer the fields to change:
host.tap_hook("combat.damage", func(payload, hook): return {"set": {"multiply": 2.0}})
Unity: TapHook(hook, (payload, hook) => …); Unreal: TapHook (C++) or TapHookEvent (Blueprint); Bevy: app.tap_kit_hook("character.jump", 0.0, |call| HookReply::set("speed", Ret::Num(call.num("speed").unwrap_or(5.0) * 1.5))): the tap reads the payload in place and answers HookReply::Pass, HookReply::set(field, value) or HookReply::cancel(reason). The hooks of a kit and their fields are listed in its API reference (hooks), the same ones a mod uses (contract of game.engine).
Read in place: accessors (no JSON) #
Every way above also exists typed, without JSON. The rule: simple values (a number, a flag, a vector, an id, a short text) are copied by value, as a plain function call does; complex ones (structures, objects, lists, the state of an entity, blocks of data) are a pointer / accessor on the memory where they already live, read in place without a copy. JSON stays where it is the most logical.
When to use what. The first question: does the data already live in memory the library keeps (an answer, an event, a hook's decision, a state, a component)? Then read it there through an accessor — never copy it into another format.
| The data | Use | Godot | Unity (C#) |
|---|---|---|---|
| a simple value: number, flag, vector, id, short text (argument or answer of a call, a hook, your brick) | copy by value | plain float, bool, Vector3, String | double, long, bool, Vector3, string |
| a complex value that already lives in the library: list, dictionary, payload of an event, decision of a hook, state, component | accessor, read in place, no copy | GfKitValue, GfKitEvent, GfKitView | GfKitValue, GfKitEvent, GfKitView |
| state read every frame (position, speed, mode of an entity) | accessor on it, asked each frame | view_state, view_component, the rows of the shared zone | ViewState, ViewComponent |
| rare data of free or varying shape: configuration, one-off orders, tools, debugging, dynamic structures | JSON | call_service, apply, to_dict(), to_json() | CallService, Apply, ToObject(), ToJson() |
No shared memory is made just to pass a one-off value: a simple value is copied, a rare free-form one is JSON.
| You want… | Godot (accessor) | Unity (C#) | the same in JSON | C (gfkits.h) |
|---|---|---|---|---|
| call a kit | call_value (simple answer by value, complex one as GfKitValue), call_number, call_vector3 | CallValue, CallNumber, CallVector3 · JSON: CallService | call_service | gfk_call_args |
| receive its events | subscribe(pattern, func(e: GfKitEvent)) | Subscribe(pattern, e => …) · JSON: Watch + gameEvent | watch + game_event | gfk_events_take_vals |
| change a decision | tap_hook_value(hook, func(p: GfKitValue, hook)) | TapHookValue(hook, (p, hook) => …) · JSON: TapHook | tap_hook | gfk_hook_tap_args |
| serve a capability | provide_service(cap, object) (typed by default) | ProvideService(cap, IGfValueService) · JSON: Provide(cap, IGfService) | provide_service(cap, object, true, true) | gfk_provide_args |
| read a continuous state | view_state(path), view_component(entity, component) | ViewState(path), ViewComponent(entity, component) · JSON: State, Entity | state, entity | gfk_val_live |
# A call: typed arguments in, the answer read in place.
var pos: Vector3 = host.call_vector3("character.control", "position", [])
var hp: float = host.call_number("combat.health", "get", ["player"])
var hooks: GfKitValue = host.call_value("engine.hooks", "declared", []) # complex: read in place
print(hooks.kind(), " ", hooks.size(), " ", hooks.to_json()) # to_json(): a copy, on demand
# Events: one object per event, its payload read in place.
host.subscribe("combat.*", func(e: GfKitEvent): print(e.topic(), " ", e.num("amount"), " on ", e.entity()))
# A hook: the decision read in place, the answer given back typed.
host.tap_hook_value("character.jump", func(p: GfKitValue, hook: String):
return {"set": {"speed": p.num("speed") * 1.5}})
# A continuous state: asked every frame, always current, never copied.
var speed := host.view_state("player.speed")
func _process(_dt): $Hud/Speed.text = "%.1f" % speed.num()
Unity (C#) has the same objects in C# casing (wrappers/unity/Runtime/GfShared.cs). An answer of CallValue that is a GfKitValue keeps its root in the library until Dispose() (using; one forgotten is given back at the next step, GfGameHost.HeldValues() counts them). The payload of an event or a hook and the arguments of a ProvideService service are lent: readable during the callback only. GfGameHost.Copied(true) stays at 0 with every typed way in use while the player walks on PhysX (test GfKitsQa.Accessors).
Vector3 pos = host.CallVector3("character.control", "position"); // kit axes: GfSpace.ToUnity
double hp = host.CallNumber("combat.health", "get", "player");
using (var hooks = host.CallValue("engine.hooks", "declared") as GfKitValue) // complex: read in place
Debug.Log(hooks.Size + " " + hooks.ToJson()); // ToJson(): a copy, on demand
host.Subscribe("combat.*", e => Debug.Log(e.Topic + " " + e.Num("amount") + " " + e.Entity));
host.TapHookValue("character.jump", (p, hook) => J.Obj("set", J.Obj("speed", p.Num("speed") * 1.5)));
host.ProvideService("world.ground", (method, args) => method == "groundY" ? (object)HeightAt((double)args[0], (double)args[1]) : null);
var speed = host.ViewState("player.speed"); // in Update: speed.Num()
GfKitValuereads a value:kind(),num(key),text(key),flag(key),vec3(key)(a key, or a path such asvelocity.yoritems.0),get(key),at(i),keys(),size(),as_float(),as_string()…, andto_dict()/to_json()for a copy. Give it back as an argument (call_value(..., [value])): it is lent to the kit as it is, not copied.GfKitEvent:topic(),source(),entity(),tick(),seq(),payload(), and the samenum/text/flag/vec3on the payload. The events reach the subscribers andgame_eventalike.GfKitView:num,text,flag,vec3,exists,to_dict; it looks the value up again at each read.- Your brick, typed: a method of your provider receives numbers, texts and
Vector3s as they are, and a list or a dictionary of the kit as aGfKitValue; its return value (a number, a text, aVector3, anArray, aDictionary) goes back typed. - How long a value lives. An answer or an event stays in the library as long as an accessor of yours refers to it (
held_values()counts them). A lent value — the payload given to a tap, an argument given to your brick — is readable only during that call: keepto_dict()if you need it later. - Proof.
copied(true)counts the bytes the library wrote or read as text since the last reset: with every typed way in use at every frame while the player walks, it stays at 0.
C and other engines. The engine gives its arguments as GfkArg records it owns (a kind, a length, three numbers, a pointer: number, integer, flag, text, vector, entity, list, dictionary, a value of the library, or JSON text for the rare case). gfk_call_args answers with one GfkArg too: a simple value by value, a complex one as a GfkVal handle on the value where the library keeps it, read with gfk_val_read (its kind, its number, or the address and length of its text in the library's memory), gfk_val_get (a field), and gfk_val_at (an item, or an entry with its key). A root — the answer of gfk_call_args, the batch of gfk_events_take_vals — is given back with gfk_val_release; gfk_val_json makes the JSON text on demand. A callback answers typed with gfk_reply_arg. Unity, Unreal and the web read the same handles.
Unreal (C++ and Blueprint) #
The same objects, at Unreal's convention: FGfKitArg is a typed value by value (number, integer, flag, text, FVector, list, dictionary, or a value of the library), FGfKitValue (C++) and UGfKitValue (Blueprint) read a value in place, FGfKitEvent / UGfKitEvent an event, UGfKitView a continuous state.
| You want… | C++ / Blueprint on UGfGameHost | the same in JSON |
|---|---|---|
| call a kit | CallValue (answers an FGfKitArg: simple by value, complex as Kind Value), CallNumber, CallVector | CallService |
| receive its events | SubscribeNative(pattern, fn) (C++), Subscribe(pattern) + OnKitEvent (Blueprint) | Watch + OnEvent / OnGameEvent |
| change a decision | TapHookValue(hook, fn) (C++), Tap Hook Value (Blueprint) | TapHook |
| serve a capability | ProvideService(cap, object), the interface's ServeValue (typed by default) | ProvideService(cap, object, true, true) + Serve |
| read a continuous state | ViewState(path), ViewComponent(entity, component) | State, Entity |
// A call: typed arguments in, the answer read in place.
FVector Pos = Host->CallVector(TEXT("character.control"), TEXT("position"), {});
double Hp = Host->CallNumber(TEXT("combat.health"), TEXT("get"), {TEXT("player")});
FGfKitArg Hooks = Host->CallValue(TEXT("engine.hooks"), TEXT("declared"), {}); // complex: Hooks.Value, read in place
UE_LOG(LogTemp, Log, TEXT("%d hooks: %s"), Hooks.Value.Size(), *Hooks.Value.ToJson()); // ToJson(): a copy, on demand
// Events: one object per event, its payload read in place.
Host->SubscribeNative(TEXT("combat.*"), [](const FGfKitEvent& E) {
UE_LOG(LogTemp, Log, TEXT("%s %f on %s"), *E.Topic(), E.Num(TEXT("amount")), *E.Entity());
});
// A hook: the decision read in place, the answer given back typed.
Host->TapHookValue(TEXT("character.jump"), [](const FGfKitValue& P, const FString& Hook) {
return FGfKitArg::Dict({{TEXT("set"), FGfKitArg::Dict({{TEXT("speed"), P.Num(TEXT("speed")) * 1.5}})}});
});
// A continuous state: asked every frame, always current, never copied.
UGfKitView* Speed = Host->ViewState(TEXT("player.speed")); // in Tick: Speed->Num(TEXT(""))
// Your brick, typed: numbers and FVector by value, a structure of the kit as a value lent for the call.
bool AMyTerrainActor::ServeValue_Implementation(const FString& Method, const TArray<FGfKitArg>& Args, FGfKitArg& Result)
{
if (Method != TEXT("groundY") || Args.Num() < 2) return false; // false: ServeNumbers, then Serve (JSON)
Result = HeightAt(Args[0].AsNumber(), Args[1].AsNumber());
return true;
}
- In a Blueprint, Call Value answers a
GfKitArg(break it, or Arg As Number, Arg As Vector, Arg As Value for aGfKitValueobject); arguments are made with Make Number Arg, Make Text Arg, Make Vector Arg, Make Dict Arg, Make Value Arg (a value lent back as it is).UGfKitValuehas Num, Text, Flag, Vec3, Get, At, Keys, Size, Is Readable, To Json. - A lent value (the payload given to a tap, an argument given to
ServeValue) is readable only during that call; a value lent by a view, until the next call that runs the game. An answer or an event holds its root until the last copy is gone (HeldValues()counts them;UGfKitValue::Releasegives one back early). - Proof:
UGfGameHost::Copied(true)(Blueprint: Copied Bytes) stays at 0 with every typed way in use at every frame; the automation testGripForge.Accessorschecks it (wrappers/unreal/README.md).
Which services does a kit consume? #
Every kit declares the services it consumes in services.json next to its manifest: for each capability, whether it is required (listed in the kit's requires) or optional (the kit checks has_service and works without it), and the methods it calls. The same list is in the API reference of the kit (section consumes), which the CLI and the MCP show. Read it to know what your brick must answer. For the third-person kit:
| Capability | Required | Methods called |
|---|---|---|
world.ground | yes | defaultSpawn() → { position: [x, y, z], yaw }, groundY(x, z) → height |
input.actions | yes | axis, pressed, justPressed |
combat.ranged, combat.melee, combat.health | no | used when installed |
engine.hooks | no | run (game.engine) |
A kit that calls a capability or a method it did not declare fails the checks of the kit repository, so the list is always complete.
When it does not do what you expect #
- The kit does not use my service. Check the capability name and the method names (case matters:
groundY; Godot also acceptsground_y). Give the service beforestartwhen the kit reads it at mount time. - Removing a world kit removes my character kits. Declare the capability your game serves (
gripforge game-host gkp_… add world.ground): see « Declare it in your project ». - "world.ground is declared served by the game … but nothing serves it". The project declares it (
hostProvides) and a kit asked before your game provided it: callprovide_servicebeforestart. - A kit still answers instead of mine. You passed
replace = false; a kit serving the capability wins then. - "the provider failed (did it call the host back?)". The provider called the host during the step: compute the answer from your own data instead.
- The player falls through my terrain.
world.groundplaces the player; the collisions come from the physics. Keepphysics: "engine"so the capsule moves in your engine's world, and give your terrain a collision shape.
Limits #
- One provider per capability. Providing it again replaces the previous one.
- The provider answers synchronously, on the game thread.
- On the web, the page serves a capability with
hostServiceswhen it creates the game: a function fills a gap,{ serve: fn, replace: true }replaces a kit.
Versions #
gfk_provide, gfk_unprovide, gfk_provided and gfk_reply_number: gfkits ABI 1.11 (library 0.2.22). The accessors (gfk_call_args, gfk_events_take_vals, gfk_hook_tap_args, gfk_provide_args, gfk_reply_arg, gfk_val_live, gfk_val_read, gfk_val_get, gfk_val_at, gfk_val_json, gfk_val_release) and their Godot objects (GfKitValue, GfKitEvent, GfKitView): gfkits ABI 1.12. hostProvides in the project, gripforge game-host, the MCP tool gripforge_game_host_provides and the warning of the host: gamekits and kit host after module-kits v0.5.27, CLI 0.3.141 (MCP with it). provide_service (Godot), Provide (Unity) and ProvideService (Unreal) ship with the same library. Bevy: gripforge-kithost-bevy 0.1, typed providers over the kit host's provide_typed. Unity: GfKitValue, GfKitEvent, GfKitView, CallValue, Subscribe, TapHookValue, ProvideService, ViewState (C#): Unity package 0.2.24, same ABI 1.12.