Tuesday, 25 September 2012

Make Simple Character Model Quickly ... 40 Days Later ...

It was time to start making some basic characters. This shouldn't take long ... and indeed MOST of it didn't ... but then some of it did ...

Magnets!? How do they -

I mean, mesh deformation ... how does it work!?

I had recently played through my Ye Olde FPS - demo of which is still available here at 168mb. I had noticed the quite poor deformation on the shoulder and joint areas of the characters - though admittedly this had been the first time that I had ever looked inside a 3D modeling application and proceeded to model, rig and animate a character ... and it had also been my last. Since then I had created a new bone armature - this time observing some proper Torque structure (bip etc) - and animated to what I considered to be a satisfactory level. My placeholder Ai player model strutted imperiously across the landscape.




She had awesome slippers but appalling vertex deformation ..


I'd rechecked various old bookmarks - many of which no longer existed - and even more that had moved about teh interwebz but could still be found. Particularly I was after the guy who had created Lara Croft in TombRaider Underworld and had posted on GarageGames ages ago. I did find the thread but he'd reorganized his gallery and the pics were missing. Back-tracing to his website I found what I was looking for, simple, clear tutorials on getting meshes to deform nicely.  Also I remembered that I'd previously seen a guy who had worked on Gun had plenty of good general modeling mini-tutorials ... if a rather unfortunate website name poopinmymouth.com.

So, armed with all of this information, I proceeded to knock up my first model. My current project is a turn-based, squad tactics with a steampunk vibe. There are 7 nations/factions and each one consists of a standard unarmoured solider, light armoured - which is the same as unarmoured but with an ethnic/national helmet, stealth armour - same as light armour but camouflaged (yay for setSkinName(%skin); ), and heavy armour which will be some steampowered mini-mech suit - the body will be the same for all nations/factions with the appropriate regime's unarmoured or light armoured head poking out .

So I started out with the unarmoured model of the British Royalists - all factions start with Nation and then Regime/Governance (eg: US Republic, Chinese Dynasty, etc). It's steampunk, they're British, it's got to be a red coat. Throw in flared trousers, big boots, a peaked dress cap and the manly facial hair of whopping sideburns and a big old moustache ... in ginger. And of course goggles ... steampunk has to have goggles ... or a monocle. Not wanting every nations soldiers to have the same type of eyewear I'm going to have to vary it somewhat, so the Royalists have their goggles loose about their necks ... but they still have goggles.

After a fair bit of initial faffing I was pretty pleased and tried the whole thing with my rig and animations and it looked like some sort of terrible mutation had been involved in some sort of scientific disaster ... on a train ... which had crashed off a bridge ... into a Dynamite factory ... More reading up rigging was required and watching copious amounts of video on youTube.

Previously I had assigned vertices to bones via simply grouping them at full strength, which had caused the poor deformation in my first models. Carefully painting the weights seemed like a better idea and slowly but surely garnered better results - as did rebuilding various parts of the mesh incessantly ...

To quote an obese, chain-smoking alcoholic:
Success consists of going from failure to failure without loss of enthusiasm.
 In the end I was either satisfied or beyond caring ... possibly both, and decided it was good enough.


Imperial Strut animation - in the ancient Blender 2.44 which I still use ...

The model is currently only sporting a simple diffuse map with ambient occlusion. Later I shall create the specular and normal maps, as well as add various details to the diffuse, though not too many as I don't see much point in having hugely detailed models or textures when the player is going to spend most of the time zoomed out on the battlefield.

And here it is in video - note, the rifle is currently a whopping bit of 2x4 that I'm using as a placeholder model.



Note: I use an older version of Blender 2.44, and 0.964 DTS exporter. I do use DAE/COLLADA at times, but not for characters. This is mainly down to the animation system changing in the 2.46 version of Blender, and me not wanting to spend aeons learning the new method.


And one final thing. Torque3D game engine is now available under the most permissive of all Open Source licenses MIT.

Thursday, 16 August 2012

Short Campaign: 96 Battles Later ... Not So Short Then ...

 So Short Campaign turns out to be ... er ... not so short after all. But was ruddy good fun, especially after I fixed the usual gazzillion bugs that you find during a month of extensive playtesting.

I played through my Short Campaign ... and it took 96 battles to win.

... so ...

... err ...

Short Campaign turned out to be not so short after all.

It's been a solid month of playtesting ... with the accompanying solid month of fixing a huge number of bugs that a solid month of playtesting throws up, and an equal amount of tweaking.

For my Campaign test, things started off well, a little too well. Then after 30 or so battles, I found a bug that meant the Ai was never deploying any of it's veteran forces. Whilst my force of veterans and equipment was growing, I was still fighting againstthe halfwit conscripts who can barely hit an elephant at close range. That fixed and things began to be a bit more challenging.

The Ai had a few issues with finding cover under certain circumstances - fixed. The Ai had difficulty re-equipping from the dead when they ran out of ammunition - fixed. Enemy gunners didn't have the correct amount of ammunition on deployment - fixed.

