Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Best practices for multiplayer in a racing game without collisions between cars

Discussion in 'Multiplayer' started by newlife, Jun 13, 2019.

  1. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,064
    Hello,
    I would like to implement multiplayer in my mobile racing game (Real Drift Car Racing).
    Collisions between cars are disabled. Some kind of matchmaking is required in order to match players with the same level of expertise.
    Basically, something like the multiplayer in Assoluto Racing or Carx.

    Any advice?
     
    Last edited: Jun 13, 2019
  2. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    279
    You may check this tutorial here: http://docs2x.smartfoxserver.com/ExamplesFlash/space-race
    It was developed on the Flash platform (not Unity), but you should get the basic concepts of client synchronization. On the server-side the game uses SmartFoxServer and the code is written in Java, while the client-side code is written in ActionScript. In both cases it shouldn't be too difficult to figure out what is going on.

    The game doesn't feature a specific match-making system (other than a Lobby), but you will find details on how to implement it in other sections of the SmartFoxServer documentation.

    Hope this helps.
     
  3. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,064
    Hello g_a_p,
    thank you for your reply. Which is the suggested "setup" for my requirements?
    As far as I understand, the best solution should be the hybrid solution (SFS2X + server side Unity). Is this correct?
    Also, is there a tutorial about client synchronization and matchmaking made for Unity?
    How SmartFoxServer compares with Unity Multiplay and Amazon GameLift?
     
  4. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,064
    I had a look to the page of the live demos, and the only Unity demo is made with a web player, so its not working.
    Do you have plan to update the demo to WebGL?
     
  5. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    279
    You can find all the latest versions of the demos in this section of the SFS2X documentation: http://docs2x.smartfoxserver.com/ExamplesUnity/introduction

    We also have a demo package (containing the same examples) published in the Asset Store.
     
  6. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    279
    I guess the need for server side Unity depends on your game requirements. If you just need to synchronize positions and you don't need a physics engine (or if it's simple physics every client can handle on their own), you don't even need Unity on the server side.
    For example our Object Movement, First Person Shooter, MMO Demo and SpaceWar examples show a few different ways to synchronize positions.

    For client synchronization, see my previous answer. For the matchmaking we don't have a specific example, but here you can find the documentation to implement it: http://docs2x.smartfoxserver.com/AdvancedTopics/game-api

    About Unity Multiplay, it is not yet clear how the service will work, so it is impossible to compare it to SmartFoxServer now. About GameLift, from what we know it is a sort of "self-service" in which you assemble your gaming infrastructure. From our understanding, both services will be something different from SmartFoxServer, so hardly comparable.
     
  7. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,064
    I was referring to the live demos
     
  8. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,064
    The physics is not simple (full realistic vehicle simulation). Keep in mind that this is my first time in multiplayer developing, my knowledge is very limited.
    So, since we dont need collision between cars, we also dont need a phisic engine on the server.
    In this scenario every client will calculate the physic only for the local vehicle (user vehicle) and send its position to the server, that will send the position to the other player. Is this correct?
    If yes, which is the best architecture? Which is the best way to synchronize positions, knowing that its a racing game (so with fast paced object)?

    Strange cause matchmaking is a very basic feature of any multiplayer game..
     
  9. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    279
    For this reason I think you should start from the basic concepts and then move on. Multiplayer development can be hard to learn, and there's no magic recipe. Every single game has its own requirements and therefore solutions.
    If you are interested in working with SmartFoxServer, we actually recommend reading the general documentation (so you learn how it works, then proceed through the various examples, from the basic one showing how to connect a client, to the most complex ones showing synchronization and more.
     
  10. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    279
    Sure, in fact this is a well supported feature of SmartFoxServer. We just don't have a Unity example showcasing it at the moment. We will take this as a suggestion to improve our set of demo projects then. Thank you.
     
  11. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,064
    Well im writing here cause I need some advice in order to understand which is the best architecture for this kind of game, which represent a very common scenario (even simpler than average cause there is no collision between cars and there should be two player at the same time, no more).
    I dont think its a good idea to reinvent the wheel.
    Btw, I had a look to your showcase page and I found a game that has EXACTLY the same architecture than our (Drift Mania: Street Outlaws).
    Do you know how multiplayer has been implemented in this game?
     
  12. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    279
    Unfortunately not, we don't have the technical details about most of the projects based on SmartFoxServer.
     
  13. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,064
    Any other suggestion? Is it still possible to use Unity Multiplayer?
     
  14. TheLastVertex

    TheLastVertex

    Joined:
    Sep 30, 2015
    Posts:
    126
    I'll try not to recommend anything specific but I can tell you what I've looked at and am currently using and why.

    I'm using UNET and the HLAPI but NOT the peer to peer hosting solution called "Unity Mutiplayer". I decided to go with a dedicated server option, even though my game is only 1v1. Best case scenarios it was going to be cheaper than than the peer to peer solutions, and worst case scenario it was close enough that I didn't care about the pricing difference with the added benefit of dedicated servers.

    I originally went with this asset store pack: https://assetstore.unity.com/packages/tools/network/master-server-kit-71604

    It's self hosted so you need to manage your own cloud droplet on Digital Ocean (I've confirmed it does not work on AWS last I used it anyways). It's fairly straight forward, and decently documented. The developer also usually gets back to any questions within a day. As someone with no Linux or cloud experience prior I was still able to get something working although I had to learn a lot of things.

    It's dirt cheap, gives you a basic for hosting multiplayer and runs a straight linux headless build of your unity project. Downsides are it doesn't auto scale to demand. If you are expecting more than a few dozens players you are going to have to scale it manually by setting up more cloud droplets. It also does not have a skill based matchmaker. It can have players find and join servers fine though.


    I decided to go with AWS GameLift as a final solution. It's a dedicated server option and cheaper than all other cloud hosting solutions I've found with the exception of doing it yourself like above. It runs a straight Linux headless build of my Unity project. It auto scales to player demand and comes with a skill based matchmaker. Downsides are you need some sort of profile / master server framework as a middle man to talk to the service. Your players should login to something like PlayFab, GameSparks, Chilli Connect etc then have that talk to AWS api's. That also costs money though some have free tiers unless you want to manage that part yourself.

    Be-aware as someone who was not familiar with AWS when I started, that they split their services out. So if you want GameLift to send a message to GameSparks, you're gonna have to use another AWS service to do so, and it's going to cost you as well. AWS is not an all in one solution, it's all divided up so just be aware of all the pieces you are going to need before you start.

    If you use spot instances it's cheaper than their competitors. It got a great toolset and their technical support is super helpful even to solo developers.

    Also I would look into PlayFab and their hosting solutions they've been moving towards with Microsoft Azure. They are similar priced to GameLift on average, but don't have equivalent to spot instances so end up being much more money. But they do appear to give you more of an all in one solution with the user accounts and hosting all bundled together so you don't have to piecemeal a bunch of services together yourself.

    I also looked into Multiplay which were recently acquired by Unity. Unfortunately their pricing is orders of magnitude more and not really geared towards indie developers.

    Last but no least there is Photon which I have not used but I know some who do and used to be fairly popular around here.



    For a racing game without player collisions I think it shouldn't be too difficult as far as the game code goes. Player collisions probably being the harder part so if you are skipping on that it'll make things easier.

    If you do client side prediction and have clients run the game as normal while sending all inputs to the server to be verified. This way you can prevent cheating and re-update the client if their are any discrepancies.

    Additionally, you take those server inputs and send the resulting positions back for all opposing players as "Ghosts" so you can see their positions in real time.

    I imagine there might have some trickiness though, especially with any close races at the finish line. If the local player has client side prediction, and they see a ghost of an opposing player. They are going to see themselves ahead of where they are on the server, and the ghost behind where it actually is. So you could end up with a case of the player seeing themselves cross the finish line first, even though according to the server the opposing player won. Not sure the best way to resolve that. Might be some white papers or GDC talks from racing game networking around that might give some clues.

    Alternatively depending on the handling response of the vehicles you could try and do it all server side and update the player positions that way. Latency would effect input, but you would solve the above problem as everyone would see the same state for all players including themselves. Additionally this would allow you to do player collision without any issues since it's all handled on the server. I know Unreal Tournament 2004 did all multiplayer vehicles server side since no one noticed the latency with the way vehicles handled anyways. But that's not a racing game and vehicles might handle different than your game.

    anyways, sorry for the long post, hope it helps and good luck!
     
    newlife likes this.
  15. g_a_p

    g_a_p

    Joined:
    Mar 16, 2015
    Posts:
    279
    I take a cue from the above comment to talk about the "authoritative server" approach. This is the one I favored when developing a space-combat demo game a few years ago. The following is extracted from an article I wrote to discuss the techniques used for players synchronization.

    Even if it refers to spaceships, I think the logic in a car racing game is quite similar, supposed you only have to deal with a trajectory altered by user input. If the trajectory can be altered by the environment too (for example bumping against obstacles), there would be an added layer of complexity which would require additional refinement of this approach.

    In any case I hope this helps, as the concepts can be applied to any solution based on an authoritative server.

    » Clients synchronization
    Maybe the most complex topic when developing a realtime multiplayer game like this example, it's to deal with the clients synchronization. Each game type has its own strategies and techniques which include movement prediction, interpolation, latency compensation and what more.

    When developing a strategy for synchronization we should always aim at minimizing the amount of data exchanged between the clients and the server. The reason is not to overwhelm the client and the server with messages to be processed, allowing more concurrent users on a single server instance and reducing hosting costs (less server instances, less CPU power per instance, less consumed bandwidth). For this purpose the mechanics of each game must be analyzed in depth to choose the best approach depending on its characteristics.

    Our SpaceWar game is a simplified space simulation in which starships and weapons move on an immutable trajectory. This trajectory is a straight line (but the same concepts also apply in case of curved trajectories, for example due to a gravity effect) which, in the case of starships, can be modified by the engine thrust or a collision with a weapon shot, which both alter the ship velocity (speed and direction). Due to the very simple maths involved (essentially we have to sum vectors representing the speed), we decided that the best approach was to run the same simulation routine on both the server and the clients on a time basis: we set a framerate of 25 fps in the Flash client and a corresponding scheduled task (running every 1000 / 25 = 40 milliseconds) on the server, and execute the same simulation logic in each frame.
    With this approach, the server continuously updates the position of all entities (starships and weapon shots) existing in the MMORoom and the same does each client on its own (of course taking into account the "known" entities only — in other words those falling within the user's Area of Interest). If no alterations to the state of such entities happen, the server and client simulations keep running in parallel without the need to exchange data between them (for example the clients declaring their position to the server continuously). We reduced the data exchanged between the server and the clients to zero (PROXIMITY_LIST_UPDATE event apart).

    Of course this is not realistic, because the players interact with the game rotating their starships, turning the thruster on and firing shots: in other words altering the starships trajectories (not to mention possible computer slowdowns, in particular on the client side, which can make the two simulations diverge even if the player doesn't interact with the game).
    In order to keep the simulations in-synch and still exchange a small amount of data, we promoted the server simulation to "master" (in other words we have an authoritative server): all actions causing a trajectory change, for example the player pressing or releasing the thrust key, must be communicated to the server, which updates the entities state accordingly and sends the updates to the clients which in turn reset their local simulations, ensuring an high degree of synchronization.

    » The lag problem

    The client synchronization mechanism described above works perfectly in a local scenario, where no latency exist between the server and the client. But what if we introduce the communication lag? Let's take a look at the following picture:



    1. The starship is moving along direction d0 at a velocity represented by the blue vector.
    2. At time t0 the player presses the thrust key after a 90 degrees rotation of the starship, sending a request to the server only (no changes in client simulation).
    3. At time t1 the server receives the request and processes it, summing the current velocity vector and the thrust vector. Now the resulting velocity direction is d1 and the new vector is sent to the client.
    4. At time t2 the client receives the update, but in the meanwhile (t2–t1) the starship in the client simulation moved to this new position: setting the new velocity now places the starship on the resulting d2 direction, making it out-of-synch with respect to the server (on the server the starship kept moving along direction d1in fact ).
    The t1–t0 latency isn't very important and in any case we can think about some tricks to reduce the lag perceived by the player between the key press and the action being executed (we will discuss this again later in this document).
    The t2–t1 lag is instead what causes the client and server simulations to diverge, and we have to take actions to compensate it. The solution adopted in our example is based on measuring the mean lag between the client and the server using the built-in feature of the SFS2X API. Given this value (which approximately indicates the t2–t1 time span), the position the starship had at time t1 and the new velocity vector (both saved in User Variables, as explained later), it is possible to calculate the actual position of the starship on the server side and reset the client simulation to align it with the server one.

    The final result is pretty good, even in case of extreme (for a realtime game) latencies of 200 milliseconds or so.

    The above is taken from this tutorial: http://docs2x.smartfoxserver.com/ExamplesFlash/spacewar-p1
    The tutorial discusses the Flash version of the game, but the same concepts have been applied in the Unity version available here: http://docs2x.smartfoxserver.com/ExamplesUnity/spacewar
     
    sharkapps likes this.
  16. Stanchion

    Stanchion

    Joined:
    Sep 30, 2014
    Posts:
    269
    @TheLastVertex How it your progress with GameLift? Do you have it working with your game now?
     
  17. TheLastVertex

    TheLastVertex

    Joined:
    Sep 30, 2015
    Posts:
    126
    Yes I have it working with my game at the moment. I'm happy with it but haven't gotten around to an external play test on it yet. The previous play test I did was using the old solution.

    I should clarify some comments I made about it earlier. It has a "Matchmaker" that is completely open to set the rules as you please, but not necessarily a skill based matchmaker out of the box. They give code examples for varies rule sets, one of which is how to set up the rule set for a skill based matchmaker. Now given this is a huge part and very valuable it is also only a portion of the solution. The other part of the battle is how do you track skill? Where do you store players skill values? How are the skill values increased or decreased based on wins and loses? Unfortunately this portion is not provided. It'll take whatever values you give it and match make wonderfully based on any rule set you want to make, but you are responsible for how those values are tracked.

    I believe PlayFab / Microsoft game stack / xbox live have some interesting stuff coming down the pipe on this front which is probably worth checking out.

    The SDK setup for Unity was pretty straight forward. I did get bogged down on some error messages that were apparently an SDK issue and not my fault as I assumed. I believe this may be addressed in the newest SDK but haven't checked yet.

    I also had to manually set up port settings for the network manager. Since you can run multiple servers on a single instance they need to use different ports. Unfortunately my efforts to do this dynamically on server start were unsuccessful. Instead I have to pass them via command line and set them manually. It's only a one time setup but still requires me to manually enter command line arguments and port numbers on the AWS portal anytime I setup a new fleet.
     
  18. Stanchion

    Stanchion

    Joined:
    Sep 30, 2014
    Posts:
    269
    @TheLastVertex Can you link me to the "SDK for Unity" you're referring to?
     
  19. TheLastVertex

    TheLastVertex

    Joined:
    Sep 30, 2015
    Posts:
    126
    Hey sorry for late reply.

    You'll want the "Amazon GameLift Server SDK" from here: https://aws.amazon.com/gamelift/getting-started/

    And the following docs:
    General: https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html
    Unity Specific: https://docs.aws.amazon.com/gamelift/latest/developerguide/integration-engines-unity-using.html

    You will have to compile the SDK first, then add it to Unity project.

    Also be aware. I remember there being some confusion on my part with the documentation. When they talk about "clients" they are not talking about the end user or player (aka unity networking client). They are talking AWS clients, which are probably closer to "master server" type logic I believe.

    Using that script in the Unity specific example should get you the bare minimum for your game server if I remember correctly. Then you can test it with AWS command line to get it to spin up servers and shut them down etc.

    Once you have that working you should be able to connect to the game server from the game using the network manager / network manage hud manually by entering ip and port info.

    Downside I found is googling for info is hard to find other than the official docs. GameLift forums are pretty bare as well. But I have found GameLift technical support to be phenomenal. I've had numerous calls and lots of emails with them that have been extremely helpful and willing to answer any questions I had.
     
  20. Stanchion

    Stanchion

    Joined:
    Sep 30, 2014
    Posts:
    269
    @TheLastVertex Are you manually connecting manually to the servers on GameLift rather than using the API for CreateGameSession, CreatePlayerSession, etc?
    Where is this email/phone contact available?
     
  21. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,064
    @TheLastVertex, thank you for the comprehensive reply.
    What Im searching for is a solution as complete and simple as possible, even if it costs more. Im a single developer with some sporadic collaborators that works only on the visual aspect, so I dont have time and resources to reinvent something that has been already implemented successfully by some of our competitors (Carx Drift Racing, Assoluto Racing, Racing Fever).
    As far as I understand, Gamelift is a bit more difficult to set up and its focused on realtime multiplayer, Playfab is a more complete service (it includes multiplayer, analytics, player authentication etc.) and it takes advantage of Xbox Live developers experience, Photon is very complete too and it seems to be very tight to unity (it has been used is several successful unity multiplayer racing games).
    Now, to me the best solutions appear to be Playfab and Photon.
    Btw, what do you mean with " spot instances"?
     
  22. Stanchion

    Stanchion

    Joined:
    Sep 30, 2014
    Posts:
    269
    @newlife GameLift, PlayFab, and Photon are all very different. They have some overlap, but you could use them all in combination, like GameLift for server hosting, PlayFab for login/social, and Photon Bolt for server/client networking.

    I am currently working on samples for GameLift and PlayFab (and work on Photon Bolt)

    On-demand instances
    - They let you pay for your computing capacity needs by the hour. There is not much planning required from the user's end and no one time cost that you need to pay upfront like in case of reserved instances.

    Suitable for use cases where you do not want any long term commitment like testing and POCs, spiky, not to be interrupted workloads.

    Spot Instances - These are spare unused Amazon EC2 instances that you can bid for. Once your bid exceeds the current spot price (which fluctuates in real time based on demand-and-supply) the instance is launched. The instance can go away anytime the spot price becomes greater than your bid price.
     
  23. TheLastVertex

    TheLastVertex

    Joined:
    Sep 30, 2015
    Posts:
    126
    I am using the API calls you mentioned, but those are only for setting and spinning up the game server on AWS and I do not call those from the end user but instead from GameSparks at the moment. You don't have to use GameSparks but this should ideally not be called from the end user due to security concerns with needing API keys and AWS privileges etc. At the end of the day though the end user still needs to connect directly via IP and Port information.

    I'm actually moving away from GameSparks due to their price change, so this could be Gamesparks, PlayFab (doesn't play nice with AWS for the moment), ChilliConnect, another service, or even your own master server if you wanna roll your own.

    I'm not sure if I should derail this thread with purely AWS stuff but I'm happy to answer your questions, via a thread, forum conversation, or even discord or steam chat if you like. I'm starting to sound like an aws sales person :p

    I don't actually remember how I got into initial contact now, but I'm assuming it was through the sales page located here: https://pages.awscloud.com/Gamelift-Contact-Us.html


    If they have the features you are after I think they are both popular for a reason.

    I am in no way pitching for AWS. I've just had to mess around with so much stuff and I encourage anyone to make sure you fully investigate every piece you need because it's a pain to get part way through and find out something you didn't even think about is missing and have to switch.

    Even right now trying to switch away from GameSparks I found out PlayFab and ChilliConnect are missing websocket feature (it's on their roadmaps though) which is a bummer and not something I even thought I would have to think about.

    To answer your question, if you have a look at their pricing page located here: https://aws.amazon.com/gamelift/pricing/

    They have "Spot" pricing and "On Demand" pricing. Take note of the instance type "c4.large". This is the most standard instance type. It has 2 Cpu's and 3.75 gb of memory. The monthly price for this spot instance is $7.92 and $46.35 for on demand. A pretty huge difference.

    AWS spot instance are essentially "left over" resources on AWS and as such they offer them for super cheap with the draw back that they could potentially be shut down if needed with a 3 minute warning(It's not as bad as it sounds). If you look up AWS spot instances they will have a whole spiel on this and how it's unlikely to happen and how they allocate the least likely to terminate etc etc. I can't seem to find the page I was looking with the stats though :(

    The downsides for gaming isn't as bad if you are planning on having a session based game and don't need a perpetual server. If your matches are only going to be run for X amount of time, then the server is shutdown, and a new server is started for each new match, this could be a cheaper solution. Since you will get fresh cloud resources every time you start a match, your chances of ever getting terminated are pretty close to 0.

    On the other hand if you want On-Demand their pricing is going to comparable to PlayFab servers for example.

    And then on top of all this you've got data transfer / bandwidth costs as well.
     
    Last edited: Jun 22, 2019
  24. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,064
    @TheLastVertex if you think that AWS is a better and more complete solution just tell, you seem to me someone who investigated a lot on the matter. I read your post carefully.
    For example, why do you think that this websocket feature is fundamental?
    Also, did you know that the matchmaking feature in playfab is still in preview state? https://docs.microsoft.com/en-us/gaming/playfab/features/multiplayer/matchmaking/ (!!!!)
    Thats crazy. On the playfab home page they market it as a full and ready to be used feature...
    For what concern ChilliConnect, do you think that it is an option too?
     
  25. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,064
    I just had a look to a video where its stated that photon PUN 2 is not authoritative server.

    is this true? If it is, PUN is useless for me (too easy to hack a mobile game, we are already facing this issue with the leaderboard).
     
  26. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,064
  27. Stanchion

    Stanchion

    Joined:
    Sep 30, 2014
    Posts:
    269
  28. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,064
    Do you work for exit game?
    Btw, I just read this thread on photon forum (https://forum.photonengine.com/discussion/14131/photon-bolt-cloud-matchmaking-exploits), how to avoid banned users to create new rooms? It seems that Bolt has no authentication function let alone custom authentication.
    Anyway, my app is released on Android and iOS, so my plan is to use Google ID or Apple ID as Photon ID and skip the authentication process (https://forum.photonengine.com/discussion/11176/googleplay-services-login-photon). Is this possible?
     
    Last edited: Jun 24, 2019
  29. Stanchion

    Stanchion

    Joined:
    Sep 30, 2014
    Posts:
    269
    Yes, we are currently working on authentication.
     
  30. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,064
    When is this planned to be released on Bolt? How does it work authentication right now?

    What about this?
     
  31. Stanchion

    Stanchion

    Joined:
    Sep 30, 2014
    Posts:
    269
    I would check back in a few weeks, we'll have a better idea on authentication in Bolt.

    As for PUN I don't work on this so I would ask someone else.
     
  32. TheLastVertex

    TheLastVertex

    Joined:
    Sep 30, 2015
    Posts:
    126
    I'm trying not to recommend anything specifically because it might not suit your needs. I'm happy with what I have but it doesn't mean it's suited to everyone. Someone who has previous experience with AWS might pick it up way easier than I did, or if they don't have any AWS experience might find it takes a lot more work than a more all in one solution. It definitely follows AWS "component" based products. Where you can take little pieces and only use what you need. But this can be annoying as you gotta put work in to link them all together. I was not aware of this when I started but I was happy to finally learn AWS in the process. With GameLift, you don't just need to learn GameLift, you're probably going to need to learn GameLift, AWS Lamba, AWS SNS, GameSparks(or alternative), and how they all work together.

    I am pretty uninformed about Photon. I originally wrote it off because I got mixed message regarding their authoritative server / dedicated server support and didn't want to use a peer to peer solution. Even reading the product page you linked confuses me. "Client-hosted Networking for Unity that Always Connects Your Players", doesn't sound like what I want... then further down it says "BOLT offers truly unique support for authoritative games: Authoritative movement with client-side prediction and lag compensated ray-casting are both built in." Ok that's good, but even further down it says "Needs to be combined with an orchestration solution like Gamelift or Multiplay.". I don't know where the line between networking API's and hosting solutions is with Bolt, but that doesn't mean you shouldn't consider it for your needs. It might be worth it to get in touch with someone and see exactly what they are offering.

    I do not think the websocket feature is fundamentally needed, it was just something I assumed everyone had. The downside to no websocket, in the case of matchmaking. If a user wants to find a match, and a match is found. The service cannot push that message to them. The user has to query for it and keep asking "Have you found a match for me yet"?. Which is not the end of the world, just another thing I didn't even think about. I was already used to this with GameSparks, but ChilliConnect and PlayFab don't have it (although it's in the works for both).

    I don't have any specific technical hangups with Chilli Connect. I actually prefer their SDK over PlayFab from what little I've used. My only concern is they are a small company which makes me a little wary of their long term viability. One of the reasons I chose GameSparks was because they are owned by AWS. I assumed their long term viability and integration would be a given. Unfortunately their pricing has changed and they are working on an all new version.

    I wasn't aware of the state of Playfabs matchmaker but good to know. I thought they had something but couldn't remember if it was always there or just announced at GDC. Thanks for the info though.
     
  33. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,064
    Yes in fact Im just listening to your suggestions cause you seem to be competent regarding mutliplayer (at least much more than me).
    I dont feel like AWS is for me cause is not a "complete" solution, which is exactly what Im looking for.

    Do you mean that Bolt is a peer to peer solution? Where did you read the negative impression regarding the authoritative server?
    What is orchestration for?
     
  34. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,064
    I think that, in order to receive the best suggestion from people more competent than me (near zero) its better to describe precisely what I need.
    I want to implement real time multiplayer for Real Drift Car Racing, a mobile drift racing game quite successful.
    Players will have a expertise lever (it will be zero for everyone at the beginning).
    A player can select several rooms (drift race, time attack race, timed event etc). In every room he will be matched with a player with around the same level of expertise. Once found, the race will start (so only two players with two cars that dont collide each other). Ideally the player can race also against a ghost saved on the server (so there will be a leaderboard with the best players with the relative ghost to race against). The winner will have its expertise level increased, the loser will have it decreased.
    This is clearly a competitive multiplayer, so I need a service with an authoritative server and client prediction.
     
  35. TheLastVertex

    TheLastVertex

    Joined:
    Sep 30, 2015
    Posts:
    126
    I'm not sure what they define as orchestration, that's just a quote from their product page but seems to imply a 3rd party hosting solution.

    Since they officially mention GameLift and Multiplay you might be able to use the Photon networking API without being forced to use their hosting services. Which is maybe where the mixed messages are coming from. The API appears to support authoritative server logic, but their hosting services might only be peer to peer. With the current state of Unet and Unity's upcoming switch to a new networking API it's definitely worth considering. Might be worth checking out the deprecation thread in this forum as well. In regards to Photon your best bet is probably to get in touch with them so they can answer any questions directly.

    Hope you get some replies from others about what their using. Good luck!
     
  36. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,064
    Ok it seems that in order to have a real authoritative server (that is a DEDICATED server, not a listen server) I have to use Bolt pro, which is sold to "selected customers" so they don't tell its price, only that its sold with a subscription. More, it has to be hosted somewhere, so you have to pay for the hosting too. An alternative is to use Bolt standard with an headless Unity server, and in this case you have to pay for the CCU that you use AND also the hosting.
    Any thoughts, @TheLastVertex ?
     
  37. Stanchion

    Stanchion

    Joined:
    Sep 30, 2014
    Posts:
    269
  38. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,064
    That's exactly what I wrote. You can host an headless server with bolt standard and a generic dedicated server with bolt pro. So with this configuration, which is the only one that is really effective against hacking, I have to pay for two different subscriptions, one for bolt and one for the host. It would have made more sense to me if you hosted this on photon cloud.
     
  39. Stanchion

    Stanchion

    Joined:
    Sep 30, 2014
    Posts:
    269
    "Photon Cloud" never runs any Unity logic, there are optional "server plugins" available that run some logic but we leave hosting to Zeuz.io, GameLift, etc which we have samples for. There is no way to really "subsidize" for running dedicated servers, those costs are just a fact for many popular games whether it is Fortnite, Rocket League, Overwatch, Apex Legends, etc.
     
  40. newlife

    newlife

    Joined:
    Jan 20, 2010
    Posts:
    1,064
    server plugin are available only for Enterprise Cloud or self-hosted Photon Server. Is this correct?
     
  41. Stanchion

    Stanchion

    Joined:
    Sep 30, 2014
    Posts:
    269
    Yes afaik (this is only for PUN/realtime)
     
  42. Tholem

    Tholem

    Joined:
    Mar 22, 2020
    Posts:
    8
    @TheLastVertex I'm so sorry to enter in this discussion.
    This is the link to my discussion if you think that is better to don't still replying here:
    https://forum.unity.com/threads/gamelift-with-unity.857341/

    The problem that I have is the following:
    I made a game in unity 3D and connect it with gamelift. But I can't see the another players, I just see mine player. I check and all share the same gamesession and I can send messages between them, but I think that there is something that I miss when I made the game in unity. But I don't know what it could be.

    If you could help me to solve that issue I'll be so grateful