Entry 70 with UI-ness

Costy tooltipness

It’s now time to describe some of the fluffy UI stuff that I’ve been fiddling with. In this case — tower upgrade and transform costs. Towers can be upgraded to level 2 and then level 3. Towers can also be transformed to their possible “transform-buddies”.

It sounds nice and straight-forward to just print the numbers and forget about it. But I do have to not only draw them in tooltip, but also check if the player has enough before actually upgrading and deduct everything correctly. A little lack¬† of forethought last year and it’s essentially a tiny mess of arrays and numbers to deal with.

But I digress, here’s a tooltip for upgrading a tower (ignore missing button icon):

Same way, here’s a tooltip for upgrading:

Now the semi-tricky bit is that it’s also possible to first upgrade, then transform and first transform then upgrade. So if I have a level 1 inferno tower and level 2 earth tower, they need to upgrade/tranform with according costs. So here’s transforming level 1 inferno:

And here’s transforming level 2 earth tower:

I have purposefully kept the costs at 10 per essence and 50 wood for a “single” upgrade/transform (except 100 wood to build initially). This way, it doesn’t matter how you build them — upgrade first of transform first — the end costs are the same and no exploits are available.

Such a simple thing but you’d be amazed just how much tedious crap one has to go through from button controls and¬†correct essence type indexes to tooltip rendering and positioning all the text and sprites…

Another UI nicety is that it shows insufficient resources in red. This way the player doesn’t have to guess what exactly was wrong with their attempt to build.

Progressive progress bar

Then there’s the upgrade bar:

“But shouldn’t there be a cancel button?” you ask. Oh yeah… so more fiddling with adding the spent resources back. It’s easy to cancel upgrading and new tower building; it’s a bit trickier reverting tower transform — after all you can be building the same tower in multiple ways.

Progression limitation

Finally, what about towers that are not yet available to the player (due to level progression)? Now that’s a little tricky, but thankfully (for now) this only needs a change in tower transform button choices:

Here, only ice tower transform is available to the water tower and not the other 2.

So there you go. Essentially, I added a couple buttons and a couple labels making stuff that is expected there anyway. Yet it takes a scorching day to do. It’s probably my fault for making everything object-orienty and dynamic. I can have 1000 or 10 towers equally fine with all these systems. Yet I’m not 100% sure it was worth it for 14 towers. I guess I expected more towers/sprites to eventually be there. But gamedev is a fickle bi… umm.. cruel mistress.

This entry was posted in Uproot DevDiary.

Leave a Reply

Your email address will not be published. Required fields are marked *