#archived-networking

1 messages ยท Page 107 of 1

verbal lodge
boreal scarab
odd kite
#

I so confuse about this one lol

odd kite
#

I make kill report system but it add killCount for other player

#

How can I make it change KillCount for owner.client

woven crater
#

how to add photon players to a list ? any idea ?

odd kite
#

Photo network.playerList?

#

Idk

terse crow
#

Does anyone know how to sync random variables to other clients when they are generated in a for each loop?

boreal scarab
#

Im not sure how to phrase this question, bare with me: Is it a bad idea to program a game, which is supposed to have multiplayer in a later stage of development, in a way that its always using multiplayer coding? Singleplayer would just be hosting a game where other players cant connect

cold yacht
cold yacht
weak plinth
#

my movement doesnt sync to other players

#

im using if (isLocalPlayer)

#

but it doesnt work

woven crater
#

true
btw i got another question , using photon instantiation , got a array of spawnpoints , and i wanna instantiate each 1 depending on how many players in a room, problem is if a player disconnects , then it still instantiates and there is an spawnpoint that isnt being used and 1 that is being repeated , cant think of any other way to do it ...


        PhotonNetwork.Instantiate(PlayerPrefab.name, SpawnPoints[RoomCount].position, SpawnPoints[RoomCount].rotation);```
jolly wadi
woven crater
#

but it is a idea i can work on for sure .. so thx

cold yacht
#

Maybe instead of a list with counters you think of your spawn points as a Pool (stored in a list) player joins pull one out of the pool (off the available list) that player leaves put it back in the pool

tulip ledge
#

yo!
Does some know how to split mirror code in separated files?
Client code
Server code

we might want to make a separated project for the server. I can't find it on the internet or an example

patent fog
#

Maybe use preprocessor directives

spring crane
#

Partial classes might help. The handy syncing options in Mirror might assume a certain way of project structure, so you might need to abandon a lot of them. You can always revert to classic RPCs and network messages and forking the framework to fit your own needs.

#

What the benefit of using Mirror at that point is questionable though ๐Ÿ˜„

lyric osprey
#

Is there a way to separate a [Server] Start and a [Client] Start?

woven crater
#

quick question , in Photon , does every player has his own PlayerPrefs ? or do they all have the same vvalues for each key in playerprefs

sand dirge
#

Playerprefs are saved in the registry of the device

stable mist
#

hi I was watching the open projects devlog about scriptable objects and was wondering what would happen if my game is a combination of multiple scenes added on top of init would that cause any problem with mirror or in general when communicating over network?

high night
#

@woven crater nothing is shared unless you share it basically

#

or you use some component that syncs some variables ans stuff
like the networked transform component for example

weak plinth
#

When i try to do a command that destroys an object if you look at it and click e it says this? Trying to send command for object without authority

sand terrace
#

does someone has experience downloading 3d model from sketchfab through code with UnityWebRequest?

golden plume
#

i am trying to make my game multiplayer (with photon) but i keep getting this error

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

namespace a.parkour.fps
{
    public class launcher : MonoBehaviourPunCallbacks{


    public void Awake()
    {
        PhotonNetwork.AutomaticallySyncScene = true;
        Connect();
    }

    public override void OnConnectedToMaster()
    {
        join();

        base.OnConnectedToMaster();
    }

    public override void OnJoinedRoom()
    {
        StartGame();

        base.OnJoinedRoom();
    }

    public override void OnJoinRandomFailed(short returnCode, string message)
    {
        Create();

        base.OnJoinRandomFailed(returnCode, message);
    }

    public void Connect()
    {
        PhotonNetwork.GameVersion = "0.0.0";
        PhotonNetwork.ConnectUsingSettings();
    }

    public void join()
    {
        PhotonNetwork.JoinRandomRoom();
    }

    public void Create()
    {
        PhotonNetwork.CreateRoom("");
    }

    public void StartGame()
    {
        if (PhotonNetwork.CurrentRoom.PlayerCount == 1)
        {
            PhotonNetwork.LoadLevel(3);
        }
    }
}}```
#

and

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

namespace a.parkour.fps
{
    public class manager : MonoBehaviour
    {
        public string player_prefab;
        public Transform spawn_point;

        private void Start()
        {
            Spawn();
        }
    
        public void Spawn()
        {
            PhotonNetwork.Instantiate(player_prefab, spawn_point.position, spawn_point.rotation);
        }
    }   
}
#

both in C#

#

plz help

spring crane
#

Use those Photon callbacks to know when the state has changed. Alternatively poll the state through PhotonNetwork in Update. Don't throw this kind of stuff in Start and hope the state of the client is right.

ashen forum
frozen hull
#

hi

#

i use photon and animations on only one sprite, there is animation for change of character (as a state in the animator)

#

but when a player join the game

#

he sees himself well with his character, but the former players who have joined the game, see their character instead of the character chosen by the new player (and each time a player joins, he sees the characters well than the others have chosen)

#

if a bool in my scriptable object is set on true, it change the state in the animator and change the character of the player

weak plinth
#

how do i sync spawned prefabs across all clients?

#

i want to make it so when i go to drop a weapon it spawns the weapon right infront of the player

frozen hull
#

add photon view to ur prefab i guess

#

old player view :

#

new player view :

weak plinth
jolly wadi
#

Does anyone know how to hold photon chat messages in cloud scripts until the user comes online?

weak plinth
#

in mirror is it possible to have a client set an object to active and have it sync with all clients?

celest talon
#

could someone pls help me setup the network for my fps game. the type of network that I am using is MLAPI network and I am struggling to understand it. could someone help?

minor escarp
#

hi my if trigger isn't working. its on my player prefab in my resource folder. if you need script i can send

spring crane
frozen hull
# frozen hull hi

Pls reply to this question, it's the 3rd time i ask for help about this

sleek magnet
#

Does anyone know what online networking is the reliable one right now?
I remember UNet, then it got deprecated, then people moved to 3rd party like Mirror or Photon, cause Unity promised a new one called something like "Multiplay" that would take 2 years to come out, but it still hasn't.

#

What is currently the stable/reliable networking solution to use for Unity?

verbal lodge
#

Multiplay is not a netcode solution like UNet or Mirror it is a hosting and orchestration service for game servers. Our new netcode solution is called MLAPI it will be a replacement for UNet and is currently available as an experimental package.

sleek magnet
#

New?

#

Wait, isn't MLAPI part of the list of networking solutions that were compared to each other in forum posts for like 5 years?

#

Is that the one made by that 1 person. I swear I've heard of it, and even used it.

verbal lodge
#

Yes it is, we acquired MLAPI.

sleek magnet
#

That's pretty cool, though. Cause a bunch of networking solutions have been made, Mirror, Forge, etc, and Unity ended up acquiring that one.

#

That original author must be proud.

verbal lodge
#

He joined us and is still working on it.

sleek magnet
#

Yeah, he deserves a good position at Unity.

#

But one thing's bugging me, though.

#

One flaw with all these solutions was that they were all good alternatives but never good as a best choice altogether.

#

That's why, after all, we were waiting for Unity to make a new modern one with no limitations, etc.

#

It just feels off that after deprecating their own, and having no answer for a few years, and then finally, they didn't end up making one, and just acquired one of the alternatives to improve it.

verbal lodge
#

I get what you mean. It feels a bit like that. But we had to start somewhere. I think what's important is that we finally have a large focus on multiplayer and a team behind it. MLAPI is one of the solutions we are pushing but we also have the new Unity transport and our ECS based netcode etc and more stuff coming up soon.

pine lynx
#

I have a question regarding scene switching in MLAPI. I want to have a MP game running in the "Main Game" scene and allow players to jump in and out as they please, but through a separate menu scene. Any quick tips on how to achieve that?

  1. Host loads the menu scene, starts server (sets password) then starts the game and plays around
  2. Additional players starts the game, loads the menu scene and then joins via IP/Password and gets put in the correct "Main Game" scene.

I'm slightly confused on the best way to handle this. All the examples I've seen have the menu in the "Main Game" scene and just show/hide the UI. Is this the recommended way, or just a shortcut they've used? Having a separate menu scene seems like the best way IMO. The solution with hiding UI I can do. Separate scenes I struggle with.

#

Is it done in the HandleClientConnected callback?

Edit: Yes it is. Yet again the solution is to just form a question on a forum and you find the solution yourself right after. LMAO. Thanks for coming to my ted talk. I'll leave this up in case someone else has this issue

shrewd swallow
#

Hey ! I have this i can't resolve ... Failed to find a PhotonView with ID=999 for incoming OwnershipUpdate event (newOwnerActorNumber=1), sender=1. If you load scenes, make sure to pause the message queue.

cold yacht
cobalt python
#

Hi! i am using photon. Is it possible to clear only specific buffered rpc from a specific player? (not all player's rpc's, not all object's rpc's)?

#

autoCleanUp is false

jolly wadi
tribal axle
#

What is everyone preferred way of doing networking (mirror, etc), why & how did you go about learning it (Iโ€™m trying to get started & learn networking)

cobalt python
cold yacht
gleaming prawn
#

There're much more sophisticated solutions than send-RPC+send-unreliable. Good networking is about how you implement your simulation, not how you transfer data (that is commodity).

#

Also, photon is a company. Probably you are talking about PUN (the most popular photon library).

#

If this is a new game, I'd suggest you look into Photon Fusion, as both PUN and Bolt are considered legacy products now.

balmy barn
#

Hey, I tried using the new MLAPI system, I successfully managed to start a server (very laggy however) but when I join I get disconnected after like 20 seconds with this error:

Assertion failed on expression: 'channel->remoteReceivedFragmentedEvents->IsInWindow(evnt)'

A friend tried too and got no issue
Would anyone have any idea what it means and how I can solve it?

verbal lodge
#

Haven't seen that error before and not sure why you are getting it. Are you using the UNet transport and is there an addition stacktrace for the error which you could provide?

balmy barn
#

No error, it's just disconnecting

verbal lodge
#

What do you mean no error? What about the one you posted above?

balmy barn
#

Sorry, I meant I have the error but there is no stack trace associated with it

#

I'm trying to reproducing it but I'm waiting for the other guy to be free because I think it's related with 2 players connecting at the same time

