#archived-networking

1 messages · Page 75 of 1

gleaming prawn
#

What people really ask for (here, and same as for our customers) is appropriate Netcode frameworks that let you focus on the game, not on boiler plate stuff

#

(for the vast majority of use cases) Implementing your own netcode in 2020 is like discussing (again) if you should write your own game engine.

#

There are always exceptions.

lone jackal
#

correct, sorry been afk in a meeting, but this is an awesome discussion, ty greatly

burnt sparrow
#

look you don't have to explain this to me ) -- i thought that epic will offer complete stack but it's apparently not the case (unless you're on UE)

jade glacier
#

A complete stack requires intimate connection to the simulation

#

If you mean that kind of complete stack

#

"full stack" in game networking isn't quite the same as full stack in web.

burnt sparrow
#

more of a 'i have data' and i want to connect to other instances stack - so not tied to simulation, but it wouldn't make sense without it (i.e. engine itself) probably anyway

gleaming prawn
#

Used to be:

  • (2000s) DirectX vs OpenGL
  • (mid 2000s) own Engine vs Commercial Engine
  • (2010s) Unity vs own engine. Later UE
    And life goes on
burnt sparrow
#

though for some types of games that might work

jade glacier
#

The stack in the sense I use it for gaming is largely

Messaging <-> Input/State Buffers <-> Simulation

gleaming prawn
#

In the end it always works in certain aspects, and doesn't in others...:) You may learn a few things... At the expense of missing some profit you could have focusing on a game

jade glacier
#

What I would like to see is simulation engines that are wired up to be super friendly to networking. Netcode actually is that, but its so borked in so many other ways, kind of undoes any benefit atm.

burnt sparrow
#

ok just to be clear: i don't program in assembler and in chrome (and don't want to:), and not looking for any particular solution
just tbh when you look at options as to what to pick there are things to consider beyond technical requirements and things tend to escalate quickly )

jade glacier
#

What is it you are making?

burnt sparrow
#

both in complexity and use-cases - you have to be careful, so i don't wonder people ask very low level questions all the time

#

yea @jade glacier something more plug and play (and ideally scaling well)

gleaming prawn
#

What I would like to see is simulation engines
The only two to fit into these are:

  • quantum
  • Unity DOTS (whenever ready - if they do not mess up with a lot of coupling, but looking ok so far)
burnt sparrow
#

unity wouldn't have scaling problem with GCP yet they somehow can't do it still

gleaming prawn
#

well... I mean for complete with physics/navigation... of course you have enTT, Entitas, if just for ECS part

jade glacier
#

"Plug and Play" is a term that isn't really going to be a thing for networking for a while

gleaming prawn
#

plug and play (and ideally scaling well)
Are these compatible? 🙂

#

Can be done, if you only want to do Asset Flipping

jade glacier
#

Game networking is a layer of problems you have to make compromise choices about, each affecting the next layer. Quantum gets around that with a lot of magic of its own, but for the rest - latency and loss fight any attempts at "just works"

#

Making a universal state transfer engine that just works, would require an insane number of toggles for you to set, to not be too specifically coded for one answer.

#

And that is ignoring that fact that game networking is actually about the simulation, now the messaging.

#

To do it right, you need the networking engine to take over your simulation, or at least couple with it perfectly - which means you now have to make a generic physics/controller engine that is universal.

Which, is what Quantum has done.

#

Not sure any of this is helping 😕

burnt sparrow
#

well it does at least in describing what's current state so to speak

gleaming prawn
#

Quantum gets around that with a lot of magic of its own,
Not magic. And it does have a lot of toggles and settings for you anyway.

#

But it does let you focus purely on gameplay

burnt sparrow
#

k looks like it's worth paying attention to dots netcode and knowing photon/quantum exists meanwhile
thanx dudes ]

jade glacier
#

Pfft. It is voodoo and you know it 😛 @gleaming prawn

#

You and fholm don't code, you do incantations to the dark lord.

gleaming prawn
#

There's more to it than the 2 of us as welll:)

jade glacier
#

I forget that its grown into a full team

gleaming prawn
#

I'm actually hardly coding nowadays, lack of time... Have a new right arm for physics

#

@wary bluff oh, he's around, not sure about the others

wary bluff
#

\o

real harbor
#

Can somebody help me with account registration and sql? I followed a tutorial by BoardToBits but I get an error saying my user registration failed.

hybrid arrow
#

So I'm making this basic multiplayer game, and here is where I am at.
I can connect, and my friend can connect, I want to update his players animation to walking when he is walking, so that his animator triggers on his screen and mine, and vice versa, so when I'm walking, I can see it, and so can he.
I've already dealt with moving the position so that's fine.

Here is my approach.. When I receive the PlayerPosition packet from the server, this is how I handle it on the client

int _id = _packet.ReadInt();
Vector3 position = _packet.ReadVector2();

GameManager.players[_id].transform.position = position;
var clientAnimator = GameManager.players[_id].GetComponent<Animator>();

if (GameManager.players[_id].position != position)
{
    Debug.Log("PLAYERRRR: " + GameManager.players[_id]);
    clientAnimator.SetBool("isWalking", true);
    GameManager.players[_id].position = position;

    Debug.Log("PLAYER " + _id + "MOVING!");
}
else
{
    clientAnimator.SetBool("isWalking", false);
}

But that doesn't work.
What it does is that when I walk on my client, his animation starts running, but only on my screen not his. And when I stop, his stops.. Again only on my screen and vice versa.
Any idea why?

jade glacier
#

Are you doing anything to ensure you are applying this to the right player object?

#

if (playerID != localPlayerId) kind of thing?

#

I have no idea the context of this method you are showing, but what you are describing sounds like the messages are going to the wrong net entity.

hybrid arrow
#

So I'm receiving a packet from the server, I'm grabbing the correct player by the id, so it's grabbing the player corresponding to the packet GameManager.players[_id]
But i realized it's in a loop, so that could be it, maybe my issue is that I need to make sure to not do anything for the rest of the players that's not the local player

crisp rune
#

Any one else having problems with Photon recently? Suddenly my lobby is no longer working after not changing anything although my Unity recently updated

crisp rune
#

Nevermind, Updated Unity Hub and now it works UnityChanConfused

weak plinth
#

Hello, I am looking for a professional web designer for a paid job (an online store)
minimum must have experience and a sample of your previous work
Must speak French or English.
be over 21 years old
If someone knows someone or is interested, contact me by private message

jade glacier
#

Wrong kind of networking

safe pulsar
#

lmaooo

clever silo
#

LLAPI question - is the transport supposed to send a 'Disconnect request' when it disconnects? Some of the docs refer to 3 ways a client can disconnect:

