<message type> <actor> <target>Messages may be stacked or concatenated to reduce the total number of transmissions sent. Connections between the client and server will be performed with TCP (to limit out of sequence packets) and will use a single established connection for the duration of the session. Finally, clients will be throttled so that they may send no more than two individual transmissions per second to the server, and no stacked message should exceed 1000 bytes (to accomodate a 1500 MTU).
Field |
Value |
Comment |
---|---|---|
Object ID |
1002 |
The unique instance ID |
Unique |
no |
Indicates if this is a
unique, single instance (determined by template) |
Template ID |
5 |
Points to a template for
this instance (5 is a basic goblin) |
Name |
a goblin |
The instance name |
Location |
1500, 703 |
The instance location in the
world |
State |
Idle |
The current state of this
instance for the action table |
Max Health |
75 |
The natural maximum health
of this monster |
Current Health |
75 |
The current health of this
monster |
Max Mana |
0 |
The natural maximum mana of
this monster |
Current Mana |
0 |
The current mana of this
monster |
Weapon ID |
1003 |
The ID of the weapon
instance wielded (if any) |
Effects |
[] |
An array or list of effects
in place on this monster (buffs, DOTs, etc.) |
Inventory |
[1003] |
The inventory available on
this monster upon death. |
Money |
5 |
The amount of money on this
monster, avaiable upon death. |
Friends |
[1004,1006] |
Other monsters that will be
alerted when this monster's State changes |
Hate List |
[] |
A sorted list of who the
monster hates, first being hated the most |
select()
statements--modern
developers should use poll()
, but the principle remains.mmap()
a structure onto disk and load it back
in when the system was started. The downside to this, of course, is that
every object in the system will be present at all times. Using ISAM or
flat random data file access techniques are another option. Using a
relational database requires more overhead, in addition to (generally) a
separate database server, but provides access to the data outside of
the application and doesn't require any special application to access,
manipulate, and update the game data when the MUD is not running.
Checkpoints are generally only made to player character objects: most
MUDs will respawn all mobs when the system is restarted, and their
status is inconsequential. On the other hand, players want their
progress and status to be frequently stored in case of a server crash.Rule No. |
Entry State |
Condition |
Action |
---|---|---|---|
1 |
Idle |
PC within 100 units, PC
Faction < Neutral |
Change state to aggro, add PC to hate list |
2 |
Aggro |
PC on hate list, PC farther
than 10 units, PC within 500 units |
Move to PC location |
3 |
Aggro | PC on hate list, PC within 10 units, PC health under 20% | Attack PC |
4 |
Aggro |
PC on top of hate list, PC
within 10 units |
Attack PC |
5 |
Scared |
PC on hate list, PC within
1000 units |
Move away from PC |
6 |
Aggro |
No PC on hate list |
Change state to idle |
7 |
Idle |
No PC within 100 units,
health < max |
Regenerate |
8 |
Idle |
Friend changed to Aggro |
Change state to aggro, add PC to hate list |