Wednesday, 19 June 2013

Virtualizing The Virtual

Virtualizing The Virtual!? Is that a double negative? And if it is, does that mean that the virtual is now physical? If so, I for one welcome our new Steampunk Turn Based Tactical Artificial Intelligence Overlords ...

So, there I was, playing away, testing my game. It was night, poor visibility ... also probably in real life too ...
I was defending a flag from pirate assault ... back in the game now, not in real life ... when I realized that sometimes it takes a while for the Ai to get into the attack, especially when visible distance on the battlefield is very low. I had got my troops into my chosen defensive positions early on, and now kept clicking for the Ai to take it's turn and advance against my forces. And it was taking a while ...

Which is when I hit upon the idea of virtualizing the Ai's move. First check that they can't be seen, then make simulate how far along their path their current tactic can take them distance-wise, make sure that they'er not going to be spotted by the player's forces, and dump them at the end of their phase, decreasing their Action Points as if their turn had been taken normally. For the player, no more interminable waiting whilst the Ai to complete something that they can't see. 3+ minutes for the Ai turn could become 45 seconds.

And if the Ai could be spotted during their virtual movement, then play their turn as normal, have the player's trooper spot them, and let all hell break loose as normal.

Needless to say ... it turned out to be considerably more of a pain in the backside to get it to work correctly. First up my test function - 5 whole lines - worked lovely ... then when I rolled it into the full Ai thinking process - 10000 lines - I had to invert the values.

Then they kept falling through the terrain and other objects - make a check for that - then they all try and jump on each other - check for that - then they fall off the end of their path somehow - check for that - then they have the falling through terrain issue again - recheck post virtualized move for that. But finally it all works. The key of course was to slap the camera on the Ai so I could see what was happening when it all went wrong.

And so here's a little video of something that will never be shown in general gameplay - the Ai moving in dev mode.





Also I finally finished off the last of my character art - so here's a video of all of the different factions in various conditions.

Character types:
Unarmoured - with hat
Light Armour - helmet
Stealth Armour - helmet and camouflage
Heavy Armour - tin man with Regime flag facings (not all flags finished at time of video)

In order:
Regime/Faction - Environment - Weather

British Royalists - Temperate - Clear
Austro-Hungarian Empire - Jungle - Stormy
Chinese Dynasty - Mountainous - Clear
US Republic - Arid - Cloudy
People's Collective - Urban - Clear
Zulu Nation - Mountainous - Stormy

Followed by repeats of the various regimes in various environments with various weathers.

You might want to up the quality level - no idea why it's defaulted to 360p when it's in 720HD ...




I finally also finished the flags for all of the regimes - though admittedly after that video had been taken. I didn't want the flags to be particularly historical, as that kind of takes the fun out of it being Steampunk.

This is what the Single Battle Mode options screen looks like now:



From the left:
That's a stylized Imperial Engle on the Austro-Hungarian Empire

Union jack ensign and crown for the British Royalists

Traditional Chinese (Cantonese) word for Dragon for Chinese Dynasty - I came up with this after many failed attempts to make a stylized dragon design that I liked ... then thought that using the script for the word might be nice. Colours taken from the Qing Dynasty of the Steampunk peroid. They did have a dragon picture on their flag but I didn't like it.

Soviet Constructivist Colour Scheme for the People's Collective. Always knew that degree in art history would come in useful eventually ...

Slight change on the 1877 version of the Stars and Stripes by making the twin circles of stars into solid hoops for the US Replubic faction.

And finally, because of alphebetical order the Zulu Nation.

I sorted some really annoying issue with the Ai not always updating their aim aniation - probably self inflicted due to the manner in which I've changed spawning and mounting - and also made a rather spiffing icon for my game.




This being a MUCH larger version of said icon ... obviously.

Saturday, 1 June 2013

FAIL! Deadline ... What Is A Deadline?

It has been exactly 365 days x2 ... which equals ... er ... 2 and 2 is 5 ... erm ... er ... say about 2 years - exactly - to the day - that I started Project BADGER OF DOOM ... maybe it needs a better name :/

