#archived-networking

1 messages · Page 119 of 1

ashen coral
#

It makes it so you can call that function on other players. RPC means Remote Procedure Call. Procedure in this case just means function/method. So remote function call.

grim merlin
#

Thanks!

nimble onyx
#

does anyone know how to use websockets for webgl builds

#

or a library

weak plinth
#

how do I update GameObject's active state when using Photon Multiplayer

#

?

#

like I wanna set a gameobject to not active

#

but it doesn't update in the other client

#

(ping me)

spring crane
#

You need to tell other clients to disable that gameobject. PUN isn't going to assume too much about what needs and doesn't need to be synced.

solemn haven
#

Hello. I want to make timer that will be the same for all players. how can I achieve that? My game is not a realtime multiplayer. Is it somehow possible to store timer script on database and read from it from every player's perspective? The only thing that all players will have in common are this timer and the leaderboard.
Both timer and Leaderboard should Reset in specified time

mossy sparrow
#

hello guys anyone here using pun2 ? i need help about event code

#

i pass the constant with byte value is 1 to the raiseevent function

#

then i debug the event.code from the Event function it return 209-210 value, why?

spring crane
mossy sparrow
#

i found the problem, changed raise option to all fixed, thanks 😄

weak plinth
stray moth
#

Hey guys i have been strugling with this error for the entire day and i need help

#

Any inpuy on how to solve this

granite yew
#

How can i make a meeting system like among us in photon unity networking? I already got the functionality of calling a meeting but idk how to make the actual meeting UI and the ability to vote someone out.

pure loom
#

Hi. I'm stuck on 0 for the playernumber using netcode following a tutorial by Dilmer Valecillos. when I add a host it keeps the networkvariable 0 on 0 although it should increment it.

    public NetworkVariable<int> playersInGame = new NetworkVariable<int>();

    public int PlayersInGame
    {
        get
        {
            return playersInGame.Value;
        }
    }
    private void Start()
    {
        NetworkManager.Singleton.OnClientConnectedCallback += (id) =>
        {
            if (IsServer)
            {
                Logger.Instance.LogInfo($"{id} joined the server");
                playersInGame.Value++;
            }
        };
        NetworkManager.Singleton.OnClientDisconnectCallback += (id) =>
        {
            if (IsServer)
            {
                Logger.Instance.LogInfo($"{id} left the game");
                playersInGame.Value--;
            }
        };
    }
