Migrates existing GDD and engine design notes from HacknPlan into a new Obsidian vault. This establishes a centralized, version-controlled knowledge base covering engine architecture, game constraints, design decisions, and open questions.
1.6 KiB
1.6 KiB
tags
| tags | ||
|---|---|---|
|
Rigid-Part Animation
Models are hierarchies of separate rigid meshes, with no skinning and no bones. See Decision Log#Rigid-part 3D on SDL_GPU.
Two sources of motion
- Authored clips. glTF supports node (translation, rotation, scale) animation without any skinning. Artists animate parts in Blender (a turret yawing, a barrel recoiling, legs swinging) and export glTF.
- The engine samples keyframes for each node, walks the node hierarchy and draws each part as an instance.
- Procedural overrides. C++ systems write to named parts after the clip is applied, for example turret aim toward the target, hit recoil, idle bob and death tumble.
Data
struct Model { // asset, see Assets
Vector<ModelNode> nodes; // parent index, local bind TRS, optional mesh + material
Map<StringId, UInt16> nodeByName;
Vector<Handle<AnimationClip>> clips;
};
struct Animator { // component
Handle<AnimationClip> clip; float time; float speed; bool loop;
Vector<glm::mat4> nodeWorld; // recomputed each frame
};
Per-frame order
- Advance clip time (on
SimClockfor gameplay entities, so it pauses and speeds up with the simulation). - Sample clip → local TRS per node.
- Apply procedural overrides by node name.
- Compute world matrices down the hierarchy.
- Push one instance per mesh-bearing node to the Rendering queue.
Later
- Vertex animation textures: if we need thousands of animated enemies.
- Skeletal skinning: only for a few bosses or heroes, as a separate milestone.