Sigh ... so, it's been 2 years exactly, to the day, since I started my current project ...

Originally it was entitled "His Royal Majesticnesses' Royal Corps Of Dirigibles And The Mighty Struggles For Supremecy Of The Pan-Dimensional Lands Of Pangea" ...

... okay it wasn't ...

But it was originally entitled "Royal Corps Of Dirigibles". The rest of the "fluff" was very much added for amusement as a sub-title, due to the Steampunk notion of the whole thing.

That eventually changed to "Royal Dirigible Brigade", a very much shortened version which still implied the Steampunk aesthetic of "royal", "dirigibles" and a "brigade" ... presumably a brigade of dirigibles ... possibly aquainted with royals.

That in-turn ... inturn? ... not sure if one word or hyphenated ... became the much easier "Dirigible Brigade" ... after all there are SIX playable faction, only one of which is called "Royalist".

I was fine with that for months, right until I woke up today and thought AIRSHIP DRAGOON ... and that was before I got to the pub ...

So ... we still don't really have a title ... only it needs to includes airships/dirigibles/zeppelins and some sort of military detachment like Brigades or more cavalry orientated like Dragoons ... or maybe Huzzars ... my late-grandfather was a Huzzar ... and an Irish Huzzar at that ... and a Royal Irish Huzzar. He wasn't Irish.

Also ...

... Deadlines ... and the utter lack of them. Thank the great magnet - 'cos I'd have missed it if there was one.

So 2 years to the day after I had started ... where about are we? ... that's the royal "we" of course ...

All Character models are done - all hail the great magnet - because it's been a 2 month - checks old blogs - looks more like 3 months - death march of 3D character modeling. But finally we are complete on that score.

I had to complete the Dastardly Pirates of Pangea - cue play on words about the pirates of penzance ... get it? Look, I did drama at school in the '80s ... when I say "did", I mean "took as a skive from doing real lessons" - and thus failed at exam time. Everybody wins!


This is the common enemy in Single Battle Mode and the insurgent if you don't keep the population happy in the Campaign modes. He's a red bearded hell-raiser, wearing a shiny jade smoking jacket, with a white stripe across the face giving him a New Romantics vibe.


What do you mean you don't know what the New Romantics were?





What do you mean "What The Hell Did I Just Watch!?"

How about this?




What?


Still no recollection? Never mind, let's continue.

Pirates done, I needed to sort out the Heavy Armour character for all 7 factions.

Having already bled my fingers to the bone on making light and stealth armour, I decided that heavy armour would be a single character model, using variations on the same texture. That's when "base_my_lovely_material_option" really came into it's own. Swapping "base" with "faction name" meant that I could load the correct material at spawn and it would then have the dominant colours of the regime. I decided that the face mask of the armour should patriotically (you spell that like that right?) have the regime's flag and the back shoulder plate should also carry the flag - as a basic way of checking for identification from behind to prevent Blue-On-Blue - something I'd done for character models in "ye olde project"



Yeah ... that one ... awww ... look at them ears ...

But back to the now ...

Whilst all 6 playable factions were VERY loosely based on great powers of the 19th Century, I had wanted to make variations on the flags, to give the factions and the game it's own unique fantasy/Steampunk identity.

The US flag was kind of easy, the double cirlce of stars circa 1877 is kinda cool. Thanks to Nebraska for that. As seen in Dances With Wolves - the only good Costner film. Sorry if you're reading Kev, but .... well ... it was. :|




I almost changed it to something else but them realized that was actually the REAL Malaysian flag ... so we scrubbed that idea ...

So turning the US 1877 flag into a double ring also looked cool. And here it is on the heavy armour character type for the US Republic faction.




The British Flag has been the one to be awkward. I ummed-and-ahh-ed for some time thinking up a new design.



That was cool :) ... positively freezing ... oh hang on that's Iceland's flag ... They ate our cod in 1971 - Nevar Forget!

Let's try a version on the theme.

GOD DAMMIT NORWAY! Fuuuuuu -

So, I ditched that idea and went back for the classic Naval Ensign. It's the British Royalist - so some sort of ... crown ... seemed right. And here's what we got.



