#archived-networking
1 messages · Page 100 of 1
are you calling API URL on this? I mean what is the response format (i.e JSON, XML)
its a binary string
that the doc
lmao
(i know its in python im trying to do it in C#
I have check the link. It is on JSON format, you can use any language on this.
First question. in order to send any request you need to have an authentication token send it along the header.
Do you have any authentication token with this API?
thats good!
thats what i have but im not sure if its working
i dont have it. ive heard of it tho
You can use it first for testing in sending API web services
you can add your authentication token
we need to verify first if you successfully send & receive the response
using POSTMAN tool
thanks ill get it now
In regards to this inquiry Get Request from unity handles the response (error,success) etc..
Make it work first in postman. make sure you successfully sent and receive the response from you API URL.
got it working
ignore the you are banned at the bottom, its a joke lol
What is the status : ? is it 200 ?
all those binary characters are the ones im trying to get, with the code i put above i get this (the first part of the reponse)
i dont know if i am actually recieving it all and unity cant print those binary characters of its not working
from what I understand in the documentation you should receive an object response (JSON)
not binary
im not sure
its supposed to be binary
at least thats what i want when i request it lol
because its the inary that i need to work with
Ok, on your C# unity can you try calling the GET method
and put debug/breakpoint on each response (success,errror) inside the switch
so that you can verify if the request sends you a response either success or fail
is that not what im doing here?
i have an EnsureSuccessStatusCode thingy
but that code works then?
do you have the documentation on that Python client call?
I have check this one from unity itself. GET request
the one I sent earlier
There should be also a response handler on that pyhton client call like. onSuccess,onError to implement . Kindly check if there is a documentation on that
cant i just assume its worked everytime?
im probably being really dumb in saying that
What did you receive in your (String content) ?
this but the lengtrh is much longer
so im assuming Unity cant print the binary chatacters
CAn you send screenshot of response
you see that what content equals is the first bit of the entire reponse from this ^^
what do you mean?
what should be the actual data you should receive? I think you need to convert the binary to string for you to have the raw data
this is the data i want want/am reciving
and i think i am reciving it with Unity
aka: i think its all working
now i need to work with it lol
just implement the response handler after. (onError,) maybe there would be any network interruption.
yes, at least the network call is working. you just need to parse properly the response
awesome! thanks
I am working with PUN 2 I i don't know how can i modify a gameobject
What do you mean by "Modify a GameObject"?
In the new 2021 hello world MLAPI you can easly drag a game object to the network manager default player area, but how can i controll the cameras of both players?
Because the script exists on both in each player's game
You need to check if "this" is the local player, and if not disable the components
Hey, was wondering if there was incompatibilities with the Linux server build and windows clients?
On a windows build the clients connect and work as they should, but on Linux the socket stops reviving data, and is either disconnected by the code or segments faults if left connected
This is using the System.Net.Sockets
Would making a player controller a singleton in a networked game cause issues?
I don't see why you would make the Player a singleton, there will be multiple
Ofc for things like movement you have a check to make sure that this instance of the script is the local player before continuing
It's kind of a convoluted thing. But I'm using the new Input System with Cinemachine. I created a new Cinemachine Extension to get the player's mouse input from the player controller.
I saw someone suggest an inputManager as a singleton but my player controller is my input manager as it takes events from the input system and updates input values based on that which the character controller will use. But it also handles giving the characterController a reference to the camera.
So in my cinemachine extension to get an instance of my playerController it would need to be a singleton right?
Doesn't Cinemachine already have a reference to the player through Follow or LookAt fields?
Just remember, the name singleton is rather descriptive, there can only be one
Although, I suppose each player could have one in their instance of the game
As long as the others remain disabled in their instance of the game
Decent chance your networking solution has a localplayer gameobject reference anyway 😄
I would keep the singletons to manager objects only, as it's a lot less likely that you need multiple manager instances than multiple more concrete instances
True, both Mirror and MLAPI have IsLocalPlayer
Can RavenDB work with unity?
Or any No sql database for that matter
I have learned a bit Unity and made a game template with basic logic and prefabs but I'm willing to focus on multiplayer projects, mainly so that one client is also the server, maybe with a server later.
How is the state of networking using Unity:
a) is there really any point to try to make multiplayer games in Unity as Unreal Engine seems to have integrated network functionalities? Not worth the extra time needed to do more complex configurations?
b) Are the plugins for Unity (MLAPI and Mirror as far as I have heard) reliable, safe and long term supported? What are the differences and the best option for such self hosting and possibly later using with a separate server instance?
Pun is mirror based and ia free for the most part, yes it is reliable and safe. Pretty easy to implement into pre-made games. Very recommended, works great
PUN is not really "Free"
20 CCU is free, after that you pay
Only good for testing purposes
If I ever release something reasonable that 20 ccu is a deal breaker....
I guess I will try using MLAPI as the new official solution... in case it is lacking something I don't know about I will find it out eventually
Photon RPC is not syncing/sending. Any ideas?
Mirror based? No. It's not related at all.
It always uses a relay server (which does a bit more than just a relay) and when the game/app is no longer in development, you book/subscribe to a certain CCU amount. Concurrent users are waaay fewer than downloads, mau and even dau. If you think it's expensive, ask us if you estimate correctly.
There is a 100 CCU "subscription", which is $95 for one year and it's frequently on sale.
Streaming tonight, continuing on the attempt to implement a 3D interpretation of "Super Crate Box" using Photon Fusion.
Planned topics (will move faster today):
- network character controller (client side prediction + reconciliation)
- 1s person camera input setup (144hz ready)
- (if time is enough) crate-boxes spawning and picking
Where:
https://www.twitch.tv/erickpassos76
When:
22h-24h CET
Idk, didnt do much research before posting this, i just saw it was mirror based on some fprum and assumed they were correct, sorry :)
No worries!
:)
Does any one know how to implement Lobby Systems ?
Like How to load Players of different lobby on the same map and cannot See each Other
Mirror has a Network Match Checker, which isolates players to their match within a single server instance
Does anyone have any experience with MQTT and unity?
Hello.
I could not set the addressable asset for firebase stroge.
Have you faced this issue?
firestore did not provede me a proper link.
Second question is: I will use a firestore and want to use storage to store some documents.
how can I conenct them?
Is Making link of a stored document into firestore database good practice?
thanks
hey guys, I've been working on a unity 3d project and I want to add multiplayer, can anybody recommend me a good tutorial?
@weak plinth its not often easy to just "add" multiplayer
you basically have RPCs and commands to pass around information in most common networking assets
and everythig is built over them
if you know what data to send, and how to read that data on the other side you may not have to learn much
better to plan for it from the beginning. most who "add multiplayer" end up spending a lot of time re-working things to facilitate this sharing of data
The best time to add multi play was at the start of the project. The next best time is today!
Is there a place where I can get advice on what cloud service and networking solution to use? I am mentally prepared to pay someone after spending days trying to decide myself
@weary creek Job and collab requests go on the forum
Sorry, I mentioned money to convey my desperation. I am just looking for additional insight. Is it still considered a collaboration request?
That's fine, but you are probably not going to receive a lot of input with the information you provided about your project
Fair enough - I am currently looking for a cloud service and networking solution for a mobile game (headless,authorative server). I would like to store basic player information that I can retrieve before a game starts. The game play will look similar to Clash Royal, where players send characters to damage the other enemy. The only input required is selecting the character to use and then sliding their finger across the screen to "send" them. After some research, I am leaning towards Playfab/Firebase and Mirror/Photon Bolt. At the moment, I can't determine what is the best combination is
Definitely sounds like something simple enough that you could create on your own
C# has built-in networking properties
I can't speak for any libraries though.
try both 👍
In the future, I would like to learn how to make my own solutions, but I don't have the time at the moment. Would Mirror be a good entry point to learn about it?
It sounds like you're making a turn-based game, or something of that nature
I would only use mirror or something like that if you were making a realtime multiplayer game like call of duty or something
I don't really know much about those libraries though. You would be much better off making your own solution in my opinoin. Other people might say otherwise. Who knows
The game isn't necessarily turn-based, but also doesn't require an intense amount of inputs.
I have heard people mention making their own solutions before. Is it easy to get into?
PHOTON Question
So I am currently working on the online multiplayer of my game ... I have set up a rudimentary Playfab login (will add Google/facebook etc sign ins later) and have been able to create and join rooms and start the match when 2 players have joined ... but that's where the fun begins.
As it seems that both players run separate instances of scripts in the same scene and though at first it was hilarious , it is starting to get annoying now 🙂
I have purchased many tutorials and went down a rabbit hole on YouTube (oddly enough the free content often was better than the ones I paid for) as well ...
But it often is just a matter of copy & pasting code and tinkering with it as they really don't explain what things really do(or perhaps I am just not smart enough 😉 )
For instance I don't really understand/know how to set ownership ... how do I "connect"the player one prefab to player ID 1 and player two prefab to player ID 2 ?
also how to have the masterclient set the pace of the game, so that even if P2 has the turn it has to send a message to P1 saying it's done and then trigger the turn change
This is how I set things up: I have a turnmanager which instantiates Player one or Player two based on a State and that works fine locally but when it comes to online I am missing something .
These are the relevant scripts ... keep in mind though that I am tinkering with these scripts atm , so the code is not super clean
You can of course comment on these things (it's a free country after all) , though I hope you are willing to look at and focus on the photon portion 🙂
PhotonConnectorscript: https://pastebin.com/WdfA8YhC
TurnmanagerScript: https://pastebin.com/XGBQ2cQM
Player Script(P2 is similar safe for some transform changes): https://pastebin.com/HbjDihBP
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.
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.
ok thanks for the explanation
That's all it is, just sending data back and forth. C# provides a UDP and TCP client for this type of communication.
Essentially your server is just going to be a unity instance, with all of the same stuff that your clients are seeing. That way you can send accurate data to each of your clients and have an accurate representation of the actual game
You'll need to know the difference between UDP and TCP before you begin.
For instance, when your clients first want to connect to the server, you'll probably use TCP or something similar, because UDP packets are never guaranteed to arrive at the destination, and some will always get lost in transit.
Guys a question, can certain people be made hosts and other people connected as clients to them without me having to run a server... Basically the COD private multiplayer map concept... How can I achieve this using MLAPI
The part that I dont get is how do I assign IP address of the host to the client cause the IP address will change if the host changes, also can I change the host with code (like a script that changes the host to the person who has got the best fps)
I am unable to do a simple GET request from my WebGL build running on a local apache server on my raspberry pi.
The code all works fine and gets the data from the external API while running in editor but on WebGL it just gives:
Access to XMLHttpRequest at 'https://api.3commas.io/public/api/ver1/bots/5216624/show?include_events=true' from origin 'http://192.168.123.102' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
I've been searching like a madman, been trying to configure the apache server.
I just don't know if it's stuff I need to fix in the apache server or if it's stuff I need to change in code in unity
Any help would be greatly appreciated
@shrewd ember The error suggests you need to add the Access-Control-Allow-Origin header. With Apache it can be done on various place depending how hardcore you fine-tuned your config. Look for a .conf file with sections like <Directory> or <VirtualHost> if you use them, that's common place. If you're lost, easier would be to set the header in an .htaccess file on the web root directory to override the global conf.
Mr.K you sitting down :'(?
?
Oh so you tried all options and didnt work
Did you restart the server ? that's a common mistake
though the htaccess should work immediately
Multiple times inbetween trial and errors
okay
This is basicly the error
Everything working fine until I press Request
I'm completely out of ideas... You got anything?
I even did: sudo a2enmod headers to enable headers in apache
i just dont understand what it exactly means with no access control... header is present on the requested resource.
What is exactly the requested resource?
In postman and in the unity editor, the request works perfectly
When it works you should see the header Access-Control-Allow-Origin in the Response headers
The requested resource is the URL you query: https://api.3commas.io/public/api/ver1/bots/5216624/show?include_events=true
oh interesting detail
could be the browser than blocks local acces then
for security purposes
like you wouldnt be able to write where you want to disk for security reasons too
Yeah browser with apache most likely. That’s just it. I don’t know what to change anymore
I even started the chromium browser with security disabled. Didn’t do a thing
So then it’s even more likely the apache server...?
There should be a dev settings in chrome to allow localhost access I guess, I didnt tinkered with that since a long time
Would that mean that I just need to add that header to my web request? From the unity code
Nope, if you see the Acces header in the Response headers from Postman and it works from Unity, that's good
Nope it's from the server and looks like you did what's expected
Try to enable this ? chrome://flags/#allow-insecure-localhost
Aight, just left home so can’t do it right now
That's the only hint I have right now :p
Aight! Is there any way for me to check in code where the issue comes from? Like can it actually send the request or is it when the data arrives back?
Actually your server works and respond, you saw it in postman and with cURL. It's more the browser which isn't happy. I can't really tell at which point in the communication.
Wait a second. You don't own the server you query to ?
I don't know why your raspberry is involved but the website won't allow you to query from localhost
But then why does it work from Unity editor, I don't know. Little confused here sorry
@shrewd ember Maybe this will help https://stackoverflow.com/a/43881141
I'm trying to get into MLAPI networking but I'm already stuck:
How to make a moving object in the scene to be synchronised to all clints (one client is also the host)?
The system does not even allow converting vector3 to nerworkVariableVector3 😖
@austere whale shouldn't you be putting "new" keyword there?
It should be currentBallPosition.Value = newPos; I suggest following the tutorials in the docs or some youtube videos to learn about the basics.
Hmm yea I’ve seen that post.
I was hoping not having to make a proxy.
I kinda just want to run it locally on a raspberry pi touch screen that just sits on my desk.
Will try it out though thx!
No that’s the weird thing.
I can make a query to the API (which I don’t own) from postman and from the Unity editor without any issues but once it’s on the apache server, it doesn’t like it
I guess maybe the server I query to doesn’t send back a header? Which gets accepted just fine in postman and Unity editor but once running in a browser, it’s not a fan?
Perhaps this is also a viable solution once I get back to it:
I have tried to look at the tutorials and documentation but maybe I have missed something 🤷♂️ I will check again tomorrow
Thanks for answers
How can I spawn an object(not a player) for all players in pun classic? I’m basically looking to allow players to spawn(place) structures(prefabs). So if one player placed a wall, the wall prefab would be spawned and it’s transform synced with the player that placed it; so that all players can see and interact with it.
@normal hemlock a common "shooter" tutorial should show you how to spawn an object
as in spawning a projectile for the player
i think there were some "spawnable prefab" fields somewhere that you needed to register the object
and you'd be able to use photons spawn command for those objects i think
but its been a long time i haven't used photon
Not spawn on awake; spawn on command(client command, server action)
hi guys, if I decide to host my game on a AWS EC2 instance for example, or any other server, would I be able to program a way for users to host lobbies on the server?
basically dinamically creating more lobbies on the server
hi @everyone can someone plz help me? i am not a beginner to unity but when i use photon and join a room, it decreases my brightness to something like horror game brightness. can someone help me?
Oh aye try pinging everyone...
Go figure, but entitlement won't get you there
I doubt Photon is doing anything to your brightness
Check your lighting
I really don't see how a networking solution, or networking in general would do this
It's either lighting, or some other code you added
I understand the premise of a brightness decrease
Are you switching scenes?
yes
So how are you doing that?
wait
PhotonNetwork.LoadLevel(1);
i call this in a startgame function i made
that is being called in OnJoinedRoom
Yeah I think it's a lighting issue
People online say turn off Auto Generate, then press Generate Lighting
where do i do it? i forgot
Lighting settings
anyone can point me in the right direction? basically I just want to know if it's possible creating more game sessions on just 1 server
if you containerize your server then just run it on AWS kubernetes and they optimize that
you could also create a C# application that acts as a lobby and starts programs which could be your server programs (would also need to transfer these players to your server program)
@woeful herald i recommend just containerizing your server
alright, thanks!
can someone help me with some photon stuff?
Don't ask to ask, just ask
on a command just c all go.instantiate
uhm my game doesn't work through external ip also i used https://canyouseeme.org/ and it says the port is closed
A free open port check tool used to detect open ports on your connection. Test if port forwarding is correctly setup or if your port is being blocked by your firewall or ISP.
i CAN connect through 192.168.x.x and 127.0.0.1
but canyouseeme says it can't detect activity on that port
i also portforwarded the port on TCP/UDP
so then you didnt portforward @gray merlin
are you releasing a game through a server your running on your own machine?
why dont u just use a service like EC2 to host ya servers
i did
its a selfhosted server
but the host has to portforward
its a 2player game
@gray merlin bruh if the canyouseme.org tool tells you the port is closed then its not properly portforwarded
so it says the port is open and you still cant connect?
so i portforwarded 25565 (minecraft's default port) and ran a server and it said it was open
is your server binding to the correct port
but when i closed the server
it said it was close
for my game's port
it says that it's closed
but i have portforwarded it the same way as my other ports
make sure the server binds to the port your portforwarding to
i also tried connecting to my own localhost server through ngrok but it didn't work
how, i just set the same port
same port for server as for portforward
yeah thats what i mean
TCP
.
so minecraft server works when you tried it (25565)?
then its a problem w ya server program
how is your server written
so your manually portforwarding
if ur server project works completely fine localhost
then it has to be a port forwarding issue and hit up mlapi chat
i use mirror instead ofmlapi
well... i forwarded ports 80 22 and 25565 and they all work
server programs dont have discrepencies for local and portforwarded connections
if it works local then itll work when u portforward
You can not use ngrok with MLAPI. ngrok only forwards TCP ports but MLAPI uses UDP.
oh mlapi uses UDP damn
i assumed it was tcp
try portforwarding both udp and tcp @gray merlin
Both udp and tcp or only udp should work.
i didnt try udp only
if u portforward an extra port it wont break it
Oh sorry I tried to say before that you can't do it with ngrok.
oh
then
idk what's wrong
but
https://canyouseeme.org/ only says that it's open when sth is bind to that port right?
A free open port check tool used to detect open ports on your connection. Test if port forwarding is correctly setup or if your port is being blocked by your firewall or ISP.
yep
opened on udp only
and canyouseeme
says it's closed
even when i host my game
also the port is being binded
and ik that cuz when i build the project in console only and start the server
after i already have one open
it says that it can't bind to that port
port's open
i also tried disabling my firewalls
and nothing
...
well i'll go offline now if someone wants to try to help me please DM me or ping me but i won't reply soon
its clearly a port forwarding issue
not something mlapi related
Hello
I wonder if it is a good practice to convert my dictionary coming from firebase to an object.
and doing my operation with object and converting back to dictionary before I send it to the cloud
so, in the code, I won't fight with dictionary during the development
Do you think it is a good practice?
but idk how to fix it
cuz i portforwarded other ports already and they work
and im pretty sure that if i open a minecraft server on my game’s port canyouseeme will say its open
@grave ice
Quick question, between PUN/Bolt, Mirror and MLAPI, which is the simplest to get started with networking? (in the sense of getting a very simple working game up and running, something like tic-tac-toe or whatever).
@slate imp PUN
Thank you for concise answer 🙂
i agree that PUN is the easiest but ive used both pun and mirror and they are very simpl
Which is better for a client server model
Im leaning towards Mirror
What are the limitations of PUN 2
ive used both PUN and Mirror @weary forge
when it comes to the code, I would say client wise PUN is easier
but client/server, mirror is way easier
a custom PUN server was a little pain in the ass for me
plus you can deploy mirror servers wherever you want
PUN servers must be hooked into their network & master server setup
(though you can deploy PUN outside of Photon Cloud, you could self deploy it on any network)
Thanks for the run down pal, appreciate it
MLAPI documentation refers to updating UI after the value of a networkvariable has changed. How is that actually done? I have got TMP text elements that should have text based on variables. If it is just about setting the new value with
"scoreText.text = "Player score: " + scoreInt.Value;"
what is the point of using a network variable instead of a client RPC including the new data?
Or is the data already on the client without an RPC and I can just use the variable there 🤔 (it doesn't according to my tests 😒 )
RPC's aren't necessarily going to be picked up by newly joined players where as networked variables will.
Network culling also tends to work better out of the box with these magic variables
Ok have to take a look at that then...
But how am I supposed to get any output based on a NetworkVariableInt for example? I would like to use the value to represent current player score (of goals).
Object transform sync I understand as I just works when the object has network object component.
Like in this example there was a renderer that could actually access and update stuff if it was run on a client @ 11.42 but I couldn't find anything similar for updating GUI elements/text...
https://www.youtube.com/watch?v=iQDGLaSI3Cg&list=PLS6sInD7ThM2_N9a1kN2oM4zZ-U-NtT2E&index=5
And that is a good point and I could notice it myself - so for sync when joining late one should use initial value check to get the non default values right in the beginning, not after they change.
So does anyone know how to update GUI text on clients based on a network variable (integer) using MLAPI?
Hello.
I have 100 different gameobjects. I converted them into assetbundles individually and uploaded them into Firebase storage. In Firebase Firestore, I put the link of the asset. And in runtime, I want to download them individually. But giving them "label" is too much to do and the count of assets will be increasing by time so it is not possible to handle it. I do not know how should I have handled this issue?
My question is : Is there any way to download this asset bundle in runtime before I had introduced "label" in the editor.
Because, According to the location, I will need to get another 100 different game object to initialize in runtime. And I can not write tens of thousands of "label" to apk. and could not update the program all the time
I hope I could explain.
Tried to google it but couldnt find much
thanks. do you know if Unity programmers would help me out if I wrote a ticket?
More Adventures in Photon
Now it's still not where it should be, but at least I got it to work somewhat, which is sort of a relief ...
... for some reason the two players won't sync completely... probably because they access their local version of teh scripts involved ... still not sure what it is, but hey , I am further ahead than I was 3+ days ago 🙂
https://www.youtube.com/watch?v=T-ailuRcFjY&ab_channel=MartinvanStein
Some syncing issues with Photon...
Hey everyone, I had a question related to multiplayer networking, and have attached a sort of block diagram to get a better visual of what I am trying to accomplish. I am developing an application that uses two way communication between a cell phone and a computer. I need the phone to be able to send video from the phone's camera via WiFi to a computer (1-2) where the computer can view the video streaming from the phone. Additionally, I need the computer to be able to access the "touch" capabilities of the phones screen by using the mouse (3-4) only within the application (meaning the computer does not have access to anything on the phone outside of the application and cannot close the app). Does anyone know what kind of service I would use (?), and any good guides to get started with. Please feel free to let me know or DM. Any help appreciated!
@mossy pawn you need to solve two technological problems. 1) video stream directly from a phone client to a computer client 2) you need to network between a unity desktop client and a unity phone client
the second thing will be easy. you can use any networking, like mirror or MLAPI, and simply send over Unity touch imputs
for 1) I would recommend researching video streaming and live video streaming
here is a live streaming API I found via google @mossy pawn https://www.dacast.com/
Hello fellow programmers! I'm here, again, asking for help.. recently i experimented a lot with networking in C# + Python(for server-side) when building my first multiplayer game in Unity, i'm very proud of some results, and what i've learned during the dev process, although some things didn't come out as expected, and i think that's normal, cause i'm still learning. Basically, i really don't like using third-party libraries for networking, i never used one, since i like customising everything in my code, surely i won't recommend this to anyone who doesn't have enough resourcefulness and motivation...problems arise very quickly when trying to create an implement your own custom networking protocol. In my case, after building the first playable version of my game, and testing it with some folks, i noticed a lot of lag, and bad synchronisation between clients, for example ( my game is a 2D arena shooter ) some bullet collisions were not fired, some packets were delivered before/after others, players were moving sloppy and not in a smooth manner... i was using UDP for the actual game-match protocol, while TCP was used for everything else, like lobby management, and so on. Can anybody suggest me some online resources, where i can learn about gaming networking protocols, and how to implement them in the most efficient way? Also, apart from implementing a networking protocol, another critical topic would be making everything server-side, i'm surely confusing lots of the concepts involved about it. If someone here has already implemented a full reliable, custom networking solution, i'd be really interested in having a conversation with you about it, you can also DM me anytime you want, it would be really appreciated! Thanks in advance! : D
Maybe this will help you? I found the code a bit ugly... But the concepts are straightforward. And I assume, he is implementing UDP for smooth client movements.
https://m.youtube.com/playlist?list=PLXkn83W0QkfnqsK8I0RAz5AbUxfg3bOQ5
Ok, thank you, apart from this series of tutorials, where can i find details about server side logic in multiplayer games?
On Tonight's Stream: Pew Pew Pew Playtest with the Audience!
Continuing on our attempt to re-imagine "Super Crate Box" in 3D competitive FPS perspective (full server authority) using Photon Fusion.
Topics for tonight:
- lag compensation (setting up hitboxes + lag compensated raycasts and overlaps)
- NAT punch through + relay fallback (demonstrating the new connection workflow using Photon Cloud)
- (because of above) Playtesting with the audience (lets see how it goes live).
When: 22h CET
Where: https://twitch.tv/erickpassos76
Question about Photon RPC
when using OthersBuffered, I'm hoping this method will be sent even to players that join the room after
but for some reason, suddenly Photon starts reporting that all other RPCs have wrong arguments
if I disable this method, it's all fine
make your question more specific to find a more specific answer. for real time physics in games heres my fav resource
from the Game Developers Conference vault
ty
this resource goes into detail about how movement and collisions work in realtime games like CS: GO
i heard about it watching Dani videos, thanks for the reference!
Hello.
{
DocumentReference docRef = db.Collection("restaurants").Document("redRestaurant");
docRef.GetSnapshotAsync().ContinueWithOnMainThread(task => {
DocumentSnapshot snapshot = task.Result;
Dictionary<string, object> data = snapshot.ToDictionary();
foreach (KeyValuePair<string, object> pair in data) {
Debug.Log(pair.Key);
if (pair.Key == "city") {
city.text = (string) pair.Value;
}
if (pair.Key == "menuKebap.name") {
menuName.text = (string) pair.Value;
}
if (pair.Key == "name") {
restaurantName.text = (string) pair.Value;
}
}
});
}```
In this code, I can reach menuKebap field. But this field has its own "key - value" how can I retrieve sub object? Thank you in advance!
I mean there is a field named "name" inside of "menuKebap" field.
Firebase indexes it "menuKebap.name" but did not work.
Slight issue with Mirror, I'm attempting to spawn the host after a scene change, but it always spawns before the scene changes, and is then destroyed after scene change.
{
foreach (NetworkConnection playerConnection in playerList)
{
SpawnPlayer(playerConnection, Vector3.zero);
}
base.ServerChangeScene(newSceneName);
}```
Hello i m on unity since 3 years and i try to make a multiplayer game, everythings goes good but now i tried like A LOT of things to make the bullets of my gun be show by the instance of the game on other computer but nothing works :/
Can somebody helps me please?
I really need it please
just tell me the command to use pls?
For Mirror, try looking at the examples
It should have a few examples that'll show you the basics of setting up a game
@lyric osprey Are you potentially delaying the active status of the newly loaded scene or something?
nope, the scene is switched the instant a button is clicked
and a host is started
but the object is created before the scene switches for some reason
Sorry i forgot to mention it i use PUN 2 i'm sorry ;-;
any solutions pls?
just look at the documentation for PUN 2
{
gameManager.StartHost();
gameManager.ServerChangeScene("MainTest");
}``` the code attached to the button
OnServerChangedScene doesn't work either
Alright, so I figured it out. OnServerChangeScene is deprecated. I use OnServerSceneChanged and it works fine
@lyric osprey Looks a bit like ChangeScene is before scene is loaded and SceneChanged is after the scene has loaded
Yea had the same thought
Though odds are like most things Mirror, backwards API compatibility. 😄
😄 No memes here though
my bad
There's also the spinoff project Mirage that is less about carrying the UNet baggage and more about moving forward.
In comparison to Mirror, how hard is it to use?
It's more or less the same thing. If you like organizing the code as you like, you'll probably find the subscribe to events you care about more appealing 😄
The two aren't really trying to be more or less lower level when it comes to API usage, so the networking complexity shouldn't be significantly different
theres also MLAPI which is Unity's brand new networking API
ima still ship my product with mirror though lol
it's been 2hours i tried others things for my shoot gun syncronization in PUN2 it dont work can somebody say to me the comamnd to use to syncronize an object with other instance of game plsss?
The asteroid demo should include firing projectiles
Network instantiation: https://doc.photonengine.com/zh-cn/pun/v2/gameplay/instantiation
The details for syncing data: https://doc.photonengine.com/zh-cn/pun/v2/gameplay/synchronization-and-state
I would invite you to the Photon Discord. Here it's a bit busy to check this. a) Make sure the method names are unique, so they don't mix. b) Use a recent PUN 2, if you didn't update in a while. c) When adding / removing RPCs or changing their parameters, this becomes incompatible with other builds. Use "buffered" sparingly.
guys, im doing a multiplayer project but i have a lot of things that i dont completely understand from the photon documentation.. you know somewhere else who teaches and it has a more didactic way explaining the engine? like when to use the AutomaticallySyncScene, MonoBehaviourPunCallbacks and this sort of things.
Pleasant evening to whoever is reading this, I am building a multiplayer game, currently for testing purposes. The server is powered via Photon and works as it should, thus the players see the other players teleporting and lagging instead of a smooth experience. Does anyone have any Ideas on I how I can fix that?
also try using smooth sync for rigid body objects its a great plugin
go through the photon documentation man. google and ready that shi like its the bible
Photon Unity Networking framework for realtime multiplayer games and applications with no punchthrough issues. Export to all Unity supported platforms, no matter what Unity license you have!
and their sample projects from their PUN plugin, lookthrough that code
How are you sending player inputs? Do you use rigid bodies?
yes
There's a million ways to sync positions. If you are simply updating the positions whenever they are received then increase the send rate and make sure you are using UDP
How do I do that 😦
Physics networking is a huge concept on its own and theres a million ways to tackle it. Could you explain to me how you are syncing players currently?
This is my favorite resource for Physics networking, btw. https://www.youtube.com/watch?v=Z9X4lysFr64&t=2706s
from the Game Developers Conference vault
I am not sure tbh, I followed a tutorial
Alright well I gave you a great resource to understand physics networking
Here are a couple other great resources to help you get your bearings
Come back here and ask specific questions once you understand a little more
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 ...
that link will lead you to information on Deterministic Lockstep, Snapchot Interpolation/Compression, and State Sync
Quick question: If I don't care about hackers/cheaters and I only care about Server to Client via P2P.
What would be the best solution? I've heard decent things about Mirror in the past.
Yes thank you!
Mirror will not help you with P2P connections. You can use mirror and LRM for a peer to peer architecture
@sick plank or Photon Fusion or Photon Bolt
Quick Google shows that Fusion and Bolt both seem to be related to dedicated servers?
no
instead of quickly googling, read what they do. Photon Bolt is literally a P2P networking library
Photon Fusion solves a few more problems but it does include a P2P networking library
Mirror + LRM is a good solution too
P2P often still requires dedicated servers...research NAT punchthrough if u wanna avoid dat
Both fusion and bolt can be used either in dedicated server mode, or player-as-host (still server authoritative) - calling them P2P is a bit misleading, as p2p is only one of the many ways you can use them.
@sick plank
BTW:
Day 4 coding a fast-paced 3D shooter with Photon Fusion
Topics for tonight's stream:
- crate box mechanics (random spawning, pickup weapon type, ammo and score)
- weapon logic (ballistic projectiles, area-effect grenades)
- gun recoil
- playtest with audience (pew pew pew)
Curious bits:
All server-authoritative, all lag compensated (when it applies), of course
Still have not felt the need to use RPCs...
when: 22h CET
where: https://twitch.tv/erickpassos76
I'm aware of that. But at the end of the day there's two larger things that I'd rather not deal with:
One: CCU Limit with Photon.
Two: I'm not looking to have any match making, or connectivity. I'm looking for Player 1 Starting the Game as Client Host, Player 2 Joining Player 1. That's it.
Photon while has free 100 CCU, it also has a 60GB Cap as a free user. And based on what I was reading, even if you wanted to do the above, you can still hit that cap.
Mirror seems to be completely free and open source to use, and I don't need to worry about any CCU/Data Caps.
Sure...
Just said because P2P is not really the case... And I really can't compare mirror with bolt or fusion. These are totally different feature-sets... You use what your game needs and makes you happy.
Thanks for the heads up
Like, feel free to correct me if I'm wrong. But if I want
Player 1: Server + Client
Player 2: Client
Even with Photon/Bolt/Fusion, I need to pay.
But in this case, I am.
Just pretend for a moment that the game becomes amazing. 10/10 Game with 500+ CCU all playing 1v1. Thats now going to run me $95 a month.
Anything photon is a service, free tiers exist, but to scale it’s paid
How much revenue do you plan to make with 500+ CCU?
It was just an example. I'm not saying I'm going to hit that, but what I'm saying is that if I just want the above listed of Server + Client, Client. Why pay for hosting at all when the Client would be the one hosting?
Doesn't that ghost game Phasmophobia use Photon?
Yes
Well, if you want a local player to host, they need to port forward or you need to do some punching
Which is fine.
NAT punching can fail, you probably want a fallback relay service.
Punch works 85-90% of the times
Port forward is just for geeks, players don’t do this
True, if you get enough of a following you could allow people to run their own community servers
I mean the CCU cost seems to include both hosting and tech support, and also serves as a subscription fee for handing you something that does netcode for you.
ppl gotta eat
If you look at something like Fusion, it provides features that you can't even get without a massive amount of efforts (months/years of work) and which are not available in any other networking library (other than others from us also, like bolt has a few of these features).
Full rigidbody physics prediction, Regular client side prediction, Lag Compensation, Automatic Host Migration, NAT punch through /w relay fallback, Several types of data transfer modes to fit your game, etc.
high performance area of interest, handling tens of thousands of objects and not even have to think about it, etc.
Most of this you can't find in any other networking library for Unity
Aye you can see people ask in the Mirror and MLAPI Discords about how to do host-migration
host migration is extremely hard to do
i dont know of ANY networking library which provides it, other than fusion
Does Fusion have dependencies on Unity or could you run the server version as a standalone .net application?
I guess you'll see when its public released 😄
Soon™️
but the same goes for these other features... does anyone else have full physics prediction? mirror/mlapi/etc. don't.... client side prediction? nope... lag comp? nope... nat punch/relay? nope... mirror sort-of via its LRM plugin but then you need to pay to host that server...
Let's hope it lives up to the hype eh
Train hit a wall here with WebGL support status, but it's a minor thing in the grand scheme of things 😄
why does it fail here
u gotta pay for host all mirror servers tho
<@&502884371011731486> - I asked a question here earlier and had someone private message me. However, they were very toxic and rude to me. Stated I was a "shitty programmer" and "good luck at your shit game".
Reason for the tag here is just because it's where I originally asked questions.
DM me or one of the mods the logs
Will do
Not following
sorry. I meant to say, you only pay for the servers when NAT punchthrough fails - and I think you can disable the relay servers for LRM
and only use the punchthru
Why is host migration hard? Is it because of having to reconnect everyone and recreate everything or is there other things to consider?
port forwarding is difficult on mobile device and some devices that don't support
It’s hard because restoring the complete game state on someone that was a client before and might not have all state
In a generic way
Is very hard to do
Ah I see
This is not why host migration is hard
But if the state is saved on all clients tho?
Sure but then 15-20% of your players can’t play so
why is it hard hen
Sure but how would that work? You send the complete game state to every client always? That only works for very small games
I said above
So for host migration to be relatively good, you'd have to store player pos, any world changes, health vars etc?
The entire game state preferably or as much as possible of it
I suppose you'd also have to tell all clients who to then connect to
Thats not very hard since if you are doing this you already have the infrastructure
To connect to “anyone”
Since you were connected somewhere originally
I mean there’s a bit of twirling about for picking a new host and such but that’s not hard
@graceful zephyr huh hole punching is easy actually, found 10 different open source implementations in C#
Yes it’s not hard at all
i did not know that
The harder part is going from 80% success to 90%
But the first 80% is like 50 lines of code
or you could be lazy and only use a relay system,
then your basically just getting P2P at a price cheaper than dedicated servers
true
It’s not p2p
its basically P2P
have you tried it yet? same as PUN?
Server auth, client auth /w server, relay based p2p
Im lead dev on it 😉
part of the Photon team?
Well me and the team yes
aye thats awesome
thats great
i will say that the idea of a C# plugin to avoid a Unity server is smart asf
though I need server-side physics calculations so I'm back to Unity server lol
Fusion let’s you build anything from competitive shooters like valorant to casual relay based client auth co-op games to 200 player BR
Run at 128 tick rate np
10 tick rate client auth also fine
Etc
so unity server for competitive shooters instead of a standalone process ?
Yes
Lag compensation yes, with rollback, etc
oh so its a full implementation like Quantum ?
We have ability to predict any state on any object during client side prediction
or only hitboxes you said?
No we have hammered physx in unity until it did what we want :p
We do full physics prediction also
right haha
non deterministic prolly?
since u said PhysX lol
Correct- if you want determinism we have quantum so
So if the only thing that actually gets removed and recreated are the network identities and network scripts, then the entire state would still exist, so picking a new client as a host would boil down to making sure that they go through the same steps as the original host and then signal to all clients to continue with the game.
Well for a small game you can send all state to all clients all the time then sure it’s easier
But most games can’t
I dug into TrueSync code before it was Quantum - and noticed that it used both open source Fixed Math libraries and Physics libraries. Does Quantum use proprietary fixed math and physics libraries?
Yes quantum uses proprietary
Also true sync did not become quantum
Quantum replaced true sync yes but it’s a complete standalone codebase
Other than some small math utils etc
I mean if every client knows about the entire state because they keep track of it themselves. Then it would be able to work without too much problems?
If the server syncs every players position, health some other variables etc. Then the new host would just roll back everything to the last correct state (should be about the same as when the game paused for host migration) then that would lead to a situation where any client would be able to become host because they already know where everyone is and their status.
Like I said this just works for a small game where the server can send all changes for all objects to all clients always. In most games you can’t
Are you talking about interest and stuff like that?
I’m not talking about anything specifically I’m just saying that what you are suggesting only works if all clients get all changes for all objects always
Which only works for small games with few objects
I've been working on host migration on my game with 50 players. And I think I've been able to make it work just finishing up some things. I think the main issue is traffic, but it is P2P so the host is also the server. All changes are sent to all clients and they also keep track of specifics themselves. But it could be that I am missing something crucial
Its using Mirror and Steam Transport for connecting everyone
The game is not cheat proof by any means as it is currently client auth but I think it shouldn't be that big of an issue to work out
The hardest part was to pull out all network code and put it on the network identity itself, and having the actual player object be a seperate gameobject. Syncing its values through the network identity so if the identity is destroyed, nothing changes on the player object, making it easier to do host migration by just recreating the identities and hooking them up to the correct player object.
But there are no other networked objects except the player identities which would make the entire process easier
What would be the best way to bring the players name with them from the main menu to the game
Since hosting a game instantly starts one up and then I need to take the hosts name and clients name from their local client to the server
Cant they just send their name to the server and then from the server to everyone else?
A bit unclear where exactly you need to get the data from and what potential timing issue you are dealing with
Local client decides their data in an offline scene -> Join match -> Scene synced on join and data lost?
To deal with scenes you can always store stuff objects marked with DontDestroyOnLoad or simply in some C# object
Yeah, I was just hoping for some easy way to bring it across upon connection.
Mostly so I can get it to work so that lobbys are ingame until the door is opened
Did you check whether you have a chance to send that data when you know you have connected?
I imagine there would be some callback too
Ill try
And yea some networking libs allow you to add data to the initial message
or you can just send the data on connect from any networking lib
Hello, could you guys explain whats the difference between CLientRPC and Command?
Is clientrpc to replicate in all clients and command from client to server info send?
I agree a 100% ... nothing is free in this world ...
@dry egret a ClientRPC allows a client to call a function on another remote client
A command is client to server
Hey i am making a third person multiplayer mobile game.
Should i add the canvas with player prefab? Or only keep one canvas in the scene?
I would like to develop a Unity multiplayer game as a hobby, as a single developer.
In my test project that I finished yesterday with some basic MLAPI and Unity functionalities I saw that self hosting by opening ports is not for basic users and a dedicated server and a database for user account and progress is needed.
I would like to have:
-account and login system and save user (progress) data
-rooms or matchmaking available right from the game itself a button click away
What kind of setup should I use for the project?
How easy is it to use the solutions with Unity and what about to exceed the free/low cost plan limits for them? Is functioning with Unity/C# supported in a reliable way?
-Mirror, MLAPI or something else for transports?
-Epic Online Services?
-Photon?
-Steam works?
-A combination of several services? Even possible?
-Else?
@stoic gull Doesn't really matter how you choose to do it. I would have one HUD/UI per local player since there isn't any point in having excess.
I would separate UI out of the character prefabs since they don't really need to inherently exist together
I would pick a managed Database solution so you never have to worry about scalability and it's easier, and deploy Unity instances (i.e. multiplayer matches) on the cloud services and use the auto scaling as much as you can.
Ok so what service/system(s) would be the option(s) then?
Yeah at last i did make only one canvas it's working good
I don't know about Unity instances
But I'd use firebase, since you get all in one... 2 managed dbs, hosting, file storage, and cloud functions. While you manage the online persistent data/storage there, you can run unity instances on whatever cloud provider you choose
a quick google should get you started
"deploy unity on cloud" or something
I have been searching the whole day and would like to hear advice from people who have already done something similar...
Well it depends a lot of the type of game you are creating, so a very short description of how your game works (is it session based? Is it competitive etc.) or listing 1 or 2 games which are similar would allow people to give better advice.
Ok
My rough plans include:
-PvP of several players on both sides
-AI units controlled by the players and players can also take control of the units (vehicles)
-It could use 1-2 hour sessions where people can join and use their side's resources to produce more units (propably easier to maintain instead of a continuous one large world )
-Players can select a combination of (2-3) parts for they vehicle(s)
-Players would earn points based on game activities and could unlock new vehicles
-Similarities with Total War games for example (with possibly fewer units though)
[mainly/only targeting PC]
And as a single hobbyist it would start small, not too much happening, only basic structures and more features and variety added later
as a full stack developer, if you don't have any networking experience just use firebase the headaches you may cause yourself trying to spin up your own linux boxes is not worth it. Other things the session itself, if 1 person always has to be connected can even be done through webrtc (0 server requirement, since you have database i.e. achievements and score stored in managed database) if the world is persistent where players can join their teams etc. in a map then you need to run the logic in server. Either a unity server or a custom C++/C#/Rust whatever. There's no one solution I'm afraid to tell you. Someone who actually deployed unity clients would give you better advice when it comes to Unity server clients itself. But for everything else, for now just trust me and dump all the work to Google and Amazon.
BSG - Escape From Tarkov uses Unity. I think they have a contract with a datacenter provider group. I don't know what kind of code runs on the servers but they basically rent physical servers all over the globe from that company.
And their servers suck
I will take a look at what FireBase can offer but using Google is out of the question as I calculated that even a minimalistic server in Google Cloud cost at least 150€ a month!
firebase is not necessarily GCP
you'd handle the Data needs of your game. Not the actual server client
Like your database, your website, your authentication, is easily handlable by these cloud services
firebase is probably the biggest one. Amazon has some options etc.
But running the unity server client is another part
These are completely separate
Your data persists all the time
And unity sessions are self contained
2 separate concerns
unity session, would probably communicate with the database every now and then. but in the end it's a self contained "simulation"
and ofc it's expensive to run
cause you pay per cpu cycle in most cloud providers
hence the BSG buying boxes all over the world
But even they can't manage it
So I should have a separate provider (Firebase) for data and have the server run somewhere else? What could it be then? I'm on a 0 budget or close to it... BSG =?
Battlestate Games, makers of Tarkov
Or did you mean I could only use a database and handle hosting on clients?
That is also doable
via. WebRTC
firebase is free to use
I'd just get started with the basic authentication and firestore (managed database)
that doesn't cost anything really
It starts to be a thing if you make a big dumb mistake (they will refund your money), or actually have millions of users (you can pay!)
you can either put the unity server client on your own server/ should be 5-6 $ a month or use some other easier to use easier to scale for future service from the beginning
like GCP/AWS/ or other unity recommended solutions.
or... go WebRTC and handle all the live networking for free
but you won't be able to run "Server Side Logic" when you use webrtc
since players only communicate with each other
and there is no central communication point
These are totally unrelated things
Firebase is a db, it may help you create a player profile service, authentication, etc, stuff that you normally would do with services like playfab…
As for actually creating a multiplayer game, the netcode, your usual solutions are the ones already mentioned: mlapi, mirror, photon bolt, photon fusion, etc
I think use photon.
Photon is a company
(I work for photon)
There are at least 5 different products you may use on unity just for netcode (from photon)
- realtime
- pun
- quantum
- bolt
- fusion (soon to be released)
Which one really depends on the type of game and the ambitions/experience/budget you have
Soon most people will just migrate to fusion, as it will replace pun and bolt with a much superior option (and will include free plans as well)
If I used MLAPI where would the servers be? Would I also have a database in Firebase/Playfab?
What would be the setup using Photon services? Would the data limits "3GB per user /month" easily be exceeded? Would I already make enough money to pay 100€/month with the CCU etc it allows?
Why would I not just use completely free database+servers of Epic Online Services?
If you use MLAPI, you get to choose where the servers go (Because you host them)
Or you let players host as clients
Tô have 500 ccu, you need 400000 copies downloaded/sold
That’s what we see from all customers in avg
Epic Online Services do not allow you to host dedicated servers.
Mirror and mlapi you host wherever you want, paying for that…
So for using MLAPI I have to have a server in my home?
@austere whale You should be able to comfortably keep up with Photon costs with just advertising revenue, so games with IAP or upfront payment probably don't need to worry.
Not what I said
You can host a server literally anywhere on Earth
But it is you (or the community) who hosts them
I literally spent 20 minutes explaining that. but whatever
Hmmm so I could have a MLAPI based build ran on a paid server service? Is there any to be considered? Microsoft and google are both some 150-500€/month
So photon communicates using Mirror?
And needs a separate database?
You talked a lot about firebase a lot, but whatever it being totally not related to netcode…:)
Photon has nothing to do with mirror
I don't know anything anymore sorry for that but thanks for answers anyway I try to somehow get the concepts understood...
First thing, try to decouple what you are thinking about database and netcode, these are mostly unrelated
- mirror, mlapi, photon (several products) and others help you write the code that communicates between game clients and game servers.. we normally call this netcode
- as for databases you use to store player data, progress, many other things (normally the server communicates with those) you can use firebase, playfab etc
These are all valid solutions, just different, not very related, topics
I love firebase man. I've so far haven't paid a dime and I use every service they offer. Especially for b2b apps since the user count is lower.
But definitely EP should separate the concerns and understand the difference between persistent and session based stuff
Sessions are gonna be expensive no matter what
You're milking the cpu and have real time traffic
That's the dream for cloud providers so they can charge ridiculous amounts
A realtime game and a b2b app are two very different products.
Ridiculous amounts is relative, specially if the game is profitable and makes more…:)
That’s what many of us live from here.
The database traffic isn't that much worse. Especially if you include analytics. But yes. Once the websockets are opened that's a completely different thing
If "Epic Online Services do not allow you to host dedicated servers"
what about Steam Works? Did I understand right that it is only 100$ one time for database and servers?
Steamworks like Epic Online Services also only gives you relay servers. Means you can have players connect to someone who is hosting a session. But if the host closes the game your session ends.
Photon services advertise their (dedicated 24/7??) game servers - do they also have a database system or should I use the free FireBase for that part?
I would like to have servers where players could just join from the game, not having to make rooms and hope someone finds them
not having to make rooms and hope someone finds them
sounds like matchmaking... you could use firebase for that also LOL. @gleaming prawn is gonna get mad 😄 😄
I don’t get mad
You can search rooms based on properties, list them to the players, etc…. Or… use firebase or playfab and create a custom matchmaking
And if I made the game using MLAPI or Mirror and could therefore have it hosted anywhere, what would those "6 dollars a month" dedicated servers be?
Photon is agnostic to databases, you can use whatever you want
Bad
It's not necessarily a dedicated server. But you'd rent a VM, which you can do for cheap
but then you'd need to handle running the unity instances yourself
I wouldn't recommend
Just let people who know what they're doing handle that part
Could I have progress tracked even in games that were hosted by other players on Steam/Epic? Or would the host have easily manipulated the progress multipliers?
If in those solutions people could still see a list of rooms maybe that could be enough...
Any example games doing so?
That is supposed to be you if you are the game developer…;)
I mean to know what to do
anti cheat is a different territory. Even if you hosted on the cloud you'd probably still need client side protection so people don't just go create a windows forms app with c# and get ESP. but on WebRTC hosted games it even less reliable
Need to leave the discussion guys, sorry
I'm learning game dev. I'm a full stack person 😄
I suggest you read a bit more about these topics EP
There’s a lot of good info online
and we deal with problems by letting google and amazon handle these things 🙂
Like gaffer on games, Gabriel gambetta blogs etc
laters man! Have fun at work! And thanks for all your work ofc ❤️
This graph talks about players in one session but does it also include synchronised NPC AI "players"?
It does just include players. If you have a lot of NPCs/AI in your game you most likely want to look into a deterministic lockstep or determinstic rollback solution.
need some help with networking
i installed fizzyworks and mirror and it keeps giving me this erros
im following this tutorial
The Course: https://www.udemy.com/course/unitytowerdefencegame/?referralCode=2C2FB97426D00893A900
Steamworks + Mirror Transport: https://github.com/Chykary/FizzySteamworks/releases
----------------------------------------------------------...
Mirror has its own Discord for support...link is in Mirror's ReadMe
NESTED GAMEOBJECTS SYNC PHOTON
So I basically have a 2 player game which instantiates a player one or player two gameobject each turn which holds a p1 or p2 scorescript.
Upon hitting a certain score ...or death I either activate (&deactivate) a nested gameObject or deactivate
But for some reason only the current client ID (owner) is executing code and it doesn't translate to the other client... how can I force other clients to execute code even when they are not the owner?
This is the code I want executed ... the "this photonView .RPC "piece of code I now have running in update ( I will place it somewhere else once it works so don't worry about that for now)
this.photonView.RPC("DisplayScore", RpcTarget.Others);
//DisplayScore();
}
[PunRPC]
void DisplayScore()
{
if (_is15)
{
transform.GetChild(6).gameObject.SetActive(true);
transform.GetChild(5).gameObject.SetActive(false);
transform.GetChild(4).gameObject.SetActive(false);
}
if (_is10)
{
transform.GetChild(6).gameObject.SetActive(false);
transform.GetChild(5).gameObject.SetActive(true);
transform.GetChild(4).gameObject.SetActive(false);
}
if (_is05)
{
transform.GetChild(4).gameObject.SetActive(true);
transform.GetChild(5).gameObject.SetActive(false);
transform.GetChild(6).gameObject.SetActive(false);
}
}
Now this code works splendidly on the owner client , but it never translates back to the other client .
I think it has to do with ownership because if I look at score I basically call a unique external function through RPC to update the score and the UI and that works fine ... but this has to be local to the specific gameObject... calling it externally doesn't make any sense .
[Thinking progress....]
After reading even more I guess I should go with Photon Realtime for "matchmaking and servers" (free to start and scalable) and Google Firebase for "player data" for my project.
I guess I will use MLAPI as the "network library" - at least some tutorial used Photon systems on top of it...
I think the limits of Photon (free or 100€ a year) will be enough and I calculated that Firebase's free 1 GiB should be able to store hundreds of thousands of simple player profiles.
are you sure its the owner and not the other client that is exectuing the code since your RPC target is others and not All
Honestly I have set it to "All"..."All Buffered" ... this "others "was just a hail Mary... I basically just want Photon to execute a piece of code on all clients (like an override of sorts) as now the code only gets executed on the current owner/player
or you can use photon self hosted servers on kubernetes on any cheaper network
you can also deploy photon on EC2 with autoscale and save hellaaaa money
The type or namespace name 'Pun' does not exist in the namespace 'Photon' (are you missing an assembly reference?)
How can i fix this?
VS Code?
Make sure you have PUN downloaded and added as a package correctly
vs code, the ide, has nothing to do with the error message he's getting...🤣
Interesting but this part I did not understand even with some searching for something related - I guess it is out of the guestion then with no reference or tutorials.
What kind of configuration do you think would be enough and still cheaper than Photon's servers?
I saw a default pricing with 4 cpu and 16 GiB ram to be 82 USD a month but based on the hourly cost they give it should be 186 USD per month...
Does Pun 2 out of the box not support Web player projects?
I wanted to setup a simple demo for me and friends to mess around on.
Few characters with a template NPC/Enemy we could attack and configure from within the demo.
it works fine under normal circumstances (animations sync, movement, etc using just the OOB Photon transform view, photon animator view and booleans to trigger animations).
But then when changing the project to web player and launching, all of the syncing becomes choppy and not usable.
Is there a solution/alternative to make this work? Im sure I used to do this in the past without these issues but perhaps I had to invoke some solution i've since forgotten?
Hello.
Is this structure ok?
I am totally new in nosql
I have a restaurant and restaurant have its own information and "menu"
but dishes are, as you see, collections. do you think of it is ok?
hello,im having an error building my app does anyone know the fix?
Tried running Unity as an administrator?
Also, is it really #archived-networking, or did you just find a random channel?
firabase is a database right?
so database suggest me "networking"
if Im wrong I can remove it
I was not talking to you
🙂
You're not having build perm issues
@olive vessel honestly i was looking which channel to paste it in,then i just saw that people were pasting their error here so i did the same
Their errors couldn't possibly have been related of course Nevermind now, did you try Administrator mode?
yeah but it not working 😦
Can you legit stop being a complete fucking asshole to me? I asked if it was VS Code because I had a similar issue yesterday that was related to VS Code.
Holy fuck, you're legit the most toxic fucking person here.
You fucking block me, keep my messages blocked and don't read them.
Actually it's on you to block others, they don't need to do a damn thing you say...
Nah he was a toxic piece of shit to me in my private messages, then blocked me and didn't let me reply. He has me blocked, and legit unblocked me to read my message, just to be toxic about it.
all he said was is the IDE is moot, Which tbh hes right so i dont see why you are getting so high rate about it.
If you dont want to see his messages block him. /endof.
Then I am sure you can find a helpful Community Moderator to sort it out, while this might be networking in the friend sense, it is not networking in the multiplayer sense
But he's not right. I had a similar issue and it's a known issue right now with VS Code. Rolling back your C# plugin fixes it.
regardless your attitude is disgusting. Fix it asap.
Nah I'm good. Especially with the shit that he said to me in a DM? And he's decided to bring it back into the public Discord? Nah, fuck him.
Ill take my own advice, Welcome to my block list.
Again, this is not really the place for it, ask for a Moderator to help you in #531949462411804679 or something
Already did. @spring crane did shit about it.
Warning was issued. Sorry for not informing about the action.
There is also a handy block feature.
Excuse me,
but after all confusing discussion and searching online could someone recap without messing up the terms:
-
What software, API, plugin, transport layer and so on is needed to host a Unity game on Amazon EC2 server?
-->Unity & MLAPI with UNet transports and server build deployed on EC2? -
What software, API, plugin, transport layer and so on is needed to host a Unity game on Photon servers?
-->Unity & MLAPI with Realtime transport and the game loaded to their system? -
Can Photon transport layers (Realtime/PUN 2 if I understood) be used with paid games for having a server elsewhere (EC2), is there a need for it?
I'm having trouble with the Photon implementation. The character's rotations are not visible to other players. The Line Renderer is not visible to other players. And there are a few more problems. If you've used Photon before, can you help?
@sweet mason you got anything done to sync the line renderer?
photon wont automatically sync everything
You got to use the RPCs, streams to keep your data in sync
How to synchronize shooting(kill) in photon 2?
Photon products do not need mlapi
Just search for tutorials on photon on YouTube, you’ll find many of them
Well that is interesting as the ones I found used MLAPI and installed Realtime on top of it!
is there any way i can make my game multiplayer without someone hosting the server in their computer
Photon's network auto scales, meaning it uses just the amount of virtual machines that you need. You can set up EC2 with autoscale to mimic that behavior. When it comes to optimizing your price, I would pay an expert to set up auto scale and choose the best VM for your application
Ok - that will be far in the future as I'm just a possibly starting hobbyist
research "dedicated MP servers". PlayFab and GameEye are some options off the top of my head.
Hey guys I'm tying to get some data from the database but I'm not sure what the most secure way to do it. Should it be done server-side or client-side? I wanted to get data from the database using php. Do I just have UnityWebRequest and request the data with a link client-sided or should I create like a server that retrieves data from the database?
Is the data sensitive? For sensitive data like passwords and anything you don't want clients to have access to, no, do not give the client access to the DB.
Also you should avoid direct DB access and use maybe a REST api instead. That way you can choose who has access to your DB instead of directly connecting via SQL
@covert haven
This is because the mlapi demo uses photon
Not the other way around
It’s mlapi who used photon for their basic demo because it was a simpler way for them to have the demo work in all situations without requiring complicated setups
Search for pun2 tutorials… you should try to get something done, just asking questions here without no experience will give you too many disparate options.
You can also look for tutorials on mlapi or mirror
In the end, use whatever you feel more comfortable with
But try to get hands on a lot
this makes 0 sense to me...why would a new multiplayer transport from unity cheat and use photon for its networking ?
Because they don’t have any reliable option?
That’s what they did, it’s not a question, it’s just what it is
The mlapi bossroom demo is built on top of photon realtime transport. This way the game works without any unusual setup
but according to the test project from their own github, no photon to be seen. Just MLAPI. https://github.com/Unity-Technologies/com.unity.multiplayer.mlapi/tree/master/testproject
Ask the developers of that demo. It’s stated in the demo website
Bossroom
I finished my 1st project - a game with a ball and 2 racket players and ran it locally on multiple PCs over network. I used MLAPI for that and now I would like to start working on an actual project and want to know the options BEFORE I start so I don't mess things up and don't have to do work twice
Mlapi does not require photon in general
But they used it for bossroom for convenience
ohhhhh ok cool I was really confused
So you can make a Amazon hosted game with only using included things of 1) MLAPI 2) Mirror 3) Photon?
i guess they used photon in that demo for the dedicated servers and for the room flow
It’s not for dedicated servers
it literally says uses Photon for its relay network
It’s to connect over the internet without need to port forward or host dedicated servers yourself
Just read their docs
Learn more about installing and running the Boss Room game sample.
i said bolt because they said relay servers
Bolt is a different photon product. Mlapi has none of the features bold provides (lag compensation, client side prediction)
They use photon realtime, which is photons basic relay transport layer
Bolt is a much superior netcode solution
right but bossroom says "..and integration with a Photon relay service."
Mlapi devs explicitly said they want to implement the features that bolt has
so my guess was they were talking about photon cloud relay service with bolt
This is just what I was asking about earlier!!
Whay is needed to have a game hosted on Amazon EC2 or Photon services!
For photon just Realtime Transports withOUT MLAPI?
For Amazon just Mirror or MLAPI?
I already told you, no photon product require any specific unity netcode
They used photon, but the opposite is not necessary
so to host something you need 1) a server somewhere 2) software to act like a server
to satisfy 1) you can use playfab, amazon, azure, anything
2 is Mlapi, mirror, bolt etc
^^^^
Oooo
1 is not necessary if you build a game with:
A) client authority architecture (just use pun2)
Or
B) a game where one of the players is also the server (use bolt, or Mlapi with photon or port forward - like bossroom)
My suggestion is: instead of asking 473 questions that show you don’t exactly know much about what you are asking, just get hands down on any of these@options
You will learn a lot with any
Does Pun 2 out of the box not support Web player projects?
I wanted to setup a simple demo for me and friends to mess around on.
Few characters with a template NPC/Enemy we could attack and configure from within the demo.
it works fine under normal circumstances on a client (animations sync, movement, etc using just the OOB Photon transform view, photon animator view and booleans to trigger animations).
But then when changing the project to web player and launching, all of the syncing becomes choppy and not usable.
Is there a solution/alternative to make this work for Web player games?
or maybe someone can suggest an alternative networking solution for .IO type of games (Web player projects)
I have googled this but cant find anyone else reporting issues like this where syncing works on a client and becomes choppy on web player. But it can't just be me. The annoying thing is I know I have done this before successfully but I have a feeling i implemented a completely custom solution (not using the Photon components) though i can't seem to access this old project to check.
Yes it supports web out of the box
according to the website
how are you actually syncing players? There are a million different techniques to do this, and I think you can chose one to reduce the choppiness.
Im just using the out of box solution,
IE i add Photon view and photon transform view to the objects i wnat to sync
i havnt done anything else
On client it works fine, no issues. Its only when i change to a web player
I havn't attempted any custom solutions yet as i wanted to know if this should already work or if i'm doing/missing something.
I think you need a better solution for syncing locations. Photon view sends the data every frame and doesn't interpolate or extrapolate (I think, please confirm for me)
You could use a frame buffer for interpolation or just use extrapolation. Either solution is better than sending raw data
Here is an asset I love for that https://assetstore.unity.com/packages/tools/network/smooth-sync-96925
I'll take a look, thank you.
No problem! Research "frame buffers" and extrapolation or interpolation for ore information.
I send this all the time but this is my fav resource https://developer.valvesoftware.com/wiki/Source_Multiplayer_Networking
This all everyone is telling me that do this and that and combine that and those software and other one saying they go ALONE and other one saying it is the OPPOSITE I guess I will just use Steam + Photon Realtime and what ever is needed with it + Firebase.
Other option is not even bother and let these salty and not willing to really help only telling to find somewhere and do whatever I want Unity/networking communities for good and forever. (Not all of that happened here.)
I will try to avoid asking any more questions and if I do I try to do it elsewhere than where I have asked before.
Thanks for all real explanations to everyone sadly involved in this mess caused by my idea of making a game.
o7
Hey, I try and Reload a scene i'm already in with PhotonNetwork.LoadLevel(1); to restart the match, but I get a load of errors like
"MissingReferenceException: The object of type 'Card' has been destroyed but you are still trying to access it."
I dont get those when I reload the scene normally
@grave ice Meh i tried the asset didn't seem to make a lick of difference. Shame had high hopes.
Whats also weird is,
If i run my project in the unity editor. And open 1 in a browser.
The syncing between the 2 is perfect.
Its only when i open a second browser
@honest crow Try it again and change the values for the frame buffer (using interpolation not extrapolation). It worked super well for me with physics bodies.
the syncing between the 2 browsers is choppy
yeah its because you send raw data and its updated as its received, so a slower connection will be choppy.
The asset doesnt really have many options, I just have 'smooth delay'.
which doesn't really seem to make too much difference 1 way or the other i tried at low medium n high values.
It does have a frame buffer, I don't remember what its called but I used it to get two 2D physics cars working.
First of all can we confirm this is a lag issue? Can you induce some lag and get the behavior reproduced in your Unity Editor?
I mean its all ran on localhost so i doubt it but i can set some stuff downloading and try again, hold on.
Download a few games on steam and a film and it still syncs fine Editor -> Browser and browser -> Editor.
Choppy browser -> browser
Maybe ill try on my computer, this is running on wifi my laptop though its still fast so would be surprising
LOL i fixed the issue @grave ice
Its the most weirdest thing. Technically there was never an issue
I decided to just build it as a client instead, So i loaded up 2 clients in full screen and alt tabbed in between.
I noticed if i move on 1 then alt tab to the other, the first one just sits in the same spot with animation running.
Weird never noticed before as i normally have it windowed.
So i went back to Web project, Put the 2 browsers side by side (instead of alt tabbing) and now it syncs perfect..... weird asf right?
Its like they both have to be visible cus if u minimize or alt tab it stops moving in the background.
While on the subject just want to say how amazing and far networking has come on unity. Few years back it took me sooo much work to get all this synced up. Now (this issue aside) it took me no more than 10 minutes to get it all working.
I can't join random room. Photon is sending error with "PeerCreated". OnErrorInfo or something else is not catching this error. Any ideas?
What
Oh sorry I think I missread, are you saying it doesnt join and u get 0 errors
Well the data is not sensitive but I'm using the steamid to retrieve the information. So my method that's trying to get the data gets steamid (this method is client-sided right now) and then in the php, it uses sql to select a level in a users table where steamid = my steamid that i sent. I'm not really sure how secure that is, cause i think someone would be able to just somehow place any steamid he wants and he'll get the level from someone else, right?
It doesn't join and shows 1 error
But this error is very odd
Hey, I try and Reload a scene i'm already in with PhotonNetwork.LoadLevel(1); to restart the match, but I get a load of errors like
"MissingReferenceException: The object of type 'Card' has been destroyed but you are still trying to access it."
I dont get those when I reload the scene normally
post the error
Maybe this isn't directly a networking question, but if I'm making a client-server architecture where each game has a relatively small number of players (say 4), I'm trying to weigh two approaches:
- Using Unity server builds, each game instance brings up a new process of the server build
- Hand-rolling the game server, easily spin up multiple game instances in a single process (but need to hand-roll the game server logic)
My initial thought was to do 2) to avoid the overhead of a headless unity build, but now that I want to add some light physics to the game it's more complicated to synchronize physics across client/server (my custom server probably can't use Unity's physics library, so I either roll my own or use a different physics library and then use that on the client as well).
Has anyone had experience with launching several headless unity processes on one machine, and how much overhead there might be?
Later
i said error code
Actually, you did not, but that's irrelevant anyway
If you wanted help, you'd have to actually show some form of issue
What?
Yeah you were then asked to screenshot the exact, full error
You'd probably want to put any relevant scripts, into a paste site and link them here
oh weird! atleast you have some more info on some syncing techniques now 🙂
It depends how deep into security you want to go. At the very least use some sort of password associated with the steam id for security. A step further would be generating a token to avoid double login attempts, etc
But theres a million different things you could do for security
yeah well this whole not running in the backround is still an issue tbh ive just put a pin in it for now.
Hello
{
Query capitalQuery = db.Collection("restaurants").Document("RedRest").Collection("menu").WhereEqualTo("Type", "Kebap");
capitalQuery.GetSnapshotAsync().ContinueWithOnMainThread(task => {
QuerySnapshot capitalQuerySnapshot = task.Result;
foreach (DocumentSnapshot documentSnapshot in capitalQuerySnapshot.Documents) {
if (documentSnapshot.Exists) {
dishes.Add(documentSnapshot.ConvertTo<Dish>());
}
}
});
}```
Hello. I can not convert my documents into custom object. it does not work
do you know why?
I'm getting some weird sync issues when 1 of my clients/games is minimized. It's easier to show than to explain over text.
Anyone seen this before?
https://drive.google.com/file/d/1l2UHBNx8LFAhPBB_1bL63xwknGAwhGCp/view?usp=sharing
Heres a slightly trimmed down version of how the movement functions: This is then juts ran in the update().
if (distanceToDestination > 0.1))
{
//We won't reach destination this frame
//find the vector pointing from our position to the target
_direction = (targetPosition - transform.position).normalized;
//create the rotation we need to be in to look at the target
_lookRotation = Quaternion.LookRotation(_direction);
transform.rotation = Quaternion.Slerp(transform.rotation, _lookRotation, Time.deltaTime * RotationSpeed);
transform.position += (targetPosition - transform.position).normalized * speed * Time.deltaTime;
return true;
}
else
{ //We will reach destination this frame
transform.rotation = Quaternion.Slerp(transform.rotation, _lookRotation, Time.deltaTime * RotationSpeed);
transform.position = targetPosition;
animator.SetBool("isWalking", false);
return false;
}```
^ Run in background is turned on
Might just be observing the work the browser is doing preventing sites that you aren't even on from hogging resources 😛
^^
You might be able to address that by increasing the limit on max framerate and physics deltas
Not really sure I understand, thts juts ran from localhost on the video.
It has the same behavior in a client as well, If u have 2 clients full screened and then alt tab between them.
I'm guessing that the browser is suspending your game to the point that you are hitting the maximum physics step, thus your character is actually moving slower
Waiting for 2 meters worth of time, jumping one meter in attempt to keep up while discarding other physics ticks
right but say i open up agar.io in 2 browsers
and do the same test, it doesn't exhibit this kinda behavior
How about thelast.io, which is made in Unity
never heard of it, ill try it.
Harder to test with that game as you hvae to continue to hold the input but it does appear to work fine
IE if i hold a movement and minimize the other client seems to sync just fine with the first
Cool looking game tho, might play that at some point.
You can change the max timestep in Time settings of your project to test it out
You can replicate the issue yourself if u want to see what i mean ->
https://simmer.io/@clerythecleric/techdemo
timestep, ill have a look.
does anyone know how to implement DNS in MLAPI?
Hii, is MLAPI worth implementing right now or is using Photon/something similar a better bet
i think both can be used in production right now
upto what suites your project more and personal preference, but you can't go wrong with either or Mirror
Can Photon based games have player created servers? Do privately hosted servers cost money with Photon?
Anyone here using steamworks cause I need some help? So steamworks works first time I launch the game but as soon as I switch scenes and go back to the main menu scene It stops working for some reason, I'm not too sure why...
What is the easiest way to do multiplayer?
What's the best way to do peer to peer multiplayer game?
Mirror or MLAPI can have a Client which is also the Host
But you'd need port forwarding or some form of punch through
Ok thanks i'll check that out
Is there a way to do both p2p and server with Mirror? Like you could play with your friends in p2p or online with random players
Yeah I believe so
You can have a server build, and a client build which allows hosting as a client
or maybe Photon Bolt or Photon Fusion
I've been pondering my server architecture for a few days (we recently did a pivot from single player only to multiplayer.. joy) and I'm not up to speed on the landscape of products out there for multiplayer servers. I want something that can scale with database support, and I don't want to spend too much time/effort on the plumbing - ideally I can focus on my game logic and the messaging layer is mostly a library that I can depend on.
Early google shows me products like Photon Server, GPF, SmartFox (which appears .. unsupported now?) and .. maybe some others.
What else do I need to be aware of when looking into these? (MLAPI looks a little fresh/unsupported yet.. I'm hesitant to dive into new Unity tech since I got burnt with Unity Remote Configs .. I spent dozens/hundreds of hours migrating to it from google sheets, then back when I found out how poorly it was supported and worked)
(I am fully capable of rolling my own - would probably do it in C# with any ole' RDBMS but .. I'd rather not reinvent the wheel when I'm already trying to invent 16 other things)
Bonus if whatever platform you know of has a corresponding unity library so I can literally just do something like SendMessage(string) from the client
You are using Mlapi
If you want to use just photon, which does not need the unity-made Mlapi, check tutorials on YouTube or our docs
What you are trying to do is to use photon as a transport layer for Mlapi , which is something they added with our support
But if you just want to use one of the pure photon products, just get PUN2 from the unity asset store and follow a few tutorials
It’s a lot easier
If you want a more professional product, check photon fusion or photon quantum.
Why would I pay for Photon when I could use Mirror or MLAPI for free? Is Photon somehow better than it's competition? In what way?
Well for one Mirror and afaik MLAPI (yet) doesn't offer hosting for you. Photon is a name for a bunch of different products, so the differences depend on what you are comparing against.
Photon IMO making networking extremely easy though it does come with its own limitations and issues.
Again, should probably say Photon PUN if you are talking about PUN.
Is it possible to make Casino Online Game with Photon Realtime?
A casino at its core is just a random number generator you can make it in pure C#, The 'casino' part is just for show.
Like the graphics is just a smokescreen
yes... Fusion very close to public beta now...:)
Obligatory "browser support plz 😭"
Hi, is there still only allowed 1 network object per parent-child relationship with mlapi?
Hi everyone, What is the recommended approach to share network connections between scenes?
I am making a server authoritative 2D multiplayer game. Server is custom. (not based on Unity).
Clients are Unity Android, and WebGl.
I am using Firebase for client authentication.
I am using Websockets to connect to authoritative server.
How to share Firebase and WebSocket connection between different scenes?
Should I use Static, or ScriptableObjects, or Additive scenes?
MIRROR 40.0.9 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
Since I'm pretty much uneducated in that area - can someone tell me where should I start from when speaking of Networking
like... How you establish the network and keep a Client-Server relationship in sync, creating and hosting the server, adapting Unity's built-in features for networking and so on.
If you got any Docs, videos, tips about what I should look for in specific, it'd be great. Thanks 
what type of game are you planning to build?
I need it in general.
The things I need to have are quite simple actually:
- A connection to the Server side (where the DataBase and its info resides)
- Each player will have some sort of stats and respective game currency that has to be synced with the client and server when they do purchase something in the shop.
It's a basic Client-Server type of thing so I can adapt to how everything works 
Okay, for this requirement, Playfab should be good. They have generous free quota. I found this tutorial easy and helpful.
🎁 Support me and DOWNLOAD Unity project: https://www.patreon.com/posts/46591972?s=yt
2️⃣ Next part: https://youtu.be/e2RXDso6fWU
💜 Join our Discord (and get help ✨): https://discord.gg/hNnZRnqf4s
🔵 Follow me on Twitter: https://twitter.com/bionicl333
➡️ Link to download Playfab for Unity: https://github.com/PlayFab/UnityEditorExtensions/raw/m...
Playfab already has all the features you are looking for.
Thanks.
Time to announce tomorrow's stream:
Coding a fast-paced 3D shooter with Photon Fusion (stream #5)
Planned topics for demonstration/discussion:
- tick-accurate animation sync with Playables
- full-rig hitbox setup (18 lag compensated hitboxes per character, synced with animation)
- answering technical questions
- Playtesting with the audience!
when: tomorrow, 09/jun, 22h CET
where: https://twitch.tv/erickpassos76
I want other players to see the line renderer, how can I do it in Photon Network?
And when I change the position of a character with a code , it comes back to its original place. And other players cannot see this transform change?
@sweet mason Just an example:
If you have network transform on two objects
And if you have a script that sets line renderers points to these two objects positions
You should have the line synced
You can base that line on the information that's already synced
Do it with transforms like that if you want
But you should really learn the rpcs if you haven't yet
You can just make yourself a "Networked Line" component for example that syncs the lines endpoints over network
I added the attribute [PunRPC] to the beginning of the function where I set the positions of the Line Renderer and called it inside the LateUpdate() with this line of code:
PV.RPC("DrawRope", RpcTarget.All);
(PV is a PhotonView)
what am i missing here
@sweet mason if you are not sending the end positions of the line, that data is not sent over the internet
i'd expect to see those two positions in your parameters
Only information you are sending to the other side is this function call
It it will just run on local data on the other side
Instead of passing parameters to the function, can I use OnPhotonSerializeView here?
i made a wavy rope. And here a lot of positions are set according to certain values. I wonder if I can send all these line renderer positions with OnPhotonSerializeView with stream.SendNext()?