#archived-networking

1 messages ยท Page 81 of 1

graceful zephyr
#

Mirror/Photon

shy granite
#

๐Ÿ‘† that question/answer should be pinned and always visible for everyone ๐Ÿ˜›

#

what kind of networking solution do you think Clash Royale uses? at first I thought it was some kind of lockstep but in the end I am thinking it is lightweight client (only input and view) and a server processing all the simulation and sending the game state (or delta gamestate) all the time

#

does that make sense? I mean, there is not a lot of data to send, so it might end up with 100KB/s (or less, I did quick math without thinking about compression or sending only delta) for the server upload, and for each client half of that

#

downloading a stream of ~50KB/s in a phone with mobile connection doesn't seem too much right?

#

am I missing something, would love to a professional opinion

slim ridge
#

is the game realtime or turn based?

shy granite
#

real time

slim ridge
#

50 is too much

shy granite
#

clash royale from supercell

#

it is about 3MB per minute streaming

slim ridge
#

i guess their laziness costs their users data ๐Ÿคท

shy granite
#

it is a lot lot less than watching a youtube video or netflix in your phone

#

no no, I am speculating

#

well, at least they save a lot of cpu => battery (it is a phone/tablet game) if they do that well (they might be using less data, like sending only deltas and not all the frames, I calculated a worst case)

slim ridge
#

you should check it and see ๐Ÿ˜„

shy granite
#

not a bad idea now that you say it

jade glacier
#

That type of game being a card game I think would be more another candidate for a cloud server turn based arragement

shy granite
#

it is not a card game

gleaming prawn
#

Clash Royale can be done with server-based lockstep (but they probably use a lot of copy-paste from rpevious projects in SC)

#

I know Lego Star Wars battles (which has very similar mechanics) uses Photon Quantum...

#

Which is server-based deterministic predict rollback...

jade glacier
#

Is it realtime? I never played it

gleaming prawn
#

yes, both are realtime games

#

you place cards,

jade glacier
#

Oh yeah, that is right - I recall it now

gleaming prawn
#

but in both the combat is RT, path finding, a bit like a tiny tower defense / tactical / strategy

graceful zephyr
#

whops i was scrolled up lol

jade glacier
#

yeah, its like a realtime card game right?

gleaming prawn
#

yep, both

#

"card game" for placing the units, yes

#

And the meta game is done around these card-units (at least in LSWB)

shy granite
#

thanks!

jade glacier
#

There was a question in the photon discord about that type of game and Quantum, not sure if it was the same person with a different name though.

#

The question being how do you deal with the database stuff like the players card collection. Does that require a server to validate the card collection? @gleaming prawn

#

Or in other words, how do you introduce 3rd party database information into the simulation?

gleaming prawn
#

you can intercept all inputs with quantum server plugin, yes, that's the best approach... But the deck building itself can also be done on server

#

There are a few different ways to guarantee 100% deck-safety

jade glacier
#

Ah yeah, forgot that a server plugin is still an option with Quantum

#

I would think that the player would get a token from the database for their collection before they join, and the relay plugin propagating that to all would be the shortest path.

#

Or more, the relay using the token to get the card data, and then replicating that out.

#

I guess two a player could join, but not be allowed to play until all players have successfully pulled the card data for the new player. Late joiners in this type of game aren't a think but I can see some game types where late joiners might come with "stuff"

gleaming prawn
#

I would not go for the last approach

slim ridge
#

photon doesnt have a data solution?

jade glacier
#

What's the most common solution to the problem of players bringing "stuff" to a game that requires database confirmation that its valid?

gleaming prawn
#

Photon does not handle player profile data

slim ridge
#

dont let players bring stuff.

jade glacier
#

Nope, photon is all realtime stuff only

gleaming prawn
#

For thay you use Playfab, etc

#

It's straightforward to integrate playfab, etc...

shy granite
#

ok, just played a match of clash royale, ~1 minute of game, consumed like a total of ~170KB (checking android data consumption)

gleaming prawn
#

that seems to be the goto solution for most of our customers (for that set of services)

jade glacier
#

I am just curious now how asyncronous stuff like that gets introduced into Quantum, since its not a player input.

gleaming prawn
#

ok, played a game, ~1 minute of game, consumed like a total of ~170KB (checking android data consumption)
Clash Roayle or LSWB?

#

I am just curious now how asyncronous stuff like that gets introduced into Quantum, since its not a player input.
SendPlayerData...:) Fully interceptable on server

graceful zephyr
#

you cant check bandwidth usage of a game by looking at data consumption in android phone

#

u need to measure it properly

gleaming prawn
#

that could include all sorts of analytics, etc

graceful zephyr
#

ye

#

or updates from app store

#

or w/e

#

email pulses, etc.

gleaming prawn
#

There's a lot of shit in background like post-notifications, etc

graceful zephyr
#

anything

gleaming prawn
#

Spying, spywares

jade glacier
#

And the server would verify the validity of that "stuff" @gleaming prawn I assume then a token or checksum is used against the database before the relay server flags it as a valid input?

shy granite
#

no no, there is an app data usage

#

separated per app

gleaming prawn
#

And the server would verify the validity
You can actually have the server send that for the player in question

#

Is it Clash Royale @shy granite ?

shy granite
#

I know there is a lot of other data from the app, but at least it is less than ~170KB in a minute game

gleaming prawn
#

or LSWB?

jade glacier
#

That is what I would have expected, that the player just gets a token, and then the server is the one that pulls the data from that token, and turns that into an input for the sim. @gleaming prawn I think I mostly get what you have going on.

shy granite
#

clash royale, updated my message with that info

gleaming prawn
#

oh, sorry

#

so, arouns 2.5KBps for a 2-player game... That's about right

#

Could either be lockstep or even an ok state transfer, the game is quite easy on network transfer

#

2.5KBps is probably even mostly overhead, not even actual commands/state

shy granite
#

I was expecting more for state transfer but my previous calculations were super naive (not considering a lot of techniques to reduce data transfer)

gleaming prawn
#

It MAY be lockstep

#

But I can't know for sure

#

I'd personally do a game like that with lockstep...:)

shy granite
#

yep, the only thing that keep me wondering is that the game runs pretty well on really old phones (but might be super well optimized)

gleaming prawn
#

Combined with server-validated commands

shy granite
#

so I was expecting no simulation on phone

gleaming prawn
#

That game is SOOOO simple, lol

shy granite
#

only input, view and particles/sfx/etc

#

yeah, indeed

gleaming prawn
#

Nah

#

That game is nothing in terms of sim

#

Compared to has is being done even with deterministic predict/rollback with quantum

#

A toaster can run a full simulation of a game like that

#

The bottleneck is 100% the rendering

shy granite
#

but in an old phone?

gleaming prawn
#

old phone >>>>>>>> toaster

jade glacier
#

Rendering costs don't increase due to resims

#

rendering is a fixed cost based on framerate

gleaming prawn
#

but still it#s normally the most costly part (by far)

#

And in a game like Clash Roayle, the sim cost is very very small

#

really, you are talking about something between 0.01ms or 0.1ms (considering they do a smart waypoint based path finding)

#

for a cheap phone, single thread

shy granite
#

yeah, it even seems to run at low fps

#

well, I wanted to say sim time yeah

#

not fps

gleaming prawn
#

I'd run the sim at around 10-20fps, interpolating view

jade glacier
#

I would think a super slow frame rate could benefit as well, allowing you to put off resimulation a bit longer, allowing more updates to arrive in time.

gleaming prawn
#

Honestly, that's one of the easiest gameplays to implement using either lockstep or predict rollback... (polishing and balancing and meta is another story, so it's never easy to FINISH/Release a game)

#

allowing more updates to arrive in time.
Just use a bit of input delay, even in rollback mode...:)

jade glacier
#

True, a game like that doesn't need the snappiest interactions. Easy to cheat user feedback without actually starting the effect.

#

The user sees the card drag on and do some particle effect... they know their input registered.

shy granite
#

yeah, even actions are always delayed, like a design decision

#

deploying units in the field has always a duration (not sure if fixed for all units or it depends on the unit/action)

#

so you can show that immediately in the client as soon as the player executed the action

jade glacier
#

The main driver of that delay is that determinism relies on extrapolation... and extrapolation can make a real mess of things.

#

So buying user updates some time to get to the client reduces the need for resims... which is easier on the CPU and also avoids visual artifacts of cleaning up the bad guesses.

gleaming prawn
#

Determinism does NOT have to rely.on extrapolation....:)

jade glacier
#

Doesn't have to of course, but one of the big perks is letting the player exist in the present.

#

I guess that is another question, how many titles make use of interpolation or some mix of interp/extrap?

#

Introducing the input latency, I can see the interpolation side having benefits, since you are interpolating your own player as well.

shy granite
#

I believe this one only does some visual interpolation for fast moving objects (or all objects) in the client side

jade glacier
#

There is always that kind of interpolation... in Update you are lerping between states

#

This is more the question of whether those states themselves are extrapolated

#

The system will I assume extrapolate whenever the buffer goes empty

gleaming prawn
#

Extrapolation just makes sense, and it's the opposite of mess when it comes.to physics

#

It's actually just better than the other option

#

I hunk you guys are messing apples with oranges

jade glacier
#

There are two things being discussed

shy granite
#

or apples with googles .....

#

sorry

gleaming prawn
#

The use of extrapolation (whereas via input prediction + rollback or in state transfers) Vs interpolation (can be done in quantum the same way as the other, default for stuff like ue) has more.to do with the gameplay

#

You use whatever makes your game look/feel better for the player

jade glacier
#

I was more just talking to what happens in the case of buffer underrun, not so much the lerping of rendering in Update

gleaming prawn
#

The networking should (ideally) not impose one or another... Quantum certainly does not

#

Exception cases look bad in any game...

jade glacier
#

A buffer underrun has to produce some kind of extrapolation, so my understanding is input latency and other tricks exist in Quantum to try and avoid that situation as much as possible

gleaming prawn
#

So if you have a sudden network loss with 0.5s without data, no matter the architecture, it will look strange

jade glacier
#

For sure

gleaming prawn
#

Buffer underrun, there are different ways to treat that, but they are as I said, the exception... You do not design the whole game experience thinking of that

#

You design the game to look right, in the correct condition window (and design a decent enough graceful degradation otherwise)

jade glacier
#

That part is news to me. I figured to get the player into the present quite a bit of extrapolation and resim were always dancing around doing their best.

gleaming prawn
#

One way to treat buffer underrun is rollbacks, sure, but again again, this does not impose at all whereas you should extrapolate or interpolate

#

