-
Notifications
You must be signed in to change notification settings - Fork 106
Tool swing animations #1918
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Tool swing animations #1918
Conversation
I made a PR almost exactly like this a while ago, we decided against it in favor of having data-based animations. |
I can probably add that as a feature, maybe with .swing_animation = .{
.pos = .{x, y, z},
.rot = .{x, y, z},
.speed_multiplier = x,
} example pickaxe.zig.zon .{
.blockTags = .{.mineable},
.disabled = .{
0, 0, 0, 0, 1,
0, 0, 0, 1, 1,
0, 0, 0, 1, 1,
0, 1, 1, 0, 1,
1, 1, 1, 1, 0,
},
.optional = .{
1, 1, 1, 1, 0,
1, 1, 1, 0, 0,
1, 1, 1, 0, 0,
0, 0, 0, 1, 0,
0, 0, 0, 0, 0,
},
.parameters = .{
.{
.source = .massDamage,
.destination = .damage,
.matrix = .{
2.5, 2.0, 1.5, 1.0, 0x0,
2.0, 1.5, 1.0, 0x0, 0x0,
1.5, 1.0, 0.5, 0x0, 0x0,
1.0, 0x0, 0x0, 0.1, 0x0,
0x0, 0x0, 0x0, 0x0, 0.1,
},
.factor = 1.0,
.method = .average,
},
.{
.source = .hardnessDamage,
.destination = .damage,
.matrix = .{
0.0, 0.0, 0.1, 0.1, 0x0,
0.0, 0.1, 0.0, 0x0, 0x0,
0.1, 0.0, 0.0, 0x0, 0x0,
1.0, 0x0, 0x0, 0.0, 0x0,
0x0, 0x0, 0x0, 0x0, 0.0,
},
.factor = 1.0,
.method = .average,
},
.{
.source = .durability,
.destination = .maxDurability,
.matrix = .{
0.5, 1.0, 1.0, 1.0, 0x0,
1.0, 2.0, 1.5, 0x0, 0x0,
1.0, 1.5, 1.5, 0x0, 0x0,
1.0, 0x0, 0x0, 1.0, 0x0,
0x0, 0x0, 0x0, 0x0, 0.5,
},
.factor = 1.0,
.method = .average,
},
.{
.source = .swingSpeed,
.destination = .swingSpeed,
.matrix = .{
0.1, 0.5, 2.0, 2.5, 0x0,
0.5, 1.5, 0.5, 0x0, 0x0,
2.0, 0.5, 0.1, 0x0, 0x0,
2.5, 0x0, 0x0, 0.1, 0x0,
0x0, 0x0, 0x0, 0x0, 0.1,
},
.factor = 1.0,
.method = .average,
},
},
.swing_animation = .{
.pos = .{-0.1, 0.0, 0.2},
.rot = .{-0.2, -0.1, 0.0},
.speed_multiplier = 1,
}
}
Keyframed animations are also likely possible, but I feel that might be overcomplicated for a simple animation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel that we should get rid of Undertime mining before continuing, as it's been proven to look awkward and will be replaced with a better system in the future anyhow. |
Do you mean we should go completely away from damage per swing or what? |
Added animations for mining / breaking blocks, scales with the tool's swing speed.
Could also have animations be data driven in the asset files.
Screencast_20251007_205040.online-video-cutter.com.mp4
PS: new to both Cubyz & Zig, so this may not be implemented in the best way / place.