(2) The connection has not received any traffic at all for a time longer than DisconnectTimeout
(3) Flow control determines that the time between sending packets is longer than DisconnectTimeout. ```
But in our tests we're only ever seeing 2 or 3 occur. We  know this, because if we increase DisconnectTimeout to, say, 20 seconds, then a client-side disconnection only registers on the server after 20 seconds.

Anyone have any experience with this?
timber plaza
gleaming prawn
#

you mean from one game client connect to multiple rooms?

#

That's allowed. It counts as 100 CCU

timber plaza
#

Using 1 client and joining as 100 in lobby, room or whatever

#

It counts them as different ppl/ccu

#

You can use multiple clients and surpass the ccu very quickly on a game or what not

weak plinth
#

should kinda limit connections per ip xd

gleaming prawn
#

That's allowed... Nothing wrong with this

timber plaza
#

Its whack why its allowed

#

I dont understand

#

U can literally bring down any game

gleaming prawn
#

You mean a game that lets people create rooms for a big number of clients, right?

timber plaza
#

Like for what legit stuff can u use it

#

Uhh

gleaming prawn
#

Like for what legit stuff can u use it
Several game architectures may need you to be connected to multiple games/rooms

timber plaza
#

I mean if u can mod it or something

gleaming prawn
#

I think you are looking at it only from the perspective of PUN

#

But there's nothing fundamentally wrong to let a single process manage mltiple connections

#

The game developer can decide if he wants the server to allow this or not

#

Using the existing authentication mechanisms, etc

#

It's up to the developer to let it be possible or not

timber plaza
#

Thats if you host it, what if u use cloud? If u make a game i dont think you want to have a huge bill to pay at the end of the month

gleaming prawn
#

I said it's not technically wrong

#

Thats if you host it, what if u use cloud?
You can still set custom authentication

#

and on enterprise cloud you can also have full control

timber plaza
#

Too bad not all devs did it on their games but what legit things u can do with this feature XD

gleaming prawn
#

Again, nothing technically wrong to let a client connect to more than one "room"

#

Too bad not all devs did it on their games but what legit things u can do with this feature XD
Read a bit about how Destiny works

weak plinth
#

ah that is quite clear

gleaming prawn
#

A single game session connects to multiple "servers" for different parts of the logic, etc

timber plaza
#

So its up for the dev to make an "anticheat" from it

gleaming prawn
#

Anticheat can mean 100 different things here

timber plaza
#

I mean antiabuse from modders

gleaming prawn
#

The game developer can do a lot.

timber plaza
#

stares at vrchat and attack on titan

gleaming prawn
#

Attack on titan you mean the fangame, right?

timber plaza
#

Yus

#

Is it that famous here

gleaming prawn
#

There are legit issues that are being tackled there. This is not one of them

#

This one is very simple to disallow

#

Not sure what they are doing though, I do not work with them (the devs of these 2)

timber plaza
#

There are no devs AHAHA

#

Well except vrchat

#

But they got bullied for years

#

Idk maybe they live in peace now

gleaming prawn
#

So it's cool we keep a game up so you play with it, isn't?

#

😉

timber plaza
#

Wdym

gleaming prawn
#

with no dev accountable for...:)

timber plaza
#

If its being paid in advance you keep it up to the end even if devs leave it

gleaming prawn
#

We could terminate any

timber plaza
#

So if i pay for 5 years and leave the game after 1 you can terminate it? Wtf

gleaming prawn
#

If we communicate with you

timber plaza
#

Why would you terminate the service if it was already paid

gleaming prawn
#

Read the EULA

#

I'm not the legal expert

#

If something is up for you to "play" with, it's because it's fine for us...:)

#

BUt I do not work directly with that, to be clear

timber plaza
#

From what i saw

#

Photonians terminated the service when the terms of contract expired

#

Even if the dev left 4 years before

gleaming prawn
#

That's the expected, yes

#

When you pay the 100ccu tier... That's what is stated

timber plaza
#

Oh yes sure you terminate it if there are ccu issues and the dev doesnt answer

#

Or stuff like that

gleaming prawn
#

of course. If dev still answers and tackles what needs to be done, no problem

#

If he doesn't and we still keep it there, there's a reason...:)

#

ty btw

#

it's there so you can have fun with the "modding"

timber plaza
#

I think most of server side exploits were discovered on that game

#

Reported *

gleaming prawn
#

ye

timber plaza
#

Are you a photon dev

gleaming prawn
#

Yes, but not on the stuff related to that

#

The client-side issues cannot be tackled

#

Unless the developer updates the game, of course

#

That one uses an ancient version AFAIK

#

So, no problem... That would be interest of the dev

timber plaza
#

Alright just wanted to know

gleaming prawn
#

It's public here, I'm one of the developers of Quantum.

timber plaza
#

Op

#

And just wondering are huge events really used

#

Like 500k bytes events

gleaming prawn
#

I think these are not possible anymore

#

for AoT the only things left that I know of are on the client, because the "dev" is nowhere, right?

#

the array-explosion vector is fixed, etc

#

you guys know that

weak plinth
#

yup

timber plaza
#

Yes all server side stuff seems to be fixed but i meant sending from client to client an event of 400k+ bytes and such

gleaming prawn
#

Maybe the server guys will still do a few things, of course, you can always protect more

#

I'm not sure that is possible. AFAIK thereÄs a limit per event.

#

But anyway... The limits on these are configurable

timber plaza
#

It was last time i tried, unless they made another patch

gleaming prawn
#

But it's really up to a developer...:) If there's none, have fun

timber plaza
#

Ty we had

gleaming prawn
#

In the stuff I work we do block messages on the server level, etc

#

So that would not happen, but yeah, not familiar with the specific cluster AoT runs on

timber plaza
#

You mean photon service? Pun 1

gleaming prawn
#

No, the actual physical servers

timber plaza
#

Aa

gleaming prawn
#

We have multiple clusters of servers, etc

timber plaza
#

Like their ips

gleaming prawn
#

for the several public clouds, for the private ones, etc

#

the IPs change even in a single cluster

#

Due to DDoS protection stuff, etc

#

This is standard stuff

fair cosmos
#

Mirror now also have a relay server transport which is open source!

gleaming prawn
#

nice

timber plaza
#

Ah also i noticed when there are too many props in server, the server starts spamming properties/events making the room closed and invis every second

#

Would be better if it just disconnected the user who surpasses the prop amount, and not allow anyone to reach it

#

For @tobi

weak lava
#

Hi, i got more a feature design question. Would you rather offer a way that the user can create a message for a specific use case and let them send/receive it or let the user use a Stream interface so he can just writer/read data from a stream ?

clever silo
#

Who is the 'user'?

weak lava
#

Anyone that will use my lib later

clever silo
#

So, programmers. This is really about what level you intend to pitch it at.

#

A Stream interface is super error-prone but super-flexible. If you're going to do that, you're probably not really providing much help. But maybe you're being deliberately flexible. I think you have to choose based on what you're trying to achieve - it's not the sort of thing where a community vote makes sense

gleaming prawn
#

I'd say for a lib you should provide both

stiff ridge
#

@timber plaza, thx, yes, we saw the properties issues, too. It's a bit more work to add limits.

lament bough
#

I'm writing a small client/server system, literally one android Unity app running on a device and a main program running on Windows written in C# + WPF

#

I want to implement a discovery system, so that the mobile app can automatically connect to the desktop app

#

point is, I'm drowning in networking issues

#

I'm using the low level C# facilities to set up the connection, but I don't know if there's a more native way to set up a nonblocking receiving on the mobile app part

slim ridge
#

for android you'll want to use an AsyncTask

#

to run your blocking reads/writes

#

but isn't there some package you can use that makes that easy?

lament bough
#

There's Mirror, but it's HLAPI, I need a communication channel with a non-Unity application

#

also, I need both UDP for the discovery and TCP for the actual connection

rigid tundra
#

Hi, I am looking for a team or a team mate or a mentor. I have been learning unity for a few years now and need more experience. I am to the point where being part of a team would greatly help my learning. if anyone wants to start any kind of anything, please let me know

#

wrong kind of networking lol

amber trench
#

@lament bough if you are using a mobile device as a client, i would recommend using only UDP, or if you need a stateful connection, use a websocket client

#

trying to write your own TCP client on a mobile device, that handles disconnects and suspends correctly, is very challenging.

#

websockets in their modern form contains the minimum set of things you need for a connection-based protocol that's useful for mobile

#

you would just be reinventing websockets for extremely basic stuff, like hitting the home key and trying to tell if the connection is still working when you resume the app

lament bough
#

I don't need it to be so fancy, it's just a research project

#

nothing commercial or anything, I just need to log data over a local network

amber trench
#

if it's write only, use http requests

#

doesn't sound like it needs to be stateful

#

http is the best, most widely deployed and thoughtful networking technology in the universe

lament bough
#

actually, it does, since the desktop app should send start/stop commands to the mobile app

amber trench
#

then you should use a websocket

lament bough
#

I need them to be at least synced

amber trench
#

you just don't know yet how many problems you will have

#

and that using a websocket is actually really easy

lament bough
#

can websockets be used over a local network?

amber trench
#

of course

lament bough
#

you just don't know yet how many problems you will have
@amber trench please, don't assume things, I know it's hell

amber trench
#

lol

lament bough
#
    {
        UdpClient listener = new UdpClient(11000);
        IPEndPoint serverIP = new IPEndPoint(0, 0);

        while (true)
        {
            Debug.Log("Running");
            var data = listener.Receive(ref serverIP);
        }
    }

What's wrong with this

#

What it's supposed to do: listen for UDP datagrams on the network, run forever and print "Running" before each Receive operation

#

What I'm expecting: Prints "running" each time a datagram is broadcasted on that port

#

What's happening: prints "running" only once, locks on Receive even though I'm sending packets with PacketSender

#

NVM, fixed

amber trench
#

i think you'll figure it out

#

you probably wanted to bind to a multicast group

#

@lament bough on mobile devices, your socket binding can be killed when the application is backgrounded, though your thread will not be

#

the thread will be suspended

#

so just make sure to wrap in try {} catch {}

#

and another while loop to re-bind

lament bough
#

I'll keep that in mind, thanks

whole loom
#

Hey, i've been trying networking for like a month

#

and its impossible for me

#

literally

#

can someone help me set up Photon 2 to my project

#

my game have a simple movement

#

is a top-down view game

#

my player just move around and rotate

jade glacier
#

Have you done any pun2 tutorials?

#

They show those kinds of basics.

cold iris
#

Im super new to pixel arting in unity, is there a way to scale the unit size to 16x16 or have it so pixels snap to a certain grid etc?

sonic marsh
hazy sage
#

@rigid tundra I could use some help working on some small projects. My game ideas are unique if nothing else, I and others believe they stand a chance in the currently stale and dull gaming world.

#

@rigid tundra I am doing the majority of the work, but anywhere that I can gain some relief would be helpful.

#

@rigid tundra you can even choose which project you like the most. 🙂

gray pond
#

@hazy sage zeeb's point was that this is the wrong channel for that. This is networking as in data packets on the wire, not networking as in collaboration / help wanted.

hallow perch
#

I'm trying to use Mirror to make a basic multiplayer game. In it, I spawn a object on the server with client authority and want the client to then have a reference to it so it can set stuff up on it. Both RPC and TargetRPC run and receive the data but don't actually change the variable. https://pastebin.com/nLXPQCPY is the code, it currently returns "Yeah, it's null." Alternatively, is there a way to search for a game object that: A. Has a certain name, B. The client has authority over?

fair cosmos
#

@hallow perch join mirror discord for help!

hallow perch
#

Thanks.

hallow perch
#

@fair cosmos Do you have a link? I got that working but now have a weird bug I can't solve

jade glacier
#

If you are using Mirror, they have the discord link everywhere

#

Can't paste it here, Unity discord is extremely intolerant of posting most everything.

lapis vapor
#

Guys, what is the most practical way that I can test an android muliplayer game after building it from unity. If it was a windows version I would have open 4 instances of it in my pc. For android, Idk what to do

gleaming prawn
#

Open from two phones? Phone Vs editor/pc-build?

#

I personally start testing editor Vs Android build.

lapis vapor
#

Okay so there won't be any issues in communicating between an windows buid and android build?

#

Okay cool

slim ridge
#

use multiple emulator instances

gleaming prawn
#

We'll, depends on the networking lib you use

#

If you will have issues or not

weak lava
jade glacier
#

Depends what points you are timing really

#

And whether you need to factor in buffer sizes along the way and such

#

If you are directly writing messages to states (fields) rather that snapshots that are interpolated, a basic RTT will do for some things.

#

If you are doing any kind of state buffers, you have to factor in how long between arriving and application, as well as 1/2 interpolation time... stuff like that.

#

Typically once you are tick based you tend to not use time, everything is in terms of ticks.

tepid wren
#

Quick question, if I am looking to set up some online coop what is the best way to approach that? I know back in the day I used UNET then after a while it was PHOTON, now coming back into unity dev and it seems that there is yet another protocol. So it begs the question what is the best for a simple multiplayer co-op networking experience using the most up-to-date version of unity

jade glacier
#

All of the netlibs outside of netcode will probably discourage getting too bleeding edge on the Unity version. 2019 is not in the most stable state.

tepid wren
#

Is that code the most up-to-date library? What do they use in the dots example?

#

Netcode* not that code

jade glacier
#

not sure what you mean by "up to date" really so hard to give you a good answer.

#

Are there features in 2019 you are specifically needing?

#

if not, stick with an older LTS

tepid wren
#

No not necessarily, like I said I'm just now getting back into it after about a 2-year hiatus. I know back when I first started everyone said that unity's built in networking was total shit and so you had to basically use photon if you wanted anything to work. But I know they released a new library at some point. Interesting that you say 2019 is not stable, do they change something about networking?

jade glacier
#

Built in is still a mess, its preview and depends on preview libraries for DOTS.

#

Fundamentally, it is doing much right - but its a mess and not production ready.

#

HLAPI was deprecated ages ago, right now they are in networking limbo

tepid wren
#

Gotcha

jade glacier
#

So most people use Photon stuff, Mirror, MLAPI or Forge

tepid wren
#

That's kind of how it felt when I left lol, oh well I got the job done with the built-in networking, and photon before so I'm sure I can make it work

jade glacier
#

or do their own networking at the transport level

#

Photon is three libraries, and they are each very different in architecture

#

Mirror is like HLAPI

tepid wren
#

I will take a look at mir ror and forge and MLAPI

jade glacier
#

they took it and are keeping it alive

#

MLAPI is also like HLAPI, but started over so its much cleaner, but its also being written.

#

Not sure of the state of Forge, those guys don't come in here often

tepid wren
#

So, not to put you on a spot. But if you were going to be making a game similar to human fall flat, or gangbeasts, what would you personally use ?

jade glacier
#

Photon Quantum, pretty much for anything that can work on it. But its a different animal. Fully deterministic fixed point library, and it costs $1000 month just to even be developing on it.

#

So not a hobbyists option.

#

Outside of that, depends on how much you want to learn networking, and how correctly you want to do it.

#

Quantum and Bolt are the only two correctly done full stacks, but they aren;t the right answer for everything.

#

Mirror and Pun2 are not full stacks, they are just the messaging and entity lifecycle control layers

#

Mirror/MLAPI are Unity server based
Pun2 is relay based

#

All of your options will be state interpolation based, with the exception of Quantum, which is deterministic extrapolation.

tepid wren
#

Well, I was hoping that they had figured this out with the built in networking at this point, but it sounds like it's time for some robust googling

jade glacier
#

There is no one engine they could build that would work for everything anyway

#

You have to kind of understand the architecture choices and what games they are good for, before picking one.

knotty berry
#

So I want to make a 4 man multiplayer (real time (could be compared to diablo 3 gameplay wise)) game with a p2p architecture, but when I started to look into it i got kind of confused and have no idea what to do/use now...
So apparently the HLAPI is outdated and is basically out of service and LLAPI will be only supported till the end of 2020.
It´s supposed to be replaced by the "connected games", but i couldn´t really get it to work and I´m still confused on how its supposed to be working do to the lack of documentation (or maybe i just didn´t find the proper documentation).

So i wanted to ask what you guys think on what i should use for the game and what i should look out for ...
Should i use the new system or the old one? Or get a completely different one?

toxic lintel
#

What part of an ip adress refers to the network the host is on?

gleaming prawn
#

@knotty berry with the unity track record on their official libs, it still amazes me people even consider them

#

Look at the third party offerings, most are production ready and used by real released games

knotty berry
#

I looked a bit into mirror and i guess ill try it with that

gleaming prawn
#

Check mirror, mlapi, and photon stuff (a biased opinion is photon quantum for the particular game you want - but I'm one of the Devs)

toxic lintel
#

When receiving a datagram packet how does the receiving program know the packet is coming from the program it actually wants data from

#

And not some random other program also sending out datagrams

clever silo
#

@toxic lintel When you receive a datagram you know which IP and port it came from - that is basically your connection information

toxic lintel
#

Ah alright

#

So you basically listen to every datagram coming in all over the planet

#

And then do an if statement to check if it is the one you want

#

But if thats the case doesnt that make incredibly long queues of datagrams you want to check?

clever silo
#

No, if statements aren't slow. 🙂

#

You can probably do a billion of them in the time it takes to read one packet

#

And who else would be sending one to you?

toxic lintel
#

It just sends the packets out right?

#

Not perse to someone

#

Just into the internet or am i not getting this right

clever silo
#

No, UDP packets are sent to a specific destination. Otherwise, everybody would be receiving everyone's messages, which would have brought the internet to a standstill. 🙂

toxic lintel
#

Ahhh

#

That was exactly my misconception

#

So how does sending packets to a destination work

#

When sending a packet you iust input (data, length, ip, port)

#

Right

#

So how does the program know wjere to send

clever silo
#

You tell it

toxic lintel
#

How?

clever silo
#

Give the IP and port

toxic lintel
#

But the ip and port is your own ip and port right

#

Not the destination

clever silo
#

No, it's the destination

#

It's like a letter. You have to put an address on it if you want it to arrive

toxic lintel
#

Ahh

#

All my assumptions come from a java university course and that told me the ip and port inputs where sender

#

Destination makes more sense

clever silo
#

Even in Java, if you're sending UDP messages, you need the destination IP and port. These are networking fundamentals which aren't language specific

toxic lintel
#

So when you create a packet object you input the destination

#

So is there a way to know where the packet comes from?

clever silo
#

You provide the destination in the send procedure. There will probably be a function like Send(data, destination)

#

Similarly, when you receive from a UDP socket, you will receive the data and the source

toxic lintel
#

Oh so the actual packet object has the sender adress and the send function takes a destination adress

#

Tysm for all the help

clever silo
#

I don't know if there is usually a 'packet object' once it gets to your application code, but from the network's perspective it has a packet which contains both the sending and receiving IPs and ports in the header. So you'll get that sender information when you receive, yes

rustic oracle
#

are there any free rollback netcode solutions for unity?
I know about ggpo being open source but I dont want the bleed my brain into making a wrapper on ggpo

gleaming prawn
#

Free? Not that I know of...

#

I'm one of the developers.of photon Quantum though. You probably heard of it... But, not free

graceful zephyr
#

GGPO isn't really, uh... it doesn't solve the hard part of rollback netcode... determinism

#

and it's only really usable with projects made in C/C++, etc. yeah you can probably make it work in C#/Unity?, but it just seems like an awful lot of work for something that's so simple to implement yourself

#

isnt the source available online now a days?

#

@rustic oracle

rustic oracle
#

isnt the source available online now a days?
@graceful zephyr yup it's open source. but like I said, I really dont want to spend time into wrapping the thing for C# and Unity since I know it's written for C/C++. if there's already a ready-made, battle-tested free solution

#

but if there isn't then i prolly have no choice but to bleeed

graceful zephyr
#

@rustic oracle unless you have a simulation able to do prediction rollbacks determinism... ggpo is useless

gleaming prawn
#

The ggpo sources also have no networking transport, right? That's quite easy to get, but thats one more piece missing there if I remember right.

graceful zephyr
#

Correct its just the rollbacks logic thing

#

That's it

gleaming prawn
#

With no clock correction as well....:)

rustic oracle
#

I should alot a lot of time then

hazy sage
#

I wonder if anyone would be willing to tutor me on Unity & Photon2 Networking for an hourly rate?

worn wolf
#

Would it be a bad idea to use a bitmask to store items in a players inventory on a database? (To save storage space, especially if there is a lot of players with a lot of items)

high night
#

@worn wolf if you have 32 possible items and they are not stackable, could be fine i guess

#

if you got stackable items you could use multiple bits in you bitmask representing the item

#

but i'd try to handle that stuff dictionaries anyways

#

unless inventory system is too simple

jade glacier
#

You would have to explain what your bitmask represents, because at a glance that seems like it won't convey nearly enough info.

#

A bitmask would indicate if a slot is full or not - but not indicate what occupies each slot.

#

I would probably for networking sync a list of indexed item types

#

If you need to also include the position in inventory, that would also be a bitpacked index value.

worn wolf
#

Ah I see okay

#

Also

#

@worn wolf if you have 32 possible items and they are not stackable, could be fine i guess
@high night you can't do more than 32 bits in a mask?

high night
#

@worn wolf you can, you could do byte arrays and stuff
if you wanna have 40 bits, you can do byte[5]

#

although there should be better data structures for this stuff

#

however, i'd do a dictiony as such:
dictionary<byte(itemId), byte(quantity)>

worn harbor
#

hi im making a multiplayer game but when 2 players join they are both controlled by one player how to i fix that?

worn wolf
#

however, i'd do a dictiony as such:
dictionary<byte(itemId), byte(quantity)>
@high night Okay thank you

graceful zephyr
#

@worn wolf you can do as many bits as you want using something like:

public unsafe struct Inventory {
  public fixed int Mask[3]; // gives 96 bits (3 x 32)
}
worn wolf
#

I see, thank you

amber trench
#

@tropic kestrel the technology you meant to say was NAT punchthrough. you should probably just use a commercial solution.

#

@worn wolf yes, it would be a bad idea to use a bitmask to store items in any real database

#

@toxic lintel yes, a UDP packet comes with its source IP and port

amber trench
#

i'm not really qualified to say specifically which commercial solution to use

#

if a player's machine is supposed to be a host, you can use STUN and TURN servers to relay network traffic despite the users' network topology and most firewalls.

toxic lintel
#

And you dont have to input that?

#

Like c# tskes care of that

amber trench
#

you will have to carefully read the sockets API to understand how to get the sender's IP and port

#

when using a datagram (UDP) socket

#

there are at least two APIs for this in .Net you can use

#

UDP is connectionless, but the sockets API uses language that sounds like there's a connection

#

so this is going to be really confusing for you

#

STUN and TURN are just names for different kinds of relays. you'll see it beside webrtc because that's often where they are used

#

@tropic kestrel when you use a commercial solution, either they're crazy and they write this themselves, or they just use a STUN server to relay traffic

#

an open source one

#

it's all sort of the same thing with the same performance impacts all the way down

#

you can also just use some other company's STUN/TURN

#

really depends

gleaming prawn
#

Stun and turn are complimentary standards, not the same thing at all

#

In short, stun is the standardized protocol for bar punchthorugh, while turn is for relaying...

amber trench
#

yeah i'm just giving him keywords

#

i mean this stuff is for media

gleaming prawn
#

Not really

amber trench
#

ultimately very few games do P2P

#

if you're making a game for Xbox you use Microsoft's services for this

gleaming prawn
#

Stun is used for games in several commercial solutions. It's just convenient to use a standardized protocol

amber trench
#

"Xbox Live Multiplayer Relay Service"

gleaming prawn
#

Steam services does punchthorugh automatically when you use them, so you seldom really run data through their rwlays

amber trench
#

yeah

gleaming prawn
#

Xbox teredo same

amber trench
#

it's tough

gleaming prawn
#

Photon includes native stun in both our c++ APIs and in photon bolt, etc

amber trench
#

it's a little cart before the horse

#

yeah

#

it's good 🙂

gleaming prawn
#

It's not uncommon

amber trench
#

hey i didn't group you in the crazy group 🙂

gleaming prawn
#

Because that is not standardized

amber trench
#

i put you in the sensible category

gleaming prawn
#

??

#

Lol

amber trench
#

"when you use a commercial solution, either they're crazy and they write this themselves, or they just use a STUN server to relay traffic"

gleaming prawn
#

I'm just trying to add a bit to the discussion

amber trench
#

lol okay okay

#

i mean the unity games are probably P2P

#

on the Switch

#

like Ultimate Chicken Horse, Overcooked 2, etc.

gleaming prawn
#

Nintendo has their own

#

Relaying,

amber trench
#

it's almost as though, what would make the most sense, is if unity provided some kind of library that runs its single-threaded game engine in an embedded, headless way

#

that is probably too much to ask though

#

so that people never do P2P ever again

gleaming prawn
#

Why?

#

Paying for dedicated servers running the headless engine is the real.tjing

amber trench
#

yeah but that's horrible

gleaming prawn
#

That's where the problem lies...

amber trench
#

running the engine

gleaming prawn
#

Well

#

That what unity.wants.you to do,.so you rent miltiplay.servers

#

Lol

amber trench
#

yeah, that is a dead end

#

nobody is going to do that

gleaming prawn
#

It's not,.depends.on how successful you are

#

That's the same you do with unreal

#

It's one of the valid strategies, albeit the most expensive one, but has its pros

amber trench
#

yeah but microsoft and sony is basically giving the platform away at cost to those people, at that scale

#

the Rocket League people

#

when it comes to unreal

gleaming prawn
#

For unity, using our stuff (photon) you can pretty much use any strategy:

  • bolt is client server, like unreal, either.with punch through or dedicated server
  • quantum is deterministic (server based.input management though, not P2P)
  • pun is pure relay
#

It's a matter.of what is feasible for your tittle

#

The amount of money epic pays to Amazon is significant

amber trench
#

ideally i would have

var server = new UnityEngine();
await server.LoadResources(file-like);
await server.StartScene(scene index);
server.Play();
...
server.Dispose();
gleaming prawn
#

Server coats are their n1 expense AFAIK, but still profitable

amber trench
#

it's 2020 and we can't do that yet

gleaming prawn
#

Lol,.you are describing what we do with quantum

amber trench
#

well, but normals want to lay out the physics in the scene

gleaming prawn
#

Unity track record with multiplayer is sketchy at best

amber trench
#

using unity phsyics or whatever

#

they want to use the editor

#

and What You See Is What You Get

gleaming prawn
#

We use the editor...;)

amber trench
#

you know what i mean

gleaming prawn
#

And wysiwyg

#

I do, lol

#

That's my job

amber trench
#

lol

gleaming prawn
#

That's what we built for our customers

amber trench
#

listen i like quantum

gleaming prawn
#

Have you used it?

amber trench
#

no

gleaming prawn
#

It's not a silver bullet,.of course

amber trench
#

i like the idea* of quantum

#

i do the other thing, which is just writing all the game logic separately

gleaming prawn
#

You would like the real one even bwttwr

amber trench
#

i mean, a priori, for the server platform we use

gleaming prawn
#

Running logic on server is always more.eypensive,.that's why in quantum that.is optional

#

Unity.is, loosely, moving towards what you described

#

But they seem to be very far off yet

#

Delayed by one year again...

amber trench
#

it's a big engineering challenge for sure

#

i think people want their C# stack to look like their game stack

#

and that's very difficulty to achieve

gleaming prawn
#

I think to go towards.what you described fully is beyond their possibilities due to business model restrictions

amber trench
#

stack meaning, literally the methods and variables that appear in your stack

#

i am not a Unity PM, but it's true that if i wanted to sell $0.40 of compute time for $40, i could not make unity easily embedded, because that is how everyone would use it

#

someone would go and compete with me, selling $0.40 of compute for $1.00, because they are happy with that margin

#

it still wouldn't be free

#

someone has to pay for the computers

gleaming prawn
#

Yep...

#

There's no free

amber trench
#

their adversary isn't the user, it's Amazon

#

that's always been true though

gleaming prawn
#

You mean unitys?

amber trench
#

yeah

gleaming prawn
#

Amazon, ms

amber trench
#

for this multiplayer thing

gleaming prawn
#

And epic, and steam, etc

amber trench
#

Steam doesn't really sell $0.40 of computer time for $40 though

gleaming prawn
#

Everybody is fighting for a piece of the cake

#

No, but they are competing for your players data

amber trench
#

Blizzard, Riot, they run their own datacenters, they don't have to pass the Amazon tax onto the consumer

#

ah yes, that valuable LoL chat data...

gleaming prawn
#

And then they offer you a cheat entry into relaying/NAT ounch

#

Blizzard riot might have that for their flagships

amber trench
#

i think the real reason it's a dead end is, anyone who knows what the value proposition actually is will feel like they're getting ripped off

gleaming prawn
#

But they use off the shelf stuff as well...;)

#

Maybe knowing the value proposition is one of the reasons we are getting cool customers

amber trench
#

i got bad news for you though, our backend is java

gleaming prawn
#

Wouldn't that be bad news for you?

amber trench
#

lol

gleaming prawn
#

Kidding

#

Used.to be a Java programmer, about 15 years

amber trench
#

i'm pretty bullish on Graal, i think that will be the future

#

il2cpp works and is shipping today

#

with real games

gleaming prawn
#

I think java is the current COBOL

amber trench
#

lol

gleaming prawn
#

So everyone's job is safe, no worries, lol

#

You got a point with il2cpp

#

I just don't see why java is the future with net core current state

amber trench
#

yeah, most of the value is tied up in the legacy

gleaming prawn
#

But honestly I can't say much about java anymore.

#

Stopped following

amber trench
#

the best indie game of last year was, ultimately, a java game (Slay the Spire)

gleaming prawn
#

Specially.since oracle.reasons

amber trench
#

who knows where it will come up next

#

it's not networked, but Monster Train is

gleaming prawn
#

Well, you also have these one trick ponies.with any language

amber trench
#

today's biggest hit

gleaming prawn
#

You have probably more.suvcessful titles.done with game maker than java... But then there was original minecraft

amber trench
#

yeah

gleaming prawn
#

Just don't see that getting any tracking, java seems dead.for the new generation of content creators....

#

You get these one ofs

amber trench
#

certainly for people who get financed

#

it's dead

gleaming prawn
#

Traction*

amber trench
#

some middle aged CEO who doesn't play games, they're going to give the Star Wars IP to whoever has the most photoreal rendering

#

and it's an FPS

#

because that's what they understand

#

they might understand networking to mean, this is where i get the lootbox revenue

#

the events revenue

#

and how i keep the IP for 3 years instead of 1

#

that's not really got anything to do with java

gleaming prawn
#

Nope

#

It has more.to do with how many minutes you can squeeze from that team instead of Netflix

amber trench
#

i can actually think of many vanguard networked Java games though

#

besides Minecraft

gleaming prawn
#

Teen

#

Minecraft is not java anymore AFAIK though

amber trench
#

Ultima was a mix of java and C++ backend, Sun Labs was all about it

gleaming prawn
#

Lineage as well

#

Super expensive old gen MMOs

amber trench
#

so there you go

gleaming prawn
#

No chance that would happen today with such an inneficient backend... :)

#

The ticket for playing these games has gone down a long time ago since f2p

#

As you said

amber trench
#

the most expensive part of my backend is the bot

gleaming prawn
#

If you are paying 1$ or 40$ per.compute time, you need to use that better

#

Bots are complicated indeed

amber trench
#

we run our own servers, it's the only way

#

as in physical hardware

#

you're right it's just too expensive with cloud providers

#

you need to have a lot of expertise though

#

the real question is, do you learn something about how your game should work by doing this all yourself

#

i like quantum, i think it exposes the right learning to people

#

to make them embed their game engine

#

you can't do The Network Thing for a lot of games without making something that boils down to an embedded runtime

gleaming prawn
#

Arguably

amber trench
#

i think for a lot of services oriented games, where you might have inventory to manage outside of your game

#

where there's this meta, that looks more like a conventional piece of single-user persistent-state software

#

that's where Java shines as a platform, not because it necessarily excels at doing any one thing but ismply because it can eventually do them all

#

it's just where people make their money, customizing avatars

gleaming prawn
#

Got it

#

Need to head to bed now....

amber trench
#

the best way to play multiplayer Ultimate Chicken Horse is on your local switch

#

lol

#

alright goodnight dude

gleaming prawn
#

Nice talking...

cold estuary
#

PUN is in development mode (development build). As the 'dev region' is not empty (usw) it overrides the found best region. See PhotonServerSettings.
UnityEngine.Debug:LogWarning(Object)
Photon.Pun.PhotonNetwork:OnRegionsPinged(RegionHandler) (at Assets/Photon/PhotonUnityNetworking/Code/PhotonNetworkPart.cs:2312)
Photon.Realtime.RegionHandler:OnPreferredRegionPinged(Region) (at Assets/Photon/PhotonRealtime/Code/RegionHandler.cs:251)
Photon.Realtime.RegionPinger:RegionPingThreaded() (at Assets/Photon/PhotonRealtime/Code/RegionHandler.cs:459)
ExitGames.Client.Photon.<>c__DisplayClass6_0:<StartBackgroundCalls>b__0()
System.Threading.ThreadHelper:ThreadStart()

#

help

#

just created my main menue with photon

#

when i press play to go to scene 1 this is the erro

#

@everyone

wooden swan
#

The position is synced but not rotation, why?

weak plinth
#

it's probably an old question, but in peoples opinions whats the best networking for multiplayer games and why? any recommendations?

distant bolt
#

@cold estuary doesn't seem like a bug, it's just a warning.

PUN is in development mode (development build). As the 'dev region' is not empty (usw) it overrides the found best region. See PhotonServerSettings.
one that seems self explanatory. Just unset the dev region in the settings it mentions.

cold estuary
#

but theres so much code

#

i cant possible find it

#

@distant bolt

distant bolt
#

PhotonServerSettings is a file in your project

cold estuary
#

thanks for that

#

but the code now doesnt work

#

but no error pops up so

empty quiver
#

Do I need to sync the players health bar if it only updates on the client, not sure why but when I set the health to be the value of a slider the slider value doesn't change depending on the health value I have it set in the update but it doesn't update

empty quiver
#

could u show me an example please

high night
#

your code should read some synced health value and apply it to the slider @empty quiver

#

every frame or every fixedupdate frame as usual

empty quiver
#

but how would I sync it?

#

Im using Photon btw

high night
#

what networking asset

#

oh

#

you will sync your float with photon streams

#

or rpcs

#

you will learn how to use streams and RPCs

empty quiver
#

I've used RPCs before so I'd stored the health float in an rpc?

high night
#

nah thats not rpc works exactly

#

if you want to do server authorith on health;

#

you have a health value and an RPC thats only called in server and updates on clients

#

server decides how the "health" changes,
and server updates the "health" value on other clients

#

@empty quiver

#

This is not the only way to do it though

#

RPC is just for sending information between users
and you send the minimal info between users to keep the game in sync
thats the idea

empty quiver
#

So master client to everyone else could I not just have the health bar controlled locally?

high night
#

your clients wont be able to locally change health this way

empty quiver
#

The health system works just not visually

#

Also the player can't see the other person's health

high night
#

its just server deciding what the value is
and clients recieving that info and displaying

#

you do it this way, all clients will have the health synced

#

.
@empty quiver Here's a tip for you, that could've saved me countless times back then:
If you wanna send some info via an RPC and that info is not included in the RPC paramater, it's never sent at all

#

Maybe you think you send some value i mean
but it's not sent you know

empty quiver
#

makes sense cheers for the tip

#

but does the health need visually need to be synced to other players?

high night
#

@empty quiver just focus on having the actual "float health;" value same

#

then you can worry about the visual

empty quiver
#

same as the health bar?

high night
#

the float value in you health bar is you actual health value?

#

@empty quiver

empty quiver
#

no Im just setting the health value to a slider

high night
#

where is your health value defined?

#

not your character script?

jade glacier
#

Keep in mind RB sync and Transform sync are going to conflict. You use one or the other, not both. @wooden swan

wooden swan
#

ok

wooden swan
#

@jade glacier im using just the rb sync and its still not syncing the rotation

wooden swan
#

I made a script to do the rotation but now its laggy for the other players

jade glacier
#

I would avoid use any rb syncs really. The Photon syncs are all pretty much just there to show people how to code a sync. They aren't really for production use regardless.

#

"laggy"?

#

That term can mean a lot of things, but if you mean there is a delay across the network - that is expected - since the internet involves transmission delays.

hollow pelican
#

is there a way to play a unity project on a website I own

#

?

#

preferably wix

#

?

cold estuary
#

can anyone help me?

#

@everyone

#

this is my code for networking but nothing happens when i press play

empty quiver
#

It was originally in the character script but I moved it to another script called player health

worldly cedar
#

Hey all,
Im running a UDP Socket to an arduino on the local network. The arduino reads a depth sensor, sends it through, I created a class to read it and send through the result, code here (https://hastebin.com/ahoxowisub.cs)

The weird thing is that code works in Visual Studio (2019). It connects, outputs the correct data, its perfect.
The only difference is a slight syntax difference and some structural stuff (this is a sub class for unity, its the main class in VS).

I have no errors in Unity, it just reaches the point of waiting for data, then doesnt receive anything. Does unity implement any blocking when it comes to UDP? I am fairly new to network programming, so this has been a big research area for me 😛

amber trench
#

@worldly cedar yes you need to run the networking on a separate thread, and queue the messages for processing back on the unity main thread (and vice versa)

worldly cedar
#

Hmm okay, thanks for the answer! Do you know of any resources around this? I have done some threading work in the past, but examples of it in this context would be useful

worldly cedar
humble lantern
#

Hello guys! Any one know good example of - Photon 2 Lobby ?

stiff ridge
#

You mean PUN 2?

#

What are you looking for, @humble lantern ?

wooden swan
#

Why isn't it being set to active?

stiff ridge
wooden swan
#

Because its a pickup and throw thing

#

You pIck it up, it goes into your inventory, then you throw it

#

PhotonView.Instantiate can only spawn prefabs

stiff ridge
wooden swan
#

I already have mine made

#

I just need to know why its not being set as active

stiff ridge
#

The code you show doesn't have any activation in it. Maybe the prefab is also disabled?

wooden swan
#

it has Enable.transform.gameObject.SetActive(true);

#

And its not a prefab

stiff ridge
#

Hm. right.
Any parenting? Is the parent inactive in that case?

wooden swan
#

no

#

No parent but the game object itself is inactive

#

But a different script is making it active

#

but its just not working

stiff ridge
#

You Instantiate. That returns a new GO, right?
You modify the "original". Is that planned?

wooden swan
#

Yes

#

The object is spawning it

#

Just not being enablked

stiff ridge
#

You don't use the result of Instantiate. You move the original and enable the original that got instantiated but .. the new instance is just placed.
That's all correct, yes?
Then I'm out of ideas 😐

wooden swan
#

I do use the new object

#

The old one gets deleted

#

I put it above the instaniate and it works

#

But everything after the instantiate doesnt

spring crane
#

I assume you are trying to modify the thing you are cloning instead of the resulting clone?

wooden swan
#

yea

#

I fixed it

slim ridge
#

is it tcp or udp?

royal cobalt
#

Is there a networking solution that supports DOTS?

#

mirror, photon, unet, etc dont support dots

#

DOTSnet supports it, but its for mmos

#

unitys solution isnt out until q2 2021

gleaming prawn
#

Dots is not production ready, so most commercial solutions would not target it directly (although we are all experimenting and cooking something for when the right time comes).

#

Photon quantum IS dots though, in its own sense. It is a fully fledged sparse set ECS with parallel task system, etc... So same data oriented principles and focus on performance.

#

But we do not use the dots libraries because they do not fit our needs, so we built our own.

slim ridge
#

great, tcp makes it easy. You can use a statemachine to read message because they are reliably ordered.

#

common practice is to prefix messages with their size.
Read the size, read that many bytes, read size, read that many bytes, ...

#

reflection is pretty slow.
I like to keep track of the size of messages as i create/modify them so the size is an actual member of the type.

slim ridge
#

"it didnt like it" ok

leaden orchid
hallow fractal
#

what is causing this errer as soon as a other player joins in?

#

The variable ObservedComponents of PhotonView has not been assigned.
You probably need to assign the ObservedComponents variable of the PhotonView script in the inspector

leaden orchid
#

on fresh project still getting error...

#

but it's having error with the 2d Animations?

leaden orchid
#

even tried on 2019.4.0f1

#

Still uses 2D Animations 3.2.2, which doesn't seem to fly with Transport

leaden orchid
#

appears to have to do with most recent version of Collections library

leaden orchid
#

Woo, got it working with the previous version of the Transport package

#

NetCode is still wonky, but I just need low level networking anyway

cursive ledge
#

Hi! Is a service like https://normcore.io/pricing a good road if you're making a game say like 'Rust' ? Where persistence is very important etc. Any feedback about it?

fervent ibex
#

Hi, First post here.
I'm Franch Student, sorry if my english is not perfect
I began my first multiplayer project using Photon PUN.

I'm a little bit confused about custom type serialization.

I'm creating a versus tactical RPG. To manage the battle, I have a BattleManager that contains all the game state I need to synchronize :

  • A list of team
  • A timeline
    A team contains a List a Character...

So I have multiples lists of custom types that contains multiple lists of custom types...

It's my first time with Multiplayer game, so the serialization concept is a little abstract, and serialize a complexe data structure looks too much fastidious to be the only way to achieve this.
How would you sync this game state?

Sorry, my question is really vague, but I feel that i'm not going in the right direction...

hallow fractal
#

Why do i get this photon error when another player joins in

#

The variable ObservedComponents of PhotonView has not been assigned.
You probably need to assign the ObservedComponents variable of the PhotonView script in the inspector

candid aurora
#

Has anyone here taken apart the network code for the FPS sample project? I've watched the videos explaining what it does, but now I'm trying to put that together with the actual code from GitHub. The plan is to recreate chunks of it from scratch as a learning project.

Alternatively, does anyone know any good tutorials that explain it by going through the code?

jade glacier
#

@hallow fractal what does your photonView look like on your prefab?

#

Typically when you add a component like PhotonTransformView, you drag it into the list in the PhotonView of observables

#

...
There is a Team component built into the Pun2 lib you can look at for ideas, though not sure off the top of my head where or how to use it.

#

@fervent ibex

fervent ibex
#

@jade glacier Thanks for answer ! I found a way to easily serialize data with Odin Inspector Serializer, so I'm able to serialize List etc... and throw it over network. So I think my current problematic is solved.

jade glacier
#

I don't see your line numbers, so no idea where the null is

#

What is null?

#

First guess is Player doesn't exists in a Resource folder

#

I mean, what actual field isnull

#

Find that out for starters

stray scroll
#

Double press error will usually get you to the line of error.

jade glacier
#

They are all exposed

#

Find out specifically what is null

#

Player exists in a resource folder?

#

no idea, first step is isolate what is actually broken. Find that null.

covert zinc
#

Hello i need some links for tutorial and information in networking. Andi'm here because u are may be good in this matter and have some links ^^

graceful zephyr
#

we're not

jade glacier
#

No idea what I just saw, sorry

fair cosmos
#

anyone here who can help me with the master server?
all is done adding sv, removing sv, updating sv, refreshing sv
my mstersv uses php at backend + unitywreq
when removing(on server exit) does not confirms that the web req will reach or not, any comments how to remove dead servers

#

dont say to start another process(for removing what if the pc shutdowns suddenly) and also not pinging server(what if there are 1000 sv's and it will ping 1000's? really my isp can ban me)

slim ridge
#

timeout. if operation does not succeed in certain time assume death

fair cosmos
#

@slim ridge

#

dude this can work, but if there are 1000 servers? so foreach loop through each sv and check wether they are timedout or not?

slim ridge
#

if you have 1000 servers i hope you have something monitoring them

fair cosmos
#

any other method?

jade glacier
#

I would start your journey using the prototyping tools for that

#

There is a component called OnJoinedInstantiate.cs

#

You can derive from that class, or just steal the code in there.

#

@weak plinth

#

You can get a game working with just ConnectAndJoinRandom and OnJoinedInstantiate in a scene.

hallow fractal
#

@jade glacier yep, it was hard to figure out where the cause was but i got it fixed somehow 😅

hallow fractal
#

@weak plinth also newbie but this Instantiates the character in the room

#

In photon

#

You need to make a resources folder and put your character with PhotonView on it, than drag the player to that script

jade glacier
#

Is the component not self explanatory enough though?

#

It's point is to be basic enough that you can see how it works

#

It is a component

#

Just put it on a scene object

hallow fractal
#

@jade glacier does your asset work also with npcs

#

Remember the error i got that i got yesterday? it had emotitron, i thought it would be the same to put that also on a npc

jade glacier
#

It's for state transfer

#

So depends what you are syncing

hallow fractal
#

Does someone here how to use rpc?

#

I have a script that should turn on and off a collider through photon, but i have no idea how to implement rpc

#

This is the script for the moment i use

peak rune
peak rune
#

ok think I found a way around

weak plinth
stiff ridge
#

@weak plinth, lag and loss can have some effect. Your job with PUN is to hide that. The built-in TransformView is just a startpoint.
If you don't want to dive into these details, have a look at the "SNS" addon for PUN:
https://github.com/emotitron/SNS_PUN2/
It comes with better "out of the box" components to sync movement. It should be more precise.
Emotitron is part of the team for PUN now, by the way and we support this in a separate Discord server (invite is on the linked page)...

weak plinth
#

alright i'll give it a go, thanks!

#

is there an install tutorials?

stiff ridge
#

It may look a little more complex but I'd say it's worth it.
Install: Afaik, you just need to import it into the project and begin using the components.
There are links to various google docs.

#

One more thing about the install: Make sure to use the latest PUN 2 version!

stiff ridge
#

You can't create Players in the CurrentRoom.
What you create with that RPC is an object, called Player.

#

The CurrentRoom.Players is the list of actual players in the same match.
And by the way, when you use PhotonNetwork.Instantiate(), you don't have to do that in an RPC. It is a networked method, so this is synced already (and no RPC is needed).
I would recommend reading and coding-along the Basics Tutorial: https://doc.photonengine.com/en-us/pun/current/demos-and-tutorials/pun-basics-tutorial

lapis vapor
#

can anybody help me with maing a unit build for aws game lift I'm stuck in this point

Build the C# SDK libraries. See the README.md file for the C# Server SDK for minimum requirements and additional build options. In an IDE, load the solution file that you want to use. To generate the SDK libraries, restore the NuGet packages and build the solution.

I don't understand what a nuget packages is and even search, i didn't understand

lapis vapor
#

Hi, I need some help. I am running an AWS instance of windows server and I need to connect to a local instance of my game on my system. I am using AWS through remote desktop.

lucid tundra
#

it only happens when im trying to access my playerIO database

#

ping me if you have a solution

merry arch
#

Im a bit stumped, Im looking for the best way to handle netplay for a fighting game and im not getting very good results

merry arch
#

I get very vague answers, I found "Mirror" for unity but I havent had clarity when it comes to how good it is on games that require precision like fighting games

#

like mortal kombat

jade glacier
#

Mirror, HLAPI, Pun2, Forge are all just messaging layers with entity management ... how precise or not they are depends entirely on how you code your simulation.

graceful zephyr
#

@merry arch mirror is useless for for fighting games

lime lance
#

might anyone happen to know why I can only see unity ads in unity but they don't work once my app is live on the Google Play Store?

sturdy saddle
#

Is there a channel I can post request to hire? I would like to hire someone to write a photon script. Else if someone here is interested you can dm me for details.

oak flower
#

@sturdy saddle No advertisement space here beyond Asset Store

small hare
#

Try the Official Unity Discord server

sturdy saddle
#

@small hare this is the official unity discord

small hare
#

Lol - sorry, juggling too many servers here

sturdy saddle
#

Does photon have an official discord?

merry arch
#

@graceful zephyr what would you use instead?

oak flower
#

@sturdy saddle Photon has official forums and tutorial examples for Unity.

graceful zephyr
#

@merry arch for fighting games the standard is ggpo, personally I would use photon quantum but I'm biased there so

merry arch
#

@graceful zephyr is there any tutorials using ggpo in unity?

#

I looked but i couldnt find anything :(

graceful zephyr
#

No

slim ridge
burnt axle
#

PUN2 Related: When OnPhotonInstantiate() is being called, is it always being called after Unity's Awake()? Cant find any info on this.

slim ridge
#

use Debug.Log to find out 😄

burnt axle
#

Tried that but id still like to hear it from someone that really knows 😛

slim ridge
#

now that you've tried shouldn't you really know?

peak rune
#

Please can someone explain what m I doing wrong, it's been days trying to figure out a way to set up user names in a simple chat, I tried bunch of tutorials and couldn't find anything that works, today I tried to take my names from a text attached to the player but it always ends up having the name of the first client across all of the network
this is my player https://pastebin.com/eBAzsx3L
my chat https://pastebin.com/p2C4qmgk
and my UI that takes the inputfield https://pastebin.com/5yAXHPCq
I would be very grateful if someone could help.

peak rune
#

nvm found my mistake

rustic oracle
#

hrmmm photon problem:
so my code calls JoinRandomRoom();
if it fails make a new room and wait.

however... when another instance of a game runs JoinRandomRomm();
it also fails (makes a new room and wait) even though there's already a room ready and waiting.
how do I go about fixing this?

#

I'm ff dino dapper's tutorial btw.

rustic oracle
#

nvm, I just need to be specific with the region

weak plinth
#

how can i do 2d overlapping using PUN 2?

#

im trying to make it so if a player touches another player the other player dies

weak plinth
#

alright thank you

#

still doesnt work unfortunately

#

In PlayerDie the destroy is placed twice for testing

wild trellis
weak plinth
#

@weak plinth but the player you play as is destroying the player it collided with so wouldn’t it be fine?

#

I just use colliding player so I can get the colliding object to void player die

merry arch
#

Can you use GGPO for a 4 player game?

weak plinth
#

@weak plinth even when i do use punrpc it still doesnt work

rustic oracle
#

Can you use GGPO for a 4 player game?
@merry arch you can. GGPO rolls back on input and received packet.

merry arch
#

Excellent!

weak plinth
#

i found out it was a collision issue

#

but i do have another issue

#

are there any good ways of respawning without losing the player controller

glass vale
#

just.. don't delete the player controller? disable it and hide the player

#

then just reuse it for the respawn

weak plinth
#

does anyone know if Mirror is good for shipping grade networking?
is it good enough for a commercial indie game is the question
I'm gonna start implementing networking in my Unity project soon I don't know where to start
I've heard Mirror is the new 'replacement' for uNet
but I've also heard people say there's no good existing networking solution for Unity

#

apparently there's been some nice titles made with it so it seems solid

weak plinth
#

these arent happening over photon even though i have punRPC at the top, does anyone know why?

#

it only happens locally

weak plinth
#

oh okay

#

how do i call it using rpc?

viscid tree
#

is there a simple easy way to make a 2D WebGL Multiplayer game?

weak plinth
#

@weak plinth

#

here's what i have with errors and stuff

#

can i set it to a gameobject variable?

#

???

#

okay so what do i target it to?

#

i'll test it

#

still doesnt work

#

no errors just this^

#

oh

#

do i put it next to rpc target

#

im confused

#

can i just copy and past with no errors?

#

yea

#

photonview doesnt have a blah blah for viewID

#

nvm

#

yep it works, thanks!

viscid tree
#

some one help me please

high night
#

@viscid tree directly ask question

viscid tree
#

@high night how can i make a multiplayer gam

#

hello

#

please dude

high night
#

@viscid tree you already got the basics of unity and programming?

viscid tree
#

yeah

#

hello

high night
#

@viscid tree most popular options are mirror and photon

#

you can find tutorials on photon

#

for mirror, you can follow unet tutorials

viscid tree
#

which one is more beginner friendly

#

like someone who knows nothing about servers clients and all that

high night
spring crane
#

Depends on what you are trying to do

high night
#

@viscid tree mutiplayer is about sending minimal data keep all players scenes synced

spring crane
#

PUN has great API, but it's made for peer to peer over relay

viscid tree
#

a 2D WebGL game

#

is what i'm trying to do if thats what you mean

high night
#

it could look like this:
player positions
player rotations
player healths

moving object positions
ai enemy positions

viscid tree
#

ok cool, which one do you prefer though mirror or photon?

#

okay i just looked it up and photon seems more beginner friendly

#

thanks

spring crane
#

Just realize that by default one of the clients has a lot of control over the game

viscid tree
#

who

#

one of the clients as in me

#

right?

spring crane
#

No. It can be any client

viscid tree
#

oh like cheaters/hackers ?

spring crane
#

Yes

#

Server authority is probably something you wanna look into

viscid tree
#

no dont worry im just doing this just for a little project with me and my friends

spring crane
#

Ah in that case PUN is great

viscid tree
#

and its also in webgl because i dont want them downloading anything, just paste in a url and stuff and we can see each other moving around

spring crane
#

WebGL is probably a good idea for your first commercial project too

viscid tree
#

true, but about the url

#

is there any way i can use netlify?

#

or is that just for js

spring crane
#

You can use netlify, but since it's just for fun, just put it on itch.io or simmer or something like that

viscid tree
#

oh alright

#

thank you so much man, you're like the only person who's willing to actually explain instead of just saying "its too complicated to explain watch a tutorial"

spring crane
#

Consider explicitly asking for direction instead of "how can i make a multiplayer gam"

#

Nobody is going to answer that question in full

tropic mango
#

hi guys i have a question : Unity NetCode is the new multiplayer system?

sonic marsh
#

@tropic mango it will be, but in like 5 years

tropic mango
#

oh

#

rip mah

#

thats why it's taking 58 years

plucky lotus
#

Is there a P2P (preferably WebRTC) networking library that supports Android (I've tried the Unity Preview Package but it doesn't build to Android yet)

wooden swan
#

Anyone know why this is happening?

stiff ridge
#

@wooden swan, the target of the RPC was probably destroyed before the RPC arrived. The warning is just there so you notice why the RPC is not being executed.

weak plinth
#

how do i compare a variable from all players to determine the winning player using pun?

gray pond
gleaming prawn
#

@gray pond curious about this: Removed: Discord Transport

gray pond
#

We had a transport for Discord's relay

#

I wasn't the author, but my understanding was along the lines of Discord's API was buggy or they dropped support for it.

#

So we couldn't continue support for it and had to drop it.

#

It was ostensibly something comparable to Steam's relay.

spring crane
#

Added: [Command] now has an ignoreAuthority option for invoking Commands on objects the client doesn't have authority over
That's convenient. Was beyond mildly annoyed that I couldn't do this 😄

slim ridge
#

sounds hackable

spring crane
#

I imagine server is aware of the flag

slim ridge
#

if anyone can ignore authority nobody really has it do they 🤔

gleaming prawn
#

If server can enforce, no problem

gray pond
#

@slim ridge That's not how it works

gleaming prawn
#

Understood about discord, ye makes sense

#

They were trying to push into these things, but it seems they gave up then

gray pond
#

The authority check is on the server

slim ridge
#

so really it's ignoreClientAuthority

gray pond
#

authority to invoke Cmd's was and is always a client-side feature, so the "Client" in ignoreClientAuthority is redundant

#

it's actually checked both on client and server for debugging convenience, so an unmolested client still warns if no authority but a molested client won't get away with anything because the server check remains intact.

#

devs have to add that option intentionally, e.g. on a door, to allow any client to call CmdOpen on the door object. Inside the Cmd, devs can still code for whatever server-side game logic, e.g. does that player have the key for that door in inventory.

#

but if that option isn't added by the dev, calling Cmd on an object the client doesn't own still fails.

#

The ignoreAuthority option doesn't change the message on the wire at all

#

it's not like the client is passing something in the message to override anything

weak plinth
#

how would u do pre-game lobbies like in fortnite or csgo?

#

im using mirror for the actual gameplay but idk what i should do for stuff like friends/friendlist/lobby

viscid tree
#

hi, how do i use Photon PUN and Photon Chat at the same time

#

like a game and a chat

jade glacier
#

You should ask in the Mirror discord @weak plinth They have some built in stuff for that I am sure.

hallow perch
#

Does Mirror have a NetworkMatch class? I'm following a old unet tutorial and it doesn't seem to be anywhere. Trying to create one with networkMatch = gameObject.AddComponent<Mirror.NetworkMatch>(); just gives red "doesn't exist" lines and trying to create one with networkMatch = gameObject.AddComponent<NetworkMatch>(); gives a deprecated warning, and I'm pretty sure it won't interface anyway.

spring crane
#

It's probably deprecated

#

@weak plinth Constantly running servers, server list, additional service for social

#

Social doesn't necessarily run powered by Mirror

hallow perch
#

Ah well, I didn't really need it anyway.

viscid tree
#

hi im trying to display ping for players but in the same location (top left) and what im doing is instantiating a text and changing the value to the players ping, it works fine but the problem is player1 can see his ping and player2's ping and vice versa, how to fix?

weak plinth
#

@spring crane run on what then?

jade glacier
#

Not sure which lib, but none of the libs really let you ping like that. Players are not aware of other players connections.

#

@viscid tree

#

Clients can ping the server. You could come up with an internal method where the server pings other clients, and returns those values to everyone - so they can add that to their own ping to the server.

viscid tree
#

okay its photon

jade glacier
#

Clients don't talk to one another. They all talk to the relay

viscid tree
#

sorry for my bad english its so hard to explain what's happening lol

jade glacier
#

Client -> Relay -> Client

#

clients do not have the ability to ping one another

viscid tree
#

okay so basically i have two texts in Unity and both players see

#

each text is has a number which is the players ping

#

but the player can only see one since it's him ping only

jade glacier
#

you can have each client broadcast their ping results with an RPC

viscid tree
#

ok ignore the ping its just the ui text thats overlapping

#

does it have to do with photonView or something im not understanding this very much

#

im looked it up but didnt find any questions for it

jade glacier
#

I don't actually follow the question, sorry.

viscid tree
#

wait ill show you

#

okay so im player2 right now and the above ping im not sure if you can see is overlapping with another number

#

the another number is PLAYER1 his ping

jade glacier
#

Offset it based on the player.ActorId or something

#

Though you would typically generate that list by iterating the dictionary/list of current players in the room

viscid tree
#

is there no solution other than offsetting because i really want it that place

#

also generating what list, and how do i get the list of current players in the room

#

i'm literally started doing this yesterday

jade glacier
#

There are a few options. One is to generate the contents of the text UI by iterating through the CurrentRoom.playerList or whatever.

viscid tree
#

contents as in the text?

#

or the position?

jade glacier
#
Player 2 - 100ms\n```
#