``` I also happen to have 2 errors on the "Logger" script, but that was taken from his github
#

Ping me if you have an idea what might be the reason

flat jackal
#

Hey, i need some recommendations.

I was previously using PUN2 for networking and Firebase for Data management (User Auth + Storing Data). Unfortunately i felt into some problems that could not be solved. So i am looking for a Platform that suits the same things but with another feature: More server Control. I read lots of things on google about things that could match but i am not sure. I found following ideas:

  • GameSpark - they recently moved to AWS GameSpark and after registering, it seems to be in a very incomplete preview so it cant do multiplayer yet.

  • Epic Online Services - that seems also very nice but i just havent found that much like getting started guides to make a realtime Multiplayer Game in Unity. For UE4 theres lots of resources and guides but i havent found lots of people using it for Unity and i dont really know why

  • Unity Gaming Services - Idk, obviously it might be the best to use the integrated unity services but they doesnt fit my needs. e.g. there is no way to easily control the server. I could probably duplicate my project and make it as a standalone server application but just while writing it it sounds completly bad

  • Mirror Networking - same as Unity Services, dont want to duplicate the project or built it 2x each time i want to update or test anything. Also it doesnt contain DataStorage by default & User Auth, so i would be required to use 3 different services from 3 different platforms

My Recommendations:
I have a multiplayer Racing Game, where players authenticate using email (or username) and password. Then they will be moved into a Paddock (something like a Lobby, where they can run around, chat, view leaderboards with best racetimes and invite others to join a race). When inviting others to a Race, all the target players will be moved into the a new "server" or "match" where they can drive until the end and then they get moved to a paddock back

Any help is appreciated 🙂

#

Problems currently:

  • limited to the PUN2's bad Pricing - 100 CCU limited, otherwise its getting expensive af
  • Firebase seems to be more optimized for simple Mobile Games, not for multiplayer solutions
  • Firebase doesnt have good options for filtering for leaderboards and in some points is insecure
  • PUN2 doesnt offer good options to write racetimes in the leaderboards on the server. They need to write from the client which is not that secure
mortal horizon
flat jackal
#

i made an empty line in between the good things and mirror because i probably not gonna do it with mirror. the huge disadvantage for me when using Mirror is that i have to keep updated 2 different Projects. In PUN2 i loved the concept that the backend is completly managed for me. Things like AWS GameSpark and EOS seems to be similar but has another easy option to add things like Firebase CloudFunctions does but directly integrated into the networking

flat jackal
mortal horizon
#

mirror is based on one project only, you shouldnt be using 2 projects

#

2 projects is not recommended at all, you will run into tons of issues trying to keep them in sync

#

Yes, you can just use mirror and basically plug into EOS using the transport @flat jackal

flat jackal
#

Okay, when using Mirror and i would like to use things like Multi-Rooms like Photon has it, what is an optimal solution to get that working? Pun has different Rooms where every data is sync only in that room. In Mirror it seems that its one giant server and not by default split into multiple instances

mortal horizon
#

Youd be using the EOS relay transport, which does essentially the same thing, you can host lobbies etc

flat jackal
#

so if mirror for example can only handle 500 players, i would be limited to that until i did some more work to scale them dynamically etc.

mortal horizon
#

One lobby is one "server", it would all be client hosted over relay per lobby/room instance

flat jackal
#

so i would not use a mirror server? Does it mean that when i connect to Mirror from the Engine, it connects to the backend of EOS?

#

they are not server hosted?

mortal horizon
#

Mirror has dedicated server build options as well as a client host option

#

ie. One person is the host and everyone connects to him

flat jackal
#

client host means it runs a server instance in the background?

unborn moss
mortal horizon
#

Essentially yes, in the same application

unborn moss
#

the server creater is hosting the game from their PC

flat jackal
#

Okay, i just dont really get the thing with EOS transport, can you explain that further?

unborn moss
#

srry for intersecting btw

flat jackal
#

is it just the Mirror API i use but in the backend it connects to a dedicated EOS server?

flat jackal
unborn moss
flat jackal
#

even opinions and recommendations are helpful

unborn moss
#

if the game is small and meant to play with friends hosting the server of the host's PC isn't that big of an issue

#

especially when you take into account grand strategy games like eu4, hoi4, vicky 2 use that same method of locally hosting | most rts game use the same method of hosting

mortal horizon
flat jackal
#

Steam Networking does not seem to offer that much. Like no clue about adding backend options etc. and there is no pricing. I dont think its free if you have 1k CCU etc.

mortal horizon
#

You are basically paying for it with steams cut of your revenue (30%)

flat jackal
unborn moss
#

so that definitely makes up for hosting costs

#

lol

flat jackal
mortal horizon
#

They have their own relay servers etc

flat jackal
#

steam might have a limit tho because if the game is completly free and has thousands of CCU, its not profit for them

unborn moss
#

in game cosmetics is a source of revenue for example

mortal horizon
#

again, if you have thousands of ccu, you have millions of sales.. which steam has taken a cut of

#

Also, relay servers are insanely cheap to run compared to game servers, it's not like its a ton of money they are losing (if any)

unborn moss
#

im working on a big project atm personally and there is a mp aspect and I want to host servers off my own person server rather then rely on local hosting

#

so while im no networking expert i shall find a way to make it all work

trail parrot
#

This is possibly not the right place but, anyone can suggest where i can hire someone, specifically using photon quantum?

#

I asked in the photon disco, photon circle, photon forum, and none seems appropriate

mortal horizon
#

The unity forums have a section for collaboration, job postings arent allowed here unfortunately

trail parrot
#

Cool will try that

#

It's kinda hard for quantum case i guess, its not free and those who are using it are most likely already an established project

mortal horizon
#

Yeah, you will most likely have to train whoever you hire

dapper night
#

Hello everyone,
My question would seem too common but I really couldn't find anything about it on the internet,
how to sync Players animations via network?
the first thing i had in mind was to sync player inputs and simulate the animation based on tha, it will work like a charm but what about ai players who don't have inputs?
Thank you

viral crag
#

Can you make a game like clash of clans with photon networking

limber zephyr
#

yes

limber zephyr
#

guys

#

help

#

uh

#

for some reason my photon netmanager just doesnt connect to master

#

it gets to "authenticating" then it just fails and gives up

tawdry dock
#

They have helped me as well.

limber zephyr
#

sick

dapper night
#

I'm sorry, I should have given more informations :p
our game is an authoritative server model and does not simulate animations, which means that the animation must be predicted according to the states.
but i never did it and never saw anything about it on the internet. :/
if anyone has any reference or idea that would be much appreciated Thanks!

green reef
#

anyone know a way to monitor network traffic with the new unity netcode? The profiler is not showing anything under network messages/operations

sterile vortex
#

Whats your thoughts on the gaming circle (paywall) for photon fussion samples / tutorials ?

spring crane
#

I feel like being too restrictive with learning material is a bit unfortunate. I would imagine some of the basic material could be released while maintaining more in-depth templates and video material paywalled, but haven't really checked this stuff out in a bit to say for sure.

limber zephyr
#

i kinda need it

spring crane
limber zephyr
#

oh sick

tiny matrix
#

im following a steamworks multiplayer tutorial rn, but they are using a system where there is one main camera and multiple players that can be seen in one area, how could i make is so that everyone has their own first person player instead?

jade moon
tiny matrix
jade moon
#

sure

tiny matrix
#

In this video I will be showing you how to implement player movement. I will go over how to firstly move every player into the game scene. Then how to spawn players for every connection and create movement that syncs across the server.

------Tutorial Links------
Previous Video: https://www.youtube.com/watch?v=kld9s...

Mirror: https://assetstor...

▶ Play video
jade moon
tiny matrix
#

yep

#

forgot to mention it was with mirror as well srry

jade moon
#

i can try help with Steamwork but not with mirror, sorry

tiny matrix
#

awh alright then

#

thanks anyway

jade moon
#

anytime

olive vessel
tiny matrix
#

thank you

#

been trying to figure that out for a while

weak plinth
#

Who know pun2
I need to have a buttom for start the game only when all player is ready

tiny matrix
mighty lynx
#

hello, i'm new to networking in games and i want to implement this feature in my game
i see there are a ton of networking APIs for Unity but i am unsure which one fits my use

#

i have a 2d 2v2 fighting like game, so some articles or youtube reviews say that I should use MLAPI, Mirror or Netcode for GameObjects

#

which one would be best suited for my need?

spring crane
# mighty lynx which one would be best suited for my need?

Sounds like you need very good lag compensation, in which case really the only out of the box solutions for that are Photon Fusion and Quantum. From there the differences become a lot smaller, but worth pointing out that MLAPI is now Netcode for GameObjects, as it was renamed during Unity's acquisition of it and further developed under Unity. Mirage is an interesting alternative to Mirror if you are particular about your code architecture.

mighty lynx
spring crane
#

I'm not seeing any pre-release markings on the doc, but whether you can call anything 1.0.0 stable is probably debatable 😄

mighty lynx
#

I am asking because this came up in the Package Manager and it just came up in my mind if it's okay to use, is it reliable and so forth

spring crane
#

Define reliable software 😄 It probably wouldn't be marked as a pre-release if the team behind it thought it was ready for production.

mighty lynx
#

well in my case i meant reliable as in someone can use it in their game and publish the game

olive vessel
tiny matrix
#

ok, thanks!

weak plinth
#

Who know good pun2 please

#

i need help

weak plinth
#

hello . I am new here . I am trying to send a video from an ip camera to unity scene

#

any suggestions

#

?

tidal brook
#

Does anyone have an idea whats the cause of the error is?

#
private NetworkList<bool> boolParameters = new NetworkList<bool>();

thats the marked code btw.

tidal brook
#

Okay, Nevermind i moved the instantiation into Awake and the error isnt there anymore.

grim merlin
#

Guys, who using Photon: where are the rooms saved when they are created? (my teacher asked me, and I didn't understand the question)

spring crane
solemn haven
#

My game is slowing down after I use this to get json from web. this function will be called every second. Why Is my game performance so bad because of this? please

pliant sundial
frosty crystal
#

Hello.

#

I have .Net Web API project with a lot of endpoints. All of them require authentication before reaching out to them but the login API

#

but I have to controll the incoming users to prevent API abuse.

#

for the DOS and DDOS attacks.

#

Have you got any documentation to point me there.

restive mesa
#

Hey all, using Mirror and I have a character with animator and works fine locally. I have network animator and client authority checked. States are changing client side but not synching across

pliant sundial
# frosty crystal for the DOS and DDOS attacks.

If a ddos attack hits your application you are already done for, you need to catch those earlier. Most cloud hosting providers provide some service for that e.g. AWS Shield. Besides that you can also implement a rate limit for API calls, but that wont stop ddos attacks because the payload still reached your application.

fringe creek
#

how do i use normcore for pc

livid olive
#

i setup photon and cosmetics but how do i make it where ppl can also see the cosmetics

restive mesa
#

sigh are there ANY decent examples of using Mirror or netcode to spawn in different GameObjects for different players. As much as I know all developers want ALL network players to have the exact same prefab and just be clones, that's not whwat I want so none of the docs or videos I've seen are helpful

#

and not "Oh we can randomly pick a different color on the server side" crap either

restive mesa
#

lol

drowsy quail
#

Hi, im using Photon and i have it all setup and working but i need help with enabling and disabling gameobjects that all plyers can see when enabled

#

ive made the script but other players cant see when i enable or disable it

#

i know i need to add RPC but idk how to implement that in my code

molten dragon
#

is it networked object ?

drowsy quail
#

not sure what you mean

molten dragon
#

what photon component you add to that object so it work with photon

drowsy quail
#

it has photon view and transform components on it

molten dragon
#

oh , then you need to use rpc i guess

drowsy quail
#

yeah

#

idk how though

#

can anyone help me understand this better

molten dragon
#

i think int blockToRemove is the id of that networked object

#

and you have to call it like RemoveBlock( Gameobject_Id, false);

drowsy quail
#

im confused

#

to explain more about what im doing, i have a object under my main camera and then buttons. when you click the button, it sets that object under my main camera to Setactive is true. When you disable it, its sets active to false.

whole slate
#

Hey, I´m looking for a Networking Solution that can be hosted on dedicated servers without the need to pay any fee´s or cloud services. The solution should be free and a good fit for a FPS Game. Any Suggestions? 🙂

whole slate
#

Anyone has thoughts on Fish-Net Networking? 🤔

haughty heart
#

As for the actual asset, I have no idea. 😆

coarse minnow
#

Hey guys, I'm using Mirror and Fizzy steamworks and I'm running into an issue with having a teamname update on anything past the first connection. Anyone willing to look at my project and help me troubleshoot? been working on the issue for 3 days now.

weak plinth
#

[Netcode] Failed to create object locally. [globalObjectIdHash=0]. NetworkPrefab could not be found. Is the prefab registered with NetworkManager?
UnityEngine.Debug:LogError (object)

#

How do I resolve this issue?

tidal brook
#

I am making a game with Netcode for the multiplayer and now i want to make the multiplayer work across different computers and networks. I searched in the internet but the solutions are rather unclear. Does somebody know how that works?

restive mesa
#

Depends on what you mean by different computers and networks.... In you protocol where you have localhost by default, you set that as the ip Address of the other computer on the client side IF the computers are either 1. on the same network or 2. the host is on a host server or ip that's routable or firewall rules are port forwarded. There's info in the docs I thought dealing with punch through and Relays... I use Unity relay (or did)

tidal brook
#

Okay, thanks! I think i will take a deeper look into Unity Relay.

whole slate
#

realy? i guess i make a bow around that then... Any good alternatives for a FPS i want to host the servers myself and dont want to rely on cloudhosting and it should be free 🙂

haughty heart
whole slate
#

doesnt they rely on cloudhosted servers ?

#

i was looking into Photon Bolt but there was pricing listed

#

100ccu and up costs quiet some money

next arrow
#

Hello, i'm have a question: what they give ccu in PUN?

whole slate
#

it says 20 is free

potent crater
#

i need help; both counters are only showing up for one person rather than each persons respective counters showing up for themselves only; here is my code, what should i change/ add?

sage apex
#

Hey i have a problem with my multiplayer game when the game spawns the player with the gun it works fine but the other player can't see the player's gun how can i fix this

quaint moon
sage apex
#

heres my camera

#

Player prefab

#

ands the Game Manager

#

to summon the player

#

i can see the gun

#

but i cant see the other player's gun

obsidian nebula
#

Has anyone experienced problems with the mirror network solution when you want to use raycasts for shooting. I am using the Network transform script to send my character movement over the network but i cant get a hit with a raycast when I shoot it from another client. I checked if the collider of my player is dislocated but that isnt the problem. So i suspect that the network transform script is making issues. When i shoot on the initial spawn position of the client it will say it hit the client even though i moved the character away. Any ideas?

restive mesa
sacred spoke
#

Using Photon PUN, how do you usually sync enemy AI over a network?

#

I am currently trying to allow host to handle all movement decisions and host sends the AI position to sync across clients

#

any video rec's on networking AI?

restive mesa
#

NOt sure about Photon, but with netcode and Mirror, just use Network Transform and check Client Authority. Photon probably has something similar

weak plinth
#

I need some help on photon if someone know

#

i need to do a readybutton for make a player ready

#

I would like to make a system to make the player ready when I click on the ready button.
If all the players are ready then I can start the game.
I would like to achieve this using PUN

weak plinth
#

?

dry egret
#

Hey people, I'm new to multiplayer and networking, what would you guys say it's the better choice for someone who knows Unity well but has never made a Multiplayer game, and that's free. (At least for 10+ concurrent users)
Thanks !

robust temple
#

Could someone help me please? I am using Photon and cant implement the Callback Methods in my script. I searched the web but could not understand how to do it even not in the documentation

dry egret
#

Then override their callbacks

dry iron
#

does anyone here have any idea on how to fix the issues with rigidbody in photon pun? I have implemented a knockback script but it's a total mess with photon

stiff ridge
weak plinth
#

but when i put ready the other player dont see when i am ready and the state is broken

#

0 = number of player ready

#

1 = player in the room

#

but the player is ready

#

AND now when i have 2 players

#

the number of player is set to null wtf

river meteor
#

Hi, after a long break I'm getting back to my project. I was wondering a long time ago to migrate my project from Photon PUN to Mirror. There is some guide to do this smoothly or I must do it manually?

weak plinth
river meteor
weak plinth
weak plinth
#

is the the value what i want

#

but i can't the if the other player is ready or not

#

I am making a chat system with the default RPC system. The reason I don't just use Photon is because I want to evade fares (and because Photon is currently down)
It almost works, and only the ClientRPC part is stopping messages from being added
Is there anything I am doing wrong?

#
public class ChatManager : MonoBehaviour
{
    public TMP_InputField ChatInput;
    public TextMeshProUGUI ChatContent;
    public bool InChat;
    private List<string> _messages = new List<string>();
    private float _buildDelay = 0f;
    private int _maximumMessages = 14;

    [ClientRpc]
    void RPC_AddNewMessage(string msg)
    {
        _messages.Add(msg);
    }

    public void SendChat(string msg)
    {
        string NewMessage = "Player" + ": " + msg;
        RPC_AddNewMessage(NewMessage);
    }

    public void SubmitChat()
    {
        string blankCheck = ChatInput.text;
        blankCheck = Regex.Replace(blankCheck, @"\s", "");
        if (blankCheck == "")
        {
            ChatInput.ActivateInputField();
            ChatInput.text = "";
            return;
        }

        SendChat(ChatInput.text);
        ChatInput.ActivateInputField();
        ChatInput.text = "";
    }

    void BuildChatContents()
    {
        string NewContents = "";
        foreach (string s in _messages)
        {
            NewContents += s + "\n";
        }
        ChatContent.text = NewContents;
    }

    void Update()
    {
        if (InChat)
        {
            ChatContent.maxVisibleLines = _maximumMessages;

            if (_messages.Count > _maximumMessages)
            {
                _messages.RemoveAt(0);
            }

            if (_buildDelay < Time.time)
            {
                BuildChatContents();
                _buildDelay = Time.time + 0.25f;
            }
        }
        else if (_messages.Count>0)
        {
            _messages.Clear();
            ChatContent.text = "";
        }
    }
}
river meteor
weak plinth
river meteor
tidal brook
#

Using Netcode, is there any way to spawn a GameObject which was instantiated in a client across the network inside of a script in the instantiated GameObject? I tried using a ServerRPC call with the spawn method inside it, but i just received a warning, that the object didnt spawned.

scenic lantern
#

Hey everyone, I'm trying to learn Mirror (and networking in general) and I'm already having a hard time figuring stuff out... I've got the players (same prefab) spawning at their correct location, and in the player script, I've got a Command to instantiate a dice under the player. The dice prefab got a NetworkIdentity and a NetworkTransform, same for the player. But as you can see, it only works on the host (right screen) and I don't understand why...

#
public class Player : NetworkBehaviour
{
    public GameObject dicePrefab;
    private void Start()
    {
        if (!isLocalPlayer) return;

        SpawnDice();
    }
    
    [Command]
    void SpawnDice()
    {
        GameObject dice = Instantiate(dicePrefab, new Vector2(transform.position.x, transform.position.y - 2), Quaternion.identity, this.transform);
        NetworkServer.Spawn(dice);
    }
}``` Here's the code I have.
weak plinth
#

