Sign in to follow this  
WithoutRemorse

About character / item file formats...

Recommended Posts

WithoutRemorse    138
I have a good idea now about the kind of information I want to store about characters/objects within a game I'm developing as a sort of hobby. It's still far from completion; I've just decided to use the OGRE engine as the basis for my graphics as opposed to developing my own math libraries, my own image file loaders, etc. Now my situation. Characters. I want to be able to save information about wounds/poisons/diseases such that characters can have -- multiple wounds of varying type, condition and effect on various body part locations. Thus, a character could have a slight bleeding wound on his leg, a slight bleeding wound on his head and a seperate wound on his head that's caused a concussion. -- multiple poison types/effects, possibility of exclusive types of poisoning; for example, drinking a bit of arsenic would cause problems throughout the character's body and drinking even more wouldn't cause another, seperate arsenic poison condition, while a spider's bite on the arm may only paralyze it somewhat and another spider bite on the leg may paralyze that. -- multiple diseases with the possibility of exclusive types of diseases. Generally similar to what poisons are described. Items. Item information is going to be particularly difficult for me because I want a truer "infinite" modability than I have seen before (of course I haven't played many new games the past few years). For example (not a good example, just an example), a gladius-type "short sword" made of steel, blade coated with zinc, with a silk-wrapped handle, made in the Iberian style, made with a certain skill, currently in such-and-such condition, provides extra penetration with thrust/pierce type attacks compared to other gladius/type swords. I've tried creating templates for these items, but I found the storage becoming unnecessarily large with such tragic lines of code as element_resist[6] = [0,0,0,0,0,0]; There just has to be a better way of doing this. I'm now thinking that if an item's going to, say, add no resistances, then won't need to store that info, but if it needs to store "resist 10" fire and 5" mind" then only save those two resists; don't add all the zero's into the storage. I've taken a look at ultimategameprogramming.com's Quake 3 PVS loader and noticed how they used "lumps" for determining file location offsets for dynamic information. This seems to be a much better strategy than my static information scheme with such travesties as the above-quoted code, and I think something like it might be modified for use for what I had in mind with the dynamic character wound/poison/disease and similar information for items. Of course I'm open to other, better ideas; custom loading/storing with files on the HDD like this is a bit new to me. EDIT: All development is in C++ now, in VS .net 2003, but I'm hoping to make it portable to Linux.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster


Think along the lines of 'inherited class' attributes. Your items will have a set of attibutes that are classes which themselves have sets of attributes (and can be members of other classes if needed). You will need specifics like how much rust the sword has (percentage of surface??) Many items will have most of their attributes being inherited as defaults from these classes and some original deviations from a 'standard' (ie- a standard gladius) and specifics the result of modification from the standard.

Unfortunately a system like this requires alot more time to fetch the attributes when you need them -- hash table lookups on a series of classes (and you may need to try caching strategies to minimize fetching the same attribute over and over).

The detail level it sound like you are describing also sounds more complicated -- more attributes have effects on actions taken, and different ones for slightly different actions and situational factors (that silk wrapped hilt increases grip friction some ammount when you do hand slip checks every phase of a sword stroke.... and the wound on the hand changes the friction as well one way if the blood is dried or still wet..... )


Of course if you make alot of these detail attributes only cosmetic (and dont have to apply most of them to affect the players actions) then it might not be as bad.....


Share this post


Link to post
Share on other sites
WithoutRemorse    138
Oh, of course! I forgot about inheritance. I'll need to look it up, but it has promise if it can do what I think it does from my cursory searches. One thing I've learned though, is to inline the class code to improve speed at the cost of memory, which should work well as we move to bigger and badder memory modules. But this sort of inheritance on a small set of active object classes is going to be the least of my worries as far as performance hits go.

But since this is just a hobby, I'm not going to make any claims about something that might not turn out at all (my new Blissard Interntainment's Whirled of Whorecraft 10: Rebirth of Azathoth (TM) now lets you reach level 1,000,000,000,000,000 and crush planets with your pinkie and we have real-time ray-tracing and use quantum math and make you a bigger 'man', if you know what we mean, wink wink!).

If nothing else I'll improve my coding skills.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this