#archived-networking

1 messages ยท Page 86 of 1

violet scarab
#

Ah ok

gleaming prawn
#

But you specifically asked about UNet, so I said that

#

I'm not dropping personal option or anything.

violet scarab
#

I knew UNET is deprecated, but i believe i can use it still. Since i know it a bit more, i thought i could use it even though it will be removed.

gleaming prawn
#

You can

violet scarab
#

Thank you for the answers though.

gleaming prawn
#

but it's FULL of bugs

#

That the devs of mirror and mlapi tried to tackle at least

#

UNet = abandonware (in non final state)

#

Also, it's public that Unity hired the original developer of MLAPI

violet scarab
#

Ok, i will consider that, do you know a networking solution that can work on steam ? I don't want to go into steam low level api.

#

Or MLAPI can do that ?

gleaming prawn
#

What you should be asking instead is:

  • what kind of netcode does my game needs?
#

If you think UNet (as an API) fits that, then ask these questions targetting Mirror and/or MLAPI (which I'm not one of the devs of)

#

I do not know the answer. Just guiding you around what actually is at least Useable

weak plinth
#

Everyone should just use Photon.

gleaming prawn
#

Photon itself (on the Unity space) offers 4 very different netcode solutions

#

IMHO, it's your gameplay (not your personal preference) that defines which option is best

#

Disclaimer: I'm one of the developers of Photon Quantum

violet scarab
#

My actual problem is not which solution actually, i wonder if i can create networking without using steam api too much, for steam

weak plinth
#

Personally i got a group of 20 people to test a game that was hosted with UNet, then Photon and then Mirror. Photon was working the finest.

gleaming prawn
#

But still pointing to where you can get info about Mirror, etc, as I never try to "sell" much

#

I assume by Photon you mean PUN/PUN2 @weak plinth

weak plinth
#

Yes.

gleaming prawn
#

My actual problem is not which solution actually, i wonder if i can create networking without using steam api too much, for steam
You can, of course

#

All solutions work for most platforms... You asked specifically if they had a layer to work ON TOP OF steam transport...:)

violet scarab
#

Ah, is there a document that says what to do it, cause i don't know how to.

gleaming prawn
#

I mean... For Mirror on top of steam, or MLAPI on top of steam, again: you need to ask in their own discord, check their docs

#

If you want to try photon (I work there) or other solutions, you do not need to have anything related to steam to use them,

#

Steam will be "free", assuming your game works well enough with these APIs , etc

#

BUT, there will always be a lot of setup involved, and you'll need to use Steam's API for matchmaking in that case, etc

#

So, you need to invest a bit more time into this topic

#

To get your full answer

violet scarab
#

I got it thank you, since you are here with photon i want to ask an another question about somehing else as well

#

Does photon have separate dedicated server for persistent worlds ?

#

Or how can you push to mmo with headless unity

#

Considering transform syncs and some other messages, how many players can be online concurrently

#

@gleaming prawn

gleaming prawn
#

Or how can you push to mmo with headless unity
There's no way you can do MMOs with Unity headless instances

#

Sorry, but I can not answer you questions if that is what you are trying to do

#

my short answer is: do NOT try do do anything you call an "MMO" unless you have years of experience with mutiplayer games and know exactly what you are talking about.

#

This idea you can host "mmos" with these basic techs is just not founded in reality

violet scarab
#

but can photon do it

gleaming prawn
#

PUN/PUN2, NO
Bolt, NO
Mirror/Unet/MLAPI, NO (whatever they tell, it just can't)

#

Quantum, may be good for instance-based small Raids... (which are a small part of mmos)

#

General overworld CAN be done with Photon Server (modifying the server SDK). This is what ALBION online uses

#

So, what I'm trying to tell you is:

  • even your question does not make much sense yet...:)
#

By MMO I mean a game with a few thousands, or tens of thousands of players seamlessly moving around a shared persistent world....
This is A LOT more than just doing basic state sync

jade glacier
#

No one who hasn't made any complete networking titles with some success should even be considering trying to develop an MMO alone.

#

I expect there is about a 100% failure rate for people trying to pull that off as a successful game, much less a game that actually is ever even playable.

#

MMO of course meaning a wide range of things. "Massive" can be a bit subjective.

violet scarab
#

Thank you for answers and your time again, this was just a question to learn about those networking solutions.

jade glacier
#

I would start by doing tutorials for Mirror and Pun2... if you have zero experience. You can at least then start to speak the language of game networking, and see where the difficulties are.

#

Once you see where those run into problems, you can start to see why solutions like Quantum exist

gleaming prawn
#

Or finish games with these other ones

#

Plenty of people just doing that...:)

violet scarab
#

@jade glacier ah no, my initial question was to know how to work with steam by not using it completely for the networking

jade glacier
#

Mirror has a Steam transport.. though not sure how well that works out for people.

#

But you could start by doing a Mirror tutorial using Steam and see what you learn.

gleaming prawn
#

If you take the 3 most recent successful games (made with Unity), they all use very simple networking:

  • Among Us (custom relay, similar to photon realtime in architecture)
  • Phasmophobia (PUN)
  • Fall Guys (custom client-authoritative solution)
jade glacier
#

Pun is typically the easiest to get rolling and deployed, but there are drawbacks being a fully relay model.

#

But that is why Pun2 is a pretty popular starting point. Warts and all, it does get you deployed quickly.

#

Mirror is quick to get rolling with, but you will eventually have to deal with the hosting question. But using a Unity exe as a server opens the door for server auth - which for some game types is a must.

#

MLAPI is a variation of Mirror (they both are modelled after UNET, which was modelled after another library I am forgetting the name of)

violet scarab
#

I just want to have one player as host, and let him invite his friends to the game via Steam.

gleaming prawn
#

On top of Steam, Mirror should NOT need rolling out servers

#

Assuming game is fine with running player hosted etc

#

I just want to have one player as host, and let him invite his friends to the game via Steam.
Give a try to Mirror Steam integration

violet scarab
#

I will look into it

jade glacier
#

If you specifically want a player as host (for true server authority) then start with Mirror. If you are going to be mostly client authority and you just need a client as the final authority, Pun2 assigns one client as the Master Client.

#

Most of what we say here will just sound like noise. Until you have done tutorials and made a semi-working demo for both Mirror and Pun2.

#

Once you have some experience with those, you can start asking the right questions, and the answers will make more sense.

violet scarab
#

Thank you.

candid flame
#

Hi all! We recently published the second episode of our multiplayer tutorial using Voxel Play and Mirror. Check it out: https://youtu.be/VTYjDz3iEVc

This is part 2 of a tutorial series about creating a battle-royale game using our Voxel Play asset for Unity and the popular Mirror networking framework. I hope you enjoy it - subscribe and stay tuned for future episodes!
In this video we'll learn how to propagate chunk change...

โ–ถ Play video
barren onyx
#

Very cool! @candid flame!

magic vessel
#

What's a good way to test your netcode locally? I'm imagining something that lets you create a "synthetic" network where different processes can get fantasy ip's and ports.

As it is, I'm able to readily test a single client, but multiple clients from the same machine can't share those ports. As a last resort I can set up a test machine on this network, but this feels like one of those "some smart developer knows about your lazy and has fixed it."

barren onyx
#

@magic vessel If your machine have enough CPU and RAM, Virtual Machine is often the best to test run your code.

stable epoch
#

@stable epoch What networking solution are you using
@mortal horizon
Photon, but its more of should i be spawning it from player? Should i have it on the characers prefab? Etc

winter stirrup
#

