com.IvanMurzak.Brutal.MCP.Box2D
0.1.0
dotnet add package com.IvanMurzak.Brutal.MCP.Box2D --version 0.1.0
NuGet\Install-Package com.IvanMurzak.Brutal.MCP.Box2D -Version 0.1.0
<PackageReference Include="com.IvanMurzak.Brutal.MCP.Box2D" Version="0.1.0" />
<PackageVersion Include="com.IvanMurzak.Brutal.MCP.Box2D" Version="0.1.0" />
<PackageReference Include="com.IvanMurzak.Brutal.MCP.Box2D" />
paket add com.IvanMurzak.Brutal.MCP.Box2D --version 0.1.0
#r "nuget: com.IvanMurzak.Brutal.MCP.Box2D, 0.1.0"
#:package com.IvanMurzak.Brutal.MCP.Box2D@0.1.0
#addin nuget:?package=com.IvanMurzak.Brutal.MCP.Box2D&version=0.1.0
#tool nuget:?package=com.IvanMurzak.Brutal.MCP.Box2D&version=0.1.0
Brutal-MCP Box2D
Brutal-MCP extension for Ahwoo.BRUTAL.Box2D (Box2D v3): lets AI agents
read and change a running game's 2D physics through RQL (rql-query / rql-mutate).
dotnet add package com.IvanMurzak.Brutal.MCP.Box2D
The one line the game needs (after Box2D.CreateWorld):
BrutalMcpBox2D.Register(world, "World");
Optional: BrutalMcpBox2D.Register(playerBody, "Player") for bodies agents should always see. Bodies that move in a
registered world are remembered automatically at every BrutalMcp.Tick() (the extension's BrutalMcp.Ticked handler reads
the world's last-step move events). Call BrutalMcpBox2D.CollectMovedBodies(world) right after each world.Step(...) yourself
when the game steps several times per tick or does not register the world. Worlds and bodies held in static fields, or in
fields of objects passed to BrutalMcp.Register, are found without registering. Call
BrutalMcpBox2D.Unregister(world) before destroying a world. The game must call BrutalMcp.Tick() once per frame (outside
Step): every read and write runs there (Box2D is not thread-safe).
RQL
| Source | Content |
|---|---|
worlds2d |
worlds: Name Id Valid Gravity (settable) AwakeBodyCount BodyCount ShapeCount ContactCount JointCount IslandCount StepMs Profile SleepingEnabled ContinuousEnabled (settable) Bodies; calls Explode(position, radius, impulsePerLength), CastRayClosest(origin, translation) |
bodies2d |
known bodies: Id Name World Valid Type Position Angle LinearVelocity AngularVelocity Mass Awake Enabled GravityScale LinearDamping AngularDamping FixedRotation Bullet ShapeCount (settable where it makes sense); calls ApplyLinearImpulseToCenter(v), ApplyForceToCenter(v), ApplyAngularImpulse(x), SetTransform(position, angle) |
worlds2d | select Name Gravity AwakeBodyCount BodyCount StepMs
bodies2d | where Name == "Player" | set Position = "(0, 4)", LinearVelocity = "(0, 0)"
bodies2d | where Name == "Player" | call ApplyLinearImpulseToCenter("(0, 20)")
worlds2d | call Explode("(0, 0)", 5, 10)
Limitations
- Box2D has no API to enumerate a world's bodies.
bodies2dshows registered / field-held bodies plus bodies that moved during the last step (fromb2World_GetBodyEvents), plus every body that moved at a tick in a registered world; static bodies that never moved appear only once registered. - Every native call first checks
b2Body_IsValid/b2World_IsValid(Box2D asserts on stale ids): destroyed bodies readValid == falseand reject writes. - Angles are computed in managed code: the package's
B2Rot.GetAngleand the other inline math helpers (b2Rot_GetAngle,b2MakeRot, …) are not exported by the shipped native library.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Ahwoo.BRUTAL.Box2D (>= 2026.10.1)
- com.IvanMurzak.Brutal.MCP (>= 0.1.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0 | 123 | 10/17/2026 |