Jump to content

Recommended Posts

Hello! I have the following task to do in the next following 3 weeks: create a real-time multiplayer strategy game. I have no experiance in making multiplayer games, no experience in phaser io, node js or using web sockets. But I am a fast learner and I already learned a few things about those libralies. I am thinking of using Angular and phaser for the client side. Nodejs and socket io for the server side. The thigs I need to be done:
-multiple game rooms
-states for the game(menu, playing, game)
-user authentication
-interacting on a MySQL table for users (connecting two servers)

-building logic for the game
-real time syncronisation between every player, every unit(when it shoots, move)

Ok so the first 5 issues won't be such a dificulty for me and if it was a single player game I probably wouldnt ask this question. I am really asking for help for building the base thing and some "proof of concept". I need to connect the two players in one room, need to when a single unit is moving and shooting to some building, and the building(tower) shoots back this to be sincronized and to work for lets say a 100 units. Where do I start? What metod do I use?
1. Shoud I have game state on the server and this logic to be in the server so everything is syncronized? So when two player start playing the game, the server also (plays the game) in some kinda loop until the game ends. And sends to the users JSON lets say 30times/second. And the user interact to the game logic with controllers, which sends the info to the server and server updates it's state, mean time the client still gets every second a lot of json objects, and rerenders on every change.
2. Using Observer pattern with syncronizable interface, for keeping track of enemy possitions on your client. The server is only used or transfering data and authorising, nothing else. Have sepparate game states on each client, which you syncronise with other clients?

So which method would you advice me to start with for my prove of concept(I accept other sugsestions)? How should I build my archictecture? The prove of concept is the basic thing that I should start with but is the most hard one. I am way over my head. I would really use some help. Thanks! :)

Link to comment
Share on other sites

I did this exact thing 4 years ago, and 3 weeks were only for first test. Then I forgot about RTS and made first version of gameofbombs.com in 1 week :)

30times/second for RTS is too much , try 10times. And first read this papers:


1. https://blog.forrestthewoods.com/synchronous-rts-engines-and-a-tale-of-desyncs-9d8c3e48b2be

2. https://blog.forrestthewoods.com/synchronous-rts-engines-2-sync-harder-5c0aa9b23820#.y9pk8gcn2

3. https://docs.unrealengine.com/latest/INT/Gameplay/Networking/

4. http://gamedevs.org/uploads/tribes-networking-model.pdf

And try use this thing: http://eureca.io/

Link to comment
Share on other sites

Authoritative server is probably the easiest way to go.

You only have 3 weeks and a lot to do so make your life as easy as possible. Your clients should be pretty dumb, just have them react to game state changes coming from the server and send instructions on what should happen to the server.

You dont need to send the entire game state all the time (although its a lot easier if you do), just send the diffs as things change. As you're using node it could well be tempting to have the exact same code run the game simulation on both client and server, this is very attractive, but, see my earlier point, probably best to avoid this and keep the project as simple as possible.

Link to comment
Share on other sites

Only three weeks? With no experience? And you're starting from scratch? Assuming your game is something more complex than tic-tac-toe you may want to consider using a turnkey service like Photon to handle the multi-player aspect to save time. If you manage to get the game completed and polished with time to spare then you can always reconsider rolling your own multi-player system.

Link to comment
Share on other sites

  • 4 weeks later...

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...