Friday, 28 September 2018

Jugular Spurtiness, Engineered Brutes And Boolean Modifiers

Scorching heatwaves have faded into Autumn and the oversized fan I went to so much trouble to get hold of is now packed badly into it's box. At one point I was swarmed by the "Idea Fairy" for other game ideas.

Actually footage of me defending myself from new game ideas

Back on the gamedev front, I added GUI markers to the interface for when the player gets a temporary boost or decline. Previously such events were heralded with an informative element saying what had just happened and how long it would last for, but there was no actual timed element to let the player know whether it was still on-going or had stopped. I decided to change that with a simple "up arrow" icon for boosts next to Experience, Health, Energy and a "running man up/down arrow" for temporary speed changes. Once the temporary change is over, the icon vanishes. Having a speed boost also now protects the player from slowing attacks.

Boosts!
I also gorified the decapitations. Not only do head explode and blood splatter but now jugular veins spurt and throw extra splatter on to the ground near the neck when the corpse finally comes to a halt.

Boom! Headshot!

A long time ago in a galaxy far, far away I had coded some custom homing missiles. However they would cause a crash if their target was deleted - even though I had told them to reset and lose height if there was no target.The hacky workaround was simply not to have any deceased target permenantly delete faster than the lifespan of a missile. Recently I realized that I had failed to add a "isProperlyRemoved" for the target deletion check, and this fixed the crash.

Getting on with modeling and coding new enemies, I eventually found that Blender 3D has a csg style tool called "Boolean Modifier". This can slice, delete and merge two different meshes. Annoyingly I found all of this information out after I had been doing the whole thing manually ... (insert autistic screeching here).

 Nobody Cared Who I Was Until I Put On The Mask ... and then beat the player to death ...

Previously I had modeled a plasma-rifle wielding alien based on the old Manits Man character, and named it the "Kralmok Warrior" after the name of the weapon it carried. This enemy has now been renamed again as the "Hive Warriror" - which is a little easier to say, never mind spell as I found "Kramlok" appearing in my code quite often. The Hive Warrior is a level 5 enemy and is now accompanied by an Engineered Brute.

Brutes with a Hive Warrior and a human sized zombie for scale

The "Engineered Brute" is a genetically engineered ... er ... brute. A large and relentless enemy with a melee attack which whilst slow, recovers quickly. They are the sort of solid enemy which the player will find difficult to push out the way, especially the default ranged weapon (gun) based player character. It spawns by teleporting in just like the Hive Warrior and gives out a gutteral snarl to announce it's entrance in overly dramatic style.

Dramatic Entrance Is Dramatic

Now that I am at testing level 5 enemies all together I realised that I had not created an easy function for this and instead would have to play through the other levels first. Which is fine apart from the time taken - unless I get chomped on by giant spiders in level 3 and it's all game over and start again. To rememdy this I coded a little function which starts the game at the desired level with the player upgraded through typical experience leveling and powerup collections from previous levels.

My Face When I Didn't Do This Earlier ... 

10 whole minutes of testing combat against Level 5 enemies. I got pwned in the 10th minute and never escaped the level.


So, that was the month that was. I fixed and tweaked loads of stuff, got level 5's enemies modeled, animated and working, and found a whole new and easier workflow inside Blender for modeling.

Wednesday, 29 August 2018

Shaggy Spiders And Splattery Goo

Spiderpig, Spiderpig, does whatever a Spiderpig does ...


Placeholder Cube under attack from (not very hairy) spiders ...

Variety is the spice of life ... allegedly ... anyhow, I am trying to have a varied and interesting range of enemies. As an easy introduction for the player I have started out with ye dull olde zombies before venturing into more interesting adversities such as velociraptors, strange deer headed Wendigo creatures and insectoid aliens. However they are all rather ... two legged. So I decided to get away from bipedal creatures and into more ... well, legs. Thus, spiders! Now as we all know spiders are complete bro's, and anyone who says otherwise is probably a fly or mosquito or something.

I wanted hairy spiders, but quickly found that sticking hairs all over them did not really show up very well, what with the distance of the camera, so instead ended up making the spiders more shaggy. The larger the spider, the shaggier. Making shaggy spiders ended up taking way longer than expected, just like everything gamedev related ... :/

Testing various levels of spider shagginess, before I added hairs to the legs

Having a spider level, I wanted a variation in spiders themselves, and chose 3 types with obvious visual differences to help the player understand what each type does. These are, rather unsurprisingly, small, medium and large.

Small spiders are thin, smooth and spindly, without addition hairs. Small and fast, they charge at the player with a toxic bite.
Medium spiders have hairy bodies. In addition to the standard bite attack, which is less toxic than the small, charging spiders, they have a spitting attack for use at range.
Large spiders are the hairiest and serve as damage absorbing tanks. They are also the heaviest, so trying to push them aside is difficult, especially for player characters with long range weapons who are the physically weakest - eg: default gun player character. Whilst I have coded a shotgun player character I have yet to design the data for melee based ones.

