#archived-networking
1 messages · Page 46 of 1
I don't think the double precision really matters in this context
next frame you get new value, it's error doesn't cumulate
it does for what I am doing, because timing errors adding up over half a day mean problems for physics
so just to avoid that I preemptively and keeping my own time in the updatemanger
https://gdl.space/gadekazobo.cpp Is half of the singleton pair... this one gets set to the earliest script execution time
and a second gets the latest execution time to capture a true "Post" callback hopefully after all other scripts have finished
relevant: http://beardphantom.com/ghost-stories/unity-2018-and-playerloop/ but I think people here know about this already
Definitely something worthy of 2 lines of text to explain LOL
if you don't know about scriptable playerloop, definitely read that blog post
yeah, that's pretty much what we are talking about
that all of that needs to be happening to replace all of the workaround crap we are doing right now
I don't want to be writing or maintaining an UpdateManager
The idea is with dots its not needed anyway I mean it's not even a compatible pattern
apparently there is PhysicsUpdate that runs after FixedUpdate
but likewise they still need to work with mono land
If we start writing in full ECS things are different
so, essentially that could be PostPhysics
Its not so much a mistake as I see it - its just not ECS style
but Unity isn't going full ECS
Hybrid and mono will be a thing for quite some time
well I expect it to "go full ECS" by 2022, but with a side of greasy carcinogenic mono fries
The challenge with it will be how to make that still accessible
In the meantime.. I'm trying to write server auth around Physx... which requires all of this bullshit
I think really most new users will migrate to visual scripting and not even want it
(in 2022)
That may be, they may just have to make a whole now "easy" paradigm
those who are expert will be on dots because it's illogical not
so beginners? -> visual scripting
mono will fade in time because the song will be "is it fast in mono land" and the chorus will be "no no no!"
One can hope
Meanwhile, I am not quite sure what my future reworking of my network lib will consist of... its all based on my own UpdateManager currently, but I would rather scrap that for built in unity
I'm playing the waiting game - decided to scrap networking in my game until a strong contender arrives - it's hardly profitable for indies anyway imo. Might do local
I write networking library stuff, so I am kind of stuck on the bubble
@compact bramble I love local multiplayer but the problem I run into regularly is having enough people to play at once, and varying skill level of those that can play
So ultimately a list of plausible games becomes very small.
I have no friends and will tolerate none in my grim eternal solitude, as I flog myself to the grave, clutching my magnum opus.
(typical everyday guy, then I guess)
just unlocked in the vault (from GDC 2017):
https://www.gdcvault.com/play/1024010/Replicating-Chaos-Vehicle-Replication-in
https://www.gdcvault.com/play/1024035/Deterministic-vs-Replicated-AI-Building
https://www.gdcvault.com/play/1024041/Networking-Scripted-Weapons-and-Abilities
Accurate peer-to-peer replication of game objects in a highly chaotic physical simulation is essentially an unsolvable problem. This session will explore the techniques used in 'Watch Dogs 2' to replicate vehicle trajectories, compensate for...
This lecture will showcase the AI technologies that were developed in 'For Honor'. This lecture will cover how, on one side, the team at Ubisoft created a believable large scale battlefield on the backbone of a distributed peer-to-peer...
'Overwatch' uses a proprietary visual scripting language called Statescript to execute the high-level state machines used throughout the game, including the logic driving hero weapons and abilities. This talk describes the features of the language...
I was wondering what would be the best framework for doing a multiplayer action game?
ue4
lol
I'm not actually kidding - often the best decision for something is based on your needs
But I would use photon personally (at least until Unity becomes dotted up)
yeah, unreal is a possibility honestly, but at the start it'll be in unity at least on a proto level
and maybe by the time the game is worthy of further dev, unity might have caught up
I would avoid Photon personally (as I can't recommend people who refuse support you if you ask about their terms and can't tolerate it when you tell their terms are vague, it's just huge warning sign)
also Photon Bolt which is their most UE4 networking like product comes with closed source, so you can't even fix the bugs they have in it yourself. they also want to tie you to their Photon Cloud so you add extra dependency on their cloud solution and can't use the products without.
it's kinda bummer as Photon would probably have most robust networking solutions for Unity atm, why people always mess up the good things?
there's various C# networking libraries listed here: https://github.com/nxrighthere/BenchmarkNet
I've been using LiteNetLib, works well
can anyone write some pseudo code for that , i still don really get how its supposed to work, simply smooth network sync
@vital hawk the argument they have is that, selling the package as a one time purchase was not a sustainable model
I know 😃
that point + their behavior makes me never consider their products tho, so they aren't sustaining their business with my support 😃
ok, never is a strong word
but not in short term
it's always better stay open minded in this industry
I also don't even buy the sustainability part, giving people option to self host / use steam is not really putting them in place where they'd have to make a completely new framework and get minimal return of investment
it's not about that
they have all that
they just want to force people on their cloud as it obviously makes them more money
they lose a lot of customers that would buy the framework with single fee but they've done the math for it being better deal to them this way
it's their business and their decision, but the sustainability part is really hard to believe
if they ONLY did one time fee frameworks and didn't additionally do the cloud, that would be totally different situation
but now they are forcing their users to their own cloud
Exit has titles on it that seem to be successful, so the model can and does seem to work for someone - though I obviously am not privy to everyone's financials. I think their business model is likely to become more common. Hoarding tech, and using that tech to get people into their garden. Rather than trying to get people to buy their tech - which is actually more of a turnoff for small companies, since it means a fixed cost, even if their title flops.
i also suspect that like with all things, private deals can be made behind the scenes if one is inclined.
But the basic model is "Use our tech, and if your title does well, we all do well" - the cost being a loss of upside to Exit taking a cut for inflated net costs.
pretty much yes, everyone wants their cut of your success now and it's up to the dev to judge what is worth it (and risks involved)
I think the quantity of free libraries lead things there. You either have to ding people up front the old way with one off software costs or on the long with a cut of success stories. Since the Unity market is largely dreamers and learners - most aren't willing to really risk the cost (which is why they are using Unity for free).
So I kind of think that the new playing field of free everything will drive success-based revenue models more and more as well.
you could just demand a cut if company earns above x ammount.
yeah thats a fairly popular model
I think with networking libraries like Bolt fholm mostly found that the money was hardly worth the work put in. Bolt produces more money as a honeytrap than as a one off purchase. That and you can generally feel better about not charging people $100 up front for software they likely will never make a dime on.
@split crescent That Unity fails to supply a real viable networking library is what makes their 30% problematic
unity should just finally put a big team together the size of SRP and make a proper build in networking solution
Just release everything networking in deprecated form yeah.
yeah the current "new" multiplayer repo is trash
Its still just the transport no?
simple wrapper around native UDP sockets
without any reliablity protocol
and some shitty examples
and then slapped jobs on top of it
and call it scalable (which it isen't )
Jobs is pointless at this point
no one is shipping anything with it
much less some monstrosity that needs threading
I get that its their mandate though, that everything made fit into that future
Networktransport slapped in jobs is idiotic, the OS socket isen't multi threaded.
but its going to hold up progress waiting for dots to be ready for the average user
I think the keep failing to recognize what a black eye networking is for them.
Having your one built in library be abandoned and deprecated for years... is hardly something a top tier game engine should really find acceptable
welcome to unity
The gaffer on games thing is exactly why physics can be deterministic going forward as well as back, but it only works up until the interference and he does cover that scenario. I don't know why people got annoyed with me on forum when I tried to point out this being a pretty cool use case of determinism across different cpus (something that unity's networked physics will have by default)
Obviously it's not for all games
But it's really exciting that dots has the performance muscle to rewind this state so when interference does happen, the sim can be kept deterministic
@compact bramble 2018.3 does act deterministically, I have resim working with it
Hard to make out what is going on here, but the right screen is the owner client simulating inputs, and the left is the server. This is 20% packetloss - when the client gets and desync from the server, it applies the servers RB values to a copy of the player in a lightweight second physics scene, reapplies all of the inputs, and copies the results back to the primary scene, and it is back to 100% deterministic until another desync is forced.
I've been trying to get back to finishing up a good working demo of it, but have spent the last 2 weeks trying to fix old assets because of what Mirror broke on everyone. 😕
I will set up a proper test over the next few days, but this is the client spawning a bunch of server authority objects. The sprout a white bars when they are out of sync and are not 100% deterministically in sync with the server - which only happens when I force a desync, and they immediately resimulate back into agreement. No idea about cross platform since this is all float based - but so far the tests are working.
nice!
PhysX guarantees the same simulation result when all the inputs are exactly the same. However, many things are considered “input” from the perspective of the physics engine. One such thing is the physics scene itself. Before 2018.3, it wasn’t possible to destroy the implicit physics scene. One could only destroy all the objects in it, which formally wasn’t enough. With multi-scene physics, this is easy to work around. However, another frequent issue was that adding a new body located somewhere far away and seemingly not interacting with the other objects also had the potential to change the simulation outcome. That was because of the way PhysX in Unity grouped objects internally. This is now possible to overcome by enabling a special option in the physics settings. It’s not free in terms of performance, but it shouldn’t slow your project down significantly.``` What that means for crossplatform.. vague
it just means that different cpus will not be deterministic but unity's burst compiler will make sure (if you want) that some floats can be deterministic
some not all because there is no point in having (a small) overhead if you don't need it
likely i will make a clear separation between network+physics and local+physics
so things that are gameplay basically
the idea that determinism is possible on different cpu architectures is not a new one but people dont usually do it
thing is though with streamed gaming or cross platform multiplayer, this becomes more important i suppose
@jade glacier from my testing physix in unity is completely deterministic on same arch
meaning intel cpu's from various generations ( 2012 and up) and windows 10
I have not tested amd
that physx thing only makes totally unrelated simulation play the same way on same cpu architecture regardless if you add or remove physics bodies etc during the simulation
it's just guaranteeing that the internal simulation order doesn't change
hey yall i'm looking for resources to help figure out how much bandwidth PUN is using at any moment, bonus if it can tell me specifically what RPC's and observables it's updating with that bandwidth
can anyone nudge me in the right direction on that? thanks
what does PhotonNetwork.CacheSendMonoMessageTargets do?
Hello everyone, I've got a question that's not exactly related to Unity. I was wondering if someone could give me a hand. I'm looking into hosting a small perforce server on a cloud solution so I can work on my project and version control from anywere. The thing is that I know very little about servers and I looked at Google Cloud, Azure and AWS and they offer dozens of solutions, some pricy, some less. I am not sure what kind of solutions I should look into for the needs of a Perforce server.
Nevermind, I found how!
I set up a perforce on a small AWS server, it wasn't difficult!
https://cdn.discordapp.com/attachments/515987760281288711/566341209530957835/2019-04-12_21-13-13.mp4
@compact bramble I have the client spawning a truckload of objects and they seem to still pop right back into deterministic. The PUN Master for some reason doesn't like objects spawning on another client that fast, but even with it choking hard, the two stay deterministic.
Hey, i am currently using UNET for at school project ( I know its being deprecated, but i don't have time to switch), and i am having a problem with a client not sending the Cmd to the server.
The structure i am using is client-host.
The problem happens when the server does a scene change. Before the scene change i can send cmd's just fine, but after i can't.
Any ideas to what the problem could be?
maybe your network manager is a scene object and does not persist across scenes
does it have DontDestroyOnLoad
Generally NM sets itself to not unload on scene change, but worth looking to double check that
also, maybe there might be a hickup or inresponsiveness during a synchronous loading of a scene (I am not so sure how to handle that one either)
The object you are trying to send that command through still exists in both scenes?
I think an async load also caused me issues
Command is generally frustrating and annoying because of the dependence on an object with authority
I pretty much abandoned Command and RPCs about a week in to using UNET in exchange for MessageBase
@acoustic jungle
Drive by help request I think 😃
Right.. I am also getting increasingly frustrated with UNET, am this is definitely the first and last project i am creating with it.. I can try out this MessageBase thing. Is it easy to get into?
And yeah they do have DontDestroyOnLoad on. The weird thing is that it used to work, but suddenly stopped. I have no clue why
And i can see the objects in the hierarchy
@jade glacier @lusty crow
All of the HLAPIs use some form of RPC/Command/Syncvar system - they are just prone to tying your hands like that
Phase 1 of networking... RPCs and Syncvars
Phase 2 - messages with your own handlers
Phase 3 - dropping all of that and serializing your own byte[]
No idea about message base, I only have a bit experience with LLAPI unet,
Mirror (and I think some people were mentioning Telepathy (which does tcp connections)) are valid replacements for Unity UNET
just to give one example, Mirror I think does some of the higher level rpc stuff,
for lower level stuff, there are a lot of frameworks out there
How much of a hassle would it be to convert my project from UNET to Mirror, and is it worth it?
I still can't believe that this is not a common abbreviation?
somebody
Oh lol
apparently it is not, because so many people seem to be confused about it ^^
also, depends on the size of your project I would say, I don't know about all the high level networking stuff though,
if you were merely making connections and send bytes over some channels, that would probably be easy to port over
It's a pretty small project. I just have a Lobby and an arena, where players throw bombs at each other.
I can see that Mirror uses a lot of the same terms. So i might give it a go
They even have a migration guide
Generally when using HLAPIs I would try to avoid making use of the RPCs and Syncvars like @lusty crow is hinting at. I like the HLAPIs just to avoid dicking around with setting up connections and creating networked objects. I use the NetIds of like UNET and PUN, but do little else with the HLAPI. Everything gets sent as byte[] that I serialize and deserialize myself, which makes it a MUCH easier port.
@acoustic jungle Mirror has a migration tool from UNet
the outward facing API is mostly the same
mostly the inner workings are vastly improved, add'l features added, UNet bugs fixed.
@gray pond Yeah i have tried using that, but i can't get my client to connect to the host.
What i did before was just this:
NetworkManager.singleton.networkAddress = ipAddress;
NetworkManager.singleton.StartClient();
And i gives this error:
Client Recv Exception: System.ExecutionEngineException: String conversion error: Partial byte sequence encountered in the input.
with Mirror or UNet?
With mirror
what are you using for ipAddress?
Just "localhost"
come to our discord and we'll help you, please
@gray pond I'm a bit of a discord noob. How do i find your discord?
sent PM since this server doesn't allow discord links for whatever reason
Also there's a Chat link in the Asset Store description [https://assetstore.unity.com/packages/tools/network/mirror-129321]
@gray pond Does Mirror have match making like Photon PUN does?
@indigo current We do not offer back-end paid services, but we're generally compatible with the common ones like GameLift, PlayFab, et al.
Learn how to get started building AAA-quality, multiplayer first-person shooter (FPS) games using the FPS Sample. Get an overview of the project – which was ...
I was sure unity hired the wrong people to make the networking stack. But that they don't even know what UDP stands for is just outright shocking
When will networking finally become a first class citizen in unity like it is in unreal?
SRP is great Team. Ecs too. Why invest nothing in a good network stack?
This is really a joke
We get a depricated llapi and hlapi. Which I understand it was bad.
The replacement is worse
We get a unreliable transport implementation
Which is a very bad one and simply a wrap around native sockets
Without reliability protocol
And the project is dead for 6 months
I haven't watched the video, but I would assume that often the people holding the presentations are not the main programmer/member. networking will probably come (slowly), but probably also will still take many months or even a few years until there is a proper library, right now it seems too low level
I know someone who is making a wrapper with channels for the lib, I am excited to see it if he intends to release it to the public one day (not sure)
I understand the person presenting it is not working on it , but that is unity's mistake.
but the main problem is the actual code and lib given to customers
it's utter crap
For what it is it has way too much code, and wrong standards to build networking on any scale
it is like it's build by somebody that knows nothing about networking, nothing about operating systems, and nothing about how to make scalable games
this team or group that knows a lot about C# or something made a wrapper around native socket interop, slapped unity jobs on it and called it golden
it's really a joke.
i don't recommend ANYONE to implement it in their games.
I heard that they might spend too much on PR, marketing and not enough for the core team and that is why progress in some areas is super slow
I think they had at some point like 2 or 3 people working on the new input solution, back in 2015, then later they scrapped it, but now they continued to develop it fortunately
the other thing is that Unreal knows first hand how to make scalable games because they made some themselves with their own engine
Unity, while they make some impressive demos, mostly looks like a company that develops a product for customers. Nothing wrong with that.
I really don't know anything about the new transport layer solution, but I believe you, from what I heard it is pretty barebones atm
not just barebones
it is even a very bad solution for what is there
you are better off with simply making a standard C# udp socket in your application and have same functionality as what this thing now provides, and it performs better probably too.
I'll decided to use LiteNetLib for my current project, but haven't really tried it yet
luckily there are at least many viable alternatives for networking with unity out there
awesome to hear that! 🙂
hi all. i'm having issues connecting to our own WSS server. I can connect to say wss://echo.websocket.org, but when trying our own server, it fails to authenticate in unity. with a browser it works, but not in unity. It also seems that I cannot get it to even connect at all on an editor running on a Mac, only on a windows one. I'm using the ninja.Websocket code that mirror uses.
does anyone have a working WSS solution, cross platform?
I'd love to get others opinions on the new networking thing, I mean beyond it lacking high level components like seen in HLAPI
I constantly see Vincenzo trashing it but haven't seen others complain about the actual implementation (only about functionality)
if I remember right, @graceful zephyr didn't think it's all horrible(?)
yeah, that's fine
the new transport is like 1200 lines of C# or something? it's nothing
its like 10 C# files in source code
with a few hundred lines tops in each
and yeah, I know most people wish for some more higher level generic solution, but that's another thing
afaik, there weren't any major news on this front at the GDC
yeah basically seems dead (tm)
-- 13 year old using unity
yeah i also think they scrapped it
again?
2x scrappage?
it's fine though so long as everything is on fire since at least we're warm
maybe unity would properly invest into networking like they did into ECS and SRP that would be great.
by the looks of it big AAA are going for Unreal/lumberyard etc because of networking
@vital hawk I'm not the only one that craps on that repo, check some comments from here and on from a well known network programmer in the unity community https://forum.unity.com/threads/jobs-any-way-to-access-static-data-safely.541070/#post-3987865
but then again that guy trashes almost everything
His comments here are very valid I would say.
I mainly see a lot of speculation on the post you referenced
read the whole topic perhaps
but it's all written by the person who I tend to ignore on the forums in the first place
as he's literally unhappy with everything
Alright. as you wish
would you say the multiplayer package unity posted in that repo is great?
no
I haven't used it or gone through the code myself, I don't have first hand experience on it
I don't remember where but I think I saw a post saying they were working on reliability and other basic features on a private repo but yeah the current networking package is a barebone wrapper on top of sockets
I wish they had more time to go over the actual architecture rather than whatever transport they use. I don't care how you find errors in UDP, I care about networking my game. Some other library can do the transport part for me
it's so hard to find any resources on this stuff
Where Unity keeps failing with networking imo is extending any library into a set of drag and drop components, which is what most people really want. What NetworkTransform wanted to be is what typical unity users are looking for. Though I think they always had plans for that, just their networking projects implode before getting that far up the API
they need to make things more obvious with the transforms as well
you wont believe how many times people put network stuff on non-root objects
Something happened: https://github.com/Unity-Technologies/multiplayer
Seems to contain some more changes: "Showing with 17,567 additions and 991 deletions. "
Well, im not sure on how Unity's network API is going but last time i had searched something it was turning out obsolete (UNet), and now i need to use some HTML requests (get, post) and etc... Can someone give me a "light" on this? Like, it still possible retrieving/sending information from/to a server as HTML (Form)?
Hm, this doesn't require a "real" network api, you can use https://docs.unity3d.com/ScriptReference/Networking.UnityWebRequest.html
Thanks! Never made something online with Unity and probably i'll need to do a online quiz now
i'll need to retrieve quiz from server and send answers
Just use the WebRequest and some json, shouldn't be too hard 😃
Any good performance ideas on this? like, its better sending all needed information to client and grabbing only the result or its better doing an real time data transfer?
Yeah, was thinking on JSON data
I'll need to access an remote database, grab info and send it back
well, thanks @nimble berry
I'm glad they made that update but having that being a dump of code with no roadmap whatsoever and no visibility made my team lose 2-3 months of work
I agree on the tranaparency
Dots roadmap talk was a huge letdown
Guy who spoke there were proud how briefly he got it covered
Yet not much new info was given
the funniest thing is that their "wrapper on sockets" needs twice as much code as ready libs with reliability 😂
Well that update isn't just a wrapper on sockets anymore since it has a first iteration on entity replication, rpc, interpolation and reliability. While you may think it's not enough, it's already more than ready libs since it's things oriented to help you make a game (IMO)
Roadmap without dates? 😛
https://github.com/Unity-Technologies/multiplayer/projects/1
https://www.linkedin.com/in/casper-boysen-13160046
More concerning is those entries are all by a Business Major.
@stray scroll
"Updated on Jan 24"
Also I don't get why we have access to release but not on going dev, I agree with the logic that they don't want to give constant support for a dev git branch for example but at least giving us access while saying there will be no support is a lot more helpful than a barebone package updated every 3 months
Example of what I'm saying, there is a few things in the current update that are not final or the "good way" to do it, we know it, they know it. But not knowing exactly what will change and on what we can rely on is making working with this package harder than it should
how did it make you lose 3 months of work
Basically doing reliability on top of that and a few iterations on entity replication. While it was written that they were working on it, we could have used more smaller updates even if wasn't finished. We knew we were going to throw that work in the trash sooner or later but the lack of visibility is making us choose between doing it ourself or waiting for updates
why would you want to use that at first...
That's another subject of discussion and I won't start it here as it depends on context, a few factual arguments and a lot of biased ones
Again, I'm happy with that update but it's still frustrating
they did say transparency was so important over and over
i was the first to hit them with the transparency demand when they announced they would be making a new network lib
they did promise transparency in writing on forums
so far? very little to none.
virtue signalling, that's all.
can prove otherwise with actions.
so far no action has proved otherwise.
Some areas of unity are very helpful, such as terrain or graphics or dots teams, these have all been forthcoming and help avoid pitfalls of redundant work
but networking team, I think probaby are too busy
It is disappointing again.
This would create a pipeline with just the reliability pipeline stage present, and initialize it to a window size of 32 (so it can keep track of 32 reliable packets at a one time). The maximum value for this is 32.
Because only 32 packets can be tracked at a time there can't be more than 32 packets in flight at any one time, trying to send a 33rd packet will result in an error and it will not be reliable (no guarantee of delivery).
For instance
😂
The new networking update on github is solid, i think their reliability pipeline is just an example and not intended for production (?), read through all of the source changes, a lot of refactoring/renamings + the pipline concept, and some updates to the native libs. They are not doing anything 'wrong', the lib looks solid - but it's still so early I'm not sure who this library is intended for.
@graceful zephyr weren't they supposed to have high level API ready for 2019.3?
I doubt that will happen to be honest
If that's still the plan, i'm 90% convinced this would be the final version
The library they have on github now, i.e. bascially socket/transport
Is nowhere near finished
It's not bad in ANY WAY, it's in fact pretty well crafted and thought out
But it's still pretty early in development, and missing a ton of features
Yep, but i'm slightly worried they may say it is, due to lack of time 😂
@graceful zephyr Heya btw, been a long time
Hey guys, anyone could give me a tip on name of architecture for splitting servers (login and game servers)?
Do i need to use TCP sockets to connect between these servers?
for example database server which asks game servers for data of actual active players within game servers
@jade glacier hey o/ yeah i've been staying off discord for a while
just too much noise at times
Hi there, is there anyone with games released with online gameplay happy to share how much bandwidth they use please ? (in/out ideally)
@graceful zephyr No worries, just throwing a wave out since its been ages.
@surreal blade You really won't learn anything from any answer any of us could give, because every game has different messaging requirements. If you're doing a turn-based card game, bandwidth usage of an FPS tells you nothing helpful, for example.
@gray pond Thank you but yeah I would definitely learn things because I would expect to also know the type of game the people answering are talking about!
Also sorry I didn't specify but I meant bandwidth per second
If for example, people have shipped games with not many people complaining with an average of 80KB/s I can know that it's an acceptable target and not worry for reaching 10KB/s
Even so, there would be a wide difference in bandwidth between games that are quite similar, just on CCU alone, whether one has voice chat, maybe one is more prone to have idle players, etc.
Yes of course there are differences, but that's what a benchmark is.
Thanks @undone sigil by the way!
Hey all. Not sure if anyone would be able to help me with this. But I have an issue when running a TCP Socket Client from an IOS device. I'm running the server on my local desktop on port 80. (Also tried port 8052) When playing in the editor both the client and the server have no issues communicating and connecting to each other. But after I've built out for IOS from XCode my networking code seems to just stop working. I'm not seeing any errors or strange messages in XCode console either. I'm not sure if someone has run into this in the past, but I would love some help.
Xcode? In unity?
Check to make sure whatever Xcode built for you is actually in the client that package
It’s not in unity, the build process creates an Xcode project file that you have to then build for iOS.
@proper olive are the permissions set in the plist? I believe some of them have changed if you are targeting 12+
Been catching up on messages over the past week. Someone keeps insisting that the FPS example is somehow a dead project based on the gitHub repo.
Seriously, in the project .readme it says this this just the public repo that gets updated when the finish a branch. They are using a different source control for day to day development.
people always talk crap, there's no way around it
if update doesn't land in 1-2 months people tell it's dead
but that's definitely not what Unity is messaging about the FPS Sample
@vernal remnant Thanks for the help. Though I actually ended up resolving this one on my own lol. I using the wrong port number on my mobile app. Stupid mistake.
Hello, first time I used a state buffer https://pastebin.com/VeiAQ8ft the results are kinda bad, it's not rly smooth. https://streamable.com/syd8k left side, left bottom(greenish) cube is using it. You see it works in some way but its not smooth. Any idea to improve this ?
won't play as a video for me, but the first question is what are you using for buffering/interpolation, assuming this is networked
@weak lava
I linked my script above. Using positions,rotation and timestamp for interpolation. My Statebuffer saves 20 states and interpolates between them. And yes, Photon Networking.
@jade glacier
I read through some articles which mentioned to increase the statebuffer to save 30 state and play with the interpolationBackTime which is at default 0.1. Not sure if this solves the problem. Also I read something about a hermit interpolation anyone got some more information about this?
you don't need that many frames in the buffer for smoothness, generally you only need a buffer of one or two frames and one extra that is mid interpolation. I can't see the video so I can't see how jittery things are.
That buffer code looks a bit suspect, its not quite a ring buffer there.
using network time of any kind I am not a fan of. Generally I always put my simulation on the Fixed timing, and I draw from the buffer on the fixed timing as well.
Otherwise things get a bit timey whimey
I generally don't use OnPhotonSerializeView for transform syncs, I use my own timing singleton that is based on FixedUpdate, which commands all net objects to serialize to a master byte[], and that gets mailed off on a regular fixedDeltaTime rate. @weak lava
https://github.com/emotitron/NetworkSyncTransform
The demo scene in there does this, and works with PUN2 (and maybe still PUN1).
Gonna check it out, thx so far @jade glacier
I've only seen issues with transforms skipping when rpc calls were being abused
@jade glacier i see you everywhere 😄
@solar garden I'm in most of the networking chans yeah
o/
eeh, to be fair, unity was messaging that unet was fine and under development until we learned that only 2 devs were actually working on it
then it got deprecated out of no where
I can totally understand the concerns about the new networking
especially after they reinstated LLAPI in a hurry after they deprecated it
I dunno about the last point
it just tells they do listen to feedback
basically now they have to give the old system support for longer than they initially wanted to
but deprecating a system when replacement isn't ready is pretty shortsighted alright
There was no reason to put the System.Obsolete tags into the HLAPI
That was just hubris
Hi guys,
im using photon server for a game i'm currently developing, but i have a problem with packets coming in faster or later than other packets.
I use tcp as the communication protocol , but not any queueing at the moment to wait for each packet individually.
Is there any specific way how i can wait for packets to be received before other packets are received?
Thanks in advance!
The reason for this is that only sometimes i get errors on specific code for packets which should be executed after another packet..
Im using the PhotonPeer
@verbal sandal doesn't TCP have sequencing?
@undone sigil i thaught so too, but still it seems like packets are received earlier than other packets
@verbal sandal yeah, i've checked and it is, there is no possible way you can get packets out of order
Probably Photon is fucking with them
@undone sigil or its something with unity, i have a packet which removes an monobehaviour and adds an new monobehaviour
however, in the next packet im trying to use that new monobehaviour
but it seems like the old monobehaviour still exists
maybe it has something to do with the next frame, im not sure..
@undone sigil TCP IS sequencing, to a fault
Photon has a TCP option?
I thought their orderered reliable was just RUDP ?
Ah yeah, they do have TCP as a transport option
Photon Unity Networking framework for realtime multiplayer games and applications with no punchthrough issues. Export to all Unity supported platforms, no matter what Unity license you have!
Definitely should be arriving in order then, if not I would ping @stiff ridge about it
Any reason for TCP rather than RUDP (as an offtopic)? @verbal sandal
Uhm well , just to be sure that all packets are received @jade glacier
I dont know if RUDP is really thát reliable
in a production evironment
It is, just a different mechanism that is less likely to congest quite as badly
and why is that?
TCP is hardcoded at the hardware level for how it creates headers and how it deals with lost packets, and it didn't make any of those handling choices with games in mind. It was for reliable things like loading web pages.
RUDP is software level, so it can be way more flexible and less bloated in how it deals with lost packets
I haven't personally dealt with it, but I would think one example of TCP failing is will send a packet, and wait for an ACK I believe before sending the next, so it can really get hung up on lost packets doing resends.
So my understanding is that in an RUDP, while its waiting for an ack, it can be sending the next numbered frame... and if that earlier packet never acks back... the originator can THEN resend it. Meanwhile, the receiver isn't twiddling its thumbs, its still getting the later packets, and just needs to hold them in limbo until the earlier missing one arrives.
I am no transport expert, but that is my understanding of the kind of advantages RUDP gives for gaming over TCP
https://gafferongames.com/post/reliability_ordering_and_congestion_avoidance_over_udp/ This article talks more about the TCP shortcomings
What we need is a different type of reliability. Instead of having all data treated as a reliable ordered stream, we want to send packets at a steady rate and get notified when packets are received by the other computer. This allows time sensitive data to get through without waiting for resent packets, while letting us make our own decision about how to handle packet loss at the application level.``` That sums it up better than how I was saying it I think
Alright, thanks for your help man. Is it okay if I try to use rudp tomorrow and get back to you?
Personally, I always just go fully unordered unreliable and number my frames in a circular buffer, since I work to make my simulations tick based
Going full unreliable means you can make use of the data even if there are holes in it
if I am on frame 5, and I get frame 7 ... when it comes time to render frame 6 I can recreate it by tweening 5 and 7
rather than just having 7 held up in the ether without me being able to see or use it.
@verbal sandal You don't need my permission for any of this LOL
Nah I know but I'll see if it changes anything @jade glacier
@verbal sandal hey, photon networking has RPCs, which guarantees packet order and delivery.
They are expensive though.
but its still better than using TCP. So Id recommend UDP while using reliable packets when required.
https://github.com/emotitron/NetworkSyncTransform I build an entire asset that abstracts that and uses 6 bit frame Ids for its own circular buffers. Comes up with some very smooth results without any of the heft of the more reliable UDP types.
You are welcome to drag in the package and try the example scene with PUN (pun does require a switch over in the settings)
wow that explanation quote from the article explained it really well.
@indigo current yeah i'm giving reliable UDP at the moment
seeing if that works fine and does the job
so far so good
Yo! Updated to the latest of Unity 2018.3 as well as the new Multiplayer Transport package, and I get this exception:
Just wondering if anyone else has the last of the transport package and can let me know if this is a bug with the package or if it's something I may've done wrong, since the exception is caused during some DefaultPipeLineStageCollection compilation.
@stable cairn in the repository they say this:
Make sure you have a supported version of Unity (2019.1 or newer)
maybe consider upgrading unity to 2019.1
Damn... I was hoping to avoid that, just ported to 2018.3 and was hoping to stay that way until 2019 reached a steady configuration. Thought networking was supposed to be part of 2018.3 as well :S Really gonna need that reliable pipelining tho.
Then again, my game works atm, so it doesn't seem to be very critical yet.
2019.1 is officially released @stable cairn
If you did not know that
Yeah, but it's the constant stream of minor updates that is a bit tedious for my programming team, so prefer to not have a "0f2" versions atm.
@stable cairn please don't use unitys networking stuff, that's terrible
Well I got high expectations for the new multiplayer 😉
Hey all, I have a game that is LAN only and currently have all my VOIP functionality done thru RPCs and CMDs. Now I've had this for months and at first it was a stutter mess. Now after tweaking it and making a bigger buffer before sending, it is pretty decent. However it still stutters and for what I am accomplishing, voice quality needs to be as good as possible (especially since every user will be always in the same building <1 ping)....
Is it worth just purchasing something like this https://assetstore.unity.com/packages/tools/audio/dissonance-voice-chat-70078
I have been eyeing it for awhile and while I know it will work, I'm not sure if the reimplementation of the current VOIP system is worth it. I think so, but if theres a smoking gun for clearing the stutter, then I think thats my best option.
I currently just pack all sound data from the mic.getdata() into a byte array and send it via CMD and then back to clients via RPC. The input sits in a coroutine on a yield waitforsecondsrealtime for .2 seconds and then it checks the push to talk key before sending the buffered data.
Any advice?
(Also might use the Opus codec as I think I need to NOT fragment my packets and I cant do that as currently it sends way too many bytes)
Hey @heavy rapids I'm one of the devs for Dissonance, I can answer any questions you've got 😃
Basically there are a whole bunch of problems with your current approach. For example if the mic is not recording data at the same sample rate as your playback system it won't work (unless you've got resampling in there), you really want a dynamic jitter buffer to buffer the minimum amount of audio (low latency) but not too low (can't handle jitter), raw mic audio generally sounds really bad so you want noise suppression/gain control/echo cancellation to clean that up.
Hm okay great thanks for the explanation! @true juniper
So, if I were to purchase Dissonance, does it have support for the host/server also talking? Our system works with a host and multiple clients. The host has the ability to talk to anyone and I'm sure it works, but just want to clarify since most probably only have the clients communicate. Thanks!
@true juniper If that works and I can have users listen/connect to multiple chatrooms and have the ability to mute certain people ect, I will buy this right now.
@heavy rapids You can start Dissonance either as a Host (client and server) or as a Dedicated Server (no voice audio at all, just networking).
You can have up to 2^16 chatrooms at once, you can mute people or individual incoming channels (e.g. mute the global room, but not the team chat room)
@true juniper well perfect then! Looks like you've got my money. Thanks man
Thanks 😄
any ideas how i could have a shotgun shooting the same random spread on each clients ?
are you using any kind of frameid for your network messages? @solar garden
no 😦
For mine, I have numbered frames, so I use the frameid for each tick as the seed. Otherwise you may just want to add a byte for a seed to your write
That will get you 256 different patterns
i'd like to have tick system 😦 i dont have one but some guys told me a good trick, i have a shotgun with a for loop for the spread, the trick is since i use random floats for the spread i can use Random.seed() to have it being the same partern for every client but it doesn't work as intended thats why i though that using RPCs would solve the problem thinking that the call would be the same over the network
thats how my shotgun looks like
void Update()
{
if (networkObject == null) return;
if (fireTimer < fireRate) { fireTimer += Time.fixedDeltaTime; }
RaycastHit hit;
if (i.isShooting)
{
for (int i = 0; i < pellets; i++)
{
float spreadX = Random.Range(-maximumSpread, maximumSpread);
float spreadY = Random.Range(-maximumSpread, maximumSpread);
float spreadZ = 0f; //Don't adjust depth of spread.
Vector3 spread = transform.TransformDirection(new Vector3(spreadX, spreadY, spreadZ));
Vector3 direction = (transform.forward + spread).normalized;
//Vector3 direction = Random.insideUnitCircle * spread; THE OLD WAY
if (Physics.Raycast(transform.position, transform.forward + direction, out hit, range))
{
Debug.Log(hit.transform.name);
Instantiate(impact, hit.point, Quaternion.LookRotation(hit.normal));
}
}
}
}```
How are you transmitting weapon fire right now?
well its kinda bad if im honest i have this Input manager that is on every player but that detect if the player is the owner and able to use the input the other local player prefabs just wont use the inputs
public class Inputs : PlayerBehavior
{
public bool isJumping;
public bool isAiming;
public bool isShooting;
public float vertical;
public float horizontal;
public float mouseY;
private void Update()
{
if (networkObject == null) return;
if (networkObject.IsOwner)
{
horizontal = Input.GetAxis("Horizontal");
vertical = Input.GetAxis("Vertical");
mouseY = Input.GetAxis("Mouse Y");
isJumping = Input.GetButton("Jump");
isShooting = Input.GetButton("Fire1");
isAiming = Input.GetButton("Fire2");
networkObject.horizontal = horizontal;
networkObject.vertical = vertical;
networkObject.isJumping = isJumping;
networkObject.isShooting = isShooting;
networkObject.isAiming = isAiming;
}
else
{
horizontal = networkObject.horizontal;
vertical = networkObject.vertical;
isJumping = networkObject.isJumping;
isShooting = networkObject.isShooting;
isAiming = networkObject.isAiming;
}
}
}```
How are you transmitting that? RPC?
err unreliable fields through the NCW
Not familiar enough with NCW to know how it times those and such, but I would say add a field for a byte that you can make the seed, and random generate that seed on the client and everyone can use it
Its a bit of a waste of space, but you already have a bloated non-bitpacked pile of data there anyway... no point getting frugal now
NCW?
Contract Wizard
its a forge thing
Basically you define structs in advance for what I believe is code gen
And it handles a bunch of the networking based on them
"bloated non-bitpacked pile of data there anyway... no point getting frugal now" 😂 i am a beginner im sorry
Yeah, don't sweat efficiency yet. Add a byte and have the client generate a random seed from 0-255
and send that along with the input struct
have the networked weapon fire use that value for their seed as well
being a unreliable field wont cause a problem of sync at some point ?
well i guess i dont have the luxury to care 😄
you need sync of your seed if your weapon fire gets lost?
They go hand in hand, so not sure why it would matter
if that input gets lost, the server is going to say the gun didn't fire
the seed and the fire event are entwined in one struct this way
oh ok
do you think i could use this ? https://docs.unity3d.com/ScriptReference/Random.InitState.html
it won't matter
don't seed the client, it needs to come up with a normally random value
oh yeah, for what we are doing on the other end yes
you stick this networked value into that right before the shotgun spread uses random
on the player side though you will want to randomize the seed probably though before picking the networked seed
You can randomize it by seeding with like Time.time
Time.Time is a int ?
I'm sure there is a better way, no idea. google that
no, you would have to do some stuff
Just google the best way to reshuffle the randimizer
I just don't know off the top of my head
its ok thanks a lot
np
I assume this is where I can talk about PUN yes?
the Photon animation view
if I were to have something like a floating platform, where the platforms position is controlled via the unity Animation Controller system and an animation clip.
Attaching the PhotonView and PhotonAnimatorView to the object, to me, this makes me assume that the platforms position will be syncronized across all connected clients.
But it doesn't every client is different.
What am I missing?
@simple sparrow
the animation view does not sync transform positions.
it syncs animation states.
if the animation timing is out of sync at all the platform wont align properly.
you should be using a photon transform view. this assumes youre animating the parent object (which is a bad idea in general).
this appeared on staging
hippocoder used SmoothDamp. -- It was highly effective.
What are pros and cons between dark rift networking and mirror networking for a ~100 CCU MMO?
I haven't heard bad things about either, so probably just try one and see how it goes @lean onyx
compare their methods for your own tastes
@lean onyx I haven't looked at dark rift networking at all, but Mirror might be good to go with because there are example MMO assets on the unity asset store
hey guys, I am having a hard time with the UnityWebRequest. I want to use the Get method to retrieve some objetcs ( a hashset of a custom class) from our rest api, but i also need to send data to the server used for a query. The api expects json data however the uploadhandler only works with byte arrays(?). But when parsing the json to byte[] and sending that to the server i always get the response that the request could not be parsed correclty : "Request finished in 681.2597ms 400 application/problem+json; charset=utf-8" Anybody knows how to handle this issue?
I suggest avoiding homebrew network libs and going with Photon until Unity's done with their new networking.
@compact bramble I would think with over a dozen launched games and a growing list of 3rd party asset integrations, support for TCP, UDP, Steam, and WebGL, and 10 actively contributing devs, Mirror can't really be called "homebrew".
for me it is
more like urine in practice than beer, I am ashamed that we tried to run it in the public beta test, it was a frustrating experience. photon is the way to go if you don't want to shoot yourself in the foot, but you need to invest money into it.
but after an initial period, if you more or less successful you will have money to keep it on rails in long-term
Indies without a full time network engineer on team will find their game does not scale or offer any form of resilience with these homebrew efforts.
"a dozen launched games" vs "thousands of actual games by AAA and indie alike" is a big difference, and worth the Photon cost.
But if you have a full time network guy, its worth a try to go with alternatives.
lol, you seem like a hardcore Photon fanboy
@vital hawk Stuff that I'm posting on forums is well-argued, and unlike you, I don't deal in absolutes.
If you can't counter-argue what I'm writing there then keep your immature tears to yourself.
Hypocrite who criticizes the new UI on the right and left.
personal attacks aren't super constructive - can we keep things civil?
🍿
I'm not going to address that further than say that people can have their opinions, there are no tears shed here nor need to attack people. and yes it's true that I tend to ignore peoples posts that are almost always overwhelmingly negative. maybe lighten up a bit, game dev can be fun too 😃
I don't feel offended, that would imply the person wasted my time (pretty much the only way I can be offended) :)
I will explain slightly futher, the rationale behind recommending Photon, it's really just a matter of perspective. As a tiny indie, you'd be unlikely to ever hit a situation where a homebrew or amateur network library will struggle, but if you're serious then it makes sense to go with something based on enet (photon is funnily enough) or just hire a proper person that will work with you and keep your net code and server running. These things need constant attention for a popular title. I would get killed if I ran my own server with 20CCU if I'm honest. That situation would eventually require hands on.
As the game got more popular, with more CCU...
Strange things would start happening that you would fail to track like people quietly not connecting, or half the planet timing out trying connect, and you never knowing why as steam reviews get more and more hateful and your title gets review bombed. This is why (if successful) you cannot take the cheap option. It is hiring someone, or using Photon.
But of course for tiny unknown or hobby titles please disregard everything :)
That still doesn't explain why Photon wouldn't struggle when other libs would 😄
I do networking as my main thing, and I have no idea what this discussion is even about.
I would abstract the library regardless. Having hard coded components, timings and messaging intertwined with your actual simulation and serialization code sounds like a recipe for pain.
Sounds good. I'd love if Unity's solution was further on, then I could start digging deep into it like I did with UNet (which turned out to be quite a bother really)
mmm, I'm rolling my own solution with LiteNetLib and a cost-effective VPS provider as a cost-saving exercise and learning experience, for better or worse
Photon is good for things you don't need absolute precision on (eg competitive shooters), and that don't use a lot of bandwidth.
You can make a ton of casual games with photon and learn good practices. It's kind of a stepping stone for more serious networking though.
I don't particularly have a bias toward photon or anything, just I'm not seeing how they're more expensive than hiring a staff member + a bunch servers across the world + debugging unproven code
its fine if you're a contractor but from the POV of an indie running a business where small downtime is able to kill the product, well that's that.
I just think the main arguments occur because the POV of the person speaking is dramatically different to the other
for example I really enjoyed using TNet from tasharen and it was cool and fun, but wouldn't ever scale to anything
Sounds a bit like your comparing apples to oranges...Photon services vs. Mirror networking, and bashing the latter for not having a multimillion dollar infrastructure, even though Mirror is portable to services like PlayFab, GameLift, etc.
And comparing the number of launched titles is bad form, given that Mirror's only been around for months vs Exit Games for years
Comparing Mirror, DarkRift, PUN, MLAPI, UNet (without Unity services), would be more reasonable in terms of API features and project structure. None of these are great for all types of games...some are better than others for certain types. I wouldn't use any of them for a turn-based game.
@compact bramble @swift plinth I don't know when you last worked with Mirror, or what your issues were , but if it wasn't this year, you may be basing your opinions on outdated information.
I came to some problems, I am using new Unity.Networking.Transport and I cant make the UdpCNetworkDriver as the Unity.Networking.Transport.BasicNetworkDriver<T> does not exist, how is that possible? I am using the git version and their docs but it does not seem to work
@dapper tusk It's pretty early in the dev of the new library, most likely docs are out of date
Yea, I will wait a bit until they make some more progress on it
or just don't use it at all
Is this conversation ever not religious?
Probably not, but bashing something without cause or context isn't necessary
Yes, I contribute to Mirror, but I'd never bash the others just to be an ass
If someone wants to make a turn-based game, I've told many to use something simpler than Mirror
Would Mirror work for that? Sure, but it's overkill.
On the other hand, if someone has a UNet game nearly finished, I'd certainly call them over to Mirror because it would surely be the least painful conversion.
If someone is trying to make a fast twitch physics game for 200 players, Mirror would fall short out of the box. Perhaps others would be a better choice. Mirror can be extended to support that, but it'd be some work. It can handle the 200, but the physics components aren't there...yet.
Different tools for different things
If networking was easy, every game under the sun would be networked
exactly, so saying one is "best" or "urine" without any context is just pointless.
Its not even quite that... networking in Unity at the HLAPI is just in a state.
There is a lot of loathing, because its really a landscape of "not good enough" across the board. Unity is really to blame, but it does seem like enough people realize its a problem that it might actually get some improvements over the next couple of years.
Either from Unity, or from some of the smaller projects spawning out of the lack of anything complete
I like the Mirror concept, but I do agree it keeps breaking the promises it has made. Once that stops and it tightens up on the original promise of "HLAPI but better", it may get some respect.
PUN has a lot going for it, but it also rides on a lot of legacy code that hurts it
Photon's back end I hear is solid
It is a shame that Unity's current live network offerings have been deprecated, has left it in a not-so-desirable state
rip raknet, rip UNet
I also read about this the other day: https://unity3d.com/partners/google/connectedgames which is like some other angle for turn-based projects
Forge I still know little about, because its architecture is not conducive to me porting my networking libs to it.
yeah the main complaints I hear about Photon/PUN is that the packet overhead is quite "large", but it all works if it's not a big deal to the developer
yeah, though you can work around it. For my asset I just raise events, so I just bitpack my own byte[] and I run my test stuff at 60 ticks a second with no trouble on PUN
I've meddled with Tasharen's TNet too, seems solid if you don't mind its prefab system, an interesting take on things
But the built in PUN stuff is a pig for net traffic
UNet/Mirror/Forge/PUN all focus on replicating primitves and none of them touch bitpacking, so its really on you to do that
Bolt is still alive and kicking, and releasing titles. No clue what its current state is
Never even heard of Tasharen's thing, will look into it out of curiousity
TNet's hook is that it stores copies of the game world to memory/disk, so you can disconnect/reconnect without much issue, like acting as a server that retains data, rather than fully relying on clients to supply data
the server does not do physics processing or anything though
Unet/Mirror/PUN all have paths to the transport you can bypass much of the bloat with, so that brings it down to hosting and pricing models
Interesting
yeah the Tasharen dev said he was able to just host servers from his home for his Windward game lol
I'm so deep in 3d realtime physics based stuff I forget about the other avenues
That's another thing - if a game doesn't need server-side physics / collisions / raycasting / navmesh, then there are definitely other choices because the server can be a non-Unity service
yea
Yeah, people get tied into these options regardless of what they are making, and then get religious about it.
There's no good reason to have a server running inside Unity if you're not going to leverage it.
I think most people first experience networking as the UNET/PUN tutorials
and get stuck in that thinking
not realizing that you can have a server that is something totally not unity
true, but they do want those features on the server more often than not
And not realizing that a unity based server is going to cost them a lot
yeah, most I think get built as player hosted, because that is the nature of the tutorials
It's not trivial to implement that stuff without Unity
or with PUN relayed and serverless
There are so many options 😄
They just aren't obvious from inside of unity if you are starting
and Unity doesn't exactly direct you toward them 😃
very true
I have issues with Mirror (mainly because it still causes me hours of work a week patching around it), but I refrain from bashing it because I want to see it make it to an LTS and stabilize. There is an audience for it of people who Unity stranded.
I do wonder what Vis2k has smoking sometimes with the directions its allowed to take. but I have issues with all of the libs I have had to deal with.
I don't think Photon is the best, by any means. I was only saying for those learning networking with no experience or that want something out fast PUN is probably better.
If you already have experience with networking and know the ins and outs then yeah, use something else.
The endless networking lib arguments are still going strong eh? People get way to upset, zealous and invested in these things.
Just pick the one which matches your experience level, game type, budget, etc.
@compact bramble a bit yes, why?
It's still too early to use it for anything serious
ENALBE_UNET as a define is always true? Even in 2019 when UNET has been removed?
Duh fuq?
you still in our side of the pond?
ah
So seems !UNITY_2019_1_OR_NEWER is the only viable test for UNET?
probably
Users can't enable it as a module or anything?
Weather starting to get springlike up there? @graceful zephyr
Warmer here than that, but still chilly as well. Not sure if its the norm for EU or just a weird season
was starting to get really warm a few weeks ago... the bam.. wearing jackets again
Shifts in the jetstream I believe
watch out apparently they make frogs gay or something
What's melting the poles is making us all colder
i know what the jetstream is, just missunderstanding on purpose 😄
to drop an alex jones ref
They stole our warm
ah Alex Jones... consumer of old friends who I never talk to any more
Funny thing is I lived in Texas when he was starting up
I'd like to live a year or two in texas
and he used to actually at one time be useful and interesting
😄
Between, PUN, PUN2, MIRROR, and UNITY_2018 ... my code is becoming more ifdef than code.
lol
And all of that pain for assets that don't have a lot of turnover 😕
@graceful zephyr argument: an exchange of diverging or opposite views, typically a heated or angry one.
@indigo current Your point?
People speak about the various libraries always in absolutes, but absolutes are hard to come by in Unity networking. EVERY option has a downside, be it cost, or bugs, or lack of support, or relying on relays, or not offering relays.. etc. It's pretty pointless debating any of them as crap or great... they are all crap and great - if they don't or do match what you are trying to do.
@graceful zephyr my point, there's a difference between debating and arguing. Debating is resourceful, arguing is not.
in internet discussions, there usually isn't distinction between the two
most of the time it's just people pushing their own opinions
All I meant is that people tend to get way to invested in this stuff
And the discussions/arguments/whatever is endless 😃
You should only push commits, nothing else 👌🏻
@graceful zephyr I need to seriously consider at least 4-8 player small scale networking for the project I am doing. I need this to be a medium rate - think basically mario style rate of change so any recommendations or advice you have I'm all ears. Tobias recommended I chat to photon regarding a discount or influencer perks (which is what I am I guess) and so I figure that's also an angle I can take if it's cost effective for my game.
I don't have a lot of net experience but I'm far from stupid, which is why I'm leaning so hard toward a company that might have said experience.
Most importantly... what type of game is it?
it's a third person arena based game at the moment with 2-8 players (flexible, I can compromise)
melee combat
platforming elements
Hmm
capsules for players, occasional rigidbodies need synching (pickups)
Full 3d movement?
yeah
x,y,z needed, can jump, some can glide a little
the rigidbodies dont really need synching at all actually
i can suffice with a position for them
I'd say bolt tbh ... I'm obviously biased. But I don't know any other that has client side prediction and other goodies built in
bolt sounds fun what happens server wise?
One of the players would be the server
host migration's important to me
Bolt has punch through and relay fallback
Does not have that tho
You've set the bar pretty high with that game and features like host migration
Its a good target for a custom solution obviously
If you go with something like pun, unet, etc be sure that you will really not be able to use any of the built in components
As they're usually not built for games like that
it's small but the quality is really high overall in the game, lots of attention to quality over quantity so the networking needs to be as professional
so having a player drop and others all suffer, that's just too low quality
I know that stanchion (our bolt community guy) has a host migration sample for bolt tho
it'll have to work also on consoles, or be tested for them
Yeah, it really is2
pausing it while a new guy is found can be acceptable
Massive headache
so long as everyone isn't dumped
I think it was halo 4 or 5 that did that
(pause to find new host)
Oh right not allowed to send discord invites here
pm me for it
Can you PM me? I'm ob phone
Just pong me
The android client isn't letting me PM you for some reason
weird thing
thanks
Bolt is by no means perfect
sounds like bolt might be simpler though
But I think the amount of work you have to do is way less than any other lib
simpler or more direct without fluff (and hopefully without too much allocations) is +1
As you're going to end up building a lot of the features that come out of the box with bolt
Depending on the exact game mechanics and such you might be able to use quantum
So bolt is free but I can optionally use it with photon's cloud stuff?
Bolt free uses the cloud always but does punch through via it
And only uses the cloud as relay incase punch fails
bolt vs pun ?
Pun is always relay
Doesn't have the concept of a server
Very different to use
@compact bramble Sent you a voucher for the Photon Bolt Sample Pack
it includes a bare bones host migration sample
@compact bramble bolt is higher level than pun is a simple way of putting it
thanks a lot, appreciated very handy
Don't need to deal with serialization by hand on bolt, automatic delta compression, built in systems for authority and predictions
Pun is more serialize and RPCS
"Host Migration Sample: Basic host migration functionality, when a host quits, the selected "backup host" will host, and the other clients will connect to that host. If that "new host" then quits, the "backup host" it selected will host, and all if any other clients will connect to that. And on and on and on... "
thats truly OK for my purposes
I might have to start recommending bolt to all if I get some good results with this :D
I have to put my two turdbirds to sleep now
I love my kids but every day is a struggle of how early can we put them to sleep
love the restraint
@compact bramble I know how much you like PUN, if you know someone getting started please don't hesitate to point them to my latest series 😃 https://www.youtube.com/watch?v=p8YQpcoaPoU&list=PLkx8oFug638oMagBH2qj1fXOkvBr6nhzt&index=2
Decide if PUN is right for your game.
I'm done recording, will be trying to edit and add 3 videos a day to the playlist.
I never said I liked PUN only that it seems like a solid choice
but yep I will mention you
That was a joke 😛
PUN doesn't really have a way to serialize an initial state in with instantiation does it? @indigo current
what do you mean exactly?
Looking at the PhotonTransformViews, looks likes its a bit hacky
Familiar with UNET so if I refer to how it does it you can get the sense of the equivalent?
public override bool OnSerialize(NetworkWriter writer, bool initialState){} is how you do it with UNET - when a NetworkIdentity is spawned, the creation over the network is accompanied by an initial serialization event, where you can write in the current state from the authority, to whomever just got it.
I get that PUN doesn't have a server, so the equivalency can't be there
but how does it handle that period between when the object is created on other clients... and when they get their first serialized data from the owner?
you keep saying current state but I don't know what that implies
In this example... lets use position
Relay server says "spawn this" to all
But they may not get a position for a frame or two
When you instantiate over the network photon passes in position/rot over the instantiate call
as well the owner.
the other clients locally instantiate and initialize with that data.
so the position should be set soon as it instantiates
I'm not seeing the current position happening by default - you are saying it Transform data is kept by the Relay server and is part of instantiation?
I may have a flaw that is just keeping that from happening for me
I don't see though how the server would be aware of position of clients
Its not something I am explicitly telling it
But the instantiate doesn't talk to the owner does it?
Or is the authority owner part of the spawn process?
When I join late - I don't have any positions
so basically anyone can instantiate, whoever instantiates by default owns the object (this can be changed)
of other players
so lets say playerB says photonnetwork.instantiate(vector3.zero, quaternion.identity);
yeah, but if I join 1 minute into a game - the only place players position data exists is either compressed in mystery packets on the net... or is only known by the owner
I think on playerB it instantiates locally at those positions and assigns owner view ID the moment it instantiates.
playerA then gets the same call with the prefab name, position, rot, and owner
I am more concerned about what that new players see of the OTHER players
because its all defaults until the new player gets updates from them
that may be true
Looking at the photon transform code it looks like a hacky after the fact update
So that may be the nature of the beast
That since the relay server is dumb, there is a momentary desync that cannot be avoided
photontransformview uses onphotonserializeview
the default to that is 10 updates sent per second
Does the relay cache the last serialization?
dont think so
So its possible for me to join a game, see a bunch of other players, all in the wrong place if that is the case?
until their updates arrive
let me look into that real quick
i dont think it would happen because realistically their positions will update well before any models or visuals load
PhotonTransformClassic has some hinting about this in its comments
What is the mechanic that would delay that?
Id assume what you said. I'm not sure if viewing how the server sends already instantiated objects is in the source. I'm abotu to check
cool, appreciate it
okay found it
you're looking for internal GameObject DoInstantiate under NetworkingPeer
the data is set on awake by the photonview
Hmm, might not be usable in my case since this is an asset
Hmm, I'll have to see if I can make use of that when I am not in control of the instantiation
so new clients receive "DoInstantiate" which passes in the obj to instantiate as well the position/rot/view data.
and it instantiates and applies on awake, which is basically immediately.
but I suppose it is possible if u perform operations off awake which use id/pos/rot
you might face troubles
Who is calling the DoInstatniate? I may just need to read up on it a bit here.
I didn't go that deep
but I suspect the photon network or maybe masterclient more likely tells the new players where each object is
and passes in all that data
Could be, I don't know the whole instantiation process
If the relay server leaves it up to each owner to give you the details that would be complete, but that would be super problematic
The Master will be outdated, so doubt that would be a source of current states
how would the master be outdated
the master is already in the room, it already knows everything
The Master is already 3 hops to and from the relay vs the object that actually is broacasting positions
That would be an awfully Server/Client way of handling it - wouldn't make sense in PUN being pure relay
oh you mean the master would be further behind
you could be right that the owner passes on the information.
The master is just there to settle scores and such, not to have the ultimate word on non-authority stuff
thats how id probably do it, makes most sense
yeah, like WAY behind - that and the architecture just doesn't make sense for that master to act as a server
but your question has been answered about the desync potential, and that there is none 😛
it does seem you cannot rely on the viewid/rot/pos on awake though unless PhotonView has a higher script priority (didnt check)
I think the ideal way is the Relay isn't dumb, and retains cached serializations, but that is a whole extension of functionality and can of worms
So I think its on the dev to just work around that initial "fuzziness"
if it does, its not in the script execution order settings
If I join a game in session, the relay doesn't know the positions of things... but it lets me in... so I can only assume there is a moment of uncertainty there. Probably ideally handled by devs - where you don't make other objects visible until they get a serialization
is just my guess
I never solved it with my previous asset
in NetworkSyncTransform, I just made the gameobject stay invisible until my first update came in
So basically after joining, other entities started popping in as they reported in
Thats not how it works from what i gathered
Okay sooo scene objects might be desyncd, thats entirely a possibility
but instantiated objects shouldnt be
Is the spawn logic posted anywhere as far as you know? Or do I just need to follow the methods and see where it all goes?
you receive a call over the network to instantiate them and that call includes the initial data.
yeah, its the scene objects that are the concern
well, I don't know couldn't track those. would be really easy to test though.
other players that I am told are in the game... but I haven't gotten current states from yet
Mostly was just asking here in case there was a known best pratice
sceneviews are objects in your scene at build that have a photonview.
yeah, they exist
I'll have to test the scene view thing for you to be sure.
the issue is if I join a game, and it says there are 4 other players.... but I haven't gotten updates... then their transform/animation/etc states are all unknown to me
until they start reporting in
they would be known to you
They don't spawn locally until a serialization from them arrives?
Im not sure about the animation states but the position/rot/viewId are definitely known when you spawn them locally.
I don't get how though
The server has no innate knowledge of position past initial spawn
I just want to be clear I'm talking about objects which are instantiated over the network.
Not objects which you place in your scene, and build.
Well I would assume other players are instantiated over the network at some point.
Then yes, pos/rot is set on spawn even for new players.
That is the missing part
does the relay server hold off on telling me about them until they are passing through some serialization?
I tried, no return in the docs, will look around some more
You can't know they're there until the server tells you anyway, right?
So it only makes sense that the server tells you their transform data when it tells you they're there as well.
But I looked at the code and I can tell you, that is how it works.
I think the serarch feature is just lame is my guess
ahh
I'm unsure about the synchronization delays on scene objects though. I want to test that out, and will tomorrow.
Is DoInstantiate even a thing in PUN2
project search found no instances of it
Oh well, first I am just going to ignore the problem and see if it just magically isn't a problem. Such as the server holds spawning objects until a serialization goes through for them. Will see here.
Nope, left to its own devices, other characters all start at their origin on the new players screen, and then move to their correct position shortly after when the new player starts getting their updates.
I think it does tie it to a serialization tick coming through, but that requires you to be using OnSerialize rather than raising your own events... so I think it works if you stay inside the lines - just going to be a problem for me doing this all on a master tick @indigo current
any news on unity's own networking? I'll be evaluating bolt soon and any other suggestions people have
there's https://normcore.io/ now that looks pretty interesting
tho seems more aimed at VR
Anyone using UNET/Mirror (possible PUN2, but I haven't fully tested that) you are welcome to try my Transform and Animator sync asset Alpha. Will be a paid asset down the line, but will grandfather anyone in who tests it for me.
whats this pun2 lark about?
I've looked at bolt but I see Pun and Pun2 being things to consider now
lark?
PUN and Bolt are WAY different net models
so its really going to depend a lot on what you are making
@compact bramble PUN2 is just a newer variant of PUN1 😛
a few APIs changed, minor internal changes. It now uses inheritance instead of reflection callbacks.
So the reason to use Pun1 for new devs is....
none
right! ok so PUN2 vs Bolt, what are your unbiased views on what I should be using for this game? From monday next week til friday I have time to evaluate one networking option
Bolt is a client auth or server auth solution which uses photons cloud service to match make. PUN is only client auth.
Obviously Unity's networking is just way too soon and mlapi and mirror are basically Unet 2.0 which isn't really what I want to be relying on.
Bolt is more efficient but the documentation is complete crap and it takes a really long time to get questions answered in their discord.
IMO go with something that has better documentation and use a third party match making service.
why third party match making service?
because Bolt afaik is the only one that has it built in, using photons service.
and Bolt is more efficient than PUN2?
yes, bolt is an entirely different system
its my understanding a lot of modern networking solutions are compatible with amazon playfab (paid service, but its REALLY cheap)
I don't undertand why one should use third party match making just because "it's built in" - 'I am not clear what the negative points are
actually playfab is free too, and much more generous with pricing than photon
*Use PlayFab's platform of back-end game services to launch and run your game quickly and without hassle. The first 1,000 daily users are free. *
I looked away from bolt because I didnt like how you had to setup network objected. it felt very clunky.
also the documentation is really bad
and their support is slow.
3 big reasons to turn me away from it
If I wanted something that had server auth personally I would look at a networking solution which supported playfab (and other third party matchmaking services)
there are plenty out there better than bolt.
playfab is a platform for recording user data though for items and currency etc?
pricing was changed recently too
bolt's cloud is optional I thought? also I'm a little concerned that bolt needs to compile code
yes its optional
host migration is a concern also but apparently bolt can support it
I cant make decisions for u 😛
I'm just telling you what I know.
IMO investigate the API and browse reviews and documentation before committing. Crappy documentation can drastically slow down development cough unreal engine
cough
wonder if anyone is in the beta for that
but that probably has some sort of NDA as I think it's apply and get invite kinda thing for now
multiplay at least is battle proven solution, Unity's new integration isn't tho
@indigo current @compact bramble most (all?) negative reviews on Bolt on the asset store complain about the CCU model, the people that actually reviewed the product - i.e. what it can do, all gave it 4 or 5 stars essentially
Yeah I don't doubt it's great, seems like it does not actually need much code even.
@graceful zephyr @compact bramble You should disclose that you're a developer of Bolt fholm.
I think he tries to not over advertise that, since its not his and he doesn't really want to be asked to be tech support for it
My complaints are with the poor documentation and slow response times of support chat. While support chat is a luxury more than anything, it's not effective enough to shine out the fact Bolt documentation is meh.
He made it, but its Exit's baby now
Yeah the father must sometimes give his children whiskey (or sell them)
I was implying his opinion is biased emoititron
Technically he isn't bsing, its the most solid option on the market
but it is its own animal, with a beast learning curve if you are coming from basic Unity
That's your opinion. I won't touch a framework without solid documentation.
I don't disagree that Exit is lacking in the docs department
Just saying that having used all of them, Bolt is definitely the only one that "gets" AAA standards and practices
But being such, its not "Unity-like"
There is no Unity-like any more though TBF
which makes a shortage of great docs and walk throughs troublesome for people checking it out
for a good while now the API has been spidering in all sorts of directions...
Unity-like is changing with DOTS anyway
and frankly this is actually a good thing as much as I hate it, because trying to bully a solution into using a specific shape that does not suit the solution is worse.
I'm not talking about it being or not being "Unity-like".
so while I do prefer classic unity (from a few years ago) to learn from, it won't fit shapes to come because the solutions are so different.
All I said is that it has crappy documentation, and that's a fact.
for example the whole mess that's unitys collision events (OnStay etc) is purely because of the unity-ifying of it, and this limited the performance, limited what you could do with it and severely delayed many performance improvements
so if an API is different thinking we should probably just accept it.
so long as its consistent within it's own API surface
therefore if bolt is different or something else is different I'll just have to pretend I dont have a mild touch of asperger's
I mean frankly what else is there? Pun2 or Bolt vs.... .....Unet and being at the mercy of unpaid individuals
But I will keep an open mind and evaluate all options.
There's a ton of options.
Mirror and DarkRift 2 are updated iirc.
There's several more though.
You also have Forge Remastered
I will start by looking at released games made with something, I don't want to be first :'D
Also host migration is mandatory, so anything not doing that is immediately dismissed
also drop-in is mandatory as well, which makes it really quite hard to find the right one
well 1 client as host would be ideal
it's for PS4 first then 6 months later I can port elsewhere (prob to xbox)
gotcha
PC is last market I will touch
how much bandwidth do you need? does networked stuff have to be really precise?
so yeah I forgot - it's mandatory it works on psn
it's melee combat and platforming
collision can be resolved by host or client in inaccurate ways just fine
how secure it is, is not that important
how many players per room?
8 would be maximum I think. Planning for stable 4
PUN would probably be fine. If you want something more performant though search elsewhere.
very little needs rotations synched for example just positions and messages would suffice
If you want a lower data usage PUN I make stuff for that, there are plenty of options for crushing down data usage
https://github.com/emotitron/Simple-Network-Sync
That's literally the thing I am alpha testing right now, which is a replacement for my previous thing that does that.
PUN uses onphotonserializeview for transform data. Just turn down the serialization rate and use photon transform view classic and set to estimated speed
works pretty good
Bolt would be perfect if it had proper host migration built in . As I undertstand it there is a sort of hack in the samples though
you can also bump up how many packets each player can send. since there will be so few that probably wont hurt
bolt doesnt offer master client hand off?
Bolt based games have higher latency too
bolt doesnt offer master client hand off?
bolt is supposed to use less bandwidth... hows that possible
I'm just reading the docs
link plz
Photon Unity Networking framework for realtime multiplayer games and applications with no punchthrough issues. Export to all Unity supported platforms, no matter what Unity license you have!
however I imagine such a list should be regenerated each time a client comes or goes
PUN isn't server auth
Oh you mean bolt
if you use bolt with a relay, that I would not recommend
you would want to avoid the relay with Bolt and host on a reachable server
you still pay for CCU to Exit Games on bolt tho, even if you bypass their services
The relay environment really calls for client auth
But if you're using server auth you might as well not use bolt because there are better options.
not for the price, because a relay server hop for server auth is a LOT of internet to go through
IMO if you want ease and you're okay with client auth use PUN. Otherwise just use something better/cheaper and link up to playfab
You can;t pick between Bolt and PUN without actually have your game arch decided
they aren't even somewhat related
The no master hand off is not great either for Bolt
Your game arch will demand one or the other
What are you even making? @compact bramble
and do you have a team for this? Because the elephant in the room is if this is your first networking adventure... its going to end in failure. I would do some tutorials and fake projects before even going down any of these paths.
one thing I'm pretty excited to see is Epic Online Services, it's not there yet tho but they plan Unity SDK for it as well
it's basically steamworks like framework that also supports crossplatform
where latter is the main reason I want to see that happen
@indigo current no it does not go through the master client and other players
it uses the cloud relay to punch directly to the clients, the relay is ONLY used as a fallback incase of a punch failing, and assuming you're hosting dedicated servers... the punch never fails (obviously)
@compact bramble fyi if psn and xbox live are mandatory then you're basically stuck with the photon products as they are the only ones that have validation and are authorized by Sony and MS
Smartfox might be also
But mirror, mlapi, etc. Are not
I don't really have a horse in this race, yes I made bolt but exit games owns it and I don't have any monetary benefit or interests in it
I try to be as unbiased as possible when it comes to recommending networking libs, and have recommended mirror to a bunch of people
If you're looking to connect using psn and live sockets then you need bolt pro (which can do this) or you need to create your own linking layer for them for mirror/mlapi etc
The status of the bolt documentation I don't really know, as I've been working on quantum the past few years and other people do the maintenance and updates of bolt now a days
@graceful zephyr thanks for advice! looks like bolt pro is required then!
@compact bramble you can of course use bolt free with its relay/punch facility on those platforms also
But if you specifically want to use psn sockets and xbox live sockets you have a use bolt pro
To my knowledge no other net lib has built in support for either psn or xbox live
I'm not sure what sockets are - didn't read much about it on dev net - I assumed at that point it was all handled by unity (how wrong I was)
But I could be wrong, was a while since I checked
bolt pro is same as bolt but just sockety stuff added?
Yes
Sounds great, I can pay for that by driving half the unity forums at bolt I guess :D