From The Mana World
m
(added example)
Line 1: Line 1:
{{Status_red}}
{{Status_red}}
{{Status_construction}}
{{Status_construction}}
''TODO: Create complete examle entry''


This is a draft for the new XML-based monster database which is shared between the new server and the new client.
This is a draft for the new XML-based monster database which is shared between the new server and the new client.


== Example file ==
===Complete version===
<pre>
<pre>
<monsters>
     <monster id="1" name="Maggot" targetCursor="small">
     <monster id="1" name="Maggot" targetCursor="small">
         <sprite>monster-maggot.xml</sprite>
         <sprite>monster-maggot.xml</sprite>
Line 17: Line 20:
         <drop item="502" percent="0.7"/>
         <drop item="502" percent="0.7"/>
         <drop item="522" percent="0.1"/>
         <drop item="522" percent="0.1"/>
        <attributes
            hp="100"
            size="8"
            speed="300"
            attack-min="10"
            attack-delta="2"
            hit="10"
            evade="10"
            physical-defence="5"
            magical-defence="0"
            />
        <vulnerability element="fire" factor="1.5">
        <vulnerability element="earth" factor="0.7">
        <exp>10</exp>
        <behavior
            aggressive="false"
            cowardly="false"
            attack-distance="32"
            />
        <attack id="1"
            priority="1"
            type="physical"
            pre-delay="10"
            aft-delay="5"
            damage-factor="1"
            range="32"
            angle="10"
            animation="attack"
            />
    </monster>
</monsters>
</pre>
=== Censored client version ===
<pre>
<monsters>
    <monster id="1" name="Maggot" targetCursor="small">
        <sprite>monster-maggot.xml</sprite>
        <sound event="hit">maggot-hit1.ogg</sound>
        <sound event="hit">maggot-hit2.ogg</sound>
        <sound event="die">maggot-dying1.ogg</sound>
        <attack id="1"
            animation="attack"
            />
     </monster>
     </monster>
</monsters>
</pre>
</pre>


"required" means that the tag/attribute MUST be defined. "recommended" means that the tag/attribute can be omitted but it is usually not advisable to do so. "optional" means that the tag/attribute is not necessary in every case.
==Documentation==
 
"required" means that the tag/attribute MUST be defined. When a required tag/attribute is missing the whole entry should be ignored by the parser.
 
"recommended" means that the tag/attribute can be omitted but it is usually not advisable to do so. When a "recommended" tag/attribute is missing the parser should output a warning but process the entry normally.
 
"optional" means that the tag/attribute is not necessary in every case.


"Client" means that the tag/attribute is client-sided and '''can''' be omitted from the server file. "Server" means that it is server-sided and '''should''' be omitted from the client file to avoid spoilers. "Client+Server" means that the information is used by both the server and the client and has to be identical.
"Client" means that the tag/attribute is client-sided and '''can''' be omitted from the server file. "Server" means that it is server-sided and '''should''' be omitted from the client file to avoid spoilers. "Client+Server" means that the information is used by both the server and the client and has to be identical.


== monster ==
=== monster ===
One monster entry in the database.
One monster entry in the database.
;id:(Client+Server, required) Unique monster type ID used to identify the monster type in the netcode.
;id:(Client+Server, required) Unique monster type ID used to identify the monster type in the netcode.
Line 30: Line 85:
;targetCursor:(Client, recommended) Size of the target cursor.
;targetCursor:(Client, recommended) Size of the target cursor.


== sprite ==
=== sprite ===
(Client, recommended)
(Client, recommended)
The sprite definition file which is used as a graphical representation of the sprite (relative to data/graphics/sprites). There should only be one sprite tag for each monster.
The sprite definition file which is used as a graphical representation of the sprite (relative to data/graphics/sprites). There should only be one sprite tag for each monster.


== sound ==
=== sound ===
(Client, optional)
(Client, optional)
;event:(required) The situation in which the sound is played. Possible values are "hit" (the monster attacks), "hurt" (the monster is hit by an attack) and "die" (the monster dies).
;event:(required) The situation in which the sound is played. Possible values are "hit" (the monster attacks), "hurt" (the monster is hit by an attack) and "die" (the monster dies).
A sound file relative to data/sfx which is played at various events related to the monster. There may be any number of effect tags. When there are multiple sound tags for the same event a random one of them is played.
A sound file relative to data/sfx which is played at various events related to the monster. There may be any number of effect tags. When there are multiple sound tags for the same event a random one of them is played.


