[MUD-Dev] Marc Hernandez' Server
Marc Hernandez
marc at ias.jb.com
Wed May 19 01:17:00 CEST 1999
[Greg Munt]
> > [Marc Hernandez]
> > Yeah I have been doing this also. I decided to stop running and
> > implement. My first and second passes were under C++ with the later one
> > (or is it two now?) under Java[1].
> What made you move from C++, to Java?
Hmm. A little personal background. I resisted even learning java
out of spite. All the hype around it was pretty annoying. Eventually I
had to write a compiler in java for my compiler class (we targed the java
.class file format. It was easy. And the compiler had the instant
ability to call any other .class file thus giving the compiler the unique
ability of being useful :-).
So I learned java and found that when I wanted to do something the
language and API support seemed to make it easier. In C++ I always felt I
was reinventing and reimplementing. Probably more a personal problem then
one with the language.
I do miss templates and operator overloading but there are
actually java compilers with that. I have not found I have missed
pointers at all and for compiler the lack of aliasing can mean much better
optimisations.
On the other hand Sun does not directly support linux so the
versions can lag.
<question to Ola about switching code design snipped>
> > Do you actually get much on paper? I find I get a bit then decide
> > to go implement because I do not know how this or that will work.
> > Probably just immaturity in designing multiuser servers.
>
> Immaturity? I don't think so. Sounds like evolutionary prototyping to me.
Well that is what I would say in a interview of course. But then
evolutionary prototyping is good when one does not exactly know the
necessary specifications for the problem neh? (which is everything but
'Hello World').
> > At the core the system is driven by events. Everything that
> > happens has an event that makes it happen.
>
> But what makes an event happen? What is the process (ie event/object
> interaction) that causes a character to speak, for example? Do you have an
Hmm. I had not made this explicit in the design as I did not
know. In theory any object (component) can create and send an event.
After getting some game in the game it would probably be good to formalize
this stuff and look at gross inefficiencies[1].
> event source that throws its own kind of event at an event manager (your
> Server object?), which then throws it at the right destination object, which
> reacts accordingly?
Actually the event manager is a seperate object (in the Java
sense) and not part of the 'world'. The server is however a 'game'
object. It handles the sockets for the different client types as well as
the mapping between unique object IDs and the persistant objects.
Probably because I never thought of sending the event manager events ;-).
That might be useful.
One could give the Server object a body and kill it. That would
be fun :-). I currently have the server saying 'Hi' to me since I am the
only one on testing.
> I remember JCL having something with four distinct components. Anything like
> what I've described above?
Probably. I did not explicitly read about it but will probably go
look up the past threads on this.
> > Events can be targeted, area or generic.
> Maybe I am making things overly complex (or am I?), but I don't see the need
> for event classifications. First, let's look at targeted and area events:
> these are quite similar. They both propogate events to their contents, it's
> just that targeted events are never sent to areas (assuming that you
> distinguish between rooms and areas - or even if your server has the concept
> of a room at all). For example, you would never send an area event to a
> single character, you would always send it to an area. (I'm starting to feel
> like I'm missing something now.) Generic events need not be handled any
> differently - just have internal objects that provide an interface to the
> system. For example, the ShowThreads event could be sent to, say, the Log
> object.
Correct. In some senses it is/could be an optimisation. Targeted
events do not currently have a position (possible design mistake. A
'MudLib' will determine if that needs to change). There are a bunch of
unanswered questions there.
> > Area events are a bit different. They get produced and filtered
> > at production like other events. Then they get filtered by the area they
> > are in. The area filters them and decides how to propagate them. Then
> > the area passes the events to the various objects that care.
> Why aren't targeted events filtered at their destination too?
Well it is an evolution :-). They are I probably either a> have
not explicitly programmed it or b> did not clearly state it. When I work
on this I find I have a nice 'what I want' vision but then have to go deal
with java.lang.reference not quite working right or finalizers not being
called or why my objects immediatly unload just to be reloaded etc.
> > For my object system (objects are called components) I wanted a
> > uniform handling of abilities. Thus components are really just
> > 'containers' for Attributes. An attribute is where all the work gets
> > done. Some attributes:
> > Physical: maintains where a component is, including its connectedness.
> > Material: Any materials a component is made of.
> > Contain: this component can contain others that can be contained.
> > ContainedBy: this attribute maintains who it is contained by
> > (I use the 2 above for areas also. Areas can contain other areas.)
> > Mind: A mind controls a body. Some minds include: Text- this is a telnet
> > control for a body, Away- this is for controlled bodies that do not have a
> > connected human, NPC- for smarter NPC characters, MOB- for simple run
> > around creatures.
> Can you give some examples of how the Material attribute would be used?
The material attribute represents the constition of the object and
any physical properties it might have. Basically things are made of some
material and some process can change them to another material. Thus
applying heat to metal causes it to soften then melt, while wood burns. I
do not plan on having a full physical system, but I hope to have some
consistancy.
> > Rather than use simple pointers between components I have Slots.
> > Slots can have constraints placed on them. Another component is placed in
> > a slot assuming it fits the constraint.
> >
> > Taking control of a body is as simple as changing the 'mind' of
> > the character. If the character is reincarnated or turned into a goat you
> > just change the characters 'body'.
> I *love* these two aspects of your design!
Thanks. I think the slot/constraint and event/filter models might
be able to be merged into the same system. But for now they are not. I
am still determining how to handle minds put into bodies that suddenly
have new or suddenly do not have capabilities. Again, 'Game' will
determine that.
<LOTR skipped. Will respond in seperate thread>
> > Oh yeah. It is for a graphical system but will support anything.
> > I currently have a text based system running atop it, since that way I do
> > not have to develop a client right away.
> > Wow. You read to here? Even I fell asleep halfway through :-).
>
> I read with excitement and interest. I am myself interested in area events
> related to the senses (talking should be heard in neighbouring rooms, shouts
And whispering should be heard by people trying to listen in (if
they can or they have help (tech or magic)). Additionally a giants
whisper is still loud (ref Wheel of Time Ogier).
> shouldn't be heard across the entire world), particularly smell, which
> no-one seems to have dealt with yet. Also a weather system which can cause
> permanent damage to the world, its inhabitants, and their manufactured
> structures. (I digress.)
Very cool. All things to make a game more immersive (I would
hope). Since I am building a graphic server but running a text mud to
test it I am try to have less of a concept of 'room' and 'area'. More of
an idea of spaces and structures.
> You don't seem to have marked where this footnote refers to..?
hmm cannot seem to find 2 either nor my original sent message.
Marc Hernandez
5 billion neurons can't be wrong.
[1] You know the N^2 or N! ones that Ola was saying academics are
concerned with.
_______________________________________________
MUD-Dev maillist - MUD-Dev at kanga.nu
http://www.kanga.nu/lists/listinfo/mud-dev
More information about the mud-dev-archive
mailing list