#archived-networking

1 messages · Page 78 of 1

austere kiln
#

Why is this happening?

jade glacier
#

Without seeing, I would suspect a bug in your code somewhere.

#

Does that happen for you with any of the tutorial scenes?

#

@austere kiln

#

Also would be good to turn up your logging settings for pun2, to see if you get any kind of messages as to why.

austere kiln
#

I've posted the scripts, will they be enough for checking? Cause I'm really stuck and have no idea what's causing it

#

@jade glacier

jade glacier
#

I can only see what I see here (busy working so I can't really dig into your project) - you are going to have to do the usual debugging involved in these things.

Do the demo scenes exhibit this behavior?

#

you are doing some not-beginner stuff there with scene changes and such, so I would add that code very slowly to a working one scene project and see what breaks it.

austere kiln
#

I've updated the scripts abit and I'm about to post the same question in Photon Engine Server

#

Let's continue there

jade glacier
#

Best to not cross post, I would pick a channel and stick to it there. Many of the networking channels are the same people and it generally is frowned on cross posting like that, and will likely get you ignored.

vapid leaf
#

so i dont know if this is too advanced for multiplayer for me at this moment but basically im making a game where you can switch in between characters with different abilities (Kinda like the lego games) and i dont want more than one player to be the same character. I tried using mirror and it didnt really work the way i did it. Does anyone know any good programs and the gist or any tutorials that know how to do that?

vapid leaf
#

One program i was thinking about using was photon bolt for peer to peer co op

spring crane
#

I don't think switching the networking solution is going to help here

gleaming prawn
#

Agree with the above

#

Either of these API/SDKs would work... You need to take your time, understand a bit better what you are doing, etc.

#

(As a photon engineer, I could be pushing for Bolt) There's nothing particularly wrong with Mirror for what you are trying to do.

hard badge
#

hi guys

#

just wondering

#

what is the best networking solution for a physics based game?

#

that uses active ragdolls that will be interacting with one another alot

jade glacier
#

Quantum really will be your only option. Since what you are describing really doesn't play well with state interpolation, which is what you will be starting with using Pun2, Mirror, or Bolt. @hard badge

#

If this is your first networking rodeo, I would NOT start with that type of game.

#

Unless you have funding and can get into Photon Quantum.

hard badge
#

alright thank you

vapid leaf
#

I was using mirror and the thing is that the buttons were not able to be pressed. I already have some of my game that was done offline and I have a script for my camera with the 2 lines about cursor.lockstate and cursor is visible which is why it probably doesnt work. All of my scripts written derive from monobehavior and im worried im gonna have to rewrite all my scripts to fit with the server

#

This is all I have done rn

tired solstice
#

Any idea on how to achieve peer 2 peer multiplayer hosting? I’m familiar with UNET and Photon, but then I’d need to upgrade photon for more players.

vapid leaf
#

^

whole granite
#

Hi guys. Does the Unity's Transport API has some sort of reliable message queue/buffer?
Basically you cannot send more than 32 reliable messages through the pipeline, as it will end you with an error and the message to be not guaranteed to be delivered.

Tho, simple buffering of these messages for later sending (i.e. wait for the queue to get some free space), would probably make it a lot more reliable.

cedar cloak
#

can somebody help me figure out how make a pickup script?

#

I'm trying to do an healthpack and I want that when the pickup enter in collision with a player, THAT player execute a "GainHealth" function

jade glacier
#

Be sure to indicate the net library, since answers will vary based on the authority model @cedar cloak

cedar cloak
#

i kinda did it right but photon "crashes"

jade glacier
#

not sure what crashes in quotes means

cedar cloak
#

Cannot send op: 253 Not connected. PeerState: Disconnected
UnityEngine.Debug:LogError(Object)

#

this happens few seconds after I interact with the pickup

jade glacier
#

Sounds like maybe something in your code caused a flood of data that forced a kick maybe? Do yo have a loop that this creates where it calls the same RPC over and over?

#

I would turn up the pun logging settings to get as much info from the networking layer as possible

cedar cloak
#
 private void OnTriggerEnter (Collider other)
    {
        if(other.attachedRigidbody == null)
        {
            return;
        }

        if (other.attachedRigidbody.gameObject.tag == "Player")
        {
            other.attachedRigidbody.GetComponent<InputController>().UnlockWeapon();

            photonView.RPC("Disable", RpcTarget.All);
        }
    }
#

this is the script, it's pretty basic

gleaming prawn
#

I assume you are connected

cedar cloak
#

I am

jade glacier
#

And disable has no arguments?

true gate
#

am in dire need for a networking expert to look at my game code and consider how much it gonna cost to add multiplayer function

gleaming prawn
#

Basic answer:

  • multiplayer is not a function. You create your game from day 1 as multiplayer online
  • otherwise, very likely it will NOT work, or will be just BAD
#

You may find "experts" to fake something for you though...:)

#

Good developers will pretty much say the same I said (can be done, re-creating the game considering multiplayer this time)

true gate
#

where can i find such developers to hire ?

gleaming prawn
#

There a few here... Most already have stable jobs, I assume

#

It's like any other profession, if you have a good position available, that pays well, you'll get what you pay for.

#

Here we mostly discuss technical aspects between developers... If you have a clear job description (I already know it's indeed related to Networking/Multiplayer), post the link here... Should be fine.

true gate
#

i have 40mb mobile game btw

vapid leaf
#

so i have this idea where you set the player prefab as an empty game object on a menu like screen where you select an actual character but if the movement scrpts are already active from another player you cant select them and then the camera transitions over to the character you selected. the only thing im worried about is idk how im gonna make it so that it doesnt interfere with cutscenes and stuff like that. does anyone else forsee any probs with this?

#

using mirror btw

gleaming prawn
#

What do you mean by 40mb @true gate ?

#

40 Megabytes, Millions of Downloads?

true gate
#

40 Megabytes

#

i need someone to look at my project scripts and figure how much it will take to add multiplayer to iOS and andriod

#

i will pay by the hour

gleaming prawn
#

40MB have absolutely no meaning here... Have no idea why you said this...:)

#

It just says you have textures/models that bake as a 40MB build... Unrelated to whatever networking would be...

trail parrot
#

Hi all. This is for UnityWebRequest

How can i fetch content including what's in the scroll downs? Like facebook wall

gleaming prawn
#

??? Are you experienced with web development?

#

A scroll is normally done with multiple dynamic requests as scrolling is done

#

You never fetch the whole at once...

#

It would not be different at all with unity... Do several paged requests resulting in JSON data (or anything else)...

vapid leaf
#

so i have this idea where you set the player prefab as an empty game object on a menu like screen where you select an actual character but if the movement scrpts are already active from another player you cant select them and then the camera transitions over to the character you selected. the only thing im worried about is idk how im gonna make it so that it doesnt interfere with cutscenes and stuff like that. does anyone else forsee any probs with this?
using mirror btw

prime dawn
#

Hello I have a problem with Photon Networking

#

This is my scritp that I attached to the player networking prefab

#

look at line 21

#

It's supposed to display players nickname above the prefab

prime dawn
#

I fixed it

#

nvm

slim ridge
#

Anyone know about Socket.SendTo and memory allocation?
Every once in a while i see 22 allocations happen in my sending thread and the profiler claims it was done by Socket.SendTo. Is this normal?

weak plinth
#

what would be the best way to create randomly spawning items? would it need its own photonview to sync its position?

jade glacier
#

Not necessarily the best, but that would be the easiest.

jade glacier
#

Which engine?

#

Unet is pretty much dead, so I would first consider switching to Mirror, and joining their forum.

#

They might have some kind of master server option, which you will need if you want a master list of active games.

#

Mirror Discord is the place to ask.

gleaming prawn
#

You are talking about orchestrating server creation/spinning up (in case of dedicated servers)

#

This is normally sold as service by providers like amazon Gamelift or Unity's Multiplay...

#

If you are talking about creating a server with your local computer, then check if mirror offers a relay + punch service somehow (I think they do), so players can host servers in their own PCs

#

In either case it's not "a button", but rather part of your full solution (several services + code to coordinate this)

jaunty timber
#

Does mirror work just like Unet?

vapid leaf
#

So i was able to get the multiplayer to sync up and now your able to join servers for MIRROR but now i have the problem that the player can still switch to another character. The reason why this is is because i have an if statement that states if the movement script is enabled you cant switch to that character but for some reason on of the players games will say that the script is on and the other will says its off meaning that 2 players can play as one player and essentially possess the other player. Does anyone have a way so that if the script is off for one players game its off in all the other players and vice versa?

#

i want players to be able to switch between different playable classes like the lego games but for some reason you can have 2 players as one character which creates development console errors that say "null reference: object reference not set to an instance of an object" or something like that

weak plinth
#

Hey everyone, I'm using a unity implementation of SimpleJSON.
I'm trying to construct an array of two values called Parameters, but it loses the Key value inside the array, any idea what I'm doing wrong?

