#archived-networking

1 messages Ā· Page 117 of 1

late swallow
#

This helped a ton, thank you sm

high night
#

ain't no thang

late swallow
#

That's a nice saying

#

One more thing

#

How do I know how the network performance is

#

If it's good or bad

high night
#

for realtime or http?

late swallow
#

Do I just, set my router to be very bad and try that lol?

#

Realtime

high night
#

your realtime networking library can get you the ping value

#

mirror, photon etc

#

@late swallow If you learn a bit about playfab

late swallow
#

Playfab?

high night
#

You can host your unity instance there

late swallow
#

I need to understand tick rate better lmao

high night
#

Playfab does matchmaking and joins the players by static ip to a unity instance

#

You can have globally available matchmaking for server authorative game rooms

late swallow
late swallow
high night
#

If you are new to multiplayer game dev

#

And you are connecting by ip

#

You can use hamachi

late swallow
#

I see

#

I don't think I will use that

#

But idk

high night
#

It puts you and your friends in a virtual lan

#

Hamachi is easy

#

Hamachi is how you play minecraft with your friends

late swallow
#

I know

high night
#

same deal

late swallow
#

But I don't want users to have to use that

#

Plus

#

I'm planning on releasing this on all platforms

#

And VR

#

So

#

No dice

high night
#

I mean get the game working and somewhat fun first
And then worry about production maybe

#

Well if you know what you are doing

#

Server authorative realtime multiplayer is big issue you know

late swallow
#

Wait so, my issue was validating data to be sent to the database

#

So if Firebase can do that

high night
#

I am thinking

late swallow
#

Then I might not need a dedicated server

high night
#

You can have custom code in firebase that can handle some processing

#

That's what enables you to use it as a backend as well

late swallow
#

I see

#

Cool~~

high night
#

But I might be wrong, not experienced in firebase

unreal falcon
#

Hey anyone using photon for simple multiplayer ?

None of my animations are synchronized on the network

I see that my view is recognizing the animator view which is in a child gameObject, but I suspect that my animator view doesnt catch my view properly, even tho I got no error

Does the default animator view has to be on the same gameObject as the view ?

somber drum
#

I've been advised to maintain a separate project for my server build to ensure security of some secret API keys that access the backend. (Playfab)

  • I have heard #if server checks could mitigate the risk of a key leak.. is there anything else, and basically is it in any way acceptable to try ship from a single project.
#

I feel like if I'm #if checking throughout, making sure client never runs server calls I should be fine.. but I have no idea how vulnerable build apps are beyond decompiling..

#

as a solo developer, maintaining two projects for a single game has me worried.. 😬

austere yacht
#

as a solo dev you have practically no chance to do everything right and secure, so if there is a dedicated third party that wants to hack/exploit you, they will figure out a way to do it

#

so keep backups and hide everything critical behind the security offered by playfab and other services you may use.

somber drum
somber drum
austere yacht
#

you server build should not have any need for "admin" access to your server host

somber drum
#

