Thursday, June 27, 2024

Character Creation Circle-Back

I started to circle back to some earlier screens as I make sure that everything in the basic functionality is working as it should and... yegads. That was some ugly entry-level "this is my first Android screen daddy!!"  work there.

Safe-Delete. Can't safe delete. Safe-Delete other reference. Can't safe delete that either....Safe Delete next in line.

Do-over time. I have done most of the work now to rebuild the character creation screen interface, and it's much cleaner and neater than it was before. There's a bit more to do, but it's certainly better than it was. I'll bundle that code into the next part, which is giving each character a starting inventory and the like.

Edit: I wrote the above, but got called away and didn't finish the post (or the code). Although work has been super busy, I got some coding time in this evening after dinner and wrapped up some errors.

The result is a much better designed, cleaner character creation screen that properly created the character, syncs to the server and finally adds in all the relevant data without an app restart (which ran a different set of commands when loading em). So. Most of that is great. It's still landing the characters in with no gear at all - which isn't great. I'll need to do something about that. I think that at the time of characters being created, the app already has processed items, so I might be able to get away with creating/equipping the gear without issue. It might be easier however to do it on the server-side instead and simply re-sync the party from the server after creating a new character. I figure that's not going to be happening all that often in the scheme of things once a player has set up their party.

Monday, June 17, 2024

Website Whoopsie

I've been switching over registrars and the like, and some DNS and encryption settings.... which broke the site for a bit. Anyhow. It's back.

Whoopsie.

Wednesday, June 12, 2024

Light Editor Interfaces and Encumbrance

Just an update that's more for me this evening as I got stuff done, but it's really for my needs rather than the game itself. I got into the editor code and tweaked up the last bits so that when I create an effect or item and give it a lightsource, the editor now displays it properly, then cleans everything up when the next item is selected. Not interesting, but needed to create items and effects in the long run.

I then started on encumbrance management. I already had items with a weight setting, so it was just a matter to increment the character's weight value when they do something with the item... And that's about where things fell over. I had mentally thought it was going to be in the code that equips the item, but that's actually incorrect. Players can find/create/dispose/trade/buy items without equipping them, so I need to go back up a level so to speak, but I ran into the problem in the code that that "level up" as such doesn't exist in a single place, but rather throughout many, many, many different sections of code. Way too many places doing way too many things for me to finish it off in the time I have left this evening, so I'll leave that for a fresh evening's work tomorrow and see if I can get it done in a single sitting - which I would prefer for my sanity.


Edit: I had a great idea, which was to use another bit of code I had which updates the item owner, which would kind of work... as it is called from most of the places I just found above, but it's also going to fall over when the owner isn't changed but the quantity is... which then led to "What if I change it in BOTH those places?" which is where I am at currently... and it's maybe possible. It feels like a band-aid solution, but it might be enough.

Edit 2: I'm trying to see if I can get away with doing it in just those two sections of code and have things work.

Edit 3: It seems to have worked mainly. Seems there's at least one bug (my encumbrance didn't increase when I bought an item I already had a stack of - but it also did fix itself perfectly when I then reloaded the game with the correct weights - so not exactly a gamebreaker issue)

Tuesday, June 11, 2024

Party Lighting Working with Items


I managed to get all the little things leftover from yesterday finished up nicely today. So there was a good bit of code the details of which I am not going to go into for a change, but the really good news is that when a character equips an item with a light, the game will use the brightest light for each character, and then the brightest light of active characters for the party.

Based on the code I got done today, extending it to also allow and check for lights created with effects will be easy enough to do, though I got a bit of editor work to wrap up before I can get there. But that's going to be really cool to have all those interactions and using different items.

Tomorrow effect lighting.

Monday, June 10, 2024

Lighting Work Continues

