Sunday 17 July 2011

TorqueTactics: Magnets! How Do They Work?! I Mean Inventories ...

Fuuuuu --- Magnets!

TorqueTactics/Torque X-Com Style GamePlay Month 2:

So I sorted out a custom inventory system ... eventually ...

Not wanting a gazillion items spilling out and rolling around the game-world, I decided on a simple system (it wasn't). I'd have 3 item types that could be scrolled through back and forth - weapons (guns! etc), ammunition (bullets! etc), items (Hankerchief! etc), and this would be mimicked in the "dropped item cache" which is a bag full of whatever got dropped.

Caching dropped items at a location obviously prevents having to render all of them together, especially useful when ammunition was divided into 5 round stripper clips and a dead team member could drop an imperial tonne of them the moment they left this mortal coil.

So that's 3 arrays of objects for the playerObject's internal inventory, and another 3 for whatever has been dropped (if anything) at that location. And then there are another 3 options that you can do, pickup, drop and use ... somehow it just seemed like more than the 27 possibilities that it was ...

And boy did it take some bughunting to get everything working within those 27 combinations ... I promptly massacred a pack of post-it notes ...





I've also got a system of attributes for each little in-game chap which affects various gameplay parameters. Strength is the important one when it comes to lugging stuff around and off-setting your aquired encumberance. (though in the above pic, that guy ain't going anywhere!) When encumberance exceeds strength it'll start to eat into your available action points.

"Throw" button isn't currently sorted out as it's going to use the same equation as hurling grenades. Everything visible is placeholder artwise for the time being. Everything else in the inventory works as expected and the big missing preview will be an image of the "Class" of the team member rather than individual portraits cos that'd just be nuts considering how fast you can go through fellas when your tactics all go wrong ...

Pior to this little hiccup, I was hoping for inventory completion in just one week (lol, yeah right), it's taken about 17 days ... including a few go slow days where I went to the pub for a couple of small ales and a sit in the sun to top up my vitamin B or F levels or whatever the hell solar radiation gives out that's good for you ...

Anyhoo, back on track for July - the remaining of which will be spent sorting out the Ai ClientPlayer/commander and turning the enemy squad into some sort of team-based, tactically co-ordinated entity capable of using different strategies dependant on mission objective, battlefield conditions, weapons available, etc, etc.

As the Ai are also going to be using this custom inventory system, it was important to get it functioning.



Fuuuu - magnets! Why are they so hard to debug!?