Jump to content

bombe93
 Share

Recommended Posts

It has less to do with babylonJS the engine, and more to do with your entire game implementation. Babylon has a LeaderBoard extension (as an example for a framework that could help you start - https://github.com/BabylonJS/Extensions/tree/master/LeaderBoard ), but you could integrate yourself anything you like.

Babylon is only the 3D engine. The entire logic around it is all yours to implement :-) 

An abstract implementation can be found here - http://buildnewgames.com/real-time-multiplayer/ 

Link to comment
Share on other sites

Yes, for creating multiplayer games, you will be sure to have scenes very optimized. model your objects Low polys, use a number of bones Collapse your character. have simple animation to relieve the game server. your images does not have to exceed 512 * 512 for fast loading of images. In short, wherever you can optimize it must be done and more will players be able to play without significant lag.

 

I develop myself a MMORPG for the browser. I also use SQL and PHP, Ajax for chatting and file creation and other for not always intervene the game server Node.js.

Link to comment
Share on other sites

Well, it's not that simple.

As you can read in RanaanW's link article, you'll need to have a transport layer between your clients and a server. As it must be bidirectional and established, WebSockets would be used. You can see them as a permanent TCP connections between the browser and the server (more complex actually, but it's for explanation purpose).

Knowing that WS don't know anything about applicative sessions, you will have to implement these first.

 

Then you've got two choices :

 

- to have your game loop running as well on the client as well  on the server.

Advantages : you have got one game referential to synchrozine every action/update on each client. You can compute predictive behaviors in function of network latency, etc.

Disadvantage : it's really complex and heavy to implement. BJS is not designed to run server side, so it will need deep modifications. Some frameworks propose all the stuff relating to game sessions, connexions, event loop, request/response management, etc. ex : http://pomelo.netease.com/

You can just type "html5 game server framework" in your favorite search engine.

If you use this kind of framework, you should consider they don't know anything about the client engine (except if you use THEIR client layer of course, but you're not in BJS then). So 3D, meshes, etc, everything making some sense regarding the client context (specific render loop, GPU use, contrainsts or optimizations) is unknown by the server.

 

- no to have your game loop running on the server.

The server may then be just a communication canal. Ex : given a game session, it could just send every received message (timestamped) to every currently connected client.

In this case, no game logic is running server side. Each client has to manage its own reactions in function of emited/received messages. It's quite impossible to manage latency prediction and so on. It is more designed to games where real-time behavior isn't that important.

It will be coded from scratch (unless it exists already somewhere on github) by the developer for server and client side - maybe something like Pomelo could be used here then too, without using all its complexity -.

But, it has the great advantage to be super light to code (dozens of LOC only), highly scalable then and to adapt to any client engine.

 

I personaly would opt for the second choice if I wanted BJS and network multi-sessions.

Link to comment
Share on other sites

Yes, the choice 2 is simpler. has implemented and this is what I use personally. but the optimization of the scene is very important to avoid Lag. plus a polygon mesh has more animations have to be calculated if there are many players, lag begins to feel that on each machine. Not side server but client side. if client side the scene is very heavy, it will slow. The optimization is firstly important in network game for many players connect.

 

Interesting topic on the load distributions behind a load balancer, see:

https://mazira.com/blog/introduction-load-balancing-nodejs

and cluster:

http://nodejs.org/api/cluster.html

Link to comment
Share on other sites

Ok I'm trying node js and I see that there are several plugins or extensions.

I am using Express (http://expressjs.com/) and to save variables (like position of object in Babylon scene) I think these things are available(http://expressjs.com/guide/database-integration.html).

 

So the questions are, which one is best? Is it okay this plugin or another?

 

Thanks  :D

Link to comment
Share on other sites

  • 2 weeks later...

You don't need to write server side code. You can try out my company's multiplayer game engine `AppWarp`. It is a cloud based service and hence does not require you to deploy and maintain server. You don't even need to write server side. We provide APIs for all the multiplayer functionality. It's free for Indies. 

 

And Oh! Yeah! I am the one who wrote the HTML5 SDK for AppWarp  :D I can guide you if you are willing to try out AppWarp ;)

 

Here is a getting started guide : http://appwarp.shephertz.com/game-development-center/the-chat-app-walkthrough/

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...