Thinking it does is just wrong

#

The right condition window is quite flexible and configurable

jade glacier
#

I don't think I was confusing that. You can't interpolate your way through buffer underrun

#

underrun = extrapolation of some kind

gleaming prawn
#

But a sudden loss of data for a full 0.5s is pretty bad...

#

Interpolating by definition = seeing the past

#

So you can definitely design your interpolation to do just that (protect agains underrun)

jade glacier
#

My understanding was that the common usage of determinism like Quantum is to ride that edge, and let small amounts of extrapolation occur and let the resims clean things up before they get too ugly.

#

I get that that isn't hard coded, and is a choice

gleaming prawn
#

That's one of the reasons, yes

jade glacier
#

I just know that fully relying on input lag isn't ideal either

gleaming prawn
#

But it's far from the only or even major one since we started almost 4 years ago

jade glacier
#

since that puts you in the same world as state trasfer server authority without client prediction

gleaming prawn
#

Yes, and there are cases that's good...:)

still pier
#

Hi currently I have a lobby with a username input field. How do I save this username so it can be used in the main game? I am using Mirror as my networking solution

jade glacier
#

I would assume that the game devs just have to play with that balance and decide where the tradeoffs feel the best.

gleaming prawn
#

Yes

jade glacier
#

Technically you can even expose that to the player as an option I assume as well

gleaming prawn
#

The benefits from determinism are far more than just extrapolation

jade glacier
#

Since there is no advantage taken or giving by playing with that balance

#

Of course, didn't mean that if that is what it sounded like.

#

That isn't the determinism even allowing for that, that is just having your inputs on a tick. Non-determnistic engines can also do that if written with stateless physics.

gleaming prawn
#

As I said, extrapolation Vs interpolation is another (independent) variable...

#

Predict rollback determinism just does both easily (and does not rely at all in either - the view is the thing that relies one one or another, and regardless of the underlying sim approach)

#

Certain netcode tools are tied to interpolation (but technically the reason not to extrapolate is sometimes practical and visual, not that it's not possible)

jade glacier
#

Where interpolation gets weird for me to understand is how the shot rewind and such play in in a deterministic sim. I guess every client agrees on how much to rewind for a shot. Unless I am messing up the timing involved in my head.

gleaming prawn
#

That's one way of doing it..
But a bit more complicated than that underneath

jade glacier
#

I can imagine, since everyoe has to agree on how much they disagreed ๐Ÿ™‚

gleaming prawn
#

But you are already specifying one kind of gameplay

#

One that pushes for interpolation

jade glacier
#

Yeah, this example is a FPS shooter

gleaming prawn
#

There are many other kinds of gameplay where you could interpolate views, and still not need controlled rewinded shora

#

Shots

#

Why you guys only think about violent games? Lol

jade glacier
#

I just always think about the edge cases where things break, and that is one that seems like it would test the limits of quantum

gleaming prawn
#

FPS shooter is pretty much THE gameplay that pushes for interpolation + favor the shooter mechanics

jade glacier
#

Solving those, helps explain the system

gleaming prawn
#

And pretty much the only one

#

But it's not rocket science, just determinism science

jade glacier
#

of course... but I am not going to ask you how to do the obvious easy stuff.

#

I am curious how you guys are tackling the tricky edge cases.

gleaming prawn
#

We don't say how we do the internals... It's just mayonese left in the sun, you know (some very expert dude said here once)

jade glacier
#

I can and should just ask those kinds of things in Slack. Though really I should just be coding right now.

#

I need to finish my stuff before your stuff completely invalidates it ๐Ÿ˜›

gleaming prawn
#

I thought you had it already done

#

Just adding more stuff and fixes

#

See the differences (publicly stated in our docs) between quantum 1 and 2

#

Always nicer to have something smaller but production ready than something too ambitious that's never in working condition...

#

Then you build the next one...:)

jade glacier
#

I mostly have been working on Pun2 improvements, many of which have led to me being able to refactor SNS do to things how I wanted to do them originally (like handling ownership transfers on the tick engine)... So I mostly just had to tear it apart and make it all work with some very different timings.

I've largely been moving parts of my lib into Pun2. Like the bitpacking stuff and syncvar packing and such.

#

It is a constant struggle, because since its not out of beta, I can do massive refactoring still that I won't when its used more. But that does keep me in a spiral of refactoring.

Though really that isn't the hold up, it is mostly just that once I joined I get sidetracked helping Tobi modernize Pun2 a bit.

craggy bear
#

I read, that when instantiating objects with Photon, it's internally using Pools. What does it mean? Does it implement object pools and I don't need to worry about them (in order to prevent resources allocation in runtime)?

jade glacier
#

It doesn't automatically pull from a pool, but it uses an interface set up to make it easier to incorporate polling if I recall. @craggy bear

spring yoke
#

I'm new to unity networking and all the tutorials i watch have me add a network manager component but for me that doesn't exist has something changed or am i missing something

slim ridge
#

unity "deprecated" it.
you're looking for Mirror or Pun2 tutorials probably

spring yoke
#

oh thanks

frosty crystal
#

Hello. Does learning mysql pushes people forward? Or is this an unnecessary to have skill.

#

When companies hire people, Is this a thing that can be benefit.

#

Talking about a unity developer

gleaming prawn
#

MySQL ir sql in general is good to understand always, but mostly for backend programming and web

#

For unity itself, I never look for SQL background... I want solid C and C# foundations... But that's me

#

Btw, wrong type of networking... No idea why you asked this question in this channel

mellow beacon
#

Mysql is very very common, learn the basics at the least

#

but its more often a web/erp/crm/ecommerce use case

frosty crystal
#

I am in a gaming school as intern. I have been offered to attend any lessons that I want. I have some opportunities such as c++, database,motion captures,animation,consepts art, 3d generalization. I want to learn something that they can help me in my career.

#

I do not know what to do would you please say something about that.

#

My ultimate goal is to become an XR AR developer

mellow beacon
#

If you want to be a programmer you should learn it

frosty crystal
#

If you want to be a programmer you should learn it
@mellow beacon what about the others. Should a programmer know how to write shader?

#

Or how much knowlede do I have to learn about motion captures or etc. basic levels are enough?

mellow beacon
#

There is a lot of stuff to learn

frosty crystal
#

Pone, you are right I will write all the lectures. If you were me, what would you prefer to learn?

mellow beacon
#

i don't know you

#

so i don't know

frosty crystal
#

Animation, Motion Graphics & Portfolyo, C++, 3D arts, Consept Art, Mocap, Maths, System Thinking, Game Engine Arch.

#

i don't know you
@mellow beacon I see. My goal is to become a good unity developer so I can catch the AR and XR things.

#

If you were me what would you do mr. @gleaming prawn and @mellow beacon and the other masters?
I have intetmediate C# knowledge

mellow beacon
#

You are looking into heavy programming

gleaming prawn
#

My ultimate goal is to become an XR AR developer
That's your answer

#

Just get into all programming classes you can, and don't waste time with mambo jambo, just sit down and program

#

College itself is not even necessary (I do have a PhD in CS, but still agree college is not necessary)

weak plinth
#

I wanted to go for an MS CS but mainly just for the specialized topics

mellow beacon
#

c++ for sure, c# of course, shaders yes but probably can get away with doing most stuff with shadergraph, networking is good to have, basics of 3d modeling/animation and a bit of database

#

having and introduction of those classes is not a bad idea but ar/xr and games in general is mostly programming

frosty crystal
#

College itself is not even necessary (I do have a PhD in CS, but still agree college is not necessary)
@gleaming prawn Yes I agree but as a non eneneer, I can say that I have lots of holes in my knowledge. People who do that, must be powerfull.

mellow beacon
#

if you can't code and have a good understanding of how things works you will be very limited

#

and don't forget math

#

very very important

gleaming prawn
#

I think this is absolutely OFF TOPIC for the channel anyway

#

Not even sure where to

mellow beacon
#

yes

frosty crystal
#

c++ for sure, c# of course, shaders yes but probably can get away with doing most stuff with shadergraph, networking is good to have, basics of 3d modeling/animation and a bit of database
@mellow beacon I will do my best thanks!

gleaming prawn
#

This channel is about multiplayer networking code practices and tech

frosty crystal
#

I think this is absolutely OFF TOPIC for the channel anyway
@gleaming prawn Ok. thanks for your patience

gleaming prawn
#

Yw

frosty crystal
#

and answers

gleaming prawn
#

The topic is not bad, just not for here...:)

frosty crystal
#

๐Ÿ™‚ you are right. I thought it may be count as multiplayer but ๐Ÿ™‚

gleaming prawn
#

you did not ask any question about multiplayer tech (mysql is a database, not really related - maybe loosely if you had asked questions about player profile storage and management)

severe mountain
#

How do I make the room get destroyed and everyone leaves the room? Using the Phonon PUN.

frosty crystal
#

you did not ask any question about multiplayer tech (mysql is a database, not really related - maybe loosely if you had asked questions about player profile storage and management)
@gleaming prawn I have just came from database class ๐Ÿ™‚ haha How did not you know? ๐Ÿ™‚ sorry embarrassing ๐Ÿ™‚

gleaming prawn
#

How do I make the room get destroyed and everyone leaves the room? Using the Phonon PUN.
Have them all disconnect (or from the server with a photon server plugin - requires an enterprise plan)

severe mountain
#

rip okay

#

Also, I do leave room for the player then load a scene back to main lobby and it teleports there for a split second then teleports back to the game, how do i fix this?

#

I though it was because the player didnt leave the room but i put leave room before PhotonNetwork.LoadScene() and it still doesnt fix it.

gleaming prawn
#

I'm not an expert in PUN, sorry...

severe mountain
#

All good.

gleaming prawn
#

But I assume you should only load the menu scene AFTER you receive the disconnected (or LeftRoom) callback for your own player...

#

Then you load a menu scene with Unity itself (not with PhotonNetwork.Load - that is for when you are inside a room)

#

AFAIK

stiff ridge
#

Maybe the TransformView has some old "network value" stored and lerps you from there to the new value

severe mountain
#

Ah okay.

#

Because after i left the room i did PhotonNetwork.LoadScene

#

But i tried Load scene without disconnecting and it still did the same thing

stiff ridge
#

