Search Unity

Connected Games: general feedback and questions

Discussion in 'Multiplayer' started by BHouse, Sep 13, 2018.

  1. larus

    larus

    Unity Technologies

    Joined:
    Oct 12, 2007
    Posts:
    280
    Yes, encryption is not included yet but this is planned for the new network transport (it will definitely be included but there is no ETA yet for it).
     
    ChujoHiroto likes this.
  2. ChujoHiroto

    ChujoHiroto

    Joined:
    Oct 1, 2016
    Posts:
    2
    Thank you for answers.

    I expect encryption and hash value check for tampering detection.

    Please continue to do your best!
     
  3. Karrzun

    Karrzun

    Joined:
    Oct 26, 2017
    Posts:
    129
    I got a quick question about sending data via commands. I need a transform to be updated so I'm wondering whether it's better to send the Transform as a whole or just its seperate fields. Does it make a difference at all?

    Code Snippet:

    [Command]
    void CmdSyncTransform (Transform transform)
    {
    ....
    }


    versus

    [Command]
    void CmdSyncTransform (Vector3 pos, Quaternion rot, Vector3 scale)
    {
    ...
    }



    //Edit:
    I wanted to do some tests and it seems, one can't pass Transform as a parameter because it's a component. Sorry for the dumb question
     
  4. JTovey

    JTovey

    Unity Technologies

    Joined:
    Oct 30, 2018
    Posts:
    35
    Hi Karzun,

    Are you still having issues, or have you worked them out?
     
  5. Karrzun

    Karrzun

    Joined:
    Oct 26, 2017
    Posts:
    129
    It's not a real issue, but rather curiosity regarding performance and efficiency. My script is working fine and porobably I won't have any performance issues either because it's going to be just a simple little LAN game for my friends and me.
    Still, I'd be more than happy to know whether and how this difference would impact performance. Would it be better to give three paramters or would it be better to write a custom struct to hold those values send the struct instead?
    Sending the struct as a whole would require some additionals bytes, I assume, and thus claim a bit more bandwidth. Of course that's not a big deal for a handful of objects but it keeps adding up so surely it would make a difference for hundreds and thousands of objects. That's why I'd tend to send those values seperatly. But maybe I miss something else/more important here?


    Edit: wording
     
  6. Magnusai

    Magnusai

    Unity Technologies

    Joined:
    Nov 22, 2018
    Posts:
    1
    Personally I prefer structs for sending data, just more neat but I imagine on such a small scale either way would be fine.
    Also depends how many values you need to send. If you end up having to send more and more values you code might look messy sending them individually instead of just defining a single struct and using it over and over.
     
  7. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    There is no bandwidth difference. UNET weaver would serialize all values of the struct into NetworkWriter. Same as when you pass the parameters one by one.
     
  8. nxrighthere

    nxrighthere

    Joined:
    Mar 2, 2014
    Posts:
    567
    If you care about efficiency, here's a tool for you. With BitBuffer you can serialize/deserialize your data efficiently and without GC, thanks to ZigZag and variable-length encoding based on integers family. Here's how you can create abstractions with your custom structures without codegen and reflection using managed arrays or Span<T>.
     
    hippocoder likes this.
  9. projectorgames_unity

    projectorgames_unity

    Joined:
    Oct 15, 2018
    Posts:
    107
    So does this mean I shouldn't be messing about with the github download, but should be on the latest 2019?

    Bit worried how you don't know if it's in or not...
     
  10. JTovey

    JTovey

    Unity Technologies

    Joined:
    Oct 30, 2018
    Posts:
    35
    Hi there,

    At the moment it is only available through GitHub (found here) as it is not yet confirmed stable so has not been added to the main Unity install. This library has not been updated since October, though there is an update which should be coming soon.
     
    Kirsche likes this.
  11. zhuchun

    zhuchun

    Joined:
    Aug 11, 2012
    Posts:
    433
    Hi, I'm wondering would it keeps support MonoBehavior in the future since more and more stuff is implementing in ECS?
     
  12. BHouse

    BHouse

    Joined:
    Jan 10, 2018
    Posts:
    76
    Everything we are implementing alongside ECS today is intended to be compatible with both ECS and MonoBehavior systems.
     
    zhuchun likes this.
  13. jessejarvis

    jessejarvis

    Joined:
    Aug 9, 2013
    Posts:
    303
    So what does it mean that the new Unity Multiplayer is with Google Cloud. Are the servers going to be able to request new servers to spin up on demand?
     
  14. JTovey

    JTovey

    Unity Technologies

    Joined:
    Oct 30, 2018
    Posts:
    35
    Hi Jesse,

    Can you confirm what you are asking the question about, maybe quote the post, so that I have a bit more context for your question?

    To answer your question as best I can from what you have said thus far, yes, they are hosted on Google Cloud, and you can spin up and down instances as the need increases, though if they are left inactive for too long they are closed down again. Of course, this is not infinite, and you would have access to a limited number of instances.

    I hope this answers your question, if not, please let me know.
     
  15. BHouse

    BHouse

    Joined:
    Jan 10, 2018
    Posts:
    76
    I can clarify a bit further. The extent of the GCP partnership varies per service. For example Multiplay server hosting continues to offer "Hybrid" bare-metal hosting with burst into the cloud. This service prefers GCP servers when using Cloud, but is also capable of leveraging AWS servers as needed.

    Other services (like matchmaking, player identity) will be hosted in Google Cloud , with maybe a few exceptions in regions like China.

    Please let us know if there's something more specific you would like to learn about.
     
  16. zhuchun

    zhuchun

    Joined:
    Aug 11, 2012
    Posts:
    433
    Hi, I contacted Multiplay a year ago and at that moment they don't have any server in China, but they planned to co-op with a local cloud service provider. When you're saying "a few exceptions in China", is that means Multiplay is going to have a different partner in China other than Google Cloud, or the services just don't work?
     
  17. BHouse

    BHouse

    Joined:
    Jan 10, 2018
    Posts:
    76
    Good question! It means that we need to work with other providers in China. It's something we're all considering carefully for adapting existing services (like Multiplay) as well as how we design new services, i.e. to ensure we have a plan to be able to support Chinese markets.
     
    zhuchun likes this.
  18. yaraco

    yaraco

    Joined:
    Aug 21, 2013
    Posts:
    5
  19. nsmith1024

    nsmith1024

    Joined:
    Mar 18, 2014
    Posts:
    870
    Is this new multiplayer have anything to do with Google Stadia? can it work with it somehow?
     
  20. CallMeSpam

    CallMeSpam

    Joined:
    Feb 10, 2018
    Posts:
    19
    So, the first update to the GitHub in six months is not considered relevant enough to mention?
     
  21. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Stadia is a fundamentally different technology as far as delivery to the player. The only place I could see this used is entirely on Google's server side, but I'd be very surprised if Google didn't have their own networking solution they are requiring for that.
     
  22. dcorp

    dcorp

    Joined:
    Sep 6, 2017
    Posts:
    3
    Not sure if anyone could possibly help advise about a logical path to take, but this seemed like the place to check:

    I currently have a fast paced 2D twitch shooter game that I’ve been working on for over half a year. The game is for WebGL and is build with the HLAPI. The game is currently playable in a server-client architecture (though the sever currently trusts the clients) and I’ve worked around all the UNET bugs that had caused issues for me, but as latency rises my current interpolation/client prediction/lag compensation aren’t performing adequately. I noticed that with the new transport layer there is an emphasis on solid examples for lag compensation/client prediction with the FPS example which looks promising. I will obviously need to migrate from UNET eventually, but I’m not sure if the new system is ready for me to adapt. I see a couple ways I could proceed:

    (1) Stay with the HLAPI and see how the new system develops (any word if a HLAPI replacement is coming?)
    (2) Convert to the LLAPI to make it easier to transition when the time comes
    (3) Work in switching to the new transport layer now

    Hoping someone may be able to provide some advice
     
    Last edited: May 7, 2019
  23. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    The new networking API is UDP based with no websockets support. This is the last update from a Unity dev on this topic I've seen:

    So I'd say #3 is out of the question, unless there's been new developments on this front.
     
  24. habitoti

    habitoti

    Joined:
    Feb 28, 2013
    Posts:
    141
    Turn based multiplayer support is really a huge issue these days. It‘s only in an acceptable shape for Android & Playstore via Google Play Games Services. It‘s a mess for iOS and virtually non-existant for any other platform on a reliable scale. While there are a lot of individual solutions, none of them is truly cross-platform and widely accepted. Players want a single logon and profile management across multiple games, and not island solutions. Only Unity would be able to pull that off at large scale, so that in the future players will have a „Unity Profile“ with their Avatars, Leaderboards, Achievements, Challenges, Friends Networks etc. in one consistent place.
    If Unity would offer a Turn-based suite of features in the scope of GPGS across all the supported platforms, that would be such a huge win. Suddenly, all iOS, Android, Windows and what-have-you users could connect to play their board games, card games and all the other great turn-based stuff.
     
  25. pKallv

    pKallv

    Joined:
    Mar 2, 2014
    Posts:
    1,191
    Can u elaborate a bit on this?
     
  26. habitoti

    habitoti

    Joined:
    Feb 28, 2013
    Posts:
    141
    Uh...where should I start? ;)

    Even before Apple abandoned the Gamecenter app with iOS 10, they had a tendency of neglecting focus on gaming. API changes and sloppy bugs (like deliberately changing parameter defaults that completely reverse an API semantics if not explicitly set by the app), fixing bugs only 2 releases (= 2 years) after reporting, erratic backend and notifications performance etc. always made it a gamble to offer Gamecenter support. Whatever goes wrong with the infrastructure is blamed on your app and instantly reflects in reviews/ratings. And Apple just never had a culture of instant response to such issues. They seem not to care.
    When they abandoned Gamecenter with iOS 10, Engineers at WWDC told that this was just a first step towards a rework of the whole concept. And it was, but not to the better. The former player photos that users just loved and most apps integrated into their setups where simply taken away and replaced by lame grey circles with players initials -- to this day. Friends handling: simply vanished. API orchestration changed year over year, bombarding you with deprecations. The invitation process via iMessage is just totally confusing, working only erratically over long periods of time and just not understood by the users, and does not fit to an in-game experience.
    As of today there is NO single Unity integration for multiplayer (turn-based, real-time) left. Prime31 was the last to keep the flag up the pole, but now has stopped it also. There are just some plugins left that support leaderboards and achievements. Full stop. If you need to make a strategic decision for iOS/Unity TODAY and want to rely on a standard service, you're lost. The plugin devs defer you to the "upcoming Unity support" for multiplayer, but it doesn't look like anything you could use productively any time soon, at least not for turn-based. There are some standalone solutions out there (whose business model is running the backends -- fair enough...), but I don't think they can be a viable alternative if you don't happen to be a mainstream killer game that can sustain a complete standalone userbase. Who wants to create and maintain multiple user profiles, different for each game? People want a central infrastructure that connects their games and friends in one place. Gamecenter and Google Play Games are the right approach, and there would be room left for one more big player that offers the same across all platforms and has an undoubted reputation for long-term sustainability, performance and reliability.
    My hope is that the cooperation with Google will blend some of the GPGS scope and reliability into the (hopefully) upcoming common solution. I am for sure rather an "Apple boy" than hardcore Android fan, but that is honestly just so much better, reliable and smooth to integrate. And you have such comprehensive analytics features in you dev. console about how your game is used.
     
    pKallv likes this.
  27. Studiomaurer

    Studiomaurer

    Joined:
    Sep 5, 2012
    Posts:
    56
    I upgraded a Unet Project to 2019.1.4f and imported the HLAPI Package. Everything looks fine ,except the one single script isn't compiling (NetworkTransformChild.cs). It's not showing any errors. I've got no warnings for anything (on any other script), it just won't load on my player prefab (Cannot be loaded. Please fix any compile errors and assign a valid script). How would I fix this?

    Alternatively, do I understand right that the new system is available now? I only need basic functionality just as connecting in local networks, synchonizing transforms and sending messages. Where would I get started to do this...
     
  28. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    There's an issue with a misspelling in that script that Unity apparently is being slow to fix, which was pointed out in a few other threads (no idea if a bug was actually filed by those complaining about the issue, so that might be the cause).

    The new system is in an alpha state. Last I checked it is little more than a barebones transport. What you describe as your needs is much higher level functionality you'll have to build on top of it. There is an FPS demo using it released, which I would assume implements transform syncing though.

    Transform syncing is not all that difficult. You just as needed or at some interval send the world position and rotation to all clients, and optionally rigidbody stuff like velocity, angular velocity, etc. The only tricky part is smoothing that out on the client side, and accounting for missed updates or updates for whatever reason arriving at an irregular rate.
     
    Last edited: Jun 5, 2019
  29. M_R

    M_R

    Joined:
    Apr 15, 2015
    Posts:
    559
    Hi,
    it seems you are all focused on realtime multiplayer (L3).
    do you have a roadmap/timeline on the Dynamic Single Player (L1) and turn-based (L2) aspects of connected games? (e.g. player identity & cloud db, virtual currencies, leaderboards, etc... )
    or you are not planning anything and we have to build our own or use gamesparks/playfab/whatever?
     
  30. zhuchun

    zhuchun

    Joined:
    Aug 11, 2012
    Posts:
    433
    To be clear, I'm not from Unity ;)

    L3 is the hardest part, and probably the most important part in 3A games, UNET failed once, so they're focusing on it. L1 and L2 already have some alternatives, as you mentioned. Specific to L2, it can be done easily by a Node.JS backend, no problem. However, if you're looking for the state-of-art version of L2(like Dota Underlords), it's based on L3 somewhat.
     
    Joe-Censored likes this.
  31. nektariosfifes14

    nektariosfifes14

    Joined:
    Jun 25, 2015
    Posts:
    12
    will pricing be depended on concurrent users or resources used? (cpu, ram usage)
     
  32. Kylotan

    Kylotan

    Joined:
    Feb 17, 2011
    Posts:
    212
    So, how are we looking with regards to "we’ll be building out networking “archetypes” that work best for different types of games", which was said over 16 months ago?

    I see there's a Netcode v0.0.3-preview.2 which implies someone is at least looking at this stuff, even if it is all unnecessarily DOTS-only.
     
  33. zhuchun

    zhuchun

    Joined:
    Aug 11, 2012
    Posts:
    433
    True and that's weird, generally a multiplayer game from scratch could be done within such a long time, my best guess is that DOTS projects are delaying each other, as they've to rewrite most systems based on OOP, the transport layer and archetypes could be done in a relative short time though.
     
  34. pantang

    pantang

    Joined:
    Sep 1, 2016
    Posts:
    219
    "Game Server Hosting service" These words scare me, will we need to use this service or can we use the api and host how we want?

    also I am wanting to start on the networking side of my project shortly where should I be looking? is it worth getting started with UNet or should I just wait a little?
     
  35. zhuchun

    zhuchun

    Joined:
    Aug 11, 2012
    Posts:
    433
    According to the battle between Unity and SpatialOS, Unity updated the ToS and clarify that developers can host the headless server anywhere they want, however, commercial service providers like SpatialOS would not be allowed to do that without Unity's permission.

    To answer your second question, it really depends on when you are going to release your game and how well you know about multiplayer networking. Unity Transport is ready to go, NetCode is, and will be in preview for a long time. So if you have plenty of time and understand how to build a network stack or development framework with an existing transport layer, start with Unity Transport or any alternative to it, say ENet. Otherwise, consider PUN instead, the old UNet is not a good idea for multiplayer games in any form nowadays, as Unity announced that it's DEPRECATED
     
    Last edited: Jan 31, 2020
    pantang likes this.
  36. Nathan1258

    Nathan1258

    Joined:
    Jan 11, 2016
    Posts:
    11
    Hi, What's happened to this whole idea of 'connected games' with google cloud? Like I know you have an FPS sample to show off some code but nothing has seemed to happen since 2018??
     
    Dazo1985 likes this.
  37. zhuchun

    zhuchun

    Joined:
    Aug 11, 2012
    Posts:
    433
    I'm not the guy you want to quote as I'm not from Unity, I don't have an FPS sample to show off neither :)
     
  38. Dazo1985

    Dazo1985

    Joined:
    Mar 13, 2019
    Posts:
    26
    Yeah curious too. No news on google cloud based connected games yet?
    It has been 1-2 years since the announcement...

    It seems like the whole dots and renderpipeline stuff ate all the production time instead.
    Even the last presentation felt like the "connected game" idea became an unwanted side project. ( Even tough the guy did a good job explaining it) It was just getting so less focus in the overall event.

    Its kind of sad I was super hyped about it.
    Really hoping that enough priority is given to it and to hear from it soon.
     
    Nathan1258 likes this.
  39. alexanderosadc

    alexanderosadc

    Joined:
    Nov 13, 2015
    Posts:
    2
    Hey guys Hello. I have some problem in unity of uploading a screenshot to the server nad give me in response image url. I tested server with Postman and it works just fine. But when I test on localhost it gives me CORS error. Some ideas how to resolve that???
     
  40. Nathan1258

    Nathan1258

    Joined:
    Jan 11, 2016
    Posts:
    11

    They actually came out with a blog explaining about Unity connected games in April: https://blogs.unity3d.com/2020/03/19/state-of-unity-2020-in-this-together/
     
  41. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    dannyalgorithmic likes this.
  42. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    414
    Im familar with code and all, but i want to delve into networking. And i understand the concept of the clinet side and server side ect. Im not worried about the code for it at this time. Its just the general concept. Like pun2, can it be used for things like xbox live? Does anyone have even a direction to go see some basic tutorials of just the idea of it?
     
  43. BHouse

    BHouse

    Joined:
    Jan 10, 2018
    Posts:
    76
    >> cross-posting in several sticky threads; please pardon the repeated message<<

    We understand many of you would like to create multiplayer games / multi-user projects and are challenged by Unity's current state of netcode. We also acknowledge the netcode and workflow requirements can vary based on the projects you're building.

    So, to help us understand how to best to support you, please share your thoughts in the survey below. The survey only takes about 10 minutes, and your feedback will help inform future product decisions. Click here to take the survey by June 8.
     
  44. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    414
    Was that survey made with unity?
     
    dannyalgorithmic likes this.
  45. Cranom

    Cranom

    Joined:
    Jan 31, 2018
    Posts:
    26
    Didn't check the forum or news for a long time, have they yet started another brand new network stack to rule them all ?
    And now a survey... have not enough people already stated what was wrong and what was needed in this same forum over and over again ?
    There are a few great guys here, helping others, and working on their own homebrew or commercial stack, and that seems to know their stuff, you should probably contact them directly instead of asking some random to check a survey on a short notice.

    Not with UNET at least, since i managed to reach the end...
     
    dannyalgorithmic likes this.
  46. habitoti

    habitoti

    Joined:
    Feb 28, 2013
    Posts:
    141
    No, Qualtrics...
     
  47. cuttinged

    cuttinged

    Joined:
    May 12, 2013
    Posts:
    65
    Based on the survey it looks like they are prioritizing, so those who take the survey will be more likely to be satisfied with their future progress, while those who don't will complain that they didn't do what they need.
     
  48. Vincenzo

    Vincenzo

    Joined:
    Feb 29, 2012
    Posts:
    146
    I filled in the survey but generally it doesn't allow to say the real issue. the empirical truth is that Unity has nothing viable in this space.
    1. The Unet (HLAPI/LLAPI) are terrible and should not be used and are deprecated.
    2. The new Networking stack is alpha, bad, and completely the wrong way to do networking, too focused on one game type and it doesn't scale at all.., and no slapping jobs/burst on something doesn't make it magically faster. a network card and kernel is a single threaded thing, you can't just slap jobs at the problem. you want to run multiple servers on one machine. more than 1 thread is bad for thread contention. The whole delta compression is just UGH and will run like hell on any machine..
    3. All open source projects out there are terrible too, they solve not the real issues with networking, perhaps they do not much more than packing data, they don't take care about the main issue; SIMULATION
    4. The only viable option today that is actually good are the products from Exitgames/Photon called Bolt and Quantum. They use Eventual Consistency or Rollback Networking, the actual correct way how you should do networking. They are simply great but cost money naturally.

    I say this again, networking is about the simulation, not about how to pack some data and send it over the wire. everybody gets this wrong. Unity too. Snapshot networking is not the future.

    I doubt Unity will ever solve this problem, they are in too far and too deep. And networking always was a forgotten child that nobody cares about, they invested millions in buying the hosting company Multiplay, instead investing that money into a team of real network developer veterans would have helped everyone. but no we have a team of people that have no experience making networked production games, that don't actually know what they are doing. If you don't believe me look on the networking package if you have such experience, you will laugh. LOUD.

    Unity. When will you make networking a primary citizen in this engine? never? next year? 2025?
     
  49. p_hergott

    p_hergott

    Joined:
    May 7, 2018
    Posts:
    414
    Perhaps they havent sent you all the meeting minutes and emails.
     
  50. MrKuros

    MrKuros

    Joined:
    Jun 25, 2019
    Posts:
    3
    The uncertainty is an issue of it's own. A lot of developers are looking for a solution for the long run, and have to make decisions whether to wait for Unity's new solution, or go ahead and dive into solutions like Bolt and Quantum. It's all very vague. Sure there are "informative" pages and surveys. But the roadmap is still unclear. Do we wait? Can we rely on a product of quality, or will it give us even more headaches?

    This thread is the closest thing to an answer about the state of the Unity Connected Games solution. That says it all.
     
    Joe-Censored likes this.