Monday, 31 May 2021

One Spell Pony Says Explosion

 This month I have mostly been dealing with explosions.

And vapour trails and general special effect type stuff.

And I found out that the PBR I had been using had broken metalness which was fixed on a newer engine version, so I had to redo all my PBR maps again, after having to redo all my PBR maps again last month because I had Occlusion and Roughness in the wrong RGB channels ... but back to those explosions.

Right back at the beginning of Unnamed Victoriana South China Seas Dieselpunk Dogfighter I created a system of damaging individual aircraft parts, thus degrading performance related attributes like turning, speed, etc. Now I neeeded to actually make it look like something was happening when this actually happened. I threw in a small explosion with a nice little puff of dark smoke to let everyone see that a damage limit had been reached. When this happened a mesh element would be swapped for a more damaged version so that the player could visibly see their aircraft being steadily shot to pieces.

Here is test to show all the parts of an aircraft that can get blow clean off

 I came up with a somewhat hacky solution of hiding the destroyed area and then spawning the blown off part of that area as a static object, so that I could use the same skin texture as the aircraft and give it a spnning animation, and mount that onto a projectile that was gravity heavy.

And of course if an aircraft takes way too much damage all over rather than having a single part get blown off, it just explodes. Whilst some of the debris is made up of model meshes, most is in fact animated sprites for small metal plates tumbling through the air.


I also made some Dazzle Camouflage skins for the three aircraft types I had previously modeled.

Dazzle Camo; The Rule Of Cool

This brings us to actually sorting out some sort of gameplay mission, and for that I started working on an Event System. I have been thinking of taking a cue from the old space shooter Freespace and FRED, FReepace EDitor, as to how missions are put together. It had a drop down editor for logical arguements which acted as cues for events, thus preventing someone from filling it with absolute gibberish. The premise is quite simple, if x happens do y. Most of this is about spawning new waves of enemies or ships as well as keeping a general tab on mission objectives.

I have come up with a system based on using scriptObjects in the mission for each aircraft or ship or active thingy, all stored in a named folder in the mission editor for ease of finding, which then accumulate to an array on the load game event, waiting for the events to be checked against array list and ticked off one by one. 

The idea is that something occurs - eg1: player connects - the Event System looks to see if anything else needs to be done - eg1: enemy aircraft wing spawn 15 seconds later.

eg2: Enemy are down to 25% numbers, second enemy wing spawns.

eg3: Second enemy wing is destroyed, large enemy formation arrives. Timer starts for player to survive for 120 seconds.

eg4: 120 seconds later, allied wing of reinforcements arrives.

eg5: All enemy destroyed, mission accompished.

And so on and such forth. Minus timers the Event List is entirely passive and is just checked against when something happens that was stored in the array from the aircraft scriptObjects in the editor. This seems to be the best result for low overhead.

So, that was the month that was, and next month we will hopefully have a fully working Event System and actual playable mission which I intend to be a homage based on the first mission of Freespace: The Great War.

Friday, 30 April 2021

Satsuma Camouflage

 The pub is open and the wind is cold. It's a Bank Holiday weekend, of course the weather is going to be terrible. I had a huge scone with jam and cream.

This month I have been modeling planes, 3 of them, and 9 different skins for 9 different factions. Part of the way through I discovered that the PBR map - known as a ORM map - actual stands for the order in which PBR goes into the channels and that I had got my Rough and my Occlusion the wrong way round. This explained why my ambient occlusion didn't look very ambiently occluded ... Having fixed this for all 4 damage levels, I could continue modeling new planes.

The Nakajima Type 91-1 actually did come in orange. I have no idea what Japan thought they could hide this amongst, perhaps tubs of satsumas? Here it is with the Tokugawa Shogunate emblem replacing the Japanese flag due to Deepest Lore™.

This thing really doesn't look safe and has a pretty poor damage rating, but it is agile.

Previously I had completed the Curtiss F-11C Goshawk and so set about making various skins for it. You will probably spot the theme of 19th Century Qing Dynasty due to Deepest Lore™. Here comes a lot of image spam.

