What have I been doing for the past three days?
The [expletive] strategy adjustment interface. This consumed approximately 30 hours and around 700 lines of code. Why, you ask? It looks so simple. Exactly! Making it look intuitive and reasonably straightforward involved burying 40+ different methods to ensure the system didn’t collapse, and that all boundaries worked correctly.
This is already the third iteration of this system. Initially, there was a placeholder that allowed players to reorder attacks without modifying the dice result ranges. Then I tried adding functionality for increasing or decreasing the ranges, but no matter how hard I tried, it always felt counterintuitive and overloaded. Perhaps I could have stopped there—if it weren’t for the road of endless bugs.
For example:
- If you increased the range of the first attack by 1, the second attack’s range would decrease by 1, or if it couldn’t decrease, the third attack would be reduced, and so on.
- Then, let’s say you want to increase the range of the third attack. The system would search for the only viable option—reducing the enormous first attack's maximum.
- Now, you want to increase the fourth attack. Which attack should decrease? The neighboring third one or the oversized first one?
And don’t even get me started on bugs with minimum values. I had set a barrier at 12 to prevent further increases, but somehow, the attack would still expand to 14. Or occasionally, the minimum dice value for triggering an attack could end up higher than the maximum dice value. 🤦♂️
I blame my inexperience—it’s my first game, after all—but the problem wasn’t just in the code. Sometimes buttons would register multiple clicks in quick succession, queueing actions and bypassing boundaries. Sometimes drag operations would work with a delay. UI systems are just a pain. Thankfully, as it turned out, I was using an outdated version of Unity, and updating it fixed a lot of issues.
Then came the breakthrough: the idea to represent the attacks as segments on a line. What I wasn’t ready for, though, was Unity outright refusing to cooperate. Thankfully, I managed to wrestle it into submission and establish some understanding.
Right now, the interface looks ugly, but I didn’t have the time to polish it. For the past three nights, I’ve been doing nothing but working on this [expletive] interface. If anyone’s curious, I can share the four scripts I wrote, rewrote, rewrote again, rewrote with ChatGPT, and then rewrote one last time. 😅
New Features:
- Strategy changes now cost tactical points (TP).
- The cost for adjusting attack ranges grows exponentially the further they deviate from the standard width.
- Reordering attacks is relatively cheap because it doesn’t provide as much benefit as you’d think and is something players often want to use on enemies.
What’s left?
- Figuring out how to replenish TP (tactical points) spent on strategy changes.
- Sprucing up the interface—adjusting sizes, adding drag-and-drop sounds, and making it look decent.
- After that, I can finally set this system aside and call it done (for now).
- Then, I can move on to designing the next enemy… or maybe even a boss. 😊
Files
Get D12Dungeon
D12Dungeon
Status | In development |
Author | Fritzenko |
Genre | Role Playing |
Tags | Dungeon Crawler, Pixel Art, Roguelite, Turn-based, Turn-based Strategy |
Languages | English |
Leave a comment
Log in with itch.io to leave a comment.