I've managed to get some great code written up around lighting on this lovely day off. I started off by updating the editor interface for items, so that I could set up a light to be attached to an item. With that in place, I threw in some extra general code into the app itself to create new lights if the item contained information on a light, then code that calculates the possible light generated to find the brightest light - then code to update the character light so that if the new light was brighter, it would equip that instead - and finally a copy of that code into the party - so that when you're not in combat, the brightest light you have will be what's used around your party as you travel.

The good news is that it works. The less good news is that I'm not finished, and I had really wanted to be. Currently, if you then un-equip the item with the light you're using, it doesn't sort through and find the next brightest light to use instead. But you know, that's for tomorrow. Really, I'm rather glad I have gotten to where I am this weekend given my ambitious target of getting character and party lighting working.

Sunday, June 9, 2024

Let there be Light!

I wrote a good bunch of code. Not like a super lot, but you know, more than a bit. And it should have created a rudimentary party light to see as you wander about. And I launched the app, and... nada. I sat there pondering for a while, maybe the light isn't showing cause it's too bright? tweaked some other settings.... nada. Perhaps the zones aren't working properly... check, code, launch... nada.

I could keep this text-based adventure going on, but the short version is that I spend a good few hours trying to work out why lighting had completely stopped working. It for all intents and purposes, very much seemed to be working, doing all the calculations and registering lights properly, but somehow not rendering them in the end. Eventually found the change I'd made in the code at some point. Trying to save resources, I had tried to reuse a bitmap by clearing the contents rather than creating a new one. When I went back to my old code, it worked fine.

Right, so lighting was finally working again. Suddenly my party light was functioning the way I thought it should be. Sweet. Now to extend that to individual characters and monsters. Some pokery-jiggery later, I'd managed to have each character and monster holding a makeshift light... and going from there to rendering it all actually wasn't that long a step. My graphics engine was reasonably happy taking in the extra inputs and just plodding along.

It's early days, and everyone literally has the same hard-coded light, but the good news is that I can add in lights easily enough, render them in the right places and the engine is happy and keeps up when the camera is moved to a different character and so on. Is it perfect? Hell no. The framerate dropped down to 25, which is lower than I'd like it to be, and lights still aren't truly in the same granularity as the world really is. But you know what... it works. I'll take that win for now.

With things working nicely, it should mean that when I get to having permanent effects in locations, I'll be able to drop in a light on a burning location dynamically, or flash up some extra lighting when casting a lightning bolt, or some other suchness.

Friday, June 7, 2024

Creature Abilities Interface

Not a huge update this evening, and not one that has any visibility to the end user - that's you - but it has been a really long week with work, so I'm on the knackered end of the spectrum. I finished up my code for the editor that lets me add any ability to any creature this evening. Going to be very useful in the near future as I add in some additional code for combat and when I start to set up some smarts for creatures being able to play the role of healer, or dps or debuff etc which I am looking forward to having enabled.... however...

I think I'll look to player and party lights and lighting next. The graphics engine already supports that, so I think it's just a matter to add the right looksups after I set up the characters with some form of "this character has this light" and with luck, the rest should come reasonably easily - or I'll be happy with "comes without needing a complete rewrite of code in some section". Seriously though, that one's been on my to-do list for well over a year now I think. It's a long weekend here, and while there's stuff to get done about the house, I'll be rather chuffed if I can get seriously stuck into this and bang it out.

Thursday, June 6, 2024

Respawning Done

So, got an early start on some code this evening, but as I thought last night, I was rather close with the respawning and quickly managed to solve the last few bits. I cleaned up some code so that character death was dealt with in one method, rather than handled in many small places here and there on the fly as needed (yeah, that was always poorly written the way it was, but that's evolving code on the fly).

I again do however find myself in that "Huh... well, I caught the car... now what am I supposed to do..." mindset as I got further quicker than I expected this evening. Normally when I am here, I look back through my last few posts to find things I meant to get to but didn't - but I am rather at a cul-de-sac here in functionality - so I might use the rest of the evening to work on the editor. When I was giving the spiders their buff so they could ride roughshod over to get em killed off quickly and respawning (seriously, that's annoying having to wait till your party is slowly whittled down in combat to test the feature at the end hah) I did notice that I hadn't finished off the interface for giving creatures abilities nicely. Originally each creature would only have one ability, so the data was kept directly in the same row of data as the rest of the creature info. When I decided to give creatures potentially multiple abilities, I changed the database structure to accommodate that, but never finished off the editor code to do it all. So, long winded way of saying "I just thought of a pretty garbage job that needs doing..." and I can get to it.