Has anyone here used the CharacterController together with client-side prediction?
CharacterController seems to be behaving strangely (sometimes the step traversal mechanic which is supposed to be handled by the CharacterController sometimes only works partially (can't climb entire staircase on the server, but works fine on the client) and I cannot for the life of me figure out why the reason for that could be. The input given to the .Move on the server is the exact same as the client

mortal horizon
#

@stable epoch what exactly are you trying to achieve? Are the networked players prefabs the same as the local player prefab? or if theres a networked player in the scene are you using a different prefab?

grim goblet
#

Hey guys

#

Could anyone recommend me any free networking framework for unity which is the best and runs well on an low end PC?

mortal horizon
#

mirror @grim goblet

floral turtle
#

@magic vessel are you hosting the sessions locally? You can connect as many clients as you want from different executables to the host on localhost (I've done up to 4, but no reason you can't do more)

high night
#

@grim goblet networking related stuff are often not the bottleneck in overall performance

#

unless you do some heavy prediction work

ember thunder
#

Hey umm anybody know where mirror docs are?

#

i cant google it my browswer isint opening

small cairn
#

i cant google it my browswer isint opening
@ember thunder change browser

ember thunder
#

what

#

no

#

i fixed it

#

i found it too

gray pond
#

@ember thunder Mirror's discord can be found on the asset store page, along with the link to the docs

#

I'd link it directly but this discord doesn't permit it.

ember thunder
#

oh

#

ik i joind it already

#

also my game immediately crashes on start(build version)

weak plinth
#

Hello, I have a problem with connecting both players and redirecting them to a different scene. The problem is that one cannot see the other (probably), namely, my code does not inform the other player that the first is in the room. As a result, both players wait for the opponent to no avail.

#

Would you mind me to help ?

oak flower
#

You should use third party host like http://hatebin.com/ to make your scripts more accessible so people would see them.

weak plinth
still pier
#

Hi, Does LiteNetLib need the server for the client to connect or can I use a custom server written myself?

ember zealot
#

have someone seem Normal2?

frail steppe
#

hello, does anyone know whats the system called for the lobby code generation which can be seen from Among Us and Phasmophobia?

prisma imp
#

Guys, i saw things like mirror, pun, photon and others, where can i find or read the good and bad part of it ?

thick mural
#

hello..is it possible if 2 client connect with webgl?

somber drum
#

@prisma imp google brings up a number of discussions

prisma imp
#

Please help give me link :)

#

And what about unity's own multiplayer system, i just read, they stop it since 2019, when will it be available again ?

somber drum
#

I wouldn't be waiting on unity's multiplayer

prisma imp
#

Why ?

somber drum
#

google brings up a number of discussions, that has been asked countless times

prisma imp
#

Oh oK

lusty crow
#

but it depends on your requirements,
for example, Mirror is a great replacement for the old HLAPI unet, it adds some high level abstractions to networking and beneath, it uses lower level libraries for the transport part. By default I think it's telepathy, but you can use other libs too, someone wrote a layer that uses LiteNetLib for transport for example

tall storm
#

Hey guys is there a photon project or a reference where i can learn how to create a room and let others join thay room by putting in the name of my room?

#

I am stuck at this

#

Please help its very important ๐Ÿ˜ญ

somber drum
#

@tall storm have you tried the examples photon comes with?

#

have you tried youtubing this topic? there are many that walk you through, step by step

azure crown
#

If I want to use Dedicated Servers for a game of mine, and I want to use Photon Bolt, would I need some sort of hosting service for the servers?

weak plinth
#

Hello all! I want to recreate Among Us using the Photon Engine. Iโ€˜ve read docs and also did some games before with it. Can someone tell me how I can pick out random players and give them a role. Like 1 of all players are imposter thxx

prime beacon
#

@azure crown players can be host or if you want your own servers acting as auth server

#

yes you need to deploy your headless instances to any provider like Amazon

azure crown
#

I want auth servers

#

Because if its a player hosting when he leaves then all players will exit

prime beacon
#

@weak plinth let your master client create tag for everyone then send them RPC/RaiseEvent however you like

#

@azure crown you can make your own host migration

#

its really expensive to deploy your own servers

azure crown
#

@prime beacon Alright, thanks for the info!

weak plinth
#

Hello, I am using a PUN2 in my project and i want to "find opponent" to enter next Scene. It follows that everything should be fine, but when the second player starts searching, he doesn't find the first one who has already created a room. What could be the reason ?

worthy marlin
#

Quick question: I'm trying to pass a prefab into a Mirror command, but the server always receives null instead of the prefab. Is what I'm trying to do possible, or do I need to find another way to do this (e.g. make a ScriptableObject that associates each prefab with an ID, then pass that ID into the command)?

weak plinth
worthy marlin
#

Nevermind, I think what I'm trying to do will be easier if I pass in an ID regardless of whether the alternative is possible.

lunar orchid
#

Why is it in mirror, only when i use localhost, it connects. When i use my public ip, it won't connect.

#

I have port forwarding on the port i am using

#

it just times out

jade glacier
#

If your firewall works correctly, and you have the correct port and the correct tcp/udp setting... should work.

lunar orchid
jade glacier
#

not really. Your port forward seems to be failing. And by firewall I mean the firewall on your router - where you set the port forwarding.

lunar orchid
#

firewall on my router...

#

oh

#

i just realised

#

the internal ip that i'm forwarding is different, thought that the router called this "mac" not a "mdp"

gray pond
brittle nymph
#

@gleaming prawn Among Us use a custom fork of Hazel, a LL API made by the same of DarkRift2.

https://github.com/willardf/Hazel-Networking

This fork has been heavily modified from the original to reduce allocations, copies, and locking. As such, it's fairly stable, but not guaranteed. However, my game Among Us currently runs on it with over 500k MAU, so that counts for something.

gleaming prawn
#

Thanks. What I meant is that on top of hazel he built his relay system, and the gameplay netcode is 100% client authoritative as in most relays.

azure crown
#

How does Unity Mirror work?

#

Like is it dedicated servers or...?

ember thunder
#

no

#

the client either can host their own server and play in it with Server+Client option and people can join those servers with the Client option but a person could host their own server only

lusty crow
#

it's just an open source framework, so you can either self host, or put your app on a host etc

azure crown
#

Aha, I get it. So could I technically host servers with some 3rd Party app?

lusty crow
#

you probably could, it's just the library - Mirror. It's not bound to a service like photon, which often requires you to use their infrastructure (I think a few of their products let you host on premise or on your own instances, but not sure)

azure crown
#

Can I use AWS with Mirror?

prime beacon
#

sure

#

you can use any hosting

azure crown
#

Awesome!

#

On the AWS website it says that you can have up to 200 players per room :O

prime beacon
#

players per room is not directly related to host/machine

#

what mostly matter is how efficient you use resources (cpu, bandwith etc)

rare root
#

Hello everyone, I am looking for a solution to call JS functions external to Unity in WebGL, do you have any leads? Knowing that Unity offers an internal JS function management system with a .jslib in the "Plugins" folder, but I would like my JS functions to be in an external file.

lusty crow
#

hmmhh, if you have a jslib linked, you could maybe have a js method which purpose it is to read a file from the server which contains the method you want to execute and run an eval() on it, sounds pretty unsafe to me though

#

or maybe you can load the js file beforehand in the index.html that loads the webgl game instance, so you would have the other methods callable in the js scope that the webgl instance uses

forest merlin
#

I'm getting ER_DUP_ENTRY from MySQL database when client sends data to backend. This means that no data is updated to the backend because there's already some overlapping data in the client and DB.

Is there some SQL command that I can use to avoid causing this error, i.e. someshow handle the request gracefully, not update key if it already exists, but still complete the procedure for other keys. SQL Insert/update etc.?

slim ridge
#

try/catch?

trail parrot
#

For an invisibility skill, and some units can have like Truesight passive

Is the right approach, modifying the observer list in its AOI
Or straight up hide renderers/colliders etc?

I'm thinking the former, for bandwidth and so cheaters can't detect packets from invis units
But idk

still pier
#

Hi when working with networking concepts, should the client send a message to the server first on connection or the server send a message to the client first when they connect

jade glacier
#

Once they are connected, there is no rule for who talks first.

#

What is in this message?

still pier
#

Hello and then hello back. And some initialisation stuff

jade glacier
#

No answer for that. The answer is whatever your game needs it to be.

#

That they are connected, means they already said hello

still pier
#

I think I have answered my own question. The client needs to send info about itself to the server for initialisation

#

Thank you for your help tho

jade glacier
#

np

winter stirrup
#

How do you guys handle player rotation in your games? Currently I am controlling my player's x rotation in Update(), then performing Move using a charactercontroller as well as sending the rotation (along with other input) to the server (server authoritative) in a FixedUpdate()
Currently, this works fine in all scenarios except when players collide, where they sometimes have the tendency to behave slightly differently from client-to-client, causing desync issues

jade glacier
#

Mixing update and fixed like that will produce jitter and frame dependency. So be sure to calculate position in both fixed AND update.

#

Unrelated to your problem... Just a side note.

winter stirrup
#

I appreciate it nonetheless, but i'm not quite sure if I have that problem atm

#

maybe I can try to elaborate on how my movement works

jade glacier
#

It will be micro jitter. Not your biggest problem atm

#

Server auth with client prediction is difficult

winter stirrup
#

yeah, i've realized that

#

kek

#

basically in Update I only control my player rotation

#

and in FixedUpdate, I do just about everything else

#

since it is (supposedly) single-threaded, I don't understand why there'd be problems

jade glacier
#

That will definitely create micro jitter

#

Your server auth model sounds a bit trial and error. Are you following a model you read about?

winter stirrup
#

I've read a bunch and watched some videos

jade glacier
#

Using CC in update will absolutely create desync

#

This is the deep end of networking, you'll want to read up more on state transfer with client prediction.

#

You are already down a bad path

winter stirrup
#

yeah I've had some problems with the charactercontroller

#

essentially I use my fixedupdate as tick counter

#

every tick, clients send input and their current rotation, then apply those input etc. via a .Move()

#

the server then replicates the same, albeit a bit delayed of course

#

there are no synchronization issues apart from (sometimes) when the character collides with each other

#

the rotation is pretty much the only state a player can have rn (not counting inputs such as go forward, jump, etc)

jade glacier
#

That sounds very non deterministic and hard to resync

winter stirrup
#

How come?

jade glacier
#

It's just not a standard client prediction model. What are you modeling this after?

#

Any tutorial or known game?

winter stirrup
#

well I looked at how quake did it, and valve networking

#

I don't know how they handle rotation though

#

but they don't communicate their positions from what i can gather, only input

jade glacier
#

The actual rotation can be sent, since it doesn't apply like input

winter stirrup
#

well they broadcast the positions from the server

#

so the other clients can interpolate

#

and actually see whats going on

jade glacier
#

.Move though ties that controller to your simulation in an odd way

winter stirrup
#

I thought the CharacterController was deterministic

jade glacier
#

You move in update but not fixed... So you have all kinds of weirdness going on with capture and remote apply timings

winter stirrup
#

I .Rotate in Update

#

I move in Fixed

jade glacier
#

Where do you capture the state?

winter stirrup
#

in Fixed

#

wait, which state do you mean?

jade glacier
#

I'm on a mobile and this conversation is about to require more typing than I have time out the ability to do unfortunately.

winter stirrup
#

thats fair enough man

#

you're doing this for free anyhow

jade glacier
#

You are starting with a bad CC for touch based simulation... So resim is going to be a nightmare.

gleaming prawn
#

Are you keeping a history of the positions from each call to move?

#

So you can rollback and rensimulate forward?

jade glacier
#

The client keeps it's history yes

gleaming prawn
#

Do you have a fixed tick controlled from server?

#

Then you CAN do it

winter stirrup
#

Yes and yes

gleaming prawn
#

It does NOT need determinism

jade glacier
#

And compares that with the server states later

winter stirrup
#

I need to have a history of previous player positions/rotations

#

on the server

#

to do things like hit detection

gleaming prawn
#

No jo

jade glacier
#

If the server state disagrees, you are in desync

gleaming prawn
#

That is server lag compensated raycasts

jade glacier
#

And you need a resim

winter stirrup
#

Never heard of those :p

gleaming prawn
#

I though you were talking about client side prediction and reconciliation (rollback)

winter stirrup
#

Ah, currently its more about preventing the desync

#

in the first place

#

aye?

gleaming prawn
#

Well

#

Then it's about reconciliation

jade glacier
#

Taking about rewinding shots? Or client predict. Server auth is a massive topic

gleaming prawn
#

It happens on the client side

#

To avoid the desync you need a room llback buffer of positions + commands on the CLIENT

winter stirrup
#

My issue is that the server movement and client movement is not 1:1 in a simulated environment with no lag, lost packets, etc

gleaming prawn
#

Not the server

jade glacier
#

I'm doing this conversation in a tiny window, so I may not be answering the right question

gleaming prawn
#

It will not be 100% same

#

The server has authority, always forward

#

It sends back confirmed positions, with a tick

winter stirrup
#

The client is technically forward for me

gleaming prawn
#

Client rollsback to the server sent position, resinulates forward all commands from that tick up to present

#

Done

winter stirrup
#

since it performs the Move() before the Server gets it

jade glacier
#

You are simulating in update on the client... That right there is instant desync

gleaming prawn
#

It's not emotitron

#

This is basic client prediction

winter stirrup
#

I don't get why the rotation could give me desync when its just that though

gleaming prawn
#

Can be done, does not need any determii

winter stirrup
#

All moves that are EVER applied

gleaming prawn
#

You need to rollback on client

winter stirrup
#

Capture their rotation

jade glacier
#

What are we calling an input?

gleaming prawn
#

I'm typing from phone as well

winter stirrup
#

WASD, Jump

gleaming prawn
#

But you should read about client prediction and reconciliation with rollbacks, that is what you are trying to do

winter stirrup
#

Erick I have and will do more, but I don't think I should have any desync issues if I do it correctly as I think emotitron can maybe tell me

gleaming prawn
#

You need a tick based sim, with a server synchronized clock, a buffer of local client commands (for each tick), and server sends down actual position/rotation...

jade glacier
#

How are you applying these inputs then? immediately as they come in?

winter stirrup
#

No, every Tick (FixedUpdate)

gleaming prawn
#

You rollback client to that POS/rot, reapply commands locally in one shot to reconciliate

#

Rinse repeat

#

Fixed update is NOT a synchronized ticker

jade glacier
#

If you are applying inputs in Update on client, but applying them on Fixed on the server... that is going to be a problem without careful coding.

gleaming prawn
#

It does not matter, even if you apply both on fixed, you need snychronized clocks

winter stirrup
#

isn't fixedupdate supposed to fire every x seconds

#

as i specify it

jade glacier
#

That comes next yeah, I am just flagging problem #1 here which we agree on... you have NO real concept of tick being enforced

gleaming prawn
#

Not n two different machines

#

It's not synchrnonized

#

Hardware clocks drift, and a lot

#

That is why I asked: do you have a tick based simulation, with a synced clock?

#

That's the first thing you need here...

winter stirrup
#

welp, I guess i dont then :p

gleaming prawn
#

That is what is built in all these (good) high level netcode tools, unreal networking, source, photon bolt, etc

jade glacier
#

For my stuff I just used ticks, and if the buffers wander to far it corrects with an extra sim, or a skipped sim... but same result. You have synchronized ticks.

#

Update ideally is ONLY for tween/lerp/interpolation of the fixed states

winter stirrup
#

How do I apply rotation then? if I do it in FixedUpdate, it feels reaally wonky

gleaming prawn
#

You may use the tick stream from the one machine + compensate for ping + smooth to have a roughly.synced clock reference from THAT machine

jade glacier
#

Rotation is the least of your concerns right now

#

I personally would back up, and entirely get out of Update. Do everything in Fixed and don't interpolate yet.

gleaming prawn
#

Rotations must be assumed the ones from the client, assuming this is an FPS

winter stirrup
#

I don't interpolate or anything

#

not yet

gleaming prawn
#

And you probably send a shot with a direction as well

jade glacier
#

You are using Update... you are interpolating

winter stirrup
#

right now I'm just trying to do the basic movement

jade glacier
#

Update = interpolation

winter stirrup
#

oh

jade glacier
#

(or extrapolation)

winter stirrup
#

I was thinking of something else

jade glacier
#

it is frame based... networking is tick based.

#

Focus on the ticks first.

winter stirrup
#

@gleaming prawn yeah man, i send the clients current rotations and they are applied serverside

jade glacier
#

Once you have it working, use Update to smooth it all out.

winter stirrup
#

but of course i'm doing it completely wrong apparrently, by donig it in fixedupdate among other things

#

so i am a bit confused now

gleaming prawn
#

Networking is not easy....:)

