
BoneTown
An alternative entity rendering system for Minecraft Forge 1.15.2 that completely changes the approach to displaying models and animations in the game.
Main Features
- Support for skeletal animations
- Work with standard 3D model formats instead of the limited Minecraft format
- Animation and vertex calculations performed directly on GPU
- Modern GLSL shader pipeline
- Advanced animation blending system based on layers
- Animations as resources - mods can add animations for other mods' entities
- Extensible network protocol for automatic animation state synchronization
Supported Formats
Internally, the proprietary BoneTown model format (.bonemf) is used, specifically designed for simplicity and efficient rendering in Minecraft. Currently, conversion from FBX format is supported.
Advantages of the Approach
If you're a mod developer wanting to create entities using professional software and implement detailed animations without performance loss, BoneTown is an excellent solution.
The standard Minecraft rendering pipeline performs all animation calculations on the CPU and transfers data every frame. This works for simple models with low vertex counts but becomes problematic for complex models and animations.
BoneTown moves almost all calculations to the GPU. Model geometry is loaded to the graphics card only once, and only changing data is transferred each frame: lighting information, final positions, and animation bone data.
Limitations
Lack of Support for Custom Forge Armor
Although the bipedal model supports standard vanilla Minecraft armor, it's impossible to similarly support custom Forge armor models. Our bipedal model contains additional joints at elbows and knees, and armor animation also requires skeletal binding.
Incompatibility with Optifine
BoneTown introduces a new rendering pipeline that only partially uses the existing Minecraft system. Compatibility with Optifine is not guaranteed and is not a development priority.
Technical Implementation
BoneTown differs radically from vanilla Minecraft in three key aspects:
- Proprietary model format for data storage
- Rendering code that transfers data to GPU
- Representation of animations on server and client with their synchronization
Model Format
Models and animations are loaded from .bonemf files containing geometric and animation data. The format is inspired by Autodesk FBX but significantly simplified for Minecraft's needs.
Technical limitations:
- Maximum 100 bones per model
- 4 bone weights per vertex
- Only one skeleton per file
Rendering System
The new rendering pipeline transfers main model data only once, then loads minimal changes to display the model at a specific screen location. Data is transferred to the programmable pipeline instead of the legacy fixed functionality.
Animations
Unlike the vanilla system, animation data is stored directly on the entity. All entities using BoneTown renderers must implement the IBTAnimatedEntity interface and contain AnimationComponent.
Developer Guide
To study the implementation, it's recommended to familiarize yourself with the com.chaosbuffalo.bonetown.init
package for registering new assets, com.chaosbuffalo.bonetown.client.render
for analogs of vanilla classes, and com.chaosbuffalo.entity.TestZombieEntity
as an example of complete biped implementation.
Directory Structure
Animations: assets/modid/bonetown/animations
Models: assets/modid/bonetown/models
Registries
Four new registries have been added to manage additional assets:
- Materials (shaders for rendering)
- Models (static and animated)
- Additional animations
- Armor models