Pages: [1] 2   Go Down
  Print  
Author Topic: Networking for the rest of us: Tutorial  (Read 2342 times)
December 01, 2008, 05:37:11 pm
At the end of this thread http://forum.quest3d.com/index.php?topic=65936.0 is a first version of per player Network Buffers, in this case with textures.
Also there is a first approach to user management and the players array management.
Maybe can be a little more complete example for networking in Quest3D.

December 02, 2008, 01:02:16 pm
Added a workaround for the Network Buffers updates, and many comments.

* Working Networking v2.rar (1854.39 KB - downloaded 376 times.)
January 29, 2009, 04:08:12 pm
Hi Juanjo, could you upload this to the quest3d knowledgebase? Many would greatly benefit from this Smiley
February 02, 2009, 05:00:33 pm
Done.
Thank you for your interest Murphy.
Any comment?
February 24, 2009, 01:40:24 pm
Nice job of breaking this down Juanjo!

I've just started looking at multiplayer-networking,and would have probably gone
through all the same confuddling hurdles as you if it wasn't for your tutorial.

The Q3D networking wiki does a good job of introducing the basics, which was easy to set up
- but there after, anything more advanced is left as an exercise.

I initially wanted a WAN/LAN solution but other than the proprietary "Endless Forest" example
(that seems to be the only Q3D multiplayer/internet demo that works universally)
nobody else seems to have reusable solution Sad

Virtual club (WAN) doesn't work on my office network, and it is suggested
that it is possibly something to do with open vs closed ports.
Who knows, but ultimately it looks like you have to be experienced in networking
to overcome all the interpretive communication issues.

Well done.
February 24, 2009, 04:14:43 pm
First thing I need to figure out is how to make a networked avatar dissapear when
F5 is pressed to disconnect client, or even when the client is shut down.
Currently, the avatar stays on screen when a client connection is removed.

UPDATE:

"Number of players
------------------
Retrieves the current maximum number of players that are connected. If a player leaves a session, this number will NOT be decreased. You are able to use the "Player active state" setting to retrieve if a player is active. This value is never decreased because problems will occur when using an array of players; the last player should remain the last player."


I guess that means once a player disconnects I'll have to hide the avatar.
February 25, 2009, 11:37:49 pm
I see you are talking in the forum about this. Excuse my delay, and thank you for your encouragement.

In the example-tutorial there is a loop (Player status update) called when somebody comes or leaves.

It's a loop because of the event A player disconnected and A player connected does not provide more specific data: Several players could be in and out when those events occurs.

And inside the loop, the Player active state Network Info Value is tested for each player.

The event is called when a client disconnects intentionally, but maybe you need to verify if someone has down or idle.
February 26, 2009, 06:52:46 am
Thanks for the tip Juanjo.
I'll look into it.
February 26, 2009, 11:51:49 am
Ah! I aded a Network Value in the array for the players status, so this loop must be done only in the server. Then the status of all is updated in the array.
I think is enough in the networking side. The rest is matter of local management.
February 26, 2009, 12:33:16 pm
Thanks Juanjo.
Maybe you have some thoughts on this.

The only fundamental missing aspect of the networking tutorial is the
fact that new clients joining the multiplayer session correctly appear on the server
and all other clients. However, a client leaving the multiplayer session just gets
stranded behind, so the symmetry is broken there.

If each client exe needs to reflect the disconnection of a client then
that areas needs expanding. That is what I'm stuck on at the moment.

It seems reasonable that when a client disconnects from the session the server exe
needs to detect this and broadcast that change to all remaining active clients so they
can (somehow) stop showing the avatar for the unplugged player.

I know how it should/could work in theory - but mapping that concept to the
associated network channels is the fuzzy part at the moment.
(I only started looking at networking this week)

If you have any ideas let me know.

Addendum:

You already provided the means to change avatar texture and photo
so I'll see if I can get a client to broadcast a similar 'bIsVisible' variable
just before it disconnects. Not sure if this is the best way to approach it but
it will give me some familiarity.

At some point I'll understand if it is enough to just hide an avatar or if it needs to be
fully removed from the session at a lower level.
February 26, 2009, 12:57:32 pm
Hi Paris

Please, read at the end of the another thread (http://forum.quest3d.com/index.php?topic=66535.0)

Now, the status of all players is managed only at the server, and delivered via the Network Value STATUS, in the players array.
This must works as is, so all rows of this field is owned by the server. Look at the comments in the tutorial.
However, I not tested it yet. I'll must to work on it in sort time.

So if this works well, the left of the player is managed, but if them are still drawn you simply must to check his status in the STATUS array network value and act accordingly.
February 26, 2009, 12:58:53 pm
Quote
but if them are still drawn you simply must to check his status in the STATUS
array network value and act accordingly.

That's where I am now, but I am scratching my head  Huh?
You have indicated quite a few red issues with the networking channels.
Half the time I'm not even sure if my channeling is wrong,
or if the channel configuration is just faulty on a lower level  Frustrated
February 26, 2009, 01:40:59 pm
I hope you do find time to test and see if it works (i.e the STATUS functionality).

I haven't yet reached an assimilation level where I fully understand the
existing channel graph - there's still a lot of trial & error happening at the moment.

also interested to know if the [Network Info Value:Number of players] count also
gets decremented automatically as a result of using the STATUS implementation..
February 26, 2009, 02:22:56 pm
(...)Half the time I'm not even sure if my channeling is wrong,
or if the channel configuration is just faulty on a lower level  Frustrated
Welcome to the wonderful world of channeling...  Clown

Quote
I hope you do find time to test and see if it works (i.e the STATUS functionality).
I hope too.

Quote
(...) there's still a lot of trial & error happening at the moment.
Yes, but as I left the tutorial, all seems to work well (except players leaving, that is not tested yet).

Quote
(...)
also interested to know if the [Network Info Value:Number of players] count also
gets decremented automatically as a result of using the STATUS implementation..
NO. The Network Info Value's are probably parsed of Quest3D as they comes for DirectPlay, so we can't touch them.
So as we said before, the [Network Info Value:Number of players] never decrements.
Don't worry about it: Also, you can't decrement your array of players, because you need to have all shared network channel instances (all rows in the network-players array) even no one has login.

We must take care about eventual overloading of the array: Now the DirectPlay player id and the array index (and the Controled by player number in the network fields) are the same.
March 09, 2009, 06:59:46 pm
Hi Juanjo,
Hopefully you can help me with something..

In your project Working Networking v2.rar
I wanted to do a test by changing text and sync'ing it in the same
way as your photo.

I took an exact copy of the photo functionality
and carefully added all necessary network,buffer, and array types.
(i.e. the initialisation channels, the array types,etc..everything!)

I thought it would work exactly the same but it didn't.
I double checked all types to be sure that all texture related
channels now referred to TEXT.

The problem is - if I press [X] to broadcast a text change it works
when the server changes it's text (i.e. all clients show the text above the
server avatar changing as expected).

However, when a client changes its text it is not sync'ed to the
server or other clients. I'm pretty sure I have changed everything that needs to be changed, but wonder if it is human error or a network bug.

If you have time could you do a little test on your project to see if you
can get a 3D Text object (floating about the avatar head)
to sync correctly on all connected clients and the server?

My basic test text was :
[TEXT]="aaa"
[TEXT]="bbb"
[TEXT]="ccc"
..substituted for your original three Textures.
Pressing [X] cycles through the text changes just like your
[P] to change a photo.

Thanks in advance.
Pages: [1] 2   Go Down
  Print  
 
Jump to: