#archived-networking

1 messages · Page 121 of 1

austere yacht
#

Photon Fusion (commercial with a free tier up to 200 CCU), Netcode for GameObjects (unity's built in solution) or Mirror (free and open source)

thorny wasp
#

So both photon fusion and netcode

#

Ok thanks

austere yacht
#

those are separate products

#

you pick one

thorny wasp
#

So photon fusion and Pun is different I see

#

I thought they were same haha

austere yacht
#

fusion is the modern replacement of PUN with a lot of added features

thorny wasp
austere yacht
#

no, they all get the job done

thorny wasp
#

Oh

#

Ok

austere yacht
#

mirror has the best community support

thorny wasp
#

Alr I'll look into mirror thanks

austere yacht
#

netcode is more low level than mirror and fusion

thorny wasp
#

But not future proof?

#

/ has limitation?

austere yacht
#

low level means it has fewer limitations

#

but requires more work

thorny wasp
#

Hmm

austere yacht
#

fusion is the most advanced library for typical session-based games (MOBA, FPS, ARPG, Fortnite etc) that is available for free

thorny wasp
#

Well I might try mirror as it has good community support and I'll assume more tutorial?

#

Thanks

#

Sorry for the long talk

glacial totem
#

All networking libraries are bad imo

#

They are great if you don’t code I guess, but if you’re a programmer you should be avoiding them at all costs imo and learning how to write actual net code

patent fog
#

Yeah and maybe 3 years later you finally start your own game

#

Libs and frameworks have their purpose

#

with pros and cons

odd apex
#

Does anybody have recommendations for a networking library? I've looked into fishnet and it looks promising

olive vessel
odd apex
#

i've also heard about face punch, any thoughts?

olive vessel
#

Facepunch is the company that made GMod and Rust

#

Both fantastic games

odd apex
#

I hear facepunch switches the language of steam integration from c++ to c# or something like that

#

I think I might use that

glacial totem
#

Client/Server architecture is pretty standard across programming lol

#

I agree they serve a purpose, but that purpose is mainly around not having to deal with netcode

#

and for most games that want to be something, skipping your netcode isn't what you want haha

#

I mean looking at this channel is kinda all the proof you need

#

It's 99% people asking questions about a library

#

meaning no one is learning anything here

austere yacht
glacial totem
#

And play the bagpipes tbh

#

No in all seriousness, I was a little extreme

austere yacht
#

you are probably contrasting PUN to writing your own transport layer

glacial totem
#

Yeah idk I will admit I work on netcode that isn’t really supported by any library

austere yacht
#

There is a world of situations between the two that benefit greatly from libraries

glacial totem
#

So I’m biased because of that. Knowing that using a library would get me nowhere.

austere yacht
#

how do you know?

#

if you haven’t done both?

glacial totem
#

Because it’s not magic. Physics networking needs to be tailored custom to every game

austere yacht
#

usually homebrew is great when the tech is new but over time it becomes ridiculously less productive except for the most high budget productions

glacial totem
#

It’s basically one of those things that if you work with it, you would know it’s impossible to create a product that would be broad enough to work for a lot of games

#

Client side prediction with physics and state rollback, that is

#

So my personal opinion is that Fusion is a falsely advertised product and there’s no way that it wouldn’t get you stuck in a hole

austere yacht
#

all that stuff isn’t handled by the popular libraries

#

You can’t standardize that, so they don’t

glacial totem
#

I guess that’s my point and it’s a small one

#

But there’s very little you can standardize on in networking for games

austere yacht
#

Fusion is a fps framework for a very specific game

glacial totem
#

So it’s a better investment to learn networking principals than to spend that same time learning a library

#

It’s not Fusion then, it’s Quantum I think

austere yacht
#

Idk what libraries you have in mind here but most are just thin convenience layers on to of a transport

#

You still need to think hard about your data and sync strategy with most of them

#

Fusion and quantum are very opinionated

glacial totem
#

Yeah I’m obviously in the minority

#

I’ve did C# for 15 years before I started Unity

#

So for me something like LiteNetLib was wayyyy more attractive than using a netcode library

#

Especially having the flexibility of running servers outside of Unity

austere yacht
#

I can emphasize with that

odd apex
#

should i use unity netcode?

#

im making an fps

austere yacht
odd apex
#

i dont know anything about networking

#

so idk

#

im interested in either netcode or facepunch

austere yacht
#

Maybe fix that ‚idk‘ part first

odd apex
#

maybe

austere yacht
#

No library will enable you to suddenly become a competent netcode developer

#

also none of the popular (and current) Libraries will prevent you from making a reasonably ambitious game

glacial totem
#

@odd apex Facepunch is a company

#

Maybe you’re talking about the Facepunch.Steam library?

odd apex
#

yeah the steamworks facepunch

glacial totem
#

Which is a native C# library for Steam instead of using the official C++ one

odd apex
#

ye

glacial totem
#

Yeah that won’t handle networking for you

odd apex
#

oh wat

glacial totem
#

Well it will, but gameplay networking and lobby networking are different

#

Steam can handle lobbies, and some matchmaking, but it can’t run game servers for you

#

So it’s technically not netcode

odd apex
#

I just want to have 2 players in a game together

#

will netcode be able to do that?

#

i assume so

glacial totem
#

Sorry “netcode” is a blanket term for all code dealing with game networking

#

“Netcode For Unity” is something that I have no understanding of

odd apex
#

oh i meant the netcode for gameobjects thing

glacial totem
#

Yeah I can’t help with that but I’d have to imagine it’s a netcode solution so yes

austere yacht
odd apex
#

ok

#

imma look at some tutorials

#

thanks guys

austere yacht
austere yacht
#

rollback and prediction are completely absent

glacial totem
#

sounds like it's something i might have been able to make my custom netcode solution on with that level on control

#

I still like that my matchmaking server is pure C# with no Unity

#

so that might have been a limitation

#

but still good info

austere yacht
#

yeah, would not build that with unity

glacial totem
#

As long as I have control, i can make rollback and prediction work

#

because those are more theories based on logic

#

I'm glad i invested time to learn the theory because now i'm not tied to any networking solution

austere yacht
#

yes. You can even do that with mirror… all those mid level libraries let you hook into the message system directly, they do abstract the transport however. So you can only configure them but not use them directly. (But you can ignore even that any use them directly anyway)

odd apex
#

has this ever happened to anyone when trying to install certain networking packages?

floral tusk
#

Is it inferior to tags?

olive vessel
thorny wasp
#

I planning on using playfab, (I dont want to pay a single penny lol)
is it a good free option?

#

It says it has 750 free compute hours. what does this mean?

#

does it mean 750 hours a month that it can be on

#

or is it 750 hours divide number of players a month?

austere yacht
austere yacht
verbal coral
thorny wasp
#

I was about to make a multiplayer using mirror, but I found fishnet, and apparently it's better. Should I use fishnet instead?

olive vessel
#

Mirror is a tried and tested solution that's been around for ages

thorny wasp
#

if I wanted to host my own multiplayer using my own pc, would you recommend Mirror or fishnet (very new to networking)

olive vessel
#

I like Mirror personally, very easy to get into. It's your choice though and there's not much difference between them

thorny wasp
#

ok

austere yacht
#

all these libraries are essentially the same

thorny wasp
#

I feel like I gotta be more subborn

#

and like choose one and do it

olive vessel
#

Yes using both would be an awful idea

thorny wasp
#

I normally compare and do the "better option" so whenever I see a possible "better option" I always wanna know which is better haha

#

if I'm using mirror, and also hosting a server from my pc, should I learn both at the same time, or focus on mirror, then add the server / storing data side

austere yacht
thorny wasp
#

yea

#

I guess

austere yacht
#

its like googling "best TV"... completely pointless, just makes you want stuff that you don't actually need

thorny wasp
#

yea i guess

#

if I'm going to be hosting on my windows desktop, could I code on my macbook laptop then send files over? or should I code on my windows desktop

thorny wasp
stone chasm
#

guys how can i pass ref to spawned object by host

spring folio
stone chasm
#

when the client spawn object object need refrence let's say stats script i pass it normal from the client and on the host the object have the ref and everything good but when host spawned and pass ref on the client the object don't get the ref i don't know why i hope u understand me

#
    {
        if(IsOwner)
        {
            if(IsServer)FireBallClient();
            else FireBallServerRpc();
        }
         
    }
    [ServerRpc]
    public void FireBallServerRpc()
    {
           FireBallClient();
    }
    private void FireBallClient()
    {
        switch (num.FireBallLevel){
            case 1:
            Instantiatee(Levels[0],Locastion);
            break;
            case 2:
            Instantiatee(Levels[1],Locastion);
            break;
            case 3:
            Instantiatee(Levels[2],Locastion);
            break;
            case 4:
            Instantiatee(Levels[3],Locastion);
            break;}
            if( num.FireBallLevel >= 5)Instantiatee(Levels[4],Locastion);
    }
    GameObject currentFireBall;
    void Instantiatee(GameObject Level,Transform where)
    {
        currentFireBall = Instantiate(Level,where.position,Level.transform.rotation);
        currentFireBall.GetComponent<NetworkObject>().Spawn();
        PassRefServerRpc();
    }
    [ServerRpc]
    private void PassRefServerRpc()
    {
        currentFireBall.GetComponent<Transfer>().Stats = stats;
    }```
stone chasm
spring folio
#

RPC is only client

#

but it executes on the server

#

nah sorry the other way around

#

RPC executes from server to all clients

stone chasm
#

this code work on client without problem but on host nope it dosn't pass the ref stats

stone chasm
spring folio
#

i'm not a very good helper on that subject sorry

#

i just told you my advice, and that's it 😦

weak plinth
#

Hi,
Question about steam networking:
anyone who knows its ups and downs?
and is it completely free?
and what is the best place to learn it?
thank you

wintry bluff
#

Hi guys are there any docs for EOS in Unity? or how can i implement basic P2P function with maybe Mirror and EOS

hexed yacht
#

Does anyone know how I should synchronise my procedually generated world?

#

I'm working with mirror

olive vessel
hexed yacht
#

ye, idk how to send stuff over

#

im down to call and share my screen for simplicity

#

I'd appreciate if you show me how to do it

olive vessel
hexed yacht
#

alright, ima check it out. Thanks

knotty horizon
#

Good day to all! The question is, do everyone know that in multiplayer games there is such a thing that you go into the search for games and you are shown a list of available rooms? So, does anyone know how to do this? Maybe there is some documentation? Otherwise I can't find anything...

spring folio
knotty horizon
spring folio
#

well if you have your own servers with your own code, you're the only one that would be able to do such thing

#

everytime someone connects and create a room on your server, you need to store that somewhere, and make it so your players can get access to that list

knotty horizon
spring folio
#

not sure, i would recommend you using an existing framework for doing multiplayer if you're not sure what youre doing

knotty horizon
spring folio
#

but it's costly, obviously

hexed yacht
#

I'm using Mirror for my game right now. It's "easy" to use

#

and free

spring folio
#

Mirror doesnt lend servers

hexed yacht
#

well what if you host your own?

spring folio
#

yea, that would be your own

#

Photon lend servers

hexed yacht
#

or you make it like host+client on one pc

spring folio
#

that's why i was telling that

#

ye you can too

hexed yacht
#

ye thats what im doing for my game. You can host a server and play on it and friends can just join you. Like in Valheim or minecraft bedrock edition

knotty horizon
spring folio
#

you can have your own server, even using frameworks

#

but obviously its more work

knotty horizon
#

ok thanks

hexed yacht
#

Why are these not synching?

#

the red is the host/server + client and the yellow is a second client

hexed yacht
#

Please helppppp

#

I just need one fricking list of all the players

spring crane
#

You have the same options available as other games, you just have to implement one.

#

Direct IPs, server browsers, matchmaking...

daring kite
#

where is this ?

lethal ether
#

someone here who could help me with basic photon pun 2 room leaving?

olive vessel
weak plinth
daring kite
#

sorry it's another subject

weak plinth
daring kite
#

I thought it's built in

weak plinth
#

if you already have one why do you want to install it?

daring kite
weak plinth
#

that doesnt even have anything to do with what i sent

daring kite
#

yeah it's another subject I'm sorry

nocturne jacinth
#

Hi there, not sure if this is the right channel, but I'm not sure where else to ask. We're working on a large project that requires networking, and we've currently got a peer-to-peer implementation, but would like to move to a dedicated server model. I'm wondering, when it comes to headless servers, if there's any advice / good practices when it comes to the code architecture. How do you keep your client code and server code separate? Do you use custom defines, separate project, or do you keep it in the same scripts?

hybrid lotus
# nocturne jacinth Hi there, not sure if this is the right channel, but I'm not sure where else to ...

I think that you can take a look at https://www.youtube.com/watch?v=zrIY0eIyqmI

In this 2017 GDC session, Blizzard's Timothy Ford explains how Overwatch uses the Entity Component System (ECS) architecture to create a rich variety of layered gameplay.

GDC talks cover a range of developmental topics including game design, programming, audio, visual arts, business management, production, online games, and much more. We post a...

▶ Play video
nocturne jacinth
tired zephyr
#

Good morning everyone, we have a Normcore problem.
in the project what we are looking for is any connected user/player can change values/attack/destroy any NPC. Because currently not all players can change the values of an NPC, only user 1 = Masterclient (that is the first player) can change the values 😅

Please, do you know how I can achieve synchronization that occurs from all User's VS all NPCs? without need or obligation that only the "masterclient" do it 😅 🧐

hybrid lotus
#

Local firewall on your side?

hexed yacht
#

What does this mean?

#

I use ParrelSync to open the project twice and since starting it today, I got this error

#

pls ping me if you answer...

high night
#

How would you guys implement low level messaging?
I mean like sending a msg in byte[] from one side and having it land where its supposed to on the other side and have it deserialize to the same type
Can we avoid the boilerplate that the type enums and factories bring?

wide girder
#

Then you have http requests, sockets and what not it you want to reinvent the bicycle after all.

high night
#

I am just using enet

#

Trying to have little more control

#

Also don't want unity dependency

#

In the networking assets I've used, these issues of mine would be handled with RPC calls

austere yacht
high night
#

I guess I just have to do some refactoring

#
    public class NetStateMsg : NetMsg
    {
        public byte[] Data;

        public override void Serialize(BinaryWriter writer)
        {
            writer.Write(Data.Length);
            writer.Write(Data);
        }

        public override void Deserialize(BinaryReader reader)
        { 
            var dataLength = reader.ReadInt32();
            Data = reader.ReadBytes(dataLength);
        }

        public override NetMsgType GetMsgType()
        {
            return NetMsgType.NetState;
        }
    }

    public class TimeSyncMsg : NetMsg
    {
        public float TargetClientTimeOnClientReceive;

        public override void Serialize(BinaryWriter writer)
        {
            writer.Write(TargetClientTimeOnClientReceive);
        }

        public override void Deserialize(BinaryReader reader)
        {
            TargetClientTimeOnClientReceive = reader.ReadSingle();
        }

        public override NetMsgType GetMsgType()
        {
            return NetMsgType.TimeSync;
        }
    }
#

and this:

austere yacht
#

what is the question?

high night
#
public class NetMsgFactory
    {
        private Dictionary<NetMsgType, Type> _msgTypes;

        private static NetMsgFactory _instance;
        public static NetMsgFactory Instance => _instance ??= new NetMsgFactory();

        public NetMsgFactory()
        {
            _msgTypes = new Dictionary<NetMsgType, Type>();

            // iterate child classes of NetMsg
            foreach (var t in typeof(NetMsg).Assembly.GetTypes())
            {
                if (t.IsSubclassOf(typeof(NetMsg)))
                {
                    var netMsg = (NetMsg) Activator.CreateInstance(t);
                    _msgTypes.Add(netMsg.GetMsgType(), t);
                }
            }
        }

        public NetMsg Deserialize(BinaryReader reader)
        {
            var typeId = (NetMsgType)reader.ReadByte();
            var type = _msgTypes[typeId];
            var msg = (NetMsg) Activator.CreateInstance(type);
            msg.Deserialize(reader);
            return msg;
        }

        public void Serialize(NetMsg msg, BinaryWriter writer)
        {
            writer.Write((byte)msg.GetMsgType());
            msg.Serialize(writer);
        }

        // TODO: reuse memory streams here
        public byte[] GetBytes(NetMsg msg)
        {
            var writer = new BinaryWriter(new MemoryStream());
            Serialize(msg, writer);
            return ((MemoryStream)writer.BaseStream).ToArray();
        }
        public NetMsg FromBytes(byte[] bytes)
        {
            var reader = new BinaryReader(new MemoryStream(bytes));
            return Deserialize(reader);
        }
    }
#

I was wondering if there's a library to do these

#

The factory, the messeges

austere yacht
#

you want a generic serializer/deserializer for datastructures?

high night
#

The figuring out the type from the first byte

#

Yeah thats it

austere yacht
high night
#

Polymorphic structures to be precise

austere yacht
high night
#

hmm

austere yacht
#

people use game/engine specific (custom) libraries because the generic solutions are too inefficient

#

boilerplate is somewhat the name of the game in all things networking

#

there are so many contingencies to manage due to the lack of any guarantees inherent to distributed systems

high night
#

Hmm, let me ask you a design question

austere yacht
# high night The figuring out the type from the first byte

if you want self documenting types you need to use a format that can store the data and the schema, this is extremely inefficient when talking about high frequency network messaging as it is typical in games, in game networking client/server are paired in a way that they know which type a message must be at compile time

high night
#

I have a GameCore that you inject your ecs systems, the player command handlers and it simulates whatever you have in your game
Lets say there can be different types of commands
like these:

CharacterMovementCommand { characterId, movementVector}
ShootCommand{characterId, shootVector}
DropItem{characterItem, itemIdToDrop}

I mean, I am having trouble coming up with a system without polymorphic messaging, without factories and such

#

And then there are messeges that arent injected to the GameCore

#

Like assigning a character id to client, maybe sending a chat msg etc

high night
austere yacht
#

you could just have a message manager that you register message types with and encode this type to an int that you pack into the message (as its first 4 bytes) and when a message is received you just lookup the type in that manager and deserialize it

#

thats essentially what all the mid level libraries do in one way or other

high night
#

a factory

austere yacht
#

you don't need a factory if you don't want one

high night
#

hmm, is there an alternative?

austere yacht
#

depends on what you understand a factory to be

high night
#

I find myself having to create a factory for the game core that handles the GameCore msg types
And another factory for the game spesific msges like the types of the player command examples

austere yacht
#

if you want to call Create() on some base type and get a specialization of it back, you need a factory, because thats what a factory is, but you don't have to do it that way

high night
#

I am just trying to minimize the boilerplate code while turning a byte[] into its type object and feeding it where it's supposed to go

#

I guess it can't be minimized much

high night
#

And use its bits

#

Based on its type integer

austere yacht
#

to minimize boilerplate you can wrap your messages into data structures

#

those would automatically register themselves with the message manager and send/receive through it, but you'd just access them like any other datastructure

#

say you have a Sync<T> type, the implementation of it would just be a strategy pattern based what kind of type it is (value, reference, ...) and wrap all the factory/abstract factory stuff

#

if you don't want to use fancy code weaving you could just have all your network classes subscribe to a message bus that receives messages and you just subscribe with your handlers (that a normal library would declare via attributes on methods)

high night
#

hmm, these will take a while to digest

#

message bus might be nice I'd think about this a little more

high night
austere yacht
#

it’s basically a wrapper around manually calling send/receive message

#

an event or message bus is a quite well defined pattern

high night
#

hmm, I wouldn't want to do weaving anyways

#

I think the best solution for me would be the message bus

#

With the listening and publishing

#

Id have just one integer going on my msgs to indicate which bus it belongs to while sending them all in one enet channel

#

And I guess it'd be nice

spring crane
#

Code generation can be used for this. Mirror/Mirage generates serializers and deserializers for you.

high night
#

Allright thanks @austere yacht I'll see what I can do

#

Thanks, @spring crane I'll also take a little look, I've never implemented any code generation system before

#

I'll take look with the online vscode

spring crane
#

I believe there has been some recent progress in more ergonomic code generation methods

austere yacht
#

it’s not very complicated code gen, but still annoying to maintain

hollow axle
#

Hey guys, I'm playing around with the NetCode package and am struggling with client animations being replicated on the host.
I've read through similar issues on the forums (https://forum.unity.com/threads/the-host-dont-see-animations-of-clients.1295964, https://forum.unity.com/threads/client-animations-not-displaying-on-the-host.127945) however even though I have followed the instructions given, my animations are still not propagating back to the host.

Is there anyone free to go through this with me?

brave barn
stray raven
#

y'all I'm lost at how to get clients to send a request to the server to do an action. I've played around with the [Command], [Client] and [ClientRpc] tags but Im clearly missing something

stray scroll
#

I have a somewhat generic shader that deals with both a spawning and despawning based on timestamps.
I'm in a bit stuck in how I should deal with setting these timestamps to cover for people joining late & in general what time unit to use I guess.
I'm using Dots NetCode & have a GameplayAbilitySystem in place where my current thought would be to use debuffs to trigger the spawn and despawning with either applying gameplayTags or lookup on the actual debuff.
Issue I get into is if there is no debuff present, I don't know if it's because it hasn't been created yet or if it was created to far in the future.

daring kite
#

anyone using mysql / phpmyadmin on droplet ?

delicate thicket
#

Hey
I'm trying to make a multiplayer mod for a game that and make it so players see everyone else's gameplay
I made this component that sends what the camera sees to the other players through RPC (I use the legacy networking because of the Unity version the game uses)
The images are send in an OnPostRender

    [SerializeField] private RenderTexture CameraTexture;   //256*256
    [SerializeField] private new NetworkView networkView;
    
    internal Dictionary<int, Texture2D> Images = new Dictionary<int, Texture2D>();
    internal Stack<Texture2D> ImageStack;
    internal int PlayerID;

    private IEnumerator OnPostRender()
    {
        yield return new WaitForEndOfFrame();
        var tex = new Texture2D(CameraTexture.width, CameraTexture.height, TextureFormat.RGB24, false);
        RenderTexture.active = CameraTexture;
        tex.ReadPixels(new Rect(0, 0, tex.width, tex.height), 0, 0, false);
        tex.Apply();
        var data = tex.EncodeToPNG();
        Destroy(tex);
        SendTexture(data);
        yield return new WaitForEndOfFrame();
    }

    private void SendTexture(byte[] data)
    {
        if (Network.isClient || Network.isServer)
            networkView.RPC("ReceiveTexture", RPCMode.Others, PlayerID, data);
    }

    [RPC]
    private void ReceiveTexture(int playerID, byte[] data)
    {
        if(Images.ContainsKey(playerID))
            Images[playerID].LoadImage(data);
        else if (ImageStack.Count > 0)
        {
            var image = ImageStack.Pop();
            image.LoadImage(data);
            Images.Add(playerID, image);
        }
    }

The streams themselves perform fine enough, my problem is that the performance of the game itself drops to a nearly unplayable level on the host machine when the match gets to around 5 players (it seems like it forwards the frames fine, but the host player wouldn't really be able to play the game)
Has anyone got an idea about how to optimize this?

stiff thistle
#

Can someone explain to me how this works when you can't have nested networkobjects nor can you have a child networkobject with a non networkobject as a parent?

#

RightHand can't be a networkobject without rightArm being a networkobject, but besides that you also can't have nested networkobjects so what gives? (Unless the player was a scene object but that obviously doesn't work and also isn't expected as the networkmanager has a field for the player prefab)

rugged trout
#

i'm trying to use OpenURL to open the website to where i work. the game i'm making is mostly for the kids, and they get 10 minutes of break for every hour they're there, so i want it to open up the website that they have to go to once they're off break when the break ends. it works fine in a local build, but when it's done through webgl, there's a 403 error, probably because it's a request being sent from an actual website

rugged trout
#

Alright, i used a custom header editor and figured out that it IS the referrer header that's messing things up. i just need to know how to pass custom headers with openurl

#

fuck openurl is external

hybrid lotus
delicate thicket
# hybrid lotus Have you tried to calculate the amount of data that is being sent with that appr...

My problem is that the objects that I want the players to see aren't shared between them
To be more specific, I want to make this mod for the game Keep Talking and Nobody Explodes where each player has a bomb that they defuse
And I just want players to see each other's bombs because this'd be a kind of contest, they don't play in the same scene. The bombs will be very different for each player and are only spawned for themselves

fringe ivy
#

Hey guys, I'm a beginner with unity networking and I wanted to ask what the best networking thing for me to use is?

hybrid lotus
hybrid lotus
delicate thicket
austere yacht
austere yacht
austere yacht
stiff thistle
#

That's what has me confused

austere yacht
#

you can spawn two network objects from separate prefabs and then parent them to each other

#

you cannot spawn a network object prefab with another network object inside it

#

you also cannot parent a network object to a non-network object and expect that to sync

stiff thistle
#

Exactly so unless I literally build the character at runtime (the hand object is a child of arm object which is a child of the shoulder object, etc.) how am I supposed to do it?

#

It just seems so counterproductive

austere yacht
#

you are supposed to build it at runtime (i.e. spawn and assemple in pieces)

stiff thistle
#

I am supposed to connect every limb independently and have every limb be a networkobject?

austere yacht
#

you are supposed to not put network objects on anything but the root object of your entity (player, car, monster, whatever...)

stiff thistle
#

But then I can't spawn an object and reparent it to one of the limbs

#

only to the root object

#

And this image literally has left hand as a networkobject

#

Which is also not possible because it would say that you can't have nested networkobjects or if you were to spawn it in the scene and reparent it to the limb then it would say you can't reparent to a non networkobject

#

So I literally don't see a way unless I were to spawn every limb independently and reparent them with every limb being a network object

austere yacht
# stiff thistle

this image seems to contradict what the docs say about parenting rules in the paragraph above

stiff thistle
#

This is where I found that image

austere yacht
#

A NetworkObject can only be reparented under another NetworkObject (GameObject with NetworkObject component attached). Only exception is moving a NetworkObject to the root of the scene hierarchy.

#

(on the same page you linked) this specifically says that the picture with the tree is incorrect

stiff thistle
#

Yes I know, that's why I'm confused because it's clearly wrong but it's in the docs

austere yacht
#

well, tbh network object parenting is something you shouldn't do anyway

stiff thistle
#

So how would I spawn an item on the hand of the player for example?

austere yacht
#

you would have to spawn those hand-attachments manually and manage the parenting with custom code

austere yacht
acoustic ingot
#

hey

#

iam using photon 2

#

but when i build using this setting speicifcally it doesnt connect

#

on ios

#

but using the "faster run time" makes it work

#

ideas?

patent fog
#

Should still fail if you're using latest version of dots package though

acoustic ingot
#

iam on unity 2021.2.11f1

patent fog
#

Please do a proper backup or use versioning, I don't want to be responsible if your project breaks 😉

narrow palm
#

Good morning :). Quick question from the netcode documentation:

You can select from three different Default Ghost Mode types:

Interpolated - all ghosts Unity receives from the server are treated as interpolated.
Predicted - all ghosts Unity receives from the server are treated as predicted.

Could someone gives me a clear example of what "type" of ghostentity you will rather spawn as interpolated and another as predicted? I have difficulty to understand the difference.

stray scroll
#

Interpolated - Enemies, controlled by server, player doesn't really need to predict them.
Predicted - Physics Boxes/Doors, interacted with by player directly and may look bad if they are delayed interpolated.

narrow palm
#

Thanks @stray scroll

stiff thistle
#

How can I have hundreds of network objects (enemies roaming the map) without crashing the clients?

#

The logic is all server sided (navmeshAgents)

#

But I add too many then the client crashes and it says payload size too small. I then increase it but eventually it crashes again (all the enemies are doing is roaming around)

#

All I'm sending the clients is the transform position, rotation and animations

wintry bluff
#

Are there any free alternatives to Photon Unity Gaming Services and Epic Online Services for Peer 2 Peer

austere yacht
wintry bluff
austere yacht
#

ok, ic, you are looking for a relay service alternative

#

i'd imagine any game networking service has a relay service and offers a free tier, none of them would be completely free

#

PlayFab Party would be an alternative

nocturne jacinth
#

👋 Had a question for those who use ParrelSync. We're moving to a headless dedicated server, from peer-to-peer. I was wondering if people had experience with seperating the server / client logic with ParrelSync. Are you using their arguments to not run the logic on one or the other, or do you have a different way, like a seperate project for the server?

austere yacht
# nocturne jacinth 👋 Had a question for those who use ParrelSync. We're moving to a headless dedic...

options in a single-project client/server architecture are separate but coupled classes for Server/Client/Shared code, partial classes and Server/Client Attributes and Suffixes on all relevant methods and all the server code is wrapped in #if SERVER_BUILD pragmas to prevent it from being distributed as part of client builds, i'm not sure what any of this has to do with parrelSync you'd just flag the clone to behave as server or client through an argument or a start menu or some sort of self-detection or some parrel arguments, whatever server/client means is up to your custom code

nocturne jacinth
#

I feel like I'm not explaining myself well haha

austere yacht
#

you dont need the defines during development

#

they are just for distributed builds

#

they only thing different between parrel clones that you can use is the parrel arguments or stuff you do at runtime (click a button to make it a server/client)

#

but that generally has very little to do with how you architect your code

nocturne jacinth
#

Alright, I'll do some playing around with the arguments then, thanks for the help!

nocturne jacinth
#

Or does the nographics / batchmode on headless builds take care of a lot of that?

austere yacht
#

no, this is just a security thing

#

you do not want to distribute your server code to clients

#

but the server doesn't care if it also has the client code (from a security perspective)

austere yacht
nocturne jacinth
#

Alright, thank you very much!

fringe ivy
#

Hey guys, I'm a beginner with unity networking and I wanted to ask what the best networking thing for me to use is?

fringe ivy
woven violet
#

be careful with tutorials for photon. most of them are outdated and no longer relevant. use the example projects provided by photon to get started.

unkempt flame
#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerController : MonoBehaviour
{
public float moveSpeed = 5f;

public Rigidbody2D rb;
public Camera cam;

Vector2 movement;
Vector2 mousePos;

// Update is called once per frame
void Update()
{
    movement.x = Input.GetAxisRaw("Horizontal");
    movement.y = Input.GetAxisRaw("Vertical");

    mousePos = cam.ScreenToWorldPoint(Input.mousePosition);
}

private void FixedUpdate()
{
    rb.MovePosition(rb.position + movement * moveSpeed * Time.fixedDeltaTime);

    Vector2 lookDir = mousePos - rb.position;
    float angle = Mathf.Atan2(lookDir.y ,lookDir.x) * Mathf.Rad2Deg - 90f;
    rb.rotation = angle;
}

}

how do l make the script work with [Photon pun] help any edit will be fine with me

stiff thistle
#

Is it possible to despawn scene objects and sync when a client spawns later?
For example:

  • Network object in the scene
  • Network object is despawned
  • Client 2 joins the session
  • Client 2 gets the information that the network object was despawned
austere yacht
stiff thistle
#

I tried to do with netcode for gameobjects and it didn't work

#

Despawn only works if the gameobject is spawned instead of being on the scene

#

At least for me, I might be doing something wrong @austere yacht

fringe ivy
woven violet
fringe ivy
#

is this a bad way of initialising the players?

kindred sky
#

Elo boys,

short question, is it a good practice to use for example Google Play store's for authentication only, and then another source for storing and updating players scores, etc ?

odd apex
#

how can i make my fps arms visible to only the client, with the character body being invisible, and then fps arms invisible to other players and only the character body visible? i'm using the default unity netcode package for this.

austere yacht
odd apex
#

Here's what I wrote: ```cs
public class visualClientHandler : NetworkBehaviour
{
[SerializeField] private GameObject thirdPerson;
[SerializeField] private GameObject firstPerson;
void Start()
{
SkinnedMeshRenderer characterMesh = thirdPerson.GetComponent<SkinnedMeshRenderer>();

    if (IsLocalPlayer)
    {
        characterMesh.enabled = false;
    }
    else
    {
        characterMesh.enabled = true;
        firstPerson.SetActive(false);
    }
}

}

austere yacht
whole loom
#

Good evening. I have been searching for answers on whether to use SQL or NoSQL database systems and so far I’ve been getting mixed answers all over. Still, when checked on games such as WoW, FF14 & lost ark they all use SQL (FF14 uses MySQL). I tried searching for Genshin Impact but was unable to find any job postings. The game I am working on is an online RPG game with inventory system, quests, etc. What would you guys recommend?

austere yacht
whole loom
#

That make sense

whole loom
austere yacht
#

yes, no-sql typically is only relevant at massive scales or if you have very specific performance requirements

whole loom
#

Oh ok. Thank you

unkempt flame
#
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
using Photon.Pun;

[RequireComponent(typeof(TextMeshProUGUI))]
public class PlayersConnectedUI : MonoBehaviour
{
    TextMeshProUGUI connectedText;

    private void Start()
    {
        connectedText = GetComponent<TextMeshProUGUI>();
    }

    private void Update()
    {
        connectedText.text = $"{PhotonNetwork.CurrentRoom.PlayerCount}/{PhotonNetwork.CurrentRoom.MaxPlayers} Players Connected";
    }
}
patent fog
#

Is connectedTest assigned in the inspector ?

#

Did you drag a textmesh pro UI element onto it ?

#

Oh didnt see the getcomponent in Start at first xD

#

I should finish my coffee

#

You sure the component is where you expect it to be ?

spice nest
#

How can I update my NetworkManager script from Netcode for Gameobjects?
I'm trying to access
NetworkManager.ConnectionApprovedDelegate which was implemented in the version 1.0.0.
Started to use Netcode for Gameobjects in the beta around version 0.9.3 i guess.
PackageManager is showing me that I have installed the version 1.0.0. Also tryed to Reimport and Refresh the package.

austere yacht
stable kraken
#

how do i check how many clients are connected to a room with photon?

#

with room i don't mean the photon server in my project, i have a system where you can connect to games with a code

#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using Photon.Pun;

public class CreateAndJoinRooms : MonoBehaviourPunCallbacks
{
public InputField createInput;
public InputField joinInput;

public void CreateRoom()
{
    PhotonNetwork.CreateRoom(createInput.text);
}

public void JoinRoom()
{
    PhotonNetwork.JoinRoom(joinInput.text);
}

public override void OnJoinedRoom()
{
    PhotonNetwork.LoadLevel("level 0");
}

}

#

//how can i check if more than x players are connected?

hushed dove
#

What's the best online gaming solution for a 3d card game in Unity?

odd apex
#

oh... oops i had the same script on another object.

stable kraken
odd apex
#

when a client joins a host, the client is put into the inspector along with the actual player. this results in two players in one scene, which duplicates the UI. This also happens on the client side with there being two players int he inspector. Is this supposed to happen?

#

I know how to fix it, but I was just wondering if it was normal for the player clones to be in the inspector for the client and host

spring crane
tepid prairie
#

I'm confused, should I be using MLAPI or Netcode???

#

I'm in Unity 2021.3.0f1

austere yacht
tepid prairie
#

thanks

tepid prairie
#

how does connecting work? the example makes it as easy as csharp if(isServer) { NetworkManager.Singleton.StartHost(); } else { NetworkManager.Singleton.StartClient(); } but i'm skeptical thinking this would work if i sent it to someone

#

it works locally, but would this work globally, or on another computer in the same household?

austere yacht
#

Why wouldn’t that work?

#

as far as your app can control it, connecting to itself or an address at the other end of the world is the same thing

tepid prairie
#

I don't know, I was always told that I'd have to host a master server or send an IP

#

I'm new to networking so I'm pretty confused 😅

austere yacht
#

obviously you need to configure the IP and port

tepid prairie
#

I'm confused about that statement but I appreciate every bit of help you've given me!

austere yacht
#

the network manager and transport need some configuration

#

You can configure those in the inspector

tepid prairie
#

after that, anyone can join anyone from anywhere?

#

at the click of "host" or "join"?

austere yacht
#

Theoretically yes, but they need to be configured with your IP and your LAN must forward traffic to the right PC and port

#

if you want to avoid these NAT issues you can use a relay service

#

in your LAN it will probably work straight away

tepid prairie
#

relay service is paid from what I've seen, though I like it

#

i'm just writing a small game right now for practice before I try to make one of my games multiplayer in the future, since I'm uneducated in networking

#

so it's nothing I would pay for at this point

#

thank you very much for everything, I really appreciate it a lot

#

it's hard for me to grasp new concepts so your patience makes a world of a difference

austere yacht
#

Most relay services offer a free tier suitable for small scale use and development

tepid prairie
#

is it compatible with this new netcode?

#

i've been eyeing unity relay for a while

austere yacht
#

Unity relay is compatible with unity transport and all networking libraries that use it

#

It’s free for 50CCU and 150GB

tepid prairie
#

awesome, thanks! so that could solve my issue with trying to let people automatically find eachother?

austere yacht
#

no, that is yet another service, usually called ‘lobby’ or ‘matchmaking’

#

But you don’t need that if you can have people share their IP/joincode in some other way

#

you can also build one yourself quite easily for a small scale project if you want

tepid prairie
#

I'm going to have to try to sleep on this and see if I don't understand it better when I wake up. I'm trying to figure out what more than an IP and some programming I would need in this scenario at the moment

#

thanks again, i'm heading to bed

spice nest
# austere yacht afaik you subscribe the `NetworkManager.ConnectionApprovalCallback` event and wr...

Do you mean using the new line instead of the old line?

private void ApprovalCheck(byte[] connectionData, ulong clientId, NetworkManager.ConnectionApprovalResponse callback)
    {
        if (connectionData.Length > MaxConnectionPayload)
        {
            callback = new NetworkManager.ConnectionApprovalResponse { Approved = false, PlayerPrefabHash = 0, CreatePlayerObject = false, Position = null, Rotation = null }; //NewLine

            callback(false, 0, false, null, null); //OldLine

            return;
        }
austere yacht
spice nest
#

Ok Thanks.

wanton anvil
#

Hi

#

I tried to make a networkvariable

#

NetworkVariable in question:
public NetworkVariable<int> netMarkerIndex = new();

#

But I keep getting this weird error

wanton anvil
#

Update: After asking around, I've given up on that idea and decided to do something else

tepid prairie
#

does NetworkTransform also synchronize children transforms?

tepid prairie
#

why is it so hard to figure anything out, it feels like even the documentation itself is very vague and sparse

#

wtf

#

I can't even figure out how to connect LAN

tepid prairie
#

I finally figured out how to get someone to connect to me, but they can't be using my router, they must have their own internet. Why is this, and how can this be fixed?

olive vessel
#

You can absolutely connect to a host on your local network, are you using the right IP?

delicate thicket
#

Is there a way to get the UnityWebRTC to work with Unity 2017.4, .NET Framework 3.5? Or is there a cross-platform (Windows, Linux, Mac desktop) alternative for it that I could use to stream the camera target texture to other players?

glossy widget
# austere yacht It’s free for 50CCU and 150GB

Isn't unity relay average 50 ccu instead of just 50 ccu, or something like that?
I'm pretty sure i saw something saying that you only start paying if you get a monthly average of 50 ccu, which means you can have like 250 ccu in the first week of the month and 0 on the other weeks and still wouldn't pay no?

#

Which ends up averaging 50 ccu monthly

olive vessel
#

Yes I think it is an average

wanton anvil
#

What packages and tutorials should I use to make MLAPI work on LAN?

olive vessel
#

Just put a local IP in

wanton anvil
#

Oh, it does?

#

Okay then

solid cipher
#

okay so I'm browsing through the pinned and I'm still running into the problem of feeling a little overwhelmed by all of the options and a lack of understanding of what does what and what is an acceptable approach for my project, a turn based strategy game

forest grotto
#

can i get some help with unity windows dedicated server build i keep geting these errors (URP project and on unity 2022.1.7f1 version and photon fusion is in the project )
Image

spring crane
stiff thistle
#

Does anyone know how can I sync the position of a child object that is controlled by the mouse position of the player? (This object is a child of the playerprefab)

#

I tried with RPC's but it's too inefficient and very stuttery

#

I also tried attaching a network transform to the object but for some reason the server controls that transform even though it belongs to a client

spring crane
stiff thistle
#

Hello, I'm using netcode for gameobjects. What I'm basically trying to do is sync where the player is looking (with the lookat feature of animation rigging).

The animation rigs follow a sphere that is a child of the main camera, so what I'm trying to do is sync the position and rotation of the camera to every client and that would fix it

#

But what happens is that when I apply a network transform to the camera it doesn't work at all

#

I also tried using RPC's but I'd have to use it on the Update() method and I assume that would overload the server with many clients connected?

weak plinth
#

Hi, just wanted to ask what would be the best networking solution for a simple CCG like this: https://www.youtube.com/watch?v=ZHc4QrcljiI

I was thinking of having Node.js handle logins, matchmaking and game state, while having MongoDB handle account info, decks, collected cards etc. but I'm unsure if that's viable.

Subscribe to Me: http://goo.gl/Xq7EG
My Blog: http://goo.gl/qPiBe
Twitter: http://goo.gl/GjHNP
#game #GamingMole ---------------------------------------------------------------------
Subscribe to Me: https://goo.gl/Jb4xtm
Most Recent Upload: https://goo.gl/CcnPeH
Most Popular Upload: https://goo.gl/id51qE
Twitter: http://goo.gl/GjHNP
-------...

▶ Play video
#

Other option would be Mirror + Playfab.

empty night
#

Hello networking channel

#

How can I show the same scene to 2 players on different devices at the same time

austere yacht
weak plinth
#

Hello

#

can anyone help me

#

?

empty night
austere yacht
empty night
weak plinth
#

I do have a game

#

multiplayer one

empty night
#

Player 1 and player 2 will see it and who ever gets the right answer first gets the point

weak plinth
#

but don't know how to setup

#

networking

#

🤷‍♂️

#

Someone help me

#

Oh wait

#

I'll do

#

i don't know to setup networking

#

for multiplayer

#

🤷‍♂️

weak plinth
#

i got it

#

but

#

the probelm is

#

The host is only updated

#

nd the client is like a kinda of shakking

#

nd not moving as well

#

@weak hull

weak plinth
#

Yeah

austere dome
#

How do i make transform over network?

limber holly
#

hello, Im working with PUN2 and I try to understand. I have a problem, I have 2 players et 1 enemy, the first player who join the game is the masterclient and then all GameObject with PhotonView owned by him. when my enemy die, the GameObject is destroy: if the first player kill him, no problems, but if the second player who enter the game late kill this enemy, I have error and he can't Destroy the gameObject. Someone know a good method for this problem ? thanks

dense tartan
limber holly
#

ok didn't know, some month I working on it

#

but I would like to find something in the net for understand the way to create a game server

austere yacht
weak plinth
#

working on unet

#

on unity 2018

#

Nd I'll upload the clip soon

limber holly
#

thank you so much

obsidian crest
#

its not working

i have 3 buttons, red, white and blue.
when you click them voids will be activated. when you click, it works perfectly in your client. but in server and other clients it's not

obsidian crest
#

yes

woeful isle
#

Anyone can help with fixing PHOTON: player can spawn (setactive) and despawn a circle that is a child of that player object, other player cannot see the first one enabling or disabling the circle?
the other player just doesnt see the change and if rigidbody is moved, then it moves back

#

Please, I need to upload my game

austere dome
#

Is there way to load scene for client only. like when i press a button on server the scene of the client will be changed but not on server

dry iron
#

Guys, I wanted to ask about something. So I have finished a photon pun multiplayer game and it has like some problems with the connections and I'm assuming it is because I haven't open a server yet. So what are the procedures that I need to do in order to open a server for the game and test the connections? And thx 🤗

olive vessel
#

Usually you just tell it to make a room and join it

#

You have to be connected to the master server to do that, but you should already be connecting to it

dry iron
#

It's making a room and doing everything, is that means that it's already connected to a server? Like am I ready to publish?

#
  • it sometimes has like some sort of lag or latency in order to show the player what others are doing what's with that?
olive vessel
#

Have you tried to connect two clients to the same room?

dry iron
olive vessel
#

Check you're on the right region

dry iron
#

Well, I am not 😅

wary gorge
#

so im using pun2 for multiplayer and when i actually instantiate it with photon than the graphics suck, but when i just use the same exact prefab by just dragging it into the scene, it looks good:

#

any help would be great