Best way to transfer maps from server to client?

Post your help queries and engine programming questions here

Best way to transfer maps from server to client?

Postby ChrisEt » Thu Oct 24, 2013 9:19 pm

Hi everybody,

I'm planning a multiplayer game and now have to solve the issue of how to best transfer the map from the server to the client.

Is NetIo suitable for that? Can I simply define a mapTransfer message and send it to a client whenever the player enters a new zone? Or would this amount of data block all other messages or cause any other undesired effects?

Or better put it with the other static content like the textures and use the texture loading mechanism (not sure yet how that works)?

I'd be interested in what you suggest or what ways you have found to be successful.
Thanks in advance,
ChrisEt
ChrisEt
 
Posts: 17
Joined: Thu Oct 24, 2013 8:59 pm

Re: Best way to transfer maps from server to client?

Postby rob » Thu Oct 24, 2013 9:34 pm

ChrisEt wrote:Hi everybody,

I'm planning a multiplayer game and now have to solve the issue of how to best transfer the map from the server to the client.

Is NetIo suitable for that? Can I simply define a mapTransfer message and send it to a client whenever the player enters a new zone? Or would this amount of data block all other messages or cause any other undesired effects?

Or better put it with the other static content like the textures and use the texture loading mechanism (not sure yet how that works)?

I'd be interested in what you suggest or what ways you have found to be successful.
Thanks in advance,
ChrisEt

Hey ya,

Much better to have static map data files that are loaded from a web server as required rather than via a netio or socketio message.

You don't want to tie up your multiplayer server with sending lots of data that a web server can serve instead.
CEO & Lead Developer
Irrelon Software Limited
http://www.isogenicengine.com
User avatar
rob
Site Admin
 
Posts: 316
Joined: Tue Oct 22, 2013 5:08 pm

Re: Best way to transfer maps from server to client?

Postby robaldred » Fri Oct 25, 2013 10:10 am

Like Rob said, you're best keeping the maps in js or json files and having them served by a webserver or cdn that is built for serving static files.
You will need to load all the maps as part of the normal IGE loading process so by adding them to your ClientConfig.js
You in theory have as many maps as you like, it would be as simple as sending a "gotoNextMap" message from the server to clients.

In the handler for the "gotoNextMap" message you can then do the world to move on to the next map or level.
In very basic terms, you need to reset the world on both the server and the client.

1. Removing all player entities by unmounting them from the tileMap
2. unmount the tileMap from the scene.
3. Load the new map
4. mount the new map
5. mount the player entities on the new tileMap.

For the clients you can mount a level loading graphic or fade the scene to mask the rebuilding of the world in the background.
I don't work for Irrelon. All comments are my own.
I would strongly encourage anyone building production projects with Isogenic to buy a premium licence, it costs very little and will help towards continued development of the engine. Irrelon have spent thousands of hours developing this wonderful platform with many features found in AAA game engine.
User avatar
robaldred
 
Posts: 243
Joined: Wed Oct 23, 2013 8:09 pm
Location: Manchester, England

Re: Best way to transfer maps from server to client?

Postby rob » Fri Oct 25, 2013 10:28 am

It might be useful for me to ddescribe the graph loading system... ill make a tutorial vid tonight. It will show how to load and unload graph objects with single command calls.
CEO & Lead Developer
Irrelon Software Limited
http://www.isogenicengine.com
User avatar
rob
Site Admin
 
Posts: 316
Joined: Tue Oct 22, 2013 5:08 pm

Re: Best way to transfer maps from server to client?

Postby ChrisEt » Sat Oct 26, 2013 7:41 pm

Thank you guys a lot for your help!

You are right that static content should be served by a web server, not the game server. In case of the maps, these should be pretty static as well, but in contrast to textures, they need to be loaded by the client and the server.

I have now looked into how .js textures get loaded (IgeTexture._loadScript) and I think I can use the same mechanism on the client to load maps on demand. The basic idea is to have only the relevant maps and entities on the client.

Thanks so far, I'm sure it won't take long until the next question come up! :D
ChrisEt
 
Posts: 17
Joined: Thu Oct 24, 2013 8:59 pm


Return to Help & Questions

Who is online

Users browsing this forum: No registered users and 1 guest
cron