Hello guys i need to do a ready button but when i click on ready the ready (true) is not see by the other player and i cant do anything
someone can help me ?

My PlayerItem.cs logic
https://pastebin.com/JZkTKB6S

My Room (LobbyManager Logic)
https://pastebin.com/gCJwdXXf

#

@river meteorlook my code

river meteor
#

I am at work now so I will take a look later

weak plinth
river meteor
half willow
#

I saw that now Unity charges a license to use headless mode (Unity Server Build), is there any way to use Unity headless on my server without paying any license?

tulip gorge
#

hello

#

anyone good with photon here

#

i just need make this instantiate

#

use networking

river meteor
tulip gorge
river meteor
#

what format

#

this one you provided ?

tulip gorge
weak plinth
#

Is for a menu not for a game

#

And people tell to me to use CustomProperties

#

And ÔnPropertiesChanged

dry iron
charred galleon
#

Hello everyone, does anyone know how to implement the login with Facebook with all the features it comes with like share to Facebook on unity PC app?

stiff ridge
#

The component that observes the transform and sends update is also the one that receives and executes them. If there is a special kind of movement (knockback, etc), you may need to add special handling.

dry iron
#

How about using event codes, maybe it might sync it better than the player himself

weak plinth
#

Hello guys i need to do a ready button but when i click on ready the ready (true) is not see by the other player and i cant do anything
someone can help me ?

My PlayerItem.cs logic
https://pastebin.com/JZkTKB6S

My Room (LobbyManager Logic)
https://pastebin.com/gCJwdXXf

river meteor
#

I told you what to do man. But you know better you do not need this so don't ask for help...

#

I don't know what's the point for asking and the you say "I don't need to use that". OF COURSE YOU NEED and there's your problem why other player don't see ready value because it's not synchronized between them.

#

You even didn't try.

#

You must learn how photon works. It's not traditional server client communication.

weak plinth
#

people tell me the best way is to use CustomProperties and OnPlayerPropertiesUpdate

#

did you know about it ?

weak plinth
woven steppe
#

hello

#

guys i am new to photon and when i type using Photon.Pun; it says ||
The type or namespace name 'Pun' does not exist in the namespace 'Photon'||
.
EDIT ; i FIXED IT AFTER 3 hours of prrrr

upbeat mauve
#

Hello everyone!

I’m David Salgado, a member of the Unity Multiplayer team. We’re working on our next wave of focus areas and would LOVE to hear from you about what you are building and how we can help.

