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.

Monday, 27 February 2012

Feedback To Player When Nothing Is Happening

Waiting around, scratching yourself, wondering what the hell the Ai is up to ... if anything? Has it crashed? Locked in a loop? Waiting for input without telling you that it wants you to do something. Who knows?

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

I had noticed occassionally decals would not work as expected but didn't think much of it as it didn't seem related to the stability issues I had been experiencing. I'd ripped out my custom explosion stuff and gone back to using automated functionality, and whilst this had fixed my disappearing decal, it hadn't done anything for stability. Eventually I noticed that things were getting deleted, random things like GUIs, decal data, SFX, and other things which was causing the stability issue.

Now I'd had previous experience of this a long time ago in a galaxy far, far away - and knew that it was trying to clean something up, failing to find it, and then eating something else.

There had been an issue ... located somewhere between the chair and the keyboard ... that had crept in very early at the start. However it hadn't surfaced until 6 or so months later when I'd had the Ai team in and working with near complete functionality.

I was attempting to delete a decal in the Ai's move routine which the Ai didn't even own, when I should have been using the decal management system to simple remove it.

BY ODIN'S HAT! Either extreme crunch or a sudden outbreak of sobriety had caused such a faux pas.

And with that fixed, stability issues disappeared.

So onwards and er ... onwards!

After replacing all my custom explosion stuff - for the umpteenth ruddy time - I'd also rolled back a few other changes which I'd recently made. Ammo packs went back down to their original 5 from changed 10. This means that ammo might need monitoring on the high rate of fire weapons and various rocket/grenade launchers. The fact was packs of 10 rounds really seemed to stop bullets being a resource and I might as well have just gone for infinite ammo - which I very much do not want (apart from in the handfull of hugely expensive rechargeable energy weapons). I'd made various tweaks to weapon and ammo weights, ranges, stopping powers, and scrapped the original idea of grenades exploding at the end of a turn in favour of immediate detonation. There were far too many instances in testing of hurling a frag and then getting shot when trying to step back into cover afterwards - thus making grenades a liability rather than another tool of the arsenal.

I'd sorted out a whole load of Ai related thinky-thinky about equipment, decisions on using grenades, swapping weapons and finding more ammo if they run out. Which all took far too much effort to synchronize and stop them from changing their minds halfway through doing something. Various tweaks to initially equipping them were also made and some dodgy mathematics fixed.

All of which brings me to having the player wait for things.




When one of the player's troops comes under fire during their active turn, control is momentarily removed and then given back when the incoming projectiles have either impacted or burntout their lifespan. During the enemy Ai's turn, there's a lot of waiting around obviously - which does tend to happen in sequential turn based games, in fact it's supposed to happen or it wouldn't be sequentially turn based ... er ... obviously.

So I've developed a camera and information system to give the player feedback when they are in "passive mode" and do not have direct input control. This starts as a basic GUI announcement that it is the opponents turn, and some basic information about what is happening. At it's most basic this is a simple "Hidden Movement" announcement, telling the player that stuff is a-foot, but none of his little chaps can see it.

This progresses to giving feedback on things that are in the field of view of any of the player's troops, such as an enemy going beserk and shooting indescriminately, fleeing in panic, or walking into a booby-trap that the player had placed at the beginning of the battle. The camera moves to whichever trooper is the most relevant, displaying their Name, Rank and Class, and information about what is happening. This can be about that particular trooper being in danger, to returning fire, to viewing something passively such as enemy panic or new enemies spotted. Eventually I'm considering tweaking the "Hidden Movement" part of the passive phase so that the camera shows a random part of the map as scenery, rather than just lingering on the last trooper that had any information to pass on to the player.

All designed to keep the player up-to-date with pertinent information and views of the action during the phase when the player has no control.

And here's some vidya of it all in action. It starts off with me planting a shed-load of booby-traps ... which the Ai then avoids by using dual flanking manouevers ... ah bugger. This just happened to be the tactics it chose, the opponent not having any clue where booby-traps are until unless spotted by a "Recce" or "Sapper" class (Sapper's can defuse booby-traps by walking into them). The enemy do however walk into an IED on either flank and there's a bug displayed in the player info where the name of the viewing trooper is not displayed with the information (since fixed!). At the very end there's a little demo of me fragging the main group of IEDs and watching them set each other off with secondary explosions.

The majority of the video is just gameplay, with an emphasis on the camera and feedback system during the player's passive phase. It features "Stormy" weather type which has visibility of all troops reduced to 100 units. (There are 4 weather types with troop visibility ranging from 300 down to just 50 units/metres).





Next up, finishing off the Ai's decision making about which equipment to use in various situations, having the Ai take more advantage of cover, and use a wider dynamic avoidance rule when moving as they do still tend to knock into each other on corners. Also required is an end of battle screen featuring stats on how each trooper did, their current state, promotions, the chance to recruit new core troops from any deployed militia which did well in the battle, and an overall battle rating.

After that it's about sorting out armoured cavalry (also to give the sapper class something to act against as an equaliser with all of it's explosive class-based weaponry), make sure the whole thing loads and saves correctly, and then it's about time to make some proper maps/battle arenas for the post-alpha game.