[MUD-Dev] Object Architecture
Sasha Hart
Sasha.Hart at directory.reed.edu
Tue Jun 11 17:04:10 CEST 2002
[Ben Chambers]
> Which objects do you use?
My current project is a little, clean and simple text mud which is
mostly bent toward providing GM tools for small games (up to 30
players). I use C as the point of this is to have something light
which can run well on scavenged hosting and which other people will
easily be able to change. Also, to get done even though I have a lot
of other stuff on my plate.
I simply declare that players are players, objects are objects, and
rooms are rooms. I have no problems partitioning things up in this
arbitrary way. The only part I'm at all unhappy with is the
"object," which is really a stopgap until I drop in scripting.
Interactions are handled by canned functions in the same vein as:
void kick_dog(struct owner *o, struct dog *d)
Dead simple stuff, but I'm not composing a demo reel or anything.
Description of the specific structs follows. This is from memory.
Sasha
------
Account is persistent data attached to connections
(e.g. password).
-> control_list, of the characters account has permission to use.
-> name (used in OOC comms, like chat - i like to provide
identity masking for characters in the game)
Connection is just a few temp variables per-connection.
-> descriptor
-> buffer
-> etc.
Character is an in-game token. Stats and descriptions,
inventories, markers etc. I don't provide a separate struct for
mobs, it's all the same.
-> name
-> inventory
-> etc.
Room is an ur-object for people to be in. (I use a node rather
than coordinate system here).
-> connected exits
-> per-node ecology stuff
Exit is a link between nodes
->description
->keywords
-> reciprocal exit
-> miscellaneous experimental stuff
Object is an inanimate thing, like a sword or chest of drawers.
-> name
-> weight
-> stuff inside
-> etc.
_______________________________________________
MUD-Dev mailing list
MUD-Dev at kanga.nu
https://www.kanga.nu/lists/listinfo/mud-dev
More information about the mud-dev-archive
mailing list