When you have 5mins please help us by filling out this survey [https://unitysoftware.co1.qualtrics.com/jfe/form/SV_eM9GaUix9NCRxGu ] to better understand your needs and use cases. We want to make sure we’re investing in the right areas, and that we have a good understanding of your benchmarks/requirements.

THANK YOU!
DavidS on behalf of the multiplayer team

river meteor
restive mesa
#

Hey guys, using MIrror and the Multiple Additive Scenes. I have an issue and not quite sure how to solve it. So, for player move, I check Pysics.Raycat(ray, out hit, 100, m_LayerMask) and use the returned value in hit to set destination. was working but since I started using Multiple additive scenes (works great so far for my use except for this issue). So getting the ray via mouse click works, but it does not hit the floor. I have a box for floor with layermask Walkable. m_LayerMask is set to this Walkable selection (ALL worked before I started implementing multiple additive scenes). Now, it does not hit. if I debug log, hit is (0,0,0) with distance 0. I've tried differnet distances but it just isn't hitting it. I have the PhysicsSimulator object and script in the scene with the floor. But I have a feeling I'm missing something or another way to do it

restive mesa
#

Discord is cesspool of scammers and I'm not about to click any links in here like that

restive mesa
flint flame
verbal lodge
austere yacht
verbal lodge
#

I do not have such powers 😆

restive mesa
restive mesa
woven steppe
#

hi i have this error with photonnetwork 'PhotonNetwork' does not contain a definition for 'AutomaticallySyncScene' help pls

potent glacier
#

how do i setup Inverse kinematics with normcore in vr

#

cuz it wont work

#

the multiplayer works but my robt kyle ik setup wont work in normcore

dapper oak
#

why do I get this error? Shouldn't the SerializeValue accept FixedString32Bytes? Strings can't be used in netcode

verbal lodge
dapper oak
#

I checked the docs but maybe I just missed it

scarlet sequoia
#

can anyone help with normcore? i want to setactive a object with normcore

blissful yacht
#

hello i have a problem with the fact that one player controls all players for some reason.

#

so how do i fix that

blissful yacht
#

?

fossil yacht
#

help me guys

dusty osprey
#

Could i get some help with setting up photon first time and i been trying for a few days btw for vr

weak plinth
#

Hello

if((bool)playerProperties["IsPlayerReady"])

i have a problem with this
Specified cast is not valid
if someone can help me

fossil yacht
river meteor
#

maybe .ContainsKey would be better

weak plinth
olive vessel
pallid girder
#

thanks

stable jolt
#

Anyone here experienced in using Photon for making multiplayer FPS games? The programming is giving me an aneurysm

weak plinth
#

Hello guy

scarlet sequoia
#

hey can someine help me with a grappling hook vr script?

weak plinth
#

i have a problem

#

it is true

#

but the image dont appear

scarlet sequoia
weak plinth
scarlet sequoia
#

then set it active in the dunction

weak plinth
scarlet sequoia
scarlet sequoia
#

put under playerreadyimage.setactive if(playerreadyimage == false) return;

scarlet sequoia
#

ok wait your problem is that it dont activate

weak plinth
#

and he disapear

scarlet sequoia
#

oh it disapear after a few seconds?

weak plinth
#

is that

#

i see the image 0.1 sec

scarlet sequoia
#

can you send the full code?

weak plinth
#

and after i stop showing the image

#

yes

weak plinth
scenic lantern
#

(Mirror) Any ideas on what's happening with my spawn ? The host on the right is perfectly fine but on the client (left screen), it looks like it has been spawned from the bottom left corner of the canvas and I don't know why

#

network transform ?

#

already has it, it's shown in the inspectors of the screenshot

olive vessel
#

Well there is no value assigned to nsm clearly

#

But is it not a singleton or something?

#

Pretty sure it's a singleton, but I can't exactly check

#

Sure there's tutorials online

#

Networking isn't easy

#

Again, I don't believe you need to new it

#

I think it's a singleton, find a tutorial

#

Well that's a load of crap isn't it

#

Sure

#

Are you new to Unity and C# itself?

#

Then you shouldn't even be trying multiplayer

#

It will make you miserable

#

Doing multiplayer as a beginner to C# and Unity is beyond foolish

stable jolt
olive vessel
#

Then again, find a tutorial online, there are tutorials for Netcode and it's older version MLAPI

#

But you're not gonna have fun, believe me

#

Because you're diving in head first without learning to swim

#

That's the easy bit

#

That part is almost no work on the dev's part

blissful yacht
#

somebody please tell me how to fix the one player controlling both players problem

#

well it was pretty easy to set it up

#

i followed a tutorial for PUN2, so basically it instantiates a player prefab in a room with a specific scene

#

its just that one player controls all players

quaint moon
#

Congratulations!! 🎉

#

Takes a lot of hard work

#

Headaches and persistence

blissful yacht
#

nice

blissful yacht
wanton crane
dense osprey
#

This is a basic-ass question but
I'm trying to make a multiplayer game
Should I start with a singleplayer demo and then add to it to make it multiplayer, or should I build it to be multiplayer from the ground up to reduce headache?

haughty heart
dense osprey
#

Gotcha

#

Time to learn that then

river meteor
#

Yeah, that was the first fault with unity done by me 😅

#

And now i choose the wrong one API and I must switch it to another one

haughty heart
#

@restive vigil Don't ghost ping people.

#

Exactly what that is. Anyway, don't be annoying.

#

!mute 790720788697055242 3d Nevermind, keep being annoying then

raw stormBOT
#

dynoSuccess f11#4273 was muted

topaz magnet
#

If anybody is wondering about what networking solution to use, I suggest Riptide, by Tom Weiland.
You dont get the network object component like in photon. You have to send the packets manually, but the freedom that this gives you is 110% worth it

#

Its not as complicated as it might first seem

restive mesa
#

Ok, question. Using Mirror but I have a NON-networked gameobject I want to move to a different subscene. How do I do that? Googling gives me a bunch of crap using Entities and DOTS

#

being it's local, I don't want (and I don't think CAN) use NetworkServer.MoveGameObjectWhatever

#

I'm googling Unity move gameobject to different subscene.... not sure how else to search and not get dots crap

#

OMG.... SceneManager.MoveGameObject

zenith prism
#

Hey, could anyone help me out with joining a photon room via a web link?

#

I want my users to be able to copy paste the web link to share

high night
#

@zenith prism

#

I guess you could have some random string the room link

#

And put it in the hashtable here

#

Find the room that way

restive mesa
#

Can someone answer me this question. I'm using parrelsync to see what errors I'm getting but does the same thing with a built version. Host side (going by the additive levels) works fine. It goes from offline to online scene fine and changes level to the first level. The client side also goes from offline to online scene and has the first game level loaded, but when I click the button to go to the first game level, it just goes black, player disappears and errors. Strangely, on the server/host side, the player character is there in the right level. Again, both client and server have the level. Another weird thing is, it's a click the screen to move (navmeshagent.setdestination) and even though nothing is being click the client just slowly moves acrosS the screen... error are as follow.

Failed to spawn server object, did you forget to add it to the NetworkManager? assetId=f8583a61-682d-70b4-b837-97b8664beea6 netId=10

#

It's in the list of spawnable prefabs and spawns on the server, just doesn't spawn on the client

#

With my Debug.Logs I'm getting the correct index value and logging the right prefab.name

weak plinth
#

Hello

#

someone can help me

#

with CameraWork on photon ?

haughty heart
weak plinth
olive vessel
#

Photon has absolutely nowt to do with Cameras?

dapper oak
#

I get these errors when I call a clientRCP or open this observer tab after opening disconnecting as the host and recreating the lobby. Why?

#

why is this network object giving me these errors?

#

this happens for any network object in the scene

weak plinth
#

Hello someone can help me ?
I want to do have a camera follow for my player (car) with PHOTON (PUN2) but i dont know how can i do that

olive vessel
#

Photon has nothing to do with Cameras

#

If you have a player prefab with a Camera, you need to enable it for the local player and disable it otherwise

#

That means that every client then sees through their own prefab's Camera

#

Aside from that, you can make it follow with a PositionConstraint

nova tree
#

When ConnectionApproval is true, you are also required to provide a callback where you put your approval logic inside. ConnectionApprovalCallback is called by the Client host.

who is client host?

verbal coral
#

hello guys anyone use the sql connection? i'm not using System.Data.SqlClient. i'm using vs code i try the nuget packed. i installed system.data.sqlclient nuget bug not fixed pls help
Sorry for my bad englishMonkaChrist

verbal coral
livid dove
#

hi, I want to instantiate a custom character made by the user in a room using photon, problem is idk how to make the reference. the workflow is as follow, i connect to photon first, then i lead the user to a scene where he can customize the character, now i want to instantiate that custom character, any ideas on how to?

wispy tapir
#

I have a cors error when attempting to make a GET request to a uri that redirects using the webunityrequest class thing

high night
#

When I use that, I only use it for sending some commands

#

And the actual character can be some other networked game object

livid dove
runic rampart
#

Using netcode for game objects - I have steam up and running and working however I don't know how I can tell what the steam id of each connection is. Is there a specific point during the connection process where I can pass this information to my game code?

unreal oxide
#

Is it easier to make one overworld MMO style or instanced dungeons that players can join in groups and players can have their own solo player instanced homeworld? Just trying to decide on the scope before I get deep into learning the backend. Thanks!

quasi pike
#

Hello. I want to make a multiplayer card game and currently having troubles with choosing networking solution. So I want to have one server hosted by me that controls different rooms for the players. Can PUN server do that? Or is it only for player-hosting? What should I use?

tawdry dock
quasi pike
#

@tawdry dock Players shouldn't be able to cheat there. So I guess it's photon server?

tawdry dock
quasi pike
tawdry dock
#

Yea pun2 would be great for the card game as networking. Pun2 has a good documentation of setting up the rooms and more.

#

It's like designed for that kind matchmaking.

high night
#

the only prefab from the resources

quasi pike
tawdry dock
# quasi pike So you advise me to look into photon server?

If you want to have a lot of authority of the server and it's quite easy to setup. But I would mainly focus on building the game first. And then looking of photon server. If you are going go pun2 I would try to test the game for photon cloud. Because photon cloud has servers all over the world. And photon cloud is based on photon server.

fading lynx
#

So for local multiplayer, should i do UDP or TCP? I have a small survival game and all i really need is for player position, what they are doing and if they are dealing damage. I was thinking of faking TCP with delayed UDP (like when i start the server the packets are delayed by like 150-300ms to compensate for Australia to canada for example) but that sounds extremely hard so is there a quick and efficient way to do multiplayer for my small game?

austere yacht
sharp coral
#

Hey guys! Can anyone help me with photonNetwork? I have a problem that players from a Lobby join a room they choose, then they can press start or leave, so after they have seen the players in the room they can decide if they still wanted to join the game (they can make sure their friend is in the room), so they all have to press Join Game individually, this means they are not all spawned at once. And the problem is that older players see players that joined after them, but not vice versa. 😦 help pls

stiff ridge
# sharp coral Hey guys! Can anyone help me with photonNetwork? I have a problem that players f...

In PUN, you only get the list of players when you joined a room.
If you want to find a room where your friends are, use FindFriends. If you still need players to join a room to decide if they want to play in it, I'd keep the room open for a while but close it (set IsOpen = false) and take it out of the matchmaking (IsVisible = false) to begin playing. The Asteroids Demo that comes with PUN has a screen where players gather and they can confirm they are ready to play. Could be a startpoint to work with and then customize.

sharp coral
# stiff ridge In PUN, you only get the list of players when you joined a room. If you want to ...

yea, but as its gonna be a pvpve survival game, I want to make something like in unturned, that somoene has been playing for like 5 hours and the room is still open.
But if u want ur friend to come play, u just say him the name of the room, he clicks on it, he can see the playerlist in the room, then he can decide when he wants to start the game.
I dont want all the players to start at once.

stiff ridge
#

I see. Well yes, if someone knows the room name, it's easy to join.
We don't send the player list to the master server (where the lobbies are), so you can't access the player list without joining. But .. you could just join, then decide to not play and leave. Or play.

dry iron
#

Do you guys have any idea on how to reset the transform position and rotation with photon pun?

stiff ridge
#

The controlling player can do that and a PhotonTransformView script will send the latest position and rotation as state to the others.
Do you mean how to "teleport"? So that others won't lerp to the new position from wherever they are? Then you need to send along some flag that tells others the update is a teleport and to also put that into the previous known position (to avoid interpolation).

dry iron
#

I tried to fire an rpc in the other player but it didn't work for some reasons

sharp coral
stiff ridge
olive vessel
#

Do you need to be moderated?

cunning sluice
#

In photon2 the IsMasterClient sometimes will always return false even if you're the master client

#

Anyone know why?

spring crane
boreal rain
#

when you make a multiplayer game, do you create a game server process for every ongoing match (gameplay scene with players in it) ? so if your gameplay scene has max 2 players and there is 20 players that want to play you run 10 "game_server.exe" to load the scene for them?

#

is that how mutlplayer works (or is that wasting resources and i should try to make 1 game server create multiple matches)

austere yacht
boreal rain
spring crane
#

Networked games inherently don't have to be separate processes and many networking frameworks/libraries do support multiple servers in a single process, but software often isn't built with this use case in mind.

austere yacht
#

actually MMOs can work the same way, but on a more complicated, larger scale

spring crane
#

Unity does provide some level of support for multiple simulations within a single space, but not sure how good that support is. At the end it's generally a lot easier to just run multiple processes despite the overhead.

austere yacht
#

really big MMOs integrate this kind of scaling inside the main process and shard internally, but the principle is largely the same with processes being replaced by threads or some other shared memory thing that is very performant

#

one way you can do sharding internally is via team/proximity-based interest management

boreal rain
#

thanks alot for the explanation it was confusing me for a while now and honestly made me overthink how i'm suppose to make a multiplayer game (because I initially thought you're suppose to connect a lot of players to 1 game server because less process = better, lol)

#

but now that i think about it , if they're headless anyway that will help save performance too 🤔

austere yacht
#

if you host your game on something like playfab it runs on a 24 core CPU with 64 GB of ram that can be allocated whichever way you like, so you can have 24 processes run on their own dedicated core on a single machine, or one process with 24 cores, or anything in between

boreal rain
#

and also documentation for the library i'm using makes more sense now lol

austere yacht
#

i'd say the sharding strategy depends a lot on how well you can parallelize network stuff inside your engine

austere yacht
#

then you pay something like $150 per day (might be per month)

austere yacht
#

in practice data egress is more expensive than compute though

boreal rain
#

i was gonna sign up but was afraid of screwing something up and getting a big bill at the end of the month while still developing 💀 .. so i thought i'll learn more for now

austere yacht
#

its best to make all dev builds auto-terminate after ~5 minutes to prevent problems like that

#

and make sure you limit the core and server count to 1

#

with 1 server and 1 core the free last for almost exactly 1 month

boreal rain
#

awesome i'll check them out again today, i was planning on using their matchmaker service soon anyway

austere yacht
#

and it resets every month

boreal rain
#

ah perfect

austere yacht
#

matchmake is different

#

that doesn't run on a server you control

#

its billed per request at something like 0.00005 cents

boreal rain
#

oh.. so i just use the api to send the matchmaking server they give me info about open games? is that the same as using a list server?

austere yacht
#

so you can control the cost of that by limiting your poll rate

austere yacht
#

not really subscribers though... you need to have clients poll the status of their ticket

boreal rain
#

that is good to know, thanks a lot for all this info

#

i dont feel as "lost" anymore for now and at least know what to research

austere yacht
#

its a quite powerful service IMO

#

saves a ton of time

boreal rain
#

yea i would rather pay for something already being done by the pros instead of trying to implement it myself , especially if price isn't breaking my wallet

austere yacht
#

DIY is more likely to break your bank unless you know you will be VERY successfull

boreal rain
#

but i really like Mirror so i'm doing that myself + plan to use playfab for services i need

austere yacht
#

IMO an indie team has no real hope of developing a dedicated server platform of that quality/capability

#

good thing is, if nobody plays the game, it costs close to nothing to run it

#

and if you have a monetization strategy that scales with the server costs, its quite safe to run in auto-mode

#

best thing is, if your game gets popular over night, you can, if you choose so, flip the switch and allow 100000 players to connect... but you'll be broke the day after

boreal rain
#

get popular overnight but end up broke the next day 💀 ?

austere yacht
#

just don't make a free game 😄

boreal rain
#

yea that's scary lol .. i can only imagine the kind of stress that would cause to a indie team (quick popularity that wasn't expected)

sharp coral
boreal rain
#

is using a networking library overkill if i just want to make a single player game with server interaction on it with no physics syncing , for example like a slots game or spin the wheel?

#

can i just do it with http requests to a web server?

#

eg. like
Spin the wheel

  • user clicks spin button
  • HTTP request to a web server,
  • spin animation on a "wheel" plays while he waits for response
  • server generates JSON response of a random pick
  • client uses that data and "wheel" stops at corresponding image
#

or is that still vulnerable to cheating from client?

#

i wanna take baby steps by making a simple game

cunning sluice
austere yacht
weak plinth
#

Someone can help me? when I start to join my lobby in a other game, the camera from the first player switches to the camera from the second player

#

I also cant controlling the camera

#

I am using the standart asset third person asset and photon for the multiplayer

#

would be glad if someone can help me

stiff ridge
# sharp coral the problem is that it worked fine and with an update it all went wrong, I don´t...

If you mix new and old clients, then this won't work. To avoid incompatibilities of updated clients with old ones, each uses a different game version and the matchmaking is completely separated from one another (despite using the same AppId).
If you test only new clients, this is not an argument, ofc. Make sure everyone is in the exact same room. Then look out for exceptions / error logs and fix those (if any).
I don't have enough info to help, really. Maybe you test the new version with a minimal project first, then figure out what's up.

sharp coral
boreal rain
austere yacht
mint tusk
#

so im using photon and im a little confused with RPCs and i have had look at youtube and otherthings and they wernt usfull so dose anyone have a tutorial?

boreal rain
haughty heart
#

Yep

sharp coral
tall storm
#

hi everyone i have a doubt about using mirror or photon for multiplayer what would you guys suggest

#

i just want to add unity networking to my cv

gleaming finch
#

hey, does anyone know how to differentiate between players

#

and not sync objects

#

I am making a multiplayer game and I have a question, Basically my game has a canvas where the player can type in what he wants but when I set the canvas as player it instantiated the canvas to both the player screens making them unable to type. Is there a way to hide the canvas? They have network identity

