Coding mud-style game for school assignment; looking for suggestions.

Posted by Mademoiselle on Sat 11 Aug 2001 02:35 AM — 4 posts, 20,190 views.

Australia #0
I'm coding a text-adventure game (in Java) for a school assignment, which I'm writing with a MUD style in mind -- rather than writing a world per se, I'm writing an engine that a person can tack a world of their own design onto, which I'll then make a world for before handing it in.

This is what I've implemented so far:

World - contains a master list of Rooms, Items and Mobs. I'm planning on implementing an update() method to move Mobs around, etc.

Rooms - These have a name, a description, a set of Exits, a set of Mobs that are in the room, and a set of Items that are in the room. All can be defined during world creation, and can be added/removed on the fly.

Exits - There are currently 6 directions (N, E, S, W, U, D), and more are added easily (but it's not worth it for a project this small. If I continue to develop it with the aim of being distributable, I may add more compass directions). Exits have a short description (one or two words such as 'door', 'arch', etc), and a long description which is displayed when you look at the exit. They can be open or closed, and locked or unlocked, and can specify an item to use as a key to unlock the door.

Items - These have a name, a description, and a keyword for referring to them. They also have a weight. I'm thinking of adding some kind of itemstate, and statemodifier so they can decay over time.

Mobs - These have a name and a description (to refer to them in commands you use their name). They also have an Action (see below), and a variable canMove which defines whether or not they can roam around.

Action - Defines triggers and actions so when certain commands are performed on mobs with specific parameters (such as giving a cake to john), the mob can respond in various ways.

Player - Defines the player as s/he moves around the game world. Currently has an inventory of items, a 'holding' position (which I'm thinking of removing because after changing the command system a bit it's no longer needed), a current weight, and a maximum weight. The player can pick up items (as long as it doesn't push their weight over their maximum weight), drop items from their inventory, view their current inventory, move around, open doors (if the user is carrying the right key, locked doors are unlocked automatically to save typing in 'unlock' then 'open'), give items to mobs (which can in turn set off an action in the mob), and can look at the room they are in, any mobs/items in the room, and can look in any direction that contains an exit to another room.

The game is played through a commandline interface (DOS Prompt in Windows, Terminal in UNIX) and is for a single player only. Things like battle, magic and experience are not needed at this stage -- the assignment specification says to make the world only about 15 rooms in size -- but I'll probably implement them at a later date if I feel motivated.

I'm looking for suggestions of stuff to add to increase the realism of the game. No timed stuff please -- while it does add to realism, it also adds significantly to coding/testing time (and since I've never touched on threaded programming I'd have to figure that out first, which I won't be able to do in the couple of weeks left before due date).
Amended on Sat 11 Aug 2001 02:39 AM by Mademoiselle
Australia Forum Administrator #1
This all sounds pretty comprehensive. My suggestion would be to make it all work properly before adding new stuff. I think you will get more marks for 8 things that work properly than 10 things that don't.

Perhaps add a couple more simple conditions for going through exits, eg.

  • Must carry item.
  • Must not carry item.
  • Must have some attribute (eg. male, female)


Maybe also have hidden exits.

I think you are doing pretty well - I know from experience that writing a MUD server takes months (or years), so I would concentrate on making what you already have as polished as possible. :)

Australia #2
Yeah, I'm thinking I'm going to do the hidden exits thing, was pondering it earlier today.
Australia #3
Well, I'm at it again, this time in C++. Got some big ideas which will be very cool if I can a) keep motivated long enough to get around to them and b) manage to code them. ;)