Chinese Republican "Dare To Die Corps"
Cuba because it was an actual thing so I though why not ...
Qing Dynasty
Kansu Braves - referred to by the Western MSM as "The 10,000 Islamic Rabble" but was actually the Qing's elite fighting force of Islamic soldiers sworn loyalty to the Empress Dowager.
The Taiping Heavenly Kingdom - a ... wait for it ... Theocrat Anarcho-Communist Absolute Monarchy led by a guy who declared himself the younger brother of Jesus. Unlike Jesus he murdered 20 million people in 14 years.
Black Flag Army - Cantonese bandits who created hell for the French in Indochina.
Fists of Harmonious Justice - Boxer Rebellion
Five Banner Alliance - more anti-Qing, anti-foreigner secret society
Damage models for the Yellow Flag Army, pirates of Canton - sporting the pirate flag from AIrship Dragoon
Plikarpov I-15bis from the Imperial Russian Air Service, poor maneuverability but fantastic quad Maxim machine guns.
Polikarpov I-15bis in Chinese Republican colours

Overhead damage models of the I15-bis (top) and F11C Goshawk (bottom)
Testing vapour trails, which needed a bit of "fixing" for the source code

Here's a video of me testing vapour trails in combat.

And that was the month that pubs finally reopened.


Next up, more skins for the Nakajima, and perhaps one more aircraft before attempting to make an actual game senario with it all. Toodlepip!

Wednesday, 31 March 2021

Replace The Placeholder Plane

 Placeholder aeroplane, which I downloaded from some modding site that I can't remember, has been replaced by my own aircraft model.

It's an F11C Goshawk biplane, which is now itself a placeholder for all other aircraft which I haven't yet modeled.

