Monday, March 20, 2023

Game Syncing to Server Updates

I got a few good hours of coding in last night, and managed to add to the code in syncing to the server. I know that while this isn't the sort of flashy code that it is easy to get excited about, it's also really really needed and needs to function really well. The update from last night is when you own an item now, and either equip it, trade it between characters (or any of the other conditions that cause it to need to be synced) it will get sent through to the server for that update.

I'm still mulling over how frequent that needs to be, and whether perhaps some updates need to be instant (purchases already do this for example) others might be held off for a combined update - or whether it really makes no difference and they should all just be synced as needed. I think a bunch of this will only get answered when there is a bit of load on the server and it's running on some real hardware.

Sunday, March 19, 2023

Editor Shop Interface Complete

I made good progress over the weekend with the editor code. It might not seem like an important bit of progress to round out the editor interface for creating shop inventories, but I'd not realistically be able to make the game world at any reasonable pace if I didn't have this in place. Being able to load up the right inventory into each vendor, and set their purchase and sale margins with a few clicks is going to save a huge amount of time in the long run - and the interface I've got should make that hopefully pretty streamlined too.

I've still got to add a few things to items in general - I've not fully implemented item buffs, or item sets with a special bonus for the set, but I think what I've already written will cater for that without much change. I think I can turn back to the engine code itself and work on setting up character stats as a (hopefully) quick interlude before I start looking at buffs in the engine proper.

Monday, March 13, 2023

Items, Items, and Items!

So, not going to lie in the slightest. For some reason, the editor interface for items really put me in a damned tarpit. I think it was the huge number of fields that I wanted to use for items, to cover off most of the various data points I would want to use in the table and make some nicely interfaced in the editor - then creating the code behind the scenes to update, insert and generally do all that other boring as hell stuff that's however indispensable.

Well, good news. That's done. (At least as done as I can do right now) and I've gone and created some items, made sure they all equip nicely into the right slots on the character, made sure all the code was working from before (boy-howdy were there some bugs in the code hah!) but finally, I have what is starting to look like a half-decent character inventory screen.

I have uncovered that I do not appear to own any assets for shoulder armor, and I need to go back and fix my items tables/data so that they can handle ammunition for ranged items properly. Not sure if that will need a table change yet, or just a better implementation of what I've got. Either way, it's not a long way off.

Next up, I should write an editor interface to be able to drag-and-drop creating various shops and what items they sell etc and connect them back to an NPC as I'm currently doing all that manually with SQL.

Tuesday, March 7, 2023

The Item Factory Rises

This evening was quite productive - I took a step away from the android code and flipped into editor code mode (PHP and JS), working on the interface that will let me create items for the game. I didn't get that interface fully completed, there's a bunch of things I want it to do which are quite clever, but just considering the sheer volume of data points that each item will carry makes it amusingly (and annoyingly) tedious to have input fields and data entered where needed.

I did get a good ways to wrapping up at least the first iteration of the Item Interface though, so that's likely something I might be able to finish off (in a pretty manual version 1.0 way) before I use it for a bit, then make all the updates that will get it working the way I'd actually like to use it. Realistically, to complete the interface, I still need to write another few interfaces (one for Item Sets, and one for Buffs) but there's no rush for those things yet. I'll be happy to have some items in the game that I can use to test out all the functionality I've written for the various trade and equipment views.

Monday, March 6, 2023

Slots Slots (not the casino tpye) and more Slots! (and Sets)

So, the weekend was a complete write-off, and had another rather long work day today, but I did manage to wrap up and get some nice code done. Nothing exciting, but rather just building on what my last bits were. Making all the different equipment slots work as expected, setting up all the various listeners on the right places and basically wrapping up the equipment/inventory interface for the most part. There's still work to do on the stat changes around items being equipped, but the main functions are being called - I just need to fill them out with all the right checks and updates.

I also decided to at least set up the basics for Item Sets, that lovely concept where if you collect a full item set, you get an extra bonus for your character, which wasn't really a lot more than simply adding in an extra column into the data table (and then updating the various places where it's used and updated) but it's nice to have that in there at least. That of course leaves me with now having to eventually write the code to implement Item Sets.... but that's going to be pretty quick and easy compared to this.

With some luck, tomorrow, I'll get a bit of an item building interface written up for the editor, and start to actually use some of the assets I've bought for items in the game!

Thursday, March 2, 2023

Of Adapters, Listeners and Static Functions

So, not much of a large update, from the last two days, and I can say, I've certainly had less code time in them than I would have liked, but in good news, I've finally got all the parts of the code doing what I need them to do (with caveats). 

Characters can trade nicely with one another, they can buy items from merchants and they can equip and unequip those items. The code nicely handles all the information behind the scenes as well as shuffling the right items about in adapters, scrolling views to where they need to scroll to and adding in all the little details that I would expect an interface to have. I did have to do a rough patch job on something where I've got two listeners applied to one view, and I cannot for the life of me work out how the second one is applied - and I eventually cracked and "fixed" it with a dodgy if statement that solves the crashes rather than finding how the second listener is applied.... but you know what? It works, even if it does also call some static functions in arguable non-elegant ways that do what's needed. Again. It works.

Although the code only functions right now for two slots (given I've only got one item in the game, it really doesn't matter hah!) I will just simply copy/paste/modify different values into what's needed and should have it all working perfectly for all the slots as new items are created. That's likely tomorrow after work.

Guess that also means I need to start working on an editor interface to create new items (and even thinking about that made me find new data I'll want to capture in the items table, so I need to modify that a bit more again and throw in a few extra columns), and probably right after that, I'll add in an interface in the editor to create shop listings. If, by some miracle I get through that over the weekend, I really should look at writing some code to nicely deal with sprite-sheets rather than directly requesting all the resources from the server on the fly. It'll make more sense to load up the data into the app and process it client-side and then just make server requests as needed for the random stuff.

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...