Mods / LibATex
Author: nanotect
Side: Client
Created: Jul 18th 2024 at 9:58 PM
Last modified: Aug 25th at 7:31 PM
Downloads: 1899
Follow Unfollow 36
Latest release (for Vintage Story 1.21.0, potentially outdated):
libatex_0.7.0.zip
1-click install
LibAnimatedTextures
Introduction
LibATex provides functionality to allow mod developers to add animated textures to Vintage Story. Does nothing if no other mods make use of this functionality.
By replacing the animated textures at runtime, your mod is guaranteed to keep displaying the correct textures if this mod fails or is not installed.
Currently untested on GNU+Linux and MacOS, but should work
To get started:
- Just make blocks / models / textures as you would otherwise
- Add animated versions of the textures you want to animate
- Create a configuration file to define your animations
- Enjoy!
Features (WIP)
Currently implemented:
These features are currently implemented and working
- Animated textures (O tested - functional)
- Replace any texture with an animated version
- Support for blocks, entities and items
- Partial animations (O tested - functional)
- Apply small animation frames to only part of a texture, instead of the entire texture
- Allows for smaller animations for accent animations
- Examples: eyes blinking, candles flickering
- No-code JSON configuration (O tested - functional)
- Add animations by simply adding textures and a config file to your own mod
- Allows for non-programmers to use animated textures
- Time-based Animations (O tested - functional)
- Sets the animation frame based on the current time of day
Planned features
These features are planned to be implemented in a future update
- Animation manipulation through C#
- provide custom textures that are rendered onto by the caller
- allow the starting, stopping, and general configuration at runtime through code
- sample renderer / shader combo for shader-based animations
- Github repo coming
- feature requests welcome!
Potential features
These features might be implemented, or may stay as ideas
- Periodic animations
- Wait for a specified amount of time in between animation loops
- Periodic random animations:
- Same as periodic animations, but waits a random time between tmin and tmax between loops
Configuration
To enable animations in your mod, add an animatedtextures.json to your assets/config/ folder (the name has to be exact) with a configuration object supporting the following options:
These options apply to the animations of this mod as a whole
AllowsOverriding:Determines whether or not other mods are allowed to overwrite your textures (animated or otherwise) with their own animated textures. Defaults totrueAnimations:An optional array of individual animation configuration objects. See the required, alternate and optional options below for valid options.
Notes:
- Mods that don't use animated textures but also don't want their textures to be animated by other mods can set the "AllowsOverriding" option to false, and then leave the "Animations" option blank to disable other mods animating their textures
Animations: an array of configuration items containing the following options:
These options are required to create an animated texture
string AnimationPath:The assetlocation path to the animated texturestring TargetPath:The assetlocation path to the texture to animateint NumColumns:The number of frame columns the animation hasint NumRows:The number of frame rows the animation has
These options can be used as replacements for some of the required options.
string AnimationQualifiedPath:The qualified path to the animated texture, including domain and starting from thetextures/folder (supersedesAnimationModDomainandAnimationPath)string TargetQualifiedPath:The qualified path to the texture to animate, including domain and starting from thetextures/folder (supersedesTargetModDomainandTargetPath)
These options can be left out if not used
string AnimationModDomain:The domain of the mod that has the animated texture. Defaults to the domain of the mod defining this configstring TargetModDomain:The domain of the mod that has the texture to animate. Defaults to the domain of the mod defining this configstring AtlasType:The type of atlas the texture to animate belongs to ["block" | "item" | "entity"]. Defaults to "block"int NumFrames:The number of frames in the texture. Defaults toNumColumns * NumRowsint Priority:The priority this animation configuration takes over other animations targeting the same texture. Defaults to 0int PaddingX:The animated texture padding on the right side. Decreases the space used by the frames. Defaults to 0int PaddingY:The animated texture padding on the bottom side. Decreases the space used by the frames. Defaults to 0int TargetOffsetX:The partial animation X-offset within the target texture. Indicates the animation is a partial texture if not 0. Defaults to 0int TargetOffsetY:The partial animation Y-offset within the target texture. Indicates the animation is a partial texture if not 0. Defaults to 0float SecondsPerFrame:The time each frame should be displayed for (note: animations tick every game tick). Defaults to 1.0bool IsPartial:Indicates the animation is a partial animation. Useful if the target offsets are both 0. Defaults to falseTimeConfig TimeOptions:An object containing options for time-of-day based animations. If this object is present the animation will be treated as a time-based animation. See specific options below.
To make an animation time-based, add an object called "TimeOptions" to the root of that animation object with the following optional options:
float TimeMultiplier:A positive number the current time of day is multiplied with before being used for frame calculations. Defaults to 1.0float TimeOffset:A number from that is added after the multiplier, but before the frame calculations, used to offset the final time. Defaults to 0.0
Notes:
- As should be best practice, only textures with dimensions of a power of 2 are supported (e.g. 16x16, 32x32, ...)
- The animation manager 'ticks' at most every game tick
- Configuration assetlocation paths default to the domain of the mod defining the configuration file being read (e.g. "game:", "libatex:")
- Multiple animated textures cannot write to the same target texture, with the exception of partial animations. Use the Priority option to set animation precedence