tawny tree
#

How much does networking cost?

haughty heart
ebon grail
#

Hi Everyone, I'm using Netcode for GameObjects.
Is there a way to call a function on a specific client from the server?
It seems like [ClientRpc] calls the function on every client.

spring crane
ebon grail
#

wow, I totally missed that, I already have the clientId in my function so that's perfect, thank you!

jolly wadi
austere yacht
#

Networking has to be built into the game from the start. There is no retrofitted multiplayer.

cinder hamlet
#

Hello, I tried to use ParrelSync with Unity to Sync my project, so i could try multiplayer. However, the clone, so the second player, doesnt have a camera and the first player controlls both player objects. How can I fix that problem?

austere yacht
sonic harness
#

Inverted condition? Normally you should have one in your script that says "if this is not the client, don't execute". You probably have that inverted

olive vessel
#

Hm?

#

It is soul destroying

#

I tried getting into it the other week and I've already thrown it on the backburner

#

I'm afraid not, Netcode has changed a lot since I last used it, that was a year ago

royal lava
#

does anyone have experience with large scale network hosting?

olive vessel
#

You might have better luck in the Netcode Discord, it's pinned here I believe

austere yacht
#

you might also just get lucky here if you post your actual question

agile flower
#

hi everybody, i've inherited a rather old project from 2015, which hasnt been updated since, with the hopes of porting it to html5. ive gotten pretty much every issue sorted out except with the networking aspect. the game is multiplayer only, and it uses PUN for multiplayer. i havent really done multiplayer in unity before (or unity much in general), but what i can tell PUN is pretty old and outdated, but i would rather not update the entire game code to fix it.

the issue im having here is with connecting to the main PUN servers from the webgl application. from the editor it loads up and connects to the servers just fine, however when i compile it to webgl, it gets stuck on the ConnectingToNameServer state. ive tried googling for answers and trying a bunch of solutions but nothing has seemed to work so far

dapper zinc
#

hi, i'm having this problem with Mirror where i can't start a new lobby after i left the previous one i've created, does someone know why ?

#

here's the code:

    public void LeaveLobby()
    {
        foreach (var playerObject in NetworkManager.GamePlayers)
        {
            Destroy(playerObject.gameObject);
        }

        SteamMatchmaking.LeaveLobby(new CSteamID(CurrentLobbyID));

        NetworkManager.StopClient();
        NetworkManager.StopHost();

       
    }
#

for some reason the .stopclient/.stophost doesnt seems to work

stiff ridge
# agile flower hi everybody, i've inherited a rather old project from 2015, which hasnt been up...

You may have to update it to at least the last PUN Classic version there is. WebGL export and WSS usage (which is required in this case) changed somewhat since 2015 and there is no guarantee your version works today.
PUN Classic is on the Asset Store for free. It has no major breaking changes (ofc APIs changed somewhat and logic may be affected) so it might not be as much effort as you expect now.

agile flower
stiff ridge
#

Yes, that's true. Even PUN 2 is relatively similar. It might have a bigger impact on the gameplay though. It changed, how property changes are distributed / updated and even slight timing changes are sometimes sneaky.

#

Glad you are willing to update to PUN 2, as PUN Classic is really outdated by now.

agile flower
#

it appears that has been the case actually, streams arent sending players transforms positions and such

