Tuesday, April 16, 2024

Simple They Said... Simples...

The plan for yesterday was a simple one. Just get ability-use to cost the right amount of each pool, and deduct it from whoever uses it. That should be a simple way back into the code, right? Right?

So.... No. I spent a solid few hours working back through my code to find the right place to trigger that, which was surprisingly a lot more complicated than you'd think. Do I do it when the monster is *thinking* about doing it? No, that's clearly a bad place to do it, what if they move before they use the ability? That's going to be dumb. Should I place it at the time that the ability is technically used? That's also kind of dumb, cause the animations have already happened... (to make it seem like things happen in the right order, animations are done first, THEN the actual attack is applied, though the outcome is already known at that point - but I'm getting really into the weeds of the code here). So, clearly, I need to add in another possible step to process in the combat-sequence which is to apply the cost of using an ability, so that it all appears to happen in the right sequence:

Plan - > move -> animate actions-> apply ability cost -> determine outcome [any following animations/actions/etc here]

After getting through most of the code, I _almost_ got it working last night, which included going back into editor code fixing that so that it was saving my inputs correctly, tweaking the code in the app that imports that section of combat abilities and finally, this morning, to tweaking a few statements to turn them from integer to floating point operations (cause... goddamit... why can't you do that automatically for me Java) and I finally got the satisfaction of seeing a spider throw out some sticky webs at the players, and its action bar went down as it should.


Monday, April 15, 2024

Ladies and Gentlemen...

It is with great pleasure that I can inform you that I'm back in the code.

A combination of things has kept me from working on the game for a good few weeks, but primarily that I just needed to have a break - a break from work would have been awesome too, but that's another story.

So, it's been a mentally refreshing good few weeks. I've not completely stopped, but have done very very little in that time. This evening, I got back in and picked back up where I'd left off. Didn't get a lot done, didn't have a lot of time to do it, but also needed to remember what I was working on, how it was all working and what I needed next.

So, I've tweaked the monster code to pick abilities, getting it closer to where it needs to be - monsters can now have a bit more smarts with what abilities they try to use when in combat.

Anyhow, the plan for tomorrow is to hopefully get back in and make abilities use the right mana/action/whatever so that there is the right cost to them.

Wednesday, January 31, 2024

Abilities and Effects Work Continues

It has been a pretty quiet week in the grand scheme of things, but I needed a bit of a break - and I've gotten that in rather well. It's not been a complete write off in development terms though! I've been chipping away at the various bits of code to make abilities do all the things I want - and I'm proud to say, I've actually FINALLY gotten to making creatures use abilities.

I've added a lot of functionality to how abilities work, added in the various target/directional and shape code (I still need to add in cone shaped effects) which amusingly got me to look up some math formulas I've not needed to look at since school days!

I'm currently working on the code that lets a creature decide what abilities to use in what circumstance, and how they play into the general things it does in combat. I've had to change things up a good bit to achieve all that, and it's not entirely finished yet, but I think I'm on the right path in that regard. As always, that means I'll need to circle back to quite a few editor screens to add in the new fields that I've come to need, but that's easy work in the end, even if it is rather droll.

Tuesday, January 16, 2024

Burning the Midnight Flaming Oil

Late in the evening last night, I wasn't quite ready for bed, so whipped out the code to get working on more things with Abilities. Months ago, when I was chatting with my mates, Nath in particular detail, about how abilities could work - and on the topic of if abilities that target an area, I was torn between "they hit EVERYTHING in that space, friend or foe" and "when you do damage, you don't hit your guys, when you heal, you don't heal monsters!". Nath made the glaringly obvious comment that I'd missed. Why not a little of column A and a little of Column B - meaning have some abilities that are indiscriminate, and others that are smarter - so last night I finally got around to implementing that.

So, some abilities will be quite basic, hitting anything within the target area, some will stop splash damage to allies, and not heal monsters and some will fall in between, with a chance of adverse effects per target in the area. This will mean that often, as your characters ability levels improve, they'll be able to use abilities with much more efficiency, and that those abilities will be able to be used in completely new ways!

Monday, January 15, 2024

Ranged Attacks & Abilities and Character Stats

Last night, I got some really good coding time in, sorting out some code for abilities (yay!) finally. Abilities that are delivered by a Ranged Attack, so things that will tack onto an arrow shot from a bow or something like that, now have the range of that weapon applied correctly. So the longer the range on your weapon, the more distance you can cover using that ability, so good weapons will be really valuable to the right characters.

Additionally, I got to fixing up the character screens, which meant also working out all the stats that will be needed. I've got a bunch of these already there sitting in the background, but having them properly displayed, so I can check them quickly and easily is great. I'll still have to do a landscape layout, but I'll work with this for a bit, work out what I've missed and then fix it up before making the landscape version.

Sunday, January 14, 2024

Memory Management Mayhem

As I was testing the app, I noticed that as I'm making many changes to streamline how it uses memory and tweaking processes, the app was still starting running nicely, then slowly degraded over time. So, on Friday, I got into "fix-it" mode, started running various tests and profiling the app to see what was going on.

First up, I found out that by placing nice backgrounds on the login and landing pages, I was using up 70 megabytes (no, really, seventy megabytes) of Androids small allotment of memory to show these as the Activity was sort of sitting there off-screen somewhere. So, that got resolved to only show the images when the Activity was visible. Bam. Seventy memory back thanks!

Next up, turns out that following some basic docs on how to show/create Activities (or, in game terms, how to open up a character screen, inventory and skill trees) actually causes memory leaks, which is a terrible way of saying that the meagre memory you start with is getting wasted on more trash that's not needed. That one was quite a bit harder to fix, as it needed a reasonable re-write of the was I call certain activities, but also changing notification methods completely (or again, in game terms - when you picked up an item from monster loot, it needed to move the icon from the "loot" pile, into the "Inventory" pile. Wham, no memory leaks.

Finally, testing again.

The Android emulator I have still seems to be doing a lot of pause-y stuff, but I gave it a run on my actual phone... and it ran smooth as smooth can be. Glorious success. I'll do more testing, but I am really really happy and confident that this is squarely back in the fast lane now.

Wednesday, January 10, 2024

Conversations and Early Layouts Polished

I got a bit side tracked with some code this evening, but am, really happy with the outcome. I have been meaning to circle back to some of the earliest layouts I've done and tweak and polish them up a bit, so today I ended up doing that instead of what I was planning to do. There were a good few various bug fixes along the way, but the main output is that conversations now happen looking a lot neater than they were before. There's no more horrid title bars in the screen (that's gone from a number of layouts now) but additionally there's a different layout for portrait and landscape modes which looks a lot better than it did before. Additionally, I've tweaked the way NPC images are processed, so the images will be proper art, rather than pure pixel-characters. It's both more and less work in different ways, but it certainly looks better than some of the early NPC images I'd been able to create/purchase.

Simple They Said... Simples...

The plan for yesterday was a simple one. Just get ability-use to cost the right amount of each pool, and deduct it from whoever uses it. Tha...