Thursday, 31 May 2012

I Break Everything And Then Fix It! Oh The Exciting Life Of Indie Deving!

I had a liver detox diet, lost the strange bicycle tire which had appeared around my torso, eat more fruit than anyone had ever eaten before, took up skipping - which is knackerising - bought a few crates of ale and a bottle of baffling expensive rum under the guide of death metal celloist (it was a very pretty bottle),
sat about in the garden because it had finally stopped raining in the Shire of York after the wettest Spring since 1907. And even found time to break everything that I'd done dev-wise whilst trying to fix it.

So I ended up changing my art style again ... immediately after I'd decided on what it was going to be ...

So it is now more "painterly" and less "abstract".


I'd done a bit of refractoring my working level, shrinking the size of the hedges a little and opening more gaps between them. I'd also noticed that I'd been getting a fair few failures on pathfinding with the Recast resource. My terrain is very bumpy and I'd set >1500 custom class CoverNodes about and done pathfinding between them with an automated script to test around 7 million paths. Initially I'd a rather worrying 2.5 million failures, and after a bit of saving throws in my pathfinding scripts, I'd got that down to <200k, and then thrown in a simple "move to nearest node where you can actually get a path" incase that 3.7% failure rate occured in game.

I'd improved my Ai, getting them to make decisions about when they should try and hide from the player. Previously they'd either stopped at distance if they were "support" or advanced if they were "assault". I've always been a fan of turn based strategy/tactics games ... which is why I'm making one obviously ... but sometimes their Ai has been a bit ... daft. Steel Panthers I'm looking at you. I added in a whole load of new thinking to make the computer act more in the way a player would, but still using it's randomized battle plan.

Suddenly my Ai were filled with awesome and powered by buttkicking, so it was time to remove all the little helpers I'd given them previously to make them more competitive, like maxing out their stats, they now get the same chances for decent stats as the player.

Which all goes to make battles more competitive, varied and fair.

Somewhere amongst all of this I'd noticed a few bugs so I'd fixed them, and thus managed to break "many things", again mostly pertaining to the Ai. After a fair bit more hitting IDE with a mallet I got things working again as they should do.


I'd also made a start on creating some player characters - or at least a "base character". I'd looked at some of the meshes that I'd got from Evolver for use in Blender some time ago, and studied one of these as a base for rigging and animating a custom character. I'm doing a SteamPunk vibe, so everyone "struts imperiously". I'm still using Ye Olde Blender 1.44 with DTS exporter 0.964, though I export with collada for the foliage/trees/bushes so I can use vertex painting.

I'd also made a whole load of improvements to my GUIs, such as adding a new button for reserving a shot at half maximum range if you don't want your little chap to be wasting shots on things miles away that he's unlikely to hit. In "loadout" I'd also added the ability to equip one chap and then have his equipment cloned to all unequipped troops - money and individual strength/encumberance permitting - which is incredibly useful when you have a bag of Conscript Militia who can only use basic equipment until they get promoted ... should any of them survive the battle.

Still to do is a bit more Ai thinking tweaking, a bit more environment tweaking, creating some finalized models for troops and weapons, testing the assault and defend gametypes, doing the art for GUIs, and errr ... general stuff. My bug fixing list gets smaller, my todo list doesn't seem to. Oh the exciting life of Indie Deving!

tl;dr good things happened, bad things got fixed, I'm eating a lot of fruit.

Thursday, 12 April 2012

Stylized Art Style is ... er ... Stylized, Plus Other Stuff

So after much "umming" and "ahhing" and even a bit of "harrmuphing", I settled on an art style I settled on an art style and booted up Ye Olde Blender and Le Gimp deux point six.




Harrumph.

A long time ago in a galaxy far, far away ... well, a long time ago anyhow, in a previous project, I'd long since dispensed with the idea of using "all the pixels". To be honest, I'd never entertained the concept of using "all the pixels" and had always favoured the stylized approach eschewing grey and brown.

