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.

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