[MUD-Dev] CORBA, RMI, threads

Vadim Tkachenko vadimt at 4cs.com
Fri Jan 23 09:36:57 CET 1998


Marc Eyrignoux wrote:

[skipped]

> - If I have a telnet client and a java serveur (or a java client and a
> C++ serveur), is it possible to use RMI?

Which kind of telnet do you mean? Pure bare telnet utility which is
ubiqitous in the every UNIX distribution and also in Windows (though,
forgive me for the expression, castrated) or the telnet protocol as
described in RFC854?

I'd say that you don't need neither RMI nor CORBA for both cases,
though...

> * one thread per connection, for listening
> * the use of a multi-threaded database like postgreSQL or mySQL, which
> libraries are already threaded

And probably you also want to divide the system into independent
business logic (read: MUD) part and persistency (read: DB) part, this
way you don't have to care about multithreading within a DB driver.

> * a thread for the time (in my mud, 3mn_real_life=1h_mud_life)
> * a mecanism based upon thread for the event handler.
> So they are 3 points I would like to get clearer:
> + even if the functions given in the database library are multithreaded,
> do I need to
> thread the functions that call them?
> + are NPCs threads in your servers?

Catching the chance, I'd like to throw the next flamebite:

NPC is a set of: ( <behavior model>,<gathered knowledge> ). Thus, it's
perfectly possible to divide the behavior model and move it out of the
main server. Then, when the NPC is needed, you just call the NPC
behavior model engine, load the knowledge base into that engine, and let
it continue.

> or is there something like
> while (1)
> {
>         getTheListOfActiveMonsters();
>         for (monster = firstMonster(); monster = lastMonster(); monster++)
>                 {
>                 monster.act();
>                 }
> }

This mechanism I (personal opinion) detest as the least efficient. I'd
prefer them to wait the objects from the event queue and then process
them and fall back to sleep until next event.

> In the case monsters are threads, do you need to stock somewhere the
> list of active monsters?
> In this case, is there an accurate way of stocking them?
> In fact, I intend to make the monsters act every 15 seconds. A thread
> that would sleep for 15
> seconds and acts according to the situation at the moment it wakes up
> seems to be a good way
> for doing this.

Once again, why 15? Why not 14 or 16?

> (in fact my question is: are monsters in your muds
> intelligent or not?

Sure they are :-) Given the in-game experience, probably much smarter
the newbies :-)

--
Still alive and smile stays on,
Vadim Tkachenko <VadimT at 4CS.Com>
--
UNIX _is_ user friendly, he's just very picky about who his friends are



More information about the mud-dev-archive mailing list