Nice clearing my head here as always, while taking a few minutes to regroup into the next plan of action.

Edit: Yeah, in the code for Creature Abilities, realized I have been meaning to work on character  and party lighting for ages. So putting that here for my next "What's next..." And character speed with encumbrance. And Item Durability something something. Right, that's enough for loads of evenings work.

Wednesday, June 5, 2024

Respawns Almost There

I managed to get a good bunch covered off today around respawns. I made some updates to the database, added a table, added columns to other tables and then wrote all the editor code to interface with (mostly) everything, so that a repsawn location is nicely baked into the terrain information like spawns, encounters and so on. It seems to be mainly working, though there's a few bugs to still work through.

Good news first, it does teleport you to the respawn location for whatever area you happen to be in. So, depending on where you die, you will respawn where you should. It correctly then re-activates your characters, removes any ill effects finally and their stats start ticking up etc.

What's buggy is that when you next get into another combat your characters start with a "collapsed body" animation, which looks like they're all dead. I think I fixed that, but haven't tested it yet. More importantly (and what distracted me much more) was that the next combat you get into something goes wrong, and the combat doesn't end properly if the monsters kill you again. So clearly I am setting something incorrectly somewhere along the way.

Hopefully tomorrow I crack that nut and move on again. In the meantime, it's rather funny, as to make testing of this quicker, I gave both giant and monstrous spiders a solid glow-up, and those things are just one-shotting all my characters, and also running in from off the screen to maul me which is hilarious - and tells me that if you walk into a zone that's much too high for you, you'll find out about it quick smart indeed as something comes running for a snack.

Good coding evening!

Tuesday, June 4, 2024

Respawns and Character Status

A huge amount of fiddly mucking about with the code for the last few hours has got me nicely progressed on character deaths and respawning the party after an unsuccessful encounter.

There's been a lot of rather droll setting of flags in the code, checking for them in other places and then, a bit more excitedly, transporting the party to a respawn location (I'll need to set this up properly, it's just manually entered currently) and resetting all the effects on the characters that aren't passive. No point in respawning everyone just to have them all keel over dead from ongoing debuffs and the like.

Anyhow, short and sweet update, but good, if slow progress in the code this evening.

Monday, June 3, 2024

Character Deaths and Interface Fixes

I've fixed up a bunch of landscape screens again, so they look and feel much nicer. The main character screen is set up (more than it was before) properly to display the data horizontally, the inventory screen now displays the various sections in the three parts of the screen properly when in landscape mode. I fixed up a few more little details along those lines... then moved on to the next fun bit.

Technically, up until this point, characters didn't really ummm... die. If a characters health hit zero, it would simply start ticking back up again. Super useful for the sort of testing I am doing at the moment, but it also means that I can write code meaningfully for when the party isn't the winner of a combat sequence. So that needed updating too, and I've gone through and made a bunch of updates to the code. Firstly, the game will keep a character "dead" as such and not tick their stats up. Secondly, the code that now checks for whether there are both player characters and creatures in a combat sequence now correctly identifies when there's no characters left standing. I've coded up a basic sequence to put the game back out of combat mode, but haven't added a respawn function quite yet. Still working on the little bits between all that.

But, again, good update on a Monday evening. Work is still ordinary as heck at the moment, so the motivation is certainly sky high to plug away at this.

New Abilities, Ability Functionality and Spells

It's been a few days since I posted, but I have been super busy working on iterative builds here to run through my own testing, and that...