• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
BurdenJohn

Multiplayer Matchmaking, is this a good system?

4 posts in this topic

So basically I have a design for attempting to do multiplayer matchmaking.

 

Essentially what it is, is the ability for people to host their own games, without the need of:

- Dedicated hosting (the server)

- Port forwarding (TCP and UDP)

 

First off, do you think matchmaking is better or worse for people who wish to play your multiplayer game?

By that I mean, will it drive people away or closer to playing your game? Will your game be more popular if you offer

matchmaking or more popular if you allow people to host their own servers?

 

Anyways, my design for matchmaking is that everyone connects to one server of which I host (or have dedicated hosting somewhere else, none the less same thing).

 

When a player wishes to "host" a game, a message is sent to the server and the server will create an instance of a class known as "Match".

 

Match will hold all the information necessary for a game match,

- Instances of incoming players (player names, keypress/keyreleases, positions, score, etc.)

- Who the host is

- The scores of the players

- What's currently happening in the game

- Solid blocks

 

With that said, Match will be doing a lot of work.

For example, in this game, there are multiple rooms to the world.

Each room has its own list of solid blocks for the server to do collision checks.

The reason for this is, it needs the information about the map, because the client also has this information.

 

The clients are basically a dummy. The only thing they do is send keypress/keyreleases, and the server will update the position

of the players, and check collisions. The server then sends keypress/keyreleases back to everyone (including the player), as well as the new positions of the player, and the clients will update the position/move the player/stop moving the player accordingly.

This way, the clients have no way of modifying their position for their advantage.

 

Anyways, like I said the Match class does a lot of work. Because the server checks for collisions on its side as well, the server

must contain:

- A list of all the rooms

- For each room, a list of solid blocks and their positions

 

With that said, there would be multiple Match instances. Depending on how popular the game is, there could be as few as 10 or even 30 to 40 Match instances.

 

That's 10-40 threads, or maybe 2 threads for each Match. One thread would be for game logic (updating player positions, collisions), and the other thread would be for networking logic (what to do for incoming messages).

 

All of that plus the main server thread that listens for incoming messages (TCP and UDP).

 

Is this efficient for a small server computer to do?

Or would it just be better to let players host their own servers?

 

What do you guys think? Am I overcomplicating it?

0

Share this post


Link to post
Share on other sites

A few things --

 

You can't just send keypresses -- its wasteful at best, and a huge target for denial-of-service attacks at worst. The client has an understanding of the game world -- it takes input from the player and if the client believes the input is a valid move, it sends some state to the server, but not "I pressed left" or "I just moved here", more like "I want to move here" -- but in the mean time, the client goes ahead and does it. The server then takes that message and determines if its valid based on the server's own understanding of the game world. Based on that, it knows what the player state should be, and it sends it back to the player, and to other players, and each client reconciles it with their local understanding of the game world. Keypresses are insufficient to convey this.

 

Secondly, I would have one match per program instance. The question of how many matches to run per physical server is a separate concern, and also its possible, if not likely, that each match might have a different world or world-state, so keeping track of all that in one monolithic program is more work than it ought to be doing. To scale up the number of matches hosted on a physical server, just spawn more instances of the server program and attach them to a different port, possibly putting them behind some kind of lobby or load-balancer. If there's multiple, possibly-conflicting configurations, spawning a bunch of executables side-by-side might be problematic, but there are great solutions for this today, like Docker allows you to create, manage, and run multiple independent execution environments on one machine without resorting to VMs. Docker runs on Linux and is also available in MacOS X, I believe.

0

Share this post


Link to post
Share on other sites

I'm a bit confused on how else you would send movement without sending keypresses?

How else would the server know that a player is moving to the left, if you don't tell it that you pressed the left key?

 

How is this wasteful?

 

Also, are you saying that having multiple instances of Match in one process, is probably not a good idea, and its better to have a separate process

for each Match? You also said that when you have multiple processes of the Server, you need a new port.

Wouldn't you need to port forward for every single new server instance? 

 

Let's say you port forward 12345 TCP, 123456 UDP.

Now a new server instance is created, you need to port forward two new ports, but how would you do this when you would need to manually go to the router settings and port forward?

 

Or are you saying, have a preset range of ports to be forwarded?

Which is kind of strange because you won't know how many Matches there would be depending on the popularity of the game.

You would be limited based on how large of a range of ports you want to forward.

It makes more sense for their to be a master server that handles all the network communication on two main ports (TCP and UDP), and the information is relayed to the Match instances and the Match instances can send information back to the master server and have the master server send out data.

 

The master server in other words would be in charge of networking, and the Matches would retrieve the network data from the server, and send it back to the server to be sent out to the designated clients.

Edited by BurdenJohn
0

Share this post


Link to post
Share on other sites


How else would the server know that a player is moving to the left, if you don't tell it that you pressed the left key?

 

You tell it that you've moved left. Or you tell it where you've moved to.

 

Ideally, the precise detail of how the input was entered (eg. via a keyboard) is all handled by the client. The server just needs to be told about intent, ie. movement.

 

I personally like to operate by sending the desired new position to the server, which can then accept it or veto it accordingly based on information about the player's previous position, velocity, and capabilities. This seems adequate for most games, though it is unlikely to be sufficient for shooters.

0

Share this post


Link to post
Share on other sites

Is your proposal that you build a service that runs matchmaking AND game servers for a game, and the developer focuses on the client?

There have been other such projects built, sometimes by large, well-funded teams, and almost none of them are still around.

I don't think the business model is there to support such a service.

The closest I know that still works is either matchmaking/social systems like SteamWorks, or service-based systems like Parse and Gamedonia.

0

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
Sign in to follow this  
Followers 0