jade glacier
#

For like an FPS, I consider rotation to be a direct input - not sure what the standard view is on that though.

gleaming prawn
#

Nothing to be shamed about

#

It's a lot of learning and trial and error

winter stirrup
#

are either of you familiar with mirror?

jade glacier
#

This stuff takes like years to get half decent at.

#

Too familiar yes

gleaming prawn
#

I'm one of the Devs of photon quantum

#

Mirror is not a high-level netcode framework

winter stirrup
#

all their documentation uses client authority so i don't have much to go with kek

gleaming prawn
#

So it is not comparable with photon bolt, or with what you want to do

jade glacier
#

My asset supported Mirror for years, and it dealt with exactly all of this.

winter stirrup
#

at least from what i could gather

#

damn i'm speaking to experts

#

should have asked here earlier lol

#

would have saved a looot of time

gleaming prawn
#

I guess the simplest tick based netcode would be emotitrons SNS for pun2

jade glacier
gleaming prawn
#

Mirror, without mentioning its pros, is based on just transfering state, not dealing with these simulation topics

jade glacier
#

It is what most of us called "ad hoc timing based" rather than "tick based"

gleaming prawn
#

It can be done on top of mirror, yes

winter stirrup
#

you don't think mirror is very suited for server authoritative movement?

gleaming prawn
#

But requires A LOT

winter stirrup
#

I considered switching to MLAPI tbh

gleaming prawn
#

Mlapi is the same

jade glacier
#

Basically the same set of limitations with MLAPI yeah

winter stirrup
#

with all due respect I wouldn't go with photon, because of the pay for CCU

