Spaces:
Running
Running
Commit
Β·
712a0e0
1
Parent(s):
bc7e9cd
better agents.md
Browse files
agents.md
CHANGED
|
@@ -1,18 +1,18 @@
|
|
| 1 |
-
VibeGame
|
| 2 |
|
| 3 |
-
|
| 4 |
|
| 5 |
-
|
| 6 |
|
| 7 |
-
**
|
| 8 |
-
|
| 9 |
-
**Auto-Creation**: Engine
|
| 10 |
|
| 11 |
## Essential Syntax
|
| 12 |
|
| 13 |
```xml
|
| 14 |
<world canvas="#game-canvas" sky="#87ceeb">
|
| 15 |
-
<!-- Ground
|
| 16 |
<static-part pos="0 -0.5 0" shape="box" size="20 1 20" color="#90ee90"></static-part>
|
| 17 |
|
| 18 |
<!-- Physics objects -->
|
|
@@ -23,133 +23,66 @@ VibeGame is a 3D game engine with declarative XML syntax and ECS architecture. T
|
|
| 23 |
</world>
|
| 24 |
```
|
| 25 |
|
| 26 |
-
## Key Recipes
|
| 27 |
|
| 28 |
-
- `<static-part>` - Immovable
|
| 29 |
-
- `<dynamic-part>` - Gravity-affected
|
| 30 |
-
- `<kinematic-part>` - Script-controlled
|
| 31 |
-
- `<player>` -
|
| 32 |
-
- `<
|
| 33 |
-
- `<entity>` - Base entity with any components via attributes
|
| 34 |
|
| 35 |
-
## Critical
|
| 36 |
|
| 37 |
-
β οΈ **Physics
|
| 38 |
|
| 39 |
```xml
|
| 40 |
-
<!-- β
|
| 41 |
-
<dynamic-part pos="0 5 0" shape="sphere"
|
| 42 |
|
| 43 |
-
<!-- β WRONG: Transform
|
| 44 |
<entity transform="pos: 0 5 0" body collider></entity>
|
| 45 |
```
|
| 46 |
|
| 47 |
-
## Component
|
| 48 |
-
|
| 49 |
-
Components declared as bare attributes (defaults) or with values:
|
| 50 |
|
| 51 |
```xml
|
| 52 |
-
<!-- Bare attributes
|
| 53 |
<entity transform body collider renderer></entity>
|
| 54 |
|
| 55 |
-
<!-- Override
|
| 56 |
<entity transform="pos: 0 5 0" body="type: dynamic; mass: 10" collider renderer></entity>
|
| 57 |
```
|
| 58 |
|
| 59 |
-
Shorthands
|
| 60 |
-
|
| 61 |
-
- `pos="x y z"` β applies to transform.pos* AND body.pos*
|
| 62 |
-
- `color="#ff0000"` β applies to renderer.color
|
| 63 |
-
- `size="2"` β broadcasts to sizeX, sizeY, sizeZ
|
| 64 |
-
|
| 65 |
-
## TypeScript API
|
| 66 |
-
|
| 67 |
-
```typescript
|
| 68 |
-
import * as GAME from "vibegame";
|
| 69 |
-
|
| 70 |
-
// Component definition
|
| 71 |
-
const Health = GAME.defineComponent({
|
| 72 |
-
current: GAME.Types.f32,
|
| 73 |
-
max: GAME.Types.f32,
|
| 74 |
-
});
|
| 75 |
-
|
| 76 |
-
// System with query
|
| 77 |
-
const healthQuery = GAME.defineQuery([Health]);
|
| 78 |
-
const HealthSystem: GAME.System = {
|
| 79 |
-
update: (state) => {
|
| 80 |
-
const entities = healthQuery(state.world);
|
| 81 |
-
for (const entity of entities) {
|
| 82 |
-
Health.current[entity] -= 1 * state.time.deltaTime;
|
| 83 |
-
}
|
| 84 |
-
},
|
| 85 |
-
};
|
| 86 |
-
|
| 87 |
-
// Plugin registration
|
| 88 |
-
GAME.withComponent("health", Health).withSystem(HealthSystem).run();
|
| 89 |
-
```
|
| 90 |
-
|
| 91 |
-
## Available Features
|
| 92 |
-
|
| 93 |
-
β
**Core Systems**: Physics (Rapier 3D), rendering (Three.js), input (keyboard/mouse/gamepad), tweening, transforms
|
| 94 |
-
|
| 95 |
-
β
**Game Elements**: Player controller, orbital camera, collision detection, respawn system, post-processing effects
|
| 96 |
-
|
| 97 |
-
β **Not Built-In**: Audio, multiplayer, save/load, inventory, AI/pathfinding, particles, custom shaders
|
| 98 |
|
| 99 |
## Development Commands
|
| 100 |
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
# Development
|
| 107 |
-
bun dev # Start dev server
|
| 108 |
-
bun run build # Production build
|
| 109 |
-
bun run check # TypeScript validation
|
| 110 |
-
bun run lint --fix # ESLint analysis
|
| 111 |
-
bun test # Run tests
|
| 112 |
-
```
|
| 113 |
-
|
| 114 |
-
## Getting More Information
|
| 115 |
-
|
| 116 |
-
**Comprehensive Documentation**: Use Context7 to fetch detailed documentation with examples:
|
| 117 |
-
|
| 118 |
-
```typescript
|
| 119 |
-
// For AI agents with Context7 access:
|
| 120 |
-
// Use mcp__context7__resolve-library-id to find "vibegame"
|
| 121 |
-
// Then use mcp__context7__get-library-docs with the resolved ID
|
| 122 |
-
// This provides the full 2000+ line documentation with detailed examples
|
| 123 |
-
```
|
| 124 |
|
| 125 |
-
|
| 126 |
|
| 127 |
-
|
| 128 |
-
- Physics Types: `static` (fixed), `dynamic` (gravity), `kinematic` (scripted)
|
| 129 |
-
- Easing: `linear`, `sine-in-out`, `quad-out`, `bounce-in`, etc.
|
| 130 |
-
- Loop Modes: `once`, `loop`, `ping-pong`
|
| 131 |
|
| 132 |
-
|
| 133 |
|
| 134 |
-
|
| 135 |
-
**Physics Playground**: Ground + walls + dynamic objects with collision
|
| 136 |
-
**Moving Platforms**: Kinematic bodies + position tweening
|
| 137 |
-
**Collectibles**: Kinematic objects + rotation tweening + collision detection
|
| 138 |
|
| 139 |
-
|
|
|
|
|
|
|
| 140 |
|
| 141 |
-
|
| 142 |
-
2. **Use recipes over raw entities** - Cleaner and more reliable
|
| 143 |
-
3. **Leverage auto-creation** - Engine handles player/camera/lighting defaults
|
| 144 |
-
4. **Physics position priority** - Set positions on bodies, not transforms
|
| 145 |
-
5. **Query Context7 for details** - This file is overview only, get specifics via Context7
|
| 146 |
-
6. **Test incrementally** - Start simple, add complexity progressively
|
| 147 |
|
| 148 |
-
##
|
| 149 |
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
|
|
|
|
|
|
| 154 |
|
| 155 |
-
This
|
|
|
|
| 1 |
+
# VibeGame Engine Context
|
| 2 |
|
| 3 |
+
You are a VibeGame specialist. VibeGame is a 3D game engine with declarative XML syntax and ECS architecture. Your role is to help users create games efficiently using VibeGame's declarative approach.
|
| 4 |
|
| 5 |
+
## Core Architecture
|
| 6 |
|
| 7 |
+
**ECS Pattern**: Entities (IDs) + Components (data) + Systems (logic)
|
| 8 |
+
**Declarative XML**: Game entities defined in `<world>` tags
|
| 9 |
+
**Auto-Creation**: Engine provides player, camera, lighting by default
|
| 10 |
|
| 11 |
## Essential Syntax
|
| 12 |
|
| 13 |
```xml
|
| 14 |
<world canvas="#game-canvas" sky="#87ceeb">
|
| 15 |
+
<!-- REQUIRED: Ground to prevent falling -->
|
| 16 |
<static-part pos="0 -0.5 0" shape="box" size="20 1 20" color="#90ee90"></static-part>
|
| 17 |
|
| 18 |
<!-- Physics objects -->
|
|
|
|
| 23 |
</world>
|
| 24 |
```
|
| 25 |
|
| 26 |
+
## Key Recipes & Components
|
| 27 |
|
| 28 |
+
- `<static-part>` - Immovable (grounds, walls)
|
| 29 |
+
- `<dynamic-part>` - Gravity-affected (balls, crates)
|
| 30 |
+
- `<kinematic-part>` - Script-controlled (moving platforms)
|
| 31 |
+
- `<player>`, `<camera>` - Auto-created if missing
|
| 32 |
+
- `<entity>` - Base with custom components
|
|
|
|
| 33 |
|
| 34 |
+
## Critical Rules
|
| 35 |
|
| 36 |
+
β οΈ **Physics Override**: Body position overrides transform position. Always use `pos` on physics entities.
|
| 37 |
|
| 38 |
```xml
|
| 39 |
+
<!-- β
CORRECT -->
|
| 40 |
+
<dynamic-part pos="0 5 0" shape="sphere"></dynamic-part>
|
| 41 |
|
| 42 |
+
<!-- β WRONG: Transform ignored -->
|
| 43 |
<entity transform="pos: 0 5 0" body collider></entity>
|
| 44 |
```
|
| 45 |
|
| 46 |
+
## Component Syntax
|
|
|
|
|
|
|
| 47 |
|
| 48 |
```xml
|
| 49 |
+
<!-- Bare attributes = defaults -->
|
| 50 |
<entity transform body collider renderer></entity>
|
| 51 |
|
| 52 |
+
<!-- Override properties -->
|
| 53 |
<entity transform="pos: 0 5 0" body="type: dynamic; mass: 10" collider renderer></entity>
|
| 54 |
```
|
| 55 |
|
| 56 |
+
**Shorthands**: `pos`, `color`, `size` auto-expand to matching component properties.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
|
| 58 |
## Development Commands
|
| 59 |
|
| 60 |
+
- `bun dev` - Start development server
|
| 61 |
+
- `bun run build` - Production build
|
| 62 |
+
- `bun run check` - TypeScript validation
|
| 63 |
+
- `bun test` - Run tests
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
|
| 65 |
+
## Features Available
|
| 66 |
|
| 67 |
+
β
Physics (Rapier), rendering (Three.js), input, tweening, player controller, orbital camera, collision detection, respawn, post-processing
|
|
|
|
|
|
|
|
|
|
| 68 |
|
| 69 |
+
β Audio, multiplayer, save/load, inventory, AI, particles, custom shaders
|
| 70 |
|
| 71 |
+
## Documentation Access
|
|
|
|
|
|
|
|
|
|
| 72 |
|
| 73 |
+
**For detailed information**: Use Context7 to fetch comprehensive docs:
|
| 74 |
+
1. `mcp__context7__resolve-library-id` with "/dylanebert/vibegame"
|
| 75 |
+
2. `mcp__context7__get-library-docs` with resolved ID
|
| 76 |
|
| 77 |
+
**Quick Reference**: Shapes (`box`, `sphere`, `cylinder`, `capsule`), Physics (`static`, `dynamic`, `kinematic`), Easing functions, Loop modes (`once`, `loop`, `ping-pong`)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
|
| 79 |
+
## Best Practices
|
| 80 |
|
| 81 |
+
1. Always include ground platforms
|
| 82 |
+
2. Use recipes over raw entities
|
| 83 |
+
3. Leverage auto-creation defaults
|
| 84 |
+
4. Set positions on physics bodies, not transforms
|
| 85 |
+
5. Query Context7 for detailed API references
|
| 86 |
+
6. Test incrementally
|
| 87 |
|
| 88 |
+
This provides foundational VibeGame knowledge. Use Context7 for comprehensive documentation and examples.
|