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 
 
NWNX4 single player only

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Scripts and Modules
View previous topic :: View next topic  
Author Message
rpgbl



Joined: 01 Oct 2009
Posts: 30

PostPosted: Mon Mar 22, 2010 15:47    Post subject: NWNX4 single player only Reply with quote

Hi guys,

The mod I've created is a single player-only game and the reason why im using NWNX4 is to connect the game to database. As you guys know, NWNX4 serves like a server which means players in the network can see and can join the server. Now the problem is I want to limit the player to play only single player (i dont want other people to join in).

is there any way to do this ? Thanks
Back to top
View user's profile Send private message
Zebranky



Joined: 04 Jun 2006
Posts: 415

PostPosted: Mon Mar 22, 2010 16:21    Post subject: Reply with quote

Currently, NWNX4 is only designed to be used with the standalone server. It's certainly possible to do what you want, but I don't know of any plans to do it. You're probably better off using local variables in a single-player mod, as that avoids the distribution hassles of teaching people to start the game through a NWNX-like launcher.
_________________
Win32 SVN builds: http://www.mercuric.net/nwn/nwnx/

<Fluffy-Kooshy> NWNx plugin is to this as nuclear warheads are to getting rid of fire ants.

<ThriWork> whenever I hear nwn extender, I think what does NWN need a penis extender for?
Back to top
View user's profile Send private message Visit poster's website
rpgbl



Joined: 01 Oct 2009
Posts: 30

PostPosted: Mon Mar 22, 2010 17:07    Post subject: populate / duplicate the server ? Reply with quote

Hi Zebranky, thank you for the reply.


Quote:
You're probably better off using local variables in a single-player mod,


At the moment all the codes I made for my mod are using local variable.

Quote:
as that avoids the distribution hassles of teaching people to start the game through a NWNX-like launcher


Yes that would be great if there is such settings / application that can run NWN2 and NWNX together without showing the NWNX launcher.

I do only required a standalone server but what I dont want is to allow other people within the network to join in. For example: when player1 call mymodule from server1, I dont want player 2 to join server1 but maybe create server2 so each player will play single-player only using different server.

Just to modify the main question, is it possible to make each player invisible to each other while playing the same module from the same server (in other words hosting multiple single player in one server without effecting each others gameplay)?

any suggestions please ?
Back to top
View user's profile Send private message
Zebranky



Joined: 04 Jun 2006
Posts: 415

PostPosted: Mon Mar 22, 2010 17:24    Post subject: Reply with quote

No, that's not possible. You could have an event script for when players connect to the server (OnClientEnter or OnPCLoaded) that boots them if another player is already connected, though.
_________________
Win32 SVN builds: http://www.mercuric.net/nwn/nwnx/

<Fluffy-Kooshy> NWNx plugin is to this as nuclear warheads are to getting rid of fire ants.

<ThriWork> whenever I hear nwn extender, I think what does NWN need a penis extender for?
Back to top
View user's profile Send private message Visit poster's website
rpgbl



Joined: 01 Oct 2009
Posts: 30

PostPosted: Mon Mar 22, 2010 17:32    Post subject: Reply with quote

Hi Zebranky, thanks for the fast reply.

I see... So the only way to keep them separated is to create multiple server then ? can I create like 10 servers in one PC ? Any problem I should be awared of ?

And also, how to boot the player ? The syntax is void BootPC(object oPlayer); what should I put in the oPLayer ? is it possible to send a message to the player before boot them away ?

Sorry for the noob question. Thank you ^v^
Back to top
View user's profile Send private message
rpgbl



Joined: 01 Oct 2009
Posts: 30

PostPosted: Mon Mar 22, 2010 17:59    Post subject: Reply with quote

I just tested to run multiple servers in one computer. It doesnt work; it only shows 1 game only (in the LAN game). I think it catches per IP so each IP only can host one game. Any help to solve this problem please ?
Back to top
View user's profile Send private message
virusman



Joined: 30 Jan 2005
Posts: 1020
Location: Russia

PostPosted: Mon Mar 22, 2010 19:54    Post subject: Reply with quote

I can try to modify NWNX4 for single-player, but whay do you need it for?
As Zebranky pointed out, the distribution of the module using NWNX may be a bit more complicated.
_________________
In Soviet Russia, NWN plays you!
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger
rpgbl



Joined: 01 Oct 2009
Posts: 30

PostPosted: Mon Mar 22, 2010 21:09    Post subject: Reply with quote

Hi virusman,

It is actually because the mod that I've created is intended to asess the player's knowledge in a particular subject. Though actually playing multiplayer will be very interesting, my main focus at the moment is on single player. In other words playing multiplayer is not suitable; the player will just ask another player how to answer those questions and I cant get the result that reflects the player's performance.

On the other hand, I need many computers to run at the same time playing the same mod so I can gather the data quicker.

I could actually just turn on manually NWNX4 for each computers but I dont think this is effective and besides the computers has a very limited power so playing the game and hosting the game at the same time really hurts the computer's performance.

