This is the documentation of the new XML-based monster database which is shared between the new server and the new client. For understanding this article you should be familiar with damage calculation, hitting and dodging, and the skill system.
<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="4" attack-min="10" attack-delta="2" attack-magic="0" hit="10" evade="10" physical-defence="5" magical-defence="0" mutation="20" /> <vulnerability element="fire" factor="1.5"/> <vulnerability element="earth" factor="0.7"/> <exp level="2">10</exp> <behavior aggressive="false" cowardly="false" track-range="8" stroll-range="4" 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>
"required" means that the tag/attribute MUST be defined. When a required tag/attribute is missing the whole parent tag 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.
One monster entry in the database.
- (Client+Server, required) Unique monster type ID used to identify the monster type in the netcode.
- (Client, recommended) Name that is displayed when the monster is targeted.
- (Client, recommended) Size of the target cursor.
(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.
- (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.
- (required) ID number of the dropped item as listed in items.xml
- (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.
(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.
- Initial and maximum hit points of the monster.
- Radius of the bounding circle of the monster in pixels. A Monster is affected by attacks and other area-of-effect effects when its bounding circle overlaps with their area of effect. For comparison: A player character has a bounding circle radius of 16 pixel.
- Movement speed of the monster in pixels per second
- Minimal damage of attacks with a damage factor ot "1"
- Difference between minimal and maximal damage of attacks with a damage factor ot "1"
- Magical attack power
- Hit accuracy of physical attacks
- Evade accuracy against physical attacks
- Defence against physical attacks
- Defence against magical attacks
- (optional) Mutation factor of the monster in percent. All attributes of every spawned monster of this type are randomly modified up or down inside this range.
(server, optional) Defines an elemental vulnerability or resistance.
- (required) Name of the element the monster is vulnerable/invulnerable against
- (required) All damage the monster receives from the element is multiplied with this value.
(Server, recommended) Experience reward for defeating the monster.
- (optional) Maximum skill level after which experience gets a penalty. Setting to "0" (or omitting) means that there is never an exp penalty through skill level for this monster.
(Server, required) General behavior of the monster AI
- (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)
- (required) Does the monster attack without being provoked? Values are "true" or "false".
- (required) Distance in tiles the monster tracks enemies in (pathfinding algorithmn is used for calculating distance).
- (required) Distance in tiles the being chooses new destinations in when not fighting.
- (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).
- Prefered distance to the enemy the monster tries to reach when in combat (horizontal or vertical)
(Client+Server, optional) An attack the monster can perform. A monster can have multiple different attacks.
- (client+server, required) Id number of the attack (unique for each monster) used to identify the monster type in the netcode.
- (server, optional) How likely the monster is to choose this attack when it got multiple attacks it can use in the current situation.
- (server, required) Type of attack. Values are "physical" and "magical".
- (server, required) Delay in game ticks* between the decision to perform this attack and performing it.
- (server, required) Delay in game ticks* after the attack until the monster can act again.
- (server, required) Multiplier applied to minimum and maximum damage as they have been calculated by using the monster attributes.
- (server, required) Range of the attack.
- (server, required) Angle of effect of the attack.
- (client, recommended) Animation that is played when the monster uses this attack.
- (client, optional) Particle effect that is initialized when the monster uses this attack.
* 10 game ticks = 1 second.
(Server, optional) Defines a script file with the scripts for the monster.
sprite sound drop attributes
track-range stroll-range attack-distance attacks script
Vulnerabilities should wait until player characters got the possibility to inflict elemental damage so that this feature can be properly tested.
Regarding cowerdly behavior: I am still unsure how a monster could calculate the optimal escape route.
|Content XML files|