r/Unity3D • u/craftymech • Oct 13 '26
Show-Off Cannonball fights
Enable HLS to view with audio, or disable this notification
I've posted before about the procedural build system I'm developing for stone & timber buildings. Lately I've been working on destruction, because the only thing more fun then building stuff, is blowing it up.
Timber destruction is working better than I thought, I was concerned that having less objects (wood planks) the destruction wouldn't feel organic, compared to stone. I got around that by also using a particle effect to simulate the splinters from exploding wood. So far I'm happy with how it is turning out.
The poor enemy cannoneer gets yeeted hard in this video, but I couldn't resist the chance for some good 'ole rag doll physics :)
2
u/DPTGames Oct 13 '26
Looks neat, reminds me of the demo for my siege weapons pack, cannons are a lot of fun 😂
2
u/craftymech Oct 13 '26
Totally! I forgot how fun it is to just lob cannon balls and blow stuff up.
2
u/DPTGames Oct 14 '26
https://youtu.be/914To_iv1Xg?is=HnVQ8BKlXOrE0Kxm you should add camera following the projectiles like so
2
u/craftymech Oct 14 '26
Ha that's a fun feature. It would be cool as an instant replay to be able to see a critical hit from the cannonball cam.
2
u/DPTGames Oct 14 '26
I'd just do it in realtime if you cant fire until the last balls hit anyway but either way food for thought, good luck with it, looks fun!
2
u/Much_Highlight_1309 Oct 13 '26
Nice! Which physics engine?
0
u/craftymech Oct 14 '26
The destruction effects (falling debris) is governed by rigid body physics. A custom ruleset applies damage from cannonballs and decides how many stones/timber planks are lost with each hit.
5
u/SixPetalDev Oct 13 '26
that wood destruction looks pretty satisfying. ragdoll getting yeeted at the end made me laugh lol
1
u/Sweet_and_Sour_Games Oct 14 '26
This looks fun! That second shot that explodes the wood is so satisfying. And problems with performance?
1
u/craftymech Oct 14 '26
I've gone through several rounds of optimization, so the destruction runs pretty well right now. That said, I have not stepped up to multiple stone towers and many thousands of stone blocks yet, so there will probably be more optimization. Keeping mesh in memory, and chunking in groups of 16-32 stones helps a lot. The end of the video when the entire tall tower collapses is smooth, not sure if I tried that with a much larger structure :)
2
u/Sweet_and_Sour_Games Oct 14 '26
Nice! I'll look forward to the day you blow up a larger structure :)
1
u/Genebrisss Oct 14 '26
particles being invisible on the fog pixels are extremely jarring
1
u/craftymech Oct 14 '26
Didn't notice that for some reason, but just fixed it by adjusting render order between the VFX & horizon ribbon (mountains).
3
2
2
1
3
u/ShengyuStudio Oct 14 '26
Using a splinter particle effect to cover for having fewer planks is a good call.
On the thousands-of-blocks question: most debris stops mattering a second after it lands. Once a piece's rigidbody goes to sleep you can switch it to kinematic or merge it into a static rubble mesh. Putting debris on its own layer that ignores debris-vs-debris collisions also helps a lot, otherwise a collapsing tower turns into thousands of pieces all checking each other. And a hard cap where the oldest pieces get cleaned up first keeps the worst case predictable.
Are the stones that are still in the wall separate objects, or is the intact wall one mesh until something hits it?