I hope the reason is reasonable enough and any help would be appreciated. Wink
Back to top
View user's profile Send private message
Zebranky



Joined: 04 Jun 2006
Posts: 415

PostPosted: Tue Mar 23, 2010 0:04    Post subject: Reply with quote

You might be able to use instanced areas for that (or just a bunch of pre-created areas). When the player connects, send them to an area that doesn't have any other players in it.
_________________
Win32 SVN builds: http://www.mercuric.net/nwn/nwnx/

<Fluffy-Kooshy> NWNx plugin is to this as nuclear warheads are to getting rid of fire ants.

<ThriWork> whenever I hear nwn extender, I think what does NWN need a penis extender for?
Back to top
View user's profile Send private message Visit poster's website
rpgbl



Joined: 01 Oct 2009
Posts: 30

PostPosted: Tue Mar 23, 2010 0:11    Post subject: Reply with quote

that's an excellent idea !!! But could you explain in more detail on how to do it ? I have around 15 different areas. does it mean i have to make many copies of the areas? will it hurt the performance of the server a lot ?
Back to top
View user's profile Send private message
Zebranky



Joined: 04 Jun 2006
Posts: 415

PostPosted: Tue Mar 23, 2010 1:58    Post subject: Reply with quote

That depends on how many copies you need. If you want to be able to support 10 players at once, that would be 150 areas, which is pushing it, depending on how big they are.

There are many ways to go about implementing the separate "groups" of areas -- numbers in the areas' tags, variables on the areas, etc.
_________________
Win32 SVN builds: http://www.mercuric.net/nwn/nwnx/

<Fluffy-Kooshy> NWNx plugin is to this as nuclear warheads are to getting rid of fire ants.

<ThriWork> whenever I hear nwn extender, I think what does NWN need a penis extender for?
Back to top
View user's profile Send private message Visit poster's website
rpgbl



Joined: 01 Oct 2009
Posts: 30

PostPosted: Tue Jun 15, 2010 11:45    Post subject: Reply with quote

I've tried it and the server just cant hold more than 2 players..even 2 players the performance went down very quickly Sad any other way ?
Back to top
View user's profile Send private message
Baaleos



Joined: 02 Sep 2007
Posts: 830

PostPosted: Wed Jun 16, 2010 22:42    Post subject: sounds like threading Reply with quote

Alot of what you are doing, sounds like threading in c#.

When I was learning C#, I practiced making client -> server apps etc,

When the app connects to the server, the server creates the connection, then creates another instance of the open connection, awaiting the next client to join.

In short, it would be able to handle as many connections as physical memory would allow.


What you would need, in theory, if you wanted
Client to Connect - Start new server instance, then wait for next client etc, and then repeat the process

is some sort of application which, like nwnx, runs the server inside its own process boundaries, then when the program, which is the parent of nwn, detects a client joining, it triggers another nwn server process load up, with a port number of +1 or something (*). Setting the max players to 1 for each of the servers, ensures no one can join the single player session.


However, since VirusMan (The Great) is gonna try to port nwnx4 to a singleplayer app, you are best ignoring most of this rabble, and wait for him to do that. hehe.


(*) - On a side note - Does anyone have any nwnx2 plugins which allow advanced control over server settings such as ip address etc.

A limitation of nwn is that it binds automatically to the IP Address which is higher priority in your adapter list.
You can only have it bound to one adapter, unless you go and change the adapter binding priority manually.


For those who run virtual private networks etc, using wippien or hamachi, a plugin, which would directly allow nwnx to bind the IP Address of our choice, would be great.


eg - perhaps a NWNX.ini setting

[IPCONFIG]
ip=5.34.22.192;


If I had to hazard a guess, I would say something like this would be somewhat simple to do compared to alot of the brilliant functional things you guys have provided.
Back to top
View user's profile Send private message
cjdarken



Joined: 21 Feb 2011
Posts: 1

PostPosted: Mon Feb 21, 2011 19:58    Post subject: any progress in on NWNX4 for single player? Reply with quote

I've just started looking into getting NWNX4 to work for single player for game AI research purposes. Has anyone been working in this area? As I'm just getting started, even a list of obstacles to be overcome would be of interest.

Chris
Back to top
View user's profile Send private message
Zebranky



Joined: 04 Jun 2006
Posts: 415

PostPosted: Thu Feb 24, 2011 4:54    Post subject: Reply with quote

Honestly, you'd be better off running NWNX4/nwn2server and limiting it to one player. It is quite possible to adapt NWNX to attach to the client (which contains all the server code too), but, especially for research, it seems like a better use of resources to just use the server.

If you're dead set on wrapping everything into the client, I can get you started, but without some asm experience, it'll be rough.
_________________
Win32 SVN builds: http://www.mercuric.net/nwn/nwnx/

<Fluffy-Kooshy> NWNx plugin is to this as nuclear warheads are to getting rid of fire ants.

<ThriWork> whenever I hear nwn extender, I think what does NWN need a penis extender for?
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Scripts and Modules 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