The TransformView is quite simple and does not know about the change of scene (normally it's destroyed on load).
You can copy and paste the code to a new class, then modify it to become aware of the "hard reset".

#

That way, you don't lose the changes on next update.

severe mountain
#

As in the transform view script that is applied to a player object to get its position, rotation and scale replicated across all clients?

severe mountain
#

Nevermind fixed it, just had to leave and load scene using scene management, not the proton network.

kind knoll
#

Hey All,
Need some help to solve problem related to photon
I am trying to instantiate bots after all real players instantiate in Scene.
I used RPC to run bots instantiation code with Masterclient and then syncing it to other clients. But it is not working properly. All clients do not have the same bots . I want same bots to be instantiated on all clients.

What is the right way to this?

vagrant marten
#
    {
        TcpClient tcpClient = tcpListener.EndAcceptTcpClient(_result);
        int myID = i;
        ++i;
        Debug.Log($"New client connected : \n   id -> {myID}\n   ip -> {tcpClient.Client.RemoteEndPoint.ToString()}");

        //PROBLEM : THIS THREAD IS NOT EXECUTING FROM THE 2nd CLIENT (but it does for the first)
        Thread thread = new Thread(new ThreadStart(() =>
        {
            //things happening
        }));

        thread.Start();
        tcpListener.BeginAcceptTcpClient(TcpCallback, null);
        Debug.Log($"Waiting for connexion on port {port}...");
    }

pls help I really don't get it. might be due to the static property of the function

vagrant marten
#

Hey All,
Need some help to solve problem related to photon
I am trying to instantiate bots after all real players instantiate in Scene.
I used RPC to run bots instantiation code with Masterclient and then syncing it to other clients. But it is not working properly. All clients do not have the same bots . I want same bots to be instantiated on all clients.

What is the right way to this?
@kind knoll one of the right ways is to spawn bots on one the clients or the server if it is server-based, and then send infos to other clients about the instantiated bots. This is how you operate synchronisation

jade glacier
#

I would just spawn them as room objects, the master would then be the controller.

#

There is no server-based in Pun2 unless you are writing a server plugin

#

@kind knoll

severe mountain
#

How do I get everyone to run specific code if something happens on one of the clients? (Photon PUN)

spring yoke
#

I'm been watching unity multiplayer mirror tutorials but lots of the things like network behavior and has authority don't work for me and every tutorial dose the same thing and none of them work for me what am I doing wrong

hard kernel
#

anyone here have experience with the Unity.WebRTC package? I have a working webrtc connection between my browser and Unity client with working data channels and everything but mediastreamtracks are giving me issues

spring yoke
#

Is there a good multiplayer api that I can use for lan and dedicated servers or will I need to make it myself

vapid leaf
#

I have several questions about steamworks multiplayer

spring crane
#

@spring yoke I think you are going to struggle if you can't sort out the basics of Mirror. Did you check their examples?

azure crown
#

What network solution should I use for a battlefiel style fps?

azure crown
#

something along the lines of 64 players (32v32 in a team deathmatch)

graceful zephyr
#

nothing that will do that by default for unity

#

at least not well

azure crown
#

Very well, what do you suggest then?

#

would Photon Pun 2 work well?

#

ei voida

stiff ridge
#

The number of players in one game is the problem here.
PUN 2 will not handle this good enough. It's too simple.

#

If you lower your expectations about the player count, you can give Photon Bolt a go. It supports FPS well.

azure crown
#

Understood, Thanks!

frosty crystal
#

Hello. OnConnectedToMaster has super lag. It takes 10 second to be called. Why? My region is eu;

stiff ridge
#

Assuming this is Photon. Can not reproduce this. Maybe the client is pining the best regions? Or did you set a fixed one?

jade glacier
#

Is there an address that he can just ping outside of unity just to see if the internet is being garbage today for him?

hard oasis
#

How do I get everyone to run specific code if something happens on one of the clients? (Photon PUN)
@severe mountain rpcs

worn dome
#

Does anyone know how should interpolation be handled for smooth visuals? Are there some common techniques (e.g. smoothing linearly over last 3 frames)?

#

Should i use the same interpolation technique for entity interpolation as well as correcting error from client mispredictions?

shy granite
worn dome
#

that article doesnt go in depth on different interpolation techniques, it seems to be only lerping the last 2 frames

#

im wondering whether there are some more advanced techniques, like using speed, or maybe lerping differently

#

like maybe instead of lerping on last 2 frames, an alternative is to lerp based on -50ms from current frame (which is what the source engine seems to do (?))

digital girder
#

@hard oasis i also have same question. Can anyone help us?

digital girder
#

how do i set the interactable of the buttons for players differently?

gleaming prawn
#

@worn dome first thing is... By frame you mean a server controlled tick? If your simulation is based on a synchronized clock, with a server defined tick rate, then it's all easier....

#

If you are referring to rendering frames loosely in each game client, no technique matters, it will always look spongy and out of control

#

If it's tick based, then normally you try to keep a buffer of server tick confirmations (with positions for example, of other players characters), and interpolate with a variable timer.

#

You smoothly try to keep this timer/interpolation factor just enough to be 1 tick behind the guaranteed server confirmation (accounting for jitter)

#

That's it in short...

#

For local characters, ideal is to predict and rollback (non deterministically, not related to that other concept) so you get fast movement... Then you store the buffer of the local player predicted positions and inputs (all tick based). If any confirmed server position is different enough, rollback to the tick (local character), and reapply inputs to fix...

#

That's a summary of interpolated server positions (for remote characters) + client side prediction (for locals).

#

That's what photon bolt implements for you, for example... + Lag compensated raycasts, delta compression, etc

digital girder
#

Hello All ! Am working in a two player game where UI elements are same. Whereas, if certain conditions are satisfied for one player then he can access the UI elements like he can click on buttons else the button should not e interactable? How can i achieve this?

frosty crystal
#

Assuming this is Photon. Can not reproduce this. Maybe the client is pining the best regions? Or did you set a fixed one?
@stiff ridge sorry for the late answer but, At the university, I have this problem, when I get home it works. I mean if it was related with university's internet?

stiff ridge
#

I can't say what exactly happens at your university network. It may block the pining. Completely or in parts.

#

In doubt, you may have to talk to someone who's responsible for the network there.

worn dome
#

@gleaming prawn ahh i see, that makes a lot of sense. Just to make sure, when you say synchronized clock, do you mean having the client synchronized to the server's clock? If server is on frame 50, the client would need to infer that from the RTT received?

gleaming prawn
#

exactly

#

that helps everything

worn dome
#

oh nice, any resources on how to get an accurate clock that doesnt fluctuate when theres extra latency / packet loss? Need to damp it somehow?

gleaming prawn
#

smooth the syncing...

#

It took us a lot of work to get it smooth, so not sure it there are lots of resources, sorry

worn dome
#

ook, thanks for the help!

gleaming prawn
#

by smooth the syncing I mean:

  • do not immediately apply the new tick clock + RTT/2...
#
  • do the above server_clock + RTT/2, but smooth the RTT...:)
#

Something on those lines...

#

It's tricky to get it good, but with a lot of experimentation you get it

worn dome
#

hmm, so for starters, itd be something like a moving average of say the last 10 received RTT/2?

gleaming prawn
#

That's a good start, yes

worn dome
#

ook gotcha

gleaming prawn
#

btw: good to give suggestions to someone who seems to understand them...:)

hexed pumice
#

hello i know that unet is deprecated but i have a question is it free now?

gleaming prawn
#

It's always been free, now it's just dead...

#

You have mirror, which is an open source evolved version. Use that instead if you like the unet ideas/approach.

honest spindle
#

@gleaming prawn @worn dome is your discussion about networking code theory in general, or specific to any library? I was about to ask about a situation seemingly fairly similar, but with regard to DOTS Netcode and what I should expect out of the box (in its current state) vs. what I'd need to manually implement myself (smoothing of movement) as I'm seeing choppy frames

worn dome
#

my question was about netcode theory, im not at all familiar with how DOTS work unfortunately :/

honest spindle
#

gotcha

#

I followed (and have since expanded upon) the "Getting started" guide for Unity.Netcode, and once I make the "player object" move faster, the skips become more noticeable

#

I'm wondering if that's just expected in its current state and will be fixed library-level in the future, or if I'll need to compensate

gleaming prawn
#

It's "general" for state transfer based approaches

#

The current dots netcode library is expected to be deprecated (yes, another one)... They will start over again

#

Do not use preview packages, specially from unity...

#

Se mature software instead...

mellow beacon
#

@gleaming prawn seriously they are going to scrap it ? I thought they were working on it and building features for their battleroyale game project?

spring crane
#

You might be thinking of the wrong company ๐Ÿ˜›

gleaming prawn
#

Probably not entirely, but that package is useless for any game other than a small scale fast FPS

spring crane
#

It's pretty normal for Unity to scrap things that are early in their lifecycle. There were several input system previews before the current one.

gleaming prawn
#

It was not a bad one for that kind of game, it's fine....

#

But that would never grow to be a fully fledged netcode framework

#

There's no official wordy but it's not being uodated thelat much anymore, and it is too restrictive. Expect something totally new at some.point again

spring crane
#

I think Unity in a recent blog post mentioned that they will build something that is beyond a transport layer with some extras

gleaming prawn
#

They always promise, yes...:)

spring crane
#

Fair ๐Ÿ˜„

graceful zephyr
#

dotsnet is a joke

gleaming prawn
#

We'll, dots is not a solution as well...:)

#

Lol

spring crane
#

Welp nvm ๐Ÿ˜„

graceful zephyr
#

@gleaming prawn they are not scrapping the DOTS NetCode btw... they are just building something else/modifying it to also work for GO/MB workflow

#

but it's not being scrapped

spring crane
#

Wanna share some pointers on dotsnet?

graceful zephyr
#

@spring crane how do you mean?

gleaming prawn
#

That's what I expect when I said not entirely

#

It's not.bad in itself

spring crane
#

What issues are you seeing?

keen dune
#

Hello, anyone know how to load your account from a website. For example my username is wizardboy and i joined a server and it would say wizard boy but if someone else from that website joined and the username was "hello" their username would be "hello" in game

digital girder
#

Hello All ! Am working in a two player game where UI elements are same. Whereas, if certain conditions are satisfied for one player then he can access the UI elements like he can click on buttons else the button should not be interactable? How can i achieve this?

high night
#

client clicks button
client sends command to server

server updates states
server updates UI's via RPC
@digital girder

#

There will be a little delay on button click responses proportinal to latency
but you'll have your life easy

digital girder
#

@high night i want to show button to both players but give the intractability to either one of them

high night
#

interactablity would just be another state in server @digital girder

#

server decides who will press the button

#

server can check who pressed in command body

#

it will be no different than any other basic networking stuff, just on ui

#

client sending Commands, server executing logic and sending RPC to update views

digital girder
#

oki

#

okay*

tulip wharf
#

