Monday, 31 July 2023

Flaming July Raining July

 

Behold, 693 materials converted to PBR - but the models LOD out quick so you can't see that here - trustMeBro
July has ended as Flaming June started ... flaming wet. The chances of a good strawberry crop in August diminish by the second.

Work wise, every single object in Monsters Loot Swag has been updated to the latest engine version and the fancy-pants visuals of Physical Based Rendering (PBR). All 693 materials have been changed to get rid of the diffuse and specular mapping, and brand spanking PBR compiltable albedo and Occlusion / Roughness / Metallic (ORM) maps have been created. I also settled on a standard 512 pixel size for the vast majority of objects as they are not large enough during gameplay to warrant textures any bigger (except bigger boss monsters and the such which are now 1024 pixel maps). All of this should also help reduce the total memory footprint for texture loading.

This new version of Monsters Loot Swag will be initially available as a beta on Steam, before later becoming the standard game version.

Boris The Spoder-Tank reflecting a rather barren test level in real-time

All of the terrains for the already completed 7 levels (3 more to do) have also been updated to the latest engine build, and are now filled with reflection probes to simulate the area around specific features.

A reflection probe before I realized I had to embiggen the capture radius to get objects to reflect in it

Slowly and methodically porting the game to the new engine has caused a few issues, namely my previous disregard for naming conventions. Many files ended up being called "thing_x_new4_v08_redux_final_final2" and then added to a profile, but the new engine uses an asset system so suddenly naming is important, and the file's name becomes the profile name. This was further confounded by previously having multiple files of the same name in different folders, so a fair bit of renaming has occurred, especially in the 262 audio files which needed to be called the name of their profiles.

So, next up is getting the actual old gameplay logic to work with the new asset system. I am optimistic that this will not be too difficult and that the main issues will revolve around some renaming of server and client connection commands. As ever I prefer to work methodically so that I can actual see where things have changed and understand how the new processes work - which seems infinitely preferable to ham-fistedly ramming the whole game into the "convert to new build button" and then wondering why everything is a mangled arse afterwards.

Hopefully August will also see a return to some decent sunny weather and I can get back to shorts and a t-shirt rather than continue building an Ark in a jumper ... we live, as ever, in hope ...


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