I also coded a damageable area system to give the model a visual personification (don't really think that was the word I wanted but hey ...) of the GUI damage system.

Model now displays damaged areas the same as the HUD damage indicator bottom right

Initially this was just meshes that used the same colour system as the GUI/HUD damage indicator for area based damage so that I could see that it was working. The idea is that the aircraft model is made of multiple meshes, engine, body, tail, wings 1, 2, 3 etc and these meshes are displayed hidden depending on how much damage each individual section has taken. There are 5 levels of damage, the first being undamaged and the last being destroyed. Eventually when an area is completely destroyed it will spawn a debris or rigidShape of the part of the plane which has been shot off. Eg: the top wing will appear to rip off and the aircraft will plummet to the ground.

I also use this show/hide mesh system for the muzzle flashes of weapons. Previously I had simply hidden the meshes inside the model at a hugely shrunk scale, and then animated them into full size.

Next up was to test the PBR and make up some textures. I knocked up a very quick normal map and some metal and roughness maps. Initially they were rather dark, eventually I discovered this was due to too little roughness so that the metal map was rather overwhelming things.

Ignore the catgirls at the back, just comparing PBR ...

After a bit of faffing I got PBR materials working, and thought that the whole looked pretty good actually.

Not bad if I say so myself

After this I proceeded to test the damage system with bullet holes. Here I noticed a fair bit of stretching which could only be remedied by completely redoing the UV mapping.

And here is a test of an AI air battle using the PBR textures. In the end I get my top wing shot off, which disappears as there is currently no debris object for destroyed areas.

So, that was the month that was.

Next up are redoing all the texture maps, albedo - which I never seem to be able to spell correctly, never had this problem when it was called diffuse - normal, metal, roughness , AO and of cause all the accompanying damage meshes and maps. After that, on to more model aircraft.

Sunday, 28 February 2021

Backbone Required

 So I've gone and FUBARed my lower back.

Current state of development ...

Hilariously this was caused, not by the hike I went on to do some deliveries and check on the welfare of vulnerable people, but by the innocuous action of stepping out of the shower afterwards ...

Least painful position right now ...

This has somewhat stalled progress due to sitting be the most painful position to be in and lying down - away from my PC - being the least painful.

This has led to watching lot's of train cab rides, mostly from Japan, which has some really pretty scenery.

Previous to incapacitating myself, I had continued to work on dogfighter game. I had detailed various datablocks of different fighters and set the AI pilots to slug it out in numerous tests. I had also finally added the player into the mix, allowing myself to take to the skies as one of Blue Team and take on the dastardly foes of Red Team, with each team comprising of a mix of aircraft types - though currently all using the same placeholder model for the time being.

Location damage GUI was broken here

I had also added a couple of different radar resources, one standard top down and the other the 3D style radar from Elite. I found the 3D style to be somewhat confusing and so removed it and stuck with the more simple top down radar. I added toggleable ranges and made sure that different teams displayed in different colours.

Top left overhead radar and below the more confusing 3D version

The one I settled on

I also changed how the aircraft classes handle so that they are obviously more different. Fighters now lose a lot of speed when turning, whilst interceptors lose their maneuverability when gaining speed, and strike aircraft are somewhat midway between the two.

I improved high G stall turns for the player, so if you get them right you can swing the aircraft round quickly, and if you get them wrong you'll stall - hence "high G stall turn".

Basic combat stats for a mission are now stored with assists, kills, shots and hits being recorded for the player. I decided to use the same system as one of the game which inspired this project which was the old space dogfighter Descent Freespace: The Great War.

The one IP Volition has no intention of ever bringing back :(

I made a few other changes, tweaks and improvements here and there, like stopping the Ai from spawning above their aircraft ceiling limits which immediately threw them into a death spin dive.

So next month I think it will be time to actually model some custom aircraft and start to deal with physically showing damage to individual vehicle parts such as having the wings shot off and the such like.

Also probably a good idea to do some exercises to strengthen the lower back when I am able to get up and down from the crapper without needing to lean on two crutches ...

Until then, time to lie in a more comfortable position and watching the Hiroshima to Fukuen line whilst the pain killers kick in ...

Sunday, 31 January 2021

Space Year 2021: Stage 1 of 12 Complete! Dogfight!

It's the futuristic space year of 2021 AD, stage 1 (January) of 12 (the Annum) has been completed ... though you might be forgiven for not noticing ... 

Having previously worked out my issues with Ai pilots taking a leading aim on a moving target I have spent all of January getting them to actually dogfight one another. Choose target, go fast to get into shooting range, slow down to follow it and blow it out of the sky. Took a bit of doing but worked nicely. 

Next up was creating a system of evading when an AI came under attack rather than just sit there and get shot at. Reading through vast tomes of air combat and aerobatics, I managed to come away with ten meaningful emergency maneuvers to try and shake an enemy fighter, and added a barrel roll if none of the others seemed to be an oppropriate match for the defenders circumstances.

 That's not a barrel roll (ノಠ益ಠ)ノ彡┻━┻

This brought some problems itself, that in high-G maneuvers such as a Stall Turn, the Ai had a nasty habit of losing all energy and ... well, stalling ... a lot.

He's written his Artificial Intelligence Pilot Engine Management System? Stall it.

So then I embarked on a complete rewrite of how my Ai would use engine management. Previously it had been a simple case of setting engine percentage with a nose attitude modifier, now it was all about maintaining the desired speed. This massively reduced stalling in tight turns but not completely eradicated. So I added an anti-stall system that would force the Ai to move to a desired rate of knots should their airspeed drop at a rate that would bring them within the losing height at level flight, with a nose attitude modifier. I reused the anti-stall method which I had written for spawning aircraft and getting them up to their starting speed immediately. The maths required a bit of evening out for an object that already had velocity in 3 dimensions and initial attempts had some supersonic thrust propelling the vehicle across the sky like Warp Factor 9 but I ironed these out eventually.

Unedited video of an 8x8 dogfight

Coupled with all of this was the the obvious need for collision avoidance, both from other aircraft and the ground and max ceiling which each aircraft type can go up to before the engine is starved of oxygen and stalls. Dynamic collision avoidance of other moving objects was somewhat of a pain in the maths but I got there eventually with very little happening in the way of head-on collisions during mass heda-on attacks at each other team's formations.

32 aircraft head on attack - no collisions just 2 shot down
64 aircraft battle moments after the first pass, and why it's called a dogfight I guess

In other news I decided to update the banners on my youtube account, and give them some new artwork. Here I discovered that it doesn't actually let you reposition your artwork and keep scale after upload, so had to edit the image to fit into their stock measurements and orientation.

I also spent quite a bit of time viewing train stations webcams on a spare monitor whilst I worked for maximum comfy.

Everywhere seemed to be getting snow ... except me, it just rained here. (๑′°︿°๑)

So, that was January, Year of The Koof Part Deux, pubs are still shut then ... Join me again in next months exciting episode of "why is maths hard?"