trying to move from PUN to PUN2. PhotonNetwork.SendMonoMessageTargets seems to be mssing... anyone aware of the replacement?

stiff ridge
#

Glad you're making the upgrade. About time ๐Ÿ™‚

tulip wharf
#

yes. thanks. i already went through the migration notes. still a bit confused.
so my PhotonNetwork.SendMonoMessageTargets.Add(this.gameObject);
will be come PhotonNetwork.AddCallbackTarget(this.gameObject);

#

is this correct?

#

@stiff ridge

stiff ridge
#

Each script can register on it's own. Complete objects are no longer registered.

tulip wharf
#

ok. but if i have to register object , then this call is valid , correct?

stiff ridge
#

Have a look at MonoBehaviourPunCallbacks. You can also inherit it and just override some of the callbacks, if you like that better. Make sure to call base.OnEnable(), if you ever override that.

#

if i have to register object , then this call is valid , correct?
The GameObject can't be registered. It must be some component that implements any of the provided Interfaces.

tulip wharf
#

got it. thanks for clarity. i think MonoBehaviourPunCallbacks is what i need. i do get the new Callbacks design though.

stiff ridge
#

Hope you are fine with it. Much much faster.

hybrid arrow
#

So I'm currently developing my own protocol on top of the already existing protocol, TCP.

This is what I'm thinking..

When the client connects, it's going to send a packet to the server with the username and password in order for the server to check whether that player exits or not, if it does exists it's going to send back a packet to the client that tried connecting saying "Successful connection". When the client receives this packet it's going to spawn the player into the game world. Once the player has spawned in, it's going to send another packet to the server saying "I'm in" which the server then will interpret as "Okay, a new client has landed in the game world, time to notify all the other already connected clients" so the server sends a packet to all of them in which they can add a new player object to their "internal" list of players.

Here is the issue.. The client that connected has no idea about the already connected clients.. How on earth do I add them to it's internal list of players?

Is this a good structure? What's a good way of notifying the connecting client that there are players already on the server?

spring crane
#

You send it the list of currently connected clients.

hybrid arrow
#

Serializing a list, hm

stray sand
#

i have an FPS game that i want to make multiplayer, but i have no idea how.
1st, which free networking solution should i use?
2nd, how the heck do i use it?

#

i've already looked at several tutorials on youtube, but either they dont work because they're old, or they arent what im looking for.

#

dm me if u want, if not ping

rare crypt
silent zinc
#

Guys i'm having problem receiving my packet, it is always filled with zeros, even if i retrieve the correct packet length, and receive the full packet, the full packet is only zeros...Why?

#

my packet structure is this: {packetLength}_{PacketId}{Data}

#

where {packetLength} is a string concatenated with '_' and encoded in utf8 bytes

#

PacketId is a single byte

#

Data is a byte[]

hybrid arrow
#

I'd check for an answer on maybe StackOverflow, most people here don't actually develop their own protocol and the ones that do will tell you about some arbitrary solution that won't really apply to what you're asking

gleaming prawn
#

Those who do either don't say anything or just advice not to write your own protocol as this is reivineting the wheel.

#

And if you insist on learning purposes, there are plenty of books and online material on how protocols are created.

#

What is more relevant to the channel are the solutions specific towards networking games... These most people here bother to answer.

#

I'll try to look at your code...

#

Not sure if I can find an obvious error though...

silent zinc
#

what's the right algorithm when receiving udp packets? I mean, i have the packet length, how can i recv the full packet? For now i'm doing this...```cs
StateObject state = new StateObject();

byte id = 0x01;
int offset = 0;
byte[] data = new byte[1];

List<byte> packet_length_bytes = new List<byte>();

while (client.Available > 0 && client.Client.Connected)
{
state.res = await client.ReceiveAsync();
state.buffer = state.res.Buffer;
for (int i = 0; i < state.buffer.Length; i++)
{
if (state.buffer[i].Equals(Convert.ToByte('_')))
{
offset = i;
break;
}
else
{ packet_length_bytes.Add(state.buffer[i]); }
}
if (offset != 0)
{
id = state.buffer[offset + 1];
int packet_length = Convert.ToInt32(Encoding.UTF8.GetString(packet_length_bytes.ToArray()));
packet_length_bytes.Clear();
data = new byte[packet_length];
int c = 0;
for (int index = offset + 2; index < packet_length; index++)
{
data[c] = state.buffer[index];
c++;
}
break;
}

}``` but right in the middle of the packet, some data get lost and replaced with 00

#

Is it worth to recv just one byte for every iteration?

gleaming prawn
#

Too many questions in one sentence

#

IMHO there are many many things wrong in this code, but I won't point them as it should be fine for now as it looks like you just want to learn a few things.

#

Try to log or debug the data in every one of the intermediate steps in this code.

silent zinc
#

ok

gleaming prawn
#

Try to print as much as possible from the full buffer, so you see exactly what it is that you received.

#

You'll probably find it...

#

As for the best way to send/receive directly with UDP? Sockets.

#

But it all depends on what is your actual goal...

silent zinc
#

I'll try, btw, is it possible to just recv 1 byte for every iteration?

#

when using UdpClient class

gleaming prawn
#

If it is to write netcode itself, I'd start with a more complete transport layer library

#

Receiving just 1 byte is ridiculously bad... It's just overhead...

silent zinc
#

oh ok

gleaming prawn
#

Just the UDP headers take 80bytes... The common practice is to fill UDP datagrams with 900 to 1000 bytes, trying to never pass 1200 bytes including the headers

#

Because > 1200 it is common for cheap routers to cause UDP fragmentation, which is bad for performance

#

1 byte, no, just don't

silent zinc
#

XD

grizzled narwhal
#

I am currently using velocity for movement but was thinking that fixed step movement might be better (feels better) and it would probably help with resimulation?

#

Any pros and cons?

gleaming prawn
#

As long as it is tick based and you store the buffer(data + inputs) for resimulations, either is the same

prisma hollow
#

I'm thinking of learning networking. What tools/tutorials would you recommend for doing so?

#

I've heard of photon and mirror

#

But I'm open to learning anything

silent zinc
#

pffff

prisma hollow
#

And ideally something good to publish with. I don't mind somewhat steeper learning curves

silent zinc
#

photon and mirror are the easy way

#

learn from docs and books

prisma hollow
#

What docs

#

Which books

silent zinc
#

sockets

#

OS

prisma hollow
#

So manual C# networking?

silent zinc
#

i recommend you take a book about internet architecture

prisma hollow
#

Recommend one?

silent zinc
#

and operative systems

#

idk, i live in italy, i used to buy italian books

#

that idk if are available abroad

prisma hollow
#

What's wrong with photon and mirror though?

#

Out of curiosity

silent zinc
#

idk, that was just a point of view

#

I'm thinking of learning networking. What tools/tutorials would you recommend for doing so?
@prisma hollow If you want to learn networking, start by creating even a dummy Application protocol by your own

prisma hollow
#

I don't mind more of a learning curve, but I also don't see the need to go into depth when all I want to do is make a game. I see it as learning how to assemble a computer by figuring out how the CPU architecture works.

#

I'd love to be proved wrong though

silent zinc
#

when u want to assemble a computer, you want to distinguish what is right to do, or not, same in networking, ofc you can use the highest level class that works well, and if your goal is to make a game with poor packet customization, then you're good to go with those options in the asset store, but i personally think that the best way to learn is to get your hands dirty on the low level, understanding how things works, and what is wrong to do and what is right ๐Ÿ™‚

weak plinth
#

st3ve what is this

int packet_length = Convert.ToInt32(Encoding.UTF8.GetString(packet_length_bytes.ToArray()));
silent zinc
#

packet_length is encoded in utf8 bytes

prisma hollow
#

when u want to assemble a computer, you want to distinguish what is right to do, or not, same in networking, ofc you can use the highest level class that works well, and if your goal is to make a game with poor packet customization, then you're good to go with those options in the asset store, but i personally think that the best way to learn is to get your hands dirty on the low level, understanding how things works, and what is wrong to do and what is right ๐Ÿ™‚
I see. I'm not sure what you mean by packed customization, but I think I get what you mean

silent zinc
#

yeah

prisma hollow
#

Awesome. He seems to make a c# DGS so it seems like a decent way to go

silent zinc
#

@prisma hollow depending on your needs, you must choose between TCP and UDP for your game, that's way i recommend first studying at least the principles of those transport protocols.

prisma hollow
#

Okay. I don't know what they are, and since you say they're important I'll look into them

silent zinc
#

you could also look at TCP/IP and the OSI Reference Model to understand better the logic behind every working piece of "networking"

prisma hollow
#

Okay

#

Thanks a bunch

silent zinc
#

yw

gleaming prawn
#

@prisma hollow depends if you want to finish and publish a game or learn the very basics

#

I'm one of the developer of photon quantum, so photon is a lot more than what people typically think (the free tiers of pun and realtime)

#

In a fast paced realtime game you definitely need UDP btw.

tranquil pollen
#

Ah nice. I've been looking into PUN heavily the past few days

gleaming prawn
#

But in general, it's not what YOU prefer, but actually your game's gameplay that sort of dictates what netcode architecture you should go for.

#

Pun is easy to start, you can get a lot with it. But there's a lot more than that.

tranquil pollen
#

Is it suitable to build on top of PUN to create a server-authoritive type deployment with a headless server build acting as a master server?

gleaming prawn
#

Photon has three very different products (each with a completely differnt netcode architecture) for unity;

  • pun (client authoritative)
  • photon bolt (cliente server, with server authority)
  • photon quantum (server based deterministic predict rollback)
#

No...

#

If you want a unity instance to be a sever, start with Bolt

#

Or mirror for an open source alternative

tranquil pollen
#

bolt is server-auth? I had no idea lol If thats the case, that may be a solution.

gleaming prawn
#

Bolt is considered by many best in class

#

For traditional client server, no other tool comes.close to it's built in features... Sure there are cons and not everybody likes its API, but it's free to download and develop for.

#

So worth a try

tranquil pollen
#

You may be a life saver ๐Ÿ™‚ I think I'll give that a shot.

#

A project that's sort of up the same alley as mine uses bolt and works amazing for theirs. Provides a solid example as well to learn from for me lol

gleaming prawn
#

Pun, bolt and mirror are the most popular of the solutions out there AFAIK. I'm not related to mirror though. They have a discord server with a good community. It's another option

#

The most famous game made with bolt is the forest

tranquil pollen
#

Yeah I seen Mirror and Telepathy but I feel like I trust photon more

gleaming prawn
#

Long time ago, bolt evolved a lot since then as well

#