This is more of a Unity question than a networking question I think

viscid tree
#

ok, so i think you misunderstood, but i found a solution myself but it needs to know something

#

so here is a part of my script that checks if scene loaded and then adds the players and ping text

    private void OnSceneFinishedLoading(Scene scene, LoadSceneMode mode) {
        if (scene.name == "RoomScene") {
            CreateScene();
        }
    }

    private void CreateScene() {
        PhotonNetwork.Instantiate(mainPlayer.name, mainPlayer.transform.position, mainPlayer.transform.rotation, 0);
        PhotonNetwork.Instantiate(debugStatus.name, debugStatus.transform.position, debugStatus.transform.rotation, 0);        
    }
#

debugStatus is ping tex

#

but i found the problem, when i check, it instantiates UI Texts as much as there are players

#

so thats why 2 players overlap

jade glacier
#

networking instantiating UI is generally going to be messy and not the way to go with this

viscid tree
#

but what i want to do is check like PhotonNetwork.IsGameObjectExisting(mainPlayer.name, mainPlayer.transform.position, mainPlayer.transform.rotation, 0);

#

so that it doesn't duplicate

jade glacier
#

I'll try re-reading one more time to see if I can understand your question

viscid tree
#

wait i think i found a solution

#

let me test and ill be back in a few minutes

