And still laziness…

Only 2-3 more weeks and 5 tests before I can start to work on this with some regularity!

-Sidenote for WAY later: Dynamic traps ALA Dwarf Fortress controlled lava flows.  But not as ripoff’y as that.

Well there’s some progress…

Implementing a simpler version of a cfg reader wasnt too complicated, now the wacky part is to make it semi efficient.  Currently I have something that picks a random number, and from that decides which item quality (defined in a cfg) and which item type (also defined in a cfg) and what bodypart it is and calculates some stats for the item as well.

‘Course, I’d also like to minimize how often a ConfigParser object gets made and if I could store the CFG into memory or as an object and work with it that way, it’d be nice.  Except now I have to figure out an efficient way of spitting out all values of a tree with an arbitrary number of branches in order.  Currently it just iteratively loops through the tree with each depth level, making what I think is O(A^n) efficiency, which is a tad too slow methinks.

So its April…

Hurray weather being crappy.  Been staring at this code some more, and I’m thinking a heirarchy of inventories just wont work out.

I tried mapping out some test items for some fun with ConfigReader to get it to recursively run through a .cfg file and spit out a value dependent upon the path taken, but adding in every single item into this is just going to get too massive with a lot of copypasta.

Currently I’m thinking of just armor–there’s Light and Heavy armor, 2 types right there.  Those split into 3 subtypes each (Say, Leather/Bone/Mail and Iron/Steel/Plate), and each of those split into their own armor sets for Head/Hands/Legs/Chest/Feet, giving-just of those ones-40 total items to type into a cfg thing.  There’s a bit too much gruntwork for inputting by hand the stats for Leather Cuirass, Steel Cuirass, etc, let alone modifiers for some randomization (worn, good, great, etc) and on top of that some other things I’m thinking up will make this just too complicated.

So, obviously I need an alternative way that makes Python and the game do the work for me.

Breaking it down into components, there’s only 8 armor types, and 5 armor locations.  If I write up a system that has base values fro armor in a given location, and work with just modifiers (IE, fill hand slots with something and you’ve got +2 defense, if it’s leather +4, worn leather its +3, etc), I can assign base qualities for each place and modifier.

The stats (at minimum) that would need to be tracked are: Picture location on the spritesheet, armor rating, armor type, weight, value, and a description of the object.  The only tricky thing would be sprite coords, but if I can rearrange the Player.png file so that the modifiers each have patterns that affect tilelocs, then that shouldnt be too much of a worry.

Plus I can test this out with plain old Python and not even worry about integrating it with pyGame and SDL!