• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed Apr 10, 2019 at 04:27 PM by RER1200 for the following reason:

Too subjective and argumentative

avatar image
Question by RER1200 · Oct 25, 2018 at 08:50 AM · networkingmultiplayernetworkclient-servermatchmaking

.io style matchmaking (one button matchmaking)

I'm currently working on a 2D web shooter. I currently have a room based matchmaking (a client creates a room and becomes the host and other clients join this client/host's room) but I want to have an automated matchmaking. By this I mean that a player launches the game, he clicks on a button "Join game" it then puts him in a game where if he is the first person, he becomes the host, and if there is already someone he connects to that persons game. The problem is that my knowledge and experience with networking is very limited so I would like some help on how to do this properly.

PS : I want to have a client server because I don't want to put money in servers.

Comment

People who like this

0 Show 0
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

  • Sort: 
avatar image

Answer by Bunny83 · Oct 25, 2018 at 10:41 AM

First of all you can not let a client host the game if your game is a webGL game. You have to have a dedicated server that you host. A WebGL application that runs inside the browser of a client can not receive incoming connections, at all. There is no way to directly connect two webGL applications through networking without having a server to which both clients connect to. Apart from the fact that the security sandbox of every browser doesn't provide a way to opening a listening socket, you would additionally have the problem that you can not circumvent firewall or NAPT routers in between.


All browser based multiplayer games have a central server (or several) to which all the clients connect to. Since it's a web application you actually have to host it on some kind of server. It's naturally that you implement the server on the same machine where you host your game, though it's not necessary. You could host the game content (the actual website) on github pages for free and provide your server on a seperate server. However you need a server where you have some sort of serverside scriting / programming so for example github pages can't be used as matchmaking / game server.


I don't want to put money in servers.

Well in this case you have to find a free webservice that allows you to run any sort of server side logic code. A lot web free hosters have quite strict regulations how you are allowed to use their service. A lot do not allow to use their service just as data service. The next issue with free hosting is, they can quit their service at any time. I recently moved from dropbox hosting to a freehoster since DB made it so tedious to host a webpage. However after less than a year that freehosting service has shutdown their service. So it's possible to use freehosters, however not very practical in the long term.


As for how to implement matchmaking, sorry but this topic as a whole is way too complex to answer here, especially if you're not experienced at least with the fundamentals of networking.

Comment

People who like this

0 Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image RER1200 · Nov 11, 2018 at 07:18 AM 0
Share

Alright so I guess that I'm pretty much stuck and should make this game a standalone. Could I implement a one button matchmaking like I originally planned to on a standalone game with a client hosting the game ?

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

204 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Unity networking tutorial? 6 Answers

Network command is running on client? 1 Answer

Can MLAPI connect to a standalone server written in another language (Go) 0 Answers

How to write a multiplayer game that uses a dedicated server? 0 Answers

are you sure the server can be connected to? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges