r/Unity3D • u/-niyr- • Jul 14 '26
Game Jam A tower defence base that walks (procedural IK), takes per-leg damage, and kneels when it's hurt
I'm prototyping Stoneheart Archive - a survival tower defence where the base is a giant walking castle. The castle movement tech turned out to be half the fun, so here's how it works:
The castle moves on a procedural IK leg system. When a destination is set, we generate a spline to it, and the castle follows the spline, rotating to establish a "forward" direction, and forward can be either end of the body, so instead of a building-sized creature doing a hundred-metre three-point turn, it just re-designates which end leads and walks.
Each leg takes damage individually, with chunks flying off as it degrades. When a leg passes its damage threshold, the castle stops moving and kneels. Enemies suddenly have a stationary target, and you're sprinting around under a wounded castle doing field surgery on its legs while the waves close in.
A problem I hit pretty quickly: the player climbs the castle via a ladder - on a body that is always moving and rotating. And when you're underneath the castle repairing legs, its own body occludes your character. The visibility half I solved with outline shaders, although it can look a bit messy. The boarding half - I parent the player to the castle's transform on ladder contact, made the ladder collider pretty generous, and then run the character controller in castle-local space while riding on top.
My question for the experts here: how do you handle character controllers on large platforms that move and rotate?
Here’s the demo if you want to give it a play:
https://chaostheorygames.itch.io/stoneheart-archive
29
u/wallstop-dev Jul 14 '26
I don't have anything to input I just want to say that this concept looks fire.
4
u/Velocirainbow Jul 14 '26
Nice! Those sound like smart solutions. Was the IK leg system difficult?
2
u/Mechabit_Studios Jul 14 '26
I would add an extra joint on the legs so that when it's on the ground the contact point isn't rotating as it walks, also add some dust or foot prints to really sell the size and weight of the thing
2
u/dul8 Jul 16 '26
Climbing is something that you have to do over and over throughout the game, it destroys immersion, It would be better remove it and make it so that when you are close to the tower you can just click a button and appear on tower, same for appearing on the ground from tower. It doesn't have to be logical and real. It's something to think about. Other than that its awesome 👍
1
u/_Brikal Jul 14 '26
Somehow this reminds me of Howl's Moving Castle. Nice work!
1
u/DPTGames Jul 14 '26
This is neat, maybe you could do an upgrade that lets you board from anywhere using a grapnel or magic teleporter
3
u/CouchLasagna Jul 14 '26
Awesome
3
u/Mendigo0447 Jul 14 '26
wow :o
2
u/mikmoniks Jul 14 '26
Cool work
1
u/Ok_Fisherman_7931 Jul 14 '26
woow, looks very good ))
1
u/Important_Evidence53 Jul 14 '26
I thought for 2 seconds it is a clash of clans scenery
1
u/8hAheWMxqz Jul 14 '26
the idea looks pretty neat, probably would try if cheap enough
1
u/otakugodxx12 Jul 14 '26
Reminds me of cnc 4 crawler
2
u/[deleted] Jul 14 '26
[removed] — view removed comment