verekia-architecture
Installation
SKILL.md
Architecture
The core principle of R3F game development is separating game logic from rendering. React components are views, not the source of truth.
Systems vs Views
Systems contain all game logic:
- Movement, physics, collision detection
- Spawning and destroying entities
- State mutations (health, score, timers)
- AI and behavior
- Syncing Three.js objects with entity state
Views (React components) only render:
<PlayerEntity>,<EnemyEntity>wrap models withModelContainer, process any data needed and pass it as props to the model<PlayerModel>,<EnemyModel>are dumb and only render meshes via props- They don't contain core game logic, just visuals logic
Related skills
More from verekia/r3f-gamedev
smooth-interpolation
Animate values smoothly using exponential decay instead of linear interpolation.
12ui-useframe
Sync UI elements outside the Canvas with the render loop using R3F v10's external useFrame.
8r3f-setup
Set up a React Three Fiber project with WebGPU support.
7reactive-polling
Poll for changes to any value and trigger React re-renders when it changes.
7miniplex
Use Miniplex for minimalistic Entity Component System with TypeScript support.
6bone-attachment
Attach meshes to bones of a skinned mesh, such as attaching a sword to a character's hand.
6