But stylized is kind of a broad brush ... initially I'd attempted much more cartoonish, slapping a cartoon outline shader on it, but visually, it ended up looking really busy. Eventually I ended up drawing things out hand roughly, and then applying various filters in gimp until I got something stylized and simplified which I liked. Same process for the modeling in Blender, keeping things fairly simple, and then slapping stylized, manipulated textures on them, and doing some final tonal tweaking using the "diffuseColor" in material in T3D's material editor.




Behold! Stylized terrain! Behold! Colour! ... spelt with a "u"!

Now I also have a randomized weather system which I have whined on about before. Each weather type changes the viewable/spotable distance of targets on the battlefield. If you can't see it, you can't attack it (regardless of whether you've got a weapon with the neccessary range). So we have the same scene in the pic below in all 4 weather types.

Clear - 300m spotting
Cloudy - 200m spotting
Stormy - 100m spotting
Night - 50m spotting






Apart from the ground cover (grass) which was part of an art pack and may or may not be replaced eventually and the rain texture which will be replaced soon, everything else is custom, minus the player model obviously ... but that will be on the list to sort out pretty soonish, as I'm in the process of defining an alpha/beta demo. And then ... ????, because I am working on the classic plan of:

1. Make Computer Game
2. ????
3. Profit!

It's the middle bit which is going to take some thinking about ... and of course I'm still working on 1 in the meantime. And it is 1 which has been expanded, with two new battle modes for the squad tactics battle part of the game. Technically it's one battle mode with two sides, as it's attack and defend a HQ, symbolized as the regime's flag. In the main campaign mode (big thing, lot's of dirigibles and hexes) attacking a territory (or your territory being attacked) will result in either a clearance mission or an assault/defend mission, depending on whether or not the territory is under garrison protection.

In assault/defend gametype, the attacker attempts to storm the enemy HQ by moving into contact with the defender's flag within 30 turns (more than enough to accomplish the task or be routed trying). I've got the Ai to use booby traps if they are on the defensive (can be spotted by recce and sapper classes and defused/captureed by sappers and prematurely detonated by any other explosion) and have some available, and created tactics for their defence when protecting their HQ flag.




Amusingly, whilst doing all 6 factions flags (plus pirates), I had to check which way up a British flag goes ... apparently the wrong way is an international distress symbol - but you'd need keen eyes to spot that ...

I'd also decided to tidy up the last few loose ends of my Ai scripts, mainly to do with choosing what weapon is best under certain circumstances and how best to rearm from deceased troopers, ... and promptly found some of them to be a right old mess when reading back through them. So the old flow-chart was dusted off again for a major refit of Ai decision making. Still pending.

I've also changed the pathfinding solution that I was using and have now integrated recast - which I had previously used in a few resources enabling Ai in deathmatch in Torque3D's stock Chinatown showoff map. Read the instructions carefully for integrating recast if you've got Torque and fancy ago.

No video of it all in action yet.

So, still to do ... things ... many things ... create initial custom player types with all the animations, sort out the artwork for the GUIs, bang up a playable demo, wonder about aplha/beta funding and whether to do it ... or indeed how to do it.

Harrumph, harrumph, harrumph ...

Wednesday, 14 March 2012

Post Battle Reports, Promotions, Recruitment, Losses

 Post battle reports! Randomized Camera placement during enemy hidden movement to increase the tension and stop the player from getting bored! Promotions! Recruitment! Doom! Exclamaition marks!
-----------------------------------------------------------------

All good things come to an end ... also ... bad things. And which it is is all rather dependant on your performance during the battle. Introducing ... Post Battle Performance Screen! With an individual breakdown of each troops performance, kills and status, featuring the ability to recruit new conscripts who did well - and survived - into your core veteran troops, as well as dismiss (I actually use the term "retire", it's kinda nicer, like you're sending the old fellow back to enjoy his twilight years rather than just sacking him out of hand) veterans which you think aren't up to it, or that you have just ended up with too many of one class and need to make room for different class members.


 
Win!