verbal lodge
#

Ah okay? You are using UNet transport right?

balmy barn
#

Yes

verbal lodge
#

So I'm pretty sure (but not entirely) that the above error is either the Unity engine itself or the Unity editor and not related to MLAPI.

balmy barn
#

Um well I can't reproduce it so maybe I changed something and somehow fixed it?
I'll try asking again if I manage to get more information

But since I'm here, would you know any good tutorial on player sync? My prototype is somehow really laggy and my code is just having a NetworkVariableVector3 and updating its value

verbal lodge
#

I'm not sure if there's a good tutorial around for making it smooth currently. In the next version we will have a lot of improvements to make NetworkTransform smoothly replicate positions.

balmy barn
#

I replaced my NetworkVariableVector3 by a NetworkTransform and things are much better now, thanks

balmy barn
#

(Well I managed to reproduce my crash fairly consistently but still no info)

verbal lodge
#

Can you create an issue on Github and include the reproduction steps? We'll investigate this.

balmy barn
#

Sure, thanks

pine lynx
#

Is there a reliable way to check if a server is running when connecting? Using MLAPI and Photon realtime transport.
So StartHost if server isn't running, else StartClient

sinful flare
#

Hey guys, I'm getting a strange error with regards to a Dictionary. It keeps telling me that i need to use a supported type or provide a custom writer, and that my dictionary<string, string> is an unsupported type. I'm not trying to [SyncVar] it

golden plume
#
using Photon.Pun;

public class Target : MonoBehaviourPunCallbacks
{
    public float health = 50f;

    public void TakeDamage(float amount)
    {
        health -= amount;
        if (health <= 0f)
        {
            { photonView.RPC("Die", RpcTarget.All, 0); }
        }
    }

    [PunRPC]
    void Die()
    {
        gameObject.transform.Translate(0, 200, 0);
    }
}```
  i have this target script for my multiplayer game (it puts the player it the sky when they get shot) but i keep getting this error when i try to shoot the other player

if it helps this is the gun  script 
```using UnityEngine;
using Photon.Pun;

public class gunscript : MonoBehaviourPunCallbacks
{
    public float damage = 10f;
    public float range = 100f;

    public Camera fpsCam;

    // Update is called once per frame
    void Update()
    {
        if (!photonView.IsMine) return;

        if (Input.GetButtonDown("Fire1"))
        {
            Shoot();
        }
    }