It shows off the predominate red of the red coats, has a crown, Union Jack - If I was a Redcoat in a past future that never was I would be proud to leap out of a zeppelin all guns blazing with that on my shirt!


I've still got 4 other flags to design but I feel that they're gonna go much more smoothly. For the Tactical Battle part I am almost complete, with just 3 more weapon systems to finish the models, scripts and GUI's for. Here's the US Republic again, left is a Recce class trooper in Stealth Armour (camouflage) holding a "Telephonicatron" to bring in artillery, and a Sapper class trooper next to him with a single shot, FlameRocket.




In other news, I've fixed MORE bugs - where the hell do they come from? - found some others, which thankfully I know how to fix, sorted out a whole load of new stuff and enjoyed using "base_material" so much I've converted a whole load of stuff done at the start of production 2 years ago to use it, thus ridding myself of various mildly repepitive datablocks.

I encourage all T3D MIT users to embrace the power of "base" in your materials.

base_barrel
blue_barrel
green_barrel
awesome_barrel

Can all be done with just one model. And even one texture if you use the diffuse setting on the material datablock.

So, I've got all that and 4 more post-it notes of issues to sort out. And then port it over to a finalized code-base (still using an experimental one).

So ... we missed our deadline ... but thankfully we are not beholden (is that even a word?) to external forces ... or some such gibberish. Production continues unabated. It has been exactly 2 years to the day since we began.

Friday, 17 May 2013

The Boys ... And Johnny Foreigner

We've had the Brits and now we've been modeling all the other factions. All 7 of them, with unarmoured and light armoured troops, with 4 LODs each, with 4 camouflage schemes for Stealth Armour. That's a lot of LODing ...

 Originally I had envisioned the idea of having seperate models for each class within each faction. There are 7 classes and 7 factions. My 7 times table is about the only one I could ever remember as a child ... probably because I liked the number 49 for reasons of no known certainty. 49 would have been a lot of character models ... even more with light, stealth and heavy armoured types for each one ...

Thankfully I scrubbed that idea as utterly impractical before I started, and stuck to the concept of each faction having 1 unarmoured model, 1 model with a helmet for light armour and stealth armour (with a camouflage texture depending on the tactical battle environment), and a global heavy armoured model with different texture for each faction, carrying the factions flag on it's back.

This all still requires 15 character models, 4 LODs each - so a total of 60 meshes - and 49 diffuse textures plus specular and normal mapping. All of which has been a bit of a slog ...

We've had the British Royalists for a while ... even though I scrapped the models and restarted from scratch for the third time to get mesh deformation. Being British, Royalist and Steampunk meant that they had to be The Redcoats. The Brits are actually the only team not wearing Steampunk eyewear - their goggles are hanging around their necks. Light armour is defined by the African Zulu campaign pith helmet.




And here we have the standard dresscap model on the far left, light armoured model kneeling centred, and stealth armoured model on the right in green camouflage. This texture swapping makes use of the built-in "base" skin definition and swaps it on spawn for the appropriate environmental material  - green (for both temperate and jungle), arctic, arid and urban.

The Austro-Hungarian Empire was as close as I wanted to get to zi Germans without actually having zi Germans. I wanted a European faction, and the Austro-Hungary seemed the perfect choice, a regime which spans multiple countries - Austria, Bosnia, Croatia, Czechs, Hungary, Italy, Montenegro, Poland (who cannot into space ...), Romania, Serbia, Slovakia,  Slovenia, Ukraine and of course including parts of zi Germans. As all troops are randomly named with national/ethnic forenames and cities/counties/states as surnames this also gave a wide selection for variaition.



Light armour centre, unarmoured forage caps flanking the sides, wandering through a rainforest, Steampunk monacles aplenty. I did have a bit of a um-and-ah about the uniform, wanting light blue and not entirely certain about the trousers which are those "flying pants" with the winged thighs that stick out.

I turned to the interwebz for inspiriation using You-Know-Who's-Image-Search and the phrase "austro hungarian empire 19th century uniforms", with safe search on.