And also made a whole load of tweaks. Some of the most expensive equipment didn't seem to have the firepower to justify the cost - fixed. You get what you pay for but no one piece of equipment tips the balance decisively. I also redid a number of Guis to make them somewhat more ergonomic. The deployment screen now has battle terrain, weather, conditions, objectives and modifiers viewable with less clicking. Conscripts can be added to the deployment force singularly or en masse now.

I also added range-based-passive-phase-fire to the classes. So gunners and snipers could only return fire on the enemy's turn if the target is over 200m away. Recce and Fusilier can only return fire up to 100m, and Sapper, Grenadier and Militia (Conscript) get 100-200m. I found it creates another tactical decision, both in deployment - low visibility prevents Gunny and Marksman using passive fire - but also in battle - do you leave a Fusilier to cover the other classes incase an enemy walks around that hedge just in front of your Sapper and is too close for him to defend himself? Or do you move the Fusilier up doing his own job?

I had started off with the concept of limiting the number of veterans to just 16 as a way of acting to create a further strategic variable. You've got a lot of one class, say a class which can only return fire in the passive phase at long range, and when some conscripts survive they get promoted to a close combat class which you are short of. Do you sack one or more of your experienced veterans to make room for the new - but inexperienced - guys?

And then there was the actual gameplay, and the type of interesting procedural stories you get from unscripted gameplay. Just throw in a bazzillion variables and watch it go.

---------------------

Late on in the Campaign, after I'd fixed all the bugs I had found, my mixed force of veterans and conscripts was attacking a large enemy base on a hill. Numerically I had the slight advantage, experience wise they probably shaded it and equipment wise we were equal. This was the third or fourth time I had attempted to win this particular hexagon shaped territory on the Strategic Campaign Map, and I needed it to allow for an extra avenue of attack on the final series of enemy territories to win the not so short campaign. Previously I'd mainly used conscripts in the attacks due to poor weather conditions and a lack of close-quarter combat troops. Now I had sunshine and clear weather which favoured my available types of veterans.

   I'd moved my force up to a low bank which gave them cover and split my troops into Support  (Marksmen and Gunners) and Assault groups (mostly conscripts with some veteran Grenadiers). I also had a Recce and a Sapper for spotting boobytraps, and Sapper dualed as a mule carrying lots of aidkits and spare ammunition. I only had one of each of these classes available

   I'd had everyone pouring a bit of fire from behind this bank to suppress the enemy, Recce and Sapper had been spotting and diffusing boobytraps. I'd started moving my Assault team round to the side so that they could run up the hill and attack, when a sniper round critically wounded my Recce. Luckily Sapper was near enough to despense first aid and medivac him. Unluckily it meant he wasn't part of the assault anymore.

   My Assault team broke cover and rushed halfway between the objective and the bank, taking cover behind a series of hedges whilst Support group peppered the enemy. All good so far ... right up until I set my first trooper out. He spotted a large number of enemy that had been obscured and took fire from the far side of the map. I decided to throw my flanking manoeuvre out wider to avoid a crossfire and that's when my lead officer was vapourized by an IED. Sapper was still back with the Support group, Recce had been medivaced, so no one in the Assault team could spot boobytraps. And that's when the conscripts which made up the bulk of my Assault squad freaked out, taking a massive morale loss from the officers death right in front of them.

   Most of them fled blindly in panic back towards the bank, narrowly missing an earlier detected but not diffused IED. A couple stood in the open impotently firing at enemies either to well concealed to be hit or out of range. And then it was the enemies turn to pick a few of my panicked troops off ... which made the surviving conscripts freak out even more.

   Eventually I ended up back where the assault had started, behind the bank with the Assault team. Sapper used the last of the aidkits to heal the wounded, the conscripts had regained their composure. Now the real problem was a distinct lack of ammunition. I spent some time dividing up the remain rounds and added a now unarmed Marksman to the Assault team as there were no more 50cal rounds left. Most of my dead troops still had plenty of ammunition, but they're corpses were stuck in a crossfire.

   Not wanting to fallback to the Deployment area and have a dirigible rescue my guys, I tried again, this time heading for the smoking earth where my lead officer had died. There wasn't going to be an IED left there now so it was a safe route up the side of the hill.

   I headed out of cover, much wider than the first ill-fated attack, and had everyone sprint through the enemy fire, past the scorch blast left by the boobytrap, and scavenged equipment from the deceased. My Support team chewed their way through the last of the ammunition to give covering fire, and I suddenly had half my men sitting behind that bank playing cards and checking Twitter feeds for the rest of the battle. So it was all down to my increasingly small and barely armed Assault force.

   Storming up the hill I noticed a lack of incoming rounds, infact, I could see some of the enemy Ai starting to loot their dead for spare ammunition and weapons. As I'd never had a battle last long enough for both myself and the Ai to run dry of bullets I was pretty bally chuffed to see this in action in real-live gameplay rather than laboratory conditions of dev testing. As my Assault team's ammunition dwindled to naught there was a sudden close-range grenade duel on the hill but I was to the enemy dead first and rearmed. A final push to the top cost another dead conscript from wherever the hell that damn sniper at the other side of the map was hiding, but I seized the enemy's colours and won the battle.