JSONObject jsonobj = new JSONObject();
        jsonobj.Add("name", inputCompanyNameField.text);
        jsonobj.Add("type", inputCompanyTypeField.text);
        jsonobj.Add("abreviation", inputCompanyAbreviationField.text);
        jsonobj.Add("location", inputCompanyAbreviationField.text);
        JSONArray parameters = new JSONArray();
        parameters.Add("product", "myvariable");
        jsonobj.Add("parameters", parameters);
        var payload = jsonobj.ToString();```

Returns: ```
{"name":"name","type":"Type","abreviation":"abreviation","location":"abreviation","parameters":["myvariable"]}```

**parameters:[] the key of the array is missing and only showing the value.**
polar fossil
#

Hello,

I'm trying to get GRPC to work on Unity on HoloLens2.

Current status:

  1. Manually compiled a windows arm64 version of grpc_csharp_ext.dll (it came out in version 1.29.1). The reason for manually compiling: the grpc binaries do not include a windows arm64 version of grpc_csharp_ext.dll.
  2. Used this version of unity grpc package: https://packages.grpc.io/archive/2019/10/8853754e8caa0b2ffb3ab0e25514f3f7612ebf7a-d6090f79-7b70-429d-a477-9df736e4941a/index.xml
    • this is listed as 2.25.0, which I'm assuming refers to grpc 1.25.0
  3. Build works in unity, and in the il2cpp project. The current exception on the HoloLens2 is attached.

Trying to resolve this, I have two possible directions:

  1. Try to make the code find the dll (which is in the same dir as the .exe file),
  2. Fix the version mismatch between grpc_csharp_ext.dll and the grpc package.
    • note: tried using the a more advanced unity package (2.29.0), and it seems to be not working in unity (even before trying to add HoloLens2 into the mix). I did manage to get 1.25.0 working in unity (as well as in HoloLens1)

Any help would be much appreciated.

stiff ridge
#

This is normal. Done by design. The regions are separated from one another.
Use less regions, in doubt.

cedar cloak
#

are PunRPC methods called globally or do I need to specify the script where it is?

fresh bone
#

globally iirc

cedar cloak
#

so i dont need static?

spring crane
#

@cedar cloak It's done relative to the PhotonView you are targeting.

cedar cloak
#

ok I have an issue so ill ask specifically

#

in a multiplayer match I need to clear objects that players drops by dying during the preparation match at the start of the "real" match

#

should I send a PunRPC method to all that basically destroy all these objects?

spring crane
#

Drops should probably be scene objects, which can just be destroyed by the masterclient

cedar cloak
#
[PunRPC]
    public void ClearDrops()
    {
        GameObject dropGroup = GameObject.Find("Circle/Map/Drops");

        foreach (Transform child in dropGroup.transform)
        {
            GameObject.Destroy(child.gameObject);  
        }

        Debug.Log("Drops Clear");
    }
#

this is my actual script

spring crane
#

Ah they don't have photonviews?

cedar cloak
#

they have

#

so should I just send that to the master or change aproach?

spring crane
#

Then you should probably use the destroy method in Photon, which should be synced automatically

#

You would do something like that when the objects don't have photonviews

cedar cloak
#
photonView.RPC("ClearDrops", RpcTarget.MasterClient); 
#

so something like this?

spring crane
#

Yea that should do

cedar cloak
#

ok it solved it

#

nvm is got fixed only on master side

#

maybe it isnt owned by the scene

#

it is, heck

spring crane
#

@cedar cloak Again, are you using the destroy method in PhotonNetwork?

cedar cloak
#

yes

#

is it wrong?

spring crane
#

No

#

How are you spawning them?

#

Spawn method in PhotonNetwork?

cedar cloak
#

with a normal instantiate

spring crane
#

Try the Photon equivalent

#

Don't remember exactly what it is called

cedar cloak
#

oh its PhotonNetwork.Instantiate

#

i dont even knew that existed

#

does it instantiate that obj on all connected machines?

spring crane
#

Yea. That should integrate a bit better with Photon than plain Instantiate.

jade glacier
#

Yeah, that is the expected way to spawn things with Photon. You have been trying to manage that process yourself?

cedar cloak
#

Acutally for now I just stopped developing for the day, its 00:10 here and I wasted all day trying to fix that

#

I know, that happens quite often, I'm just chilling out for now and waiting tomorrow for doing it

jade glacier
#

Be sure to do the tutorials before trying to get too far. Guessing like you are doing is going to burn a LOT of time.

cedar cloak
#

agree

#

i actually started with a long tutorial series but that got interrupted and I got the curiosity to try new things by myself

#

turns out multiplayer is 10 times more complicated than i expected

#

even because there's no much community around that and so there are few people that can help with these specific probles

jade glacier
#

Networking games is probably THE hardest part of game dev.

cedar cloak
#

luckily on this discord people always ask ^^

#

Its time to go for me now, cya guys have a good night. I'll probably back tomorrow for more dumb questions 😄

weak plinth
#

What’s the limit when it comes to photonviews? How many before it lags the game

vivid owl
#

how would I handle matchmaking?

cedar cloak
#

How can I setup a skin (material) systyem?

#

the problem is that iirc it's messy to change prefab color at runtime and I cannot unpack the player obj since it's needed for isntantiation (respawn)

gleaming prawn
#

all clients must have the prefabs with the right colors (or possibility to change material sikn colot-tint) - this can also be done with asset bundles, etc

#

Then, when you instantiate, you include the information about the right skin to be loaded, etc.. (you definitely can switch materials, models, etc)

#

There are several different ways to setup such system... But it will be hard to find someone to just write one for you for free.

whole granite
#

Hi guys.

Does the Unity's Transport API has some sort of reliable message queue/buffer?
Basically you cannot send more than 32 reliable messages through the pipeline, as it will end you with an error and the message to be not guaranteed to be delivered.

Tho, simple buffering of these messages for later sending (i.e. wait for the queue to get some free space), would probably make it a lot more reliable.

gleaming prawn
#

They are probably using an Int32 bitmask for ACKing

#

that's whyt the 32 queued message limit

jade glacier
#

What are these messages your are sending? At a glance it sounds like you are trying to make Unique packets out of each "message"? Rather than serializing a bunch of stuff into a byte[] and making that one message? @whole granite

#

I have no idea what the Unity transport does for batching and such.

whole granite
#

Yeah, let say that I want to send more than 32 packets over reliable pipeline. It's totally edge case, tho.

jade glacier
#

That is some 32000+ bytes worth of data if you are making efficient use of your packets

whole granite
#

Well, technically you don't have to send that much data over single packet (i.e. <1400bytes).

jade glacier
#

A single packet for UDP is more going to be in the byte[1200] range to keep it within MTU

#

I assume that 32 packet cap resets once you flush the transport?

#

I am not familiar with that restriction, so not sure what it relates to. Typically with transports you just send, and it keeps pushing them out the door. A mask implies that it is batching your writes into datagrams or something. I really have no idea. I avoid the transport layer. That just all sounds a bit odd.

gleaming prawn
#

they probably also slide the window

#

so it keeps shifting the bits as soon as an ack happens, etc

jade glacier
#

That would make sense.

graceful zephyr
#

it can only have 32 reliavble packets 'in flight' at once

#

which is laughabily small

#

@jade glacier

jade glacier
#

I assume that is atypical?

graceful zephyr
#

depends on the game, but it makes the library basically useless for reliable sends

jade glacier
#

If they were going to be lazy, why not back it with a uint64 at the very least?

graceful zephyr
#

it's too little tbh, it needs to handle these cases well

#

just one simple thing

#

I want to send a map from server to all clients when they join, if the map is larger than 1200 * 32 bytes ... i can't.

jade glacier
#

That seems pretty fragile yeah

#

If you want bigger you have to build in some kind of metering method that "feeds" the transport slowly and waits for acks?

graceful zephyr
#

yes which is just...

#

that's what the transport should do

jade glacier
#

defeats the abstraction yeah

#

I would expect my transport to be fire and forget

graceful zephyr
#

yes

jade glacier
#

weird.

slim ridge
#

or stream the map with tcp

graceful zephyr
#

yes but that's just

#

then you're adding another complexity

#

it should handle that easily no problem

#

but it doesn't

jade glacier
#

This is the current transport layer of the netcode library?

graceful zephyr
#

yes

jade glacier
#

oh boy.

weak plinth
#

what would be the easiest way to handle randomly spawning objects?

#

like events to happen in the map

gleaming prawn
#

In which library?

#

Your question is way too broad

weak plinth
#

sorry, i cant find the right words

#

what im trying to do is spawn an item at a random position on the server side, instead of the players

gleaming prawn
#

What is the library?

weak plinth
#

i just wanna start off with 1 object to spawn

#

as i have no idea what a library is

whole granite
#

Yeah, that is why I asked about that queue/buffer thingie. @jade glacier @graceful zephyr
Dunno, but I'll probably make my own "feeding" mechanism. But it would be nice for Unity to support this, tho...

#

Probably I'll post something on the forums.

weak plinth
gleaming prawn
#

So, library is photon

#

Best way would be, get a random position, network instantiate from the master client, I'd say

#

If you don't know what that means, than I'm not sure I know how to explainm

weak plinth
#

i understand that, any help on my error though?

gleaming prawn
#

Your code, line 29 of that script is trying to call functions in a null reference

#

Should be self explanatory

weak plinth
gleaming prawn
#

We'll, it's your code

#

Probably photon view is null?

#

Debug the code

weak plinth
#

that was it, thanks

weak plinth
#

Guys

#

Help please?

#

how i can duplicate a object

#

properly with PhotonView

#
        private void CloneGameObject(GameObject GameObject)
        {
            DebugLog("Found A Test GameObject  :" + GameObject.name);
            var obj = PhotonView.Instantiate(GameObject, CenterOfPlayer() + DistanceVector, Player.field_Internal_Static_PlayerField_0.transform.rotation);
            if (obj != null)
            {
                obj.transform.SetParent(null);
                DebugLog("Spawned A Copy Successfully!, cloned " + obj.name);
            }
            else
            {
                DebugLog("Failed to clone object, is null!");
            }
            return;
        }
#

this is how im instantiating the object

#

but

#
ArgumentException: An item with the same key has already been added. Key: 55
  at System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) [0x00000] in <00000000000000000000000000000000>:0
  at System.Collections.Generic.Dictionary`2[TKey,TValue].Add (TKey key, TValue value) [0x00000] in <00000000000000000000000000000000>:0
  at ̊̊̈̊̈̊̈̊̈̊̊̈̊̊̊̈̊̊̈̈̈̈̊̈̊̊̈̊̊̈̈̈̊̈̈̊̊̊̊̊̈̊̈̈̊̈̈.̊̈̊̈̊̈̊̈̊̊̊̊̊̈̈̈̊̊̈̈̊̊̊̈̊̊̈̈̊̊̈̈̈̈̈̈̊̊̊̈̊̊̈̊̊̈̈ (Photon.Pun.PhotonView ̈̊̊̊̊̈̈̊̊̈̊̊̊̈̊̊̈̊̊̊̈̈̈̈̈̊̊̊̈̈̊̊̈̊̊̊̊̈̊̊̊̈̈̈̈̈̊) [0x00000] in <00000000000000000000000000000000>:0
  at Photon.Pun.PhotonView.Awake () [0x00000] in <00000000000000000000000000000000>:0
  at UnityEngine.Object.Instantiate (UnityEngine.Object original, UnityEngine.Vector3 position, UnityEngine.Quaternion rotation) [0x00000] in <00000000000000000000000000000000>:0
  at UnityEngine.Object.Instantiate[T] (T original, UnityEngine.Vector3 position, UnityEngine.Quaternion rotation) [0x00000] in <00000000000000000000000000000000>:0
UnityEngine.Object:Instantiate(Object, Vector3, Quaternion)
UnityEngine.Object:Instantiate(T, Vector3, Quaternion)
#

there's this error

jade glacier
#

