Animation system mostly done
This commit is contained in:
+19
-2
@@ -68,6 +68,10 @@ plain object mods can hook. See [Engine Access](modding/misc/engine.md). The cod
|
||||
chestplate on other players, wide and slim, and on the first person arm with its equip and swing.
|
||||
- Blockbench's `mirror` isn't supported in entity models, so the giant chestplate's left sleeve has the right one's
|
||||
texture unflipped.
|
||||
- With entity animators (see [Animations](modding/entities/index.md#animations)), switching from one state's clips to
|
||||
another's is instant, where Bedrock's controllers fade over their `blend_transition`.
|
||||
- Without an animator, the engine still poses bones named like a humanoid's (`head`, `right_arm`, ...). That belongs in
|
||||
the mods, and moves there once mods can share code with each other.
|
||||
|
||||
## Planned API
|
||||
|
||||
@@ -279,6 +283,21 @@ Worn items are drawn by `render_worn`, which puts an item's `worn` model on a pl
|
||||
- **Glint and glowing overlays**, as `glint` and a full bright `overlay_texture` in `worn`, once the renderer has a
|
||||
glint pass.
|
||||
|
||||
### Entity Animations
|
||||
|
||||
Clips and animators are built, see [Animations](modding/entities/index.md#animations). Still to come:
|
||||
|
||||
- **Events**, for one-off moments that aren't a state, like a roar. `MobRef.event(id)` sends an `entity_event` with a
|
||||
mod's id, and the animator gets `on_event?(id, time)`. `EntityEvent` becomes the engine's three or an id, so
|
||||
`PROTOCOL_VERSION` goes up. Nothing needs it yet.
|
||||
- **Sounds**, like a Bedrock clip's `sound_effects`, once client scripts can play a sound: an animator plays one when a
|
||||
state's seconds pass its time. The jester's crank, music, pop and scream are in lethal3's `jester.animation.json`.
|
||||
- **An importer**, `deno task import animation`, for whole Bedrock packs. It copies each file, leaves out the channels
|
||||
with Molang expressions, and lists them with a JS version for the animator: `math.cos` and `math.sin` take degrees,
|
||||
`query.life_time` is `time / 20`, `query.anim_time` is the clip's seconds, `query.modified_distance_moved` is
|
||||
`walk_position`, and `query.target_x_rotation` and `target_y_rotation` are `head_pitch` and `head_yaw`. It lists the
|
||||
animation controllers and client entity files as left for an animator to do, with their states.
|
||||
|
||||
### HUD, Keybinds and Mod Channels
|
||||
|
||||
- `ctx.hud.register(id, { on_render(g, hud) })` draws every frame after the world, under open screens. Built, see
|
||||
@@ -401,8 +420,6 @@ saved before any of this plays exactly the same.
|
||||
waits a round trip. Components could get optional handlers that clients run to predict.
|
||||
- **Engine access versions.** Tying engine access mods to one minor version is simple but strict.
|
||||
- **Game API versions.** Only breaking with the game's major version needs deprecation warnings and a changelog.
|
||||
- **Entities.** Mods can define simple animals, but there's no API for entity types with their own behavior, animations,
|
||||
or natural spawning.
|
||||
- **Hot reload.** Restarting the server and rejoining is the answer for now.
|
||||
- **Biome rules or multi-noise?** Biome sources are ordered rules, which kept the old biomes exactly, but mods inserting
|
||||
rules can step on each other in ways that are hard to see. Minecraft's multi-noise is easier to merge but would move
|
||||
|
||||
Reference in New Issue
Block a user