for example when a server is started I need to authenticate users; when I'm starting a server instance I pass in the server entity token, and on client side they'll be passing in their local profile key. In that case of a build starting a server I do need the admin access (though I'm not 100% if admin access is the same thing as server.. separate thing I think

#

*clients are not starting servers

#

so really, they have no need for that in their build.. which is why I was hoping #if checks would be enough

austere yacht
#

everything about networking requires you to think about stuff five times from different angles until it makes sense

runic rampart
#

How does Unity internally test multiple clients with networking? Do you all build clients every single time you want to iterate?

verbal lodge
#

You can use something like ParrelSync to open your project multiple times and run multiple clients without having to build.

weak plinth
#

or get a good pc and just build swagglasses

runic rampart
#

My issue in ParrelSync is that the two clients aren't agreeing on the NetworkConfig. It seems like they are getting different global hashes or something

verbal lodge
#

Some of our teams use it. We used it in the development of Boss Room for instance.

runic rampart
somber drum
somber drum
austere yacht
#

you can also make those keys expire regularly, and you could just make a new build every day with a new key

somber drum
#

dev secret key grants access to everything as far as I know, any player any thing it's the master lock

austere yacht
#

Never include your developer Secret Key in a client build that you send to your customers. Doing so exposes your title to abuse.

somber drum
#

I'll just see what all goes into a separate server project I think. Might be less hassle in the long run day-to-day and there is an official example (stating it as the best option for security)

austere yacht
#

If your old keys are compromised, rotate the keys to return your Title to a secured state.

somber drum
#

right- key is where they state Never include your developer Secret Key in a client build that you send to your customers. Doing so exposes your title to abuse.

#

rotating is a last resort, not something I'd want to be doing on the daily.

austere yacht
#

you are running in cricles here

#

just dont send the key in any form to a client

#

you have already described ways to do that, beyond that, rotate the keys

somber drum
#

I don't see it as running in circles šŸ˜†

#

I'm thinking through the options

#

thankful for the feedback provided

austere yacht
#

idk the api of playfab but if you need to compile keys into the binary that API is useless and i highly doubt they made it that way

somber drum
#

well when their suggestion is always "make server/client project separate" I doubt they came to that conclusion (despite user feedback asking for other solutions) for no good reason

#

This is going to be the final point, anyway.. I'll try work through it.

austere yacht
somber drum
#

yes I was reading it as can as in possible but not the recommended approach.. which was enough for me to reason with honestly.
I was also concerned not knowing what I'm doing my "diligence" when blocking off code for a server-only build would be lacking, exposing certain things.. I'll compare to their shared git project

rotund terrace
#

What needs to be removed

#

Do you just need to remove the playfab shared settings SO or what?

somber drum
rotund terrace
somber drum
#

yeah client' model vs server.

feral oak
#

Anyone here ever used Photon Networking for a shooting game? I'm currently trying to pass to other clients that the player has changed the weapon, I've tried using RPCs, Custom Properties, and PhotonSerializedViews and nothing seems to be working for me. Could just be set up incorrectly. If anyone has any experience with that it would be greatly appreciated. Been trying to figure out this issue for around 10 hours.

balmy fog
#

Is there a way to call gRPC on WebGL?

somber drum
#

(Pun is the networking, Photon is the company)

alpine pulsar
#

hi i am following the docs for Unity's new networking system and when i click 'Start Host' nothing happens. below is my setup

olive vessel
#

What are you expecting to happen?

alpine pulsar
#

it to spawn my object for the player in

#

no game object for the player is spawned in

olive vessel
#

Is the prefab setup correctly?

alpine pulsar
#

it's set up in that pic

#

i've tried setting it in player prefab and the network prefabs list

olive vessel
#

I asked if the prefab was setup correctly

#

So what's on the prefab?

alpine pulsar
#

ok it's working now

#

no clue what i did

feral oak
# somber drum 10 hours spent on syncing a weapon change? There are many many tutorials coveri...

Lol. There are plenty of tutorials that follow it. That I stated above haven’t worked for me. I didn’t follow anyone’s weapon change so it could just be that when I try to implement their way of syncing it doesn’t work with how I’m implementing. Hence why I said it’s not working for me and was asking for a more basic setup instead šŸ™‚ also I’m well aware pun is the ā€œnetworkingā€ if you want. Most people call it Photon since it stands for Photon Unity Networking

feral oak
unreal falcon
#

Anyone is able to help syncing animation though network with PUN, doesnt seem to work at all on my project ?
Movements are successfully synced over network but no chances yet for animations.

I think this will be pretty straightforward for an experienced PUN dev,
I am able to pay to make it work or to know why it doesnt, I think this is just a matter of minutes to solved it.

feral oak
#

Inside the photon animation view the animation parameters are listed are they changed from disabled to discrete?

unreal falcon
feral oak
#

All the disabled ones will never sync though. None of them are working or just the disabled ones?

unreal falcon
feral oak
#

Could I see your script where you’re implementing them

unreal falcon
#

Sure, thanks for your help šŸ™

I'm trying to implement it on top of Corgi Engine, which is a platformer engine on Unity

Here is the file referencing the animations, I can provide more if needed (I can see animation initialization around line 580)

I havnt modified the code regarding animations, I've just implemented the photon view on all related scripts to sync movement, which is working great,

Animations are being played perfectly on local for each player, but animations are not propagated over the network

somber drum
# feral oak Lol. There are plenty of tutorials that follow it. That I stated above haven’t w...

"Most people" calling it photon would be wrong..
As photon holds multiple products ( as I'm sure you're aware. ) which people reference here..
-Pun
-Bolt
-Fusion
-Quantum
..these are all "Photon".

Yes, Pun is the popular one, just needed to clarify as these all work in their own way.

In Pun, changing an item should be as simple firing an rpc, as you've read in the docs.

If you are struggling with this particular area, feel free to post a snippet of the troublesome code for people to guesstimate what might be the problem.

Believe it or not, 90% of the people who come here "asking" for help do so without any prior research of their own.

Getting hostile isn't going to get you anywhere.. I wasn't attacking you when I was simply seeking clarity into the issue and suggested a tutorial, you gave virtually no indicator what might be the problem simply saying "I've tried all these different methods none worked".

Show your implementation, maybe someone else is willing to help you.

feral oak
somber drum
#

You can't receive help making people beg to see your code.
I was sympathizing.. 10 hours is a long time we've all been there learning a new topic. Wasn't intended to come across as anything offensive.

feral oak
#

You may want to go back and read my post.. I didn’t beg anyone to ask for my code.. I asked if anyone has ever accomplished what I’m trying and if they did what worked for them.

Definitely comes across offensive when your post seems as if it’s attacking someone’s intelligence.

feral oak
somber drum
#

I can't control how you take things.
If you tried as you've stated these various different ways of syncing the weapon change and all failed, and you're asking for help; without seeing your code and without being suggested a tutorial, what do you expect people to do?

feral oak
somber drum
#

Cheers mate.

unreal falcon
feral oak
unreal falcon
late swallow
#

ok so, I literally can not find an answer to this and I have no idea where to ask

#

so, I'm just gonna do it here

#

I need to make a dedicated server for my game

#

and my project is a social platform as well, using Firebase

#

I wanna know where I should verify data and stuff

#

if a user requests to see another user's profile, I need the server to check if their profile is set to private or not, and return an answer accordingly

#

do I do all of this on the server build or...?

#

do I need to do this in Firebase?

quaint moon
late swallow
#

oh ok

#

I was not aware of that

late swallow
#

thank you!

weak plinth
#

is there a plugin or something that can allow all devices to connect to my game without the internet? in other words, a NAT hole puncher or net play or something like that. someone can help? i want to connect device directly to other devices in the area.

bitter swift
#

@lethal tree does it explain how to connect in the guide?

lethal tree
#

it should iirc

bitter swift
#

Gotcha, I think I was confused because the unity looks different from mine

#

I thought it might have been outdated, which is why I came here. Thank you!

#

Actually, how do it get the options to appear

#

I have very little compared to the guide

#

This is the guide

#

This is mine. Am I missing something?

mortal horizon
#

why did you take a pic of your inspector yet manage to take a screenshot of the guide?

somber drum
#

I'm getting into backend stuff for a sever authoritative title, wondering if using the exclusive server API itself is the go-to way since it seems to me more straightforward than if you were to use cloudscript since there are less steps to verify, right?

A simple example client sends command in game asking for x gold, server verifies, uses server api to change player's gold to x in the cloud. Simple, secure..

Where in cloudscript, you're sending logic directly to the cloud from the player to change gold to x.. and then you're supposed to verify it in the cloud?

I'm not understanding the need for cloudscript I guess, I know it's supposed to make things simple, but in doing so it feels like it's also adding more complexity in terms of security.

#

There are plenty of videos outlining the simplicity of cloudscript, but they never seem to touch on cheat prevention which seems like an obvious rule of thumb

#

Though now that I'm thinking about it if your client is part of the server's simulation you're not even needing to verify on the cloud since any value sent from the client is reverted to the server state anyway- šŸ˜†

bitter swift
#

@mortal horizon šŸ˜‚ Cause I was reading the guide on my phone and my pc can’t handle unity and a screenshot program lol

ocean cradle
#

okay so I have a script which disables and enables buttons, but for some reason it's not registering the press. even after assigning it to a specific void, it still won't register the press, this only happens with my networking projects specifically(Mirror) anyone know how to fix it?

bitter swift
#

I’ve gone around trying to figure out how to connect unity to photon but I keep getting both a OnConnectedToMaster and OnJoinedLobby error. I’ve gone around trying to google and find videos but I’m lost. Does anyone know the next step?

sage finch
#

which package should i use for multiplayer as a beginner?

limpid sky
#

Hi, I'm trying to have a pause state for my player when in a photon match, they'll be able to press a button to leave the match and go back to main menu

#

But the button itself seems to not work at all, not even hovering over it does anything

#

No clue on why.... any ideas?

bitter swift
#

Hello everyone. I was just able to get my multiplayer tested and working. But there is extreme lag. Does anyone know how to fix this? Thanks

ocean cradle
bitter swift
#

It was two different computers

ocean cradle
#

Then I don’t know

#

Can someone help me with a UI problem and Mirror?

green narwhal
#

who can help me with photon 2 , i try copy 2 videos and don't work .. ?
or you recommand other "asset"

olive vessel
#

What specifically didn't work?

green narwhal
#

when i try connect and press join , nothing happen

green narwhal
#

if you have a tutorial can help me with all [JOIN / JOOBY / START GAME] ty ā¤ļø

somber drum
#

Would definitely start by googling around if you haven't already

#

Many tutorials that walk you through step by step no point linking pick the one that works.

heady tendon
#

What should I use to create a multiplayer game? Riptide networking? Mirror etc?

#

What is the easiest

austere yacht
ocean cradle
#

So a problem is becoming really frequent and is very very annoying. This has to do with the playermodel and viewmodel and who it shows upto which screen, I want the localplayer to see other players as the playermodel, while the viewmodel only shows up for the localplayer. It was fine before, but once I added a class picking system, it broke it and now, for some reason once a new client joins, they are seen as the only localplayer as the most recent's code is working properly, but for some reason, everyone else isn't even on their screens, leading to them only seeing the insides of the playermodel with no viewmodel.

ocean cradle
# heady tendon What is the easiest

That's very subjective, Mirror is more fiddley, and so is Riptide, but Photon is more simple/widely used but will probably end up being more expensive if you're comparing it to Mirror and RIptide. Which don't have dedicated servers unlike photon, but if you're putting your game on steam, it would cost much less.

heady tendon
#

Thank yoy

#

You*

edgy rain
#

hey guys can some one help me please with photon 2 projectile syncing I don't really understand how can i send the projectile position through an RPC when i cant send game objects or transforms via RPC function

cursive nebula
#

(Photon PUN)
Ok so like when transferring ownership to another player, does the gameobject need a photonView itself? And if so, how would i go about a online block based game?

ocean cradle
#

Oh shit one second

worthy kiln
#

Guys i'm using Mirror for my multiplayer but what should i use instead of NetworkBehavior on the class?

#

I can't find xr legacy or multiplayer hlapi

#

Can someone help me?

#

nvm i found the problem

#

For anyone that wants to know you should put using Mirror instead of using UnityEngine.Networking;

stiff ridge
stiff ridge
# edgy rain hey guys can some one help me please with photon 2 projectile syncing I don't re...

You may want to join the Photon Engine Discord and ask this in the #pun channel. This question may turn into a somewhat longer conversation...
Overall: If you can, avoid sending updates for projectiles. As long as everyone knows when a shot was fired, where and in which direction, you can usually show it in adequate precision over the path of the projectile (if it's visible at all).

#

Have a look at the included samples (in the PUN package), to get an idea how they sync shots (the PUN Basics Tutorial and the Asteroids Demo both include shooting).

edgy rain
edgy rain
stiff ridge
#

That happens. There is no guarantee to get a fitting reply. It might make sense to ask again with some more info on what you are after, etc.
E.g. is it a slow or a fast projectile? Could a raycast be enough for the hit calculation (and a line renderer would be enough visually) or do you need to follow the path of the bullet, etc.

fading apex
#

Hey, what would be the best multiplayer solution for a turn based strategy game?
I have only used the old unet up to this point.

#

I am thinking of trying Photon maybe.

olive vessel
#

Well definitely not UNet. Unity's new official solution is called Netcode for GameObjects, then there's Mirror which is like UNet, and of course Photon has various products

unreal falcon
#

Hey anyone is familiar with Photon Pun2 ?

Looking for someone who could help fix my 3d character, animations arent propaged to client using photon animator view, movements however are correctly synced through network.
I think this is something that can be achieved pretty quickly for somebody who's used to do these kind of things, because everything is already implemented.

I am able to compensate for the time spent, I think a 10 min call is enough.
Dms are open

Let me know if this isn't the right channel

bright mauve
#

For some reason, only the host player (which is also the server) Is getting this Rpc:

In some script That Only The Host Has Access To:
DisableSelfClientRpc();

[ClientRpc] private void DisableSelfClientRpc()
    {
        Debug.LogError("Got Here");
        PlayerObject = NetworkManager.Singleton.SpawnManager.GetLocalPlayerObject();
        
        Debug.Log("Starting To Affect Stuff for " + NetworkManager.Singleton.LocalClientId);
        PlayerObject.GetComponent<PlayerDisabler>().EnableMe(NetworkManager.Singleton.LocalClientId);
        UIDisable.DisableThose();
    }
```Did I do anything wrong? only the host gets the "Got Here" print.
edgy rain
weak plinth
#

oops nvm

unreal falcon
unreal falcon
#

I have normally setup everything, this is the character

cursive nebula
weak plinth
#

Hey Can anyone help me with an issue i am having with photon and animation rigging?

#

I'm not the best coder i have benn trying to fix this issue for over 2 days

austere yacht
weak plinth
#

I am having an issue with animation rigging specifically with Multi Aim Constraint. In simple words I want my character to look in the direction they are facing. this works in the client(Editor) but not in the build when a someone joins and I look around the other charecters IK moves also(I have tried using : if (!PV.IsMine){Destroy.GetcomponentInChildren(MultiAimConstraint).gameobject)) but that just crashes the build and i have no idea how else to fix this

ornate zinc
#

*component

weak plinth
#

I have the transform under a camera holder and the Ik is set to that transform

#

I can send all the code regarding this and screenshots of my setup

ornate zinc
#

But if you are instantiating a player, what script is attached to handle input?

weak plinth
#

Ohh I have an input script on the player

#

The player prefab

ornate zinc
#

So you gotta check that

#

For isMine or not

#

Right now all instances of that script listen for your input

weak plinth
#

Ohh let me try that

weak plinth
#

this is my prefab setup

#

Also im sorry for the bad quality its the only way i could upload to discord

leaden matrix
#

Does anyone have tips for how to make movement secure + server side authoritative? My team is a little puzzled on how we can make sure movement is protected from cheaters, including jumping, actions, etc. Do we just need to send movement packets from the client to the server and have the server check the packet properly? Any points to a guide or more information would be great.

Thanks.

magic barn
#

Hello hope a stranger help question using mirror I encounter error ".unity needs to be opened and resaved , because the scene object Card has no valid sceneId" what's the possible problem ? help plz

feral oak
feral oak
mortal horizon
#

the invite is pinned

magic barn
stiff ridge
# cursive nebula Gotta be honest pretty lost with this; because with it being multiplayer and hav...

Well. The minimum needed to "network an object" is to make sure everyone agrees which object they refer to via some ID. If you've got some level or chunks, they already have IDs (you store and reference them somehow). If this is the same reference on all clients in a room, you can begin to talk about said object/block. You can tell the others "i picked up block xyz", or whatever else can be done with it...

ornate zinc
weak plinth
#

I actually figured this out the reaso it wasn’t working is because I didn’t have a photon transform on the camera holder

#

Thank you for all the help though

ornate zinc
weak plinth
#

Only because of your help lol I would have never thought of changing the input settingsšŸ˜‚

cursive nebula
stiff ridge
cursive nebula
#

Hm okay thanks

#

My main trouble is getting everyone to delete it

ornate zinc
stiff ridge
#

It's like accessing some array. But instead of just changing the values in it, you send a networked message which index should become which value.
This is the basis. That may need to get some optimization. Depending on the size of chunks and the speed of changes, you maybe don't want to send a message just to change a single value.

cursive nebula
#

Bc transfers require Pviews, which would make sense why it didn’t work properly

#

And wouldn’t really work long term Anyways

cursive nebula
stiff ridge
#

If someone clicks only one block, you don't have to send a list but ... kind of, yes.

#

I don't know if we talk about a few blocks or if we talk about a scale a la Minecraft. For the latter, I guess some optimization is required.

plain grove
#

Any good tutorial for Unity's Relay system on Netcode for GameObject?

cursive nebula
#

Okay ill see what i can do

ornate zinc
#

Watch out for mods, you are not supposed to offer jobs here from my experience.

spring crane
#

Yea not that kind of networking. There is a section on the forums.

shut grail
#

I've made a turn-based game (snakes and ladders) and right now it just works with one player, I wanna turn it into a multiplayer game but I'm not sure where to begin. I've looked a little into Photon 2 and the new NetCode by Unity but I'm not sure which one to proceed with

feral oak
unreal falcon
feral oak
#

As long as you’re calling it correctly in your scripts

unreal falcon
feral oak
#

So the animator view needs to be on the actual thing doing the animation does your player have an empty object holding everything then the model?

unreal falcon
feral oak
#

I use discrete mainly in my animations also, idk if that matters, but I would look at the difference between discrete and continuous. Some of those probably could be discrete

#

Yeah the animator and the animation view would need to be on the child I believe. Have you tried taking it out of the gameObject and just attaching everything to the actual model? Does it work then?

#

Also if I could see your script you’re using to call animations from that may help @unreal falcon

unreal falcon
#

About the update mode (discrete, continuous) I believe it's just the refresh rate, tried both options without success
Here is the (long) script 😁 (around line 580)

feral oak
unreal falcon
feral oak
unreal falcon
jolly charm
jolly charm
feral oak
cursive nebula
#

Can you photon instantiate without a photon view on the new game object?

feral oak
#

It has to have a photon view

weak plinth
#

what would be a way to make a kill counter in photon that checks who sent a shoot rpc and killed you and adds kills to them

feral oak
cursive nebula
#

So a game with a bunch of blocks is not possible?

weak plinth
feral oak
cursive nebula
feral oak
feral oak
weak plinth
feral oak
feral oak
#

Show your code

weak plinth
#

currently i dont have it implemented cause i scrapped it yesterday

weak plinth
cursive nebula
feral oak
feral oak
cursive nebula
#

šŸ‘ thanks šŸ˜„

feral oak
#

Wrong tag lol

feral oak
feral oak
cursive nebula
#

Thanks man, appreciate it

feral oak
cursive nebula
#

Unfortunately not atm, workin on homework at school, just wanted to get the question out there

#

Im basically free all of tomorrow though so whats a good time then?

feral oak
#

I'm usually available around 10pm est. Just on a early today. I can tell you all I did was make a script called "Ground Item" and I attached a scriptable object of the item to that script. The scriptable object actually holds all the information about that gameobject. Then I made a collider on the object and added it to be "Is Trigger" once inside of the collider I have the option to pick it up which adds it to my inventory (if the photon view is mine) and deletes it if it is mine and if it isn't mine.

I only used a trigger collider instead of raycasting to pick it up, because I'm using raycasting to follow the mouse and I didn't want it doing two things and acting weird.

#

Nothing is needed networking wise because the objects are spawned into the scene from the master client so everyone can see them at that point, it's basically like putting a gameobject in there by hand then loading it. It doesn't need a Photon view

frosty crystal
#

Hey!

#

Tell me something why do I have to use DTO when the database table matches perfectly to the payload coming from a client?

bright mauve
#

for some reason my rpcs are only getting sent to the host:

private void Update()
    {
        if (Leader) //is server || is host
            SomethingClientRpc(NetworkManager.Singleton.LocalClientId);
    }

  [ClientRpc] void SomethingClientRpc(ulong clientid)
    {
        Debug.LogError("I am a clientRpc!" + clientid);
    }
``` - only the host is showing the error log. did I do anything wrong?
austere yacht
frosty crystal
#

Is it a good practice to use DTO over Entity derived classes as payloads?

austere yacht
#

that depends on what philosophy of programming you subscribe to. I'd say use abstraction/indirection only if necessary for you and others on the team to understand what is going on, otherwise use the thing that gets the job done in the most direct and simple way possible.

#

best practices are only valid in the exact context they originated in

bright mauve
ornate zinc
bright mauve
#

yes, their player objects also spawn in the world.

bright mauve
ornate zinc
#

What network are you using, photon?

bright mauve
#

Also, does it need to be network object / shouldn't be one in order for it to work?

bright mauve
#

But im thinking on moving for something else

ornate zinc
#

Oh, did you name your thing correctly, the function

#

Oh you did

#

And you are sure your client is not also a host?

bright mauve
#

one is a host, the other is a normal client

#

when I call the Rpc through Update() [that runs for EVERYONE], they both execute it like a normal function.

ornate zinc
#

Just to be clear that accidentally both are acting as host and therefore not connecting to each other. I dont know your library you are using, but at first, there is surely a way to check who is connected, right? Just to get the simple errors out of the way if you not already did

bright mauve
#

I'm not sure what you mean...

#

only one of them is a host.

bright mauve
#

they are 100% not connecting to each other.

ornate zinc
#

well the client and host are sharing the same unity project, right? So if you start the wrong or dont assign correctly, they both COULD act as host

bright mauve
#

they are both 100% not acting as host.

#

I put a debug.log() at the start, they are not hosts.

ornate zinc
#

Both?

#

Well who is going to call the client rpcs then if there is no host? I sthat meant to work like this?

bright mauve
#

Sorry

#

I meant that one of them isn't

#

This is the current situation

ornate zinc
#

And your ClientRPC function only runs on the server, right?

bright mauve
#

I mean, this specific script runs on both clients and server.

#

In Update() I check if its a server or client.

if it's a server, I call the ClientRpc (so hopefully the client will execute it)

#

if its a client, nothing happens.

ornate zinc
#

That should work I guess... hm

bright mauve
# ornate zinc That should work I guess... hm

thanks for trying to help, but at this point, it seems like netcode is way too new for me to write code with it.
there is just not enough support or examples for things, the documentation isn't even complete.

I'm thinking on moving to fishnet. or just another network solution in general. how hard do you think it will be to completely switch an online solution?

ornate zinc
bright mauve
#

working with sockets was always the best option šŸ„‚

ornate zinc
#

Yep, so netcode, is that a Unity thing? Or a custom one

#

I was waiting for the new unity networking but never catched up when or if it was released šŸ˜„

bright mauve
#

its supposed to be the official networking solution, released in 2021.
but its really far from being used in personal projects...

#

it worked very good for me at the start, but it has too many simple problems that no one can help fix...

ornate zinc
feral oak
#

Also, photon is super user friendly so if you’re new to networking I’d recommend it.

unreal falcon
# feral oak I wouldn’t give up. There’s always an explanation. Mine is set up super simple. ...

Hey wanted to give you a quick update,

I finally succeeded to propagate my character animations on network,

I tried many test case to see where things went wrong
Long story short my character prefab was a bit complicated and I had to remake the player prefab to make it works, I also added some missing view owner verification to propagate animation only when I wanted to, now it's working out of the box.

So thanks so much for your support šŸ™

regal kestrel
#

Whats the best solution for making a game with rooms, matchmaking and such, lets say a system like fall guys, I dove straight into netcode for gameobjects and after a bunch of days trying i was only able to connect locally to the server, what a pain, is there a better choice out there?

ornate zinc
feral oak
ebon girder
#

hello , guys for a pvp game where should i host my game and what technology i need , i want dedicated server

glass timber
#

Any opinions on mirror vs photon?

velvet silo
#

for unity netcode

#

the library

#

how would you go abouts making a custom server on the cloud and building on there

#

as an alternative to relay service.

verbal lodge
#

You'd just create a server build in Unity (checkbox in the build settings) and then call StartServer on the NetworkManager to start a server instance. Then upload the built server application to a server or a cloud provider.

spring crane
#

Well Fusion is replacing PUN, but you get the gist.

glass timber
#

what is mirror geared for then?

#

in the first video dapper dino has he says he's gonna say what its for but only tells what it does, not what its suited towards

velvet silo
#

Okay , also i was wondering like for unity netcode, should the server instance be rendering the game content or just dealing with requests

spring crane
ornate zinc
velvet silo
#

i think i misunderstood anyway server doesnt really render anything its just an instance of the network manager

#

the local component updates are done on the client i presume, or i guess it depends on how you choose

verbal lodge
velvet silo
#

oh right cheers

#

does netcode for game objects deal with creating multiple game rooms by the way

#

like say i have some simple game pong

#

would a host send some RPC or something to generate a new room and that server stores this ID and player names in it

#

and then people join that game etc

#

or is this managed by the unity lobby service

steady kite
#

anyone know a good way to go about offline server bodies in a server. So when the player disconnects, a body remains on the server let's say (sleeping) and other players can interact with it, when the player reconnects he will be spawned back at his body location unless he was killed when he was offline. Any resources on learning to create this or just general direction would help.

tiny eagle
#

Hey guys. I have a little unconventional question. I'm developing mod for Unity game that uses Photon. And I want to find some way to communicate between clients utilising it. But looks like that in order to send some message, I need to have GameObject that have Photon View. And this view have id range to 999. It is scary to just use those id, since I cannot be sure of every view id that would be used by game or other mods. Is there a way to create some generic communication channel that wouldn't rely on those ids?

snow birch
#

Does anyone know the best Lan networking solution, to play with people on my network?

austere yacht
snow birch
#

ty

austere yacht
#

that was a joke btw (although those are great switches)

snow birch
#

lol

#

could you help me

austere yacht
#

it depends on what you want to do. mirror is probably easiest and most straight forward.

snow birch
#

i wanna make a shooting fps for me my brother and cousin to verse

#

ty

#

#lanparty

austere yacht
#

how much work do you want to put into it?

snow birch
#

enough for us to pvp

#

I am very good at coding, but I have no idea how to do networking.

austere yacht
snow birch
#

thank you

steady kite
#

is there a way to setup a mirror server that runs 24/7 ? I tried setting up a dedicated server with Playfab but it keeps shutting off

mortal horizon
frosty crystal
#
    [SecuredOperation("organization.add,admin")]
    [ValidationAspect(typeof(OrganizationValidator))]
    public IResult Add(Organization organization)
    {
        IResult result = BusinessRules.Run(CheckIfOrganizationIsAlreadyExist(organization.OrganizationId));
        if (result != null)
        {
            return result;
        }
        string base64Guid = Convert.ToBase64String(Guid.NewGuid().ToByteArray());
        organization.OrganizationId = base64Guid;
        _organizationDal.Add(organization);
        return new SuccessResult(Messages.OrganizationAdded);
    }```
#

Hello. This code is in one of my manager scripts.

#

Which layer is the best place to put 'gui' code in it?

#

so the new generated GUI will be the id name of the entity instead of incrementing the number.

frosty crystal
#

Hello People!

#

Another question šŸ™‚

#

I make OTP system for our end users and not sure if I must create a OTP table that tracks the one time password, or I can put that password as a field in User table

#

Since those values are trivial, one-time things, in any way should I create a seperate table for it?

#

I mean tens of thousand of unnecessary record will be stored at the end of the day.

#

instead of re-writing the field, I'll use the table

#

What do you think

frosty crystal
#

I got my third question already but anybody here šŸ™‚

odd badge
#

I am looking to efficiently capture the screen in unity, does anyone have any pointers to resources that may help me capture the screen and pack it into a byte array more efficiently than this. The small image is the texture creation, enum is the processing and pushing of frame to Agora and the profiler with the tanked FPS and performance

mortal horizon
velvet silo
#

Anyone know how to return a reference to a networked object from server to client in netcode for gameobjects.

zealous marten
#

im having some trouble with photon's serialize

#

so basically im trying to make it so when an object/player dies, it gets tped to death area and everyone sees that, ive tried while loops and everything but the info isnt transmitting; heres my code. ```c
using UnityEngine;
using Photon.Pun;

public class Target : MonoBehaviourPunCallbacks, IPunObservable{

public float health = 100f;
public Vector3 deathpos;
public bool isdead;

public void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info)
{
    while (true)
    {
        if (stream.IsWriting)
        {
            stream.SendNext (deathpos);
        }
        else
        {
            deathpos = (Vector3)stream.ReceiveNext();
        }
    }
}

public void TakeDamage (float amount)
{
    health -= amount;
    if (health <= 0f)
    {
        Die();
    }
}

  void Update()
{
    if (deathpos == new Vector3(0f, 0f, 0f))
    {
        
    }
    else
    {
        transform.position = deathpos;
    }

}

public void Die ()
{
    deathpos = new Vector3(-24.23993f, 37.48f, -17.78f);
    Invoke("respawn", 3);
    isdead = true;
}

public void respawn ()
{
    deathpos = new Vector3(0f, 0f, 0f);
    transform.position = new Vector3(0f, 0f, 0f);
    health = 100f;
    isdead = false;
}

}

sterile inlet
#

how to use optional parameter in a RPC (Photon Pun2)

#

I mean in methods like Kill(bool ShowGhost = true)

austere yacht
sterile inlet
#

oh, okay thanks

#

already did, because I didnt knew the solution

slow knoll
#

Has anyone encountered the same problem?:
The physical network objects falls through the floor when starting dedicated server.

[NETCODE]

prime geyser
#

what do yall think of photon?

#

good or bad?

daring junco
#

I'm making a tile turn based multiplayer strategy game, is it reasonable to make a 'synchronization' function that at the end of each turn just takes the board of the last player that moved, destroys the other player's board and replaces it with the last player that moved's board? or is that too inefficient to be worthwhile?

somber drum
# prime geyser good or bad?

you wouldn't get much out of a "good or bad" example.. depends the context and what your definition of either means

#

I would say the current state of photon they are good for most unity use cases..
also said to be "AAA" in features and quality I don't see anyone suggesting otherwise.

somber drum
wind belfry
#

When I try to sync data to syncvar, data is not synced

haughty heart
#

You can use available options like Photon or Mirror. Unity currently doesn't have a production ready multiplayer solution.

sour fiber
#

Hi all, I have a unity project where the target fremework version is 4.7.1. I am trying to include a Client project that uses grpc in this unity project. First of all, I created a library project named ClientMgr with the same target framework data(4.7.1) selected and I installed some packages in this project using nuget (net45\Google.Protobuf.dll , net45\Grpc.Core.Api.dll, netstandard2.0\Grpc. Net.Client.dll, \netstandard2.0\Grpc.Net.Common.dll). Then I added this library (ClientMgr.dll) to my unity project as a reference. My project compiles without any problem, but when I run my game in Unity, my reference file (ClientMgr.dll) I added is automatically deleted and I get an error. Can you help me where am I going wrong?

ashen shoal
#

Is anyone using the new input system with the new unity netcode?

rotund terrace
velvet silo
#

when would you call a server rpc without ownership exactly?

opal finch
#

Does anyone have experience with Unity MLAPI/Netcode and Mirror? Been working with the former for a few weeks and keep running in to breaking bugs that are logged on the forums. Wondering if switching is the right move.

#

I guess a simpler way of asking - is mirror considered production ready? (I think the answer is yes but always good to get views)

somber drum
#

Mirror is 100% production ready.
It is between Mirror and Photon usually depending on game.

opal finch
#

Thank you @somber drum

#

I was wondering why the APIs were so similar, I guess it's the UNet origins

somber drum
#

Though its been improved so much its not really fair to call mirror unet, but yeah they kept it easy to move to mirror from unet.

opal finch
#

I think I'll spend a few days to explore Mirror, seems worthwhile šŸ™‚

somber drum
#

Yep definitely, check out the mirror community discord when you get a chance helpful folks with project showcases.

opal finch
#

Oh that's a good idea, will do

lavish frigate
#

hi, im using mirror and ive just made a lobby, but now every time i start the game it sends me this error: " Disconnecting connId=0 to prevent exploits from an Exception in MessageHandler: MissingReferenceException The object of type 'NetworkIdentity' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object" any suggestions?

modern gulch
wind belfry
#

The function named move gives this error when it stops working

#

how to fix this error?

true quartz
#

Anyone have a multiplayer game idea

edgy rain
#

hey guys i have an issue when i try to spawn a projectile both client can play the attack animation but only the master client spawns the projectile which is then take its way to the target position, the client can't spawn a projectile at all but the client can see the master client projectile however the projectile is not moving, can some one help me with this pls?

quaint moon
normal shuttle
#

So I have a problem. I started using (Netcode https://docs-multiplayer.unity3d.com/) and have game where I have Action system, and want to bradcast actions with its own parameters. Every action extends abstract class in which I want to place networking logic, but I don't know how to handle generic params that will need to go throu. Please look at diagram. I want to achieve sth like this. Is it good aproach or I should use different pattern? In both cases I'd be thankful if you'd help me with proper solution.

austere yacht
normal shuttle
austere yacht
#

its also just an example to illustrate what you can do. i'd like to think this custom serializer approach is the way to go. It allows you to keep a nice API and do efficient messaging without coupling everything in your game to the netcode

weak plinth
#

When ever I preform a animation the other player preforms the animtion to ( im using photon)

upbeat wadi
#

[Using Photon]
Does anyone know a good way to have each player with their own Main Camera references?
The game works fine when I enter the room alone by myself, but when a 2nd player enters the room, the my current player's main camera is detached, and the new player's camera reference works, so they could move around, where my character has errors of that missing cam reference and I can't move around.
Also Unity was unable to detect a main camera in the scene for my player.

worn eagle
#

Hello, I'm trying to grab a video from a URL and play it in the video player. It works fantastically the first time, but then it fails the second time (when i try to queue up another video from a different url) with this error:
ArgumentException: Failed to create file C:/Users/Kaleb/AppData/LocalLow/Scythe Dev Team/Happys Humble VR\tempvid.mp4 UnityEngine.Networking.DownloadHandlerFile.InternalCreateVFS (System.String path, System.Boolean append) (at <e61918abe7eb4cca803071d15bb3e52b>:0)

#

Here's my code:

IEnumerator SaveVideoToDrive(string vidURL)
    {
        uwr = UnityWebRequest.Get(vidURL);
        string path = Path.Combine(Application.persistentDataPath, "tempvid" + ".mp4");
        uwr.downloadHandler = new DownloadHandlerFile(path);
        yield return uwr.SendWebRequest();
        if(uwr.result == UnityWebRequest.Result.Success)
        {
            v.url = path;
            Debug.Log("File saved to: " + path);
        }
    }```
#

Any idea what I can change to fix it?

#

It's specifically this line that fails uwr.downloadHandler = new DownloadHandlerFile(path);, but only after running the method the second time

runic rampart
#

Using Netcode for Gameobjects - can I refer to prefabs over the wire?

magic barn
#

Hello plz help I'm new to mirror this code works if I'm getting the client identity. But how about the server ? I've been searching around to no avail.
can anyone help. ^^
// PlayerManager is basically the one that spawning

NetworkIdentity networkIdentity = NetworkClient.connection.identity;
PlayerManager PlayerManager =networkIdentity.GetComponent<PlayerManager>();

bright mauve
#

But mostly it depends on the case

#

Of what you are trying to do

runic rampart
#

I got around it, I wanted to refer to a prefab asset that isn't a network prefab over the network so other clients can spawn it

spring crane
upbeat wadi
# spring crane Spawn camera for the entity that has a network identity marked as local.

Thanks! I was using the pre-existing camera.main in the scene and referencing it to the entity on start(), I guess I'll remove the main camera from the scene and have each own entity spawn their own. Should I tag it as Main Camera after spawning them or will that have conflicts?
(Assuming I'll handle deleting any other main camera if it's not local)

spring crane
austere yacht
edgy rain
#

hey guys i have an issue when i try to spawn a projectile both client can play the attack animation but only the master client spawns the projectile which is then take its way to the target position, the client can't spawn a projectile at all but the client can see the master client projectile however the projectile is not moving, can some one help me with this pls?

feral oak
knotty solar
#

Hey guys! Just had a quick question about headless server builds, is there any way to make one for iOS?

random ore
#

I just started work on a 2d top down multiplayer game using photon. i cant fin out how to make the camera follow each player. how can i do it?

modern gulch
# upbeat wadi [Using Photon] Does anyone know a good way to have each player with their own Ma...

If ur camera is an object not in player prefab u can have a cam pos obj in ur player prefab and give ur cam a tag as cam and
If(isMine) Transform cam = GameObject.FindObjectWithTag("cam");

And set that camera position to cam pos object position but if ur camera is a part of player prefab then u can simply enable or disable camera depending on isMine

Note the keywords above just give a basic idea they might be not correct

modern gulch
#

It might help u as well

upbeat wadi
stiff ridge
edgy rain
feral oak
edgy rain
feral oak
edgy rain
feral oak
#

You should be able to. You can pass floats through rpc. Pass it that way

edgy rain
feral oak
vast solar
#

guys which server tier on aws lightsail would be enough for about 20-40 players in a browser party game

#

i am using mirror

weak plinth
#

id say try the $10

obtuse tulip
#

anyone real familiar with Photon 2.0 here ?

obtuse tulip
#

So, if I call PhotonNetwork.Instansiate() on a prefab, and I only do that from the master client, where do instances of the scripts in that prefab exist? I'm getting a bit confused because they seem to quasi-exist on everyones client but at the same time not exist there at all. Like I'll do something like
```
[PunRPC]
private void SetSolvingPlayerCrossNetworkRPC(int viewID)
{
_solvingPlayer = PhotonView.Find(viewID).gameObject.GetComponent<PlayerController>();
}

but `_solvingPlayer` never updates on the clients...
high phoenix
#

does anyone know what this error means (newlly downloaded lobby sample)?

weak plinth
#

Getting this issue

#

Whenever I try to create a room

quaint moon
feral oak
#

This is super vague. Also unless you make variables for the photon variables you have to call them before. Otherwise how would the script know what you’re using?

keen pivot
#

Hello I have one problem

#

I am doing a multiplayer game and the rooms are not complete never so I need to create bots to complete the rooms

#

But I don’t know how to do it

rocky garden
# weak plinth

hey same here trying to create new room for each scene cant figure it out

#

did you find any solution please let me know

weak plinth
#

I just changed my scene to switch to

#

idk that fixed my issue\

rocky garden
#

if not possible go through this and see if you can give me any solution

#

I have 3 Scenes which are main menu , office and outdoor
the player connects to photon server on main menu
and joins office room on pressing join button
the player can enter the outdoor scene on trigger
so i want to create a photon room for outdoor scene on trigger

keen pivot
#

Hello I have one problem

I am doing a multiplayer game and the rooms are not complete never so I need to create bots to complete the rooms
But I don’t know how to do it

#

Please help

weak plinth
#

Does anybody know what the best networking solution is for a simple turn-based Chess-like game with "deck"-building? Preferably with the potential to futureproof server set-up for anticheat. I want to use it with PlayFab, at the moment I'm looking at Mirror.

#

I have previous experience with Photon PUN and Fusion, but not sure it's what I'm looking for with this project.

sage saffron
high night
#

@weak plinth Playfab might be pretty nice imo

#

You could use something like redis to store states that belong to the matches

weak plinth
#

Are you talking about asynchronous play?

high night
#

it could be synchronous too

#

with cloud functions and a fast database

#

it might be just fine

#

you wouldn't host a server for the game

#

you'd just worry about cleaning up the database after the games are finished

weak plinth
#

That would be fantastic if it was viable.

#

Only problem is I need to use a clock to keep track of time remaining.

#

I saw with Mirror you can have hundreds of 1v1 games running on a single server.

keen pivot
#

Hello I have one problem

I am doing a multiplayer game and the rooms are not complete never so I need to create bots to complete the rooms
But I don’t know how to do it

weak plinth
keen pivot
#

Ok let me explain better

keen pivot
# weak plinth That's a very open-ended question.

I meen that to start that game there must be 30 players in a room but only they are 10 so to start the game are left 20 more players so for people not to wait instead of 20 human player join 20 artificial intelligence players automatically after a time

feral oak
feral oak
#

Maybe have it to where the master calls it and switches everyone

keen pivot
keen pivot
high night
#

@keen pivot I'd think of ways to server/master client simulate additional players

#

I always use the "player" of the networking library as the clients entry point and nothing more

#

If your game uses the "player" as the players character, thats gonna be more difficult for you

#

I suggest designing it so that the "player" object possesses a networked object which is a character, a player controller

#

Then make it interchangeable with AI controller which also can possess the same character

weak plinth
feral oak
keen pivot
#

Ok thanks for all of you

mint slate
#

how to make multiplayer

#

?

weak plinth
#

roblox

mint slate
#

?

weak plinth
weak plinth
#

here is what you need to search for:

#

How to make multiplayer games in Unity

#

Just copy and paste

limber zephyr
#

hey guys

#

im using photon pun 2

#

how do i check which player i am

#

like am i player 1 or 2

#

cuz i wanna assign red team to p2 and blue team to p1

#

just want a simple if(playerid == 1){redteam} or smth like that

patent fog
#

Or maybe UserId instead, because docs say ActorNumber are never recycled on re-join

#

Also pay attention to :

UserId of the player, available when the room got created with RoomOptions.PublishUserId = true

weak plinth
#

I feel like this had something to do with code so imma ask here, When I preform an animation my other player preforms it too. Any idea on how to fix this? I use Photon.
Please help
Need this for a school proj

mortal horizon
#

probably need to check if the photon view is the local view

weak plinth
#

I’m using photon pun 2 and I want to know, how could I save rooms to a server?

#

So like if someone creates a room named ā€œroom1ā€ then builds in it and leaves

#

then recreates a world named ā€œroom1ā€

#

that building isnt saved because they’re making a whole new instance of the room, how can i make it safe on the photon servers?

rocky garden
#

im having a problem with creating room with photon
players are joining their own individual rooms instead of joining a single room
how do i fix this

spring crane
chrome rover
#

Anyone know Multiplay from Unity? How many players can it have per server?

rocky garden
#

im using trigger in photon

#

but when one player enters trigger area it triggers for all users

#

how do i fix this

patent fog
#

You could check if player entering the area is the local player

rocky garden
weak plinth
#

Hi, chandraprasadajay26.

rocky garden
weak plinth
#

How are you?

rocky garden
weak plinth
#

Good, how about you?

rocky garden
weak plinth
#

Okay.

rocky garden
feral oak
#

Then you would call change scene inside that

rocky garden
#

if(!photonView.IsMine) return;

is this correct

#

is this the way to check for local player

feral oak
#

That checks that if it’s not yours

#

But if you want specific code on the local player you would say is

if(photonView.isMine)
{
Code here
}

#

@rocky garden

sly saffron
#

Hey everyone. I'm trying to implement networking in my game which is like a matchmaking 5v5 shooter. I'm thinking that dedicated servers are better than P2P for this. What are the top recommendations for dedicated server (API?). I've heard of Mirror, Photon, and Unity's Netcode for Gameobjects. I'd love to hear some thoughts.

feral oak
# sly saffron Hey everyone. I'm trying to implement networking in my game which is like a matc...

I like photon because of the simplicity and the variety of resources and tutorials. There are a ton on shooter game tutorials. You also can have 20 concurrent players for free for testing and designing the game. Mirror is another good option, I still prefer Photon. If you have a good knowledge of Networking then Unity’s new solution may work for you, just not a lot of resources currently.

rocky garden
#

even if other players enter trigger area its getting triggered on master client

rocky garden
#

just a sec

rocky garden
feral oak
rocky garden
#

i cant paste my code here

#

its getting deleted

#

ill dm

feral oak
#

Okay

rocky garden
#

i just did \

weak plinth
#

So for a simple Chess-like game (with slight adjustments such a piece-dropping like Shogi and "deck"-building), would it be possible to create a local multiplayer version first, then implement a client-server-based multiplayer function later on? I've been trying really hard to work out how to get it set up for it, but I think I'm just not getting it. I want to spend more time doing rather than going in circles, but ideally I don't want to have to start from scratch when I do get around to it.

austere yacht
crude fractal
#

what is the best multplayer network option for webgl based 2d games ?

#

photon is overkill ?

obtuse tulip
#

if I use PhotonView.Find() how do I then get the gameObject that view is attached to and how do I get components attached to that gameObject?????
I've tried:
PhotonView.Find(2).GetComponent<GameManager>();
and:
PhotonView.Find(2).gameObject.GetComponent<GameManager>();

glass steeple
#

and what happened?

wanton fulcrum
#

I have a doubt, can python socket server accept unity socket client?

green reef
#

Hello, I recently jumped from unity 5.x to the 2021 version (Big Jump!) I am in the process of learning the new Unity.Netcode functions and the issue I am having now is that I cannot send GameObject references via ServerRpc calls. Does anyone have recommendations to get around this?
Unity 5.x worked:
void CmdThisGuy(GameObject objWithNetworkIdentity)
Unity 2021 Does not work:
void ThisGuyServerRpc(GameObject objWithNetworkObject)

sand dirge
#

Possibly best to ask in the official dedicated netcode Discord. Invite is pinned in this channel

weak plinth
#

How do I make my collider ignore other players so we cant stack and etc in photon

glass steeple
#

Use layermask

stuck snow
#

so, I'm finding that Netcode for Gameobjects works well in engine, and most of the time well in build, but I have an intermittent problem where the NetworkEarlyUpdate duration increases steadily, eventually taking more than a second per frame (and ultimately beyond that the player crashes and I can't log further). When that happens I see things like this in the profiler:

#

I also get a console full of these (999+)

#

and it appears to start after this cryptic error, which has absolutely no stack trace info or any other context beyond this message:

quiet ginkgo
#

My game is on Steam. When it starts up, Windows asks if you want to allow it to access the network. Is there a way to automatically allow this during installion?

#

The problem is that this question is asked when the game goes fullscreen and it seems as if it's hanging.

#

The game is slow in Windowed mode and the cursor will cause issues if it leaves the window.

barren onyx
pseudo drift
#

Is it a bad idea to use animation events in a mulitplayer game? I have an attack that i wish to add a hit effect at specific time of the animation, i know that i can hard code it but it's alot easier in case i want to add a modifier to the animation speed

crude spindle
#

how can I get photon to handle the View ID automatically?

spring crane
quaint moon
#

I forget what’s it’s called, kind of like a key frame but for calling methods

pseudo drift
#

good idea ill try it

weak plinth
#

In photon sometimes in my FindRoom function, it dosent show the room that was created

#

But when im in the editor instead of the actual build it lets me create a room that others can find

#

But its different in the build

weak plinth
#
    public void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info)
    {
        if (stream.IsWriting)
        {
            stream.SendNext(health);
        }
        else if (stream.IsReading)
        {
            health = (float)stream.ReceiveNext();
        }
    }```
I have this code and I am making a 2d shooter game
so when I shoot the player it's health decreases but when I click on the other player in the editor and go back to that player it's health goes back to 100
and the health doesn't update in the other player's screen
weak plinth
#

(ping me)

fading apex
#

I get these errors when I click on the Network Manager while the game is running. I have tried re-importing the Netcode for GameObjects Package already.
Anybody got an idea on how to fix this?

weak plinth
#

Hey I get this error in** Photon Pun 2 **

weak plinth
#

So bassically when im in the room by myself I can send messages

#

but as soon as another player joins the messaging dosent work

#

It may be because of this

fluid tapir
#

What's your guys opinion on Fishnet vs Mirror?

austere yacht
tidal frost
#

hello there, i am working on a 2d online multiplayer game called yarnball does anyone know how to make physics smooth in multiplayer šŸ¤” and update the score across network, i am using photon with unity 2021.2.8f1 thank you for your time in advance

gray hill
#

how do I access the ServerGameNetportal in netcode

manic topaz
#

can you help me to know why when a local player connects to my world through riptide it generates player 2 but when it connects externally by public address with the port open, it only connects and does not generate the object (I get the message that you have connected correctly in the console and others)

rare notch
#

anyone know a fix for this?

#

also says "Display 1 - No cameras rendering"

manic topaz
#

some idea what is wrong?

barren onyx
#

Using mirror, how can I ensure that the object will self create on the client side? E.g. I spawn an item, a client joins, but now how do I make the client "sees" the item I created. Does Mirror handle this process automatically when joining the hosts?

quaint moon
quaint moon
barren onyx
white wagon
#

Does anyone have a good resource as to where to start with networking, I know nothing about it, don't know what would be considered the beginning

quaint moon
white wagon
#

Is that in the unity api? Or just Google mirror networking?

olive vessel
#

Mirror is a community solution, Netcode for GameObjects is the new official Unity solution

#

Definitely shop around and compare different solutions

manic topaz
#

help pls someone know why is this error or how can fix it?

patent fog
#

Anyway this error tells you something wrong with the signature of the method

#

Presumably wrong number of params

#

Oh wait is this used in mirror also ?

#

Uhm this looks valid in mirror. If I understand well in earlier versions you were supposed to register the callback but now it's suppose to just work if you directly override the method.

#

Just to make sure, your CustomNetworkManager does implement NetworkManager, right ?

tranquil pollen
#

I'm just researching some networking options and curious: has anyone here ever worked with DotNetty (or any of its up-to-date forks) for the base of their networking on the server side?

#

It looks interesting. I'm really just curious if its considered performant enough generally for games

austere yacht
tranquil pollen
#

Sorry, I'm really just looking for feedback about experience with DotNetty in a game networking context.

#

I've found a very small amount of talk about it through google-fu but not enough to know if its worth the time to pursue it further for games. Code-wise, it looks like it should work fine

austere yacht
#

do you know of any game using it as its primary network library?

tranquil pollen
#

Not that I know of but thats not a very helpful metric lol

#

I pretty sure one of the threads I seen some talk about it was a unity forum thread so hoping to maybe get some feedback from the community in here

olive vessel
#

I would say use in production games would be a very useful metric as to whether it is performant enough in games?

#

If no game uses it, perhaps they thought it was dogshit for use in games

tranquil pollen
olive vessel
#

You'll just have to wait and hope then, but in all my time here I have never seen it mentioned before

#

And maybe, don't be an arsehole

tranquil pollen
rocky garden
#

is it possible to exit scene and join scene in a photon room

upbeat wadi
#

[using photon]
I have two players join the room, they both have a player script that has something like

if (!photonView.IsMine)
        {
            cam.SetActive(false);
        }

This is to prevent having multiple cameras active at the same time.
However, when the 2nd player join, your own local player's camera becames unactive. Which makes no sense. How come when a new player joins, your own player's camera become unactive when IsMine is true for you?

rigid eagle
#

as you guys can see I don't have any problem on client's view

#

but RemotePlayer is flickering

#

How can i solve this problem?

#

Im using PUN

spring crane
upbeat wadi
frosty crystal
#

Hey folk

#

Is it a good practice to put a JSON file into a varchar field of a relational database table instead of using NoSQL

#

so we get the data as raw json and deserialize in the client side.

#

and make the changes and send as json string to the same place.

#

thank you

fallen dragon
#

In dire need of some backend assistance from a masterful wizard with Unity and Node.js server stuff! A discord call where we go through some basic things would be amazing and I'd definitely tip the person with atleast a coffee.

full holly
#

I am new to networking

#

And i am not sure what to use

#

Pun Or mirror

#

What would be beginner friendly?

#

I saw some videos on yt
But most vids are old and the comments were suggesting newer alternatives
So asking here

frosty crystal
#

I began with Pun. Begin with Pun. Pun is fun. Fun is Pun šŸ™‚ and free.

full holly
#

Thanks!

#

Unity multiplayer netcode
Is this any good?

rocky garden
#

im having problem with using trigger in photon
i have a trigger in the game which activates a canvas. the trigger is accessible by any player. but the problem is if any player triggers the canvas the canvas is being shown on everyone screen instead of the player who triggered the canvas

pliant sundial
# full holly And i am not sure what to use

You should also note that mirror and netcode are using a server client architecture, while there is no server in pun. So choosing between them also needs to account for what kind of game you are making. E.g. you cant have dedicated servers in pun. Pun and mirror are best for beginners because of the amount of tutorials there are and the size of their communities, you can join their discords for help too, links to them are pinned here in the channel. Netcode is still lacking tutorials, but if you are fine with trying out stuff on your own and reading documentation you will be fine with it too. Their community is small but the devs help a lot on the netcode discord.

I would use PUN if you want to make any mobile game.
If you need dedicated servers use mirror or netcode.
If you plan to release on steam/epic games store or another store that provides a free relay use mirror or netcode (then you get a free relay instead of paying for it like you do with PUN)
If your game doesnt care about cheating and is not releasing on a store that is giving you a free relay use PUN.

pliant sundial
formal ocean
#

Which one is the best between netcode for gameobject or mirror?

glass steeple
formal ocean
#

So I want to have p2p so people can host their own servers and doesn't need to open a separate file to host a server

#

Can netcode have p2p?

austere yacht
formal ocean
#

Pear 2 pear

#

No host server

#

Peer

#

Can't spell

austere yacht
#

there is no game networking middleware that uses P2P as a fundamental architecture

#

it is generally viewed as a dead end architecture as it does not scale well

formal ocean
#

Ok so maybe its not p2p

#

But like in mirror

#

You can just click host and a server is hosted without a separate file opening

austere yacht
#

if you mean an architecture that does not require a dedicated server, all of them can do that

formal ocean
#

Yeah i gues that's what it is

#

So then it's not p2p?

austere yacht
#

no

formal ocean
#

Okok

#

So yeah I don't want a dedicated server

austere yacht
#

its called "host based networking"

formal ocean
#

That's good to know

#

Thanks

austere yacht
#

it is still server/client, where a client that is also the server is called the "host"

formal ocean
#

Ok so both mirror and netcode support host based networking

austere yacht
#

yes

formal ocean
#

Ok so now I gotta check out the features of both to figure out which one to choose

#

Is there a sample project for netcode?

austere yacht
#

yes

#

what features are you looking for

formal ocean
#

Well if there is some kind of server list that would be nice

#

And a lobby system before the game starts

austere yacht
#

thats not really a core part of a network library, but mirror comes bundled with a few simple sample-components to make prototyping discovery and a lobby easier

formal ocean
#

Yeah I used mirror for a bir

austere yacht
#

for discovering other remote servers you need to build/subscribe to an external relay/discovery service

formal ocean
#

Or maybe using a code system

#

Liek among us each lobby has a code and you can enter it to join

austere yacht
#

that is a part of the game design and hard to generalize, so any lobby solution you might find in a networking library will only ever be an example

formal ocean
#

I see

#

Thanks for helping

#

I will be testing both solution and see which one is the best for my need

austere yacht
#

they can both get you to where you want to go, unless you want to build a MMO, in which case no middleware library can really help you šŸ˜„

true spade
#

gawd it's going to take me weeks just to decide on a networking package... MLAPI or Mirror

olive vessel
#

Remember MLAPI is now known as Netcode for GameObjects

sly saffron
#

For Netcode for GameObjects Is there an example for using server authoritative movement with like an FPS type game? Something using continuous movement I mean

austere yacht
sacred spoke
#

Im using Photon Pun 2 - I have a persistent scene containing my loading screen. When a player connects to someones room and loads their level via PhotonNetwork.LoadLevel() it destroys my loading screen screen. I wanna do the photon equivalent of SceneManager.LoadScene("Loading", LoadSceneMode.Additive) does anyone have any insight?

frosty crystal
#

Hello.

#

I am making a OTP system and wondering if I should OTP as an attribute in the User table, or a seperate table stores both the OTP and metadata with it.

#

What happens if I had 1 million records at the end of the day for just authentication system.

#

does this decrease the performance of finding the phone-otp key pair.

#

Or should I delete upon after the authentication is done?

high night
#

@frosty crystal You can use managed services for common use case stuff like these

#

I'd use playfabs authentication

#

It's supposed to distributed systems for managing infinite users at the same time

#

If you wanna do it yourself, maybe you can try to build it over a distributed database service online

frosty crystal
#

I made it in a way that the OTP is generated and gets stored in a table. and an SMS service sends the code to the user.

#

user enters it and I check if it matches, he gets the access token.

#

@high night

#

Our system is little bit different. I do not know what to do.

high night
#

@frosty crystal I just suggested a little something for 1 million user situations

#

That'd probably require your logic and data running in cloud

frosty crystal
#

šŸ‘

sly saffron
#

With netcode for gameobjects When I use network rigidbody and network transform on my players. The host seems to have much higher gravity than the clients. Meaning he falls way faster. Any ideas?

brave saddle
#

Hey, so I have a problem where Mirror will throw an exception:

OnChangeOwner: Could not find object with netId 8

This is caused by me transferring client authority away from an object (using RemoveClientAuthority) to another object (using AssignClientAuthority) and then destroying the object I transferred away from within the same frame (using NetworkServer.Unspawn or NetworkServer.Destroy). At some point then the client will receive a OnChangeOwner message for the old object that no longer exists.

So far the only way I've found to deal with this is to delay the actual object destruction by a frame (so I just mark it as 'dead' and clean it up later in LateUpdate).

But finally the question, is there some proper way of doing what I'm trying to do above or perhaps a different approach that would solve the problem or is the solution just delaying like I did?

#

Maybe it's a Mirror bug, but I wanted to see what others thought of it

dusky storm
#

actually I think he's here too @gray pond

true spade
#

how do I create a singleton script in Unity .. guess i'm not familiar enough with how the framework instantiates scripts

brave saddle
#

Oh, never noticed Mirror had a specific discord for some reason

quaint moon
# slow lichen

You’re not showing the code that changes the scene

slow lichen
#

But I can show

#

One sec

#

Oh fuck

#

I called OnStartHost in OnStartServer

quaint moon
#

Yeah that looks weird

#

I don’t think it’s the problem though

#

Do you get any error messages?

slow lichen
#

Idk why but in editor all works fine

#

But in builded game all brokes

quaint moon
#

What part breaks

slow lichen
#

Scene just don't load

#

I click to connect

quaint moon
#

That’s when you build the game for the client or server?

slow lichen
#

The client appears at the host and disconnects after a while

quaint moon
#

That’s because when you join as a client, OnStartServer doesn’t get called

#

OnStartServer is a server callback, not a client callback

slow lichen
quaint moon
#

You’re right it’s ServerChangeScene

#

Here’s the thing

#

You are more than likely getting errors, I’d assume a Client ready problem or something of the sort

#

But you don’t see them in the built version

#

I recommend getting Parrel sync

#

Then you won’t have the build the game every 10 seconds

slow lichen
#

I send this network message when client is ready

slow lichen
quaint moon
#

Just trust me and get parrel sync

slow lichen
quaint moon
#

It’s a unity extension you can get on GitHub

slow lichen
#

Oh understand

quaint moon
#

It will create a clone of you’re project that will automatically update as you change the main one

slow lichen
#

I have opened ports

quaint moon
#

It lets you test stuff without building the game

slow lichen
#

You can just connect to my host

slow lichen
#

I will try install it

quaint moon
#

It’s very quick and easy

#

And the clone editor will show all the errors, warnings, and logs so you know what’s wrong

slow lichen
#

Okay

#

I installed it

quaint moon
#

Did you create a clone?

slow lichen
#

In process

quaint moon
#

Okay

#

Always test everything on just a client

#

Lots of things will work when you’re hosting but not on a client

slow lichen
#

ready

quaint moon
#

Open it in a new editor

slow lichen
#

ready

quaint moon
#

Start host on one and join as client on other

#

Check the console on the client for errors

slow lichen
#

All works fine

#

No errors

quaint moon
#

We have identified that it’s a server build problem

slow lichen
#

Hm

quaint moon
#

I use docker containers for unity log files so im not too sure what you should do

#

But look up how to get log files for a server build

slow lichen
#

Oh

#

I find one error on serverside

#

But she is not paired with client connect

#

but maybe paired

#

There is already a player for this connection.

#

Then I trying to register player more than once

quaint moon
#

Okay wait

#

You said it works when you do it just in the editor?

#

That doesn’t make sense

quaint moon
#

You’re server is changing the scene before the client even joins

#

I can see it working on the host in the editor but not on the client

quaint moon
#

So it doesn’t work on the client in the editor?

slow lichen
#

But when I starts host in build

#

and connect using editor

#

all is work

quaint moon
#

What happens when you start host in editor and join in the other editor

slow lichen
#

If I changed code I should clone again?

quaint moon
#

The clone will automatically update

slow lichen
#

No errors

#

All works fine

quaint moon
#

There’s no way it works if the server changes the scene in OnStartServer

slow lichen
#

I changed this code

#

I set lobby as parameter for NetworkManager

quaint moon
#

Where do you change the scene now?

slow lichen
quaint moon
#

I highly recommend not using the NetworkManager default offline scene and online scene

#

It’s seems like you may want to use a NetworkRoomManager and NetworkLobbyManager

#

At least don’t use the online scene

slow lichen
#

And don't understand difference between NetworkManager

#

Between Room, Lobby and host

#

Or how it works

quaint moon
#

Read documentation

slow lichen
#

That includes network rooms system

quaint moon
#

You understand now?

slow lichen
drifting osprey
#

I've heard of Photon, Mirror, Riptide and other Unity Networking solutions. Which one did they use in recent multiplayer FPS sample? Is it still the best one to start with right now in terms of the amount of UDP features?

mortal horizon
#

(netcode for gameobjects, aka MLAPI)

drifting osprey
#

there's the networking samples, and then there's a separate FPS sample where they employed 15+ various Overwatch-Level UDP techniques like Rollback Networking. I want to use the bleeding edge of professional UDP optimization. I'm interested in whichever one has most of these features built-in.

#

Is the FPS sample from 2018 still the best one in that aspect?

mortal horizon
#

if you want rollback and easy prediction id recommend photon fusion

#

they have all that stuff pretty much turnkey

pliant sundial
#

I am also not sure what you mean with "professional UDP optimization" overwatch did not modify UDP their networking code is just built on top of UDP.

split sonnet
#

Hey, who is expert in photon pun networking??

austere yacht
drifting osprey
#

Got it. Thanks, all

sonic owl
#

Hey i'm setting up a simple multiplayer game test with mirror but i'm having a problem with the camera every time a new player join the network no one can move their cameras, am i doing something wrong, should the camera also have a network id and be connected to each player or something ?

austere yacht
worn shale
#

so I have online steamworks & mirror lobbies setup and working thanks to a tutorial on YouTube. Soo I have a local play board game, if it's an online lobby, I basically set a variable "isOnlinePlay" , and if so it'll change a few things.

I have a few questions:
For things like syncing a random dice roll, I use a command, and then use a ClientRpc to send the roll to all the clients. Is this a good practice, should I do it for other things such as selecting a pawn to move?
Secondly, how can I give the pawns networkidentity? If I do that, they do not appear in offline/local play. Can I give them one manually after online starts? Worth noting all the pawns are pre-set in the world, they are prefabs but aren't being instatiated, they're in the world. It's not really giving me any issues the way I have it setup.

And is all this above good/fine practice? thanks

sonic owl
quaint moon
prime geyser
#

anyone know why when i connect to my photon server the playerobject gameobject always gets deleted from players that arent ticked with IsMine in photonview?

oak flower
#

!mute 911573495908032552 7d It's your only activity here. Spam.

raw stormBOT
#

dynoSuccess Akarsh jain#1773 was muted

steady crater
#

I have a question: i know games where players can play without any server, where one of players is server-client. How it can be realised? I know that without network settings, an Internet provider and a firewall, it is impossible to make a network interaction where others connect to one of the players via the port, or am I mistaken?

verbal lodge
somber imp
#

how do you sync scale in mirror?

austere yacht
distant bolt
#

!kick 739274312195899463 if you're here being an intentional troll, don't come back

raw stormBOT
#

dynoSuccess Jamz#0001 was kicked

true spade
#

Anyone know why I have my build set for windowed mode but on my mac the client tries to read my mouse input in the game even when my mouse is outside the window for my game? I’m trying to test@multiple clients connected in my@mutltiplayer game and this is making it hard

potent glacier
#

bro how does normcore work

shell relic
somber imp
velvet sonnet
#

does anyone know of a simple networking library? like... really simple. Something where I can just create a server just by doing something like "listen port(7777);"

HLAPI seemed like it was perfect for me, but now it's deprecated and doesn't work 😦

high night
#
        server = new Host();
        Address serversAddress = new Address();
        serversAddress.Port = port;
        server.Create(serversAddress, 10);
#

like this?

verbal lodge
stray heron
#

check documentation

#

and especially quick start project

weak plinth
#

for something like vrchat what should i use?

stiff ridge
#

VRChat is using Photon. Would recommend a look into Fusion for new projects.

high night
#

isn't fusion for state syncing multiplayer?
photon pun would probably suit better for vrchat
and it'd be easier

spring crane
high night
#

Oh, interesting

glacial totem
#

I've built a physics-state syncing implementation with rollback using that.

mortal horizon
weak plinth
#

Im using Mlapi , any one know hof i can connect between players outside the local network

uneven mural
#

Hey guys, new to multiplayer.
I was wondering if anyone had a good tutorial to start with. I'm making a 4vs1 player game and I was wondering what the best workflow would be. First make the 5 players with each there scripts, models, animations,... and then script multiplayer
or first script multiplayer and then make the 5 players?
I was thinking of using steamwork.net since I want to put the game on steam.

slate maple
#

is this a channel to ask questions about netcode for gameobjects?

velvet sonnet
# stray heron mirror. It’s actually not hard

yeah I checked out Mirror, FishNetworking, MLAPI, etc. I just... don't know how to read any of their documentation. All they show are a bunch of functions, not how to use them. I was hoping in the documentation to find a tutorial showing how to set up a barebones listening server, but none of them had any. Also, all tutorials seemed to be based around dragging/dropping refererences into a NetworkManager GameComponent, and I just didn't understand what was going on. I needed a high-level API, and HLAPI was it but now it doesn't work 😦

quaint moon
shell relic
# velvet sonnet yeah I checked out Mirror, FishNetworking, MLAPI, etc. I just... don't know how ...

The creator made some tutorials for basic stuff. I can feel how it can be really confusing, and mirror does have a lot of tutorials. Fish-Networking and mirror and very similar in how you use them, but right now fishnet might not be the easiest to learn just because of lack of community tutorials. I'd reccomend following Dapper Dino or Firstgeargames's mirror tutorials and learning, then switching to fishnet.

velvet sonnet
#

do I have to use the NetworkManager gameobject? All I want to do is send text message between server and client, so i was looking for a simple API that would let me code that

rocky nebula
slate maple
#

is mirror a better alternative (at the moment) to netcode for gameobjects?

velvet sonnet
#

what if.... i use a realtime database instead of a disk database..HMM

#

here are my thoughts. UnityEngine.Networking, while mostly broken, still works if you want receive/send data to a webpage/PHP script.

What if, on the server, I have something like MySQL database, but living in memory instead of disk (so I/O is much faster), and the DB has two tables: a master table, and a change table.

All clients update their state by pulling info from the master table, but submit any state changes to the change table.

The server verifies/denies entries in the change table, and the ones that it approves are sent to the master table. All clients then update their state with the new master table.

high night
#

@velvet sonnet I don't know if there's more context to this but how about something like this?

client -> server verifies/denies request -> memory cache database (redis perhaps) -> disk database (can be mysql)

#

and the server won't ever know the disk database

#

all the server will know is the memory database which is redis cache

#

pages of the cache could be saved the disk by least recently used principle

#

If you like this, there's probably premade solutions for this so you don't have to worry about doing all the cache management stuff

velvet sonnet
#

yeah that works too, but the reason why I was thinking client -> change DB -> server was because idk how to create a connection (via code) between the client and game server, but I do know how to create a connection between client and my webserver/DB.

Issue I have now is I can't get json parsing to work on Unity! I think... I'll just have to learn Mirror, at least to get the client/server connection working.

Then I can just learn how to send JSON/text message between the two with Mirror, but use my own method for syncing/validating

high night
#

@velvet sonnet parse them from strings

#

Create a dto

#

data transfer object

#

that's the same shape as your json file structure

#

your json serializer library will have something like this:
JsonDeserialize<T>(jsonstring)

#

I'd try to maintain some layers, set up some boundaries between the connections between the modules

#

.
I think this might be a good general solution for all needs:

1- client <-> tcp/udp based comm <-> game server (for the realtime game)
2- client -> http -> backend (login, see my profile, friend requests)
3- server -> http -> backend (on game finished exp distribution and other authorative stuff)
4- backend -> http -> redis -> http -> persistent db (for backends persistence needs)
#

4 might be pretty easy if you wanna use some cloud services

#

You can get a cached database as managed service, they give you a nice API endpoint and you don't have to worry about anything

stiff ridge
high night
#

I was thinking fusion would had rollback stuff by default while pun wouldn't

wild lintel
#

Hi, may I ask a question does unity web request support already SSL/encryption or I need to implement some code or plug if so do you have any suggestion that can help me? thanks already for the response I try to search but i don't find anything

pliant sundial
frigid briar
#

hey how do i have to change the camera settings so that every player gets their own camera that also follows him but since i implemented my game to a multiplayer game there is only one camera that is stuck on one position. The camera script has a target so it should follow the char but it wont . Thats the camerafollow script https://gdl.space/oqabimahog.cs and the spawnplayers script https://gdl.space/bupubareye.cpp also i use photon 2 pun free

pliant sundial
#

You dont need to have a camera prefab that you spawn, easiest way is to make the camera part of the player prefab but deactivated and then you turn the camera on the local player on.

frigid briar
#

ok

frigid briar
pliant sundial
frigid briar
#

its in the inspector right? or u mean just creating a child gameobject??

pliant sundial
pliant sundial
frigid briar
#

when i click on camera

pliant sundial
frigid briar
#

all i do rn is that i create a prefab of the camera each time a player join

#

which is wrong i guess