#archived-networking
1 messages ยท Page 107 of 1
Do you recommend using MLAPI as a beginner to networking, or is there another Free Library you can recommend?
I make kill report system but it add killCount for other player
How can I make it change KillCount for owner.client
how to add photon players to a list ? any idea ?
Does anyone know how to sync random variables to other clients when they are generated in a for each loop?
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
It'd not unreasonable depending on the library. Some of them fall through on the rpcs etc if you're not connected
I usually have a "remote" call and a "local" which does the real work. Then if I'm connected I call remote and local and if not skip the remote. But otherwise it's all the same.
my movement doesnt sync to other players
im using if (isLocalPlayer)
but it doesnt work
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);```
Add Colliders maybe the send RPC over the network for each player that collides with a spawnpoint and you can increase the value of the spawnpoints by one
that doesnt fix the problem .. say there are 6 players .. the 2nd player left , then the value of the next spawnpoint is 6 .. spawning him on top of the 6th player
but it is a idea i can work on for sure .. so thx
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
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
Maybe use preprocessor directives
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 ๐
Is there a way to separate a [Server] Start and a [Client] Start?
quick question , in Photon , does every player has his own PlayerPrefs ? or do they all have the same vvalues for each key in playerprefs
Playerprefs are saved in the registry of the device
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?
@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
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
does someone has experience downloading 3d model from sketchfab through code with UnityWebRequest?
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
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.
anyone happen to know if there is some example on how to use MLAPI's Steam P2P transport? https://github.com/Unity-Technologies/multiplayer-community-contributions/tree/main/Transports/com.mlapi.contrib.transport.steamp2p
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
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
i use mirror
I assume that'd be covered by the official documentation
Does anyone know how to hold photon chat messages in cloud scripts until the user comes online?
in mirror is it possible to have a client set an object to active and have it sync with all clients?
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?
hi my if trigger isn't working. its on my player prefab in my resource folder. if you need script i can send
Post your questions and you'll find out whether someone can help ๐
Pls reply to this question, it's the 3rd time i ask for help about this
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?
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.
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.
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.
He joined us and is still working on it.
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.
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.
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?
- Host loads the menu scene, starts server (sets password) then starts the game and plays around
- 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
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.
When you're playing you can see the id's in the photon views. You can try to find 999 before they send
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
Hey Have you seen this thread? Would this help?https://forum.photonengine.com/discussion/17186/clear-individual-buffered-rpc-calls
thanks, ill check this
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)
Could you explane a little bit?
int[] callersActorNumbers: the actor numbers of the actors who called/buffered the RPC. For example if two players buffered the same RPC you can clear the buffered RPC of one and keep the other
How can i choose a specific player from the array? i cant use playersArray[1] because int can not be an argument
My guess is photon is easy to learn from. The two most basic things most networking systems do is a "reliable send" usually called rpc and an unreliable send, which is a faster state updater or some mechanism and is lossy.
If you figure out how to use those two things correctly, then all the other features of a library are just very helpful or make certain further optimizations for you
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.
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?
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?
No error, it's just disconnecting
What do you mean no error? What about the one you posted above?
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
Ah okay? You are using UNet transport right?
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.
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
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.
I replaced my NetworkVariableVector3 by a NetworkTransform and things are much better now, thanks
(Well I managed to reproduce my crash fairly consistently but still no info)
Can you create an issue on Github and include the reproduction steps? We'll investigate this.
Sure, thanks
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
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
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
Can anyone help me with storing Photon Chat private messages until the certain recipient gets online to receive the message?
Unreadable image. Maybe photonView.RPC("Die", RpcTarget.All, 0) should not have the 0 as parameter. Or the method should have an int parameter.
That's good ๐
That is not supported and can't be built in right now.
Not what I heard Toby, one of the photonians said I can use web hooks to save the messages but I couldnโt wrap my head around this and it was a bit confusing so I was wondering if someone could explain it to me?๐ค
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)
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 ๐ณ
you could technically also have a backend subscribe to all chat "channels" as a "client" just to store the full histories, tec
He's one of the devs of chat, yes
He also recommended making public chats with just the two users as it saves messages easier but that would create too many public channels
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
Yes I have playfab integrated would that help?
Something like a cloud script
That I can call๏ผ
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
Sure I already have but I didnโt want to bother John as he seems the main person to help with the chat area
I asked JohnTube as he's the expert. His reply:
private messages can't be saved using webhooks
that's why he recommended with public channels then
Oh that makes sense I can do public channels I donโt mind
But would having many public channels ruin quality or something ๐คทโโ๏ธ
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.
Iโm not using mobile I can find a way thanks for replying quickly ๐
Can't guarantee quick replies but once in a while we check here ๐
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?
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๐คจ
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?
scene object meanes thats the object should be in the folder of the scene?
Scene object is a object contained in a scene
in here for EX
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.
How am I doing that?
Oh so I sould leave my player OBJ inside the game Scene?>
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?
Here
And it's not present in any scene?
The base of this Variant OBJ is presented in other scene
but its in non-Multyplayer scene like the singleplayer scene of the game
The networkidentity probably doesn't know that
So is there a way to do that?
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
yes I tried to remove and recreate
On the prefab too?
Yep
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?
Whats funny if Ill just try on playmode it will works fine @spring crane
Yes it is
I'm not sure if the sceneId plays a role when it's a spawned object. The issue is probably somehow caused by the object existing in some scene and some values being overridden to the prefab.
I think that error is specifically trying to protect against bad scene objects
oh ok
Does anyone here know how to use Firebase?
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?
I fixed that issue
Do you know what fixed it?
for some reason the object ("the player") cann't contain the "PlayeMaker FSM" script inside so I just deleted them and everything works properly
just a weird bug with the Mirror plugin I guess
The client can't call a ClientRPC
The following table details the execution of ServerRpc and ClientRpc functions:
That's pretty interesting
@olive vessel I know that's why I added if(!IsServer) return; in there
Mea culpa. Try not destroying the object?
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
Is there any nice tools for making fps multiplayers?
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
Upgrading Unity should fix this https://github.com/Unity-Technologies/com.unity.netcode.gameobjects/issues/716
Yeah if possible upgrade to 2020.2 or newer and it should work.
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
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
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
i seemed to have partially solved it by making a prefab for each fbx file with its own networkobject in it i think
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 ?
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
dose anyone know what is wrong OnDisconnected is not working it says it is not a thing please help
OnDisconnected from what networking solution?
photon pun 2
Is your class is derived from MonoBehaviourPunCallbacks
yes but i keep getting this error Assets\testconnect.cs(22,42): error CS0246: The type or namespace name 'Disconnect' could not be found (are you missing a using directive or an assembly reference?)
Disconnect being?
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?)
So you're missing the Photon.Realtime namespace then
thak you so much
which network do you suggest for unity ? photon, mirror, darkrift or else?
For me tbh Photon as it is easy to understand but i cant say anything as i haven't checked the others
yeah , I use photon thats why its so easy to code but most of people never suggest it
oh thank you so much ๐
Even before the edits, was that graphic ever liked?
This graph (original one as well) does not even include many solutions, not to mention several fundamental problems with it
It seems I choose mirror network to learn and use
@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.
I just want to learn the infrastructure of online systems , I tried Photon but most of people never suggest it to use
I mean they call Photon as "trash"
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...
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...
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
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
Photon Pun 2 Networking
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.
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.
@gleaming prawn How did the Fusion WebGL evaluation go?
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
we have not yet done it again, we're finishing other tasks related to get the 1.0 final release
But it's still there...:)
Hope lives on ๐
I've had pretty good success with Nakamas websockets and unity
Oh nvm you said webgl. Those always equate in my head for some reason...
Well pretty close, but yea I'm more interested in the high level bits of Fusion than the transport layer ๐
Fair enough :)
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
Any specific reason for using PUN classic btw?
I follow a youtube tutorial that uses this asset: Photon Unity Networking Classic - FREE
Probably better to switch something a bit more recent. PUN2 has been out for a while now
i use them but its not good as script
https://gyazo.com/e76c33167038d910694b15961da0cf3b
Does anyone have any idea why the movement of this object becomes so jittery when parented to a player? This only happens on clients that aren't the master client, even though the rigidbodies are only enabled on the master client. (using Pun 2 btw)
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)
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)
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Are you using PUN's NetworkTransform for both?
NetworkTransform?
Photon Transform View I think is the correct name
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
Ah, I see. I'll try that.
That fixed it, thanks!
https://gyazo.com/33623655c6f442a2c1a4f43d7f092424
It's still a bit jittery when it falls though, any idea why?
Is that a remote object you
oops. Is that a remote object you're dropping?
(not locally controlled by the physics simulation but just updating through the Transform view?)
Yeah, it's only being updated through the transform view.
You might need to use Rigidbody view instead. That may help some of that. Or a better smoothed version of the transform view, that involved velocity estimation etc for the local side. But I don't think PUN has that.
And if you haven't seen these: https://gafferongames.com/post/introduction_to_networked_physics/ they are very good
Introduction Hi, Iโm Glenn Fiedler and welcome to the first article in Networked Physics.
In this article series weโre going to network a physics simulation three different ways: deterministic lockstep, snapshot interpolation and state synchronization.
But before we get to this, letโs spend some time exploring the physics simulation weโre going ...
Never heard of rigidbody views, what's the difference?
It synchronizes the velocities as well as the positions, which means that it can better predict locally
Alright, I'll see if adding one of those improves anything.
good luck!
Thanks!
Is anyone using photon quantum?
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()
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
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)
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.
Sounds like you want a Dictionary of nickname to element? Or am I missing something
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
@weak plinth Don't ask to ask.
You could also try asking in dedicated MLAPI server, link in the pins.
Dont ask to ask. what?
@weak plinth Ask an actual question.
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
Not sure what that local player check is but holy hell
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?
Hello everyone, how do I send an RPC only to a certain interest group in photon pun2?
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
@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
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
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
Describe better your issue
What I understand is that you dont see your character in the game on all clients?
So Im gonna suggest that you checked if you used PhotonNetwork.Instantiate when instantiating him and make sure to use PhotonNetwork.LoadLevel when loading a networked scene
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?
Pun is very good easy to learn and it has so much functionalities that you need and want. Donโt take my word as I have never used mirror as I have never had a problem with pun but it is the way to go๐
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)
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
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
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
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?
How long would it take to make a multiplayer when all of my assets are completed. (Gui, maps, guns etc.)
Depends on your level of programming, ability to learn etc
For someone who has never made a multiplayer and has to watch tutorials for code
Would you say you're a beginner at using C# in Unity?
I kinda get the jist of it but far from doing a whole script by myself
Ah, well multiplayer introduces a whole new level of pain and heart break
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.
you can copy/modify example/tutorial code for multiplayer that does simple sync/lobby/loading... but i wouldn't recommend attempting a multiplayer project to someone with that skill-level as you will have lots of issues/bugs that you have no hope of solving without solid fundamentals.
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
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
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.
Code:
Not completely rewrite it tho, all you have to do is make the inputs request the server
Atleast thats what got from the tutorial i watched
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
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?
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?
What you're asking for help with, is an incredibly large topic
ah
You need a combination of NetworkVariables and RPCs
thanks i guess i'll search them up and see what i can do
Yeah, the MLAPI docs are pretty good tbf
btw do i have to add the networkobject component to every child of my player?
I think the root having one is fine, but the docs might say otherwise idk
Only put it on the root.
Hello. using photon
I can't figure out why my OnEvent Function doesn't get triggered after a RaiseEvent call
https://hatebin.com/aaezynzbgi
please help
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.
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
Honestly, bang out an MMORPG in minutes
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?
interpolation
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
State your networking solution
?
Well presumably it doesn't work by prayer, is it Photon, Mirror, MLAPI, Sockets?
oh its photon
photon pun 2
the latency on prayer can be pretty bad
Yeah I read the documentation
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
There is no lag compensation or anything
Networking solution?
yeah mlapi
Oh soZ donโt use that
what
I donโt use MLAPI
ah
Do they work with RPC?
ye
When ownership change, the ball teleport and back how fix this, When the right "owner" of the soccer ball changes, it teleports, how can I solve this? https://youtu.be/MAr1mJWid20
Ok what is the full error
And also what do you mean by teleport I donโt see any teleportation in the video provided
no, the lag happens on the soccer ball, when it changes the owner it teleports
But I just see it roll
It looks like it just rolls to the player
Also what is that error
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 .
use two logical copies of the ball. each is owned by the player. create a ball that is rendered on screen. its position and behavior is your interpolation of the two balls
when player A owns the ball logically, the interpolated ball is shown on player B's screen.
ok but i need, create a copy of the ball for each player?
this is one way to do it, you can also fix your bug
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
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?
If you are using port forwarding they'd connect using your external ip address, but he'd need to connect with the internal one (probably 192.168.x.x)
yes I've done it, now I'm doing it like this to launch the game, only this error occurred
One possible problem at least
Hey thanks for the response. I tried having him use my DHCP which didnโt work either. Do I need to add an additional port maybe?
I use telepathy a lot not mirror. So I'm not sure how it starts but Are you binding the server to a specific ip address instead of 0.0.0.0
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)
Yeah Iโm binding it to my public ipv4 I believe
Try just binding to 0.0.0.0 instead
Ok Iโll try. Will others be able to connect though?
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...
Im getting this issue with Photon Pun 2 when trying to create a way to leave the game:
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?
maybe you send leave request multiple times
Could route stuff like that through masterclient and have the masterclient confirm those actions.
yep, working on it already, thanks!
Is it possible to use websockets in webgl build?
yes
Nakama has a nice implementation for Unity
@cold yacht Can i have a link to this resource, please?
Documentation for the Nakama realtime and social server for games and apps.
@cold yacht Thanks mate, is it possible to use raw websockets in this nakama library?
Possibly. I haven't done it that way but the source is there to see down to the transport code.
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
I'm using pun for this, https://duhprey.itch.io/immortals-shattered-worlds there's a lot of activity but maybe only several hundred object to the extent I've tested games so far?
I'm not doing any high frequency sync though. Occasionally correcting positions or health (or other less visible things)
Wow,looks marvellous amigo. So on synchronizing many objects, u must ve used custom type on rpc or raise event right?
Like manage all the objects in one script
Hmm, no they're each relying on their own photonview if I'm understanding your question. I'm primarily syncing floating point values. And then rpcs for creation deletion (and other implied booleans)
Same as i did before.but photon limits the count of photonview that needed to be less than 999, which sucks
Ah good to know. I haven't hit that limit yet
I heard Unet don't have this kind of limitations only photon,jezz
UNet's limitation is that it's old, crap and deprecated
Don't use UNet, use Mirror or MLAPI for UNet-like solutions
Yes im awared
Hey
How can i make multiplayer game
without Photon
I still canโt find one tutorial about 2d yet
Search for tutorials using Mirror or MLAPI
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
@bold goblet Not a place for job posting. There is a section on the forum.
The networking concepts shouldn't change at all between 3D and 2D. I wouldn't get hung up on that detail when looking for resources.
hey I just start learning photon pun is there a way to check kill?
Can I check from killfeed?
what exactly are you trying to do? Like tell another player who killed them?
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?
Yeah ok then
@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')
I want to tell player1 that he kill player2 and add killCount
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
yeah lol
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
np haha
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
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?
Hey are there any other ways to do 2d to do online multiplayer without photon
I told you last night to Google Mirror and MLAPI
Danny mentioned not getting hung up on the 2D part, it's entirely irrelevant
Ok
Then what should i do
Youtube is literally cluttering with photon engine online multiplayer
Three times, let it sink right in
Mirror and MLAPI are networking solutions, because you seem to dislike Photon PUN for some reason
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
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
I would start by looking at what existing MMO solutions are doing. SmartFoxServer and Namaka to name a few.
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!
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
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
How to install server list mlapi?
https://github.com/MidLevel/MLAPI.ServerList you just put the files in the project?
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.
You've got compiler errors, what's the ones above the weaver error?
More weaver errors, an object reference not set error, more weaver errors and dashes.
And this 5 times.
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
Do you know what the issue might be? From googling a lot of people say the issue comes from stuff having using UnityEditor in their scripts but mirror came with that and I don't know if I should delete those lines.
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
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.
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
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.
@olive vessel Fixed the issue, had to get a new version of unity.
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)
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
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
In the end you need some sort of relay server to reliably make connections without portforwarding. There are techniques to punch through NAT firewalls, but they don't work for all users, so you generally need a server regardless.
you can use com.unity.webrtc data channels and use a Twilio account as a relay server
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
Help please with this
I don't use PUN so don't know, but did you see that ? https://forum.photonengine.com/discussion/12872/onplayerpropertiesupdate-not-called
No.. I'll read it now.. Thank you
post it on our issue tracker for Mirror. we recently switched to ILPostProcessor for Unity 2020+. You can still use the old one with Unity 2019 or by changing the ifdef. Either way please post the issue so we can take a look ๐
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?
Only the server can spawn a NetworkObject, you can send an RPC up to the server to spawn the bullet.
I have done that but the client still cant find the prefabhash
Is the prefab registered under the NetworkManagers prefab list?
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!
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
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
Is there any reason I shouldn't switch to MLAPI from Mirror?
I dont know, but i want to start with MLAPI too, because it sounds simple to use and is free
Mirror is also free, they're both good solutions. Mirror is the elder solution, which may have more complete features.
Yeah I've heard that MLAPI might not be ready to use in projects you plan on selling/publishing, but I haven't seen a reason not to
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)
What's the most simple way to do multiplayer in Unity? Particularly for a 2D, brawlhalla like game
i wouldn't mind some help thanks
@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.
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)
(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.
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)
@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.
@silk iron I think you need to make a function for synhronization and add your transform position and rotation to it.
i do have another issue hto
how would i make this https://pastebin.com/dT1uhbRi multiplayer ready?
could i replace the player GameObject with this?
Yeah or other not sure where that script refrences the variable player
well this is my new one
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
and after testing i get this
and i have a collider on my player
Does the player have the tag?
And the script is attached to the player?
๐ ๐
Use other instead of this
What is the structure of your player gameobjet
๐
Epic
okey maybe somebody will answer me
Why these objects are being desynchronized? And they are synced only after when master client have interaction with it
Can someone list every way to make a multiplayer game
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
You can only despawn NetworkObjects as they're the ones shared across the clients. If you'd want to disable the gun specifically on the clients, then I'd suggest setting that specific GameObject to inactive on all clients instead
Which could be done through a RPC , depending on whenever you'd want this change to happen
Hi anyone know Photon Bolt here ? I'm having issues with my scripts
Better to just post the issue
found it thanks though ๐
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)
Photon is much easier than u think my friend
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
do you have any good tutorials to follow?
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.
Agreed
Yes depends on how you want to learn
Like with the tutor
the tutor runs through the code?
what do you mean?
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?
I was thinking of a 3d battling game. Everyone picks a character and then we go into a map and fight
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...
This will allow you to create a waiting room
In which you can choose your skins
Or characters
ok thanks!
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
can anyone help?
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)
@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.
how do i know if its the owner?
my problem is that every client's camera gets destroyed
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
i use mlapi
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
I've seen those tutorials, for his BaseServer and BaseClient I believe he uses the Unity Transport, this is different to MLAPI
yeah soo. i cant use both?
There's no point using both, it doesn't make sense
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?
Not sure about MLAPI's integration with PlayFab, I know Mirror does that
Mirror absolutely does?
No dear, they've had a lot more than that
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?
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
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.
MLAPI has a good docs site, idk if it specifically covers building a server build
my braaiinn
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
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
What is that goal?
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.
Ok cool
@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...
Not sure if the video got what you're looking for 
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
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 ?
uhm don't think you need this one
you're not implementing one of the callbacks from your screenshot
okay come back if this didn't work, should be an easy answer for someone who used it in the past
dont worked but what if here is the actual problem?
The position synchs but the rotation not
a player rotates all other players
MIRROR 46.0.4 IS LIVE ON THE ASSET STORE
Download: https://assetstore.unity.com/packages/tools/network/mirror-129321
ChangeLog: https://mirror-networking.gitbook.io/docs/general/changelog
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?
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?
hes the guy i was talking about an no, hes using transport and this demo game doesnt even have enemies.. sadly..
Well MLAPI is built with Transport, so that shouldn't be an issue?
I'll actually give it a try myself
that one guy i was talking with earlier said transport and mlapi is different. that i couldnt use my transport baseclient and base server in mlapi.
Oh yeah, well transport is lower level
MLAPI has a UNet Transport, UNet Transport != Unity Transport
MLAPI uses Transport, not the other way around
Yeah we might be talking about different transports then
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
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
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.
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
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
i mean, they say that but, Request ticket> server Authorization > result.
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
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*
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
Yeah I don't understand why isLocalPlayer is useless on a dedicated server?
There is also isServer
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
If I am the local player, and I input a key, send that to the server to move me
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
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
Yeah which is why you pass the client you want to give authority to to the spawn command
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
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
You can do that too...
whos its talking to
Mirror and MLAPI are high level solutions, if you don't like it move down
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
however high up or low it is, it should be intuitive considering the solutions are supposed to be designed by humans and all. lol
The documentation isn't that broad, but I think it has enough content to implement the things you need
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
Yeah that's more about network standards and strategies
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.
@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.
@agile spadeYeah dedicated works fine. You can see my linux machine running remotely on the right with the dedicated server, as well as listening to the correct ports selected in the NetworkManager.
On the left my local client running graphically as intended.
https://gyazo.com/e9ccf7f9e078e9d08a029723ec1da984
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
As welsh had mentioned earlier, you just run the same build but with the "server build", and use NetworkManager.Singleton.StartServer()
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
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.
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
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"
still need help..
You should repost the problem, with any updates, it has been two days after all so you should have made some changes
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
does exists NetworkServer.dontlisten into the MLAPI??
hey something weird just happened, Photon.Pun is missing but others aren't???
it was fine seconds ago wtf?
@glossy widget I generally just go to Unity -> Edit -> Preferences -> External Tools -> Regenerate project files whenever the IDE craps out like this.
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?
can anyone help with this i cant figure out what is wrong here is script https://hastepaste.com/view/zmx4enZLzA
I assume that _photon is null
yes i think so but i cant figure out how to fix i have been trying for like an hour
The object with this script has no PhotonView component, or, you try and use _photon before it is initialised in Start
@olive vessel i think second cause it has photon view so how do i fix it
Either initialise it earlier in Awake, or don't try and use it before it's initialised
awake dosnt work so how do i make sure it is initialised
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
You want to enclose the use of it within that condition
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); } }
If it is not null, send my RPC
so yes?
Yeah it won't let you use it if it's null
ok thx
Which will avoid the error
ok thx
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
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
so anyone know
This channel is definitely dead
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.
Thanks
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?
still need help...
Have you considered just finding a Photon PUN tutorial for movement and rotation?
I found many utorials, but not about the rotation with mouse position
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
ok thanks, I'll do my best
@candid hollow Don't cross-post
Ok. Sorry. I deleted it
how to use mlapi with DOTS?
I answered you, MLAPI is Netcode for GameObjects
Pinned here are the DOTS Netcode and Transport
Where can i address it?
Photon
You've ignored conversation directed at you in other channel. <#๐ปโunity-talk message>
Might as well ask here now.
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
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)
Is it possible to get an array of files names from a web server directory? Similar to Directory.GetFiles() but from a URI?
Please don't crosspost. This isn't a networking question. #๐ฑโmobile.
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
depending on the networking protocol, you might
Please elaborate
if you're communicating via UDP and one of the endpoints is behind a NAT, you might need to holepunch
do you know what NAT is?
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
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
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
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
About 4 billion yeah
right
so NAT is a technique for allowing devices to communicate despite not having unique addresses
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
can i ask what you're trying to do?
is a webgl build capable of executing on the server or is it entirely sandboxed and downloaded on the client side?
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
are you actually running into an issue where clients aren't connecting?
Not at all
or is this a hypothetical scenario you're conecrned about?
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
is the goal of this project to learn about networking, or make a game?
Making a networked game ๐
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
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
i don't really understand your question. if you run a webgl application on a server, it's running on the server. if you run it on the client, it's running on the client
You're right I well understand it's a complex subject
ENet is definitely not what i'd consider a beginner-friendly networking stack lol
try Photon or Normcore
I like the fact it doesn't impose so much on me in terms of learning the API
what it doesn't impose on you in the API it requires you to write yourself
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
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
https://gafferongames.com/ has great articles
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
I am not familiar with WebGL builds. Its not a "network" game. I think its sandboxed on the client, but better to be safe than sorry
ah i see. i'm probably not much help to you then, but good luck
Thanks I'm gonna have to dig a bit deeper
if it's a not a network game why are you asking about it in #archived-networking lol? but to answer your question -- when running a WebGL game in a browser, it's just executing the code inside the JavaScript VM, which yes is sandboxed if your browser is worth its salt.
@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
running Unity on the server?
you can just run unity in batchmode and it'll happily run on a server
Not unity but a webgl build
but why would you want to do that? the only reason you'd compile to webgl is to run it in a browser
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
I guess kind of like how Stadia streams the computed content, or maybe I misunderstood the question
well that's a whooooole other thing
that's literally just streaming a video of the game to your browser
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?
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
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
blazor and unity are just completely different technologies
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 ๐
there's just no reason to, Unity already effectively translates C# to multiple target platforms
IL is Unity's wasm
Although I think unity compiles to C++ first then to WASM. Blazor has the entire dotnet runtime in a WASM assembly
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
Yeah you're right it's called IL2CPP for a reason but you get my point ๐
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
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#
well, blazor does it lol
but i think it wouldn't solve the problem of other platforms
mmm true
Maybe in a few years other cool stuff is possible as the technology matures
Sorry for the off topic mods back to networking now ๐
lol. i do wonder what they were really asking about
He/she didn't talk anymore so who knows
because it is not a game yet, working to make it a decentralized game. Thanks. Technically speaking, I am using a Qt WebEngineView, so kind of a browser ๐
New to Unity and its networking, so trying to prevent writing a whole library that does everything. Asking dumb questions instead to learn about this new toy.
or as embedded WebEngineView that is OS agnostic ๐
I think for now the only option you have is vanilla, so clients will have to download the entire build
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?
i dont understand your problem
you can certainly make HTTP requests in Unity, e.g. via UnityWebRequest
already build a REST api around it
I know, but if the page is dynamic, it probably times out as the page is JS driven.

