TWiki Home Tharsis . Design . ObjectLibrary Tharsis webs:
Design | Guilds | Combat | Website
Design . { Home | Changes | Index | Search | Go }

Object Library

The need for the object library arises naturally out of some of the other systems we are planning. Mainly crafting and a dynamical world.

Recording the current state

We need to determine the state of the things that are already in play.

To this end I've (FantoM) built the first of several tools (or maybe they will all be the same tool) to allow players to walk around the mud and record the details of the things they find.

The tool for describing the body SHAPE of monsters is described in RecordingBodyShape

A daemon for giving bodies to things are getting its own shape in BodyAllocationDaemon

The object library:

  1. handles/stores the behaviour of data in items
  2. make us better able to alter the behaviour of each kind of item
  1. centralizes the data of items, opposed to the current area-based localization
  2. (contains data about each item, making it possible to for example craft them)
  3. should be able to generate items based to fit an area/theme

Datatypes

Inheritance

Any object is defined by the modification from the parts it consists of, and does not (?) contain data of its own.

Static

Modifier

Importance

Object Types

Example: sword

Example: blade

Example: Huffintot

Example: (from ObjectDatabase??) the evil iron sword of Huffintot

Definitions:
object/items - These are not just weapons/armours, but monsters/trees/spells as well as buildings/terrains

-- PumaN - 06 Feb 2003

We've experiemented in the past with isolated object libraries - one lib for each type of thing, rather than a global lib.

These were defined in xml and converted to a .h and a .o via an app I wrote. The .o was then loaded by an object library daemon, often a customised one for that library.

A sample xml for the weapon lib which I was experimenting with is

- <!-- 
 basic rules.
   If [inherit="xxx"] is specified for a weapon then all attributes of "xxx" for which "no-inherit" is not specified are inherited into the new weapon.
   If a weapon specifies a value for an attribute then ALL inherited values for that attribute are discarded.
   
   Weapons should alter their fragility based on the the type of thing they are hitting.
   Perhaps just alter the fragility of the most prevalent material.  IE the metal in a sword becomes more fragile if it hits stone, less if it hits bare skin.


  --> 
- <lib>
- <weapon name="weapon" desc="base weapon with no details set">
  <short value="base weapon" no-inherit="true" /> 
  <long value="An unconfigured base weapon" no-inherit="true" /> 
  <alias value="weapon" no-inherit="true" /> 
  <adjective value="base" no-inherit="true" /> 
  <value value="0" /> 
  <weight value="0" /> 
- <!-- 
 skill defines one way that this weapon can be used.  Allowable names are "co.me.*", "co.th.*".
         Also defined is the wc (weapon-class).
            The wc is an indication of how much damage the weapon can deal in a single hit.
            The wc provides a default value for difficulty-to-use, if that is not given.
         Also possibly given is "not-in-combat".  
            All skills that do not specify "not-in-combat" will be used randomly during combat.
         Also possibly defined is the difficulty-to-use.
            0->100.  0 is anyone can use, 100 is impossible to use by all 

  --> 
  <skill name="combat.melee.edged" wc="1" difficulty-to-use="100" no-inherit="true" /> 
- <!-- 
 a material defines what the item is made of.
         The "name" must map to a defined material name in the materials library
         The percentage is how much of the weapon is made of this.  No checking is expected to be done to
            ensure that the percentages total 100.  If not specified this defaults to 100.
         The material definition will provide default values for durability and fragility.
         The durability is how much damage the item can take before it is destroyed or unusable.  
            For a rule of thumb we will presume that each kilogram of the item will increase the durability by 10
         The fragiity is how easy it is to damage the item, 0->10.   Use the values below as a base then alter based on
            how likely the material is to be damaged when the item is in use.
            0 being impossible, 
            1 being almost impossible - adamtine/magically strengthened materials
            2 hard metals/composites
            3 chain mail
            4 hard woods
            5 
            6 studded leather, soft woods
            7 leather
            8 
            9 glass 
            10 objects made of sand or fluids 
         By default if a material durability reaches 0 the item is unusable.  If all materials reach 0 it is destroyed.
      

  --> 
  <material name="metal" percentage="100" durabilty="1" fragility="5" no-inherit="true" /> 
  </weapon>
- <weapon name="sword" desc="standard sword" inherit="weapon">
  <short value="sword" /> 
  <long value="A double edged two and a half foot blade. The pommel is a plain leather wrapped affair with no ornamentation. The last 4 inches of the blade tapers to a point providing a minimal stabbing ability." /> 
  <alias value="sword" /> 
  <value value="100" /> 
  <weight value="2" /> 
  <skill name="combat.melee.edged" wc="7" difficulty-to-use="28" /> 
  <skill name="combat.melee.pointed" wc="2" difficulty-to-use="25" not-in-combat="true" /> 
  <material name="metal" percentage="95" durability="20" fragility="4" /> 
- <!--  higher fragility due to the weapon loosing it's edge in use 
  --> 
  <material name="leather" percentage="5" durabilty="5" fragility="1" /> 
- <!--  very low fragility as it is hard to damage this bit in normal use 
  --> 
  </weapon>
- <weapon name="long sword" desc="long sword" inherit="sword">
  <adjective value="long" /> 
  <long value="A double edged five foot heavy blade. The pommel is a plain leather wrapped affair with no ornamentation. The last 4 inches of the blade taper to a point but the sheer weight of the weapon make it almost impossible to use this sword to stab anything at all. This is a ponderous weapon but one with the potential to deal substantial damage." /> 
  <value value="250" /> 
  <weight value="4" /> 
  <skill name="combat.melee.edged" wc="10" difficulty-to-use="40" /> 
  <skill name="combat.melee.pointed" wc="1" difficulty-to-use="60" not-in-combat="true" /> 
  </weapon>
  </lib>

Topic ObjectLibrary . { Edit | Attach | Ref-By | Printable | Diffs | r1.26 | > | r1.25 | > | r1.24 | More }
Revision r1.26 - 22 Feb 2005 - 13:22 GMT - FreD
Parents: WebHome
Copyright © 2001 by the contributing authors. All material on this collaboration tool is the property of the contributing authors.
Ideas, requests, problems regarding Tharsis? Send feedback.