== drop ==
=== drop ===
(Server, optional)
(Server, optional)
;item:(required) ID number of the dropped item as listed in items.xml
;item:(required) ID number of the dropped item as listed in items.xml
Line 45: Line 100:
An item the monster can drop when it is defeated. Every monster can have an infinite amount of drops.
An item the monster can drop when it is defeated. Every monster can have an infinite amount of drops.


== attributes ==
=== attributes ===
(Server, required)
(Server, required)
The character attributes of the monster. The basic attributes like strength, vitality and so on are derived from these attributes instead of the other way around like it is done for player characters. It is easier for the server administrator to assign reasonable attributes to the monsters when doing it this way. All properties are required.
The character attributes of the monster. The basic attributes like strength, vitality and so on are derived from these attributes instead of the other way around like it is done for player characters. It is easier for the server administrator to assign reasonable attributes to the monsters when doing it this way. All properties are required.
Line 59: Line 114:
;magical-defence: Defence against magical attacks
;magical-defence: Defence against magical attacks


==vulnerability==
===vulnerability===
(server, optional)
(server, optional)
Damage factors for elemental damage. All elements are optional. When an element is omitted it is assumed to be 1.0 (normal damage):
Defines an elemental vulnerability or resistance.  
;fire:
;element: (required) Name of the element the monster is vulnerable/invulnerable against
;water:
;factor: (required) All damage the monster receives from the element is multiplied with this valie.
;earth:
;air:


== exp ==
=== exp ===
(Server, recommended)
(Server, recommended)
Experience reward for defeating the monster.
Experience reward for defeating the monster.


== behavior ==
=== behavior ===
(Server, required)
(Server, required)
General behavior of the monster AI
General behavior of the monster AI
Line 80: Line 133:
;attack-distance: Prefered distance to the enemy the monster tries to reach when in combat (horizontal or vertical)
;attack-distance: Prefered distance to the enemy the monster tries to reach when in combat (horizontal or vertical)


== attack ==
=== attack ===
(Client+Server, optional)
(Client+Server, optional)
An attack the monster can perform. A monster can have multiple different attacks.
An attack the monster can perform. A monster can have multiple different attacks.

Revision as of 06:11, 9 January 2008

This article is currently only a proposal

The features or design guidelines described in this article are only a proposal made by one or some persons. It has not been evaluated or accepted by the core development team yet. Feel free to add your personal opinion about them or make counter proposals.

Outdated template, please use Template:Status Under Construction to mark pages as unfinished.

This is a draft for the new XML-based monster database which is shared between the new server and the new client.

Example file

Complete version

<monsters>
    <monster id="1" name="Maggot" targetCursor="small">
        <sprite>monster-maggot.xml</sprite>
        <sound event="hit">maggot-hit1.ogg</sound>
        <sound event="hit">maggot-hit2.ogg</sound>
        <sound event="die">maggot-dying1.ogg</sound>
        <drop item="505" percent="8"/>
        <drop item="518" percent="4"/>
        <drop item="501" percent="1.5"/>
        <drop item="533" percent="1.5"/>
        <drop item="502" percent="0.7"/>
        <drop item="522" percent="0.1"/>
        <attributes
            hp="100"
            size="8"
            speed="300"
            attack-min="10"
            attack-delta="2"
            hit="10"
            evade="10"
            physical-defence="5"
            magical-defence="0"
            />
        <vulnerability element="fire" factor="1.5">
        <vulnerability element="earth" factor="0.7">
        <exp>10</exp>
        <behavior
            aggressive="false"
            cowardly="false"
            attack-distance="32"
            />
        <attack id="1"
            priority="1"
            type="physical"
            pre-delay="10"
            aft-delay="5"
            damage-factor="1"
            range="32"
            angle="10"
            animation="attack"
            />
    </monster>
</monsters>

Censored client version

<monsters>
    <monster id="1" name="Maggot" targetCursor="small">
        <sprite>monster-maggot.xml</sprite>
        <sound event="hit">maggot-hit1.ogg</sound>
        <sound event="hit">maggot-hit2.ogg</sound>
        <sound event="die">maggot-dying1.ogg</sound>
        <attack id="1"
            animation="attack"
            />
    </monster>