Instantiate takes the name of the gameobject, and uses that name to find the Prefab in a Resources folder. What you are doing there looks like its trying to do something different. Can't comment on the error, since I can't see the trace of what line in cs is causing that.

weak plinth
#

the error pops up

#

when you try to instantiate with UnityEngine.Instantiate

#

because the cloned object in photonview has the exact same key and it doesn't allow it

#

soo the object is not grabbable at all

#

but the original one is it.

jade glacier
#

You are trying to do something that Instantiate isn't really meant to do is what it looks like at a glance.

weak plinth
#

yeah

#

how im supposed to instantiate a gameobject then?

jade glacier
#

By putting the prefab in the resources folder at design time

#

that way all clients have the exact same prefab to work with

weak plinth
#

.... is a mod boi, the client has a API that im using

jade glacier
#

Can't speak to that

weak plinth
#

but when im grabbing the object

#

it doesn't let me interact with it

#

because of that error

jade glacier
#

Not sure what grabbing the object means, but that is something outside of the Photon networking problem it sounds like.

#

I wouldn't be trying to "grab" anything while you have a critical error.

weak plinth
#

is not a critical error if the object shows up

#

but photonview doesn't allow me to interact with it.

jade glacier
#

If you have red text in log, you have a problem you are going to want to resolve first

weak plinth
#

that is a white error, not a red error luckily

#

but is annoying that i can't interact with it and i want to fix that

#

if there's a way to convert that object into a prefab throught script i would do that

jade glacier
#

I mean, yeah - you got some bugs to work out.

#

You can get into instantiation with your own RPCs

#

and not use the PhotonNetwork.Instantiate

#

But you will need to send all info that is required to other clients.

#

nothing just "replicates", you have to parse out what info is needed that other clients won't know about the object, and send that, and apply it on them manually.

weak plinth
#

yeah, but RPC doesn't have much

jade glacier
#

Typically you try to avoid that, and make your prefab that you spawn from standard. Then you only send messages about "variations" to that object.

weak plinth
#

how im supposed to clone a object with RPC?

jade glacier
#

by deserializing and serializing whatever needs to be to make that happen. It isn't basic and will require some understanding of object serialization and such.

#

You generally don't "clone" objects with networking. You typically have a starting prefab, and then you just network changes to that prefab... such as color, mounted weapons etc.

weak plinth
#

is a test

#

is a ball

#

not much rn

jade glacier
#

Is your ball a prefab in a resources folder?

weak plinth
#

is made with script

#

not in the editor

jade glacier
#

Then you are pretty much on your own yeah. That is outside of the MonoB tools that Photon gives you to work with. You will need to write your own serialization and deserializaton probably.

weak plinth
#

C_C

jade glacier
#

You can make your own instantiation methods and such, but its all going to be a bit more advanced than PhotonNetwork.CloneMyThing(mything)

weak plinth
#

..........

#

WHY

jade glacier
#

Why what?

weak plinth
#

Why is soo hard

#

the error says the object already exists in a list

jade glacier
#

Because serializing undefined GameObjects is not trivial

#

If you have produced an object on all clients that you are treating as the gameobject starting point, you can instantiate that and then make variations to it.

#

But none of this is trivial.

weak plinth
#

is possible to destroy that object from photonview ?

#

since that is the only issue with instantiated gameobject, that photonview interferes

jade glacier
#

I have no idea, I don't know what you have going on. Anything is possible with coding though.

weak plinth
#
        private GameObject RemovePhotonFromObject(GameObject originalobj)
        {
            var PhotonLessObject = UnityEngine.Object.Instantiate(originalobj);
            if (PhotonLessObject != null)
            {
                PhotonView[] photonViews = PhotonLessObject.GetComponentsInChildren<PhotonView>(true);
                if (photonViews != null && photonViews.Length > 0)
                {
                    for (int i = 0; i < photonViews.Length; i++)
                    {
                        PhotonView pv;
                        if ((pv = photonViews[i]) != null)
                        {
                            UnityEngine.Object.DestroyImmediate(pv);
                        }
                    }
                }
                return PhotonLessObject;
            }
            return null;
        }
#

but it doesn't work perfectly

jade glacier
#

can't say, too much code not in front of me to say if you are on a good path or a bad one.

#

You are just definitely not doing a standard PN.Instantiate() here.

#

PhotonView.Instantiate() is not a thing btw

#

You is just GameObject.Instantiate() ... it is derived from MonoBehavior so you are just seeing the MonoB Instantiate method there.

#

PhotonNetwork.Instantiate is what you use for network instantiation.

weak plinth
#

Yeah, but it asks for a prefab

#

this game aint using prefabs

jade glacier
#

I'm not sure what your question is really sorry.

weak plinth
#

@jade glacier i got a different error right now

#

i figured how to set the object's viewid

#

ApplicationException: NetID disagreement on TOY_BeachBall(Clone)

frosty crystal
#

Hello. What do you prefer to use? Azure or Google Play services to keep data

weak plinth
#

You probably shouldn't be destroying photonviews from objects. Can't think of a logical reason why this would be something you do

weak plinth
#

im trying to add different skins into my game, but they're always the same or dont show at all

tall storm
#

Hi

#

I am using addressable in my project

#

And i am using a bucket on aws to store my updates

#

I want to ask if i can use my own server
Cause i have a website and 100 gb free space on the web

#

Can i use that to download updates in my game

crimson zephyr
#

Hu

#

Hi*

#

What is the most recommended way of making a multiplayer game?

tall storm
#

@crimson zephyr try making it playable for more then one person at the same time

frosty crystal
#

Hello. My level is being creating by scripts. How can I implement the same scene to my remote player? (Pun2-Photon) I do not know how to google for this topic. Thank you in advence.

sterile ore
#

cannot resolve symbol NetworkBehaviour, why?

cedar jacinth
#

Hi I’m in unity 5.6.0 and I got problem I’m coding a multiplayer game in unity and it’s multiplayer both characters work and can move independently on the client but only the lan host registers on all screens btw it’s C#

cedar cloak
#

how can I just create a "normal offline" room using Photon? I need to create a tutorial scene but since now is all tied up to Photon services it's really hard to do a stardand scene

weak plinth
#

just remove all the photon stuff related to the room

cedar cloak
#

problem is that the player is linked to photon references too

gleaming prawn
#

Isn't there the offline mode?

#

I remember PUN classic has it

#

Not sure about PUN2

#

With Offline mode you can just use the code as it is, it will work the same as a local regular unity game

#

Maybe @jade glacier or @stiff ridge can chime in...:)

weak plinth
#

hope so 🤞

jade glacier
#

I would start by reading about offline mode yeah, see if it's what you are looking for.

cedar jacinth
#

Unity 5.6.0 : my problem that I posted about was never solved so I’m going to post again in more detail.
My lan character is registering movement across all connected games I had 3 games open and the lan seemed to be moving on all but when I moved on a client it’s movement only registered on its own screen

gleaming prawn
#

Unity 5.6: which library are you using for this?

#

Is it PUN/Photon, UNet, etc?

cedar jacinth
#

Library?

#

Sorry @gleaming prawn is really new to code meaning player movement which I wrote 2 days ago was my first working piece of code

gleaming prawn
#

What is the networking livrary you are using?

#

There are several different ones...

#

My lan character is registering movement across all connected games
You must be using some networking solution to have this.. Was it the old, abandoned UNet (the last official attempt from Unity to create a default networking package)?

#

If it's anything official from Unity, you'll probably not have any help here (UNet is not supported anymore, was never finished... There's an open source project which took the original UNet and moved on - called Mirror)

#

I suggest you study a bit more, and also: upgrade from 5.6 at least to one of the LTS versions, either 2017.4 or 2018.4

#

IMHO

frosty crystal
#

Hello. I could not find the solution. Thanks in advance for your responses.
In pun2, In my scene, the game is being creating by script as random. How can I implement exctaly the same room to my remote player? Should I transfer gameobjects to remote client? If it is, how? If there is another solution how? just giving a header to google it is enough for me. Thanks.

jade glacier
#

Have you done the tutorials for Pun2? (I assume you mean Pun2 when you say Photon).

#

They demonstrate network instantiation of objects and how you should be doing it.

frosty crystal
#

Have you done the tutorials for Pun2? (I assume you mean Pun2 when you say Photon).
@jade glacier I did not watch tutorials associated with that I think. check it out now.

jade glacier
#

I wouldn't watch them, that won't really drive home how things work well enough. You really want to complete a few tutorials before trying anything of your own. You won't guess correctly.

spring crane
#

@frosty crystal If you mean world generation, you probably wanna use some sort of seed as the base for the randomness. You can then just send the seed and let each client do the generation

#

At least the static parts

spice steeple
#

I have a question, I don't know if any of you ever used mirror (multiplayer package), but I'm trying it out right now and I was wondering how do you host a server on your PC using and ip instead of localhost so other people that are not on our network can also join

gleaming prawn
#

you should join their own discord

spice steeple
#

Smart I'll do that right now

gleaming prawn
#

But what you are looking for is punch-through + relay fallback options. I think they have this through some third party software

drowsy owl
#

You can also have them connect to your public ip, the host will need to port forward the port you are receiving connections on

gleaming prawn
#

port forward, you mean with the router?

spice steeple
#

Interesting, how would i go about port forwarding, is it hard?

gleaming prawn
#

This is not recommended at all for several several reasons, but sure.. If it's just a playground thing

#

you need to configure in the Router

#

It's very "nerdy" to do this, as UpNP (a protocol for automating that) is unsafe and almost not supported anymore AFAIK.

#

Modern method for this is STUN punch through

#
  • relay fallback
#

It is what Steam networking and Photon Bolt both use...

#

Port forwarding should be fine for some basic testing.

spice steeple
#

do you maybe have any video or article on this topic that i can read on so I understand it a bit more because its my first time trying something like this

#

would u say that port forwarding is easier but unsafe?

gleaming prawn
#

if this is first time, I'd not start with it

#

It's NOT easier... It requires you to configure in your router

#

SO there's no "google it" that's generic... Each router has it's own user manual

drowsy owl
#

Yeah, for an actual game you wouldnt want to force your users to port forward because it needs to be done on your router, I remmember having to learn how to port forward to make a minecraft server for my friends back in the day. For if you want to skip the fuss for some playground stuff like Erick mentions, then portforwarding will be easier than doing NAT punchthrough

gleaming prawn
#

And it will only work IF your ISP gives your router a real IP (some use double nat now, which makes things more complicated)

#

Easy is relative...:)