#
    void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info){
        if (stream.IsWriting) {
            //We own this player: send the others our data
            stream.SendNext(transform.position);
            stream.SendNext(transform.rotation); 
        }
        else{ 
            //Network player, receive data
            correctPlayerPos = (Vector3)stream.ReceiveNext();
            correctPlayerRot = (Quaternion)stream.ReceiveNext();
            if(Vector3.Distance (transform.position, correctPlayerPos) > maxDistForLerp)
                transform.position = correctPlayerPos;
        }
    }```
#

this for example

stiff ridge
#

There is a PhotonTransformViewClassic component in PUN 2. Might be more similar to what PUN Classic did.

agile flower
#

that didnt seem to work either

#

hmm

weak plinth
#

would there be any better options for a multiplayer solution? looking for mobile, vr, and pc

oak flower
#

Doesn't matter really as far as platform goes, you can choose one in the pinned messages. All of them can work with PlayFab as well, which can also facilitate cross platform identification.

#

But for the style of the game you can enquire on their respective discords which one would do better.

weak plinth
#

im not doing anything competetive so im not too worried

#

just confirming, unity multiplayer is free to start?

olive vessel
#

If you use something like Netcode for GameObjects and use P2P, then there's no cost

#

If you want game servers, you get what you pay for

weak plinth
#

alr, thanks

novel topaz
#

Hey there, I don't realy understand the purpose of network transform child component of Mirror. I mean, if I have a player empty with network Transform on it, should i use network transform child for all the model objects inside my player object ? (for exemple should i use it for my gameobject with mesh for left arm, same for right arm, foots, etc ?) and .. why ?
Thanks a lot !

oak flower
#

If depends how important precise synchronization of those child objects is. With character you usually would get away with just making sure animation would look very similar in the same conditions. But if gameplay mechanic depends on precision you can make sure that child object is synced properly.

spring crane
novel topaz
spring crane
sacred spoke
#

[Photon PUN] how should i go about syncing coroutines on a network? I have an enemy AI that jumps into the air and slams down on a player. Should I make the host run the coroutine and just simulate it happening on the clients rather than making clients run the same coroutine?

austere yacht
sacred spoke
#

heres how it looks on singleplayer - in multiplayer it starts/ends fine but that lerp is jittery

sacred spoke
#

I find myself avoiding syncing things that involve lerping/coroutines/ elapsedtime loops etc. etc. If anyone has any resources that would point me in the right direction id appreciate it

austere yacht
#

normally what you do is: sync the raw values (results from gameplay code) form server to a proxy object on the client. Then have a "visualizer" or "view" object on the client that takes the raw values and interpolates them to produce smooth transitions/movement

#

you can get quite fancy with this interpolation, using prediction to make the movement appear less laggy.

#

if your network middleware has a good network transform this will make things much easier

royal lava
#

hey does anyone understand ssl encryption. i have a unity application , a python server written with the sockets library, and an ios app. i need to send the data back and forth between the unity application and the ios app via the server and this data needs to be encrypted. does anyone understand / explain to me how ssl operates and how to implement it?

austere yacht
dreamy ibex
#

Hey, I'm using Netcode for GameObjects.
Players starting play together in main menu scene. All main menu scene network objects are replicated without any problems, but then host start proper game, main menu scene is unloaded and new game scene is loaded. Problem is that for different players time to load this game scene is different, so scene network objects on this game scene won't replicate. Is there way to force network manager to try replicate scene network objects one more time?

austere yacht
dreamy ibex
austere yacht
# dreamy ibex Hmm... So mayby my way to change scene is bad? Host use ClientRPC to call changi...
clear prairie
#

working with TcpClient, what happens if i don't call NetworkStream.Close()?

#

and TcpClient.Close()?

dreamy ibex
austere yacht
tawdry dock
#

Any mods here?? ^^^^^

oak flower
tribal bough
#

Do unity netcode work with android connected to a wifi router?

olive vessel
#

Yes

tepid egret
tribal bough
#

What is the difference between UnityTransport and UnityRelay?

#

I want to be sure I'm using the local and not the online one

mortal horizon
tribal bough
mortal horizon
#

That's the spirit

static badge
#

Any Mirror users in chat?
How would i go about passing the server a user name on connect? Can i override StartClient?

novel topaz
#

It's possible to ovveride OnStartClient if my memory is good

static badge
#

ohhhh ye ok that helps

brittle knot
#

Hi

brittle knot
#

how to use Photon chat function PublishMessage correctly pls

#

I'm new comer to photon

stiff ridge
ripe comet
#

how do i create a vr player spawned with photon😩

brittle knot
#

Hey again

#

I have a little problem and guys I need help

#

With Player names

#

When I connect first player, names show perfectly fine

#

But in 2nd player it doesn't show 1st player name

brittle knot
#

nvm fixed.

quiet quartz
#

Hello! I'm following a photon game tutorial word for word, but, when i'm creating a room, it doesn't work. Maybe it's because something changed in the new versions, I don't know. I was googling and i saw that a lot of people had the same problem, but no one gave a satisfying answer. Btw, when i first launched my unity game, it worked. Here's my code (the Debug that i marked shows 0 rooms):

    public void CreateOrJoinRoom()
    {
        if (PhotonNetwork.CountOfRooms > 0)
            PhotonNetwork.JoinRandomRoom();
        else
        {
            RoomOptions options = new RoomOptions();
            options.MaxPlayers = 2;
            options.IsVisible = true;
            options.IsOpen = true;
            PhotonNetwork.CreateRoom(null, options);

        }
    }
    public override void OnCreatedRoom()
    {
            Debug.Log(PhotonNetwork.CountOfRooms);///////////////////////////////////////

    }
potent glacier
#

this line of code is giving me an error on photon PUN 21

#

2*

#

and this is the tutorials line of code

#

this is my error

olive vessel
#

RoomInfo is in Photon.Realtime, a configured IDE should suggest this fix to you, configure your IDE using the guides in #854851968446365696

potent glacier
#

do is put at the top using Photon.Realtime?

#

it works

maiden sentinel
#

in Photon, does a collectable (that spawns that every player should see) need a PhotonView element

maiden sentinel
#

hey, my photon player is really buggy in 2D, any other player is teleporting around the place!

#

could this be a lag issue, or a issue that I can fix?

#

and if I release this game, will this be an issue to all players?

paper blaze
#

Should I be using NetCode for my multiplayer game or something different? I can't get NetCode to install right.

austere yacht
# paper blaze Should I be using NetCode for my multiplayer game or something different? I can'...

what kind of multiplayer game? Netcode is still in preview, once stable it will be the default option that is integrated best into the Unity 'experience', Mirror is the 'free' option that people commonly use for 'easy to get going' and 'great community support' for authoritative networking, Photon PUN is also an easy option if you don't care about authority, Photon Fusion is ideal if you need to build a tight FPS / ARPG experience, for MMO you (probably) have to roll your own on top of any transport layer you choose.

paper blaze
#

Hmm. I was thinking MMO :/

austere yacht
paper blaze
#

Little to none

#

I can scale back and for testing/prototyping I'll use anything simple

austere yacht
#

there is no scaling back an MMO game

#

stuff you do for small games do not translate to MMO requirements

paper blaze
#

Hmm

#

I've done some basic stuff with sockets in c# but I don't think that'd scale to MMO level stuff

austere yacht
#

for MMO you need to do so much stuff on the backend that just syncing gameplay is the easy part

paper blaze
#

Are there any links you can provide so I can learn?

austere yacht
#

MMO networking is basically about running a single client experience on multiple servers in multiple locations and with different specializations for handling the various systems of your game

#

there is no standard solution, and no resources on how to do it beyond knowing the ins and outs of all the components yourself

paper blaze
#

I was thinking of using Azure for the server side

austere yacht
#

that is just a hosting platform

paper blaze
#

True.

#

I was thinking a VM for the server side

austere yacht
#

you can use playfab to deal with various parts of the backend like secure storage of player inventory and purchasing, but playfab is not aimed at MMO games

paper blaze
#

I think the part I have the most issues with right now is understand the inbetween programming

austere yacht
#

inbetween what?

paper blaze
#

For instance, unity works on game objects and I believe I just need to serialize the data for sending back and forth but I'm not sure

#

Or what's the core concepts in making this work?

austere yacht
#

well, naturally all you do, at a fundamental level, is sending messages between two computers

#

you have to define what these messages mean to the two computers and which roles they play

paper blaze
#

Encoding, decoding, and you signing where to send it and how to use it

austere yacht
#

a multiplayer middleware like netcode/mirror/photon helps with formalizing that messaging process

paper blaze
#

I see

austere yacht
#

each of those contains a transport layer which deals with the actual encoding/sending/receiving

paper blaze
#

I think I'm going to be having to send a lot of stream data so does any of the options have UDP with integrity check I guess?

austere yacht
#

under that transport is usually another layer based on the IP protocol (UDP or TCP) that does the even lower level receiving/sending

#

most multiplayer games are built on top of a binary reliable UDP protocol

paper blaze
austere yacht
#

their transport layers do

#

examples are Unity Transport, Enet, Lindgren, KCP

#

generally nobody reinvents reliable UDP for their game, everyone (even professionals for the most part) use an existing implementation that is battle tested.

paper blaze
#

What would you recommend using for the transport layer and for the messages?

austere yacht
#

the important thing to understand here is this: your gameplay syncing solution you use for comms between the client and gameplay server does not matter much in the larger scheme of MMO things. you can create a MMO with 50 people per gameplay server and make it appear integrated into a much larger world

paper blaze
austere yacht
#

the hard part is figuring out how to make player transition between those servers smoothly, so the appearance of a larger world is plausible, you can do this a 1000 different ways, from running the game on a mainframe and actually doing it all on separate CPU cores, or you scale via VMs and have to involve a scalable "server transition database" to move players around

paper blaze
#

This will require some thinking

austere yacht
#

you can look into presentations of "spatial OS" for some ideas

#

the tricky bit is also not in doing it for 10 people, or even 100, its doing it for 100000 people

#

in the olden days (WoW), they did it by not doing it and just locking people into actual servers, i.e. actual physical machines and made their servers run quick enough to handle 2000 people, this also involved a lot of game design choices that limited the amount of events that needed to be synchronized

paper blaze
#

I don't see how to get the special OS. Is it a paid service that they run their own servers?

austere yacht
#

spatial OS is a enterprise level solution. Its not something you can just download and use.

#

but they have made some presentations about their architecture that are educational

paper blaze
#

Ok, I think I have a good starting place to learn from. Thank you for talking to me.

unborn moth
#

Hi. What i'm really looking for is a rundown on what solutions are good/bad for real time PVP games. I'm not making League of Legends but that style of constant input.

#

What should I steer towards/away from for a real time pvp game like that?

#

I was originally thinking peer2peer lobbies and using photon for that.

#

The game would be similar to gauntlet, just a little prototype at first but I don't want to start with a solution that is not right for a real time game.

potent glacier
#

why what phton directery do i have to use

olive vessel
#

An array has a Length, not a Count

potent glacier
olive vessel
olive vessel
#

You'll need to show some code

dreamy ibex
#

Hey! In my game (using Netcode) I have vehicles which can use every player on server (like in GTA). I used ClientNetworkTransform to allow clients move vehicles, everythink works fine - host see when clients driving vehicles, but when host enter vehicle, it is instant teleported to vehicle start position. How can I correctly code vehicles that can be moved by any player?

#

I submit ownership to player on entering vehicle, so I guess problem is that when host get ownership back, vehicle teleport to his saved position

potent glacier
olive vessel
#

Yes, because the method needs () for where the params go

potent glacier
#

i rewrote the exact line

olive vessel
#

The Awake line was the issue, that is not how you declare a method

#

A configured IDE should underline this, if your IDE is not, head to #854851968446365696 and complete the setup guide applicable to you

potent glacier
#

ahhhhhhhhhh

#

i see

#

yeah i configured vs code

#

ive said that in begginer code 44859438593485 times

#

but it wonr work for the life of me

#

i gott go to school bye

balmy cloud
#

I have an issue

#

when I create a server or lobby it creates the lobby successfully

#

when I try to join a lobby from another device

#

it doesn't join unless you have to create a lobby once again and rejoin it from the same device

mild tartan
#

I'm a bit confused whether or not lobbies handles some of the connections between players. For example, I read some networking guides/docs and see that you can start a server with NetworkManager.StartServer(). Does Creating a lobby do this? If not, do I need to connect the users again at some point?

tame pendant
#

Anyone familiar with Vivox chat?

#

For some unknown reason players can’t hear each other inside a channel?

#

I’m passing the same channel name though

#

Any ideas?

spring crane
#

@balmy cloud @mild tartan Probably wanna mention which networking solution you are using. Odds are a lot of people are not going to engage with the question if they can't even figure out whether it's related to a networking solution they are familiar with.

potent glacier
#

how do i display the number of online players in photon PUN V2?

quasi flume
#

What information would I need from a java server to start building a client in unity with a tcp socket connection? It would be my first project in networking, im already sorry in advance if that question is rather weirdly put 😄

potent glacier
#

=why do i get this

#

i wrote this

#

full code

#

NEW ERROR

olive vessel
#

Are you sure you should be doing multiplayer...

mild tartan
#

@spring crane all right. im not actually sure which solution im using to be honest lol. I guess it'd be the HLAPI? looks like maybe I should use photon, seeing a few people using that in here

#

I just started w/ the lobby pinned doc because it seemed useful for what I was going to try and start building

olive vessel
#

You are NOT using the HLAPI please

spring crane
#

Actually haven't looked into this service at all, but it seems like this service don't rely on any specific realtime networking solution. You would use it with some other realtime networking solution, like Netcode for GameObjects (Unity). Photon provides a lot more integrated experience from what I've seen, which makes the learning process a bit easier.

olive vessel
#

It was deprecated years ago

mild tartan
#

Netcode, it seems

#

sorry Welsh! It'll never happen again!

olive vessel
#

We sometimes get people using it to make their new MMO because of that Brackeys tutorial

#

Can you persuade them off it and onto the new solution? Of course not 😂

mild tartan
#

@olive vessel , as an alpha male game developer, what's your go to networking solution?

olive vessel
#

Far from that, but I'm loving Mirror at the moment

mild tartan
#

cool will check it out. im confused tho. is netcode == hlapi? are they both deprecated?

austere yacht
#

netcode is the HLAPI replacement, about 10 years and 1000000 bugfixes better

mild tartan
#

gotcha

#

so it's a reasonable solution to keep going with if I'm using it already

austere yacht
#

netcode, yes

mild tartan
#

cool

subtle depot
#

I want to implement photon into my physics based 2d fighting game, but heard that there could be issues if I use rigidbody. I’m using the rigidbody.addforce function for all movement will it work fine or will there be issues

fair roost
#

Hey

#

Can I also ask about Facepunch.Steamworks here?

#

anyway

pseudo bramble
#

Hello. I'm trying to use Netcode for GameObjects on 2020.3.34f1, and just updated to version 0.50pre and I ended up getting this;
(0,0): error - System.NullReferenceException: Object reference not set to an instance of an object| at Unity.Netcode.Editor.CodeGen.INetworkSerializableILPP.Process
Does anyone know what causes it? Could it be because of my code?

hardy vapor
#

Hello, is there a way to stream scene assets to the unity clients? I would like to create a scene that loads the assets remotely. Is this possible?

pseudo bramble
hardy vapor
#

Do you have any source of knowledge you can refer to solve this specific problem? I would appreciate it

pseudo bramble
#

I beleive StreamableAssets + AssetBundles could also work. As these aren't built in, but can be streamed as necesarry

hardy vapor
#

Thanks

mild tartan
#

if I load a new scene, will my network manager connections terminate?

#

right now, I have two users connecting to a lobby. they're supposed to both load scene when there's 2 users in the lobby. it works for the client but not the server, I think because the client is loading the scene and the lobbyAvailable slots goes back from 0 to 1 before the server user has a chance to loadScene as well

mild tartan
#

nvm that's not the issue. available slots never going to 0

mild tartan
#

weird. on client and server I swear im getting same lobbyID, but not seeing availableslots decrement the 2nd time

mild tartan
#

will the host's lobby data change automatically when a client joins? or do I need to heartbeat it / requery it or something

fair roost
#

I am creating my server using Facepunch.Steamworks like this:

            var serverInit = new SteamServerInit("test", "test")
            {
                GameDescription = "test",
                GamePort = 28015,
                QueryPort = 28016,
                Secure = true,
                //DedicatedServer = true,
                VersionString = "0"
            };

            try
            {
                SteamServer.Init(appid, serverInit, true);
                SteamServer.ServerName = "test";
                SteamServer.AutomaticHeartbeats = true;
                //SteamServer.DedicatedServer = true;
                SteamServer.MaxPlayers = 2;
                SteamServer.LogOnAnonymous();
            }
            catch (System.Exception)
            {
                Logger.Warning("Dll not found? Why.");
            }

it says Connectivity test: result=Connected, in progress=0
so i guess that my server is working
but my client won't see it

private void GetServers()
    {
        internet = new Internet();
        internet.OnChanges += OnServersUpdated;
        internet.RunQueryAsync();
    }

    void OnServersUpdated()
    {
        if (internet.Responsive.Count == 0)
            return;

        foreach (var s in internet.Responsive)
        {
            ServerResponded(s);
        }

        internet.Responsive.Clear();
    }

thats how i am looking for servers

high night
#

Can we get the other players ping to server in photon?

#

Without them having to send their NetworkTime?

uneven basin
#

Hey folks, I have a SignalR back end I would like to have a Unity client work with for a small project I am doing. I've found a lot of solutions online and was wanting to ask the braintrust what their recommended way of doing this would be.

maiden sentinel
#

Hey, just asking, pretty simple, is there a way that I can make a multiplayer. camera for unity that follows each player

spring crane
#

Technically the situation isn't necessarily any different from local multiplayer, just make sure you sync all the necessary data and then use the data pretty much as if it were local.
There might be additional polishing things you may want to consider depending on the data you need, but it should get you started.

maiden sentinel
#

right now, the camera is a child of the player

spring crane
#

You sure you don't need a camera just for the local player?

maiden sentinel
#

but the behaviour is kinda strange, being that the cameras do not seem to be assigned properly

#

i think thats what I need ngl

#

all i want is that the camera follows your player

spring crane
#

Preferably I would hook into the spawning method of the player object, but if that isn't available, you could have a component on the player object that spawns a camera prefab if the object is locally controller

#

Or have a camera that is looking for client's local player object, if that is available

maiden sentinel
spring crane
#

I don't remember the stuff available in PUN by name, so just go with the component on the player object approach to get something working.
Create a component that spawns a camera prefab in Start if the PhotonView is local.

maiden sentinel
spring crane
#

Get rid of that camera and make it a prefab.

#

The goal is to control the spawning of the camera

maiden sentinel
#

ok, i will inform you of the results.

#

ok, i will do this tomorrow

blazing cloak
#

using unity netcode for game objects is there a way to run code on a server without using an rpc function. To be clear I don't want the code to be called by a server rpc I want the code to run on the server by default.

spring crane
blazing cloak
spring crane
#

You should be able to differentiate between client, host and server.

#

At least for the runtime check. Compile time would be a bit more challenging 😄

blazing cloak
#

yeah but won't that only have effect in the client if you use a local host?

#

I am still very new to netcode so its still a bit confusing

spring crane
#

Not sure what you mean. You should be able to have different code paths based on all 3 states.

blazing cloak
#

ok so let me clarify. I want to run code on a server that is hosted on a local host. As far as I know the local host is split into a server and a client and just running the code like normal will only effect the client version on the local host and won't be synced on the network. So is there a way to g et code to run on the server side of the local host without using a server rcp that can be called by all clients?

spring crane
# blazing cloak ok so let me clarify. I want to run code on a server that is hosted on a local h...

I don't think server side of a host is really a thing, which is why host is a separate state from being a client or server. To run code when in host mode, you check if you are running as a host. Client that is in host mode generally shares all state with the locally running server. It's more of a server that is also acting as a client rather than a client that is running a server, if that makes sense.

blazing cloak
tropic shoal
#

Someone know how fix this ?

olive vessel
#

Semicolon on a method declaration, should it be there?

high night
#

Also, I think your script needs to extend to "Editor" instead of "MonoBehaviour"

olive vessel
#

No

#

The issue is a semicolon closing a method, leaving it without a body

#

And a misspelling of Rect

high night
#

yeah right

tropic shoal
#

Ok I will check and write if it helped

tropic shoal
#

oh i fixed this xD a lot of missspeling

#

but thanks for help

maiden sentinel
#

ok, I am back, I'd like to make a 2D multiplayer camera that follows the player. Right now, the camera is a child of the player and when the player spawns, the camera does not follow the player or the player is looking at the wrong camera

weak plinth
#

important question with pun 2....
I have applied IPunObservable. and I did the sendnext and recieve next.. but now I have come to realize that those work ONLY FROM THE OWNER OF THE PV, like the values get synched from owner of the instance that has the variable, is there a way to make the value update from other non owners as well?

#

also is fusion fully documented now??

surreal seal
#

Anione that work with photon online?

limber holly
#

Hello, Someone know how to Synchronize parameters of Photon Animator view in C# please ? I try to get the component then use SetParameterSynchronized() but I have error message. thx and good day

unborn mulch
#

Hello, there are problems when developing a network game using Mirror Unity. I want to make a connection via a local network, but I realized that sometimes there are problems when you cannot connect to the phone distributing the Internet. I used different connection methods, but this error always clearly indicates that something else needs to be done, has anyone met such a problem? There is a solution? What could be the possible reasons for such work?

ember mango
clear aspen
#

Hi, I'm completely new to Unity multiplayer.
I need a direction on where to start.
My requirement is to make a game that can

  1. Have a lobby filled with player created public rooms. (Auto matchmaking not required)
  2. Players can host/join room.
  3. Works on steam, but shouldn't be limited to steam (possible to reuse for other platforms)

From what I googled, Mirror + Facepunch seems to be my best choice?

surreal seal
clear aspen
#

But photon have a pricing, should I be worried about it?

maiden sentinel
maiden sentinel
#

idk tho, i suppose it depends on the scale

brave perch
#

Is the usage of Unity.Networking covered here?

maiden sentinel
#

Ok, I need a solution to a problem where, although so simple, I cannot get it to work.

The problem is to destroy a gameObject(with a PhotonView) across the entire network.

My current approach is to use an RPC method to the MasterClient, here is the code for it:
Call: view.RPC("destroyCollectable", RpcTarget.MasterClient, col.gameObject);

RPC Functioncs [PunRPC] void destroyCollectable(GameObject collectable) { PhotonNetwork.Destroy(collectable); }

This approach seems to work fine when there is only 1 player in the game, that player being the MasterClient, however, if another player joins and tries to destroy the GameObject, it creates one of two errors: cs Failed to 'network-remove' GameObject. Client is neither owner nor masterClient taking over for owner who left or cs Exception: Write failed. Custom type not found: UnityEngine.GameObject

As for the first option, I was led to this post (||https://forum.unity.com/threads/photon-failed-to-network-remove-gameobject-please-help.371499/||), which comes to the conclusion that the MasterClient cannot destroy GameObjects anymore and that that is outdated, if that is the case, what approach should I take? Any help would be greatly appreciated!

#

In case it isn't obvious, I'm using Photon PUN2 as my networking solution

unkempt spruce
#

Hello i have the following problem:

#

Im using a VPN and unity isnt able to connect with any API ("could not connect to host error"), ive tried with different APIs dont know what the issue is, can access the package manager just fine.

#

First happened when i tried to connect to the Playfab API but now i realize it happens always, everytime i request for web service

austere yacht
#

maybe the services/APIs block your vpn provider's proxy servers

unkempt spruce
#

im using express vpn

#

how can i prevent it from blocking it?

gray raft
#

what's the "intended" way to do multiplayer dev in unity. I love unity as an engine but i struggle to justify it as compared to other engines in terms of multiplayer dev. Biggest issue is running mulitple instances of a game without dodgy 3rd party addons. Hell even monogame is so much more convinient in that sense.

weak plinth
#

if you want to destroy an object that's not yours then in the rpc add an if (PN.localplayer.ismasterclient)

clear aspen
surreal seal
#

I dont know

#

I just know that with PUN2 free asset that you got in unity asset store you can create multiplayer game

#

you need to study these another tools to check their functions

#

or even ask for someone that can help you 🙂

somber drum
maiden sentinel
weak plinth
maiden sentinel
weak plinth
weak plinth
maiden sentinel
weak plinth
maiden sentinel
#

and right now I can't really do anything cuz this error fills up my screen: cs Exception: AllocateViewID() failed. User 1 is out of viewIDs. It seems all available are in use.

maiden sentinel
weak plinth
maiden sentinel
weak plinth
maiden sentinel
weak plinth
#

In the rpc... Use the is master client condition

maiden sentinel
#

ok... I'm neew to RPC, how can I send it to every player?

weak plinth
weak plinth
maiden sentinel
#

so, I just exclude that argument?

weak plinth
#

Give me 10 mins, @maiden sentinel ill go to the computer and explain

maiden sentinel
#

kk

#

also, I'm getting this error:cs Exception: AllocateViewID() failed. User 1 is out of viewIDs. It seems all available are in use. Yeah.

weak plinth
#

back @maiden sentinel

#

can we talk in dm?

maiden sentinel
#

sure

tacit veldt
#

what is the best way to make multiplayer game in unity with high quality?

deep radish
#

hey guys

#

I'm trying to wrap my head around security around client to server communication, this is my question in a nutshell

relating to an inventory system (as an example).

A user logs in, and now has access to read data from their inventory, rewards, etc. All the subscriptions happen to all the data (or it is all loaded in at once and polling occurs).

In our scenario, the player then picks up a potion. This is then stored locally on the client RAM and eventually triggers a request to a server that has write access to the database, the database validates (?) the data and writes it to the database.
my question is, how does the server know the client is telling the truth?
ie can a malicious user deconstruct the client, after authorization, and send potentially send the server false data?
Or am I incorrect in that being an attack vector, and can the server trust the client?

pure locust
#

I tried to add client prediction to my game, I didnt add reconciliation yet, but I think this isnt supposed to happen. The model is the player with client prediction and the green model is the latest known server position.

deep radish
pure locust
#
  1. idk
deep radish
#

like an inventory item

pure locust
#

also server

#

because some hackers might change the inventory items

deep radish
#

So when a player adds a potion to their inventory system, what is the workflow? generally speaking. I'll write my best guess below

#
  1. Client caches data locally.
  2. An event is emitted when this action happens, from the client to the server
  3. Server validates and persists information
  4. Client polling ensures eventual consistency
pure locust
#

Ig it's like this

#
  1. Client sends keypress to server
  2. Client displays predicted message
  3. Server processes keypress
  4. Server sends message to client and validates
deep radish
#

ahhh i see

#

much more granular than i thought

#

of course

#

thank you

pure locust
#

Np np

unkempt spruce
#

hello, what could be causing that web request calls dont work on the editor play mode, only on build

brave yarrow
#

with unity

#

cant find any good library

golden gust
unborn mulch
#

hello everyone, I'm developing a game on unity with a mirror and I want to make the server call a function that will work on all clients and the server as well. I know the ClientRPC decorator, but it is called only on all clients, but I also need it called on the server. please tell me how this can be done?

brave yarrow
opaque thorn
#

Yo anyone able to help with Pun?

golden gust
brave yarrow
#

i made my own library

#

why would anyone pay $60 for a library what

subtle depot
#

can someone help me with photon latency

weak plinth
#

i am not sure where i go with this. i have a game set to host & client mode for Multiplayer using Photon. This works fine but i want to set this logic to a headless server. I got a virtual linux server up and running and as far i can see it works but i cannot see the Server in the lobby while that is locally no problem. Is there a specific step to do?

#

the game is starting in server mode via arguments and it should be visible. is there a way to get the debug from unity into the server console?

still hare
#

Might work by default, but I remember having some troubles at some point

#

That's for custom logging, but if you just build the headless server in development mode you should get error logs

weak plinth
#

Ah thx. That's a start

weak plinth
#

hm, write to line is not shown in the server console

#

hm how can i print output to a console like bash/etc when i run a build?

#

ok as far as i can see it is not possible to get messages to the server console. but instead into the player log

#

but how can i access the player log on a server?

#

ah i see. have to find them on the server system

weak plinth
#

hm, does anyone having trouble starting a linux build on a server? my windows build runs.. but at linux it does hang at Unable to load player prefs

weak plinth
#

i made a picture. on the right is the windows log, on the left the linux log

#

i underlined the parts that may have something to do with the linux build not running

quasi pike
#

Hello. I want to make a multiplayer card game and currently having troubles with choosing networking solution. So I want to have one server hosted by me that controls different rooms for the players. Can PUN server do that? Or is it only for player-hosting? What should I use? Thanks!

high night
#

@quasi pike You could probably have it very easy and robust via having the game as a backend

#

And players sending commands with http requests

#

It'd be infinitely scalable

#

A request would be something like:

{
  "GameId" : 324687,
  "CommandType" : "PlayCard",
  "CommandParams" : {
    "CardIndex" : 5
  }
}
#

But I don't know if the requests will be expensive

#

Your game state would be a database entry in some database or redis

#

Your function app would pull the game entry, update some data, and write it back also returning the new state of the game to you

#

The good part about all this is you not worrying about hosting an "instance" for a game

#

Because a game would just be a database entry

#

The bad part is having to move around the game data for each request

#

There has to be some ways to cache it where its processed and maybe forward the same user there all the time
Or avoid having the need to store the game state in a database at all

#

.
I wonder how would some else answer this question

weak plinth
#

so i get this crash report finally.

#

somebody a clue if this is somethin linux specific (when working with photon)

tropic shoal
#

Im using Netcode for GameObject and host move normal but when host move the client move too and client cant move how i can fix this? how i can give every client move script

inland fog
#

What is the limiting factor of concurrent users in multiplayer games today? Is it the expected limited bandwidth of the clients?

#

Excluding any AOI, compression or smart packet handling?

winged geyser
# inland fog What is the limiting factor of concurrent users in multiplayer games today? Is i...

Engineering effort, probably.

If you have a single container/vm/instance without any firewall/LB, you could theoretically handle 65k concurrent connections, but you'll likely run into resource issues far before you'll run out of ports: CPU processing, disk/database access, memory depending on what's needed per client.

If you are scaling out (multiple instances that can handle a smaller number of connections per) then you're essentially only limited by engineering effort (to get the instances talking to each other or a database if needed) and cost (instances of servers cost money, bandwidth costs money, data costs money, and most importantly - salaries cost lots of money).

weak plinth
#

i made a websocket client in unity and i converted to webgl
but i have this erro

wooden copper
#

Guys, does anyone experiencing problems with Vivox? I'm able to authorize, but not able to Join any channel. Getting instantly disconnected.

jade hinge
#

Can someone help me with the my unity transport code. I'm getting a event queue error when more then one person joins

#

Server Client ``` using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ServerClient
{
int playerNumber;
bool isConnected;
string playerAlias;
float playerXPos;
float playerYPos;

public ServerClient(string newPlayerAlias, int newPlayerID)
{
    playerAlias = newPlayerAlias;
    playerNumber = newPlayerID;
    isConnected = false;
    playerXPos = 0f;
    playerYPos = 0f;
}

public void initNewClient(string newPlayerAlias, int newPlayerID)
{
    playerAlias = newPlayerAlias;
    playerNumber = newPlayerID;
    isConnected = true;
    playerXPos = 0f;
    playerYPos = 0f;
}

public void updateClientPosition(float newPlayerXPos, float newPlayerYPos)
{
    playerXPos = newPlayerXPos;
    playerYPos = newPlayerYPos;
}

public void updateClientData(
    bool updatedConnectionState,
    string updatedPlayerAlias,
    float updatedPlayerXPos,
    float updatedPlayerYPos)
{
    isConnected = updatedConnectionState;
    playerAlias = updatedPlayerAlias;
    playerXPos = updatedPlayerXPos;
    playerYPos = updatedPlayerYPos;
}
public void clearClient()
{
    playerAlias = "No player";
    isConnected = false;
    playerNumber = -1;
    playerXPos = 0f;
    playerYPos = 0f;
}

public bool isClientConnected()
{
    return isConnected;
}

public int getPlayerID()
{
    return playerNumber;
}

public string getPlayerAlias()
{
    return playerAlias;
}

public float getXPos()
{
    return playerXPos;
}

public float getYPos()
{
    return playerYPos;
}

}