If you go for bolt, join it's discord as well... Ramon Melo is the lead developer since a few years,.he's cool

tranquil pollen
#

Thank you for the helpful info ๐Ÿ™‚ Didn't expect to get info direct from one of the devs

gleaming prawn
#

I'm one of the Devs of quantum, but I know well what the other products are good for

shadow stag
#

What is Quantum good for?

gleaming prawn
#

Anything very twitchy/fast, where latency is the villain... Up to 64 players per game.

shadow stag
#

nice

gleaming prawn
#

There are certain things I'd not do with quantum, but it covers a great deal of genres well

#

Not yet at least, as our long term roadmap is ambitious...:)

weak plinth
#

Guessing long-living game servers that handle a lot of drop in/out?

gleaming prawn
#

That's fine... Quantum handles snapshot based late joins automatically for you

weak plinth
#

Dang that's been my one hangup with determinism

#

always thought you needed to store a giant buffer of inputs

gleaming prawn
#

Hmm... Nah, we do not run old fashioned 30 year old lockstep...:)

#

We have a lot more tooling than people think..:)

#

You only store the inputs for replay/validation purposes...

#

If you want... But we do not even keep full input histories on server (for memory consumption purposes). It's not needed... Late joiners get up to date snapshots, then proceed with the input stream under predict rollback

weak plinth
#

sounds interesting. any plans to support other game engines in the future? Seems like it's not heavily tied to unity

gleaming prawn
#

The tooling for storing full input stream is there turnkey for you to store match replays,.of course

#

Quantum is a gameplay.engine in itself, yes (Sparse set ECS + physics engines + navigation agents + AI SDK), however...

#

Although it is decoupled from unity in terms of gameplay API (and you can run that in our servers without unity) it's designed to run on unity for a few reasons:

  • half the value is in the seamless tooling both with the unity editor (entity prototypes, terrain/navmesh/animation exports, static physics colliders) and runtime view interpolation scripts
  • unity's runtime (il2cpp, job system, etc) are the only complete solution for running a pure C# ECS engine (like quantum) in multiple platforms without a vm
#

So, quantum is designed to work well with unity... And it should continue like this

#

We did run tests with UE, unigine, godoh, etc, but just for experimentation

#

It works, of course, but from a practical and professional point of view, it is meant to work with.unity

shadow stag
#

Since it prioritizes low latency would it be practical for a racing game with client collisions?

gleaming prawn
#

Hell yeah

#

Racing games are one of the things quantum shines at

#

Let me show you a crappy looking video

#

This is even a bit old... But this is a physics based vehicle, try to spot any issues..:)

#

I mean, that's not even a question... A car/racing game "holy grail" is deterministic collisions with accurate client predictions.

shadow stag
#

looks great

gleaming prawn
#

We have a few raving games being developed with it now... No idea when they'll be released though.

#

Racing

azure quail
#

how many raving games tho

#

quantum dance party

shadow stag
#

I've had a racing game idea for a while now but I got stuck in the physics aspect of it but if I ever start that project up again I'll keep quantum in mind.

tranquil pollen
#

I had played with one in UE4 as well and the non-deterministic physics was a nightmare

#

won't lie, was fun to see the vehicles randomly launch into the stratosphere after running over something though lol

shadow stag
#

yeah, I know exactly what you mean

gleaming prawn
#

Score, AFAIK at least 3

#

Scorr

azure quail
#

sry was bad joke

gleaming prawn
#

Lol, I knew the second part was a just ke

#

Joke

#

But I'm bad at jokes, sorry, I just work.

azure quail
#

haha

#

i've seen vr raving games tho so i guess it is a real genre

#

like dancing stuff

#

have there been any vr games made with quantum

gleaming prawn
#

Lol, now I got it

#

I saw the damm typo, and just didn't bother to fix

shadow stag
#

lots of racing games have VR support so I see no issue with VR

gleaming prawn
#

A raving game wouod be fun

#

RaVing games...

shadow stag
#

well fortnite concerts are raving games I guess.

azure quail
#

i mean games where hands are simulated as well over network, i imagine vr racing wouldn't have that

gleaming prawn
#

Lol, time to sleep

tropic creek
tranquil pollen
#

Is anyone familiar with Master Server Toolkit? https://master-toolkit.com/ Wondering if its legit. I see in the reviews of the Master Server Framework on the asset store, a user comments "Asset is not abandoned! It's still alive" and links to that above link and turns out he is the guy behind it. But then searching the github repos for both, he's not the same guy as the asset store. Anyone know what's going on there?

Master Server Toolkit is designed to kickstart your back-end server development. It contains solutions to some of the common problems.

#

It just seems suspicious because its not the same owner and this new one's repo shows a single git push 9 days ago and then nothing.

#

sorry yeah 9 days

#

Is it actually the same guy and same asset (just updated) though?

tranquil pollen
#

ooh wait I see whats going on. He updated the original to work with mirror and has a repo specific for that. The other repo I was curious about is something different

#

seems legit

spring crane
#

@tranquil pollen Pretty sure I saw him posting on #archived-works-in-progress with his game project. I believe it's being worked on alongside of his projects.

vestal valley
#

If anyone has worked with Steam's multiplayer API stuff before, I'd love some help with requesting Lobby Data, I'm just completely lost on what this means:

#

Why am I getting a char as a return and how does that help me find the data? It says it is a key for what I assume is a dictionary, but I don't know where to access that dictionary, or if it's set up by me or whatelse

craggy bear
#

Why am I getting a char as a return and how does that help me find the data? It says it is a key for what I assume is a dictionary, but I don't know where to access that dictionary, or if it's set up by me or whatelse
@vestal valley const char* is a string

#

It's not written in C#

vestal valley
#

ah

craggy bear
#

Also, pchKey is only named Key, but it's not dictionary-type Key

vestal valley
#

well I'm still pretty confused on what I am supposed to be getting?

#

I can send over the SetLobbyData method as well

craggy bear
#

I have no idea what you're trying to do, also I never worked with that, but your input is basically your steam lobby ID and some key to associate metadata with

vestal valley
#

Yeah sorry, ideally I would want to retrieve data with GetLobbyData and input a lobbyID with the type of data i need to get, and retrieve that type of data.
Now looking at it I'm starting to see how it functions...

#

You create a new object/value in the dictionary when you SetLobbyData and then can retrieve it by key later, but It's weird to me that it only accepts strings then?

craggy bear
#

Apparently your keys and values are strings.

#

They're not Dictionaries (or in this case I rather should say maps)

#

Or maybe they are internally, but it's still a map<std::string, std::string>

vestal valley
#

noob question then: what's a map?

craggy bear
#

It's C++'s dictionary

vestal valley
#

ah, okay

craggy bear
#

in that case though I'd imagine they're unordered maps, too

#

(hash maps)

vestal valley
#

Okay, I think I understand it enough to try out something tomorrow

#

I appreciate you helping me a bit :)

craggy bear
#

โค๏ธ

prisma hollow
#

So I wanted to learn networking and read up a little on TCP and UDP. From what I gather, TCP is more reliable, but slower whereas UDP is the opposite. So UDP for where latency matters and the occasional packet loss is okay, and TCP when delay is fine and getting the message across is crucial

graceful zephyr
#

@prisma hollow not correct really

prisma hollow
#

Oh

graceful zephyr
#

There is no 'speed' difference between TCP and UDP per say

prisma hollow
#

TCP has overhead in handshakes and packet error checking/fixing?

graceful zephyr
#

Difference in how they handled lost packages

  1. UDP doesn't care
  2. TCP resends the data and stalls the receiving end and resends it

Difference in how they handle connections:

  1. UDP is connection-less
  2. TCP requires a connection 'socket' on each end which is unique
prisma hollow
#

What do you mean by connection-less? And can you recommend any concrete source to read up/learn?

graceful zephyr
#

UDP doesn't have any connections at all

#

You send a packet to another IP address

#

That's it.

#

There's no connect/disconnect, etc.

#

You just send(data, targetIp, targetPort);

prisma hollow
#

Whereas with TCP?

graceful zephyr
#

TCP requires a connection to be established, first by hailing an 'accept' socket from one side to the other, which then transfers the connection to a secondary socket used for communication

#

again, kinda high level explanations but it's the gist

prisma hollow
#

Well it's high enough to go over my head

#

I'll try and figure out what sockets are

graceful zephyr
#

In general games used UDP

#

again, as a simplification

#

The only reason for that is because the difference in how lost packets are handled

#

But most games use UDP, for sure - there's cases to be made for TCP/IP also

prisma hollow
graceful zephyr
#

@prisma hollow don't learn networking from people on youtube is my first advice

prisma hollow
#

How then?

graceful zephyr
#

ยฏ_(ใƒ„)_/ยฏ

prisma hollow
#

Youtube is where I've learnt a lot of what I know, unity-wise

graceful zephyr
#

that's a decent example of networking

#

and based on well established patterns

prisma hollow
#

There's so much going on there I don't know where to start and how to look

graceful zephyr
prisma hollow
#

How did you learn networking?

graceful zephyr
#

i started learning before any good resources online

#

and then just a lot of trial and error

prisma hollow
#

Hmmm

#

Tribes? The supremely old hirez game?

graceful zephyr
#

yeah the paper is good

#

there's some old talk about halo:reach also from like 2010-ish floating around too

#

but that's it, there's some small info on the source engine developer website also around counter-strike, but it's just a few pages

#

that's all that was around give or take

prisma hollow
#

... wow

graceful zephyr
#

figured most of it out on my own, discussing with other people, etc.

prisma hollow
#

So build projects, try, fail, repeat?

graceful zephyr
#

basically

prisma hollow
#

I can't complain, that's my favourite way of doing things

graceful zephyr
#

depends on how you deep you want to go also

#

is the goal to network a game, or to learn how to do networking yourself

#

two different options

prisma hollow
#

Network a game

#

But I don't want to be that guy who knows how to make the API work but has no idea what's going on

graceful zephyr
#