#

For a first timer... Photon is easier... Honestly... Mirror is easy for the LAN case though

spice steeple
#

ah ill try to use photon then see how that goes

#

Thanks for the tips

#

means alot

gleaming prawn
#

But you should join Mirror's Disrcod

spice steeple
#

Yea did that right now

gleaming prawn
#

they might answer you with more details

drowsy owl
#

Looks like for mirror it is not out of the box, you need to do the NAT punchthrough yourself. I bet somebody on the mirror discord already has code you could use though

spice steeple
#

Thanks ill look around in there discord

frosty crystal
#

@frosty crystal If you mean world generation, you probably wanna use some sort of seed as the base for the randomness. You can then just send the seed and let each client do the generation
@spring crane I see. But ı want to do it randomly. Let me explain. as you see in the picture below, I want to make all the boxes randomly. But I dont know how to do. If I do it randomness how do I do?

#

When I do it randomly how can I send all the game objects to remote clients. If there is no solution, how can I do with seed without using random.

#

In the documentation mentions about sending seed and changing custom room properties, so the clients can implement with in their own scene.

gleaming prawn
#

You should definitely just send the seed, and generate the same random sequence, hence the map as well, in all clients

#

Also, Bomberman is a good example of a game that works well only with deterministic predict rollback (aka rollback netcode). Using interpolation in Bomberman is sacrilegious

#

:)

#

Trying to sync info about all these boxes is overkill, just use determinism....:) Specially because you should definitely not use physics engines and shit like that for such game, it's grid based, very.clean and straightforward implementation.

#

So, I'm more than familiar with the genre/topic.

frosty crystal
#

Oh my gosh

#

amazing

#

I will play now 🙂

gleaming prawn
#

There are not many players, so chances are you'll only play bots...

frosty crystal
#

Ok. Erick, I have a question, I am kind of new in unity.

#

After every boxex's instantiation, I will determine the type of the box, and add to a dictionary, Right? After all, to the hashtable...

gleaming prawn
#

You need to guarantee your random is deterministic in the first place

#

If this is your first game, do not try to make it multiplayer

#

That's the only reasonable advice I can say...

#

What I said before is valid, but requires a lot of experience

frosty crystal
#

I wrote some basic games, fps etc. I think I it is time to start. Thanks Eric!

frosty crystal
#

I bother you I know but, I could not convert object type to int to iterate. How do you do for it? Thanks

weak plinth
#

cast to string then use int.tryparse. as an alternative just send int instead of a string

vapid leaf
weak plinth
#

this screenshot isn't close to being readable. However post the errors you are getting

#

the weaver is the magical tool that's converting your code such as [SyncVar] into something usable over the network

vapid leaf
weak plinth
#

You'll find better help in the Mirror discord, but I see a few errors. CharacterClasses isn't a mirror-serializable type, [Command] method names have to start with Cmd. Also this is two monobehaviours (NetworkBehaviour derives from) in a single script which I imagine is causing the weaver to flip out

vapid leaf
#

i fixed all the errors listed above im gonna go ask the mirror discord, im still getting weaver issues. Thanks for helping out though appreciate it!

jaunty burrow
#

if thats the case then why arent i getting an error when this runs

frosty crystal
#

Hello. How can I get callback if my local player's process of custom property loading is done?

#

Pun2

cedar cloak
#

am I wrong or calling a PunRPC from a machine let every machine connected execute that method?

jade glacier
#

That is what they are for yeah @cedar cloak

cedar cloak
#

strange, I'm trying to make some sort of killfeed so if the player dies it sends to everyone (thorugh an RPC) a method that create a message on the HUD, but doesnt seems working...

jade glacier
#

Dunno

#

Sounds like you got a bug.

cedar cloak
#

are RPC called like this? photonView.RPC("Method", Target, *eventualy variables*);

cedar cloak
#

can I call an RPC on another script right'

#

?

jade glacier
#

I never use them, so I would just end up referring to the manual, but that is the concept yeah.

cedar cloak
#

tought to explain but i fixed it 🙂

lunar sage
#

is there a way to share information with every player in photon pun 2? ping me if you know

jade glacier
#

Typically with an RPC @lunar sage

lunar sage
#

yes i am gnna do that, didnt know what it was called

#

is threre a way to do that with variables @jade glacier

jade glacier
#

Just through the RPC. I have added syncvars with the SNS extension library for Pun2, but that is still in beta.

lunar sage
#

oh

#

would getter and seter functions work

jade glacier
#

It works like the Unet/Mirror Syncvar, only using tick based timings.

jaunty burrow
#

What is the best networking to use for a physics based game with 2 - 4 players, where the players are controlled with forces and shoot bullets with physics

lunar sage
#

@jaunty burrow photon

#

its free

jaunty burrow
#

@lunar sage what version of photon?

lunar sage
#

the newest

jaunty burrow
#

sigh

lunar sage
#

just get it on the asset store

jaunty burrow
#

pun bolt

lunar sage
#

sigh
@jaunty burrow what?

jaunty burrow
#

do i use pun?

#

bolt?

lunar sage
#

yes

jaunty burrow
#

truesync?

lunar sage
#

bolt? why do u need bolt

#

what is truesync

jaunty burrow
#

i likely need an authoritative server

#

for a physics based game

lunar sage
#

idk just look it up

#

w8

#

ill link u to some stuff

jaunty burrow
#

i tried using pun but the physics were slow and unresponsive

lunar sage
#

i dont think it affects the physics

gleaming prawn
#

@jaunty burrow definitely photon Quantum

#

Truesync is a discontinued product (also deterministic predict rollback like quantum, but with a -wrong- MonoBehavior-based architecture, so didn't reach the desired performance),

#

For physics-based interactions where accuracy is required, there's nothing to really compete with quantum...That's what it is.

#

@lunar sage PUN2 would not be ideal for physics-based interactions.

#

Neither bolt.

cedar cloak
#

I'm using a particle system on the guns to make a flash when I shoot, problem is that when I do it all nozzle flashes

#

I even tried with photonview.isMine check but nothing

#

any tips?

lunar sage
#

@gleaming prawn bolt is a visual scripting language, not sure what it has to do witht his

gleaming prawn
#

@lunar sage Photon Bolt is a networking library.. Was created LONG before bolt scripting language FYI...:)

lunar sage
#

oh

#

im dumb

gleaming prawn
#

I never understood why Unity let the scripting language use that name, as it was taken (Bolt networking was a package in there before)

lunar sage
#

ye

#

a lot of ppl were talking abt the bolt viual script so i thought he was

gleaming prawn
#

Bolt (the net library) is a client-server, fully fledged tool... Well praised by people who use it, etc. For the right games (FPS, TPS, Action Adventures, etc), it is possibly the best tool in Unity (subject to opinion, of course).

#

But for games where the main focus is physics interaction and accuracy is necessary, Quantum is (arguably) the best.

jade glacier
#

The main thing people should get from all of this is that Bolt and Quantum are you ONLY complete networking stacks.

#

Pun2, Mirror, Forget, MLAPI and the various transports will require you to get your hands dirty quite a bit more in the business of working out the paradoxes that come with state transfer.

#

Any Transform/Animator syncs they provide are indicated as "Reference only" and are not particularly good. And none of them are tick/simulation based. So you are on your own to wire that up.

jaunty burrow
#

@gleaming prawn is quantum free?

jade glacier
#

Quantum isn't for hobbyists no. Last I was aware it costs $1000/mo just to be working with it. The target audience is funded studios/projects.

frosty crystal
#

Hello. When I cast number to selection variable. My value is being destroy. Why?

lunar sage
#

can photon pun 2 be used in cross platform like for example, webgl and download?

cedar cloak
#

I reimported an older version of the same project but now Unity doesnt find the asset in the Rources folder, what can I do?

lunar sage
#

dont upgrade ur unity version when ur wroking on a project @cedar cloak

cedar cloak
#

I dindnt do it

#

the project "state" was older

#

it was a backup cause now i screwed up some code

#

and I want to return back using a saved project folder

slim ridge
#

use git next time 🤣

jade glacier
#

Yeah, stop whatever you are working on. Spend half a day getting git installed and learning the basics.

#

Programming without a repo is suicide.

terse relic
#

so i cant use photon free for an fps game then

#

cuz explosions use physics

weak plinth
#

you can have physics in games without determinism. Just gets a bit complex

lunar sage
#

cuz explosions use physics
@terse relic make ur own explosions

#

w8 @weak plinth what physics things dont work in photon pun 2

jade glacier
#

It depends what you mean by physics really.

#

State Transfer involves the authority version running some form of physics or simulation, and then broadcasting that state to the players. Physics themselves aren't networked.

#

What you likely are asking for, the only library that will make physics appear in perfect agreement between clients is Quantum.

#

With state transfer libraries (Bolt, Pun2, Mirror, etc) Physics occur on one client or on the server, and the results are replicated to others not as physics, but as transform states.

floral turtle
#

I haven't used it, but looks like they got something functional

#

@sonic echo I haven't tried it, but how does PhysX like being rewound/fast forwarded? Is there a large CPU cost to manually reposition many bodies?

frosty crystal
#

Hi. In pun2, when I create room, in OnJoinedLobby, my game scene is being opened. But in the game scene, function the OnJoinedRoom is not working? What may cause it?

jade glacier
#

"Not working" ?

#

What messages are you seeing in the log?

#

Do the example scenes in the photon folder work? Like the Asteroids demo? @frosty crystal

lunar sage
#

@jade glacier this wont cause much issues in a game with character controller movement right

#

and do raycasts get affected

jade glacier
#

Way too vague really for me to even guess at the right answer for you sorry.

lunar sage
#

like would this affect character controller

gleaming prawn
#

@floral turtle this "add on" is super old, and does not even mention that Bolt now has a free version... I doubt it still works, as it didn't get updated since 3 years ago.

jade glacier
#

You have to clearly define what you mean by "networking physics" before you can answer questions about what can and can't happen

gleaming prawn
#

ALso, you can join Bolt's official discord and check the community there, they are very welcoming to newcomers.

jade glacier
#

I WOULD NOT even think about any of this unless you have a few basic networking games made.

lunar sage
#

i didnt say "networking physics"

jade glacier
#

Then I might be confusing conversations, I'm not sure what we re discussing sorry.

lunar sage
#

i mean would the issues u talked abt earlier affect character controller or no

gleaming prawn
#

