logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Multi-module realms

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux development
View previous topic :: View next topic  
Author Message
KymlunAdmin



Joined: 16 Jun 2012
Posts: 16

PostPosted: Sat Jun 16, 2012 18:30    Post subject: Multi-module realms Reply with quote

Hello,

We are looking to connect multiple servers in NWN1 via NWNX. We want to have multiple servers with teleport points/transitions between them, but be able to share the player list and chat so it looks to the players as if they're all on one server.
- Instancing of the player housing system.
- Instancing of dungeons and miscellanous areas.
Where do we begin?
There are professional programmers on our team they just have no time to reverse engineer the game and we were wondering if anybody in the community who have been working on it, know of this?

best regards,
Kymlun Team
Back to top
View user's profile Send private message
elven



Joined: 28 Jul 2006
Posts: 259
Location: Germany

PostPosted: Mon Jun 18, 2012 11:58    Post subject: Reply with quote

The most obvious approach would be to use either a database, or a messaging queue to share information.

Any generic MQ would be sufficient to share chat and game state information. You'd probably use nwnx_jvm, nwnx_ruby, or similar, to run the endpoint for that.

As to sharing the player list, that is not as simple. It would require some nwserver patching, and I don't think it's that good an idea anyways - it would mess with a lot of things like scripts and internal intrinsics.

Area instancing can be done with nwnx_areas; there's a dedicated thread for that.
Back to top
View user's profile Send private message
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Mon Jun 18, 2012 17:57    Post subject: nwnx_kewl Reply with quote

Terra_777 made a version of nwnx_kewl for win32 - you would need to port it.

it, as far as I know, is the only plugin that facilitates a network communication socket on a separate thread than the nwn server.

It allows external applications to send messages to nwnx, and then have the messages trigger actions in the game world instantly - without the need for a Polling / Database heartbeat.

Its basically like nwnx events - where an ingame event, triggers c++ code, which then calls a script in the game.

Instead, a network message, gets picked up on a specific port, which then calls a script in game, which parses the message, and acts accordingly.


This system would be great for implimenting all sorts of backend systems.
Database, Forum, paypal transactions. Lol
Back to top
View user's profile Send private message
elven



Joined: 28 Jul 2006
Posts: 259
Location: Germany

PostPosted: Mon Jun 18, 2012 20:34    Post subject: Reply with quote

That is mostly doable with nwnx_jvm as well (nwnx_ruby is still 1.8, no native threading - meaning all other threads are stuck until nwserver yields).

As I understand your post, Baaleos, nwnx_kewl hooks into the main() loop to allow arbitary script VM execution? Where is the sourcecode to that?

nwnx_jvm doesn't allow calling into the nwscript VM at any time; only while executing scripts. In practice, for a slow-paced game/engine like NWN, this is only an academic limitation given a high enough event rate.

One could just embed (for example) libzmq, or any other MQ stack, and make up a inter-server protocol to exchange messages just like Baaleos said. I'd sort of advise against rolling your own bare-socket stack, though.
Back to top
View user's profile Send private message
KymlunAdmin



Joined: 16 Jun 2012
Posts: 16

PostPosted: Tue Jun 19, 2012 13:15    Post subject: Reply with quote

Thank you, both of you. Meanwhile a friend has advised us to rather use ResMan and UpdateArea as it would better suit our purpose. We might yet return to this concept. Apparently a server called "Higher Ground" has achieved a marvelous system for the multi-module solution.
Back to top
View user's profile Send private message
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Tue Jun 19, 2012 18:19    Post subject: Reply with quote

http://95.109.119.126/Terra/nwnx_kewl.rar

From what I can tell, it runs on its own thread (the socket) - I may be wrong though.


When it receives a communication, it inserts / makes a VirtualMachine call to the nwnscript - providing the message that it received.

I havent implimented its use yet, but I plan to.
To allow web applications etc on the local machine, to directly influence the PW, without the need for heartbeat/db calls.
Back to top
View user's profile Send private message
Terra_777



Joined: 27 Jun 2008
Posts: 216
Location: Sweden

PostPosted: Tue Jun 19, 2012 19:29    Post subject: Reply with quote

Ah, yes.

It hooks the mainloop which calls the virtual machine. I'm very unfamiliar with networking so don't expect it to be amazing or even secure. Its an experiment, but it does work to externally pop nwscript atleast.
_________________
I dun have any signature, I'm happy anyway.
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Linux development All times are GMT + 2 Hours
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, 2005 phpBB Group