Conway Hu Posted December 28, 2017 Share Posted December 28, 2017 Hello, I'm currently trying to make a networked (client/server) multiplayer game with an option for local multiplayer, where the game is hosted directly by the client so that people can play against each other on the same screen. In my original GameMaker prototype, I did this by maintaining two separate copies of the game logic for each mode (local multiplayer in GML and networked multiplayer in javascript/nodejs). This seemed redundant, so for my current html5 version, I figured a better approach might be to place the game logic in a "shared" folder on the server, and then have that be served to the client using express-js. That way, both the local mode and the networked, server-side mode derive their game logic from the same source. Is this the right approach? And if so, are there specific tools other than express-js that I should be using to achieve this? Quote Link to comment Share on other sites More sharing options...
kurhlaa Posted January 2, 2018 Share Posted January 2, 2018 On 12/28/2017 at 6:17 AM, Conway Hu said: so that people can play against each other on the same screen How does it look like? 1 monitor and 3 people on the same keyboard and moving the same mouse? Quote Link to comment Share on other sites More sharing options...
Conway Hu Posted January 4, 2018 Author Share Posted January 4, 2018 On 1/2/2018 at 1:05 PM, kurhlaa said: How does it look like? 1 monitor and 3 people on the same keyboard and moving the same mouse? Hahaha. My game's turn-based so nothing awkward like that. Anyways, I did some more research and I ended up answering my own question. This article (http://buildnewgames.com/real-time-multiplayer/), which I initially discounted because my game is turn-based rather than real-time, turned out to be the reference I needed because it shows an example where both the client and the server require a copy of the gameplay code. I'm glad to see it really is as simple as serving a shared file via express! 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.