Demos

Game AI

Melee

Remix this demo ↓

Watch offense chase defense, then open a decision in Neurons.

P1: offense · P2: defense · edited 2×

Same input. Different features.

One saved game state. All 5 available moves.

MoveOffenseDefense

Inspect the decision

Melee decision graphConnections behind an offense choice.Approach And Grab RangeApproach And GrabRangeRetreat Shield Or ReleaseRetreat Shield OrReleaseAerial Attack PlansAerial AttackPlansYour Move Lock And StatusYour Move Lock AndStatusOpponent Windup And RecoveryOpponent WindupAnd RecoveryRelative Position And Action TimingRelative PositionAnd Action TimingActive Pressure And Recent LaserActive PressureAnd Recent LaserGame state +choicesDecisionMelee decision graphConnections behind an offense choice.Approach And Grab RangeApproach And GrabRangeRetreat Shield Or ReleaseRetreat Shield OrReleaseAerial Attack PlansAerial Attack PlansYour Move Lock And StatusYour Move Lock AndStatusOpponent Windup And RecoveryOpponent Windup AndRecoveryRelative Position And Action TimingRelative PositionAnd Action TimingActive Pressure And Recent LaserActive Pressure AndRecent LaserGame state + choicesGame state + choicesDecisionDecision
View input
State: You are at mid approach range at similar height, beyond immediate short-range attacks; a move that closes distance is needed to reach them. The opponent is outside the nearby distance used for grab attempts.
Open in Neurons ↗
Against level-3 CPU
Offense · won
Defense · lost
Earlier Large vs Jev: Jev won both games

Two games / 4.5 minutes

Spinda Large
vs Jev.

Fox vs Fox on Final Destination. Jev wins both games 4–0.

Compare the controllers

Remix this demo

Examples
  • Needs: None beyond Python if the agent builds the simulator; real robots need your own control API and safety interlocks

  • Needs: Access to your game's state and input hooks (source code or a debug API)

  • Needs: Recorded sensor CSV for sample mode; controlling real HVAC hardware is your responsibility and needs its own safety limits

Paste it into your coding agent in your project.

Read the full prompt
Adapt this for [what I want to build].

Build a bounded-plan decision loop in my existing project. This prompt is self-contained; no starter repository or Melee files are needed to adapt the pattern. Use my project's stack and conventions. If there is no project yet, make a small Python application with a browser viewer.

The model chooses what to do. My code executes it:
1. Read a typed state snapshot from what the application actually observes. Include current action, time until another action is possible, relevant recent outcomes and the age of the snapshot. Do not invent observations.
2. Offer 3–8 bounded plans. Each defines its steps, start conditions, acknowledgments, maximum duration, expiry and cancellation rules. Include a stop/release option. Do not let a plan hide repeated tactical choices.
3. Ask a decision model to choose exactly one plan ID. It never emits low-level controls.
4. Run the chosen plan in a deterministic executor at the application's tick rate. Confirm steps from observed state. Keep at most one pending next choice; expire it or cancel it when context changes. Start a valid pending choice on the first legal tick. A late response must not replace a newer decision.
5. Feed observed outcomes back into the next state. Show the state, selected plan, execution steps and resulting observations in the viewer.

Build this in my project:
- First identify the observation and action interfaces. Show me a compact state schema and plan menu, then implement them. Ask one question only if a necessary interface or constraint cannot be inferred.
- Start with an offline sample: a small explicitly scripted state sequence, scripted choices and deterministic timing. It must work without a key, make zero network calls and be labelled "Sample". Include a plan finishing normally, a cancelled plan and an expired buffered choice. Preserve manually supplied inputs.
- Keep the simulator/adapter, model client and executor separate. The sample must exercise the same executor as live mode. Do not present scripted outcomes as model performance.
- Default live provider: Spinda, model `decision-model-large`, POST `https://api.spinda.ai/v1/systemone`, key `SPINDA_API_KEY`. An explicit alternative is TypeSafe Jev, model `jev-1.13.0`, POST `https://api.typesafe.ai/v1/systemone`, key `TYPESAFE_API_KEY`. Never silently switch providers or models.
- Read keys only on the server from environment variables or a git-ignored .env. Never put them in browser code, logs, fixtures or this chat. Without a key, keep the sample working and explain which variable to configure.

Request contract:
Send JSON with `model`, the readable state in `state`, and `questions.next_action` containing `type: "choice"`, `instructions: "Choose one listed plan from the current observed state."`, and `criteria`, an object mapping each plan ID to its complete bounded behavior. Send `Authorization: Bearer <key>`, `Content-Type: application/json` and an `Idempotency-Key` stable for that exact decision body.

Read the chosen ID from `answers.next_action.choice` and every option's probability from `answers.next_action.probabilities`. Validate that the returned ID is in the menu before execution. Do not use `confidence` as the selected option's probability. Label live results with the exact returned model ID.

For Spinda, check `https://api.spinda.ai/health` before live mode. `models["decision-model-large"]` must be true; `healthy` alone is not model readiness. On missing credentials, unavailable model, malformed response or a failed request, remain in sample mode or hold/release safely. Do not fabricate a model answer. For uncertain requests, retry only the identical body with its original idempotency key and bounded backoff; do not create a new charged decision merely because the client timed out. Honor Retry-After, set a call cap and retain usage by run. Ask before any paid run beyond the user's configured cap.

Verify:
- Acknowledgments advance a plan only after the expected observation.
- Cancellation, response staleness, buffer expiry and first-legal-tick execution work.
- Unknown plan IDs and failed requests never trigger an action.
- Sample mode makes no network calls; keys never reach the browser or logs.
- Recorded replay outcomes match executor outputs before claiming replay validity.

Run the sample, open the viewer and exercise the full loop. If a key is configured and the user has authorized it, make one harmless live decision with a fixed call cap. Do not connect real hardware or place trades automatically. Real Melee play additionally requires the user's own game, Slippi Dolphin and libmelee; build against recorded or synthetic state until those interfaces are available.

Finish with the changed files, the run command, what was verified and any missing connection. Keep the UI focused on state, action, outcome and a clear Sample/Live label.