for networking a game you have options like:

  1. Mirror (based on old UNET)
  2. Photon PUN (easy to use, but has no authority functionality)
  3. Photon Bolt (comes with most stuff you need, I'm the original author of this)
  4. Photon Quantum (deterministic predict/rollback, not available publicly , I'm the original inventor of this also)
  5. ... some other stuff maybe... idk ?
prisma hollow
#

Wow. You made photon? That's kinda amazing

graceful zephyr
#

I made Photon Bolt and invented the tech behind Photon Quantum

#

photon is a suite of products, i'm heavily involved in two of them

prisma hollow
#

Are there situations where server authoritative isn't the way to go?

graceful zephyr
#

absolutely

#

server authority complicates things a lot

#

but for anything casual i'd probably go w/o server authoirty

#

depending a bit on the game at hand

jade glacier
#

You can grab the SNS demo for Pun2 and see kind of the limits of client authority

prisma hollow
#

Till now my perspective has been that since a lot of games seem to use server authoritative and so learn what the big bois use

jade glacier
#

It is an extension set for Pun2 - so there is no server logic in any of it.

graceful zephyr
#

@prisma hollow Completely depends on what you're trying to make

prisma hollow
#

Atleast, I'm under that impression. I know I'm probably wrong in so many ways

graceful zephyr
#

I'm fiddling on a little 2 player co-op card-game in my spare time

#

I'm not doing authority for that

#

It's a co-op, played with friends, etc. just complicate shit, and if you want to ruin a game with your friends... go for it

jade glacier
#

If you plan to go server authority (make sure you really need and want that), there is quite a bit on the web about doing that correctly. What fholm posted for starters

prisma hollow
#

So client authority makes each client fully in control of itself, or one client as host acting as the authority?

graceful zephyr
#

And i can build an authoritative setup by heart without having to look a single detailed up... and I still wouldn't do it for a game like that

#

@prisma hollow varies really, both models work - depends on the game

jade glacier
#

Any authority model always involves deciding who is the authority of what, and many games have that mixed - even server auth games can give client authority over some things.

prisma hollow
#

I don't have any specific game in mind, but I want to learn something that can atleast work for most games, even if it's far from ideal. Then build up from there when needed

jade glacier
#

Keep in mind that a generic system is harder to make than a specific one as well, if you go into networking without a game or game type in mind... you will be making a networking engine. Not the easiest place to start.

prisma hollow
#

So I'm fine with learning any one specific system

#

I can do something like a client authoritative FPS right? Theoretically, that can function

graceful zephyr
#

@prisma hollow you can have the same code-base work for client<>client, client<>client host and client<>dedicated server

#

they are not mutually exclusive

jade glacier
#

If you are just kicking tires, I would recommend doing the Bolt tutorial. It's workflow isn't the most fun, but you can see hints of its inner-working that will make some things more clear.

graceful zephyr
#

most of the pieces are the same for all of them

prisma hollow
#

Kicking tires describes it I guess. I have a bunch of spare time in my hands, and I've been experimenting with different things to see what I can learn. So far compute shaders and basic unity jobs have been my feat

jade glacier
#

Bolt works on the simulation with a fixed time tick engine and uses bitpacking... you won't see those in other packages (other than SNS, but that is just a beta extension library)

prisma hollow
#

Bolt it is then

#

Thanks a lot

prisma hollow
#

What's the difference between Photon PUN2 and Bolt?

graceful zephyr
#

Completely different

#

PUN2 is a relay-based client-authoritative system

#

Bolt is built for client-server authority, with client-side prediction for local player, lag compensated raycasts, etc.

prisma hollow
#

What's this <> thing you do?

graceful zephyr
#

๐Ÿ˜„

prisma hollow
#

XD Got it

#

Thanks

#

So isn't pun2 better/easier to start off?

graceful zephyr
#

Depends on what game you want to build

#

If you are going for a FPS, then ... no, not really.

prisma hollow
#

Okay. Thanks

#

I'm assuming most of the theoretical aspects translate to any tool I choose?

graceful zephyr
#

-ish, depends a bit... bolt is very much : it has one way of doing things, you do it that way or not at all.

#

and those are ways i decided on when i built it

#

other tools are way more open ended usually

#

but bolt takes care of A LOT of hard stuff automatically, things you'd have to do by hand in Mirror/PUN2/etc.

prisma hollow
#

Ah

#

Aight, got it

#

Ironically enough, I found a couple tutorials I like and my favourite one uses PUN2 for an FPS

#

But I probably favour it because there's a lot more of a visual output than the others

#

And it's a bit more extensive

jade glacier
#

If you are kicking tires right now, do tutorials for all of them. Each will give you some insight into networking.

#

https://docs.google.com/document/d/1moPBIt8cNe-h1uG01pvaOZQvrIjZfSBfDmVa793X6AQ/edit#heading=h.qql6b8eo9tfa The SNS Beta stuff I am working on for Pun2 probably does a better job of things than whatever tutorial you are looking at for Pun2. If you are playing around with Pun2, I would try the SNS stuff - since it does have a tick engine and works on buffered frames. Without that, most Pun2 stuff will be a bit "mushy".

That and you can get two players running around and shooting projectiles and raycasts at one another without a line of code - so its a quicker entry. @prisma hollow It also has tick-based syncvars, where Pun2 core doesn't have syncvars at all.

It is though still Beta, but we are actively merging it into Pun2 core.

fallow elk
#

hello! i've just gotten started with networking for a project, and I decided to go with Mirror. I just have a quick question about workflow: Currently to test my game on the same computer, I have to build the game for every change I make to run it as a client (or host). Is there any way where I can test multiplayer on the same computer without having to build each time I make a change?

floral turtle
prisma hollow
#

Okay so the docs for photon bolt are amazing

smoky hearth
#

im new in the networking in unity, and i learn it from Youtube, ok i know this is bad Question but i dont know how can i fix it because my unity is 2019.4.4f last Youtubr video about networking in 3/20/2020 : i use mirror assets , i need to move my player but i cant this is my script

#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;
public class Online : NetworkBehaviour
{
    [SerializeField] private Vector3 movement = new Vector3();

    // Update is called once per frame
   
   private void Update()
    {
        if (isLocalPlayer)
        {
            if (Input.GetKey(KeyCode.Space))

                transform.Translate(movement);
        }

      
    }
}

#

i will send a video wait a minute

#

when i delete the (islocalplayer) the player move

#

when i put network behaviour it say: the network behaviour is obsolete

#

so what should i use!

#

hi i think i fix it

#

thank U U R very helpful hhhh

random pier
#

is this the correct channel for netcode questions?

jovial rapids
#

yes @random pier

random pier
#

@jovial rapids thanks. I have a question about Ghost Authoring. I want to spawn multiple actors, which would be the same archetype. How do I spawn something that is the same archetype but is unique? i.e small health pot vs large health pot

silent zinc
#

Finally! My Network System works!

west loom
#

Why is my photon multiplayer game so laggy?

#

The other player don't walk nice and cannot stand still

#

They tremble around

dense meteor
#

I have question

#

Can you make LAN game for free in unity?

gleaming prawn
#

Yes, use mirror

#

It's an open source improved version of UNet, and works well in LAN

tardy forge
#

Any good blog post or tutorial on how to architect the code when integrating with PUN2 especially when working with a team of developers.

gleaming prawn
#

That's a tough one @tardy forge . Searching here I could not find any entry interesting enough. @stiff ridge might know one though. You could also join our Discord if you want. I can PM you the invitation if needed.

tardy forge
#

thank you for helping out!

stiff ridge
#

Hmm, no, I don't know tutorials for that specific topic. I guess that general ideas for team organization also apply for networking.

jade glacier
#

@west loom You will have to give a LOT more info than that to get any help, sorry.

pliant zodiac
#

anyone have some experience with agones and unity to create multiplayer games or matching making using the Open Match from google ?

#

i'm thinking on create a social game similar to animal crossing but i'm looking on the network part of it to make some prototype what you guys think will be best to use? for a indie studio? and for the future?

west loom
#

here the movement script

#

the player moving very laggy around without animation

bronze nest
#

anyone know how to setup photon and can help me with it?

hybrid arrow
#

What's a good way of letting a client that connects to a server know that there are other people already connected. Becuase that's valuable information that the client needs in order to work with those players. Would the server send a list of all the connected players to that client? That seems pretty "heavy"

spring crane
#

If the client needs it, you send it

#

You can also consider whether it needs to know about all players. Common sense applies.

#

Really hard to say without knowing your game's design

floral turtle
#

if a client joins a session in progress, the entire world will need to be synchronized with the client (this could be a lot of data). So sending a list of player names is pretty small

verbal current
#

Hi i have a question that i cannot find any solution for it in google
I hoped you could help me
I have a game that works fine for desktop
The game have a persistent scene that reads a data.json file and then take all the questions from it into the quiz
It works very well on desktop
But when i build it for WebGl
It won't load the data.js file
I checked and it's because of security restrictions so webgl cannot read locally only from a server.
So i installed WAMP
And checked unity
And they changed from www to UnityWebRequest

So i implement UnityWebRequest
But

Here is my baffling.

Inside Unity it Works well
But when i build it it stucks
I made a boolian to switch between reading from localhost and the harddrive.
It works fine only inside unity
Any ideas how can i adress this issue?
Any help will be much appreciated.
Thank you

gleaming prawn
#

@verbal current you might ask that question in a general programming channel. This one is about multiplayer online discussions.

#

But sure,.maybe someone knows exactly what it is just by reading your description (I do not, sorry)

verbal current
#

Thx

worldly cedar
#

Simple question: Does the new networking stack require ECS/Jobs? It says its "DOTS Compatible", but not whether its DOTS exclusive

#

Also, if anyone knows of any up to date resources on learning the new networking systems, I would be grateful ๐Ÿ™‚

gleaming prawn
#

@worldly cedar originally it was coded just for ECS/dots... But AFAIK they are reworking it to also work for GO/MB workflow.

#

But no version with that is out yet... And resources are pretty much "get the sources and try it"

worldly cedar
#

Ah lovely ๐Ÿ˜› I have managed to get the Transport Layer working with GO/MB workflow, so Im running with that for time being. I dont really need most of the features available in netcode, so im going to see how I go and convert to Jobs down the road

#

Thanks for the answer ๐Ÿ™‚

gleaming prawn
#

yw

west loom
#

@jade glacier https://hatebin.com/bzzmrgqvum
@west loom didn't find a solution. But it seems that my player movement and/or animation the other is runed aswell. But just for one frame and than the other player come back to the place he belong to. Bat this cases that the other players never stand still when I move.I just dont see how I can solve it in my script

#

changing move and animation method to don't do it over rpc it made better. But now the animations are not seen at all.

worldly cedar
#

Does anyone know how to do a GetBytes from a DataStreamReader in Unity Transport? Heres what I have, its throwing an error I cant quite parse

NativeArray<byte> buffer = new NativeArray<byte>(256, Allocator.Temp);
stream.ReadBytes(buffer);
string s = System.Text.Encoding.ASCII.GetString(buffer.ToArray());
print("Text buffer: " + s);
#

Im going to try to used FixedString as a workaround, but would be nice to know how to do this ๐Ÿ™‚

worldly cedar
#

Well...it worked, but now clients are disconnecting like 30 seconds in. So much fun haha

#

nmd, it was timing out. Fixed. Apologies for spam

versed socket
#

NetCode/ECS: Following the getting started guide to netcore 0.3, I have everything working except that when I try to move the cube, it moves on the client but not on the server, in short, the server appears to not be receiving data in the DynamicBuffer of the CommandData. Does anyone know how this could happen? More details https://forum.unity.com/threads/netcode-getting-started-server-does-not-enter-foreach-of-the-ghost-movement-system.962253/

gleaming prawn
#

William, most people here gave up on using the netcode samples until it's more stable. Maybe you'll get an answer, but being realistic, the sources are the best bet really.

versed socket
#

Oof, alright thank you ๐Ÿ™‚ Thought that waiting 2 years after deprecation of UNet was enough ;_;

gleaming prawn
#

Well, I'm biased of course, but the reality is that most professional teams go for more mature solutions.

versed socket
#

I was liking the integration with ECS tho

gleaming prawn
#

You have plenty of choice outside of the internal netcode (until they finish it, if you will)

#

Ye, but ECS itself is also not stable/production ready as well

#

So you do have a lot of (good) enthusiasts working with it, but not a lot of production stuff, so no mature solutions yet

versed socket
#

Absolutely, I was mostly fiddling around trying to get a headstart on the tech

gleaming prawn
#

Ye, makes sense

#

Maybe the guys in the dots channel itself might be more responsive

versed socket
#

Kinda sad that I can't make my damn cube move when most people seem to have it working

#

I'll try it out thanks

gleaming prawn
#

They are the early adopters of the stack

versed socket
#

Otherwise, what are the current popular "mature" solution for Unity MP?

gleaming prawn
#

I'm biased, as I'm one of the developers of photon quantum (an ECS deterministic multiplayer engine integrated to unity)

versed socket
#

Well do tell :p

gleaming prawn
#

So the various photon products are among the most used ones... You also have mirror (the open source version of unet)

#

Which is popular around, but I can't say much beyond that about it

#

If you liked unet, that might be a good option, but not for ECS

#

The ECS based ones are very simplistic (except for the unity one, which is a good foundation, and hopefully will be a nice framework in the end)

versed socket
#

And Photon Quantum is integrated with DOTS?

#

Is it available yet?

gleaming prawn
#

Photon quantum was released in 2018, there are several games released with it... We are currently.in it's second version.

#

It IS an ECS (a mature API based on the sparse set memory model), it does not relies on Unity's.
We do use the job system to wrap out task system worker threads (although we have our own task graph controls, with less overhead)

#

So it uses the same concepts and approaches (so you can say quantum is a form of dots), but we do not use anything from unity's except for job system. We have our own physics engines, navmesh, math library etc. Cross platform deterministic.

versed socket
#

Interesting, so you guys develop twice as fast as Unity xD

gleaming prawn
#

We have a very specific focus

versed socket
#

Yeah makes sense, no shade on Unity I know they have a big workload

gleaming prawn
#

Not saying it is easy, it is not. But Unity has a different goal and scope, so different challenges

versed socket
#

Well, I appreciate the help, I'll look into alternative solutions until further netcode updates

#

Or just keep bashing my head until I become a vegetable

gleaming prawn
#

Yes, it all depends on your own goals

#

Unity new netcode has nice foundations, so it's a good learning step in either case

#

Depending on your goal, and the speficic gameplay you want to implement, other solutions (maybe quantum) might be always better, maybe not

versed socket
#

Honestly I just wanted to do a small multiplayer game to learn DOTS/ECS/NetCode and see if I could use it for something bigger, but for now all I really want is to learn these

#

I don't know if I'm close minded or just warry but I seem more lenient in learning Unity frameworks than 3rd party

#

Thus why I'm getting impatient to finally get a solid MP framework

gleaming prawn
#

Honestly, it might be different this time (they have a solid foundation), but their past attempts were not great

#

And you should listen to other professional in the industry (not biased me), they might have a better opinion about 3rd party solutions...:)

#

Even the foundation being good, their approach also implies a certain architecture that forces you to host engine headless instances (that for many cases might not be the most cost efficient option )

#

There are reasons why predict/rollback determinism, or even client authority, are good options.

#

So, it's always excellent to learn

versed socket
#

Yeah I'm a bit scared they will be way too restrictive in the use cases of their framework

gleaming prawn
#

But focusing on just one approach is a bit narrow IMHO

#

I think they are on a better path this time, compared.to the other attempts

versed socket
#

Basically, FPS / MOBA people were saying on the forums

#

That leaves out MMOs or larger scale player counts

gleaming prawn
#

In terms of genres and gameplay, they should cover well most cases...

#

There's Nothing out there that handles mmo out of the box

#

Mmo requires a long and complex suite of several layered solutions

#

That's out of the scope of the discussion :)

#

What I said by restrictive is more in terms of costs, as it's a solution targeted towards hosting dedicated servers (which are expensive)

versed socket
#

Yeah okay I get it, so there won't be a choice for devs but to buy cloud servers

gleaming prawn
#

Yes... That's not bad per se, it's just very specific approach.

versed socket
#

Maybe that will enable cheaper hosting solutions tho if more people start using that

gleaming prawn
#

With quantum we let you decide on a match by match basis if you want to have server simulation running, or just rely on determinism + replay validations

#

So you are not forced to use server simulation and still achieve full authority

#

Nah, cloud hosting with VMS is fully consolidated since a log time

#

If hosting becomes cheaper, our solution becomes even more cheaper (at scale).

#

There's no silver bullet in the end.

#

There are use cases where their approach is recommended in either case... It's important to have options IMHO

versed socket
#

Yeah okay makes sense

#

I don't know enough about Networking to understand all that yet

heady helm
#

Just curious but is it possible to make a video call (with Webrtc) from a unity client (on android phones, Windows applications) to a third party client using html5(phaser, play canvas, other html5 engines)?

worldly cedar
#

Has anyone implemented a local network server broadcast? Is it possible with Unity Transport, or am I going to have to make the socket myself?

wise vapor
#

I am using Time of Day and Mirror for my networking, I was looking on the documentation of Time of Day to sync to time with the network and this is what is says. I'm pretty new so I have no clue what this means

#
To network cloud movement, synchronize the property TOD_Sky.Components.Animation.CloudUV of type Vector3```
sour robin
#

(Xpost from General) Does seem to be a channel for Web/WebGL related stuff so I guess Ill ask here? Does anyone have a good strategy for streaming web data to a WebGL build (SSE in this case)? Nothing async works in WebGL (HttpClient.ReadStreamSync etc) and Im finding that a single StreamReader instance is allocating too much heap memory for it anyway. Sync WebRequest would completely stall the app on the request. Anyone got any tips? :/

acoustic obsidian
#

Hi everyone,
I need some advices regarding PlayFab and cloud scripts anyone ? ๐Ÿ˜’

azure crown
#

How do I sync animator component in Photon PUN2?

#

I have a working multiplayer system, but when I test the multiplayer, only the local character has animations. Any ideas?

jade glacier
#

PhotonAnimatorView is the vanilla component for that

#

Nothing in networking just "syncs", you have to be explicit about what is being sent where as messages.

prisma hollow
#

But I can't understand why

#

Is there any difference between when those two are called?

#

And apparently I can spam it on the standalone but not in the editor

jade glacier
#

Few devs in this channel know Bolt, are you on the bolt discord as well? @prisma hollow

vapid leaf
#

Anyone know how to grab friends steam name when they enter the lobby? when a player joins a match I would like to grab their steam use name then set it to a [SyncVar] string variable to put on a text object

#

every player in the lobby should be able to see the usernames of connected users

wise vapor
#

I am using Time of Day and Mirror for my networking, I was looking on the documentation of Time of Day to sync to time with the network and this is what is says. I'm pretty new so I have no clue what this means

To network cloud movement, synchronize the property TOD_Sky.Components.Animation.CloudUV of type Vector3```
lapis vapor
#

Guys, are smartfox and node server are other multiplayer sdk like photon and mirror for unity

gleaming prawn
#

they are AFAIK, yes

#

but different architectures, not the same feature sets

#

When you say Photon, for example, there are at least 4 different products (each with a different architecture): realtime, pun, bolt and quantum...

#

So not really sure what those you mentioned would compare with, definitely not even close to quantum... maybe similar to photon realtime + a custom server plugin... maybe.

urban shadow
#

I want to make something multiplayer, basic cubes with guns. You know, for educational purposes.

#

But I don't want to use photon. I want to make something myself... Now, I made a basic tcp server and I am able to sync positions (even though it's sometimes a bit choppy).