#

okay im almost fixing my problem

#

but i all i need it to find out how to get the ping of a PhotonView component

#

like this

PhotonView photonView = GetComponent<PhotonView>();
photonView.player.getPing() // ????
#

just an example of how it WOULD work

#

@jade glacier

jade glacier
#

components don't have ping, PhotonNetwork is where you find most of that.

viscid tree
#

alright can i find a ping of a owner of a photonView? or from a ownerId?

jade glacier
#

PhotonNetwork.GetPing() gets you the ping for this connection to the relay

#

You cannot ping other players

#

Players only know their ping to the relay

viscid tree
#

okay so in that case, how do i go about making a singular for each player for example:
in player1's hierarchy there would be two players him and player2 and one debugstatus for his ping
in player2's hierarchy there would be two players him and player1 and one debugstatus for his ping

#

before it was:
in player1's hierarchy there would be two players him and player2 and two debugstatus's for his and player2's ping
in player2's hierarchy there would be two players him and player1 and two debugstatus's for his and player1's ping

jade glacier
#

Im getting lost on your question, sorry. Not sure I can help much more than I have.

viscid tree
#

also why is photonView.owner not working?

jade glacier
#

How so? Owner is not the same as controller btw.

#

Owner is the default controller, usually the player that instantiated the object (creator)

#

If it is a scene object, by default the owner is null / 0

#

This doc is part of some work we are doing for the next release, it indicates the definitions/behaviors of creator/owner/controller and IsMine.

wooden swan
#

Anyone know why SpawnBlock isnt even being called?

spring crane
#

@weak plinth Anything that isn't built to run on some Unity instance

weak plinth
#

I just wanna save as much time as possible, don't wanna write unnecessary code if there is a simple solution for this

solar garden
#

Is there cases where whe want data sent reliably but not ordered ?

gleaming prawn
#

short answer is: there could be

#

We do use this in Quantum... BUt there are other use cases

jade glacier
#

Reliable unsequenced lets you ensure a packet will arrive, without holding up other packets if packetloss occurs.

gleaming prawn
#

yes, so they arrive slightly faster in some unstable conditions

solar garden
#

But for what application ?

#

using a button ?

#

fireing a gun ?

#

because unreliable is for positions reliable ordered for commands and i fail to see where you could use reliable unordered

gleaming prawn
#

We use this idea in quantum, because predict rollback benefits from it

#

The sequence is embedded in the data that is transfered

#

And there're benefit of receiving something even with a Gap (that will be filled later)

#

The immediate prediction is more accurate, etc