Conway Hu

Handling local multiplayer for a networked multiplayer game

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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? 

Share this post


Link to post
Share on other sites
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.:P

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!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.