Feedback wanted on a mud design

 
Post new topic   Reply to topic    mudlab.org Forum Index -> Design
View previous topic :: View next topic  
Author Message
caius



Joined: 12 Dec 2006
Posts: 13

PostPosted: Fri Jul 20, 2007 12:36 am    Post subject: Feedback wanted on a mud design Reply with quote

Oh no, another moron wanting to design a mud!

Yes, it's true, I want to code a mud. So far I've started brainstorming a few keywords, and mapped some of them out in an UML class diagram (I'm a little inexperienced with UML still, so feel free to correct me if I've used wrong symbols somewhere).

A few comments to clarify the diagram:

The MudServer class is responsible for the initial boot process, starting the network, running the main game loop, and finally shutting down.

The NetworkLayer abstract class is there to hide the implementation of the network code from the MudServer class.

The WorldHandler will coordinate most of the game content that the players can interact with.

The MobileHandler will work with Mobile objects. Player and Npc are hidden from the MobileHandler, they are both referred to as Mobile (a game object that moves around in a semi-intelligent fashion). The decisions of a Npc is handled by an ArtificialIntelligence class, while the decisions of a Player is decided by a user through a network connection (hence the arrow to the Socket class). I've done it this way because I want Npc's and Player's to be treated the same in almost every way.

The Item class is abstract, and there will be one derived class per itemtype, to govern its specific behaviour.

Many different types of objects can register an Event with the EventHandler. The Event class should probably be a base class providing a common interface to specific types of events. Events can be scheduled to happen right now, or in 'n' seconds (or some other time unit). The EventHandler appears as a part of the MudServer class in the diagram, though it may be better to give it a global entry point using (for instance) the Singleton pattern.

There are of course other classes that I haven't included in the diagram, like a Parser, but let's work with what we got first.

This is all very vague, I know, since I haven't said anything about what kind of game I want to create. Let's just say that it's meant as a general purpose framework for now.