gleaming prawn
#

It does have less allocations, etc

jade glacier
#

Not going to get into that discussion.

gleaming prawn
#

We'll, mirror and mlapi you pay for expensive servers...:)

winter stirrup
#

I thought I could set up my own, but yeah I guess that's another discussion

gleaming prawn
#

So it's your choice to whom and how much money to oay

jade glacier
#

There is no free ride in networking, you will pay for it somewhere.

winter stirrup
#

its faaaar in the future anyways, if at all

gleaming prawn
#

Your own in your house? For Lan games yes

jade glacier
#

IF you are building for lan, none of this matters

gleaming prawn
#

For anything online, headless instances are not super efficient. But that is another story

winter stirrup
#

Nah, it would be public

#

I didn't mean my own servers as literally my own

gleaming prawn
#

Focus on writing the game, studying the topics you are discussing here

jade glacier
#

If it is on the internet, you have to learn the architectures and pick the one that makes sense for the game type.

#

Avoiding CCUs should not be the deciding factor. Architecture should be.

gleaming prawn
#

Do not pick the tool because it's free... That is not a technical reason....:)

jade glacier
#

But first, make tutorials.

gleaming prawn
#

You can learn a lot from all these

#

And decide later what to use

winter stirrup
#

tbh I just think that so far, all the client authoritative stuff was really interesting and fun to learn

#

although I suppose I am a bit misguided since i do the tick stuff completely wrong apparrently rofl

jade glacier
#

Client Auth still wants ticks

winter stirrup
#

I figured i'd have each machine have a tick counter in their respective fixedupdate

gleaming prawn
#

Ou need to know the tick counter of the other machine

#

In your case the server

#

That is the trick

winter stirrup
#

Yeah, it would continuously communicate it

gleaming prawn
#

Omoensated for rtt

winter stirrup
#

in case of lag

gleaming prawn
#

Exactly

winter stirrup
#

So that it can choose to ignore some ticks if say, the delay suddenly is reduced

#

otherwise the lag will stay because the tick counter is at the same "delay" if that makes sense

gleaming prawn
#

As I said, can be done in mirror, mlapi, pun (and does it)...

#

Its something built in photon bolt, unreal or source

jade glacier
#

Depends on your needs. Some things you can disregard late updates. Some things you may want to resim for late updates.

#

All of this is VERY advanced.

winter stirrup
#

Can you give me any hint as to how I would do it, what sort of method, if any?

jade glacier
#

Start with Mirror and Pun2 tutorials

winter stirrup
#

or is it way lower level

gleaming prawn
#

It's a lot of stuff

#

There's the blog.of that Italian guy Davin

winter stirrup
#

I've watched a lot man, but I couldn't find any that explained this in depth :/

gleaming prawn
#

What is his name?

jade glacier
#

don't make a real game yet, or you will be lost for a year refactoring failed attempts over and over.

gleaming prawn
#

The one linked by that offensive guy.. lol

jade glacier
#

I hope his name isn't Davin

winter stirrup
#

ah yeah, I'm only implementing what we're talking about atm

gleaming prawn
#

There is a very good informative blog by this Gabriel something guy, sounded itallian

jade glacier
#

<- My name is Davin, but I am not an italian blogger.

winter stirrup
#

server auth movement i suppose

gleaming prawn
#

I asked you Davin, if you remember

#

Lol

jade glacier
#

oooooh

#

LOL

#

yeah for small text

winter stirrup
jade glacier
#

That one comes up often lately

gleaming prawn
#

Yes yes

#

This is good info. I have not read in detail

#

But the topics sound legit

jade glacier
#

Before doing that, I would really just get some basic poorly designed client auth examples made to get comfortable with the libraries.

gleaming prawn
#

Other than that, source networking from valve, all docs

winter stirrup
#

but is there not 1 right way to make a tick counter?

gleaming prawn
#

Tribes networking model (paper)

winter stirrup
#

ah ye, read some of the valve stuff

jade glacier
#

Overwatch gets a bit more complex, but the terminology is still there.

gleaming prawn
#

Send from server, compensate for half rtt, smooth for jitter

winter stirrup
#

and watched an hour long vid about how halo does it

jade glacier
#

My main advice on all of this is avoid Update early on

#

Stay 100% in tick based land

winter stirrup
#

but FixedUpdate isn't really tick based either then

jade glacier
#

once thigs are correct and agreeing, add Update code to handle lerping

winter stirrup
#

rite?

jade glacier
#

Fixed by definition is tick based... though you still have to wire things up of course.

#

Fixed is likely the clock you will want, since you are making use of physX

#

Fixed = preSimulate

winter stirrup
#

well that was my initial assumption but erick said it wasn't

jade glacier
#

He may have meant something slightly different

winter stirrup
#

or did i misunderstand

#

oh okay

jade glacier
#

He did say that you will have to manage clock drift and such

winter stirrup
#

i'm not completely off track then

#

great

#

alright well

#

the issue is

#

I tried moving the "rotate" code into myFixedUpdate

#

it didn't really fix it

#

i guess itd be really hard for you to help me here though, since you can't see my code and are on the phone

#

i really appreciate you guys' info so far, still

#

This is KINDA another problem, but have you ever had problems with the CharacterController in networking? there's another thing that's extremely weird, but I don't think the problem lies in my code because of the nature of the problem

gleaming prawn
#
  • The TIME is the tick
  • the ACCUMULATED time (for smoothing/interpolation or extrapolation) you add on UPDATE, from the timestamp of the TICK
jade glacier
#

We might be giving you different terminology here then

gleaming prawn
#

So the tick time marks a position from that timestamp (assuming a server confirmation), then you render smoothed from update

jade glacier
#

For my usage of "Tick" I am referring to simulation events

winter stirrup
#

Ah, I'm not that far yet

gleaming prawn
#

We might be giving you different terminology here then
I always assume a ticker that is based on the data source (in this case the server)

#

Simulation evens can be that, etc

#

OR maybe you are talking the local ones

#

I'll stop confusing things... Lol

jade glacier
#

For me, tick is always in relation to either simulation events

winter stirrup
#

Each client (or server) has their own tick counter for me

jade glacier
#

Terminology is messy in networking

#

Erick and I work for the same company, and we often have collisions in term definitions. That is just the nature of this industry.

gleaming prawn
#

I use ticks as the synced clock source/server etc

jade glacier
#

I think it ends up meaning the same thing

#

I am tied to Unity, so I am tied to Fixed as the simulation timing

#

thus my tick is tied to that, or every X of that

winter stirrup
#

I understand, i think

jade glacier
#

In Unity world, you don't "sync" the clocks so much as offset as needed to keep your buffers happy.

#

Though, if you use the Overwatch model that blurs a bit, as you can modulate the client simulation rate as needed to keep the server buffer happy. But that is getting STUPID complex for where you are now.

winter stirrup
#

its just reaally strange and been boggling my mind for a several days - my charactercontroller on my server side (which is moved by the server when the client tells it to move) sometimes seems to not be able to travel up stairs, or get stuck halfway

jade glacier
#

You are tied to PhysX right now, so I would stick to Fixed for now for sanity. That is where Photon Bolt and my asset operate from for ticks.

#

It is not exotic, and plays nice with Unity internals

gleaming prawn
#

ye, we do "modulate" in quantum

winter stirrup
#

Ah yeah, It did it even when all my code was in FixedUpdate

gleaming prawn
#

using the server tick

jade glacier
#

yeah, I think for what he has going right now.. that is a "deal with that later" thing

gleaming prawn
#

Fixed update is a starting point

#

Hardware clocks drift, but it takes some time

#

For starters you can use something simple

winter stirrup
#

yeah, I feel like i'll get overwhelmed otherwise tbh

jade glacier
#

exactly

#

you just want to see the concepts working

#

Get on a fixed tick, and things become much more deterministic (minus non-determinism from floats and PhysX)

winter stirrup
#

floats?

#

:0

jade glacier
#

not a concern now

#

but you will want to be familiar with determinism and its limits when you get into networking.

winter stirrup
#

are they non deterministic

gleaming prawn
#

yes

winter stirrup
#

wat

gleaming prawn
#

nothing in unity is deterministic

jade glacier
#

much of networking is the search for determinism where you can find it.

gleaming prawn
#

but this is NOT a problem for the networking model you are building

jade glacier
#

There is also absolute determinism, and just good enough determinism

#

like when you shoot a bullet, that is deterministic in nature.

gleaming prawn
#

This does not require it... determinism, or at least a low error rate is enough

jade glacier
#

if you have an origin and a direction... you know that bullets path without having to sync it every tick

gleaming prawn
#

good enough determinism
THis is an invented term I've seen a few people use

winter stirrup
#