</monsters>

Documentation

"required" means that the tag/attribute MUST be defined. When a required tag/attribute is missing the whole entry should be ignored by the parser.

"recommended" means that the tag/attribute can be omitted but it is usually not advisable to do so. When a "recommended" tag/attribute is missing the parser should output a warning but process the entry normally.

"optional" means that the tag/attribute is not necessary in every case.

"Client" means that the tag/attribute is client-sided and can be omitted from the server file. "Server" means that it is server-sided and should be omitted from the client file to avoid spoilers. "Client+Server" means that the information is used by both the server and the client and has to be identical.

monster

One monster entry in the database.

id
(Client+Server, required) Unique monster type ID used to identify the monster type in the netcode.
name
(Client, recommended) Name that is displayed when the monster is targeted.
targetCursor
(Client, recommended) Size of the target cursor.

sprite

(Client, recommended) The sprite definition file which is used as a graphical representation of the sprite (relative to data/graphics/sprites). There should only be one sprite tag for each monster.

sound

(Client, optional)

event
(required) The situation in which the sound is played. Possible values are "hit" (the monster attacks), "hurt" (the monster is hit by an attack) and "die" (the monster dies).

A sound file relative to data/sfx which is played at various events related to the monster. There may be any number of effect tags. When there are multiple sound tags for the same event a random one of them is played.

drop

(Server, optional)

item
(required) ID number of the dropped item as listed in items.xml
percent
(required) Probability of item drop in percent.

An item the monster can drop when it is defeated. Every monster can have an infinite amount of drops.

attributes

(Server, required) The character attributes of the monster. The basic attributes like strength, vitality and so on are derived from these attributes instead of the other way around like it is done for player characters. It is easier for the server administrator to assign reasonable attributes to the monsters when doing it this way. All properties are required.

hp
Initial and maximum hit points of the monster.
size
Radius of the bounding circle of the monster in pixels.
speed
Movement speed of the monster.
attack-min
Minimal damage of attacks with a damage factor ot "1"
attack-delta
Difference between minimal and maximal damage of attacks with a damage factor ot "1"
hit
Hit accuracy of physical attacks
evade
Evade accuracy against physical attacks
physical-defence
Defence against physical attacks
magical-defence
Defence against magical attacks

vulnerability

(server, optional) Defines an elemental vulnerability or resistance.

element
(required) Name of the element the monster is vulnerable/invulnerable against
factor
(required) All damage the monster receives from the element is multiplied with this valie.

exp

(Server, recommended) Experience reward for defeating the monster.

behavior

(Server, required) General behavior of the monster AI

script
(optional) Filename of a Lua script that controls the monsters behavior. Should only be used for rare monsters to reduce server load. (makes all other tags unnecessary)
aggressive
(required) Does the monster attack without being provoked? Values are "true" or "false".
aggression-range
(required when aggressive="true") Distance the monster tracks enemies in in tiles.
cowardly
(required) Does the monster flee when attacked? Values are "true" or "false". Combining aggressive="true" with cowardly="true" results in a monster that uses hit&run tactics (attacks unprovoked and flees when the target fights back).
attack-distance
Prefered distance to the enemy the monster tries to reach when in combat (horizontal or vertical)

attack

(Client+Server, optional) An attack the monster can perform. A monster can have multiple different attacks.

id
(client+server, required) Id number of the attack (unique for each monster) used to identify the monster type in the netcode.
priority
(server, optional) How likely the monster is to perform this attack when it got multiple attacks.
type
(server, required) Type of attack. Values are "physical" and "magical".
pre-delay
(server, required) Delay in game ticks between the decision to perform this attack and performing it.
aft-delay
(server, required) Delay in game ticks after the attack until the monster can act again.
damage-factor
(server, required) Multiplier applied to minimal and maximal damage as they have been calculated by using the monster attributes.
range
(server, required) Range of the attack.
angle
(server, required) Angle of effect of the attack.
animation
(client, recommended) Animation that is played when the monster uses this attack.
particle-effect
(client, optional) Particle effect that is initialized when the monster uses this attack.