The reason I'm posting this is because I'm hoping someone would comment on the design as it stands. (Since I haven't coded a single line yet, the design can be shuffled around freely.) Do you see anything that you know from experience would be a bad design decision, and why?
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Author Message
Kelson



Joined: 18 May 2005
Posts: 71
Location: SC

PostPosted: Fri Jul 20, 2007 1:17 am    Post subject: Reply with quote

You have a very general MUD architecture laid out there. With the exception of the event handler, it describes your standard Diku; though I'm sure that wasn't your intention.
Back to top
View user's profile Send private message Send e-mail AIM Address
Author Message
caius



Joined: 12 Dec 2006
Posts: 13

PostPosted: Fri Jul 20, 2007 1:27 am    Post subject: Reply with quote

It's not meant to describe a Diku no. Did you mean that a Diku also has Mobiles, Items and Rooms?

The point of the diagram is to plan the architecture, not specific implementation details. An important difference from a Diku is that I want to use abstraction layers between high level classes and low level classes, so that implementing new code will require changes to the abstraction layer only. A Diku tends to have everything in a global scope, which is why most of its derivatives is a spaghetti mess.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Author Message
Kelson



Joined: 18 May 2005
Posts: 71
Location: SC

PostPosted: Fri Jul 20, 2007 1:43 am    Post subject: Reply with quote

caius wrote:
It's not meant to describe a Diku no, and I don't really agree that it does. Did you mean that a Diku also has Mobiles, Items and Rooms?


And handlers for each of those items; though without a formal abstraction. It also has Player/NPC as sub-classes of Mobile (accomplished in C through inclusion of the mob struct in the pc struct). Abstraction layers are great, but all I see are 4/5 global objects. I think, and feel free to correct me, your abstract architecture is too abstract to be of much use in defining a game; there is far, far, far too much ambiguity still.

Besides locking in the use of sqlite3, what does your diagram tell you? What assumptions about the game are not yet encompassed in it? Maybe if it were combined with a design document, then an effect could be observed. Right now, the document locks you into a somewhat specific view of the world as three distinct entities, though those are very formless entities. One thing I notice is there is no secondary grouping of rooms; for example, areas in diku or regions in Adequise. Are they all just part of the global room grid? Might you want 'region' / 'group' specific effects?
Back to top
View user's profile Send private message Send e-mail AIM Address
Author Message
caius



Joined: 12 Dec 2006
Posts: 13

PostPosted: Fri Jul 20, 2007 2:22 am    Post subject: Reply with quote

Ok, thanks for clarifying that.

The SQLite3 class will probably be the first type of Database, mostly because I already have experience with its API.

Quote:
One thing I notice is there is no secondary grouping of rooms; for example, areas in diku or regions in Adequise. Are they all just part of the global room grid? Might you want 'region' / 'group' specific effects?


I've been thinking about that, and I'm not sure yet. Some form of grouping is probably a good idea. I'll give that some more thought.

Quote:
[...] what does your diagram tell you? What assumptions about the game are not yet encompassed in it?

As I implied earlier the exact role and extent of the EventHandler is still unclear. It could be used for events actually happening in the game world only, or it could be more general to also schedule events to update various states, autosaving, etc.

Another thing that is unclear is how I will handle actions and resolve their effects. I got inspired by a thread on Nick Gammon's site (half way down, search for 'all actions') on handling this.

Quote:
Right now, the document locks you into a somewhat specific view of the world as three distinct entities, though those are very formless entities.

I've also been thinking about the fact that mobiles (defined here a living objects) and items (defined here as dead objects) has a lot in common, and that I could combine these into a common base class. I'm not sure it makes sense to do the same with rooms, but it may offer more flexibility down the road to do this. There is, for instance, no real reason why you shouldn't allow an item to hold a person, or a person to carry around another person. Also, all three has the common trait that they can contain other things. So they could possibly all be seen as specializations of the same thing.

Quote:
I think [...] your abstract architecture is too abstract to be of much use in defining a game; there is far, far, far too much ambiguity still.

Yes, I agree. It's incredibly vague at this point. But that's also one of the reasons I wanted to air some thoughts and get feedback, because it helps forming a vision and to see things more clearly.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Author Message
caius



Joined: 12 Dec 2006
Posts: 13

PostPosted: Fri Jul 20, 2007 2:51 am    Post subject: Reply with quote

Quote:
I've also been thinking about the fact that mobiles (defined here a living objects) and items (defined here as dead objects) has a lot in common, and that I could combine these into a common base class. I'm not sure it makes sense to do the same with rooms, but it may offer more flexibility down the road to do this.

Perhaps I don't need the Room class at all. An item that can hold mobiles and other items could be used to represent buildings and vehicles.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Author Message
ide



Joined: 21 Feb 2006
Posts: 105
Location: Seattle

PostPosted: Fri Jul 20, 2007 4:25 am    Post subject: Reply with quote

caius, I've wanted to tie together a few old threads for a while from TMC and this seems like a good place to do it, since you put up Nick's post (good one, thanks). Things may get a little more specific than you're looking for.

"Thing structures"
http://www.mudconnect.com/discuss/discuss.cgi?mode=MSG&area=adv_code&message=14182

"Behavioral encapsulation"
http://www.mudconnect.com/discuss/discuss.cgi?mode=MSG&area=adv_code&message=13974

"Ticks versus anything else"
http://www.mudconnect.com/discuss/discuss.cgi?mode=MSG&area=adv_code&message=13735

"Actions and events"
http://www.mudconnect.com/discuss/discuss.cgi?mode=MSG&area=adv_code&message=13665

"Multithreading"
http://www.mudconnect.com/discuss/discuss.cgi?mode=MSG&area=adv_code&message=12578

"Custom actions (and a brief diversion with skill objects)"
http://www.mudconnect.com/discuss/discuss.cgi?mode=MSG&area=adv_code&message=12458

"Databases"
http://www.mudconnect.com/discuss/discuss.cgi?mode=MSG&area=adv_code&message=12072

"Event localization" (classic quote: "this may be beyond the lot of you")
http://www.mudconnect.com/discuss/discuss.cgi?mode=MSG&area=adv_code&message=10847

....

Man, I didn't even get to mud-dev yet: http://muddev.wishes.net/viewforum.php?f=2 (which may take a little longer).
Back to top
View user's profile Send private message Send e-mail
Author Message
caius



Joined: 12 Dec 2006
Posts: 13

PostPosted: Fri Jul 20, 2007 6:26 am    Post subject: Reply with quote

They're a little too specific since my current concern is creating a framework that can be changed and expanded with ease, and not game-specific implementation details.

Still, thanks for posting those links. Lots of good reading there. Lots of things to consider.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Author Message
caius



Joined: 12 Dec 2006
Posts: 13

PostPosted: Mon Jul 23, 2007 9:37 pm    Post subject: Reply with quote

Since we've already started gathering good links to game development, let's not forget one of my favourites.

SkotOS article archive:
http://www.skotos.net/articles/ArticlesArchive.shtml

People seem to have very strong opinions on Richard Bartle, either for or against, but either way his Dawn of Time column in that archive is great stuff.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Author Message
ide



Joined: 21 Feb 2006
Posts: 105
Location: Seattle

PostPosted: Mon Jul 23, 2007 11:27 pm    Post subject: Reply with quote

Caius, have you revised/expanded/changed your model? Enquiring minds and all that.
Back to top
View user's profile Send private message Send e-mail
Author Message
caius



Joined: 12 Dec 2006
Posts: 13

PostPosted: Tue Jul 24, 2007 7:14 pm    Post subject: Reply with quote

Yeah, the UML diagram has been changed. However, I'm currently working on a couple of textual analysis documents. Most importantly a non-technical requirement analysis. It's in a very raw, brainstorm-like form right now. But I'll post it when it's a bit more fleshed out.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    mudlab.org Forum Index -> Design All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB © 2001, 2002 phpBB Group
BBTech Template by © 2003-04 MDesign