bombe93 Posted February 6, 2015 Share Posted February 6, 2015 Hi, I'ts possible to create a multiplayer game with Babylon JS? Maybe adding node js is possible? (example fps multiplayer, racing game) Quote Link to comment Share on other sites More sharing options...
jerome Posted February 6, 2015 Share Posted February 6, 2015 You mean a network multiplayer game ? Quote Link to comment Share on other sites More sharing options...
bombe93 Posted February 6, 2015 Author Share Posted February 6, 2015 Yes, I was wondering if you can create it with Babylon Js. Quote Link to comment Share on other sites More sharing options...
iiceman Posted February 6, 2015 Share Posted February 6, 2015 Sure, why not? If you can transfer the information needed fast enough. I think the bottleneck the amount of data that you would need to transfer pretty fast to avoid lags. bombe93 1 Quote Link to comment Share on other sites More sharing options...
RaananW Posted February 6, 2015 Share Posted February 6, 2015 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/ bombe93 and Dad72 2 Quote Link to comment Share on other sites More sharing options...
bombe93 Posted February 6, 2015 Author Share Posted February 6, 2015 thanks for the answers, other suggestions? other frameworks? Quote Link to comment Share on other sites More sharing options...
Dad72 Posted February 6, 2015 Share Posted February 6, 2015 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. bombe93 1 Quote Link to comment Share on other sites More sharing options...
jerome Posted February 6, 2015 Share Posted February 6, 2015 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. bombe93 1 Quote Link to comment Share on other sites More sharing options...
jerome Posted February 6, 2015 Share Posted February 6, 2015 this topic : http://www.html5gamedevs.com/topic/1480-how-to-make-multiplayer-online-games/ Quote Link to comment Share on other sites More sharing options...
Dad72 Posted February 6, 2015 Share Posted February 6, 2015 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-nodejsand cluster:http://nodejs.org/api/cluster.html bombe93 1 Quote Link to comment Share on other sites More sharing options...
bombe93 Posted February 7, 2015 Author Share Posted February 7, 2015 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 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted February 7, 2015 Share Posted February 7, 2015 Look here, I create a cluster server and lowest how to communicate with the client on the server side. http://www.html5gamedevs.com/topic/12321-create-a-cluster-server-with-nodejs-and-socketio/?p=70965 bombe93 1 Quote Link to comment Share on other sites More sharing options...
bombe93 Posted February 7, 2015 Author Share Posted February 7, 2015 Thanks I'll try! Quote Link to comment Share on other sites More sharing options...
suyashmshephertz Posted February 20, 2015 Share Posted February 20, 2015 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 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/ Quote Link to comment Share on other sites More sharing options...
RaananW Posted February 21, 2015 Share Posted February 21, 2015 this one looks promising as well - https://www.exitgames.com/en/Realtime . I have no experince with it thou, so don't take that as a recommendation Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.