yeah I will have errors either way when I switch to UDP

#

and will have to interpolate, rollback, etc etc

jade glacier
#

For lack of a better term. Predictibility I guess would be better

gleaming prawn
#
  • For me you are either deterministic or you are not...
  • then you can talk about how much you DRIFT
winter stirrup
#

so charactercontroller is built on top of PhysX

#

so in other words

gleaming prawn
#

The fact is that you do NOT need determinism for these eventual consistent models, or server authority... Even if things drift with an absurd rate, it would not BREAK... It would just look OFF (when reconciliating)

winter stirrup
#

its not very good for what i'm doing?

jade glacier
#

You have an actual deterministic engine, so it obviously has a pure meaning for you. The rest of us are just lacking a term for "deterministicish" ๐Ÿ™‚

gleaming prawn
#

In reality, it drifts very LITTLE

#

ANd it's definitely enough

#

its not very good for what i'm doing?
It is good enough

jade glacier
#

You are the author of your own model, we can't answer that

#

if it is good enough depends on if you system relies on it being good enough

gleaming prawn
#

He want server authority, with client side prediction... That is what I understood

winter stirrup
#

well my first step at the moment, is to make my server and client behave the exact same to the same input

#

ye erick

gleaming prawn
#

In that sense, physx with kcc is ok

jade glacier
#

For client prediction, you have to sort out how to deal with desync

gleaming prawn
#

server and client behave the exact same to the same input
You will not achieve EXACTLY this

#

Unless you have a synced tick...:)

jade glacier
#

the more non-determinism, the more they will be out of sync. You either have to correct for that constantly, or tolerate a certain amount of disagreement.

gleaming prawn
#

And it will also not be EXACTLY same due to non determinism...

winter stirrup
#

Well, NEARLY the same then :P

gleaming prawn
#

You either have to correct for that constantly
That pretty much what EVERY server authoritative netcode does

jade glacier
#

That is on you, just be aware of where your non-determinism is coming from - and figure out how to deal with it.

gleaming prawn
#

how constantly, depends on a lot of thing

winter stirrup
#

That's what I'm trying to figure out

gleaming prawn
#

Movement rate, how good the clock sync (and engine drift rate) is, etc

winter stirrup
#

I made a list of positions/rotations/tick which is constantly communicated from the server to client

jade glacier
#

Step one is make your system not horrendously broken. Get your simulation code out of Update.

gleaming prawn
#

Bolt syncs back EVERY frame for your local character

#

so this could be even 60Hz

#

At least the original code... not sure if Ramon now relaxes this and allows lower rate server command confirmations

winter stirrup
#

the client has its own list of positions/rotations/tick after each .Move as well

gleaming prawn
#

But I reckon you could reconciliate like 4 times per second or so...

jade glacier
#

Bolt I BELIEVE is fully tied to FixedUpdate, so whatever your fixedTimeStep is... that is what Bolt is. But @graceful zephyr knows that better than me.

gleaming prawn
#

It really depends on a lot of factors...

#

Again, assuming synced clocks.. lol

winter stirrup
#

and then I compare them

#

on the client

gleaming prawn
#

the client has its own list of positions/rotations/tick after each .Move as well
What you ACTUALLY need is the list of COMMANDS (movement intentions)

jade glacier
#

Bolt compiles out its own character controller btw @winter stirrup It does NOT use the Unity CC, because the unity CC is crap for networking.

winter stirrup
#

I'm not gonna use those datastructures/info for the "final" build

#

I'm only using them to check

gleaming prawn
#

you will receive the "correct" reference position from server... you need to reapply the commands/input (on client)

winter stirrup
#

whether the result of the client / server move is equal

jade glacier
#

But also because server auth means you have to manhandle simulation, which means PhysX is your enemy.

gleaming prawn
#

oh, got it

#

You also need those if you want to SMOOTH the corrections

winter stirrup
#

as in, check whether my movement is applied the same way

gleaming prawn
#

the buffer of positions locally

winter stirrup
#

because i move further

#

yeah

gleaming prawn
#

on the server you need a buffer of positions to do lag compensated raycasts (favor the shooter)

winter stirrup
#

so in other words

gleaming prawn
#

but that is another topic altogether

winter stirrup
#

using unity's CC is a mistake

#

in my scenario

gleaming prawn
#

No

#

Not IMO

jade glacier
#

You might need to rework it a bit

gleaming prawn
#

I think you can make it work just fine with it

winter stirrup
#

I could easily make a rigidbody controller

#

but I thought that was even worse

gleaming prawn
#

It is not the source of your issues now

jade glacier
#

Resimulating it is a bit problematic is all as it is. @winter stirrup

gleaming prawn
#

Rigidbody is worse

#

way worse, for that

winter stirrup
#

Kinematic maybe?

gleaming prawn
#

KCC... Kinematic CC

#

That is what a CC is

winter stirrup
#

I mean kinematic rigidbody

gleaming prawn
#

A Kinematric Rigidbody is a very rudimentary and bad KCC

jade glacier
#

yeah, KCC typically is considered the gold standard

gleaming prawn
#

Do with a proper CC

jade glacier
#

and he did code in better networking friendliness

winter stirrup
#

KCC

#

uhh

#

whut

#

wheres that

gleaming prawn
#

The Unity CC can be repositioned manually, can't it?

jade glacier
#

Kinematic Character Controller I believe

gleaming prawn
#

Just position back the transform, then .Move again

winter stirrup
#

is that something someone else made?

gleaming prawn
#

it's a TERM

#

Means Kinematic CC... There are many many ways to do it

winter stirrup
#

oh, I thought you were referring to something specific

jade glacier
#

For this first test, you might want to avoid controllers

gleaming prawn
#

Basically using shape casts, etc

winter stirrup
#

like the character controller asset

gleaming prawn
#

the CC asset is internally made with shape cast

winter stirrup
#

mate I know some of those words

#

keyword some

gleaming prawn
#

It's just bloated with simplified assumptions

#

KCC is a topic that is very complicated

#

because each game has different needs

jade glacier
#

You are taking on a lot of things at once here btw

winter stirrup
#

well, you say that my charactercontroller is proobably not the source of my issues atm?

jade glacier
#

If you haven't made a basic goofy simple game with pure client auth, you are in WAY deep.

winter stirrup
#

but more like, later issues would arise

#

ah I kinda have

gleaming prawn
#

IMHO:

  • use the Unity CC... Reposition it manually (transform) when you get an updated position from server
  • run both the re-sim + the prediction forward with its .Move
#

Then, interpolation... Hmmm... Lol

jade glacier
#

That should get you close enough resims I think. Also not sure about interpolation in that use case.

gleaming prawn
#

You will want to write your own KCC later on, based on shape casts, maybe maybe

jade glacier
#

You will have to tolerate some slop in your client auth desync checks

winter stirrup
#

there's just some unexplainable stuff with the unity CC atm

#

like how it sometimes refuses to climb stairs

#

halfway

gleaming prawn
#

until you smooth the networked receive things

winter stirrup
#

i really don't get why it'd do that

gleaming prawn
#

Does it hand in a LOCAL test?

winter stirrup
#

a local test?

gleaming prawn
#

I have no idea if the unity CC is stateless (meaning it just assumes the position from the transform and recomputes everything when you .Move)

#

If it's not... then all sorts of glitches may happen

jade glacier
#

A major goal in client predict and such is to make sure that your client code and server code are exactly the same, and apply using the exact same timing/order of exec and such.

gleaming prawn
#

it may have an internal state for velocity, etc

#

that's fine

#

local = not networked

winter stirrup
#

@jade glacier yeah thats basically where i'm at atm

gleaming prawn
#

I do not use the Unity CC anymore... Long since I last did

jade glacier
#

I would hold of on more of this talk then... and just go try what you think should work using nothing but Fixed timings

winter stirrup
#

I did have perfect synchronization in terms of move

jade glacier
#

get that working first

winter stirrup
#

before I added rotation

gleaming prawn
#

For me Unity is a rendering/UI engine only nowadays

#

need to sleep... nice chat

winter stirrup
#

the only weird stuff is the stairs thing that happened occassionally

#

have a good one erick, thanks a lot !

jade glacier
#

Night @gleaming prawn

#

That should be very rare if you fully in sync

winter stirrup
#

I can see on the server side that I am at the exact same place

#

but then when i'm somewhere on the stairs, it just doesn't want to continue up

#

on the server

#

as if its colliding with an invisible wall

#

hold on, i got a clip of it

#

server side view of my player

jade glacier
#

something fishy with that controller code to let that happen

#

you aren't attempting any resyncs yet I assume

winter stirrup
#

nope its reaally barebones

jade glacier
#

Then that is pure controller weirdness