Initially I'd thought of allowing the player as many veterans as they liked ... or at least could get to survive, but eventually decided on restricting it to just 16 - and 6 classes into 16 does not make 3 each. So the player is forced to evaluate his replacements for each battle carefully. I have been thinking that this might be a little on the stingy side ... but there needs to be a limit somewhere or else the value of a veteran will start to wane - and I want them to mean something to the player, for the player to be struck with panic when he sees his favourite Marksman Captain fall under a hail of bullets, feel a sudden wave of relief when they see the "critically wounded" sign appear over the still twitching body ... and then panic again whilst trying to find someone with a firstaid kit who can get over there and have the casualty saved by medivac.



Individual results

Conscripts who survive and gain at least one kill are then converted into the rank of Lance-Corporal and whatever class their initial attributes decide that they are best suited to. Surviving veterans also increase their experience. Killing enemies increase experience, and killing an enemy who is better than the trooper who felled them doubles the experience.
So here is the simple formula:
Survive = 1 xp
Kill enemy equal or weaker = 2 xp
Kill enemy stronger = 4 xp
Promotion on 5 xp + rank level.
So a corporal (rank 2) needs 7 xp for promotion, whilst a Captain (rank 6) requires 11 xp to become a Major. If the Captain bags a couple of Colonels and a Brigadier, he's promoted. Score 4 Sergeant-Majors and he's still 2 xp short after surviving a mission.



Promotions and recruitments

I've designed a formula on overall battle performance, depandant on troop numbers, experience, weapon advancements and funding, which give 24 different types of final result depending on victory or defeat. This would seem to be the ideal thing to turn into achievements eventually too, but for now it's just to give the player feedback how they did. Every weapon that is lying around or in the victorious side's possession has it's financial value added up and is then awarded to the victor's team. If you've fought and defeated a well equipped side with basic weaponry you can turn a tidy profit, or at least offset the cost of deploying veterans. Veterans cost 10 cash (which will probably be sovereigns in the final thing) per rank level, consript milita are free to deploy.



Bum whupped ... but I was outnumbered 2-1


All your promotions, losses, retirements and recruits are duly noted and saved out to your veteran file, so when I have the whole thing intergrated with the campaign, there's already a fully functioning system for saving and progressing your troops.

In other news, I've created a new feedback system of randomly locating the camera during the enemy's turn so that it will show a random location every time the enemy switches to initiate a new trooper. This is another little thing of feedback to tell the player that stuff is happening and the game hasn't locked up and make passivity a little less dull.



And that didn't go so well :(

And here's a video showing a whole load of stuff about that. And if you're wondering about the names, I was playing as the Zulu Nation (names done as givenName surName regardless of faction culture).




I've also gone and redone a whole load of behind the scenes stuff like alter the whole way targeting is done and integrate it into other systems like action point deduction during movement. Originally I'd had multiple schedules running and various overlapping - all of which had to be cancelled at gazillions of possible places depending on various factors and various emergency calls having to be made if it all ended on odd cycles. Things are now much more streamlined - though obviously I created a shedload of new bugs which I have since fixed.

Still to do, still to do ... plenty! I've got to fix the bugs (read - rewrite) in the Ai's ability to find dropped ammo and weapons when they need them, sort out enemy boobytraps, get the Ai to decide on the best solution when attacking an armoured target, redo the playHUD, try a new pathfinding and cover node concept, transfer hidden movement cam to this (at least this one should be easy), create my own preload of data or integrate middleware (I've bought middleware called AFX2 by Jeff Faust that can do this amongst other things but have been implementing my own concepts of various things in it without referencing it as this helps me think and learn ---- though Jeff's methods are all far superior to my hacky make it up as I go allow route), create armoured cavalry, fix the flammenwerfer which has too many drawbacks for something very expensive, make sure the save/load system works fully, herp the derp, etc, etc ... but to be honest we're not that far from needing to create an actual map with proper assets and to end our testing (our = Royal "we" ... it is just me and the imaginery girlfriend) on these quickly made test arenas. It's just that I'm mindful of trying to avoid the constant chop and change between making assets and functionality.