{"id":33227733,"url":"https://github.com/deadronos/robotspacebattler","last_synced_at":"2026-05-10T04:30:12.031Z","repository":{"id":314649576,"uuid":"1056232322","full_name":"deadronos/RobotSpaceBattler","owner":"deadronos","description":null,"archived":false,"fork":false,"pushed_at":"2026-03-26T23:15:34.000Z","size":10783,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-27T04:33:02.124Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://deadronos.github.io/RobotSpaceBattler/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deadronos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.MD","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-09-13T16:56:08.000Z","updated_at":"2026-03-26T23:15:01.000Z","dependencies_parsed_at":"2025-10-02T17:13:46.803Z","dependency_job_id":"9cd483b0-384c-4ec1-b893-529b048f7d4d","html_url":"https://github.com/deadronos/RobotSpaceBattler","commit_stats":null,"previous_names":["deadronos/robotspacebattler"],"tags_count":37,"template":false,"template_full_name":null,"purl":"pkg:github/deadronos/RobotSpaceBattler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deadronos%2FRobotSpaceBattler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deadronos%2FRobotSpaceBattler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deadronos%2FRobotSpaceBattler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deadronos%2FRobotSpaceBattler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deadronos","download_url":"https://codeload.github.com/deadronos/RobotSpaceBattler/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deadronos%2FRobotSpaceBattler/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31364577,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-03T15:19:21.178Z","status":"ssl_error","status_checked_at":"2026-04-03T15:19:20.670Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-11-16T16:04:08.078Z","updated_at":"2026-04-03T17:00:58.589Z","avatar_url":"https://github.com/deadronos.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Space Station Auto-Battler (Prototype)\n\nA 3D team-vs-team auto-battler simulation built with React, TypeScript, and Three.js.\n\n![Space Station Auto-Battler](public/image.png)\n\n## Overview\n\nThis project simulates a battle between two teams of 10 humanoid robots (Red vs Blue) on a space station arena. It features:\n\n- **Autonomous AI**: Robots use NavMesh pathfinding, behavior blending, and state machines for\n  intelligent navigation and combat.\n- **NavMesh Pathfinding**: Obstacle-aware navigation using A* search on polygon meshes with path\n  smoothing and caching.\n- **Behavior Blending**: Priority-based weighted blending of pathfinding, combat, and retreat\n  behaviors for smooth concurrent AI.\n- **Physics**: Powered by Rapier physics engine via `@react-three/rapier` for realistic movement and collisions.\n- **ECS Architecture**: Uses `miniplex` for efficient entity management.\n- **Visuals**: React Three Fiber renderer with shadows, lighting, and instanced visual effects.\n- **Procedural Generation**: Arena and robot meshes are procedurally generated (placeholder visuals).\n\n## Getting Started\n\n### Prerequisites\n\n- Node.js (v18+ recommended)\n- npm\n\n### Installation\n\n1.  Clone the repository.\n2.  Install dependencies:\n    ```bash\n    npm install\n    ```\n\n### Running the Simulation\n\nStart the development server:\n\n```bash\nnpm run dev\n```\n\nOpen your browser to `http://localhost:5173`.\n\n### Other Commands\n\n- **Build**: `npm run build` - Builds the project for production.\n- **Preview**: `npm run preview` - Serves the production build locally.\n- **Lint**: `npm run lint` - Runs ESLint.\n- **Format**: `npm run format` - formats code with Prettier.\n- **Test**: `npm run test` - Runs unit tests with Vitest.\n- **E2E Test**: `npm run playwright:test` - Runs end-to-end tests.\n\n## Project Structure\n\nThe codebase is organized in `src/` as follows:\n\n- **`components/`**: React components for the UI and 3D scene (React Three Fiber).\n- **`ecs/`**: Entity Component System definitions (World, Systems, Entities).\n- **`lib/`**: Utility libraries (Math, Random, Constants).\n- **`runtime/`**: Simulation loop and state management logic.\n- **`simulation/`**: Core game logic (AI, Pathing, Combat rules, Arena geometry).\n- **`state/`**: Global application state (Zustand stores, Quality settings).\n- **`visuals/`**: Visual managers (Instancing, Particle effects, Renderer stats).\n\n## Key Technologies\n\n- **React** + **TypeScript**: UI and logic.\n- **React Three Fiber (@react-three/fiber)**: 3D rendering.\n- **Rapier (@react-three/rapier)**: Physics engine.\n- **Miniplex**: ECS library.\n- **Zustand**: State management.\n- **Vitest**: Unit testing.\n- **Playwright**: E2E testing.\n\n## Pathfinding System\n\nThe NavMesh pathfinding system enables robots to navigate around obstacles intelligently:\n\n### Features\n\n- **A* Path Search**: Optimal path finding on polygon-based navigation meshes\n- **Path Smoothing**: Funnel algorithm and path optimizer reduce waypoint count by ~40%\n- **LRU Caching**: Frequently requested paths cached with 60s TTL (\u003e70% hit rate)\n- **Behavior Blending**: Concurrent AI execution with weighted blending (retreat \u003e combat \u003e\n  pathfinding \u003e idle)\n- **Performance**: \u003c5ms P95 path calculation, \u003c16ms for 20 robots, \u003c5MB memory\n\n### Architecture\n\n- `NavMeshGenerator` - Converts arena geometry to walkable polygons\n- `AStarSearch` - Optimal path finding algorithm\n- `PathOptimizer` \u0026 `StringPuller` - Path smoothing and simplification\n- `PathfindingSystem` - ECS integration for per-robot path management\n- `BehaviorBlender` - Priority-based weighted blending of AI behaviors\n\n### Debug Visualization\n\nUse `NavMeshDebugger` and `PathDebugger` components to visualize:\n\n- NavMesh polygon structure (wireframe overlay)\n- Active robot paths with waypoint markers\n- Real-time path calculations\n\nSee `src/visuals/debug/` for implementation details.\n\n## Documentation\n\nThis codebase is fully documented with JSDoc comments. You can inspect any function, class, or\ninterface in your IDE to see detailed descriptions of its purpose, parameters, and return values.\n\n## Spec Kit (AI-assisted spec \u0026 implementation)\n\nThis repository is compatible with the GitHub Spec Kit workflow. For a quick introduction and\nto get started see the Spec Kit get-started guide:\n\n[Spec Kit: Get started](https://github.com/github/spec-kit?tab=readme-ov-file#-get-started)\n\nAvailable Slash Commands\n\n| Command | Description |\n|---|---|\n| /constitution | Create or update project governing principles and development guidelines |\n| /specify | Define what you want to build (requirements and user stories) |\n| /clarify | Clarify underspecified areas (run before /plan unless explicitly skipped) |\n| /plan | Create technical implementation plans with your chosen tech stack |\n| /tasks | Generate actionable task lists for implementation |\n| /analyze | Cross-artifact consistency \u0026 coverage analysis (run after /tasks) |\n| /implement | Execute tasks to build the feature according to the plan |\n\n## Pull Request Templates \u0026 Contributing guidance\n\nTo keep changes aligned with the project's constitution and review expectations, we maintain\nmultiple PR templates under `.github/PULL_REQUEST_TEMPLATE/`. When opening a PR, pick the\ntemplate that best matches the change:\n\n- `feature.md` — new features, user-visible changes, and behavior additions.\n- `bugfix.md` — fixes for defects and regressions.\n- `chore.md` — maintenance, dependency updates, infrastructure, and cleanup work.\n\nEach template contains a required `CONSTITUTION-CHECK` section. Complete this section with\nconcrete evidence of compliance (file paths, LOC decomposition plan if any file exceeds\n300 LOC, TDD/test evidence, r3f/rendering notes, and any agentic-AI approvals). The CI\nworkflow will validate that a `CONSTITUTION-CHECK` section is present and will post an\nauto-generated draft comment listing changed files and suggested decomposition steps.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeadronos%2Frobotspacebattler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeadronos%2Frobotspacebattler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeadronos%2Frobotspacebattler/lists"}