winter stirrup
#

i'm only applying a movement vector and a rotation transform

jade glacier
#

movement vector is NOT input though

#

you are sending WASD right?

winter stirrup
#

I'm using the RawInput one

#

so it's just 1 0 -1

#

forgot the exact name

#
moveInput.x = Input.GetAxisRaw("Horizontal");
moveInput.z = Input.GetAxisRaw("Vertical");
jade glacier
#

That should do it. Moved all of that code to Fixed?

winter stirrup
#

yeah, it is in the video

jade glacier
#

You will have to finesse it later so it captures better (since capture happens in Update)

winter stirrup
#

yeah for sure

#

so its more responsive

jade glacier
#

There is no reason if the code is identical on player and server for them to act differently

winter stirrup
#

they run the same method

#

by sending moveInput as argument

#

lmao

#

but the server occassionally does not like the idea of players being able to climb stairs apparrently

jade glacier
#

That seems unlikely. I would debug some more.

winter stirrup
#

even if my input was diff, a .Move() shouldn't be able to make it go through stairs should it

#

unless I somehow disabled the CC on the server

#

disabling collissions idk

jade glacier
#

They need to match exactly for client prediction

winter stirrup
#

@jade glacier i'll try to fix my basic stuff, thank you so much for all the info anyways

jade glacier
#

Gl

bold hull
#

I feel like this would be the right channel for this, is it possible to exclude certain packages imported from packamanger in a version control?

#

they all are stored in the packages.json so im assuming the answer is no

somber drum
weak plinth
#

any good tutorials on how to make an online multiplayer game?

azure crown
#

How can I use AWS for mirror?

#

Is it expensive?

sly dragon
#

Hello, I have just downloaded and installed Mirror. But during the importation, this kind of errors appeared. There is a missing assembly. What should I do ?

orchid lark
#

@sly dragon Unity & Mirror ver?

weak plinth
#

How do i place the photon SDK without going into unity? im using it for a private server in a free steam game

sly dragon
#

Yas I updated the both and it's good now x)

weak plinth
#

Photon Network Matching players .. If I connected to server (player 1) I created room. And tried to JoinRandomRoom other player (second player) and I have the same situation with first player (Created new room) . What's a problem ? Why second player doesn't see open room ?

jade glacier
#

Are you seeing that they are connecting to the same region?

#

Be sure to use Dev Region (and make your builds Development Builds), or used Fixed Region during development.

weak plinth
#

Is there any way to easily UDP & TCP hole punch without the need for the server to be connected behind a router that doesn't have a NAT?

gleaming prawn
#

You need a server to at least coordinate the punch process

#

Plus servers that get the reflective addresses (for this you have Google public ones). But coordinating the initial share if the reflexive addresses needs some initial form of communication via a custom server... This is normally referred as signaling.

sleek laurel
#

how can i check that a game object is owned by player (photon pun)

#

@gleaming prawn is this correct:
if (hit.transform.gameObject.GetPhotonView().IsMine)

#

sorry for random ping btw

#

no one was responding

gleaming prawn
#

Don't ping

#

Sorry

sleek laurel
#

do you know?

gleaming prawn
#

I'm on vacation, and I do not work on PUN

sleek laurel
#

oh ok

#

sorry

gleaming prawn
#

This is a public discord, not a support hotline

sleek laurel
#

ik

gleaming prawn
#

Sorry by some of the messages, I confused this with our own public discord

#

Also don't ping unless I am discussing directly with you...

sleek laurel
#

k

gleaming prawn
#

But not a big deal that you've done...:)

#

Btw, I THINK your code is correct

#

But I do not work with pun

sleek laurel
#

k

jade glacier
#

If your collider is on the root that should be correct.

edgy tiger
#

Should I use mirror or photon for first time multiplayer

#

I have tried both and it seems like photon is less involved

jade glacier
#

Photon pun2 will be easier to deploy, but it does limit you to client authority. But it's a popular library for casual games for those reasons.

#

If you need a unity based server with game logic for your game type, mirror would be better.

weak plinth
#

Is there any way to easily UDP & TCP hole punch without the need for the server to be connected behind a router that doesn't have a NAT?

jade glacier
#

Some kind of server is needed

#

Something accessible on the open internet needs to be accessible to all clients to facilitate the handshakes and such.

weak plinth
#

Thanks, I found solve myself ๐Ÿ˜‰

graceful zephyr
#

@weak plinth no u need a publicly accessible third party/arbiter

sterile garden
#

Hey guys! I'm about to start a multiplayer game for Unity WebGL and I was planning on using Photon.

I have a problem though. I have a requirement that states that players will only be able to connect to the game between certain hours, in order to make planned sessions.

I don't know how to work around that. Maybe controlling login dates directly on the web page? Or do you know any tool other than Photon that can help me?

Thanks in advance!

lusty crow
#

does photon support webgl?
I can't answer for photon specifics sadly.

the thing with webgl/running games in a browser is that you need a tcp based solution, like using http requests/long polling or websockets.
but there is one nice library for this:
https://github.com/endel/NativeWebSocket

if you code the backend per hand, you could simple deny requests to start or join a game at certain times of day

sterile garden
#

Photon does support WebGL, that's why i was trying to avoid doing the back en per hand.

Maybe using something like Mirror? I think that gives you more control over the server

jade glacier
#

Webgl isnt going to help you on the server side.

#

Your html server is separate

#

You still have to host your game server, with or without webgl.

lusty crow
#

I wonder, depending on the product you use with photon, how much control you actually have over the backend code. for example, I think I have read that you can write backend code/authoritative server code when you use Bolt, but with Pun, it's more like a p2p code setup

or if you have to handle certain things with regular http requests that are not even related to the photon framework, then the question is if it makes sense to use photon.

#

what you want to do sounds like a setup with clients + authoritative (public) server,
so there would be one app for the frontend that the players use to actually play the game and another app for the backend to handle server side logic, authentication etc.
authentication/matchmaking server and play server could be separate too if needed

jade glacier
#

Webgl is just an alternative to having players download your game.

sterile garden
#

I see, you gave an idea on how to do it

#

I will check out Bolt too to see if it fits me

#

Thank you!

weak hollow
#

Hello, i've some trouble with Photon, i follow this tutorial to setup a multiplayer game: https://www.youtube.com/watch?v=VX6VGcQTY5E but i found myself with this error in console: error CS0115: 'MenuManager.OnJoinRandom()': no suitable method found to override But I didn't find any help in the comments or Documentation, could you help me with that, please? here's the .cs file i created too

Make sure to subscribe and turn on the notifications so you get notified when we release a new tutorial or video!

Learn how to make a multiplayer game in unity!

-~--~--~-
Please watch: "Please Teach Me Kung Fu "
https://www.youtube.com/watch?v=gXjsfkS_xWQ
-~-
-~~~-~...

โ–ถ Play video
maiden sundial
#

Hello if want to create a multiplayer game in unity, which networking solution do you like the most? I've tried photon and thinking of learning it properly but ive also heard of mirror... Thanks!

jade glacier
#

Pun2 and Mirror are the most common starting points

maiden sundial
#

@jade glacier Thanks, which one do you prefer and why? ๐Ÿ™‚ If you dont mind me asking

jade glacier
#

I am one of the devs for Pun2, so I am the wrong one to ask for opinions on that.

maiden sundial
#

haha, okay thanks! ๐Ÿ˜„

jade glacier
#

@weak hollow Likely it is an old tutorial (pun1 maybe?) and you need to just use the correct arguments

#

MenuManager though is not Pun2's code

#

so whatever they have going on in there is the problem

weak hollow
#

8 months is that old already? :c

#

MenuManager is my file, that's just it

jade glacier
#

This is more basic C# debugging really. Your args don't match, or you didn't make that method virtual.

weak hollow
#

Thanks for the feedback, gonna check if i missed something

#

it's my file and an emptyobject*

opaque dew
#

@maiden sundial It depends what you need imo. If you don't mind client auth(potential cheaters) go with PUN. If you absolutely need server auth go with Mirror, or Bolt. PUN and Bolt also have rooms while Mirror does not.

fair cosmos
#

Mirror also have a rooms

#

it have a transport name Dark Reflective Mirror

#

use that for rooms

sleek laurel
#

yes i know there is a missing (;) at the top

gleaming scarab
#

Can you improve the question by telling us what's not working (what's wrong)?

sleek laurel
#

well im trying to change the text with a input field that will do it for all players

#

its not working

gleaming scarab
#

The expected and unexpected results would be nice.

#

What's happening?

sleek laurel
#

well

#

it will do it on my screen

#

and it will do it

#

but on the other screen it wont

#

idk why

#

@gleaming scarab do you know why?