#

also if there is any way i could optimize the code and have it run better would help

austere yacht
vapid pewter
#

hi im trying to send a http json request to link sqlite db using nodejs to unity

#
var formContent = new StringContent(newUser.ToJSON(), Encoding.UTF8, "application/json");
            HttpResponseMessage response = client.PostAsync(baseUrl + "/api/login", formContent).GetAwaiter().GetResult();
            string responseStr = response.Content.ReadAsStringAsync().GetAwaiter().GetResult();```
#

is this done by sending json request or url encoding request

weak plinth
#

Hello =>

#

Whats the best way to create a websocket client in c# that support webgl?

obtuse pumice
#

Does anyone have any good resources on architecture for sharing code between the client and server?
Putting all logic into the server and just having a dumb client which simply does presentation seems very straight forward but it will fail when latency increase and it also wont allow for any type of client side prediction.
Would it be crazy to run a local server for each client which handle all client side logic and then correct itself after the actual server?

austere yacht
# obtuse pumice Does anyone have any good resources on architecture for sharing code between the...

have a look at the architectural descriptions of photon fusion and photon quantum, they are both interesting solutions to low latency multiplayer. Prediction can be unnecessary or much simplified if you have a game design that hides latency well, things like lock-on/explicit targeting as in WoW vs incidental targeting as you see in first person shooters. Ultimately even if you have the server run all the prediction, you can still provide a client with any information it may need to steer and correct its own simulation, basically you can have have both run in parallel and checking for consistency at intervals and smoothly correcting if necessary.

obtuse pumice
winged geyser
# obtuse pumice Does anyone have any good resources on architecture for sharing code between the...

My approach is (assuming you have the networking & serialization of data taken care of) for a very carefully managed player state object that you can send either way. When my clients connect, the server strips any "secret" information out of the state, and sends it to the client so they can play. When they make non-important changes (ie, nothing they could advantage themselves with) they are free to just edit the model on the client side. When they want important changes (ie - redeem a chest or randomly select a reward or something) they send a request to the server, which verifies they're able to and validates other aspects of the request, edits the model, and sends it back to the client, which can either discard the model entirely and use the new one, or merge them together.

So - you have an entirely serializeable player model that has methods to strip the secret stuff on the outgoing copy, strip the potentially hacked information on the incoming copy, and methods to merge them depending on where you are.

obtuse pumice
winged geyser
#

Sure. I'm using MessagePack for C# (for serializing to byte[] for networking), Newtonsoft.Json (for serializing to JSON for my database) and Ruffles rUDP for networking.

#

At some point I might write a blog article or something going over my stack.. seems like a pretty common need and it took a lot of learning on my own to do it.. and it wasn't super complicated or anything

violet ice
#

hey i have a problem with UnityWebRequest doing a POST. not sure if this is the best place to put it

#

so in postman i have a POST request with this signature, no body, and it 100% works with a valid auth token. no problemo. but when i try to make a UnityWebRequest.Post, no matter how i seem to configure it, i either get a 401 or a 403 back. the 401 i think is because i'm putting the auth header in the wrong place but when i put it where i think it should be, i get a 403 which makes no sense to me

#

https://paste.myst.rs/2q1i166o here's a paste link with a bunch of the code i've tried, most of it commented it out. it all seems to fail no matter what i try though

#

anyone? i'm dying here

#

i literally can't stop working until i get this working

mortal horizon
violet ice
#

my postman doesn't seem to use one

mortal horizon
#

In your screenshot above it has one

violet ice
#

okay. it works via swagger and it looks like it doesn't use one

#

i can try though. do i just make up a user agent name?

violet ice
#

does anyone on this planet have experience with this? i literally just want to POST an empty body

#

it shouldn't take two days of research, trial/error and literally just guessing at this point to structure a query that i got working in 30 seconds in swagger and postman

mortal horizon
violet ice
#

yeah that's not my problem

#

its my own API and i'm not checking for the user agent and it didn't work when i tried it for s+G's

weak plinth
#

is anyone here proficient with Mirror and wouldnt mind spending some time answering questions and clarifying some stuff to help me understand how it works? (and would be ok with helping over VC)

oak flower
#

@weak plinth Don't cross-post. Ask the actual question.

weak plinth
#

i tried to write my question.. it would be 1000x easier to explain it in vc

pulsar sorrel
#

Try

#

No one knows if they'll be able to help with your specific issue unless you actually ask

olive vessel
#

Do you actually think people will commit to VC with you before you can even formulate a proper question?

weak plinth
#

im just trying to understand how the server comms with the client and vice versa

olive vessel
#

Networking is a big topic to get through

weak plinth
#

i made multiplayer games on another platform for 9 years, and trying to learn on a new platform is tough. im trying to make connections between the two platforms and how it would work to make it make sense to me

#

for example: im used to scripting with dedicated Server scripts and Dedicated client scripts that communicate to each other through Events (similar to Commands with mirror)

#

so i dont get where the Server code should be written, and why

#

same with client code

quaint moon
#

There’s no such thing as dedicated clients

quaint moon
weak plinth
#

with unity im using Mirror

quaint moon
weak plinth
#

something as simple as a player shooting a projectile. When the Lmouse button is clicked, how does that client communicate with the sever to let them know to insatiate the projectile prefab, add a velocity etc, and then transmit that to the clients

#

is it all done in the same script?

quaint moon
#

No

#

So do you want the game to be server authoritative or client authoritative

weak plinth
#

server (if i understand right, this will give some level of protection against exploits?)

quaint moon
#

Yeah

#

I’ll explain a hybrid example

#

On the Player script, when the player clicks shoot, the player script(which inherits from NetworkBehaviour) will send a [Command] (this just means the code will be executed on the server). Now on the server the code will execute and spawn the projectile. It will also have to call NetworkServer.Spawn on the projectile so all the players can see it. You could put a NetworkTransform on the projectile (to sync the position) but to be honest, you don’t need to, just use the same movement script and it will roughly align on all clients

#

@weak plinth

weak plinth
quaint moon
#

The server code is in the [Command]

#

When you call a method with the command attribute on a client, it is instead executed on the server

weak plinth
#

so its all in the same Cs script?

quaint moon
#

Yes

weak plinth
#

ok thats the confusing part to me

quaint moon
#

Do you understand now?

#

Also, read the docs

#

ALL OF IT

weak plinth
#

a bit more than i did 30 mins ago

quaint moon
#

It takes about 30 minutes and will clear up all your misunderstandings

#

Everything under USER MANUAL is essential to read

weak plinth
#

because how i did for the past 9 years was;
client has a player script, and when they click to shoot it will fire an event
-server listens for the designated event and when called on, will execute code (in a seperate "server script"). this will then instantiate the object on the server, add velocity etc