LoL Gameplay Kit — Documentation¶
LoL Engine is the plumbing. The Gameplay Kit is the grammar.
One page per module lands here as the module ships (part of the definition of done).
Release 0.1.0 (Tier 1)¶
| Module | Page | Milestone |
|---|---|---|
| Core (contracts, config) | this page | M0 ✅ |
| WorldFlags | worldflags.md |
M1 ✅ |
| Calendar | calendar.md |
M1 ✅ |
| Items | items.md |
M2 ✅ |
| Tooltip (UI) | tooltip.md |
M2 ✅ |
| Interaction | interaction.md |
M2 ✅ |
| Contracts | contracts.md |
M3 ✅ |
| Deduction | deduction.md |
M3 ✅ |
The four contracts¶
Every module obeys:
- Save — a versioned
GameplayKitSaveDatadomain (gameplaykit.<module>), registered withISaveSystemonly when the module is enabled; migrations from v1. - RNG — draws only from
IRngServicenamed streams (names reserved inGameplayKitRngStreams);UnityEngine.Randomis banned and guard-tested. - Events — typed pooled
GameEvents outward; no hard sibling references where an event suffices. - Config — ScriptableObject tuning; LocString for anything player-facing.
Getting started¶
- Add LoL Engine and the Kit to
Packages/manifest.json(both lines — git deps don't resolve transitively; see README). - Create a
GameplayKitConfigasset (Create → LoLGameplayKit), toggle the modules you use, and place it in aResourcesfolder (asset nameGameplayKitConfig). Modules with their own config (e.g.CalendarConfig) also live inResources. - That's it — registration is automatic. Each module ships an
IServiceRegistrarthat the engine's initializer discovers by assembly scan, constructs parameterlessly, and runs after all engine services are up. Note: the engine does not callInitialize/Shutdownon externally registered services; the Kit's registrars initialize their own services.
Sample Scenes¶
Playable demos that live entirely inside the package (Assets/GameplayKit/Samples/), so they
work in a brand-new project that imports only the package — no engine setup, no Kit setup.
Open any scene and enter Play Mode. Each scene shows an on-screen instructions panel (a "What
this demonstrates" / "Try" card, matching LoLEngine's own samples); for deeper detail, watch the
Console for each sample's LogInstructions() banner, or use component Context Menus.
Self-containment has three layers, mirroring LoLEngine's own Samples:
- Engine bootstrap — every scene carries a
LoLEngineBootstrapGameObject (ImprovedGameInitializer+Samples/Content/Configs/KitSamplesServiceConfiguration, which enables only events, object pool, time, and RNG). Engine initialization is asynchronous, so sample scripts yield onSampleEngineWait.UntilReady()before resolving services or callingEventStartListening(which throws pre-initialization). - Kit configuration —
Samples/Content/Resources/holds the five Resources-loaded catalogs (GameplayKitConfig,CalendarConfig,ItemDatabase,ContractCatalog,DeductionMatrix).Resources.Loadsearches package Resources folders, so the Kit registrars find them with zero setup. If your game defines its ownGameplayKitConfigin a Resources folder, remove the samples' copy (or the wholeSamples/folder) to avoid the ambiguity. - Demo content — prefabs under
Samples/Prefabs/, items/contracts/deduction assets underSamples/Content/.
| Scene | What it demonstrates |
|---|---|
Samples/Scenes/KitShowcase.unity |
Integrated console-driven modules (WorldFlags, Calendar, Items, Contracts, Deduction) plus a small calendar HUD (day/phase + Next Phase / Next Day). Cross-module story: advance days to expire a contract deadline; complete a contract and inspect reward flags in Tools → LoLGameplayKit → World Flags. Also carries TooltipSample for the headless Show/Hide path (console only — no tooltip canvas in this scene; use TooltipDemo for the uGUI skin). |
Samples/Scenes/InteractionDemo.unity |
Movable player (SamplePlayer prefab) with InteractionDetectorComponent, facing-origin cone, and 4 interactables. WASD move, E interact; focus tint + verb label. |
Samples/Scenes/TooltipDemo.unity |
uGUI tooltip panel (TooltipPanel prefab) + hoverable item slots wired to demo ItemDefinitions. Hover for rarity-tinted tooltips; TooltipSample keys for scripted Show/Hide. |
The host project's Assets/Scenes/KitDev.unity stays as an empty URP 2D sandbox (dev-only, not
shipped). Rebuild everything via Tools → LoLGameplayKit → Build Sample Scenes.