Everything networking affects character controllers...:)

#

You can just do a very naive implementation (using PUN2, for example), so you control your local KCC and sync it's movement.

lunar sage
#

i think im confusing myself

gleaming prawn
#

And not do any lag compensation for raycasts

#

But the more you get into networking you'll see the devil in the details.

#

And understand why there's a lot more involved into making a good game (that feels good, fast and fair to play)

lunar sage
#

yeah cuz the thing is like a quarter of a second delayed, even tho both clients were on the same device

#

or maybe i just have bad internet, i have no idea

gleaming prawn
#

For mirror, I suggest you join their own Discord server

fading mason
#

im stupid forgot i was in there ty

frosty crystal
#

What messages are you seeing in the log?
@jade glacier I have noticed my issue. why I do not know but, I thought, even after changing scene, the OnJoinRoom is supposed to be run. But it is being called just once in the same scene. Not to the other scenes.

jade glacier
#

It is a callback, so it will only fire when you join a room, and the callbacks that fire will only be the callbacks you registered.

#

If any scene objects aren't loaded, they wont have any instances, nor will they have registered any classes.

haughty blade
#

Hey so... how incredibly hard would it be for me to write server authoritative netcode for VR that actually feeds in 3 rigidbody's vector info as input per client (head + 2 hands) as Vector3 position, Vector3 linearVelocity, Quaternion rotation, Vector3 rotationalVelocity? Is that a lot (too much?) of data to feed from client to server considering generally most games just need a Vector 2 for mouse cursor and like 4 bits for WSAD?
How much should I truncate the Vector 3's by before I will crash everything to the ground? What tick should I be going for?
Like how often should I send input considering the much higher input requirements? And any recommendations on server tick rate? I'm going for multiplayer melee (sword).
Also - has anyone successfully set up Unity with wireless ADB in a way that you can Build and Run wirelessly? I mean, on an Oculus Quest

buoyant carbon
#

Help needed. If I have networkid stored as string, how can I find gameobject with that netid? I tried NetworkServer.FindLocalObject() but how do I convert from string back to networkid?

jade glacier
#

Should we first ask why its a string?

haughty blade
#

@buoyant carbon I think what @jade glacier is saying is that the return type from FindLocalObject() should be GameObject

#

From the GameObject itself you should be able to use its own member functions to find out whatever you need about the object you've pulled up, or interact with it

jade glacier
#

The netId has no real reason to ever be a string, wondering what could have led to that.

vapid leaf
#

so i have a singleton with a script variable which is supposed to only have 1 player play as one character so players can switch between characters so the variable should be global yet i cant get it to be global on all clients yet i can get 2 players on 1 character. Anyone have any fixes? This is in mirror but i am debating if i should just use syncEvents instead tho

jade glacier
#

That sounds like a job for syncvars.

buoyant carbon
#

The netId has no real reason to ever be a string, wondering what could have led to that.
@jade glacier @haughty blade thanks, I backtracked all the old methods to find why it was originally done so, and there really was no reason for it at first place. Just bad code. Thanks for the help.

jade glacier
#

👍

safe sand
#

Hey. I wanted to learn about the network in the unit. can i use local multiplayer for free? and also multiplayer on the network for free if I use p2p? or will you have to write your own implementation of everything?

floral turtle
vapid leaf
#

@jade glacier i put a syncVar bool in a singleton and refeerenced it in my scripts that needed to use it but it did not work

jade glacier
#

Make sure you have read the docs and done any tutorials. And join the mirror channel.

safe sand
#

@vapid leaf what do you recommend for a simple 2D game? I want to be able to play locally (by connecting, for example, to one wi-fi network). and via the Internet. And I would like it to be free

vapid leaf
#

For local I'm using mirror and I'm pretty sure you can also use mirror for online p2p connection but I'm not exactly sure how

safe sand
#

mirror is free?

vapid leaf
#

If anyone knows how to make online p2p for mirror let us know

#

Yeah its in The asset store for free

#

No license either so u can use it commercially worry free

safe sand
#

If it works like that, then it's not a problem to create a p2p connection via the network using fierbase and a table inside as matchmaking

vapid leaf
#

I'm not trying to make a competitive multiplayer game just so that you can play with friends for the story mode

hushed marlin
#

Hey, i know UNet has been depricated has anything taken its place? If not what do you sugest if i play to make a multiplayer game?

tropic creek
#

hi, guys I am making a multiplayer game with parkour and guns and I need someone that good on multiplayer to join(for free). we are working with unity, about the networking: photon 2 and playfab

jade glacier
#

I would start any networking learning with doing tutorials for some of the main library options like Mirror, Pun2 and Bolt. You won't even know the right questions to ask until you have gotten your hands dirty in the libraries available.

hushed marlin
#

Whats the "Best" language to make a game server in (UDP and/or TCP)

slim ridge
#

lol "Best"

#

Java, python, Go, elixir, rust? 🤔

hushed marlin
#

@slim ridge Would you say UDP or TCP is better

slim ridge
#

UDP for time sensitive information, TCP for everything else

hushed marlin
#

so i should have a mix?

acoustic oriole
#

yes

viscid tree
#

how do i get the length of a htmlnodecollection ?

var web = new HtmlWeb();
var doc = web.Load(url);

HtmlNodeCollection links = doc.DocumentNode.SelectNodes("//a");

Debug.Log(links.Length);
hollow abyss
#

Hey guys sorry to be a bother but I have what I think is a pretty unique question that I don't think is very hard - does anybody have a moment? I am wondering how to use mirror (or any other networking tool I'm not married to mirror) in order to assign control of the same object to two different players.

vapid leaf
#

I have 3 problems 1. my syncVar only applies to clients but not to the host. What im trying to do is have switchable characters but i dont want 2 players on 1 character. 2. My client does not move on the server but can still move as in it doesnt appear to move for any one connected to the server 3. I will send an image cuz idk how to explain it

indigo walrus
#

Hey, new guy here 🙂 So I have a question which is: I am planning to make a video game which eventually to publish using Steam servers or Amazon servers(not sure if those work the same way), which would be way to go?What network language should I go for? I watched quite a lot of videos and read forums and just got more confused. Thanks in advance!

worldly cedar
#

Im finding that I have 'left over' packets in my UDP socket between connections. So, if I connect once, then disconnect, then connect again, any packets I hadnt received in the meantime seem to queue up to be consumed.

Now, from what I've read, a NetworkStream doesnt have a buffer, so Flush on that wont actually do anything, but what I did is this:

if (flush)
    {
        while (client.Available > 0)
        {
            client.Receive(ref groupEP);
        }
        flush = false;
    }

Where flush is a bool, client is a UDPClient and groupEP is the IPEndpoint. Is there anything particularly wrong with doing it this way? I am using ReceiveAsync on my other calls, but thats more a structure thing, this is running on a separate thread so it wont block the game thread.

frosty crystal
#

I need huge help, please.
When my Bomberman drops a bomb (RPG method) I can reach bombs script via bombs game object.
If the remote player gets in the room, my remote player can not reach its bombs script via the remote player's bomb game object.
What could cause this?

maiden sundial
#

Hi iam looking forward to make a new multiplayer game. Ive used photon before and was just curious if there are any better options? Ive heard some stuff about unitys own, DOTS but is that available at the moment? i can't seem to find it, much thanks! 🙂

gleaming prawn
#

Unity's own is slpha/broken state.

#

Not close to being usable... Also very tied to a very specific networking model so far (may evolve later, but who knows)

#

By photon you probably mean PUN, right? There are several options (from photon, like Quantum, Bolt and PUN2) or from others like Mirror (open source followup to unity's deprecated UNet), etc

indigo walrus
#

Hello guys, has anyone here used SmartFoxServer?

#

or any similar low-budget solution for the network frame

tidal zealot
#

okay, So i'm having a problem that I think this might be the right place to post it... I'm not too sure exactly how to phrase it nor do I know where the problem is in my code, but I'm doing an FPS and have an effect of the current prototyped pistol that allows it to recoil upwards when a shot is taken before then returning to it's initial position that it was held in... THIS works, just not over the 'server' I made with PUN, I've got all the movement and shotting synced apart from this one issue

#

so now it looks as though the player that has shot has the gun constantly rotation around him hahaha

#

So if anyone thinks that they might be able to help me, please PM me... I've been struggling for a lot of today on this one issue and don't really understand what to do :/ Thanks in advance! haha

thorn kestrel
#

hello guys

#

there's someone have a knowledge about multiplayer?

#

and games thats u should connect to the server not to the host?

gleaming prawn
#

@thorn kestrel

there's someone have a knowledge about multiplayer?
Yes, several
and games thats u should connect to the server not to the host?
But this question is difficult to even understand.

#

Please, ask a more specific technical question, then you might get a proper answer

#

@tidal zealot I'd just trigger an animation for that when I get the information about the shot (on the other clients)
If you want to consider the recoil for the aiming on the next shot, use the bone-animation position/orientation as part of the shot parameters...

#

It's a bit of a complex topic (to make that influence gameplay), but just showing it should be straightforward with animation

brittle vigil
#

Hi, I made a simple air hockey game for two players, but the positions of players aren't synchronized correctly. I used mirror.

#

what's the problem

jade glacier
#

Video doesn't play for me, but what do you mean by synchronized? The internet latency will always make each player live in the future, unless you are doing an extrapolation-based input or state sync (you aren't) @brittle vigil

slim ridge
#

it plays just nothing happens 🤣

brittle vigil
#

positions are different on host and on client

#

On google drive video works

gleaming prawn
#

Ye @brittle vigil position of the other disk is wrong.

#

But it's your code, only thing we can say is: yes, it's not right.

#

Why, being this Mirror, first you should join their discord (there's a bigger community there), second: post more details of the code used to make the movement.

jade glacier
#

It looks like your non-authority versions of player objects is a non-kinematic physics objects. They typically need to be kinematic on other clients, and they get moved with the NetworkTransform sending updates from the Authority version to all other clients.

#

If you are using physics, only the one with hasAuthority == true should be affected by physics (set to non-kinematic).

#

@brittle vigil

thorn kestrel
#

@gleaming prawn my question is clear i ask if there's anyone have a knowledge about c# networking and connecting unity clients to a dedicated server

#

i want the host is server not player

plucky steppe
#

Any one here running on AWS?

#

I was gonna setup a proto with endels websocket and aws lambda

toxic pumice
#

hi

#

do you have any tutorial about parsing apis for unity?

dusty salmon
#

anyone used UNet, been getting the hang of it, ive built a custom server browser using it and ive also built added an auto search system, can someone help me with the logic atm the program list all the matches or trys to list 200 if there are no matches we create a match, if there are matches then pick a random match from the list and join, these feels to simple to work properly

gleaming prawn
#

@thorn kestrel in that case my answer is also clear: yes...:)