#

I have two questions. My first question is about this choppy behaviour. I want to "solve" it using lerping instead of hard moving the characters to the synced positions. Is that a good idea?

#

My second question is: what's the best way to prevent "cheating". Like moving into walls and such. I saw someone run an instance of the game itself as the server so it would be responsible for the physics, but that seems a bit much to me.

weak plinth
urban shadow
#

Yeah I was worried that might be the case.

#

So what are the options then? Running a unity game instance or... I guess, creating a virtual representation of the world and using headless physics?

#

I guess everything is virtual but... You know what I mean.

gleaming prawn
#

2 - the only problem is that you need the player to locally predict (so it feels responsive), and then you need to "fix/reconciliate" from the server confirmations...

#

THEN, you need to make sure you have a tick-driven simulation (long story here in this channel). And it will go on and on and on...

#

It's very good as learning, but you'll quickly see that each small problem pushes you to a somehow complex solution (that's been investigated and solved by experience in these networking tools like Source, UE, Bolt, etc).

#

So next is this:

urban shadow
#

Sounds fun ๐Ÿ˜„

gleaming prawn
#
  • tick based server driven sim, so inputs are bound to ticks
  • then local client must predict movements, and keep a ring buffer of positions, so it can reconciliate from server confirmations (tick based as well), and if there's enough error, re-simulate from that fixed one to present, smoothing results visually at same time.
#

After this is done, you'll get to shooting, which will be another story again...:)

#

Ah, get rid of TCP, move to UDP (unless it's really really just a toy project in LAN).

urban shadow
#

I have both actually

#

I use tcp for login and such

gleaming prawn
#

oh, I might have misread. Apologies

urban shadow
#

No you didn't, I didn't provide the context ๐Ÿ˜„

gleaming prawn
#

Cool cool

urban shadow
#

me me big dumb dumb

#

So, I have some work to do it seems. Cool ๐Ÿ˜„

#

Thanks for the detailed pointers

hallow locust
#

The bullets are coming out of client's legs when the host is not watching, but as soon as the client gets in host's view, everything seems to work as intended. Very weird bug, anybody had similar issues? ๐Ÿค”

jade glacier
#

Without seeing your code or knowing the library involved, all anyone can says is "you have a bug in your code" @hallow locust

hallow locust
#

Well I'm using Mirror and it's not just the shooting, a lot of stuff is getting desynced when the host is not watching but this one is most annoying so I was wondering if this was a known issue or I have messed up.

jade glacier
#

I would present that in the Mirror discord, but you will likely need to show your code. The bug is likely something you are doing.

shut yarrow
#

So far very satisfied with it

#

Since you like to do as much as possible yourself (if I understood you correct) I think this will be useful to you, it just gives you some basic framework to set up a connection and send/receive data, and all other stuff is up to you how you handle it

west loom
#

gives me now this error

#

'RestClient' is a namespace but is used like a type

#

I imported the complete asset folder from a older project

#

3 months ago

#

why does that happen? how can I oslve it?

weak plinth
#

will need some context, what package is this?

shut yarrow
#

I don't know what library you're using but you might have to do using RestClient; on top of your script

west loom
#

id do use it but it's grey

shut yarrow
#

Maybe try using RestSharp.RestClient;

west loom
#

i downloaded another dll... same

shut yarrow
#

The error says RestClient is a namespace, so I suspect the RestClient class may be inside the RestClient namespace

west loom
shut yarrow
#

Never mind according to github it should be in RestSharp namespace

weak plinth
#

I don't believe RestSharp has a 'RestClient' namespace. Do you have different restclient packages in the same project?

west loom
#

let's check... could be with importing the hole asset folder

#

not even one about restsharp

#

nor in the imported one

weak plinth
#

sorry I didn't mean specifically Unity packages. In your VS it should show what you've added in the Solution Explorer

west loom
#

the nuggets?

#

no

#

someone an idea?

white apex
#

fk, i'm using NetCode 0.3 and my connection to the remote server fails. Anyone else got it working or knows how to debug? Everything should be fine including firewall

jade glacier
#

DOTS typically has more people in the know about netcode than this channel. Not many DOTS users in this channel @white apex

white apex
worldly cedar
#

Is there an accepted method for server broadcast/discovery, or is it a per-game basis kind of thing?

spring crane
#

@hallow locust Do you have network culling setup?

#

Could animator culling affect it?

hallow locust
#

@spring crane No network culling setup and animator culling mode is set to always animate

rare crypt
#

i added IPunObservable to photonView but it reads a different stream ? also there is a photon transform view on the same gameObject , not sure what to make of it ...

robust cypress
#

Hey guys really basic Photon question but couldn't find an answer, how can I get the RoomInfo or atleast the room name of the room I currently joined ?

rare crypt
#

PhotonNetwork.CurrentRoom.Name

robust cypress
#

oh thank you haha

#

I knew it was something dumb

rare crypt
#

not at all

quiet fulcrum
#

Hey guys, anyone using socketweaver for multiplayer? Im having issues with syncing the rotation of the player

jade glacier
#

Had never heard of it until now, but it advertises that it handles transform sync

quiet fulcrum
#

it does but its just working with position not rotation

#

Its good i think cause photon only allows 10 people at a time wich is not much

#

And socketweaver allows 20G per month doent matter how many people actualy is online at the same time

#

And you just pay 4cent each GB you use more than 20Gb

jade glacier
#

You should join their discord for support, pretty sure most people in here won't have heard of it, so won't be able to help much.

quiet fulcrum
#

Im in their discord but almost doesnt have memberns no one answers me there

jade glacier
#

That is kind of the risk of new untested libraries - you are a pioneer.

worn fable
#

Hey folks!
I was wondering if one of you might have a solution for the problem I posted on unity answers. I'm really struggling with this...
https://answers.unity.com/questions/1767645/unet-moving-a-ball-through-a-maze-together-by-tilt.html

lilac zephyr
#

I'm writing some code in Unity using photon and I'm trying to receive the EventData however my unity keeps saying Assets\00_5 Players\Game Scripts\Player\CardAssigner.cs(39,49): error CS0246: The type or namespace name 'EventData' could not be found (are you missing a using directive or an assembly reference?) but I can't seem to find any answers on the internet about why

#

im going insane and I don't know any other type than EventData

urban shadow
#

@shut yarrow Sorry for the belated reply, but thank you for your suggestion. I will take a look at ENet-CSharp

jade glacier
#

Can't see your line numbers in your screencap @lilac zephyr

#

Does your editor not suggest a fix by adding this?
using ExitGames.Client.Photon;

lilac zephyr
#

it didnt suggest it but that worked

#

can i just ask why it needed that specifically

#

@jade glacier ty so much, I bow to u my king ๐Ÿ‘‘

#

XD

jade glacier
#

What are you using for coding?

#

VS 2017 and up should be giving you suggestions for that.

#

If you need to know why you need "using"... you REALLY should hold of on networking. I would get through a couple single player games with vanilla Unity before even thinking about a networked game.

#

Learning C# and trying to successfully make a networked game will end in horrific failure.

robust cypress
#

I would try more stuff normally but the code is so simple I don't see where the problem is (Object has PhotonView component)

distant bolt
#

and does PhotonView have a method called ParentObject that takes two ints?

robust cypress
#

check the Pastebin, photonviews dont host methods

distant bolt
#

I don't know anything about photon, but you're firing an RPC call on the PhotonView component, and getting a message that PhotonView doesn't have a method matching what you're sending

#

so surely PhotonView should have that method

robust cypress
#

it says the object holding the photonview doesn't have one, when the object has the script I sent which hosts both the method and the photonview ("GetComponent<PhotonView>()")

distant bolt
#

Looking into it, yeah I cannot see what you're doing wrong. Hopefully someone who actually knows photon will be able to help haha

robust cypress
#

Yes thank you for trying to help it's really nice

#

Ok so I've narrowed down some of the issues

#

It works only with the objects that hold the original class

#

those that derive from it dont ?

#

Do I need to do something so that classes that derive from it can still access the [PunRPC] Method ?

robust cypress
#

I made the method public and it worked, i have much to learn about classes

grand terrace
#

Which ports aren't reserved that I can use for a locally hosted server? I tried checking on here but I'm clueless https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers

This is a list of TCP and UDP port numbers used by protocols of the Internet protocol suite for operation of network applications.
The Transmission Control Protocol (TCP) and the User Datagram Protocol (UDP) needed only one port for full-duplex, bidirectional traffic. The Stre...

#

tried forwarding like 5 different ports but checking them afterwards always shows the port as closed

amber trench
#

@grand terrace try anything about 1024

#

however you might have a firewall turned on

#

also bind to port 0.0.0.0 (the "all interfaces" ip-address+port pair) instead of 127.0.0.1

#

@worldly cedar not really, but many packages provide server discoverability. it is pretty challenging to correctly expose a local host to another internet-connected player, especially outside of platforms like steam and its related packages

worldly cedar
#

I've had good success across local networks with UDP broadcast, and I have an idea for an internet wide system, just wanted to check. Thanks for the answer!

delicate parcel
#

So I am using Photon Pun 2 and when i do the
PhotonNetwork.Loadlevel()

function It says SCENE_NAME (loading)
But it never loads...
Code: ```
public override void OnJoinedRoom()
{
PhotonNetwork.LoadLevel(6);
}

How should I fix it?
stiff ridge
#

Where exactly is the log "(loading) coming from? When this is in the right place, it confirms that the level is loading.

glad pumice
#

Is there anybody that sits on some examples on how to use the new networking system?

pliant zodiac
#

i notice that fall guys used the multiplay network how hard is to implement it? because let's face has indie developers without a free tier on a service is hard for us to learn and analyze the best way to create our game since we prototype to learn first using each one of those network systems...

#

@glad pumice great question i also want to know how to use it

azure crown
#

How do I sync particle systems and audio sources in Photon PUN2?

#

I have a TFPS, and a character is holding a rifle. How can I make it so that when somebody shoots the muzzle flash is seen on all clients and the sound can be heard by all clients?

stiff ridge
#

You'd send a message "I shot" (where, when, aiming at) and this triggers everything else. You'd not send a message to sync a particle system or sounds.

azure crown
#

As in Debug.Log?

#

I don't get it sorry XD

pliant zodiac
stiff ridge
#

Read it and code along. Then you'll at least know some basics and you can begin making your own steps.

azure crown
#

Alright awesome, thanks!

west loom
#

please help!

#

why do I get this error? I already changed from https to http

signal halo
#

is New NetCode system in unity have a toturial .?

jade glacier
#

Best to ask about NetCode in the DOTS channel @signal halo

signal halo
#

nice

crystal glen
#

Guys i get this error : Curl error 56: Receiving data failed with unitytls error code 1048578 when i try to login with playfab email in play mode...

#

and i using photon Pun 2 for multiplayer, playfab is only for player data

#

someone help me?

crystal glen
#

i trying now to reopen unity...

crystal glen
#

@stray scroll can you help me?

west loom
#

I found that page too in Google. But the comments doesn't show any solution...?

stray scroll
#

You got latest version of your unity editor?

crystal glen
#

@stray scroll i restarted unity and now seem to work you can help me with another problem of playfab? i trying to get Gold Currency but it's always 0...

stray scroll
#

So you got 0 gold ๐Ÿ˜‰

crystal glen
#

after i logging with playfab i load scene of the lobby and with a script i trying to get the gold currency

#

in playfab profile i have like 155 gold

stray scroll
#

Then you're doing something wrong ๐Ÿ˜†

crystal glen
#

i don't know because i don't get any error from playfab...

#

i new to use playfab

stray scroll
#

Best to do then is follow a guide to get up to speed

west loom
#

So you got 0 gold ๐Ÿ˜‰
@stray scroll, ๐Ÿคฃ

crystal glen
#

all guide is only to get currency after login... but i try to get it every time

#

i made a void called GetCurrency and is on Update void...

west loom
#

@crystal glen ich empfihl dir mit IOTA z schaffe.

crystal glen
#

what?

west loom
#

Oh I thought CH is for Switzerland

crystal glen
#

i have it only because i like it xD

west loom
#

๐Ÿ‡จ๐Ÿ‡ญ?

#

You like Switzerland?

crystal glen
#

umh i don't know xD

west loom
#

Or the letters C and H? ๐Ÿคฃ

crystal glen
#

i like the CH in my name

#

lol

west loom
#

Hahaha why?

crystal glen
#

can someone help for my problem of playfab i can't get currency?!?!?!?!