Monday, September 25, 2023

Render Engine Scaling Bugs Fixed

This afternoon, I cracked it with some bugs in the graphics engine when it was rendering creatures that were not a standard size. There was also an issue that had been nagging at me as it didn't appear that all animations were offset correctly, and I'd done a lot of work in the editor to make sure that they were spot on with the optimisation.

So, around two hours of bug fixes and the engine correctly displays all animations with the right offsets and so on, and secondly, it renders larger animated objects in the exact spot where I want to see them based on their location - where previously it was "there or thereabouts" but not incorrect enough for me to chase it.

I figured that as I was about to start tweaking the combat code to deal with creatures that are considerably larger than the average thing, I should be able to see it properly first. So that's done.

Oh, and I made the red active circle scale top the active creature size, whatever it is.

Tomorrow, back into combat logic to now get these things working as they should.

Oh. Also. Had a great chat with Brett and Nath on spells, skills and progression and what that should look like. I'm much happier with the way it's sitting in my head now after having a good chat!

Sunday, September 24, 2023

Combat Rewrite

Well, it's been a very busy week on multiple fronts. I've had the week off from work, and that's meant that I've been able to get neck deep into the game, and also stuff around the house that's been on the to-do backlog for a while.

In things that I have done on the game though, I took what was working in the combat system, especially the parts around how the game runs the monsters and threw it all out the window. It was barely functioning, and was written before I really had a good idea of what needed to do, and how it needed to do it. 

I thought that re-write would take a day or two. It ended up taking basically five full "first thing in the morning, to late at night days" to get it right - right enough anyhow. So, the good news is that creatures now kind of decide if they want to try to do damage or heal, they look for opportunity targets, they look and deal with threat tables nicely, they understand who their enemies are and who their friends are in a fight - and who is at the top/bottom of that list. I've gotten them to path nicely to their targets, working around things in the way, using the map terrain properly and resolving a bunch of issues that I hadn't thought of when I started to write all that code.

I also had a great back and forth with one of my mates, Nath, around logic, algorithms and generally how stuff works. It's nice to talk through logic and what's doing what with someone else as it makes you think about things in detail, more so than getting it to "work well enough" so that things don't crash. I probably need to do more of that, especially as the development starts to shift from pure "getting it working" to "tweaking and improving" so that it's not just another app that never gets anywhere cause the gameplay is hot wet trash in the midday sun.

