Friday, 30 June 2023

Flaming June Raining June

June started with a jumper, June ends with a jumper

 June ends as it started ... wearing a jumper. Thankfully the bit in the middle was scorchio and I took advantage of the free vitamin D and got a nice tan. My veg patch also got a good soaking and the emergency water barrels filled up.

June has primarily been upgrading Monsters Loot Swag to a new engine build. This requires me to change all the materials from Diffuse/Spec to albedo/ORM for all of those fancy PBR reflections... and that means updating all 693 of them ... (note to self; next game go for flat shading).

Player Characters and bushes get the PBR treatment

Catgirl T-Poses over the nettles to assert dominance

HDR has proven to be somewhat of an issue in all of this - initially because I didn't realized that it was switched on by default, having not used it in previous version of the game or engine, and is now on as default. This led to some awkward automated changes in exposure for filmic tonemapping based on camera position.

Eventually, after a little fiddling with sliders and values I settled on an interpretation of ACES filmic tonemapping.

Stock ACES tonemapping with auto-Contrast - pass the light blub

Manually defined auto-contrast values for a sunny day

Whilst all of this was going on I ended up helping out with a new implementation of parallax mapping.

Old parallax mapping

New parallax mapping

Yes but actually no!

This is the start of a change in how parallax mapping works in the engine, with the original version being replaced with a brand spanking new Parallax Occlusion Mapping. And this is what that looks like! (minus the occlusion casting it's own shadowing).

Definately not the same picture ...

 The POM version required a total change of art pipeline where the alpha channel receeds from maximum height of white, downwards to lowest area of black, whilst the original parallax mapping built up and outwards from the lighter values.

So far I have the characters, bushes, trees, general vegetation, all of the level objects such as rocks completely transformed into PBR mode. So, still to do are the dynamic objects, animated explosion effects, most of the terrains and all of the monsters - and as it's a game about monsters, there are rather a lot of them ...

All that to do in Flaming July - which is not a painting by Lord Leighton.


Wednesday, 31 May 2023

Boxes In Boxes

 

According to the weather forecast, she will need a jumper ...

After getting mild sun burn sat out by the veg patch with a bottle of wine, we are now back to standard British weather of needing a jumper for late Spring and early Summer ... Flaming June looks like it means that the fireplace will need to be lit ...

Steam brought out an update to the Steamworks SDK, sneaking it out again as they did in the previous month without any fanfair. Once again they had made changes to the authentication system, and once again I had to wade through code comments to find out what it all meant - except this time I also had to wade through the online documentation, complete with it's links to various 404 dead pages. To quote the docs at https://partner.steamgames.com/doc/webapi/ISteamUserAuth:

 NOTE: This call requires a publisher API key to use this method. As such this API MUST be called from a secure server, and can never be used directly by clients!

So, yeah I'm good, this was just splitting up web-based games from the standard Steam Client authentication. Also feel free to click the api.steamworks link at the bottom of that page for more helpful advice. 😉

In April I had attempted to create a melee combat system of checking through a defending player object's hitBoxes for intersection with an attacking object's hitBox - to see if this would be faster than using a raycast system of quad edges projected from the attacker's weapon - all whilst suffering from the Dreaded Lurgy.

What I found, during illness enduced brain fog, was that there was no current system to determine whether rotated worldSpace boxes intersected (OOB) only AABB. Now without the brain fog I had another attempt at coding a solution to this, with a nice easy early out if half longest box sides added together were beyond central distance, though ended up using raycasts after all for the actual connection checks, which were oriented in worldSpace with the attacker's box and then a perpendicular test if no initial result was found.

The end result was that I found checking through the defender's 12 hitBoxes (but potentially up to 20) could easily take more than the standard 4 raycasts which I had been previously using. On top of that, box intersection would take more the boxes behind the initial hit into account, nearly doubling the struck areas, so a big melee swing would 98 damage rather than 40 something. To order these results in worldSpace would require another raycast or more maths based on location and orientation.

tl;dr - I've kept my original melee system, it works fine for what I want, but I might use the OOB intersection for weapon on weapon parrying.

So, that was the month that was. Flaming June awaits, with a promise of thick jumpers and hot cocoa ... 😒

Sunday, 30 April 2023

The Dreaded Lurgy

 

 

The Dreaded Lurgy is a Rare SWAG Power-up. It is an Attack Based event which causes the targeted MONSTER to succumb to the Dreaded Lurgy. The infected MONSTER is highly contagious and will transmit the Dreaded Lurgy to any other MONSTER who they come into contact with. However, after receiving the dark gift of the Dreaded Lurgy, the victim is now immune from further infection.

Annoyingly this is also a thing in real life, and I have spent the last month suffering from The Langshan-Po Lurgy - a free internet to anyone who gets the reference, but Gen-X (greatest generation) here, is probably just showing his age.

Needless to say 3D vector maths, gimbals, quaternions, cpp and general cerebral activity, has been somewhat compromised with lurgy brain fog. In celebration at the cerebral degradation - which hopefully will only be temperory - I have revised, both the icon and the in-game activation event art, for
The Dreaded Lurgy.

However during this time, Steam has snuck out a new update to Steamworks (v1.56) ... which broke previous coded SteamGameServer::getAuthentication - thank you Valve devs for the code comments which gave a good explaination of the new changes. 

The Steam update for Monsters Loot Swag is here.

It has also spent all month raining again - just like last month. So it turned out in the end there really was enough rain for April showers. In the midst of all these downpours there has been a frequent visitor, and pidgeon numbers are being reduced.

Who's a pretty boy, then?

In the world of melee combat coding I decided to try a new way of doing things and ended up on some terrible code carousel, going round and round in circles - and having the Dreaded Lurgy did not help brain function. 

I had wanted to look down a list of the target's hitboxes and check if they were within the bounds of a weapon's hitbox. This caused far more problems than I had preceived, with a total lack of being able to get the transforms and orientation of the hitbox meshes within the model. When I could get the hitbox mesh itself it wouldn't allow me to translate it to into world space because it was the wrong class, when I had world space I could not access the hitbox mesh because that was then the wrong class.

I could test a strike against the target bounds and check for intersecting but then to get the actual hitboxes still required using a raycast against all hitboxes to get their transforms and then suddenly we were into more load than I had before.

Dave is made of hitboxes and the raycast is checking alignment of the forearm hitbox

 The only thing I can think of is to create a whole series of points within each of the target's hitboxes and and then check the Box3F of the weapon hitbox against all these points --- and once again we are into even more load, and not the less I was hoping for with just intersection checks of boxes.

Giving all of this up as a bad job, I decided to use the 4 main edges of the weapon hitbox and fire a raycast down each length for more accuracy than a single, central raycast check. This has turned out to be infinitely simpler than going down a list of up to 20 hitboxes checking for intersections.

I also coded up a fatigue system for heavy attacks, sprinting and swimming, and completely rewrote how fall damage works. I started to add attribute statistics for the player, which are fairly similiar to standard RPG stuff with STR, DEX, CON, etc, and the start of a leveling and experience system.

Next up will be to code classes and jobs with bonuses for these attributes on how fast experience points boost them.

Next month I am not certain whether I will continue with the melee action RPG prototype or start porting Monsters Loot Swag to the newest an shiniest version of the engine - I expect it will be a bit of both.

The Dreaded Lurgy is finally subsiding and I am down to a dry and somewhat sore throat with an occaisional dry cough. A pox upon the ... er ... pox!