Re: Fourth Age screen shots
FA has progressed immensely in the past couple of days.
no, there's no new screenshots, this progression is under the hood...
I've completed a custom data structure for working with my data model in this game. it is a 'deepdict' data structure that can work with nested hash tables, returning values and doing comparisons no matter how deep or oddly shaped the tables are. this has not only made working with my data model much easier, i've been able to deprecate the host of odd typechecking functions that were driving me crazy. i've also managed to find ways to collapse other functions together. in all, everything is much more polymorphic now.
so you need to check if that item can be equipped?
its as simple as:
if item.fit <= unit.body
this checks that the hash table defining what body structure the item requires to fit is contained wholly within the unit's body. if anything is missing or out of place, it would false and the item would not be equipped. no matter how complex a body type or item fit someone comes up with, the interface to check for equipping is that simple, and that's what I'm shooting for. now stuff can be added almost wily-nily, and the game will handle it with grace.
also, i've made a minor adjustment to how items/units/skills are structured in the game data. everything has a unique id number, just like dominions. this way it is very easy to find the necessary data. even if things are in nested hash tables, the custom data structure can find keys no matter where they are, and since each object has a unique key, it is very easy to pull up the relevant data without being afraid of a mistake being made. of course, it requires everything have a unique id key, but I think that's a pretty reasonable requirement.
lastly, if you're wondering, items are stored at the bottom of whatever relevant hierarchy (the body fit for items, the skill tree for skills). i wanted it that way because it makes it a little easier and more parsimonious to add stuff. the deepdict data structure has functions for extracting the path to the requested item/skill so that it can be used to check for fitting or calculate skill bonuses.
|