[CF-Devel] Technical Object Questions

Chachkoff Yann yann.chachkoff at mailandnews.com
Fri Aug 3 08:53:21 CDT 2001


About the object classes/subclasses...
What do you think of a simple "Object tree" ? I was thinking of a hierarchy 
of objects like this one (it is only an incomplete example !):

Object
 - Non-living
 -- Weapon
 --- Swords
 --- Knives
 --- Poles
 -- Armour
 --- Body armour
 --- Helmet
 --- Gloves
 --- Boots
 -- Jewels
 --- Rings
 --- Talismans
 -- Organic
 --- Food
 --- Body parts
 -- Misc.
 --- Furniture
 --- Walls
 - Living
 -- Player
 -- Monster
 ---NPC

And so on.
The common functions used by all objects (query_name for example) could be 
referenced in the archetype itself (by function pointers). If a specific 
subclass of object requires a different procedure, simply reference another 
one in its archetype. This could give more flexibility to the code, because 
it would allow a clear separation of "What the server should do" (the rules 
of the game and the global interactions between objects) and "What the 
objects do" (The server no longer need to know how the object store its 
datas).

I know that it could be a lot of work. I just want to know:
 - If anyone is against the idea (and the possible objections);
 - If anyone has an idea for a complete object hierarchy;

>
     
       Longer term, I could also see weapons getting changed around some.
     
     >
     
      For example, think of these types:
     
     >
     
     
     >
     
      Knives (dagger, knife, shortsword)
     
     >
     
      swords (as described above)
     
     >
     
      pole (as described above)
     
     >
     
      bludgeoning weapons (mace, flail, club, hammer)
     
     >
     
      cleaving weapons (axe)
     
     >
     
      two handed weapons (either as a total type, or another one for each of the
     
     >
     
       above)
     
     >
     
     
     >
     
       Two handed weapons would prevent use of a shield.
     
     >
     
     
     >
     
       In addition, some weapons could be more/less useful against certain
     
     >
     
      things. If you go back to old AD&D, things like daggers and spears are not
     
     >
     
      very effective against skeletons, but hammers are.  Also, the melee weapon
     
     >
     
      skill could get broken out into a skill for each weapon type, with the
     
     >
     
      ability to learn certain things limited (the wizard won't be able to learn
     
     >
     
      cleaving weapons for example).  This could get used to add more flavor to
     
     >
     
      some of the classes.
     
     Maybe reusing the old Advanced Combat System ideas and preliminary code could 
be interesting for that ?

Chachkoff Y.

    
    


More information about the crossfire mailing list