    void Shoot()
    {

        RaycastHit hit;
        if (Physics.Raycast(fpsCam.transform.position, fpsCam.transform.forward, out hit, range))
        {
            Debug.Log(hit.transform.name);

            Target target = hit.transform.GetComponent<Target>();
            if (target != null)
            {
                target.TakeDamage(damage);
            }
        }
    }
}```
#

using photon

jolly wadi
#

Can anyone help me with storing Photon Chat private messages until the certain recipient gets online to receive the message?

stiff ridge
# golden plume

Unreadable image. Maybe photonView.RPC("Die", RpcTarget.All, 0) should not have the 0 as parameter. Or the method should have an int parameter.

golden plume
#

i fixed my problem

#

srry

stiff ridge
#

That's good ๐Ÿ™‚

stiff ridge
jolly wadi
gleaming prawn
#

You could store them outside, and then the person would be querying that from this outside service...

#

What Tobi said is that this is not doable with photon chat alone...

#

But I'm not sure about the webhook for chat (have not tried that myself/haven't seen it)

jolly wadi
#

Yes that I agree with someone called JohnTube recommended web hooks which looks very good method of doing it but I do not understand it at all to be honest ๐Ÿ˜ณ

gleaming prawn
#

you could technically also have a backend subscribe to all chat "channels" as a "client" just to store the full histories, tec

gleaming prawn
jolly wadi
#

He also recommended making public chats with just the two users as it saves messages easier but that would create too many public channels

gleaming prawn
#

The point is you need to store the history somewhere else, like a Firebase thing, etc... And then the player would query the "past history" from that, not from photon chat

jolly wadi
#

Yes I have playfab integrated would that help?

#

Something like a cloud script

#

That I can call๏ผŸ

gleaming prawn
#

if that can be made into a URL, probably yes... Perhaps you should join Photon's Discord and ask in the chat channel

#

I don't work directly with chat

jolly wadi
stiff ridge
#

I asked JohnTube as he's the expert. His reply:

private messages can't be saved using webhooks

gleaming prawn
#

that's why he recommended with public channels then

jolly wadi
#

But would having many public channels ruin quality or something ๐Ÿคทโ€โ™‚๏ธ

stiff ridge
#

You may work around this with public channels but .. honestly, if someone isn't online, just use the service (the one you'd have to build to store stuff) directly. send the msg there...

#

If you also build for mobile, it might even make sense to look into the services which can do push notifications for your app. So you could add (e.g.) inviting friends who are off.

jolly wadi
stiff ridge
#

Can't guarantee quick replies but once in a while we check here ๐Ÿ™‚

spark copper
#

Hi guys, i have been playing around with mirror about a year ago. I am doing a small multiplayer game project. I have seen Unity has now released a networking system, and i'm wondering if it is worth it before diving into it and then realising it's maybe not mature enough after a week of documenting myself?

jolly wadi
# spark copper Hi guys, i have been playing around with mirror about a year ago. I am doing a s...

If u are talking about Unet I heard it was deprecated and I would recommend something like Photon, Mirror or if your feeling it MLAPI because they seem to have many tutorials if you just starting off and anyway if Unity did release a new one there are bound to be pit stops and it will take a while to get it out there ๐Ÿง Small edit I realise you were referring to MLAPI Iโ€™m not an expert at this but I heard that this is hard to learn if your new but I donโ€™t see any problem in looking straight into the documentation that is the best way to learn isnโ€™t it๐Ÿคจ

mighty sail
#

Hello I have some errors (in image) and I dont know why and how to fix that, its shown only when I try to build my project
Using Mirror network

#

Someone know why does it happening?

spring crane
#

Tried recreating the network identity on that object?

#

Is it a scene object?

mighty sail
spring crane
#

Scene object is a object contained in a scene

mighty sail
#

in here for EX

plush flint
#

When players are shooting I use object pooling for their projectiles, But I'm not sure what approach should I choose when some player dies and needs to be respawned, should I still use object pooling for player characters or in this case it's also good to just use Instantiate? Don't know If I should always avoid Instantiate in networking games or If there are cases in which their usage is okey, as for example respawning players character after he dies.

mighty sail
spring crane
#

By having an object in a scene

#

All the objects in the hierarchy are scene objects

mighty sail
spring crane
#

No, I'm just asking what the situation is

#

It telling you to open a scene called "" is a bit odd, so something has probably gone wrong

#

Where is that object?

mighty sail
spring crane
#

And it's not present in any scene?

mighty sail
#

The base of this Variant OBJ is presented in other scene

#

but its in non-Multyplayer scene like the singleplayer scene of the game

spring crane
#

The networkidentity probably doesn't know that

mighty sail
#

So is there a way to do that?

spring crane
#

Just meant that the networkidentity and that build check probably aren't trying to figure that out. It's a functional network identity regardless

#

Did you try recreating the component on the scene object?

#

Or on the prefab

mighty sail
#

yes I tried to remove and recreate

spring crane
#

On the prefab too?

mighty sail
spring crane
#

Not sure. I would make sure to be on the latest version of Mirror. Post on the Mirror discord with the info about it being a prefab variant etc.

#

Is your Mirror version recent?

mighty sail
mighty sail
spring crane
#

I think that error is specifically trying to protect against bad scene objects

silk helm
#

Does anyone here know how to use Firebase?

abstract moon
#

Hi everyone, Im using MLAPI, and my ClientRPC are not being called if I destroy the object right after

using Unity.Netcode;
using UnityEngine;

public class TestBug : NetworkBehaviour
{
    public override void OnNetworkSpawn()
    {
        base.OnNetworkSpawn();
        
        if(!IsServer) return;

        Debug.Log("Before RPC");

        TestClientRpc();
        Destroy(gameObject);
    }

    [ClientRpc]
    private void TestClientRpc()
    {
        Debug.Log("RPC called");
    }
}
#

In this case TestClientRpc isn't called, is this normal?

spring crane
mighty sail
#

just a weird bug with the Mirror plugin I guess

spring crane
#

That's pretty interesting

abstract moon
#

@olive vessel I know that's why I added if(!IsServer) return; in there

olive vessel
#

Mea culpa. Try not destroying the object?

abstract moon
#

I tried but in the usecase where I get this bug I could really use being able to destroy the object. I also tried calling the RPC from OnDestroy but MLAPI gives me some errors as I am not supposed to instantiate stuff from that method

zinc hull
#

Is there any nice tools for making fps multiplayers?

normal dust
#

I'm following the Unity network steps for project Hello World. When I press play it crashes. It says the Network Transport is missing and trying to fix but I set it to UNetTransport. When I exit play mode after crash it doesn't have UNetTransport selected anymore. What do I do?

#

I follow every step. I've remade the project 2x and reinstalled. Same error.

#

This is MLAPI

normal dust
#

oh dang. ๐Ÿ˜ฆ Ok thank you!

#

2020.1.13f1 is my version

verbal lodge
#

Yeah if possible upgrade to 2020.2 or newer and it should work.

normal dust
#

The sad part is I have a HUGE project and it will need to upgrade as well cuz I want to add multiplayer to it now

sinful flare
#

does anyone know why my server might not be picking up Colliders for Raycasting while the client finds it just fine?

#

Server (left), Client (right)

#

Both send out raycasts and place dots at either their maximum range, or the point that they hit

grim lagoon
#

i have a problem using MLAPI i'd like to sort out.

so i have a unit which is a networkbehaviour.
it's structure is
unit

  • in world ui
  • an arbitrary 3d object ( a sphere )
  • a gameobject that is another prefab that is instantiated via script, this is the fbx model of the unit along with child transforms of other meshes

when i spawn the unit through an rpc, it appears fine on the host but on the client, it's missing the gameobject but the other 2 are syncing fine

is it because this was the go was not inside the unit prefab when compiled so the networkmanager doesnt 'detect' it or something? how would i go about solving it

#

should that gameobject have a networkobject has .Spawn() called on it as well? id have thought it didnt need that as the other two objects show up fine

#

(Fighter2(Clone)) is the object i am referring to that is generated when the unit finds out what type it should be

#

i'm trying to avoid making a different prefab for every ship type which is why im doing it that way

grim lagoon
#

i seemed to have partially solved it by making a prefab for each fbx file with its own networkobject in it i think

woven crater
#

hey , how would i go about making a #1 spot that displays the player that has the most points (if he wins a minigame he gets a point) , and then i synchronize it to all players to display the player with most points using a text Using photon ?

snow escarp
# sinful flare

in the client side, the walll also casts a shadow. Is that ommited in the server side or are your raycasts not working for it either

severe canyon
#

dose anyone know what is wrong OnDisconnected is not working it says it is not a thing please help

olive vessel
#

OnDisconnected from what networking solution?

severe canyon
olive vessel
#

Is your class is derived from MonoBehaviourPunCallbacks

severe canyon
olive vessel
#

Disconnect being?

severe canyon
#

sorry this is the error Assets\testconnect.cs(22,42): error CS0246: The type or namespace name 'DisconnectCause' could not be found (are you missing a using directive or an assembly reference?)

olive vessel
#

So you're missing the Photon.Realtime namespace then

severe canyon
weak plinth
#

which network do you suggest for unity ? photon, mirror, darkrift or else?

jolly wadi
weak plinth
weak plinth
olive vessel
#

Even before the edits, was that graphic ever liked?

gleaming prawn
#

This graph (original one as well) does not even include many solutions, not to mention several fundamental problems with it

weak plinth
#

It seems I choose mirror network to learn and use

spring crane
#

@weak plinth You are more likely to get appropriate suggestions if you told us what kind of game you were making. RTS FPS and MMOs generally use wildly different networking setups.

weak plinth
weak plinth
stiff ridge
#

Depends on who you ask.
Either is fine to experiment. Actually, take your time and get to know more than one solution. Some of the benefits of some solutions are hard to understand, when you never experienced what can go wrong in which way...

gleaming prawn
#

Photon is also a company, so there are many products for different cases...

#

So saying to use or not use Photon just like that already tells this is someone not very familiar with networking solutions...

weak plinth
#

ok but.. he uses DarkRift for a game like Minecraft (online) , I had chatted with him and he suggests Mirror or Darkrift to use

#

maybe because of Photon's optimization or some lag problems

gleaming prawn
#

Again, I have no idea what "photon" product he's talking about

#

it really depends on which kind of game you are trying to build

weak plinth
verbal lodge
#

I'd recommend to you to learn more about the solutions you mentioned. Shouldn't take too long just watch like a 10 minute video of how they work. Darkrift, Mirror and PUN are very different so I wouldn't try to compare them to each other directly. Figure out how they work and take whatever you think fits your way of working the best.

gleaming prawn
#

I'd strongly recommend you to check Photon Fusion as well (specially if building something fast paced)...:)

#

And like Luke said, trying all the different solutions, learning what they do and how is the best approach for someone with not a lot of experience.

spring crane
#

@gleaming prawn How did the Fusion WebGL evaluation go?

weak plinth
#

Luke and Erick , thank you so much for your recommendations ๐Ÿ™‚ I'll watch some videos about this networks and try it

#

then , i will decide which one should i use or not

gleaming prawn
#

But it's still there...:)

spring crane
#

Hope lives on ๐Ÿ˜„

cold yacht
#

Oh nvm you said webgl. Those always equate in my head for some reason...

spring crane
#

Well pretty close, but yea I'm more interested in the high level bits of Fusion than the transport layer ๐Ÿ˜›

undone cypress
#

Hello I have a problem with an asset: Photon network classic. I have several errors (picture below) which annoys me, I also have an element this element is PUN WIZARD but it is especially the errors, thank you for your help good evening

spring crane
#

Any specific reason for using PUN classic btw?

undone cypress
#

I follow a youtube tutorial that uses this asset: Photon Unity Networking Classic - FREE

spring crane
#

Probably better to switch something a bit more recent. PUN2 has been out for a while now

undone cypress
#

i use them but its not good as script

terse crow
cold yacht
#

If there are two updates, one for the player one for the child object. There may be enough network jitter to cause update delays between those two (one will lag the other occasionally)

terse crow
# cold yacht If there are two updates, one for the player one for the child object. There may...

I don't think I have two updates? Although I'm not really sure.
Here are my scripts if you want to take a look at them:
https://pastebin.com/BHwY5ch8 (player script)
https://pastebin.com/W2PzMsrw (script that is on the gameobject that stutters)

cold yacht
terse crow
cold yacht
terse crow
cold yacht
# terse crow Oh, yeah I am.

That's what I meant by updates here. As those are synchronizing position they may be out of sync on the remote side even on though on the local side they're perfectly matched because of the parent child relationship

#

One fix to that is to disable the Transform view while its parented and just rely on the parent's sync to move the child around correctly on the remote side

terse crow
#

That fixed it, thanks!

cold yacht
#

oops. Is that a remote object you're dropping?

#

(not locally controlled by the physics simulation but just updating through the Transform view?)

terse crow
cold yacht
#

And if you haven't seen these: https://gafferongames.com/post/introduction_to_networked_physics/ they are very good

terse crow
cold yacht
terse crow
#

Alright, I'll see if adding one of those improves anything.

cold yacht
#

good luck!

terse crow
#

Thanks!

sturdy mountain
#

Is anyone using photon quantum?

grim lagoon
#

i've got an issue with serverside bullets not always calling a client rpc when they collide

#

it seems something like a 10% chance that when they hit they call the rpc, it's weird

#

all it is, is a BulletHitClientRpc(); inside of an OnTriggerEnter()

grim lagoon
#
    void OnTriggerEnter(Collider other)
    {
        if(!IsServer) return;        
        if(other.gameObject == shooter) return; // don't collide with shooting ship
        if(!other.GetComponent<Unit>()) return; // don't do if collided object doesnt have unit component;
        if(other.GetComponent<Unit>().team.Value == shooter.GetComponent<Unit>().team.Value) return; // don't do friendly fire

        BulletHitClientRpc();
        ...
#

but out of all that i got... three collision rpcs? seems really weird

#

could it be that sometimes the bullet gets destroyed on the server which destroys it on the client before the rpc goes through?

#

i think that actually might be the case. because i changed the destroy method in the triggerenter to not be instant. i am probably doing that the wrong way

woven crater
#

hey , say i have an array of Score texts , and i want it that when a player i save his nickname into the element of the array of the order that he joined it(if he joins 2nd , he gets the 2nd element of the array) , but then i would like to save that Element By him , how would i do that , like i would like to call back that array by his nickname or something (Using photon)

cold yacht
# grim lagoon i think that actually might be the case. because i changed the destroy method in...

That would definitely be a problem. :) Another way to handle this is to simulate the bullet effects locally and correct mismatches. That is if bullet changes health both sides locally simulate that health is going down and use an unreliable state update to say "health is now actually, x" from the authority. Assuming pretty deterministic simulation the final health value won't be far off from the local one.

cold yacht
weak plinth
#

Can anyone here who has worked with MLAPI please help me? i have a problem that ive been trying to fiugre out for 2days now

oak flower
#

@weak plinth Don't ask to ask.
You could also try asking in dedicated MLAPI server, link in the pins.

oak flower
#

@weak plinth Ask an actual question.

weak plinth
#
using MLAPI.NetworkVariable;
using MLAPI;
using MLAPI.Messaging;
using UnityEngine;

public class Pistol : NetworkBehaviour // PISTOL IS SEMI AUTOMATIC
{
    // Update is called once per frame
    public NetworkVariable<float> ShootTimes = new NetworkVariable<float>(new NetworkVariableSettings {WritePermission = NetworkVariablePermission.Everyone, ReadPermission = NetworkVariablePermission.Everyone}, 100);
    private NetworkObject LocalPlayer;
    void Start()
    {
        LocalPlayer = gameObject.transform.parent.parent.parent.parent.gameObject.GetComponent<NetworkObject>();
    }

    void Update()
    {

        if (Input.GetButtonDown("Fire1") && LocalPlayer.IsLocalPlayer)
        {
            Debug.Log("ButtonDown");
            ShootServerRpc();
        }
    }
    
    [ClientRpc]
    public void ShootClientRpc()
    {
        Debug.Log("ClientRpc");
    }
    
    [ServerRpc(RequireOwnership = false)]
    public void ShootServerRpc()
    {
        Debug.Log("ServerRpc");
        ShootClientRpc();
    }
    

}

#

This code. For some reason when i start a dedicated server and join game (join as client) i am not able to call serverRpc

#

"ButtonDown" shows up in console but nothing else

olive vessel
#

Not sure what that local player check is but holy hell

barren onyx
#

Looking into multiplayer stuff, Would it be more efficient to use Vector2 to replicate across the internet for first person shooter "rotation" the x can correspond to the horizontal movement, and the Y represent up and down of the camera, this saves me two bytes of data over the internet rather than using Quaternion?

split zenith
#

Hello everyone, how do I send an RPC only to a certain interest group in photon pun2?

burnt frigate
#

um i need help with unity photon.., here is the ^problem :

  • the player who instantiate the mob see the mob move smoothly ,
  • but the player who did not instantiate seem to see the mob "tp"

if you can help me i will be very happy : D

high night
#

@burnt frigate the owner of the mob simulates the mod so it will be updated at nice 50 fps

#

but the player who is viewing it will recieve position information at a slower rate like 10 times per sec by default (i think)

#

maybe if you are using network transform component or something the is a setting to interpolate the body

#

or you can do the interpolation yourself, make your own networked transform component

vivid shale
#

why when I put "play" my character not seem in the game I am using photon but I do not know why it not working for me...

character = charactercontroller + script + cinemachine follow camera

vast ingot
#

Hey can someone please link me to an explanation on how to create a client socket in unity?
for a school project I need to create a multiplayer unity game with a python server

split zenith
grim lagoon
#

mlapi isnt doing it for me unfortunately, so now im deciding if i should go with pun2 or mirror, the most my games will be is probably 4 person lobbies in an rts, maybe 8. having someone be a server host would be nice rather than having to have something on a server. although i do like how easy pun looks to set up it looks possibly costly

#

is mirror still a good goto nowadays?

jolly wadi
gleaming prawn
#

You said rts

#

For rts you are normally talking about determinism. The only product that is design for that is photon quantumโ€ฆ you also have a few lockstep libraries around (easy google search)

zinc hull
#

Is it easy and possible to set up a peer to peer connection with something like the new ML-API?

#

One of the players being host, like a little server

olive vessel
#

MLAPI can do that yeah, the host will have to port forward unless you use a relay service or something though

#

I believe there is a Steam P2P transport, which can act as that relay for you

zinc hull
#

Hmm okay, cause im thinking in case of a mobile game where a player can invite another to their server, like minecraft or any other survival

weak plinth
#

guys, i have a question
My player has 3 attributes: speed, max ammo, and bow range
There are upgrade items that add or decrement the value of this attributes
The player movement is made locally, while the upgrade pick up is made on the server with a ServerCallback
Why the speed doesnt update on clients but the other attributes do?

mint stratus
#

How long would it take to make a multiplayer when all of my assets are completed. (Gui, maps, guns etc.)

olive vessel
#

Depends on your level of programming, ability to learn etc

mint stratus
olive vessel
#

Would you say you're a beginner at using C# in Unity?

mint stratus
olive vessel
#

Ah, well multiplayer introduces a whole new level of pain and heart break

mint stratus
#

I just want a system where you choose a gamemode and you get put into a lobby as a host or guest then a map is randomly chosen to play on.

austere yacht
mint stratus
#

Right now i have a gun and movement down, i hope by the time i get all my other assets done ill be better ready

gleaming prawn
#

If you have fun and movement down in single player, you will have to rewrite all that on multiplayer

#

Take the others advice, start with something a lot simpler

tribal axle
#

I'm getting this error when trying to display impact effects for all players. (Using Photon) This is a method inside a class called 'StandardGun' which is attatched to all of my gun objects.

mint stratus
#

Atleast thats what got from the tutorial i watched

gleaming prawn
#

To do a proper multiplayer, you write the game as multiplayer from day one

#

That's what I do for a living... You can do a simple port, but that won't be a proper multiplayer with tick feeling, etc

mint stratus
#

Do you if theres a way for a matchmaking system to choose a host, have the hosts computer run the server, and then the matchmaking fills other people in?

rotund salmon
#

hi i want to make a multiplayer fps game, so i already made the player with the movements weapons shooting system reloading and swapping wep.

everything works fine in signleplayer but when i started setting up the mlapi the only thing that works is movement but if i shoot from a client the other one does not see the particles, the weapon movement does not show for the other ( i attached the weapons to the camera so it follows camera rotation, the other client does not see when i change wep, and basically it can't see nothing, can someone help?

olive vessel
#

What you're asking for help with, is an incredibly large topic

rotund salmon
#

ah

olive vessel
#

You need a combination of NetworkVariables and RPCs

rotund salmon
#

thanks i guess i'll search them up and see what i can do

olive vessel
#

Yeah, the MLAPI docs are pretty good tbf

rotund salmon
#

btw do i have to add the networkobject component to every child of my player?

olive vessel
#

I think the root having one is fine, but the docs might say otherwise idk

verbal lodge
#

Only put it on the root.

split zenith
split zenith
#

please help

terse relic
#

How do u sync models across mobile and pc? Eg. Low poly model on mobile while there's a high poly model displayed on pc. (Would like to know how to handle both scenarios of preplaced static objects and instantiated objects that may or may not be destructible.

mint stratus
#

You guys make it sound really hard. Ill think ill just make an open world game similar to how hypixel skyblock works but with guns and aliens

olive vessel
#

Honestly, bang out an MMORPG in minutes

burnt frigate
#

the owner of the mob simulates the mob so it will be updated at nice 50 fps
but the player who is viewing it will recieve position information at a slower rate like 10 times per sec by default (i think) , how to make that the player who is viewing see 50-40 fps too?

robust cypress
#

basically try to guess where the mob will be and make it move there and then correct that with when you get the next reading

#

good networking is endless tweaking

burnt frigate
#

oh

#

um

#

but

#

is there a way to send

#

more often?

olive vessel
#

State your networking solution

burnt frigate
olive vessel
#

Well presumably it doesn't work by prayer, is it Photon, Mirror, MLAPI, Sockets?

burnt frigate
#

oh its photon

regal delta
#

the latency on prayer can be pretty bad

jolly wadi
rotund salmon
#

yo guys how do you disable a gameobject for every client, i would do:

gameObjectName.GetComponent<NetworkObject>().Despawn();

but the object i want to the spawn is a child of a networkobject so it doesn't have the networkobject component, and i don't want to give him the component becouse i'd get an error when i connect with the client to the host

jolly wadi
#

There is no lag compensation or anything

rotund salmon
#

yeah mlapi

jolly wadi
#

Oh soZ donโ€™t use that

rotund salmon
#

what

jolly wadi
#

I donโ€™t use MLAPI

rotund salmon
#

ah

jolly wadi
#

Do they work with RPC?

rotund salmon
#

ye

jolly wadi
#

Could you network the deactivation?

#

To all clients

vagrant nest
jolly wadi
#

Ok what is the full error

#

And also what do you mean by teleport I donโ€™t see any teleportation in the video provided

vagrant nest
#

no, the lag happens on the soccer ball, when it changes the owner it teleports

jolly wadi
#

But I just see it roll

#

It looks like it just rolls to the player

#

Also what is that error

vagrant nest
#

i will send other video wait

#

the game I made is like football, where the player needs to have the ball to owner the ball, the error is the following when it changes owner it kind of teleports and there is a delay with it, I tried everything I couldn't solve .

amber trench
#

when player A owns the ball logically, the interpolated ball is shown on player B's screen.

vagrant nest
amber trench
#

i think you should try to make the basic version first

#

without change in ownership at all

#

it should work perfectly over a local network without dealing with ownership changes

wide current
#

Hey! Iโ€™m using mirror and currently just hosting locally. Others are able to connect to me but my brother who is on the same network is not able to. Does anyone know how I can fix this so that he can play with us?

cold yacht
vagrant nest
wide current
cold yacht
#

You could also setup a separate local connection but that's a pain and he should be able to come in on the same port as the others as long as he can route to you correctly (and you're listening correctly)

wide current
#

Yeah Iโ€™m binding it to my public ipv4 I believe

cold yacht
#

Try just binding to 0.0.0.0 instead

wide current
#

Ok Iโ€™ll try. Will others be able to connect though?

cold yacht
#

Yeah shouldn't be a problem as long as your router is forwarding to your machine

#

The ip binding limits how people can access (I don't really know why you'd want that...) vs just knowing the right port

#

Maybe securiry...

tribal axle
#

Im getting this issue with Photon Pun 2 when trying to create a way to leave the game:

cobalt python
#

Hi! Question about pun. Is it possible to wait for network lag? I have some king of quest terminal in my game, and players can interact wit it. There is a list of quests, same for all, and any player can take a quest. When a player takes quest he sends rpc and stores his nick (he took it) and quest becomes unavailable for others. But when 2 players take the same quest both of them succeed as information about, who has took the quest already, is not received yet. What can i do?

cobalt python
spring crane
cobalt python
rocky bramble
#

Is it possible to use websockets in webgl build?

cold yacht
rocky bramble
#

@cold yacht Can i have a link to this resource, please?

rocky bramble
#

@cold yacht Thanks mate, is it possible to use raw websockets in this nakama library?

cold yacht
quick folio
#

anyone ever use photon to sync huge amount of Scene objects ? i mean, not like sync them all at once ,some of them may just need to be synced from time to time ,some are high frequency sync,but not too much

cold yacht
quick folio
#

Like manage all the objects in one script

cold yacht
quick folio
#

Same as i did before.but photon limits the count of photonview that needed to be less than 999, which sucks

cold yacht
quick folio
#

I heard Unet don't have this kind of limitations only photon,jezz

olive vessel
#

UNet's limitation is that it's old, crap and deprecated

#

Don't use UNet, use Mirror or MLAPI for UNet-like solutions

quick folio
#

Yes im awared

azure yarrow
#

Hey

#

How can i make multiplayer game

#

without Photon

#

I still canโ€™t find one tutorial about 2d yet

olive vessel
#

Search for tutorials using Mirror or MLAPI

twilit breach
#

Hello, I need help on this :

toSend = (int)RPC_STATE.DUEL_ACCEPT+"|"+view.ViewID+"|Accepted";
if(isSendingToMe != null)
  view.RPC("SendRPC", isSendingToMe.GetComponent<PhotonView>().Controller, toSend); // <======= this won't be sent until
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = "D:\\edopro\\bin\\debug\\ygopro.exe";
startInfo.Arguments = "1 test test";
var emulateur = Process.Start(startInfo); //<===== This ended
spring crane
#

@bold goblet Not a place for job posting. There is a section on the forum.

spring crane
odd kite
#

hey I just start learning photon pun is there a way to check kill?

#

Can I check from killfeed?

tribal axle
#

what exactly are you trying to do? Like tell another player who killed them?

odd kite
#

Ummm

#

I just

#

want to check

#

like

#

player1 kill player2

#

how to tell player 1 that him got kill

#

Now I just use to check from killfeed

#

that if shooter name(from rpc) == client name he just kill someone

#

and keep variable in playerManager(so when he die his variable won't change)

#

but now

#

it assign variable for anoter playerManager

#

How can I assign variable for client playerManager?

tribal axle
#

@odd kite So hangon, are you trying to tell player1 that he killed player2 (e.g message 'You killed player2!'). Or tell player2 that he was killed by player1 (e.g message 'You were killed by player1')

odd kite
tribal axle
#

ok well im assuming you've followed RugBug's tutorial up to this point (seeing as ur in his discord)

#

so make IDamageable.TakeDamage() return a boolean

odd kite
#

yeah lol

tribal axle
#

if they die, return true, if they dont die return false

#

then when you call for them to take damage, if it returns true (meaning that they've been killed), player1 now know that he killed player2

odd kite
#

oh thx

#

I just

#

stuck at this point for a week

tribal axle
#

np haha

odd kite
#

um

#

nnow

#

I can track kill

#

but I want to add killCount to playerManager

#

so when I die kill won't lose

#

but now it add killCount for oter playerManager

#

how can I fix it

twilit viper
#

Hi guys, i'm working on create a scalable MMO architecture.
I'm thinking in use Redis to communicate between servers nodes to share information/message.
I need the communication be fast, im thinking in use Redis or directly TCP Connection.

Any recommendation? any tutorial or something about this?

#

or any know any other discord or forum to talk about online or networking with or without unity?

azure yarrow
#

Hey are there any other ways to do 2d to do online multiplayer without photon

olive vessel
#

I told you last night to Google Mirror and MLAPI

#

Danny mentioned not getting hung up on the 2D part, it's entirely irrelevant

azure yarrow
#

Ok

#

Then what should i do

#

Youtube is literally cluttering with photon engine online multiplayer

olive vessel
#

Three times, let it sink right in

#

Mirror and MLAPI are networking solutions, because you seem to dislike Photon PUN for some reason

azure yarrow
#

Ok den

#

And what the hell is google mirror

#

It just shows me a reversed google

#

You mean mirror?

#

Like not google mirror

#

Like the asset?

#

I would prefer MLAPI

olive vessel
#

They are two words

#

Google, and Mirror

#

Mirror is a networking solution for Unity

#

Whether you use Mirror or MLAPI is entirely your choice, there are tutorials for both solutions available online

spring crane
cerulean crescent
#

Hello there! I'm working on a 2d top down shooter battle royale and I'm evaluating game session options.

I'm using MLAPI and I'm wondering if there are any "suggested" approaches for multiple game sessions. Currently I'm considering 5 options, and if you have any insight on the current considerations, or a brand new options I'd be happy to listen!
(OBS assume that it's a dedicated server and not host based)

1: have all players in the same scene and have all their interactions, visibility etc cluster by a session id etc. (same server) (perk of this is efficient object pooling?)

2: clone scenes for each game session. (still the same server)(perk of this is that each scene can be treated as it's own world with states regarding it? Not sure if object pooling is as smooth here?)

3: spin up a new process for each session (multiple servers) (I assume this option isn't optimal)

4: mix of option 1,3 where a new process is fired up whenever the first one has reached some form of limit.

5: mix of option 2 and 3

Thanks in advance!

humble swift
#

Evening all. Can any Photon boffins explain to me what I need to do to fix this error please?
PUN cancels an ongoing async level load, as another scene should be loaded

vagrant nest
# amber trench this is one way to do it, you can also fix your bug

https://youtu.be/mgYoxLO5uEg I did it the way you asked, but I think I did something wrong it was like this, to remove the teleport when you receive "ownership of the ball" it teleported so I made it disappear for 1 second and appear later to not teleport but it was strange how can I solve know another solution? or did i do it wrong do i have to make a ball for each player?

#

I'm trying to cheat this, when ownership is transferred there is a teleport and the ball changes position and comes back quickly, in the middle I'm trying to create a code not to show this teleport to the player who doesn't own the ball. someone with a solution
say that? this is my soccer game in the video

topaz roost
chrome pecan
#

Has anyone used mirror networking before? I keep getting the error cannot build player while editor is importing assets or compiling scripts.

This only happens once I import the mirror package from the asset store.

olive vessel
# chrome pecan

You've got compiler errors, what's the ones above the weaver error?

chrome pecan
#

More weaver errors, an object reference not set error, more weaver errors and dashes.

#

And this 5 times.

quick folio
#

hi folks, i was wondering what is the best practice to sync numerous objects across network?

#

objects that contains various kinds,different kind has different data
and frequency to sync, some just needed to sync one position ,some might have state, quaternion ,floats etc to sync

chrome pecan
olive vessel
#

You've literally not given me a workable error

#

Those messages all tell me you have compiler errors, you've yet to show me the actual error message

chrome pecan
#

Those are the only error messages I got. I don't know what else I can show you except for just giving you a version of the unity project itself.

olive vessel
#

I don't download files from the internet, click the messages and see if any are less vague

#

Because currently, there's nothing for me to help you with

chrome pecan
#

Welp, these are the only error messages I got, clicking on the errors just give the same messages, nothing new to show. I guess I might just have to not use mirror for the time being.

#

Oh, and these errors at the bottom of the console. Other than that, I got nothing.

normal sluice
#

me: int num;

#

the console: 999+ errors

chrome pecan
#

@olive vessel Fixed the issue, had to get a new version of unity.

weak plinth
#

people, I need help, idk what happened, I was using custom properties for my weapons, and it was working then after I started using the new input system it stopped, I made sure I am synching the right value, and that i am putting it into a PUN hashtable and sending using the SetCustomProperties method, YET THE OnPlayerPropertiesUpdate ISN'T WORKING why is that... can someone please help

#

public override void OnPlayerPropertiesUpdate(Player targetPlayer, ExitGames.Client.Photon.Hashtable changedProps)
        {
            base.OnPlayerPropertiesUpdate(targetPlayer, changedProps);
            Debug.Log("PLAYER WEAPON 1");
            if (changedProps.ContainsKey("HII")) //Human Item Index
            {
                Debug.Log("GOT PLAYER WEAPON");
                if (!PV.IsMine && targetPlayer == PV.Owner)
                {
                    EquipItem((int)changedProps["HII"]);
                    Debug.Log("updating player weapon");
                }
            }
            
        }

NONE of the debugs is being called

#

which states that the function itself isn't being called and idk why that is... (the equip item function is working on my player)

weak plinth
#

Hey I am wondering what Network Solution I should use if I want to make player host a game so others can join it with easily (without depending on Platform) any suggestions? The best would also be, that the player doesnt have to enable the ports etc

rotund salmon
#

so i have a player with a networkobject component and this player has a gun as child and i need to disable it for all clients with code so i wanted to use the despawn() method but if i give a network object component to the gun this error pop up

#

mlapi btw

spring crane
amber trench
#

you can use a standard signaling server solution or roll your own. there are some that exist for "enter a lobby code"

#

or use photon

patent fog
weak plinth
dusky storm
topaz linden
#

Hey, i am trying to make my player be able to shoot using MLAPI but when i try to spawn the object from the client it gives an error saying it cant find the prefabhash?

#

Im new to networking so i dont know if this is a common problem or not?

verbal lodge
#

Only the server can spawn a NetworkObject, you can send an RPC up to the server to spawn the bullet.

topaz linden
#

I have done that but the client still cant find the prefabhash

verbal lodge
#

Is the prefab registered under the NetworkManagers prefab list?

topaz linden
#

Apparently i haven't, i thought i had but i think i just read another prefab's name wrong and thought it was that

#

this did fix it, thanks tho!

burnt frigate
#

so... i am searching for someone to help me with photon network, my actual problem is that the "master" of the room (the one who instantiate the enemies) see the enemies perfectly fine and smoothly but the others those who joined the room see the enemies tp(teleport) and lag so much thats its literally unplayable,

i will be really happy if you can help me

odd kite
#

Broo I need help

#

why when it start zipline.The other cannot see player1 zipline

#

it just tp to target when zipline is done

#

How can I fix this

faint plaza
#

Is there any reason I shouldn't switch to MLAPI from Mirror?

weak plinth
#

I dont know, but i want to start with MLAPI too, because it sounds simple to use and is free

olive vessel
#

Mirror is also free, they're both good solutions. Mirror is the elder solution, which may have more complete features.

faint plaza
modern cipher
#

Anyone familiar with the network transforms on MLAPI,

I have my characters almost 100% smooth but am wondering if I really need to go down the path of client side interpolation custom code it appears like the network transform component extrapolates and interpolates based on input settings I suppose the only way to expand this is to use some rigidbody tracking? (not sure)

brave bluff
#

What's the most simple way to do multiplayer in Unity? Particularly for a 2D, brawlhalla like game

rotund salmon
bleak hollow
#

@rotund salmon i dont think you want to use Spawn() or Despawn() on the gun because its a child. You can just activate it and deactivate it. In the past ive used a Networkvarbool that you can change via a ServerRpc, and then set up a OnValueChanged event handler to do the activation and deactivation.

golden plume
#

for some reason when i want to leave the game i have to press the leave button and a different button pls help here is script https://hastepaste.com/view/PfbJ (using photon)

silk iron
#

(PhotonNetwork)Hi, I need help
This script should synchronize the position and rotation.
I also added to the player a photon view and photon transform view classic. I ticked synch position and synch rotation, but it still dont works. A player rotates the other player, but the movement is okay.

haughty osprey
#

Does anyone know why when i load up one map my cameras work just fine but when i load up another scene the camera is on the main camera and not on the main character ๐Ÿค” (mirror)

acoustic python
#

@haughty osprey why not try spawning the player with camera disabled and then enable it if player is localplayer or client? And don't have any cameras in scene.

haughty osprey
#

its ok

#

i got it

#

sorry should have deleted my thing

#

๐Ÿ˜…

acoustic python
#

@silk iron I think you need to make a function for synhronization and add your transform position and rotation to it.

haughty osprey
#

i do have another issue hto

#

could i replace the player GameObject with this?

acoustic python
#

Yeah or other not sure where that script refrences the variable player

haughty osprey
#

well this is my new one

#

and after testing i get this

#

and i have a collider on my player

acoustic python
#

Does the player have the tag?

haughty osprey
#

yes

#

oh wait

acoustic python
#

And the script is attached to the player?

haughty osprey
#

the player tag wasnt on the object with the collider

#

let me test again

acoustic python
#

๐Ÿ˜‹ ๐Ÿ‘

haughty osprey
#

but it triggered when i jumped into the death barrier

acoustic python
#

Use other instead of this

haughty osprey
#

ok

#

nope

#

still didn't work

acoustic python
#

What is the structure of your player gameobjet

haughty osprey
#

wait

#

oh

#

i didn't set the respawn point

#

๐Ÿ˜…

acoustic python
#

๐Ÿ‘

haughty osprey
#

it works now

acoustic python
#

Epic

river meteor
azure yarrow
#

Can someone list every way to make a multiplayer game

olive vessel
#

How high level?

#

Because we could start using raw sockets, but they're not very beginner friendly, and won't give you nice NetworkTransform components

#

The higher level ones are Photon, MLAPI, Mirror to name a few

cerulean crescent
#

Which could be done through a RPC , depending on whenever you'd want this change to happen

storm phoenix
#

Hi anyone know Photon Bolt here ? I'm having issues with my scripts

olive vessel
#

Better to just post the issue

storm phoenix
#

found it thanks though ๐Ÿ˜›

steady patio
#

I wanted to make an online game to play with my friends, have tried making games with photon before but with no success, but I saw that unity's networking solution is finally available. Should I try it, or is it harder that photon? (I just want to make a quick game for 4-5 players so I can play it with my friends)

jolly wadi
#

I recommend coming to the photon server

#

And there are many who would help you out with a wide array of different solutions

#

Especially the fact that you want a game for only 4-5 players is what photon pretty much does

steady patio
spring crane
#

Apart from PUN having pretty clean API, I think a lot of the simplicity of it comes from how it operates. All PUN clients do basically the same thing and have the same data with some exceptions when it comes to masterclient, so there are a bit less decisions in general to be made.

jolly wadi
#

Like with the tutor

#

the tutor runs through the code?

steady patio
#

what do you mean?

jolly wadi
#

Like what do you want to make exactly i know you want to make one where you can play with your friends

#

Do you want something where your friends click a button and then you all join a game together?

steady patio
jolly wadi
#

Yeah

#

That would be just a quick start game

#

here watch this one

#

For this lesson, I will teach you how to create a delayed start matchmaking system using the Photon 2 plugin in Unity. In the last video, I showed you how to create a quick start matchmaking system which is where the players can click one button that will connect them to a photon room and load them into the multiplayer scene. This is mostly used...

โ–ถ Play video
#

This will allow you to create a waiting room

#

In which you can choose your skins

#

Or characters

steady patio
#

ok thanks!

golden plume
#

I messaged a person on reddit as how to make it connect to a photon server you put in a txt file in the folder that the .exe is in and they told me i had to modify the AppSettings file at runtime and set the appId to File.ReadAllText(Path.Combine(Application.dataPath, "..", "server.txt")); and i also asked them if i could make a public and private servers in my game and they said "yeah you could just have a button to load from the server.txt and only have players click it if they want to play private servers" but i cant figure out how to do these things please help here is launcher code if helpfull https://hastepaste.com/view/InHtrMgYzo

#

please help i cant figure out how to do it

#

how do i make it so it joins the server that has the appid in the txt file

#

pls help

#

so basicly i want to make it join a photon server thats appid is in a txt file but only if they press a button otherwise i would like them to join public servers

golden plume
#

can anyone help?

vocal ferry
#
        public override void NetworkStart()
        {
            Cursor.lockState = CursorLockMode.Locked;
            Destroy(UnityEngine.Camera.main);
            if (playerCamera)
            {
                if (IsOwner) return;

                playerCamera.transform.GetChild(0).transform.parent = transform;
                Destroy(playerCamera.GetComponent<Camera>());
                Destroy(playerCamera.GetComponent<AudioListener>());
            }
        }

This code in my player prefab doesn't work. It's supposed to remove the cameras of other players (they don't need it because the local player is the only one on the screen)

acoustic python
#

@vocal ferry you could maybe try enabling the camera on the owner of the GO when it is spawned and set it to disabled before spawning. That would make things easier for you if you are unsure.

vocal ferry
#

my problem is that every client's camera gets destroyed

acoustic python
#

not sure which library are you using. In Mirror you can do that by saying isLocalPlayer/ in Photon you have isMine not sure what are in others.

Yes you don't need to destroy the camera simply let it stay disabled

vocal ferry
#

i use mlapi

foggy halo
#

im trying to convert my game and i cant find the thing

agile spade
#

heyy I if anyones familiar with
Epitome transport tutorials online, i made a base server and base client like his 5 part series. Now, I just downloaded MLAPI and my brain is feeling like it's going to pop... Basically, I wanna use a linux VPS from Amazon web servers to host a space mmo rpg. I do not want clients to host the game. I wanna use a dedicated server but, as I'm looking through the mlapi i see alot of singlton.iserver and serverRPC bracks in client and shared net assets etc. So, like, how do I build a mlapi project with the intent of making it hosted on a dedicated server?

#

can i scale in
Epitome baseserver and baseclient class from the tuts or do I scrap them?

#

this shit is soo confusing

#

lol

olive vessel
#

I've seen those tutorials, for his BaseServer and BaseClient I believe he uses the Unity Transport, this is different to MLAPI

agile spade
#

yeah soo. i cant use both?

olive vessel
#

There's no point using both, it doesn't make sense

agile spade
#

basically, how this went, was, i made an account with playfab, made a smtp email auth. then made it where people could sign in made a "planet" select scene, and a intro, then i watched his videos

#

so, how do i set up mlapi for dedicated server?

#

also, i can log the playfab IDs as the client IDs withh mlapi right?

olive vessel
#

Not sure about MLAPI's integration with PlayFab, I know Mirror does that

agile spade
#

mirror and photon dont support dedicated servers

#

so, "throws in trash"

olive vessel
#

Mirror absolutely does?

agile spade
#

they said the scaling was like 64 players

#

or something

olive vessel
#

No dear, they've had a lot more than that

agile spade
#

and i tried using mirror for an old project and had a lot of issues with signletons not behaving properly

#

so, can mlapi work under a dedicated server?

olive vessel
#

At the end of the day, it's up to you what you use. I just know Mirror has a PlayFab integration plugin

#

Yes I believe you can make a server build for MLAPI

agile spade
#

i just wanna have a ref how to build the server interface in mlapi (assuming its an authorative server)

#

Any refs for it?

#

i spent all day on this mlapi shit and i have nothing to show for ir

#

it*

#

I always give up on multiplayer projects because the fucking documentation is just way too complicated or, should I say, not reader friendly.

olive vessel
#

MLAPI has a good docs site, idk if it specifically covers building a server build

agile spade
#

my braaiinn

olive vessel
#

Well, the build settings has a Server Build button, so I guess looking into that would be a start

#

My assumption would be that it allows you to strip client code and assets out of the server build, and vice versa

agile spade
#

that just means it doesnt run graphics

#

i ran it through git

#

it doesnt change the states of it making the server run through the "rules"

#

same isssues i had in mirror

#

it tries to make your server run through the steps on player prefab and singleton authority rpc commends

#

and starts throwing mad errors

#

and crashh

#

i had 0 issues with transport but

#

it isnt scalable to what my endterm goal is with the game

olive vessel
#

What is that goal?

agile spade
#

game thats graphically simplistic like dark orbit, but has the skill system and the expandability of eve-online

#

eve online has a bigggg learning curve and is now a pretty dated game

#

darkorbit is really really dated and has too many limitations within skills and ship classes

#

yet, its more inuitive on how to play

#

so, i need to register events through an authoritive server.

#

players movement doesnt need to be authoritive, just shared.

#

but, everything else needs to be real time and secure.

cerulean crescent
#

@agile spadePretty sure this dude hosted a MLAPI server build on cloud servers https://www.youtube.com/watch?v=wm18gcIoUwc

We're finally doing it, we're hosting our own dedicated server on a cloud platform! Now anyone will be able to join, from anywhere in the world.
Digital Ocean provides us with the Linux machine, and we use SSH to connect to it!

If you're new to the whole cloud platform shenanigan, use the same provider I do for clarity, oh and guess what, if y...

โ–ถ Play video
#

Not sure if the video got what you're looking for shrug

twilit breach
#

Hello,

I try to send a RPC to another client to start an external process on both client that want to play.
But It doesn't want to send it until I close the process on the client that send the RPC ๐Ÿ˜ญ

client A send RPC and launch the process -----> client B receive RPC and launch the process

patent fog
# silk iron still need help

I don't use PUN, but aren't you supposed to inherit something else than MonoBehaviour ? something like a NetworkBehaviour or another name maybe ?

silk iron
#

do you mean MonoBehaviourPunCallbacks ?

#

I'll try

patent fog
#

uhm don't think you need this one

#

you're not implementing one of the callbacks from your screenshot

silk iron
#

MonoBehaviourPun

#

I'll use that

patent fog
#

okay come back if this didn't work, should be an easy answer for someone who used it in the past

silk iron
#

dont worked but what if here is the actual problem?

#

The position synchs but the rotation not
a player rotates all other players

gray pond
next sedge
#

Hey Guys i am new to UnityEngine Networking. So i did a WWWForm to send a value to my Server. And my Server Answers with the result of my Question. But if i get www.result it gives me only "Success". How can i get my anwser?

barren onyx
#

So I am a little bit conflicted with Unity's MLAPI package. I can't tell when NetworkManager gets instantiated in scene.

#

Is there a certain execution order that needs to process first before NetworkManager gets created and referenced?

agile spade
cerulean crescent
#

I'll actually give it a try myself

agile spade
cerulean crescent
#

Oh yeah, well transport is lower level

olive vessel
#

MLAPI has a UNet Transport, UNet Transport != Unity Transport

cerulean crescent
#

MLAPI uses Transport, not the other way around

#

Yeah we might be talking about different transports then

agile spade
#

this is what im talking aout, the people tat design multiplayer api and documentation make this shit too difficult. i cant even think of anything in normal programming that comes close to being as cnflicting and non-senseical.

#

they do it so on purpose so not everyone can "profit" off the multiplayer cash cow. my theory anyways

#

lets make eveything non-compatible, all the "easy to read" shit needs to be port to port only

#

but, if you wanna make a game that can scale to the hundreds? lets get real fucking crptic reak fast.

#

and i dont mean you guys. i mean the people shipping out api for it

olive vessel
#

Well, if you want hundreds of players, you'll probably need to roll your own solution

#

Multiplayer isn't an easy thing, it's not for beginners

agile spade
#

ive made like 6 multiplayer games that can handle p-p and like 4-6 people

#

but, everytime i try and go dedicated

#

it magically becomes super fucking cryptic

#

been programming since 2007.

olive vessel
#

I learnt a lot from Tom Weiland's TCP and UDP networking tutorial on YouTube

#

Doesn't use any built in solution, just TcpListener and TcpClient at first

cerulean crescent
#

I mean, it's not always easy. I remember when I wanted to host my own website from my own machine instead of using a host

#

I required like 5 different frameworks / software to work together for all the routing / instancing / filtering / etc

#

There are a lot of layers to network related applications

agile spade
#

i mean, they say that but, Request ticket> server Authorization > result.

cerulean crescent
#

But I'll be giving it a shot now to try and get a server instance of my own MLAPI application onto a dedicated server, so I'll notify you later on how it goes

agile spade
#

for example, in boss room

#

i wanted to look at hour they handled player movement on authority

#

didnt even have it. they just used localplayer

#

thats useless on a dedicated server.

#

fine for port to port

#

how they handled*

cerulean crescent
#

It shouldn't be? The localplayer indicates the client you're playing on, not the server?

#

Aka if the client you're controlling owns a certain gameobject

olive vessel
#

Yeah I don't understand why isLocalPlayer is useless on a dedicated server?

#

There is also isServer

agile spade
#

okay think of it like this, they do this decloration, (if im server, then send the information to me, and THEN move.

#

wen you try wrapping that into a server

#

the server if "playing" an instance the game

#

and my issue was on boundless kingdoms

olive vessel
#

If I am the local player, and I input a key, send that to the server to move me

agile spade
#

whatever the scene was the server would go on

#

would be the onlything playable

cerulean crescent
#

I usually think of it like 3 different dimensions. Local client, server and the rest of the clients.
-Localplayer could be used for things that are individual to you (UI, player HUD, etc)

  • Server handles simulation of game state
  • Rest of clients just displays the things broadcasted by the server
agile spade
#

and the mirror api kept trying to spawn prefabs to the server. and this was a solution i got after pestering the forums sites

#

so, i just gave up

olive vessel
#

Yeah which is why you pass the client you want to give authority to to the spawn command

cerulean crescent
#

Yeah exactly, registering mouse / key presses is a perfect example for good use too

#

as it should only be done on the localclient

#

otherwise you'll get loads of errors

agile spade
#

Again, if you use node.js or mke a server in java. getting a website, or something running in java doesnt hve this weird Egyptian logically conflicting BS.

#

i just track a client with a unique id, give the server a ssh/ip/id

#

and the fucking vm KNOWS

olive vessel
#

You can do that too...

agile spade
#

whos its talking to

olive vessel
#

Mirror and MLAPI are high level solutions, if you don't like it move down

cerulean crescent
#

I've actually never used any networking game libraries before, and I'm 2 weeks into MLAPI and I think it's divided quite neatly

agile spade
#

however high up or low it is, it should be intuitive considering the solutions are supposed to be designed by humans and all. lol

cerulean crescent
#

The documentation isn't that broad, but I think it has enough content to implement the things you need

agile spade
#

easy stuff is easy, basically player movement, messaging, and logging in

#

easy

#

authority, pinging locations "accurately" and dealing across scenes is where it becomes a bitch

cerulean crescent
#

Yeah that's more about network standards and strategies

agile spade
#

my issue with boundless kingdoms 2 years ago, was mirror not switching scene authority, and throwing unsync locations and black screening

#

well, im going to go try and build a server in playfab now, it stores player data, and ill use transport to server client/server requests. screw mlapi. maybe in another year or two.

spring crane
#

@agile spade Just having a trusted entity in the loop enables some checks you can make. You don't need to jump from completely client side peer to peer setup to completely authorized by a server.

cerulean crescent
#

Oh and I started a 2nd client as well just to show that you can connect multiple clients

#

as seen by the player standing still

cerulean crescent
#

So as long as you have the correct ports opened and let clients connect to the IP address of your server, you should be fine

agile spade
#

okay, so, i have been putting my 3d assets together and am building my game (I spend more than a month aking 3d models of spaceships, guns and procedriall planets etc..

#

so, i want a play to have their own workshop

#

how do i switch a scene to being offline

#

while keeping the variables online?

#

if that makes any sense

#

the resources you drones collect from the planet/asteroi you can use

#

and to check if an upgrade s ready i wanna just set a global SST using a smpt from a clock website

#

if the time on this address is == to this, and the upgrade was started at x then upgrae complete

#

and resource tracking

#

but, nothing else should be shared and can be offline

#

when i was in my old mmo project another issue i had was, you gotta make your "player" a network entity and if you try going to an offline scene

#

it breaks

#

i can make the player prefab an instance

#

instead of the shop itself

#

but, again, how do i stop players from oading ontop of eachother?

#

idk if im making any sense.

agile spade
# olive vessel Mirror and MLAPI are high level solutions, if you don't like it move down

mirror or mlapi? my server is AWS, and my authentication is a custom smtp and playfab. Which do you think is better? So, I been programming since i left, and to make my life not hell, i cam up with a weird solution. idk if it'll work but, to stop wetwork management from flipping out, i just made everything authoritixe from off the bat, and made every client carry a "serverToken" script in their "player panel" which consists of, network manager, player instance, player_positiontoken, player_credntials and Player_nodes(basically their modular ship)

#

but, mirror and mlapi are supperr simlar

#

but, also different

#

if im going to route of dedicated server which one is reccommend(Preferably answred by someone whos made a dedicated server mmo before) lol

jagged cliff
#

Hey, if anyone has used Photon PUN, I'm trying to get projectiles synced properly. They don't always fire on both screens. This is the warning i get: "Received OnSerialization for view ID 1041. We have no such PhotonView! Ignore this if you're joining or leaving a room. State: Joined"

olive vessel
#

You should repost the problem, with any updates, it has been two days after all so you should have made some changes

silk iron
#
using UnityEngine;
using Photon.Pun;

public class Player : MonoBehaviourPun
{
    PhotonView view;

    public Rigidbody2D rb;

    Vector2 move;
    Vector2 mousePos;
    public float speed;

    public GameObject currentWeapon;
    public Transform weaponEquipPos;

    private void Start()
    {
        view = GetComponent<PhotonView>();
    }

    private void Update()
    {
        if (view.IsMine)
        {
            move.x = Input.GetAxis("Horizontal");
            move.y = Input.GetAxis("Vertical");

            mousePos = Camera.main.ScreenToWorldPoint(Input.mousePosition);

            if (currentWeapon != null)
            {
                currentWeapon.transform.parent = weaponEquipPos;
                currentWeapon.transform.position = weaponEquipPos.position;
                currentWeapon.transform.rotation = weaponEquipPos.rotation;
                currentWeapon.tag = "equipped";
            }
            FindWeapon();

        }
    }

    private void FixedUpdate()
    {
        if(view.IsMine)
        {
            rb.MovePosition(rb.position + move * speed * Time.deltaTime);

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

    public void FindWeapon()
    {
        GameObject[] weapons = GameObject.FindGameObjectsWithTag("Weapon");
        float shortestDistance = Mathf.Infinity;
        GameObject nearestWeapon = null;
        foreach (var weapon in weapons)
        {
            float distanceToWeapon = Vector2.Distance(transform.position, weapon.transform.position);
            if(distanceToWeapon < shortestDistance)
            {
                shortestDistance = distanceToWeapon;
                nearestWeapon = weapon;
            }
        }
        if (nearestWeapon != null && shortestDistance <= 10f && Input.GetKeyDown(KeyCode.E))
        {
            currentWeapon = nearestWeapon;
        }
    }
}

#

Nothing changed except the weapon finding

#

I also changed MonoBehaviour to MonoBehaviourPun

Movement is still okay, but not the rotation

halcyon oak
#

does exists NetworkServer.dontlisten into the MLAPI??

glossy widget
#

hey something weird just happened, Photon.Pun is missing but others aren't???

#

it was fine seconds ago wtf?

spring crane
#

@glossy widget I generally just go to Unity -> Edit -> Preferences -> External Tools -> Regenerate project files whenever the IDE craps out like this.

glossy widget
#

thank you sir, that solved ๐Ÿ™‚

#

but anyaways I had other networking related question:
So I'm making a 2d networking platforming game for practicing, right. So I Created a new object which is basically a tranpolin/spring, and I made a script like this (which works well for singleplayer (ignore the gravityScale thingy, it's for other feature)):

#

this is basically a spring I drew with a collider and a smalled triggerCollider inside:

#

and it plays an animation OnTriggerEnter2d

#

The problem is that, in multiplayer I basically synchronize the players position, and it works for the jump of course, because the position is synced, but sometimes the player barely doesn't touch the trigger because of lag, and doesn't touch it, then not playing the spring animation. How would I go about solving this?
Because the script is in the spring, and the spring doesn't have a photonView or anything like that I can't use RPCs inside the spring or synchronize the animation. So should I put a photon view on the spring or is there any other way?

golden plume
olive vessel
#

I assume that _photon is null

golden plume
olive vessel
#

The object with this script has no PhotonView component, or, you try and use _photon before it is initialised in Start

golden plume
#

@olive vessel i think second cause it has photon view so how do i fix it

olive vessel
#

Either initialise it earlier in Awake, or don't try and use it before it's initialised

golden plume
#

ok

#

i willtry awake

golden plume
olive vessel
#
if(myThing != null)
{
  DoStuff;
}
#

You could put an else on there too, with a Debug to tell you that you used it and it was null

golden plume
#

ok

#

so i put it above line 32?

#

right?

olive vessel
#

You want to enclose the use of it within that condition

golden plume
#

ok thx that works

#

just to check it should be like this right public void SendChat(string msg) { string NewMessage = PhotonNetwork.NickName +": " + msg; if(_photon != null) { _photon.RPC("RPC_AddNewMessage", RpcTarget.All,NewMessage); } }

olive vessel
#

If it is not null, send my RPC

golden plume
#

so yes?

olive vessel
#

Yeah it won't let you use it if it's null

golden plume
#

ok thx

olive vessel
#

Which will avoid the error

golden plume
#

ok thx

golden plume
#

i am making a chat for my game can anyone explain why the messages dont show up on the screen the console says the RPC has been sent and also that it has been recieved but the messages dont show up on the screen pls help here is script https://hastepaste.com/view/Z0z5lCVNch

#

and also only the host can send a message

fleet plaza
#

So far I have everything working but just have one problem you load up the game you can only see rooms made after you loaded up is there any way to store a list of rooms server side instead of client side or have the client side list pick up already running rooms

#

Iโ€™m pretty new to this so the simpler the better

#

any help is appreciated

fleet plaza
#

so anyone know

fleet plaza
#

This channel is definitely dead

jolly wadi
#

it is not

#

but what networking solution u using

chrome pecan
#

Are there any plugins that allow me to have the same project open twice for testing my multiplayer game?

I don't really want to have to rebuild the game every time I try to make an adjustment.

chrome pecan
chrome pecan
#

I imported parrelsync into my project and hit add new clone... It was stuck on importing assets for over 50 minutes and no progress was made.

I just reimported it and am trying to add a new clone again, does it usually take long?

olive vessel
#

Have you considered just finding a Photon PUN tutorial for movement and rotation?

silk iron
#

I found many utorials, but not about the rotation with mouse position

olive vessel
#

Surely the method of rotation is irrelevant

#

Find a tutorial to make the player rotate over the network, then find a tutorial about mouse rotation

#

You may never find a tutorial that fits every criteria, you might have to take knowledge from multiple, and apply it differently

silk iron
#

ok thanks, I'll do my best

oak flower
#

@candid hollow Don't cross-post

candid hollow
safe sand
#

how to use mlapi with DOTS?

olive vessel
#

I answered you, MLAPI is Netcode for GameObjects

#

Pinned here are the DOTS Netcode and Transport

candid hollow
fleet plaza
oak flower
odd kite
#

Hello

#

I need help

#

I write zipline code

#

it work perfect for singleplayer

#

but when it mutiplayer

#

player2 see player1 who use zipline tp from target1 to target2

#

but not along the zipline

#

I use photon pun

#

This is video which is my error

#

just start to learn photon pun

cerulean crescent
#

If I've hid a player object from a specific client, does that mean that it won't get the broadcasted ClientRpc as well? Just wondering if I need to use RpcParams for that, or if I don't have to bother since the object is hidden (doesn't exist) on the client anyways

#

(MLAPI)

restive geode
#

Is it possible to get an array of files names from a web server directory? Similar to Directory.GetFiles() but from a URI?

haughty heart
shut yarrow
#

Someone please clarify this for me if possible. My friend claims that you need hole punching whether you run a server where everyone connects to or not. Here I was thinking you'd only need that if you want a direct (p2p) connection between clients because it can be cheaper and/or because port forwarding isn't an option. This is definitely not what I want and I'm quite sure you don't need this if everyone already can connect to the server and serves everyone else data

wraith monolith
shut yarrow
#

Please elaborate

wraith monolith
#

if you're communicating via UDP and one of the endpoints is behind a NAT, you might need to holepunch

shut yarrow
#

What does it technically mean to be behind a NAT?

#

Because I am using UDP

wraith monolith
#

do you know what NAT is?

shut yarrow
#

A router that keeps track of local IP's?

#

Otherwise no

wraith monolith
#

well that's part of it. essentially it's a technique for connecting across two networks with different address spaces

#

typically your home wifi network to the internet

#

google 'udp hole punching', it's a whole topic

#

but the need to holepunch is not only for peer to peer connectoins

shut yarrow
#

Been doing that but couldn't find anything very specific on this, other than hole punching being a technique used for p2p connectivity because it's either more cost effective or some router blocks direct connection

wraith monolith
#

not about cost effectiveness

#

basically NAT is a big hack

shut yarrow
#

It's pretty difficult to find info on this, all I find is what I already talked about and that's where my confusion sets in

wraith monolith
#

it's designed to hack around the fact that ipv4 has a very finite number of possible addresses

#

way fewer than the number of devices one earth

shut yarrow
#

About 4 billion yeah

wraith monolith
#

right

#

so NAT is a technique for allowing devices to communicate despite not having unique addresses

shut yarrow
#

My friend tried to explain this to me but I failed to understand him, because I haven't found anything in much detail about this, and I haven't run into the issues yet

wraith monolith
#

can i ask what you're trying to do?

shut yarrow
#

Just run a game server with UDP (ENet)

#

And I have access to a server as well

uneven egret
#

is a webgl build capable of executing on the server or is it entirely sandboxed and downloaded on the client side?

shut yarrow
#

I feel like still stuck on this cause my friend might have a very good point but I just don't understand it. It's so hard to find information on hole punching that doesn't just talk about the low hanging fruit issues I already knew about

#

And not having experienced any of these issues yet doesn't help me either in understanding the need

wraith monolith
shut yarrow
#

Not at all

wraith monolith
#

or is this a hypothetical scenario you're conecrned about?

shut yarrow
#

My friend tried to explain to me and he admits he sucks at explaining ๐Ÿ˜„

#

But no I haven't had any issues yet, so all I know it is hypothetical and I don't even know why

wraith monolith
#

is the goal of this project to learn about networking, or make a game?

shut yarrow
#

Making a networked game ๐Ÿ˜‰

wraith monolith
#

because if it's the former, there's a lot of info out there -- but you're right it's not like there's a simple guide to doing it afaik. if it's the latter, i'd suggest starting with something higher-level than ENet

#

networking is a complex rabbithole

shut yarrow
#

I kind of like ENet because it's simplicity and if it were not for my friend or you I would be oblivious to the issues. Still failing to see them but I wish I could

wraith monolith
shut yarrow
#

You're right I well understand it's a complex subject

wraith monolith
#

try Photon or Normcore

shut yarrow
#

I like the fact it doesn't impose so much on me in terms of learning the API

wraith monolith
#

what it doesn't impose on you in the API it requires you to write yourself

shut yarrow
#

Photon is too complex imo and isn't cost friendly either

#

I don't mind writing that API on top of the basics (notably packet fragmentation and reliability which I do mind)

#

There are just some things I haven't found anything about yet, nor experienced the issues but now I am between a rock and a hard place

wraith monolith
#

my advice -- as someone who's both shipped games and written my own networking library -- is decide whether your goal is to make a game or learn about networking/make a networking library

#

doing both at the same time is a recipe for doing a bad job at both

#

if you do end up rolling your own networking library (on top of ENet or otherwise), probably gonna be helpful to get used to mining google for help

shut yarrow
#

I appreciate the advice but I'm way past the point of tinkering, and understand pretty well how much work is involved and I'm up for it. There are just very specific things (hole punching in this case) that I seem to have misunderstood and trying to find clear explanations turned out to be pretty difficult. I'm not even talking about explanations about implementation but just an overview of its applications, particularly in a scenario where you have access to a server

#

I'm sure if I somehow experienced issues with connectivity it could clear things up a bit for me

uneven egret
wraith monolith
shut yarrow
#

Thanks I'm gonna have to dig a bit deeper

wraith monolith
shut yarrow
#

@uneven egret I think you're out of luck for now. I know Blazor can run (C#) code on the server but this is most likely only for webpages and I doubt it supports webgl.

#

Even if it was possible then I think it would be an expensive undertaking

wraith monolith
#

you can just run unity in batchmode and it'll happily run on a server

shut yarrow
#

Not unity but a webgl build

wraith monolith
#

but why would you want to do that? the only reason you'd compile to webgl is to run it in a browser

shut yarrow
#

I doubt Blazor can do that

#

I can only imagine protection of IP

wraith monolith
#

i mean... you of course can have private code executing only on the server

#

but that's nothing to do with webgl

#

that's just running unity in batchmode for a server deployment

shut yarrow
#

I guess kind of like how Stadia streams the computed content, or maybe I misunderstood the question

wraith monolith
#

well that's a whooooole other thing

#

that's literally just streaming a video of the game to your browser

shut yarrow
#

Well the question was is a webgl build capable of executing on the server or is it entirely sandboxed and downloaded on the client side?

wraith monolith
#

yeah the question doesn't really make sense xD i think they perhaps misunderstood what webgl is

#

a more reasonable question would be: "is a Unity player targeting WebGL capable of interoperating with a Unity player running on a server" and the answer is of course yes

#

but there's nothing specific about webgl to that

shut yarrow
#

It's not a strange thing anymore though with Blazor but I doubt many people already use it, and most likely it's limited to what it can serve to the browser

wraith monolith
#

blazor and unity are just completely different technologies

shut yarrow
#

That's right but the thing they have in common is running WASM

#

So theoretically unity could cook something up but I don't see them doing that anytime soon ๐Ÿ˜›

wraith monolith
#

there's just no reason to, Unity already effectively translates C# to multiple target platforms

#

IL is Unity's wasm

shut yarrow
#

Although I think unity compiles to C++ first then to WASM. Blazor has the entire dotnet runtime in a WASM assembly

wraith monolith
#

Unity provides the exact benefit of being able to write C# code and execute it both on client and/or server

#

Unity compiles to IL first, then to cpp, then to wasm

#

the IL is the common bytecode

shut yarrow
#

Yeah you're right it's called IL2CPP for a reason but you get my point ๐Ÿ˜›

wraith monolith
#

wasm is just a downstream compile target

#

you beg the question though of why doesn't unity just say fuck it and replace IL with wasm

shut yarrow
#

But to answer his question it's not currently possible to stream webgl builds

#

Because C# already compiles to IL so it's probably easier to convert that to WASM than directly from C#

wraith monolith
#

well, blazor does it lol

#

but i think it wouldn't solve the problem of other platforms

shut yarrow
#

They do the same thing

#

From IL

#

Just probably no C++ involved in the pass

wraith monolith
#

mmm true

shut yarrow
#

Maybe in a few years other cool stuff is possible as the technology matures

#

Sorry for the off topic mods back to networking now ๐Ÿ˜‚

wraith monolith
#

lol. i do wonder what they were really asking about

shut yarrow
#

He/she didn't talk anymore so who knows

uneven egret
uneven egret
uneven egret
shut yarrow
#

I think for now the only option you have is vanilla, so clients will have to download the entire build

uneven egret
#

UnityWebRequest.Get gives a 404 when I am trying to fetch a dynamic page. Yes, I want a REST/json working too, but wondering if I can bypass this problem too.

#

also, is there a REST/json thingie built into Unity or do I need to find Newtonsoft json from asset store?

wraith monolith
#

you can certainly make HTTP requests in Unity, e.g. via UnityWebRequest

uneven egret
#

I know, but if the page is dynamic, it probably times out as the page is JS driven.