-------------------------------

It had all been rather exciting, and nerve wracking, but showed me that my whole gameplay idea and the methodology of how I had been creating it was just what I had been after, 14 months ago when I first started.





And here is the final Campaign map. As you see I had tried my best to avoid cities as much as possible as they always have the largest number of enemies to face. I'd started off from the left, worked my way right up to the last few which are protected by the enemy Citadel's influence (more troops per hex). And that was when I got a bit stuck. Each hex captured which borders the hex you attack gives 4 troops, and for the final attack I just never seemed to have enough and so had to open up a new front all the way up the right side to attack from all available angles. If those 3 cities in the top(ish) centre had been other types of terrain I would have gone through them instead, but they simply were too much of an obstacle.




And here is the final tally. As you can see Sapper survived! Recce recovered from his medivac but was killed later. Out of all 77 victories, half of them were  aided by the bug mentioned above when the Ai only fielded basic forces. Total War Cost is blank because it was an idea I had at the end and thus only just implemented it - it shows exactly how much you spent over the whole war. Tax payers like to know these things ...

And finally, a short video demonstrating starting the campaign and then saving mid-battle and then reloading it with progress restored.


Wednesday, 18 July 2012

Long And The Short Of It, Working Campaigns and SaveGames

Long Campaign, Short Campaign, Save Game ... cos you can't really play through the whole thing in one sitting ... well, you could if you never have to ever do anything or go anywhere, but must people occaisionally have to.
And behold, there is a Short Campaign.

Don't have time to conquer an entire continent in a procedurally generated, airship fleet commanding showdown between the world's Great Powers, yet don't want to play through a one off, single tactical battle, but fancy something with a bit more longevity?

Then maybe the Short Campaign is for you. Also known as "The Citadel Campaign", "The Dastardly Pirate Citadel Campaign" ... and possibly a few other things until I work out the correct name which I shall ultimately call it. One thing is for certain, it has Dastardly Pirates and a Citadel ... actually that's two things ... Two things are for certain, it has Dastardly Pirates and a Citadel ... actually it doesn't have a real Citadel because I haven't made the model yet ... so you'll just have to pretend for the time being.

The Short Campaign comprises of a triangle of territories (hexes) reaching 8 or 9 at it's deepest point. They're all under the control of the Dastardly Pirates who send out flagons of treason from their Citadel Fortress right at the back, and it's up to the Regime of your choosing to blast their way through enemy territory and storm that Citadel.



Blank/blue territories are captured ones, and the player's regime gains cash and extra troops from wrestling them from enemy hands. Seizing fortifications allow for class upgrades. The deeper into hostile territory the player pushes, the more skilled and better equipped the opposition becomes. The player can only launch attacks from territories which they occuppy, and each adjacent captured hex gives additional troops for the assault.

And this is where the main part of the game is now fully functional. Yeah, in bold and everything.

From the "Campaign Overview" section, you select your troops, equip them, and then it's straight to the "Tactical Battle" mode where you direct your chaps around in hot turn-based squad tactical action! The end result it recorded, your veterans are upgraded or if deceased removed, successful conscripts get promoted into the veteran core, loot gets gathered, and the Campaign world is updated to reflect the changes, territories change hands, progress is made ... or not if you got your bum whupped by the opposition in the Tactical Battle.



And when the Campaign reloads, updates the changes, and it all continues. It's very much in the mould of the original X-Com "Geoscape" to "Battlescape" and back again - except you're fighting for possession of territory and territory change hands depending on battle results. And it all works - exactly as I'd envisioned (or at least hoped it would) when I first started, 13 months ago.


HUZZAR

In fact, 80% of game logic is complete and bug-squished. Obviously there's a bit of tweaking that can be done here and there, but it works. The Short Campaign Mode works in it's entirety, the Single Battle Mode works - though I've only one map at the moment and I've yet to introduce the Armoured Cavalry class option, and the old Long Campaign Mode (the thing with the airships) works save for 3 known bugs and a bit of tweaking.

And I've knocked up a save game system which works across all 3 game modes. Because of the various jumping back and forth in the Campaigns between "battle mode" and "campaign overview mode" it took a bit more effort than just saving out the current missiongroup. It's going to get a slight tweak to incorporate the difficulty level when displaying available saved games to restart, but apart from that it works as desired. Each game mode has 10 saves.



There is now also now a difficulty setting for campaigns, so the player can choose their own level of challenge.

In the video below is it all in action, abridged obviously as time and filesize are premium in both uploading and watching these sorts of things. There's also a little hiccup when I attempt to save from the "tactical battle" part first time as I had fix a bug and re-execute the gui to get the info to display correctly ... note to self: don't write a save game system at 5am ...

The combat is very abridged, just a little taster but if you've watched any of my previous videos you'll know the gist. As it's early on in the campaign both my troops and the Ai's are lowly conscripts with the most basic equipment, and thus have trouble hitting the broad side of barn. In the end the Ai throws in the towel and flees the battle area after taking a few casualties.