gleaming scarab
#

Looking into it with the limited time I have

sleek laurel
#

k

gleaming scarab
#

Put a debug log in game chat and see if it prints for all users.

sleek laurel
#

@gleaming scarab i know pun rpc is working

#

because it shows the player name

#

im basically making my first chat system

#

so it will do

#

PLAYERNAME: (message here)

#

i got the playername part to work

#

but not the messgae

#

message

gleaming scarab
#

So the function is working (being called by every user)?

#

Did the log print for every user?

sleek laurel
#

yes

#

well it should let me do that

#

wait

#

no its not

#

wait let me remove outputtext from photonView.RPC("gamechat", RpcTarget.All, outputtext);

#

if i did that it would work

gleaming scarab
#
Debug.Log($"{playername}: {outputtext}");
sleek laurel
#

but TEST wont show for other players

gleaming scarab
#

Yes, if it didn't work that means the function isn't being called remotely by all users (targets).

sleek laurel
#

ik but TEST wont show for other players @gleaming scarab

gleaming scarab
#

At the very least, this code does not seem to be your problem.

sleek laurel
#

@gleaming scarab well what is it then

gleaming scarab
#

I suggest following some basic unity photon tutorial to first get a proper setup of photon with unity then extract what you need into your application.

sleek laurel
#

i did that..

#

it is setup

gleaming scarab
#

There doesn't seem to be any issue with this code so I can only assume pun wasn't setup properly or a connection wasn't established.

sleek laurel
#

i think it is because gamechat() does not know what outputtext is for other clients

gleaming scarab
#

It should still print the debug log regardless.

sleek laurel
#

it wont tho

gleaming scarab
#

Since it isn't, that means the method isn't being called for the others.

sleek laurel
#

it will only print the players name

#

thats it

gleaming scarab
#

Exactly

sleek laurel
#

wait

#

would it work if i spawned the text?

gleaming scarab
#

Meaning RPC couldn't call the game chat function for the other players.

sleek laurel
#

no RPC will call

#

it just does not know what outputtext is

#

for the other players

#

is what it looks like to me

#

so i need it to know what outputtext is

gleaming scarab
#

I believe you and the others are not connected else it would print a debug log. Try calling a different pun method ๐Ÿ˜›

sleek laurel
#

it does print a debug log

#

just it dont print outputtext of debug.log for the other players

#

@gleaming scarab

gleaming scarab
#

So it prints something for the others?

sleek laurel
#

it will print playername but not outputtext

#

for the others

gleaming scarab
#

I was under the assumption it didn't print anything.

#

Alright

#

One pebble out of the way.

sleek laurel
#

i have no idea how to solve it

gleaming scarab
#

Have string parameters and pass the string over?

#

As arguments?

#

Should be pretty simple..

sleek laurel
#

k

gleaming scarab
#
pseudo code

GameChat(string outputtext)
{
   stuff
}

Called with:
pv.RPC("GameChat", ..., "Hello World");
#

And remove the member outputtext from the class since you won't be needing it.

sleek laurel
#

member outputtext?

gleaming scarab
#

Where you'd substitute "Hello World" with your inputtext.text.

sleek laurel
gleaming scarab
#

I've got to go soon.. any immediate concerns before I do?

sleek laurel
#

uh ye

#

wut do i do i am stupid

gleaming scarab
#

Did you provide a string parameter for the function (declare it with a string parameter).

sleek laurel
#

?

#

@gleaming scarab

gleaming scarab
#

try it

sleek laurel
#

do i need 2 strings

gleaming scarab
#

Where they took two parameters.

sleek laurel
#

i am confused

gleaming scarab
#

No

#

You only wanted one so use one

sleek laurel
#

where do i put outputtext = inputtext.text;

gleaming scarab
#

You don't need it

#

Remove it from the class

sleek laurel
#

i need outputtext = inputtext.text; tho right?

gleaming scarab
#

and remove the assignment line before get key down

sleek laurel
#

k

gleaming scarab
#

Nope

sleek laurel
#

then what

gleaming scarab
#

You're the coder/developer not me ๐Ÿ˜‰

#

Does it work?

sleek laurel
#

well no because nothing is telling what outputtext is

#

if i remove outputtext = inputtext.text;

gleaming scarab
#

Where at?

#

Show an update code

sleek laurel
gleaming scarab
#

Try it

#

it was passed in as an argument and should be valid

sleek laurel
#

but it still wont work

gleaming scarab
#
Debug.Log($"{playername}: {outputtext}");

@gleaming scarab

#

It should.. in theory

sleek laurel
#

why is it working???????

gleaming scarab
#

Basic c# parameter with functions

#

Where you passed the string as an argument to the function

#

Alright I've got to go, have fun.

sleek laurel
#

k

#

@gleaming scarab but its doing it client side only now

#

Ahhhhh

gleaming scarab
#

Probably you've got something associated with outputtext, add that back in as a member, do the assignment operation you had before the get key down conditional branch.

sleek laurel
#

wut

#

oh ok

#

@gleaming scarab so it should work now yes?

#

I GOT IT TO WORK

#

YESSSSS

#

@gleaming scarab thxxxxx

maiden sundial
#

@opaque dew Thanks for the answer ๐Ÿ™‚

prisma imp
#

Guys, usually my ecpm is around 0.01$ to 0.2$ but suddenly yesterday was 200$, what happen ? And how to make it happen again ?

gleaming scarab
#

Probably advertising (not here though)

weak plinth
#

Would you mind telling me something about programming score for opponent? I created a multiplayer scene, both players get points in their windows, but the opponent's points are still zero. How could I fix this?

jade glacier
#

How are you syncing your points?

#

@weak plinth

weak plinth
#

The point is added when the object hits.

jade glacier
#

point is added to what? And how is that networked?

#

I'll take a look

#

I don't see any networking

weak plinth
#

It's just function to add I ask about syncing point with opponent in scene multiplayer which is connected to Master server Photon (PUN2)

jade glacier
#

You need to add some kind of sync, and determine the authority and such.

#

Right now you have no sync code of any kind, so its not networked.

#

Who is the authority over each players score? Each player over their own? Or the Master Client?

stuck furnace
#

the other player moves and shoots when the first and the second also how do I solve?

jade glacier
#

Which library? You have to disable your controller code for any instance that isn't locally owned.

#

@stuck furnace

weak plinth
#

Sceny Player have own itd work but i want to see opponent's score also but i see just 0

#

Every*

jade glacier
#

Again, you have to sync the value. How are you syncing the value currently? If at all?

#

Things don't sync automatically just by installing Pun2

#

you have to explicitly wire things up.

winter stirrup
#

hey emotitron, do you know any good resources for learning how to make a kinematic character controller that is deterministic? I spoke to you last time about some synchronization problems due to partly my own fault, and partly using PhysX

#

I have found a couple of tutorials, but I am a bit wary of youtube tutorials since they sometimes follow very bad practice :p

jade glacier
#

Truly deterministic? Not going to really happen without introducing your own fixed point math library. But at least close, you just have to make sure you do all simulation work in the fixed update. But you will still need to sort out a way to clean up desyncs. Which is typically resimulation.

#

All of the stuff talked about for things like Counter-strike and Valve's docs on the topic are good. I don't keep any links handy though no, sorry.

#

You won't do this through a tutorial.

#

It takes like years to really get good at dealing with proper networking, and a lot of just writing stuff and failing.

winter stirrup
#

Could you give me a brief clarification of what you mean by simulation and resimulation? I want to make sure I understand it correctly

jade glacier
#

There are very few networking gurus for games for a reason. There isn't "networking college"

#

I can't sorry, that will turn into an hour of my typing stuff here I have typed too many times before.

#

Go read up on server auth with client prediciton wherever you can find it.

winter stirrup
#

i'll try mr ctrl+f

#

that too

jade glacier
#

Erick, fholm and I have spoken about it often - too often.

winter stirrup
#

its just that it has different meanings

#

from what i've seen

#

It is just odd that they call it a simulation when it is server authoritative, since the server simulation is what actually happens - and what clients view is just a previous (and sometimes imperfect) view of that simulation

#

In my mind, simulation means an imitation, and the clients are trying to imitate what happens on the server by predicting what they think is going to happen

weak plinth
#

And here the question arises about what to use? I looked through the documents but I have no idea.

opaque dew
#

@jade glacier Sometime in the future I want to add better compression to my FlexNetworkTransform. I was considering using your library but I wanted your permission first. I know it's MIT but I don't want to step on toes by using your code in my paid product, since we both have similar products.

jade glacier
#

It isn't actually all MIT, just the bitpacker.

opaque dew
jade glacier
#

The transform crusher stuff just as permission for use for game dev, NOT for networking products.

#