Now we've had unexpected things thrown up before when a search for ideas on User Interface Buttons - "steampunk buttons" brought the wrong type of button ... and the ladies who were wearing them.


These are not the Steampunk buttons I was looking for ...

And it happened again ... well ... actually it didn't, it did give my the 19th century uniforms ... just in an unexpected genre ...



This was not the context I was looking for.

Anyhow, in the end I decided on a fairly realistic colour scheme of the Austro-Hungarian cavalry - the red jodpurs/flying pants being a nice foil to the predominant light blue, and a flattened forage cap.

The Chinese Dynasty. Dee-nasty or Die-nasty? There used to be a terrbile American TV show in the 1980s called Dynasty which was clearly trying to copy and cash-in on the success of Larry Hagman and co in Dallas. Over in the UK we tended to refer to it as Dysentery :P ...


China meant being able to break away from the usual style of uniform and colour schemes and throw in yellow - technically it's light amber, to go with my repeating amber and black colour scheme that can be seen in numerous places through out the game (especially on the boobytrap warning fences).

I ummed-and-ahhed again for some time about the overall colour, and decided on a green leather vest as a not to the jade emperor. The above picture is a good illustration of how I work - slapping the models into the engine and then changing the textures on the fly to see what looks best.


Unarmoured Chinese Dynasty troops to the left and light armoured walking to the right. You can just make out stealth camouflage armour in the background. They have these small spectacles perched on their nose which are half fashionable, half granny glasses.

The People's Collective is a sort of revolutionary soviet style idea for a faction.  Not so much Reds Under The Beds more Reds In A Dirigible ... and not really red either, the British Redcoats had already commandeered red as their dominant uniform.


I ended up basing the unform on a 1930s Security Apparatus Officer. "Security Apparatus" - I think the modern translation is Murderous Jobsworth Despot. The helmet is from the same peroid, looking remarkably similar to Great War French helmets, but in shiny brass and with goggles to steampunk it all up. Everyone has a little Lenin style beard and the names are all Soviet.

The Ungrateful Ruddy Colonials didn't quite make it in as a faction name but the US Republic did. I had wanted the USA to be "damn Yankee" dark blue but was hestitant on using yellow again for trim. In the end it ended up as two tone blue, dark coat dominant to light pants with a Rough Riders style slouch hat. The helmet is a shiny brass hybrid of US doughboy hat and early prototype brodie helmet.



The US has more modern, nearly cyberpunk style, one piece, wrap-around type goggles and everyone has an Abe Lincoln beard.

Finally, the last - at least in alphabetical order - regime which the player can choose to represent in campaigns and battles is the Zulu Nation.

I had wanted to steer well clear of anything to do with lions, leopard spot cloth and the whole Africa cliche. Oh ... and Vuvuzelas ...

In the end I opted for a more informal uniform based on gentleman's attire. Shirt, waistcoat, pants, gaiters/spats and a tophat and monacle. I had wanted to include the Zulu colours of black, white, red trim, green and yellow.

Initially I had made them a lot more green ... but then they looked like drunks from a Saint Patrick's parade. Adding a lot more yellow brought them too close to the Chinese colour scheme and made them look like they were wearing the South African Foot-to-ball strip. Eventually I decided on a much plainer, white, back, green dominant colour palette. Light armour is denoted as a helmet, which is sort of an ancient Greek facemask with the plume removed.




All names are (ethnic/national) given name - (city/area) family name, including the Chinese and Zulus who normally would have family name first.

Still to do ... are the Dastardly Pirates of Pangea. The enemy the player faces in one off single battle mode and who serve as the insurgents in the Main Campaign if the natives in your captured territories become unhappy with you rule. Also still to do is the heavy armoured character which will feature the same model for all factions but with different coloured textures using the material swapping function. And 6 more weapons to model and then the Tactical Battle part of the game is done.

For the Strategy Overview Map part of the campaigns I need to create a couple of new dirigibles, texture them all, and re-texture the environment hexes. There's still a few GUIs to finalize, some audio to sort out, port it all into a final codebase and make a few more code alterations which I want.

And an absolute shed load of documentation on how to play it to write.