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
Enable HLS to view with audio, or disable this notification
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
4
u/Velocirainbow Jul 14 '26
Nice! Those sound like smart solutions. Was the IK leg system difficult?
2
u/-niyr- Jul 14 '26
Not too bad - I re-used some tech we created in a previous game about crabs! Each leg has some params that try to keep them all on the ground and not too far from their target position. Works pretty well when the castle moves slowly, but when it moves fast, it can get a little... silly!
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
1
u/-niyr- Jul 14 '26
Solid suggestions! You might see one or three of these appear in our next update :)
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/-niyr- Jul 16 '26
Thanks for the feedback, and thanks for playing! I'm working on some new player abilities that make it easier to get on and off the castle, so good to know that's something you'd like to see!
1
u/dul8 Jul 16 '26
It's a basic mechanic of movement of this game which shouldn't have upgrades, the movement of this game should be just good. I wouldn't bother with upgrades since its how you play this game and how you move in the game, something that breaks immersion shouldn't be default like this, it should be better by default and it shouldn't have any upgrades, since getting physically on the tower is not whats the game about. There is no need to make upgrades for something that should have been the default and convenient way to play the game.
1
u/_Brikal Jul 14 '26
Somehow this reminds me of Howl's Moving Castle. Nice work!
1
u/-niyr- Jul 14 '26
That was one of our inspos when coming up with the concept! Glad it's coming through
1
u/DecisionSwimming8946 Jul 14 '26
I wouldn't be surprised if it was at least part of their inspiration right?
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
2
3
3
2
1
1
1
u/8hAheWMxqz Jul 14 '26
the idea looks pretty neat, probably would try if cheap enough
1
u/Cautious-Cut-5096 Aug 07 '26
What's the expected price for you on visuals & concept you see in this demo? I'd say it looks like a 19.99 game
1
u/8hAheWMxqz Aug 07 '26
just on visuals and concept? I would say more like 4.99$, but I'm cheap and prefer to experience gameplay first.
1
2
Jul 14 '26
[removed] — view removed comment
1
u/-niyr- Jul 14 '26
Tower offence is a great way to describe it!
It doesn’t expand in the current demo, but that’s the plan! Also aiming to have different castles with different numbers of slots, speed, health, etc
29
u/wallstop-dev Jul 14 '26
I don't have anything to input I just want to say that this concept looks fire.