That is MIT yeah

opaque dew
#

I'm honestly looking for the route that saves me the most time so I can add in other features; legally and respectfully ofc.

jade glacier
#

I believe I MIT'd that - if so, it is out there now.

#

I don't know that all of the files got the proper headers and such though

opaque dew
#

I'll take a look. Thanks.

#

@jade glacier You probably don't want to hear this, and don't care...but the NetMsgCallbacks file is out of date because of Mirror changes lol

jade glacier
#

I stopped supporting mirror ages ago

#

They break things too often and for no real reason

#

On the topic of IP though, looking at my code while making a competing product... isn't generally legally considered a good idea.

#

@opaque dew

#

Is that in the bitpacking library that I have that mirror code? Or one of my non-MIT libs?

opaque dew
#

The transform crunching library

jade glacier
#

TransformCrusher isn't MIT, so I would be cautious about looking at that code if you are making a product that competes with mine.

opaque dew
#

Gotcha, I won't be using it then.

vague mica
#

How can I sync an object (eg. a bottle) to all other players in the room?(photon)

jade glacier
#

Put a PhotonView on it, and make use of Observables or RPCs @vague mica

azure crown
#

What should I buy if I want to use AWS with Unity Mirror? On the AWS websites it says AWS can handle up to 200 players per room! So which AWS product actually does this?

alpine pivot
#

@azure crown They are talking about EC2 most likely

azure crown
#

@alpine pivot Interesting, can you tell me more? Is it like Dedicated Servers?

#

Because thats what im looking for.

alpine pivot
#

It's a Virtual Private Server, a Virtualized OS running on AWS hardware

#

You get a dedicated IP address, a set amount of RAM and CPU power

#

And you can use it to host your Unity headless builds in

azure crown
#

Soooo it can be used as a dedicated server? (Im a recruit in networking sorry!)

prime beacon
#

dedicated server means all hardware is reserved ONLY for you

#

you should google VPS and Dedicated server

azure crown
#

Oh ok

#

But can I connect to that dedicated IP address in the game then?

#

as in, join it?

prime beacon
#

yes

#

you can use free ec2 instance to test

#

get a public IP

#

you should really follow a tutorial

azure crown
#

Oh alrighty then! Can this be used for a big scaled FPS game?

prime beacon
#

how to create instance, getting public IP etc

#

yes

#

you can also see gamelift

#

it allows you to spin up new game server&instances on demand

#

scale up & down

#

but it might not be as easy as you thought

azure crown
#

@prime beacon Ok thanks man! You helped me alot!

prime beacon
#

you're welcome

somber drum
#

What is the reliability to a relayed host after a client has connected generally speaking? If I'm using steam to connect players, are they then at the mercy of said player host's connection speed?

#

Dealing with small lobbies of 3-4 players, for small match times mind you so I don't see a reason to have dedicated servers.. Maybe I'm under thinking it though and dedicated servers should always be on the table.

Question is when is one better than the other for this kind of scenario? (A couple players, short match, real time, closed lobby)

grim goblet
#

hey guys! i wanted to ask an question. i am currently making an FPS Game. i Wanted to ask wether which networking FrameWork would be suitable for making my FPS game into Multiplayer. please give me suggestions. (And also it should support for version 2017 or below and should be runnable in low end computers. if yes pls do reply)

lusty crow
#

maybe photon bolt can be a viable choice,
there are a few low level options too, but for high level networking with more abstractions, I hear a lot of people are using mirror as an improved UNET approach

opaque dew
#

Mirror doesn't work on 2017

#

@grim goblet @lusty crow ^
But, if you do end up using a newer Unity version and want a FPS resource specifically for Mirror I have FPS Land, which is a full server authoritative shooter demo. Demo is free, source code is $3. You also get a bunch of Mirror tutorials, assets, and other projects for the same $3. If that at all interest you, it's here https://trello.com/c/8Fw2Q5mp/17-fps-land-project

#

@jade glacier I'm constantly having people ask me, PUN or Mirror, so I'd like to make a good comparison video on the two. I've seen you get asked this a lot as well. I can make the bulletins for Mirror, and while I know a bit about PUN as well I figure it would make more sense to ask someone more hands-on with it. I could throw in talk about Bolt too, since it's also server authoritative. I just need several good talking points.

jade glacier
#

One is Relay and one is Unity EXE server based.

#

That is the primary difference.

#

Pun2 = No actual hosting required, or any punchthrough etc. Downside is the server (the relay) has no game logic unless you write server plugins.

Mirror = Unet-like HLAPI. There is a server that you must provide that acts as the hub. You either need to host that, or you can let a player act as a server. Downside is you have to host, or deal with nat traversal. Upside is your server can be authoritative.

@opaque dew

stiff ridge
#

@grim goblet , why would you use 2017 or older in the first place?

random crown
#

Okay, i got a question. I'm currently using Photon for the first time in my project as it seemed to be the one that was going more in line with what i wanted from the game, but i'm having this issue:
So let's say i have player A and player B, I want player A to be able to press a button and that will open a door to player B. Sadly it seems it only click the button and opens the door on the client side of whoever clicked the button, so i'm clearly missing some code or so. Anyone knows what might be able to help me?

jade glacier
#

First thing is to decide who owns that door. Typically it is a scene object, meaning the Master Client controls it. So all clients should RPC the Master Client with something like an RPC request to the master.

random crown
#

@jade glacier i guess that makes sense, but how do i do that? as i said i'm very new to photon, i've been following tutorials and reading a bit of the online documentation but i cant seem to fix this issue.

Also shouldnt the host be the one responsible for the state of the door instead of the master client? i mean i don't want someone to open a session and for the door to be open for them because another room opened it first

jade glacier
#

There is no host with pun2

#

There is just the relay (which is technically the server) and clients.

#

One client is flagged as "Master" which is just a regular client, except it is the default controller for scene objects.

weak plinth
#

Hey, i'm using photon for the first time, and i'm trying to do transform sync. But it is very choppy and it looks as if the other player is moving at 5 fps... The animations are very smooth, just the transform sync i'm having trouble with. Please help

jade glacier
#

Be sure to do the tutorial first

#

It sounds like you are not managing your controllers.

#

@weak plinth

weak plinth
#

?

#

@jade glacier

#

wdym by managing controllers

jade glacier
#

You need to complete the Pun2 basic tutorials

opaque dew
#

@jade glacier gotta say, you are not a good salesman ๐Ÿ˜›

weak plinth
#

i'm following the dapper dino course

#

i think that's enough lol

opaque dew
#

I was thinking more along the lines of things PUN does that Mirror doesn't. EG rooms, are huge.. very big.

#

@weak plinth I thought dapper dinos was for Mirror?

weak plinth
#

no he has photon tuts

opaque dew
#

gotcha

weak plinth
#

no

#

i will not look through docs

#

lol

jade glacier
#

Can't help you then sorry.

weak plinth
#

ok, someone else can though

random crown
#

One client is flagged as "Master" which is just a regular client, except it is the default controller for scene objects.
@jade glacier that's kind of what i meant i guess. But how do i "link" the door and the button to the master and have it so that if the other players interact with the button it changes the door for everyone? Do you know any part of the documentation or a tutorial i could check for that?

jade glacier
#

@opaque dew Rooms are basically the alternative to spinning up Unity instances. It is included in my description, but yeah - I wasn't explicit about that.

#

I have to ask the same question I ask everyone. Have you completed the Basics tutorial for Pun2? @random crown

opaque dew
opaque dew
#

looks fine. wow you guys have a few new things in there since ive used PUN2

#

maybe your serialization rate is really low

weak plinth
#

how do i make it higher

random crown
#

@jade glacier yup, but i do not remember any part that allows me to link anything to the master. I can use the photon views to define the players and link their position, rotatio, scale and animations, but that's about it on how much i know how to link

weak plinth
#

PhotonNetwork.SerializationRate ?

jade glacier
#

Nothing is linked to the master. The Master just is the authority over of door. Players just have to RaiseEvent a message to the master asking it to trigger the door.

opaque dew
jade glacier
#

You can also set up RPCs on your player object that handle actions and such.

#

like RpcTriggerObject(PhotonView clickedObject) type stuff. @random crown

opaque dew
#

PTV uses OnPhotonSerializeView, so those rates could be a contributing factor.

random crown
#

@jade glacier was that in the basics tutorial?? O.o

jade glacier
#

Probably not this specific thing. Just wanted to make sure when I mentioned RPCs and ownership and such, that you would understand the terms. @random crown

#

You will need the player to send a message in some form that the Master gets and acts on.

random crown
#

but i'm gonna look into that in the documentation, thanks for the help

jade glacier
#

For this, look into RPCs and RaiseEvents