A range of spiders (and some test ones at the bottom)

Here is a good 13 minutes of testing the spider level in combat. I accidentally used the wrong model for the smallest spiders, and later also changed how the hairs cast shadow as they made the largest spiders look too dark from certain angles.

Action Spiders!

I also spent sometime thinking about general combat. First I created a "miss" effect for melee attacks which do not hit the player. For standard melee attacks this is a small distortion flash and some sparks, whilst for larger monsters there is an accompanying puff of dust. Attacks which do hit the player trigger an on-screen damage effect so there is no reason for additional effects.

I enhanced the blood decal effects too. Previously these had been a single, randomized decal. Now there is a splatter effect of blood going outwards. Standard deaths have a single additional splatter, whilst decapitations and full body explosions have considerably more.

New splattering effects before I honed and increased their randomization

All this and various additional and general gameplay tweaking - and some sun bathing because there was a heatwave - took up the whole of August.

So, what's up next. Good question. I've been rethinking my list of levels and extending it. Deer monsters level needs an additional enemy which are likely to be fast moving spritegirls with a ranged special attack. Insectoid/Mantis aliens need a melee based tank/brute. Interdimensional Shadow Knights have been modeled but are still in need of animations. There are a couple of planned levels with no modeled enemies, and all the level bosses and player characters are currently placeholder cubes. Several special attacks still require fancy models and of course all the actual levels are just the single test environment. Originally I was planning on creating whole levels out of meshes and lightmapping it all to save CPU/GPU load but now I am not so sure and might use the more "traditional" methods of creating the environments.

So, lots to be cracking on with ...

Monday, 30 July 2018

Of Wendigos And Monstrous Morris Men

There's been a heatwave ... and I have got "The Dreaded Lurgy". It's not been a great combination. However, though only tenuously attached to this mortal coil with sickness, I have risen from my death bed to write this blog, and show the work I've been doing whilst on death's door ...

I was going to do some spiders as enemies for the player, but instead ended up grappling with some sort of Wendigo/Beast of the Wilds/Herne the Hunter sort of thingy-majig. I have bought a number of models, mostly for the animations, and have decided to retro-fit and modify them for my purposes. So I amalgamated a number of models in creating "The Deer Hunter", a sort of archetypal monster of the wilderness which I intend the player to come across in a rather desolate and windy steppe-like grassland.

The Deer Hunter, available in four earthy flavours

I was umming-and-ahhing a bit about how to spawn them in the level as it seems almost everything comes out of the ground. One it's convenient and two it sort of fits that creatures emerge from their own lands. To give a bit of variation, and to avoid everything clawing it's way out of the ground like a zombie, I decided that the Deer Hunter would rise up as though propelled on a lift (that's an elevator to our former colonial cousins), holding it's skull in it's hands, and then fit it's head into place. I thought it was a rather amusing effect.

Over here son, on my head!

I also thought that this might be a good time to introduce the player to invisible enemies. They come in two types based on the shader effect I used. One is a slightly wavy Predator style optical camouflage effect which produces near invisibility whilst the other has an internal shadow which makes the distortion more noticeable. I still fondly remember playing Doom against a horde of pink Demons when suddenly I realised I was getting bitten by an invisible one. Learning that some enemies are (semi)invisible is always a nice shock for the player.



Another variant on this stag monster was the "Monstrous Morris Man".  This is basically the Deer Hunter with different antlers, wearing a Morris Dancer style rag coat (a coat covered in strips of rags). That's the bit inspired by Morris Dancers and thus there is a lot less drinking ale and prancing about waving a sticks, and no guy called "The Fool" with black smeared on his face. Why has he got black smeared on his face? Because he's covered in shit and doesn't know it. Why doesn't he know he's covered in shit? Because he's "The Fool".

Monstrous Morris Men in colourful rag coats

The rags themselves were looking a bit flat, so I created a second UV channel and unwrapped it using Blender 3D's automated lightmap unwrapping, so that none of the polygons overlapped and that they were all clustered nicely side by side. I then baked ambient occlusion to this channel. Once exported and in-game, I added the new ambient occlusion image (with alpha inverted of course!) into the Overlay channel of the material file.

Ambient Occlusion from the additional UV channel helping add depth

The Monstrous Morris Man comes with a long range special attack, and is able to throw some sort of energy bomb over distance. Other than that, all these creatures are melee based. Below is a video showcasing various spawning, deaths and finally special attack.




Another month, and more progress ... and a being ill in a heatwave, which is a real annoyance. So next month ... maybe get those spiders working.