Back to work tomorrow, so that's always great after some time off, catching up with the team and working through the backlog of requests that's no doubt waiting for me - but if, just if, I manage to get through all that in humane time, I plan to tweak the rendering engine (and monster/character code to allow for creatures that render larger properly. They kind of work, but render incorrectly at the moment. I'll try to tie that in with tweaks in the combat and pathing code to allow for the same, so that big monsters are really indeed big and need more space etc to move about.

Thursday, September 14, 2023

By George!.... I think.... I've....

I have managed to get some really productive code written after I finished up work today. It's all been about creature logic and pathing. I've got some reasonably "not terrible" pathing set up now, working with the threat that I'd set up over the last few days - so creatures now move to target what they are most worried about in a combat as far as their move will allow them, and if they are in combat range, will attack with a melee attack and pass the activation over to the next character/monster in the fight.

So, the short and long of it, is that I think I've gotten the hardest bits working now. Deadset celebration time this evening. 

There's still some things to validate, as the monsters don't appear to be doing any damage to characters - though I think that is more likely just a lack of actual data in their creature profiles.

I'll need to add in more logic steps still, so that things will look to see if they can attack via ranged attacks, and do all that, but the goal for tonight, was to implement creatures using pathing to avoid obstacles/monsters/characters to get to where they want to get to - and for the most part, that seems to be working nicely.

I'll post something more thorough when I tie up the few loose ends!

Wednesday, September 13, 2023

Scarebear (Or... you know... Combat Threat)

I put in a good few hours this evening working on threat and how all the creatures (and eventually player characters if desired) would work out threat and what's the best thing to attack for them. Loads of new functionality that is going to work quietly in the background and hopefully no player wi,ll ever have to think about it too much, but things will do hopefully reasonably smart things when you're playing against them.

I am finishing up tonight halfway (which means started, but not complete - has no true indication of how far complete this section is) through getting the code working out the best path for a monster to use getting from it's current location to the thing it wants to attack the most.

Hopefully a better update tomorrow or the day after when this bit is working, but there's a few cogs in this system to work through!

Tuesday, September 12, 2023

Combat is Taking Shape

Super quick post. I've been furiously spending my evenings working on the combat system. It's coming along certainly, and I've still got a good bit to do, but I'm certainly moving it along in the right direction. Maybe with a bit of luck, I'll have a better update to post in another few days. But my test characters are certainly doing their worth, fighting giant spiders and such as I test things out.

Tomorrow, I'll be adding threat to the monsters, so that I can start to work out who they want to target, then let them start attacking and write the code that will let them move in the right places as they see fit.

Wednesday, September 6, 2023

Rudimentary Combat Mode

After wrapping up work today, I managed to get some really good coding time in and have a super rudimentary combat mode starting to work! 

Building on what I was up to last night, I've managed to connect the characters to movement through the action buttons in each direction, set them up as they are available, skip them if you can't move/attack in a direction and so on.

I also managed to connect these things to the rendering engine, so when a character chooses to move in a direction, it shows the right animations and so on. With that skeleton code in place, adding things like attacks and other stuff should come easily enough I think. I still have written nothing on the monster logic though, and while I've got a half decent idea of some of the functionality I would like them to have in terms of understanding their own abilities, using things well and so on, that's a long way off actually having them do all that. The good news is that all this is running with no impact to the framerate on the physical device. So there's some winning in the tally for this evening!

Tuesday, September 5, 2023

Combat Interface Progress!

One of the things that has been sitting in the background quietly waiting to be solved (and giving me stress in doing so) was what the interface would look like for combat. With the phone, there's so little space (and lets face it, I am no android expert - I'm a novice at most) so I don't know all the good tricks on how to get the most out of everything.

But I think I am progressing nicely with something that switches from a non-combat mode interface, to a combat interface, hiding a lot of superfluous things on screen (valid for when you're running about) but less important when you're focused on what one character is about to do. And so, with that thought in mind, I've created a second set of inputs and HUDs that are much more trimmed down, to basically status bars, and dedicated half the space to what the combat options will be - move, fight, use skills or cast spells, grab something and gulp it down. That leaves a set of directional action buttons over the world view, that will be used for movement, for targeting and so on. I've written the code in a way that they can easily change depending on what options are available - meaning if there's an empty space in a given direction, it will show a movement arrow. If there's a monster, it will show an attack icon and so on. That should make it nice and easy to tie in additional actions later, such as bandaging a fallen party member or things like that. 

I'll try to tie these new buttons to actual actions, so that pressing a move button moves that character in the right direction, which seems simple enough, but there's so much code to write to look after that and connect it to the rendering engine!

Monday, September 4, 2023

Overdue update

It's been taking a long time to get through some of this code, much longer than I thought it would, but I have been chipping away at it slowly, and tonight I managed to get a good few hours in, so the results showed that.

It might seem trivial, but building on the "combat mode" or "not combat mode" in the last update, I have been working through all the code to split out the party from a single sprite into individual characters, each occupying their own location on the map - and the same for all the various creatures that are in an encounter. Next up more interface work to give some sort of options for a player to choose for their characters - and finally how to render it all correctly so that when the focus changes from one character (or monster) to another, everything else is still correctly rendered in the right places on the map. The basics of that are working now, so I'll start to build out both player options (I'll do movement in combat next) and then I think I'll start to work on super basic attacks/defences from players and monsters which the basics should support without too much change - then with the utter simplest of options, it will be time to give some logic to the monsters to be able to determine what they need to do when it is their turn.

The fun I'm having right now seeing this all come to life is amazing and utterly exhilarating - I can't wait to build this out.

Sometimes you do the same thing really well. Twice.

And each time, you do it for the first time. So, lets start with some back story here. While I was doing all the recent changes to the code ...