x


Networking Level Loading Issues

I am in the development stages of an online game. When a player starts, the player start at server browser where the player can make a new server or connect to other servers. I am trying to make it where when the player joins a server, he automatically loads the level the server is on. Each server has a "server manager" which is used to control what happens when players join and disconnect, and also controls when to change the level. How might I go about accomplishing my goal, which to have players that just connected to server, load into the same level that the server is on?

more ▼

asked May 15 '12 at 03:28 AM

MrJagaloon gravatar image

MrJagaloon
1 3 3 3

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

The simplest way would be to make the server's LoadLevel call in a buffered RPC with RPCMode set to RPCMode.All so that the server and everyone that connects to the server henceforth will receive this RPC as the first in the buffer and so load the level before anything else.

It's also advised to suspend receiving new messages until the level has finished loading to prevent receiving states for objects that don't exist yet and possible crashes.

An alternate solution that may fit your situation better, considering your server will change levels, is to send the player the LoadLevel RPC in the OnPlayerConnected callback on the server. This will save you a little tumbling between network groups. Again the player should suspend receiving new messages and updates until the level has fully loaded.

more ▼

answered May 15 '12 at 05:19 PM

asafsitner gravatar image

asafsitner
2.4k 2 8 19

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x808
x702
x414
x322
x298

asked: May 15 '12 at 03:28 AM

Seen: 974 times

Last Updated: May 15 '12 at 05:19 PM