thorn kestrel
#

@gleaming prawn ok so how to make it u have some yt tutorial or somethin ?

jade glacier
#

Erick is saying that you need to post specific questions here that are answerable. "Teach me networking" is a bit much, considering it is something that typically takes a few years to get a really good handle on. @thorn kestrel

#

Try out the public libraries that are an option. Mirror, Pun2 and Bolt are pretty typical starting points.

gleaming prawn
#

A server can be for many things, so there are several YouTube videos, yes. But your question is still way too vague, as stated by emotitron.

thorn kestrel
#

@jade glacier ok ty man

craggy bear
gleaming prawn
#

You will need to set the app I'd later

#

App id

craggy bear
#

How can I make photon work with ObjectPool? I know I can instantiate with it, but I want to have my objects preinstatiated to improve performance. (Also, it's a test and I want to impress them)

craggy bear
#

Also, is there anything special to photonView.IsMine? I can freely move 2 players, but their position isn't updated on other clients.

#

And when I say this (if statement), it's updating the wrong client...

#

if I reverse this if(!photonView.IsMine) it works fine

regal badger
#

Also, is there anything special to photonView.IsMine? I can freely move 2 players, but their position isn't updated on other clients.

#

you have the transform views on them yea?

craggy bear
#

Yep, it's in the screenshot.

#

I am also moving them by transforms, not by physics, so it should be fine here too.

regal badger
#

i see it now

#

i see u have the camera

#

is everything parented under the camera?

craggy bear
#

Yes.

#

It's because it's sort of an FPS.

regal badger
#

yea

#

thats why i used mine

craggy bear
regal badger
#

the code shouldnt matter

#

how it got to that position shouldnt matter

#

until u start to precalculate ur movements and stuff

#

so you only got basic cubes? so far

#

alrighty i found it

craggy bear
#

Well' I've got a bit more, the cubes are there just to visualize where players are.

regal badger
#

yea thats fine

craggy bear
#

It's also not really an fps, but the idea is the same.

regal badger
#

imma look how i have mine set up

#

and u can compare that to urs

#

damn that took a while

#

and ur players are prefabs that u instantiate in?

#

sorry just trying to cover the basics first

craggy bear
#

yep

regal badger
craggy bear
#

And you called it from StarT?

regal badger
#

did you not need to put it in the resource folder?

craggy bear
#

I put it in resources.

#

Yeah it was complaining otherwise

regal badger
#

i had to type out all the weird syntax when i did mine

#

it wouldnt work without (Path.Combine("PhotonPrefabs", "NukeBoxPlayer")

craggy bear
#

Well, it works here.

regal badger
#

good good

craggy bear
#

And what about your controllers

#

?

regal badger
#

oh snap

#

its pretty bad

craggy bear
#

can I see NetworkPlayerAwake and NBPlayerMove?

regal badger
#

thats for enabling only your conrols

#

nb player move is a big script..

#

moves a CC using CC.Move();

#

yea

craggy bear
#

can I see the relevant part for moving around?

regal badger
#

it doesnt have any photon in it

craggy bear
#

oh ok.

regal badger
#

ya

#

i have photon space but its unused

#

the real magic is just the transform

craggy bear
#

you mean...?

regal badger
#

my observed component

#

is on the same object as itself..

craggy bear
#

ok so you just observe your parent

regal badger
#

and the same object as the move script

#

yea

#

im not sure if it has anything to do with the move script being on the same object

#

but the graphics all followed when i do it this way

craggy bear
#

Any chance I could DM you?

regal badger
#

ya you are free to

#

but i dontknow how much more help i can be

#

i didnt get very far into the project

haughty needle
#

@regal badger How would I host an online fps?

regal badger
#

use Mirror of Photon

#

both free both good

haughty needle
#

k

#

Thanks for the help

weak plinth
#

hi

#

can someone help me w/ mirror

gleaming prawn
#

have you tried Mirror´s Discord?

lean nacelle
#

Zapnet is also good and designed for programmers - especially if you want to self-host dedicated servers 🙂

gleaming prawn
#

never heard of this one... will take a look...:)

jade glacier
#

That came up in the channel like a half year to year ago, but haven't heard much since then. It looks like it hasn't really progressed much. Is the author of it still active?

floral turtle
#

@jade glacier kuro is the author!

thorn kestrel
#

guys there's a networking system that's is free ?

narrow crown
#

Has anybody got experience making game with socketweaver?

#

In unity

#

Of course

gleaming prawn
#

@thorn kestrel mirror is open source and free... But if you plan to host servers, these will never be free, and also a matchmaking system to list active server, etc, these are services you normally have to pay for

lean nacelle
#

@jade glacier yeah unfortunately the coronavirus pandemic kind of halted our development as we had to shift to focus on paying the bills / jobs and we both got sick 😦

safe lynx
#

i need help getting my body to instantiate

#

am i doing something wrong?

#

also im in VR so that just muddies the water

fluid raft
#

Lemme pull up my project

safe lynx
#

this is in my game manager script

#

well shit

#

i should have just read the error msgs

fluid raft
#

Got it?

#

Sorry I was spitting in my files lol

safe lynx
#

lol yea it spawned

fluid raft
#

I have an old phtoton project

#

I can send it to you for reference

#

It's a few years old but yea

safe lynx
#

sure but i think ill try it first

#

ill let you know if i need it XD

fluid raft
#

Sure thing

#

I dropped it here just incase

#

😋

safe lynx
#

:D

safe lynx
#

@fluid raft

#

IPunObservable

#

why is there an error

fluid raft
#

what is null?

#

photonview?

#

You can debug it too

#

IPunObservable seems to only implement the method on line 34

safe lynx
#

whats wrong with it

#

yea i think photonview is null

#

is that not how u use photonView

#
using System.Collections;


using UnityEngine;
using UnityEngine.SceneManagement;


using Photon.Pun;
using Photon.Realtime;

public class LocalSync : MonoBehaviourPunCallbacks, IPunObservable
{
    public GameObject LeftHand;
    public GameObject RightHand;
    public GameObject Head;
    // Start is called before the first frame update
    void Start()
    {
        PhotonNetwork.SendRate = 30;
        PhotonNetwork.SerializationRate = 30;
    }
    private void Update()
    {
        if (!photonView.IsMine) return;
        Debug.Log(SyncHeadPos.HeadPos);
        Head.transform.position = SyncHeadPos.HeadPos + new Vector3(0, 1.5f, 0);
        Head.transform.rotation = SyncHeadPos.HeadRot;
        LeftHand.transform.position = SyncLeftPos.LeftHandPos;
        LeftHand.transform.rotation = SyncLeftPos.LeftHandRot;
        RightHand.transform.position = SyncRightPos.RightHandPos;
        RightHand.transform.rotation = SyncRightPos.RightHandRot;
    }
    void IPunObservable.OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info)
    {
        if (stream.IsWriting)
        {
            stream.SendNext(Head.transform.position);
            stream.SendNext(Head.transform.rotation);
            stream.SendNext(LeftHand.transform.position);
            stream.SendNext(LeftHand.transform.rotation);
            stream.SendNext(RightHand.transform.position);
            stream.SendNext(RightHand.transform.rotation);
        }
        else
        {
            Head.transform.position = (Vector3)stream.ReceiveNext();
            Head.transform.rotation = (Quaternion)stream.ReceiveNext();
            LeftHand.transform.position = (Vector3)stream.ReceiveNext();
            LeftHand.transform.rotation = (Quaternion)stream.ReceiveNext();
            RightHand.transform.position = (Vector3)stream.ReceiveNext();
            RightHand.transform.rotation = (Quaternion)stream.ReceiveNext();
        }
    }
}```
fluid raft
#

is this object instantiated by photonnetwork.instantiate?

safe lynx
#

wait every instance of photonview.ismine is broken

#

yea

fluid raft
#

erm

#

there is also a photonview attatched to the object?

safe lynx
#

no

fluid raft
#

im unsure, been too long

safe lynx
#

oh Mah goad

#

its workin

#

kinda

#

only my left hand is working

lunar sage
#

how do i make it so that when a player enters a room I get his name in photon pun 2?
ping if you know

vapid leaf
#

does anyone know why my client doesnt move for other players. Im using mirror(yes i did ask the discord and the objects do have network transform) and i have 2 movement scripts that go together for controlling movement. 1 of the scripts uses a derivative of monobehavior so i cant use network behavior on it. anyone have any fixes?

thorn kestrel
#

@gleaming prawn oh, so there's no free matchmaking system ?

gleaming prawn
#

@thorn kestrel Epic Online Services promises to be "free"

#

Although these things always come with strings attached...:)

#

If they offer options for matchmaking, I've not yet tried them.

#

The one from steam is also free, but it's only useful if you plan to sell the game there (PC only, etc) - which is give-me-30%-of-revenue "free"

safe lynx
#

hey could anyone help me with networking

stiff ridge
#

yes. just ask what you need to know.

safe lynx
#

lol

#

i need help using photon

#

im trying to sync a ball between instances

#

is this the right way to do it

stiff ridge
#

It's a simple way to do it. if multiple players interact with the physical objects, there will be problems like objects passing through one another.

jade glacier
#

Balls are one of the bigger challenges in networking, because they expose the latency of the network, and the disagreements between clients timings.

#

Most ball type games tend to use extrapolation rather than interpolation.

#

Most of your networking libraries work on state transfer and interpolation, so they are not out of the box good for dealing with players interacting with shared objects or one another.

#

I would not recommend a game like that as your first networking attempt.

safe lynx
#

XD im not going to do a ball type game

#

i just need a way to sync an obj

jade glacier
#

may have just misinterpreted your "sync a ball" then

#

I see "Grab" in your components, which leads me to believe that players can and will be competing for control of that object though, which is the same general problem.

weak plinth
#

Hey! What networking solution do you recommend for a game where the client is also the host? I saw photon and I dont really like that I have to use its servers. Also saw that UNet is being deprecated, and that Mirror exists, but what do you recommend?

gleaming prawn
#

photon (PUN2)... or photon Bolt.

#

Mirror has p2p as well, it seems... But I'm not familiar with how to do that. For LAN games, then Mirror should be ok

#

I mean. I read what you said

weak plinth
#

Yeah, I have been the last couple of days trying to use mirror, but I dont find really good tutorials (Almost everything is the basic, just connect)

gleaming prawn
#

But I would not rule-out tools used by successful games because "you do not like" a certain aspect

jade glacier
#

Pun2 is the easiest in the sense that you have no concerns about punch-through and such. But Mirror and similar give you a proper server option.

weak plinth
#

Yeah sorry, I forgot to add that it will use LAN connection, so I cant rely in photon servers

gleaming prawn
#

There's a few reasons why the photon products are used...:)

jade glacier
#

Pun2 is relay, so its easier to deploy, but a little different to develop for.

gleaming prawn
#

If it's LAN-ONly...

#

then go for mirror

jade glacier
#

Yeah, Photon products are not going to be something you want to play with if you are making a lan hobby project. Go Mirror.

weak plinth
#

Do you recommend any tutorials about Mirror?

jade glacier
#

The mirror discord is the place to be for all of that.

weak plinth
#

Okay, then I will try it, thanks guys

grizzled narwhal
#

I use MLAPI but this seems really unpopular around here

weak plinth
#

Do you recommend that before Mirror?

gleaming prawn
#

I really have not studied the MLAPI much

#

I mean, I tend to see the most opposite tiers:
high level: fully fledged netcode APIs, like quantum, pun, mirror, bolt, etc
low level: transport layers like steam, photon realtime, etc

#

I see here it has high level concepts in it...

#

From a first view it seems to be based on the same concepts as Mirror/Unet...:) Hmm... That does not play on its favor...

#

@grizzled narwhal does it have scoping, scheduling, client-side-prediction and lag compensated raycasts like Bolt? These are thing it came with since 2015...

#

I find a bit of a bummer that all attempts to build a networking layer fall short of offering these basics...

grizzled narwhal
#

No idea what scoping and scheduling is 😅 . Its a mid level api so doesnt really have client side prediction either -> you'd have to build it yourself

gleaming prawn
#

hmmm

grizzled narwhal
#

It has low level and boxed rpc's and synced vars

gleaming prawn
#

I mean, I forgot to mention delta compression, etc

grizzled narwhal
#

Yeah I would have to build that myself

gleaming prawn
#

IMHO it's a bit counter productive, if you are trying to build a GAME

#

If you want to learn how to create a proper networking API, could be fun

grizzled narwhal
#

Yeah . Atm I just compress pos, velocity, rotation in my custom script and rpc them over with udp

#

Not the best system ever build but it works ;)

gleaming prawn
#

Why would MLAPI be better than Mirror, for example?

#

Gives more access to lower level stuff? Just that?

grizzled narwhal
#

Yeah. He also claims that its more memory efficient (everything is pooled) and it doesnt launch 1 thread / user

jade glacier
#

I would break those layers out a bit more even.

Full stack is Quantum and Bolt
NetEntity message wrappers would be Pun2, Mirror, MLAPI, etc
Transport - messages and connections only

#

MLAPI and Mirror will get you about the same results, with minor annoyances related to choices either make, but they do the same thing.

clever silo
#

Personally I wouldn't touch anything which does 1 thread / user, or TCP as a default, and the last I checked, Mirror did both of those

jade glacier
#

If you are chasing "efficiency" then any of these libraries should be off the table. Only Bolt and Quantum actually will get you there for that.

gleaming prawn
#

That's a good break-down @jade glacier

jade glacier
#

You typically want one thread @clever silo

#

Treads in deployment = money

clever silo
#

Yes, I was saying you don't want 1 per user

gleaming prawn
#

it depends @jade glacier

grizzled narwhal
#

I just skimmed the docs of bolt and this entity crearing ui stuff looks a bit weird to me imho

gleaming prawn
#

Kylotan is correct, 1 per user is really BAD

grizzled narwhal
#

And mirror does that

gleaming prawn
#

If it's a game for like 4 players, fine

jade glacier
#

fholm was fighting with that for quite a while, dealing with making use of threads and not getting enough benefit for the potential cost to devs. Not sure how that played out with Quantum @gleaming prawn

#

But that was for his 100+ connect engine attempt

gleaming prawn
#

Quantum is a different beast

clever silo
#

In my experience, you can sometimes get some benefit from threads, but in many cases the operating system and the network adapter do a perfectly good job of batching stuff up while you deal with it. You're often better off using your cores elsewhere

jade glacier
#

yeah, no server requirement @gleaming prawn

#

So it will take any CPU it can get I am sure

gleaming prawn
#

For the game simulation we do run multiple threads (like Unity's job system - we actually hook up to Unity's job system on unity clients)

#

but it's just the right amount for the target hardware, othjerwise it's useless overhead

weak plinth
#

is quantum based on ECS or different thing entirely?

jade glacier
#

This was all about regular state transfer based servers, which is the world Mirror lives in.

gleaming prawn
#

Quantum IS an ECS

#

A production-ready one

jade glacier
#

its a fixed point engine @weak plinth

gleaming prawn
#

Quantum's SDK 2.0 is a sparse-set ECS (like C++ enTT)

jade glacier
#

The concept of Quantum is full determinism, which makes it not comparable in most ways to discussions about state transfer only engines like Mirror and Pun2

gleaming prawn
#

But photon servers @jade glacier , which run the input management and clock sync (optionally simulation) in quantum, uses IO-completion ports (not traditional socket-threads)

jade glacier
#

That just flew right out of my pay grade 🙂

grizzled narwhal
#

I think I preffer the flexibility of mlapi

jade glacier
#

They will get you the same perks and headaches @grizzled narwhal

grizzled narwhal
#

Mh?

jade glacier
#

Mirror and MLAPI give you NetEntities with IDs, and ways to wrap messages up with RPCs and Syncvars - but they do not tie into your simulation or simulation timings. So you are pretty much on your own with the sync timing and such.

#

MLAPI is a bit cleaner, because twoten started from scratch, but its also missing some luxuries... like the weaver in Unet was one of its real perks.

gleaming prawn
#

hmmm

jade glacier
#

But its all time based, and will give you fits in the long run if you don't get some kind of tick manager of your own in place and tie your messaging to your simulation

grizzled narwhal
#

You mean mlapi's networktime isnt all that great?

gleaming prawn
#

ye, neither MLAPI nor UNET nor MIrror have a great timing mechanism build in

jade glacier
#

Networking with time rather than ticks is usually accompanied by mixing messaging with simulation... which is a no no

grizzled narwhal
#

For the moment I havent bothered with input prediction/resimulation but thats probably an important step

weak plinth
#

I have recently been enjoying UE's networking. I hope whatever unity comes up with to replace UNET is as extensive

jade glacier
#

Messaging <-> State and Input Buffers <-> Simulation is typically how you keep state transfer sane.

gleaming prawn
#

I wouldn't wait for Unity's default solution

jade glacier
#

MLAPI and Mirror both encourage new users to tie messaging directly to Simulation... or WORSE to interpolation.

gleaming prawn
#

They are on their 4th attempt, and counting...

grizzled narwhal
#

I have messaging tied into simulation probably lmao

gleaming prawn
#

UE is ok for the typical action/FPS use cases...

weak plinth
#

was their network code before unet bad? I've never heard anyone complain about it and it seems like the only reason they got rid of it was Raknet which I don't really get

jade glacier
#

All new networking devs do... its the first big mistake we all make when we first try this stuff. @grizzled narwhal

gleaming prawn
#

Although they had a super super bad method for scoping (which gave them a LOT of headaches on Fortnite, and for PUBG)

jade glacier
#

Networking is about simulation, not about messaging.

gleaming prawn
#

Then they cam with the network graph "hack"

grizzled narwhal
#

Networking is about simulation, not about messaging.
@jade glacier Could you elaborate?

gleaming prawn
#

@weak plinth

was their network code before unet bad?
It was so bad that it's the main reason why all the alternatives had a chance

jade glacier
#

Not as much as you probably would like, its a 5 hour lecture on time in gaming

gleaming prawn
#

Unity's original UN (similar in concepts to PUN) just would not work outside of LAN

weak plinth
#

yea my (limited) experience with UE networking so far is a generic third person which I assume is the perfect fit given Epic

gleaming prawn
#

it was a full broadcasts P2P solution, pretty bad

grizzled narwhal
#

The basic is probably to have the game code to be as networking unaware as possible no?

gleaming prawn
#

UE networking has a few very good things in it... proper timing, a lot of stuff like Bolt, etc...

#

The major issue I saw was the lack of an efficient scoping mechanism for network culling on the server (performance on server for high player count was pretty bad, really bad)

jade glacier
#

The model to think of for networking is the model for PhysX in Unity. There are two timings.. FixedUpdate is the PreSimulate callback, this is where actual simulation logic goes. All things in a game should be done on a fixed timing like that. Networking should be tied to that timing, not to Update().

Update is just for interpolation and extrapolation based on timeDelta.

#

FixedUpdate is the slideshow of reality that you don't actually see.

#

Update is where that slideshow is made pretty for the player

weak plinth
#

there's also the SpatialOS integration but I haven't gotten that far yet

gleaming prawn
#

Then they (Epic) developed the network Graph thing to deal with that (culling performance on server)... It's basic implementation is a damm GRID, but works

jade glacier
#

Networking likes the slideshow... it should not know about or touch the smoothing of Update

gleaming prawn
#

there's also the SpatialOS integration but I haven't gotten that far yet
I have a friend working there... But my expectations are of: you pay 10x more to deal with the overhead... lol

weak plinth
#

I don't know anything about them besides that Worlds Adrift used it

jade glacier
#

I haven't seen any clear demos of their tech that felt compelling

gleaming prawn
#

It's interesting from the technical perspective (lots of neat stuff done by smart guys)

#

Worlds Adrift used it
Doesn't count, as it's backed by them AFAIK.

weak plinth
#

compiling their (fork?) of the engine instead of dropping a library in did catch me off guard

gleaming prawn
#

But... Lets see... THat's just my impression...:)

jade glacier
#

Complexity doesn't make something a great utility unfortunately. But it might be great - it just didn't resonate with me in any demos or explanations as something I cared about or though was the right answer for most people's networking problems.

#

I work for the company that makes Quantum, but Quantum actually will eventually invalidate all of my work - so I am not biased to promote it.... but Quantum is the kind of innovation networking needs imo.

gleaming prawn
#

I liked when I got a full explanation from one of their engineers (from the technical perspective)

#

But I did not had the chance to ask: how much would it cost for 10000 CCU?

jade glacier
#

People making wild stacks of stuff to reproduce existing models without as much coding doesn't excite me.

#

(though I literally make that kind of stuff myself for a living)

gleaming prawn
#

As a quantum core developer: I "envy" the technical challenges the guys of SpacialOS face...

#

lol

#

different types of challenges...

jade glacier
#

Does it all come around to being a complete stack of stuff? @gleaming prawn Like do they have a toolkit for Unity that contains all of the drop in components for syncing up player states, anims, transforms, etc?

gleaming prawn
#

My doubts are about the business model, technically it's cool stuff IMHO.

clever silo
#

I work for the SpatialOS people, by the way. I don't work on SpatialOS itself, however.

gleaming prawn
#

I have not followed since a long time, but ye, it would do scoped/culling properly, sync thousands of entities across super big worlds over the clients, scale the world simulation with clustering, etc

jade glacier
#

The issue I see with a lot of those models is they kind of focus on a certain game type that they draw from... but offer very little for some actual new game types like RocketLeague - but i could be TOTALLY wrong.

gleaming prawn
#

I have a friend there @clever silo

clever silo
#

Cool. We're a big company these days

gleaming prawn
#

ye, you guys got a lot of funding

#

Not sure if that will translate into profit..:)

jade glacier
#

funding and profit are definitely different worlds in tech 🙂

gleaming prawn
#

Emotitron, the SpacialOS premise is not "wrong" in itself, there's a case for MMO

jade glacier
#

MMO is also not going anywhere

gleaming prawn
#

It will just not be good for the stuff we solve well, for example

#

MMO is also not going anywhere
I'm not sure

jade glacier
#

It does seem like most games just opt to not doing a massive world like WoW, and just put everyone into smaller groups

clever silo
#

Definitely true to say that SpatialOS isn't a one-size-fits-all solution. I think any game networking expert will tell you that. Same goes for the UE4 model, etc

gleaming prawn
#

Now that's really TALKING something cool... I'll drop my opinion (I don' t care if you care, lol)

clever silo
#

WoW is actually a pretty badly-networked game - they just cover it up well

gleaming prawn
#

yep.-..

#

here's my take on the trends...

#

SO far, we've had these techs that try to solve different worlds (coming from different perspectives - I'll mention only 2, but you guys will get the idea):

  • quantum starts from small-mid sized games (2, up to 64 players per match), UE struggles to run 100, etc, Apex runs 60, etc
  • SPacialOS (and WoW poorly) come from the other end, MMO sizes...
#

ANd the gameplay PACING is totally different...

#

You cannot have 3k players interacting ACCURATELY at 60Hz, it's impractical...
So MMO tech is slow and scales
Accurate and fast tech can only deal with smaller numbers

#

What I THINK we'll see in a few tittles in the next few years, maybe (IF they became successful enough) is getting to the MIDDLE:

#
  • a fast/accurate game (like small scale netcode) with 200+ players...:)
#

This is certainly MY GOAL... lol

#

Lets see what will actually happen

clever silo
#

It's very hard to do, because the fast/accurate stuff tends to require predict/rewind/replay semantics, which carries a very heavy physics cost, and one that grows for every physics object you control locally

gleaming prawn
#

🙂

clever silo
#

Whereas MMOs don't attempt to do any of that, so they rarely need any physics interaction

gleaming prawn
#

Wait and see then...:)

clever silo
#

Good luck 😄

gleaming prawn
#

Ye, I mean... We know we can already do

#

And we know what we can technically do (not with pure determinism, BTW)... For me it's more a question of being a good approach business wise

#

YOu need to have a market for fast-paced games with 200+ players

#

Nobody even knows if such market exists...

#

You can't consider Unicorns the norm...

weak plinth
#

which came first, the chicken or the egg

gleaming prawn
#

ye

clever silo
#

Oh, there's totally a market. It's just tricky to do technically, hence why it's not already been solved by people who already know the FPS-style model well, like iD and Epic

gleaming prawn
#

It's just tricky to do technically
It's tricky to do efficiently enough to make it feasible in terms of business model...:)

#

Specially with the current state of affairs with F2P etc

jade glacier
#

I suspect most companies will just avoid trying to make a 1000 person battle royale.

clever silo
#

Well, sure - it's already solved if you're happy to only run 1 physics step per second 😄

gleaming prawn
#

No Kylotan

jade glacier
#

The lanes that work are pretty well defined now, and companies can choose the game type they are making and stick to the limitations of that type.

gleaming prawn
#

Not sure what exactly you work with, but I've seen interesting tests...

#

I think fholm mentioned here

#

10k players full KCC movement in <2ms on a single 16-core machine...

jade glacier
#

the big wall fholm slammed into was in the priority engine

clever silo
#

What is 'KCC'?

gleaming prawn
#

kinematic character controller

#

the big wall fholm slammed into was in the priority engine
we solved the culling... can't say much though

clever silo
#

I don't think any physics engine is capable of rewind and replay of 10K objects in a single step. So, either he's solved physics (which would be great beyond networking) or there is some other corner being cut

jade glacier
#

not for quantum, this was for his MMO BR experiments @gleaming prawn

gleaming prawn
#

A 200 or 500 player game is absolutely feasible...

#

I don't think any physics engine is capable of rewind and replay of 10K objects in a single step.
You don't, not for 10k

#

And yes @clever silo we write our own physics engines.

clever silo
#

I've worked on games where we had 800 concurrent players on one server, one world. That in itself is not so hard. The hard part is trying to do that and to have a simulation with FPS levels of consistency

gleaming prawn
#

That's correct

#

And with enough efficiency to pay for the server bill

#

To that regard, a game with 100 players is a lot more efficient than with 6 (considering you run dedicated servers per match/game)

#

But that if you solve culling/Scoping/priority-scheduled-updates efficiently...

#

800 with full server authority @clever silo ? and what specs?

#

I heard Epic runs an avg of 250 ccu per 4-core machine...

clever silo
#

Sure, if you do enough area-of-interest stuff you can reduce the physics simulation area down to that similar to an FPS, which is manageable. Then the problem becomes trying to do that at a fast enough network tick rate, because MMOs usually have to send 2 to 5 times less frequently than shooters do

gleaming prawn
#

y

#

the tick rate for network is typically 10-15hz

clever silo
#

We had 800 on our servers back in 2008. Full server authority. But it wasn't doing physics, or rollback, or any of that stuff. Just standard MMO tech

gleaming prawn
#

got it

#

I can't say much about our numbers unfortunately (on server, but >> 800).

#

Maybe I'll ask the Albion online guys, who run an MMO on photon servers

#

full server authority as well

#

It's not anything magic, you just use what you can... 800 in 2008 with full authority was probably correct/efficient

weak plinth
#

So, I am using Mirror and Im a little blocked. I dont know if anyone here knows about this, but how can I spawn different prefabs in the local and server? In the local it should be a first person prefab, and in the server it should see a full body prefab.

jade glacier
#

you should for simplicity sake make it one, and hide/show children based on hasAuthority or isLocalPlayer

weak plinth
#

So the GameObject should have both? The FirstPerson and what the others user see?

spring crane
#

Yea I feel like it would be convenient to have separate server and client models

weak plinth
#

I was trying [Command] private void CmdSpawnPlayerController() { Instantiate(pf_net_localPlayerController); NetworkServer.Spawn(pf_net_netPlayerController); }
But i get GameObject pf_net_netPlayerController is a prefab, it can't be spawned. This will cause errors in builds. Both of the prefabs are registered

floral turtle
#

@jade glacier is there any public info on perf with quantum? We don't want to rewrite our logic code for our project, but the core idea fantastic and really want to see how it pans out. I'm curious how well the rollback holds up with lots of physics objects...stuff like GGPO is obvs designed for smaller scale games

#

I saw a couple games with physics on the showcases, but nothing with tons of stuff (unless I missed it)

gleaming prawn
#

GGPO does not implement anything

#

But first:

  • thousands of stuff (like RTS) you would NOT use rollbacks... YOu would run quantum in lockstep mode
#
  • we do what we call prediction culling (only predict/rollback what is closer to camera), running most of the world in "lockstep" with confirmed inputs from the steady server input stream... But still
#

I can say the numbers for Battlelands Royale

#

512 raycasts, 400 kinematic bodies, 32 players, 4000 static colliders, etc

#

per frame

#

30Hz, mobile

floral turtle
#

ahh okay, yea something like prediction culling is what I was thinking. That's really cool @gleaming prawn

#

and yea ggpo ofc doesn't implement physics, but rather the games I know of it being mostly used on are smaller scale (fighting etc)

gleaming prawn
#

ye, GGPO also does not have ANY concept of clock sync + input batcjing for 2+ players

#

is really just for 1v1

#

Quantum has currently a hard cap at 64 players, and has been battle tested with 32 in several mobile games (battlelands royale being one of them)

thorn kestrel
#

@gleaming prawn ok thank you very much

pure vector
#

anyone used epics online services with there c# api?

meager crypt
#

Don’t know whether this is the right channel but I’m trying to create a game with a similar multiplayer to clash of clans. Does anyone know how to setup a server like that, from my understandings I need a centralised structure I think. And finally anyone know what youtuber or documentations I should look at?

jade glacier
#

Have you made any scrap learning networking projects first? Or completed some tutorials for the available net libraries? I would start there before trying to overthink any particular game type too much.

tidal zealot
#

Why might I be getting this error?

hard oasis
#

Im not sure but try this: in the PlayerMotion class definition where it says MonoBehaviour, add a comma and put IPunObservable @tidal zealot

heady trail
#

i do not get the option for adding networking component

#

i m using version 2019.3.13f1 64 bit

#

pls help me with this

karmic void
tidal zealot
#

i'm getting this error for putting this with my class at the top of a script

#

I believe I need to add the script component on my player to the photon view

#

but when I try and add it to the observable components in the photon view, I get this error

#

I feel like I can't do one without doing the other, yet it works both ways and neither work unless one of them does, and I don't understand

weak plinth
#

you have to implement the interface

#

@tidal zealot

#

an easy shortcut is click on IPunObservable, press alt + enter, and implement interface

tidal zealot
#

holy crap, thank you!!! been stuck on this error for a while now, what did that even actually do?

weak plinth
#

it's not really a networking thing but read up C# interfaces