{
"Animations": [
{
// a 2x2 animation with all files within this mod
"AnimationPath": "block/animation1",
"TargetPath": "block/target1",
"NumColumns": 2,
"NumRows": 2
},
{
// a 2x2 animation targeting a game texture that changes 2 times per second
"AnimationPath": "block/animation2",
"TargetPath": "block/soil/blueclay",
"TargetModDomain": "game"
"NumColumns": 2,
"NumRows": 2,
"SecondsPerFrame": 0.5
},
{
// a 4x4 animation with 10 frames
"AnimationQualifiedPath": "animatedmod:block/animation3",
"TargetQualifiedPath": "game:block/soil/fireclay",
"NumColumns": 4,
"NumRows": 4,
"NumFrames": 10
},
]
}
{
"AllowsOverriding": false,
"Animations": [
{
// a partial animation replacing the windmill of the banner texture with 4 frames
// the target region is 10x10 pixels with an offset of (11,12)
// we need to use a 32x32 texture, so 2px leftover at the right and bottom
"AnimationPath": "block/animation1",
"TargetPath": "game:block/cloth/banner/hansa/keys-top"
"NumColumns": 3,
"NumRows": 3,
"NumFrames": 4,
"PaddingX": 2,
"PaddingY": 2,
"TargetOffsetX": 11,
"TargetOffsetY": 12
}
]
}
{
"Animations": [
{
"AnimationQualifiedPath": "animatedmod:animated/blinking_face",
"TargetQualifiedPath": "game:entity/humanoid/trader",
"NumColumns": 3,
"NumRows": 3,
"PaddingX": 2,
"PaddingY": 2,
"TargetOffsetX": 10,
"TargetOffsetY": 14,
"AtlasType": "entity"
}
]
}
{
"Animations": [
{
"AnimationQualifiedPath": "libatexexamples:block/clock_animated",
"TargetQualifiedPath": "libatexexamples:block/clock",
"NumColumns": 4,
"NumRows": 4,
"NumFrames": 12,
"TimeOptions": {
}
}
]
}
Note about time-based animations; the time of day is represented as a percentage, i.e. a number from 0.0 to 1.0, in order to accomodate different hours per day configurations.
Each frame is spaced evenly across the day, so an animation with 4 frames would receive 6 hours per frame, or 3 hours per frame with a multiplier of 2.0 for example.
| Mod Version | For Game version | Downloads | Released | Changelog | Download | 1-click mod install* |
|---|---|---|---|---|---|---|
| 0.7.0 | 174 | Aug 25th at 7:31 PM | libatex_0.7.0.zip | 1-click install | ||
|
Updated for .NET8 / Vintage Story 1.21 | ||||||
| 0.6.0 | 1125 | May 25th at 7:30 PM | libatex_0.6.0.zip | 1-click install | ||
|
Added time-based animations | ||||||
| 0.5.1 | 271 | Mar 30th at 3:35 PM | libatex_0.5.1.zip | 1-click install | ||
|
Fixed an issue that prevented partial textures from loading | ||||||
| 0.5.0 | 204 | Jul 27th 2024 at 3:51 PM | libatex_0.5.0.zip | 1-click install | ||
|
First alpha version - changes and bugs possible | ||||||
If I ever finish my texture pack, I'm using the absolute frick out of this, thoughtfully and sparingly, with purpose.
How to get started actually. As for what I wanted to do, something like this...
DilanRona there are some sample configurations that should help you get started all the way at the bottom of the description. I am also working on a small sample mod. Are there any specific things you'd like to see examples of?
Could you please provide a small sample config file, and a small mod to demonstrate it in action, please?
This is amazing! Thank you so much for making this, it's making me inspired to make something now... :O
My disappointment upon finding out this was not a mod to type formatted math equations into chat was immeasurable
Thank, for this mod, Tyron maybe have his own reason why he don't want add 2D animation to this game. I love particle animation but sometime I prefer using 2d anim, and of course I think, that lack of 2d animation was reason why still we don't have even simple connected textures like this from Chisle Team for MC. I hope you will continue updating your mod and maybe some day you will make first full ClientSide only CTM :)
I've been waiting for this! It sounds like optifine on minecraft.
This is an amazing utility, thank you so much for your hard work!