#archived-networking

1 messages · Page 100 of 1

drowsy yoke
#

wait that doesnt handle response content which is the bit im struggling with

final timber
#

are you calling API URL on this? I mean what is the response format (i.e JSON, XML)

drowsy yoke
#

its a binary string

#

that the doc

#

lmao

#

(i know its in python im trying to do it in C#

final timber
#

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?

drowsy yoke
#

yes

#

i do

final timber
#

thats good!

drowsy yoke
#

thats what i have but im not sure if its working

final timber
#

ahm . try one thing first.

#

do you know a tool POSTMAN?

drowsy yoke
#

i dont have it. ive heard of it tho

final timber
#

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

drowsy yoke
#

thanks ill get it now

final timber
final timber
drowsy yoke
#

ignore the you are banned at the bottom, its a joke lol

final timber
#

What is the status : ? is it 200 ?

drowsy yoke
#

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)

drowsy yoke
#

200

drowsy yoke
final timber
#

from what I understand in the documentation you should receive an object response (JSON)

#

not binary

#

im not sure

drowsy yoke
#

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

final timber
#

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

drowsy yoke
#

i have an EnsureSuccessStatusCode thingy

#

but that code works then?

final timber
#

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

drowsy yoke
#

cant i just assume its worked everytime?

#

im probably being really dumb in saying that

final timber
#

What did you receive in your (String content) ?

drowsy yoke
#

so im assuming Unity cant print the binary chatacters

final timber
#

CAn you send screenshot of response

drowsy yoke
drowsy yoke
final timber
#

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

drowsy yoke
#

and i think i am reciving it with Unity

#

aka: i think its all working

#

now i need to work with it lol

final timber
#

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

drowsy yoke
#

awesome! thanks

mental lark
#

I am working with PUN 2 I i don't know how can i modify a gameobject

olive vessel
#

What do you mean by "Modify a GameObject"?

bright mauve
#

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?

olive vessel
#

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

worn bramble
#

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

dusky vigil
#

Would making a player controller a singleton in a networked game cause issues?

olive vessel
#

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

dusky vigil
#

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?

spring crane
#

Doesn't Cinemachine already have a reference to the player through Follow or LookAt fields?

olive vessel
#

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

spring crane
#

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

olive vessel
#

True, both Mirror and MLAPI have IsLocalPlayer

icy pine
#

Can RavenDB work with unity?
Or any No sql database for that matter

austere whale
#

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?

jovial urchin
olive vessel
#

PUN is not really "Free"

#

20 CCU is free, after that you pay

#

Only good for testing purposes

austere whale
#

If I ever release something reasonable that 20 ccu is a deal breaker....

austere whale
#

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

azure oracle
#

Photon RPC is not syncing/sending. Any ideas?

stiff ridge
#

There is a 100 CCU "subscription", which is $95 for one year and it's frequently on sale.

gleaming prawn
#

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
jovial urchin
stiff ridge
#

No worries!

jovial urchin
#

:)

ashen nebula
#

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

olive vessel
#

Mirror has a Network Match Checker, which isolates players to their match within a single server instance

rustic osprey
#

Does anyone have any experience with MQTT and unity?

frosty crystal
#

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

weak plinth
#

hey guys, I've been working on a unity 3d project and I want to add multiplayer, can anybody recommend me a good tutorial?

high night
#

@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

slim ridge
#

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

rustic osprey
#

The best time to add multi play was at the start of the project. The next best time is today!

weary creek
#

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

spring crane
#

@weary creek Job and collab requests go on the forum

weary creek
#

Sorry, I mentioned money to convey my desperation. I am just looking for additional insight. Is it still considered a collaboration request?

spring crane
#

That's fine, but you are probably not going to receive a lot of input with the information you provided about your project

weary creek
#

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

teal obsidian
#

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.

slim ridge
#

try both 👍

weary creek
teal obsidian
#

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

weary creek
#

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?

plush needle
#

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

weak plinth
teal obsidian
#

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.

hexed frost
#

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

hexed frost
shrewd ember
#

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

patent fog
#

@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.

shrewd ember
#

Mr.K you sitting down :'(?

patent fog
shrewd ember
#

I don't know where else to put stuff

patent fog
#

Oh so you tried all options and didnt work

#

Did you restart the server ? that's a common mistake

shrewd ember
#

Pretty much, Final ditch attempt coming here

#

Yes

#

Sudo reboot

patent fog
#

though the htaccess should work immediately

shrewd ember
#

Multiple times inbetween trial and errors

patent fog
#

okay

shrewd ember
#

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

patent fog
patent fog
#

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

shrewd ember
#

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...?

patent fog
#

There should be a dev settings in chrome to allow localhost access I guess, I didnt tinkered with that since a long time

shrewd ember
#

Would that mean that I just need to add that header to my web request? From the unity code

patent fog
patent fog
#

Try to enable this ? chrome://flags/#allow-insecure-localhost

shrewd ember
#

Aight, just left home so can’t do it right now

patent fog
#

That's the only hint I have right now :p

shrewd ember
#

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?

patent fog
#

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

austere whale
#

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 😖

high night
#

@austere whale shouldn't you be putting "new" keyword there?

verbal lodge
#

It should be currentBallPosition.Value = newPos; I suggest following the tutorials in the docs or some youtube videos to learn about the basics.

shrewd ember
shrewd ember
#

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:

austere whale
#

I have tried to look at the tutorials and documentation but maybe I have missed something 🤷‍♂️ I will check again tomorrow

#

Thanks for answers

normal hemlock
#

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.

high night
#

@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

normal hemlock
#

Not spawn on awake; spawn on command(client command, server action)

woeful herald
#

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

hazy sentinel
#

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?

olive vessel
#

Oh aye try pinging everyone...

hazy sentinel
#

sorry

#

i need hlep

#

help

olive vessel
#

Go figure, but entitlement won't get you there

#

I doubt Photon is doing anything to your brightness

#

Check your lighting

hazy sentinel
#

i did

#

in edit project settings

#

and the directional light

olive vessel
#

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

hazy sentinel
#

idk i could send a video in like 5 minutes

#

maybe you can check it out

olive vessel
#

I understand the premise of a brightness decrease

hazy sentinel
#

okay

#

but why

#

i checked my code

olive vessel
#

Are you switching scenes?

hazy sentinel
#

yes

olive vessel
#

So how are you doing that?

hazy sentinel
#

wait

#

PhotonNetwork.LoadLevel(1);

#

i call this in a startgame function i made

#

that is being called in OnJoinedRoom

olive vessel
#

Yeah I think it's a lighting issue

#

People online say turn off Auto Generate, then press Generate Lighting

hazy sentinel
#

where do i do it? i forgot

olive vessel
#

Lighting settings

hazy sentinel
#

i did

#

disable autogenerate and then generate

#

still don't work

hazy sentinel
#

idk what to do

#

i have tried everything

woeful herald
grave ice
#

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

woeful herald
normal hemlock
#

How to initialize prefab on client command?

#

Pun classic 2018

grand widget
#

can someone help me with some photon stuff?

olive vessel
#

Don't ask to ask, just ask

grave ice
gray merlin
#

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

grave ice
#

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

gray merlin
#

its a selfhosted server

#

but the host has to portforward

#

its a 2player game

grave ice
#

@gray merlin bruh if the canyouseme.org tool tells you the port is closed then its not properly portforwarded

gray merlin
#

it is

grave ice
gray merlin
#

so i portforwarded 25565 (minecraft's default port) and ran a server and it said it was open

grave ice
#

is your server binding to the correct port

gray merlin
#

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

grave ice
#

make sure the server binds to the port your portforwarding to

gray merlin
#

i also tried connecting to my own localhost server through ngrok but it didn't work

gray merlin
#

same port for server as for portforward

grave ice
#

yeah thats what i mean

gray merlin
#

TCP

grave ice
#

so minecraft server works when you tried it (25565)?

gray merlin
#

yes

#

i run a minecraftserver 24/7

grave ice
#

then its a problem w ya server program

gray merlin
#

i know

#

and i want to know how to fix it

grave ice
#

how is your server written

gray merlin
#

mlapi

#

its self hosted

#

you are a client and a server

#

at the same time

grave ice
#

so your manually portforwarding

gray merlin
#

then another client selects your ip

#

yes

grave ice
#

if ur server project works completely fine localhost

gray merlin
#

yeo

#

well

#

127.0.0.1

grave ice
#

then it has to be a port forwarding issue and hit up mlapi chat

gray merlin
#

and 192.168.x.x

#

the thing is

#

i also tried with ngrok

grave ice
#

i use mirror instead ofmlapi

gray merlin
#

and still can't connect

#

well i use mlapi

grave ice
#

i think its a port forwarding issue mane

#

even tho u said u did it right

gray merlin
#

well... i forwarded ports 80 22 and 25565 and they all work

grave ice
#

server programs dont have discrepencies for local and portforwarded connections

#

if it works local then itll work when u portforward

gray merlin
#

well it doesn't?

#

;-;

verbal lodge
#

You can not use ngrok with MLAPI. ngrok only forwards TCP ports but MLAPI uses UDP.

gray merlin
#

??
so i have to forward UDP only?

#

i used ngrok tcp myport

grave ice
#

oh mlapi uses UDP damn

#

i assumed it was tcp

#

try portforwarding both udp and tcp @gray merlin

gray merlin
#

i tried

#

and it didn't work

verbal lodge
#

Both udp and tcp or only udp should work.

gray merlin
#

i didnt try udp only

grave ice
#

if u portforward an extra port it wont break it

gray merlin
#

how do i do it with ngrok then

#

coz ngrok only has tcp

verbal lodge
#

Oh sorry I tried to say before that you can't do it with ngrok.

gray merlin
#

oh

#

then

#

idk what's wrong

#

but

#

yep

#

opened on udp only

#

and canyouseeme

#

says it's closed

#

even when i host my game

gray merlin
#

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

grave ice
#

not something mlapi related

frosty crystal
#

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?

gray merlin
#

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

slate imp
#

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).

spring crane
#

@slate imp PUN

slate imp
grave ice
weary forge
#

Which is better for a client server model

#

Im leaning towards Mirror

#

What are the limitations of PUN 2

grave ice
#

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)

weary forge
#

Thanks for the run down pal, appreciate it

austere whale
#

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 😒 )

lost thistle
spring crane
#

Network culling also tends to work better out of the box with these magic variables

austere whale
#

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.

austere whale
austere whale
#

So does anyone know how to update GUI text on clients based on a network variable (integer) using MLAPI?

frosty crystal
#

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.

robust cypress
#

Tried to google it but couldnt find much

frosty crystal
#

thanks. do you know if Unity programmers would help me out if I wrote a ticket?

plush needle
#

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

mossy pawn
#

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!

grave ice
#

@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

silent zinc
#

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

vivid cobalt
silent zinc
#

Ok, thank you, apart from this series of tutorials, where can i find details about server side logic in multiplayer games?

gleaming prawn
#

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
dry ibex
#

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

grave ice
silent zinc
#

ty

grave ice
#

this resource goes into detail about how movement and collisions work in realtime games like CS: GO

silent zinc
#

i heard about it watching Dani videos, thanks for the reference!

frosty crystal
#

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.
lyric osprey
#

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);
    }```
solar valve
#

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?

lyric osprey
#

For Mirror, try looking at the examples

#

It should have a few examples that'll show you the basics of setting up a game

spring crane
#

@lyric osprey Are you potentially delaying the active status of the newly loaded scene or something?

lyric osprey
#

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

solar valve
#

any solutions pls?

lyric osprey
#

just look at the documentation for PUN 2

solar valve
#

ok thanks

#

:)

lyric osprey
lyric osprey
#

OnServerChangedScene doesn't work either

#

Alright, so I figured it out. OnServerChangeScene is deprecated. I use OnServerSceneChanged and it works fine

spring crane
#

@lyric osprey Looks a bit like ChangeScene is before scene is loaded and SceneChanged is after the scene has loaded

lyric osprey
#

That scares me

#

I usually differentiate hooks like that by using Pre and Post

spring crane
#

Yea had the same thought

#

Though odds are like most things Mirror, backwards API compatibility. 😄

#

😄 No memes here though

lyric osprey
#

my bad

spring crane
#

There's also the spinoff project Mirage that is less about carrying the UNet baggage and more about moving forward.

lyric osprey
#

In comparison to Mirror, how hard is it to use?

spring crane
#

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

grave ice
#

theres also MLAPI which is Unity's brand new networking API

#

ima still ship my product with mirror though lol

solar valve
#

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?

spring crane
#

The asteroid demo should include firing projectiles

stiff ridge
steel mist
#

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.

proven ridge
#

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?

grave ice
grave ice
grave ice
#

and their sample projects from their PUN plugin, lookthrough that code

grave ice
proven ridge
#

yes

grave ice
#

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

proven ridge
#

How do I do that 😦

grave ice
#

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?

proven ridge
#

I am not sure tbh, I followed a tutorial

grave ice
#

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

#

that link will lead you to information on Deterministic Lockstep, Snapchot Interpolation/Compression, and State Sync

sick plank
#

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.

proven ridge
#

Yes thank you!

grave ice
#

@sick plank or Photon Fusion or Photon Bolt

sick plank
#

Quick Google shows that Fusion and Bolt both seem to be related to dedicated servers?

grave ice
#

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

grave ice
#

P2P often still requires dedicated servers...research NAT punchthrough if u wanna avoid dat

gleaming prawn
#

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
sick plank
# gleaming prawn Both fusion and bolt can be used either in dedicated server mode, or player-as-h...

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.

gleaming prawn
#

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

sick plank
#

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.

gleaming prawn
#

Yes. Except you are in the free plans

#

I’m not comparing price...

sick plank
#

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.

gleaming prawn
#

Anything photon is a service, free tiers exist, but to scale it’s paid

verbal lodge
#

How much revenue do you plan to make with 500+ CCU?

gleaming prawn
#

I expect 500ccu to be a game with 200 thousand copies sold

#

Só...

sick plank
#

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?

olive vessel
#

Doesn't that ghost game Phasmophobia use Photon?

gleaming prawn
#

Yes

olive vessel
#

Well, if you want a local player to host, they need to port forward or you need to do some punching

sick plank
#

Which is fine.

verbal lodge
#

NAT punching can fail, you probably want a fallback relay service.

gleaming prawn
#

Punch works 85-90% of the times

#

Port forward is just for geeks, players don’t do this

olive vessel
#

True, if you get enough of a following you could allow people to run their own community servers

dense hedge
#

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

graceful zephyr
#

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

olive vessel
#

Aye you can see people ask in the Mirror and MLAPI Discords about how to do host-migration

graceful zephyr
#

host migration is extremely hard to do

#

i dont know of ANY networking library which provides it, other than fusion

verbal lodge
#

Does Fusion have dependencies on Unity or could you run the server version as a standalone .net application?

graceful zephyr
verbal lodge
#

Soon™️

graceful zephyr
olive vessel
#

Let's hope it lives up to the hype eh

spring crane
#

Train hit a wall here with WebGL support status, but it's a minor thing in the grand scheme of things 😄

river basalt
#

why does it fail here

grave ice
sick plank
#

<@&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.

spring crane
#

DM me or one of the mods the logs

sick plank
#

Will do

graceful zephyr
grave ice
#

and only use the punchthru

shadow flare
grave ice
graceful zephyr
#

In a generic way

#

Is very hard to do

shadow flare
#

Ah I see

graceful zephyr
shadow flare
graceful zephyr
grave ice
graceful zephyr
graceful zephyr
olive vessel
#

So for host migration to be relatively good, you'd have to store player pos, any world changes, health vars etc?

graceful zephyr
olive vessel
#

I suppose you'd also have to tell all clients who to then connect to

graceful zephyr
#

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

grave ice
#

@graceful zephyr huh hole punching is easy actually, found 10 different open source implementations in C#

graceful zephyr
grave ice
#

i did not know that

graceful zephyr
#

The harder part is going from 80% success to 90%

#

But the first 80% is like 50 lines of code

grave ice
#

or you could be lazy and only use a relay system,

graceful zephyr
#

Maybe slight exaggeration but not that much

#

Yes but affects the ping

grave ice
#

then your basically just getting P2P at a price cheaper than dedicated servers

grave ice
graceful zephyr
#

It’s not p2p

grave ice
#

it is in the sense that the clients have the auth

#

but i get what you are saying

graceful zephyr
#

That has nothing to do with p2p but sure :p

#

Fusion support all these modes

grave ice
#

its basically P2P

grave ice
graceful zephyr
#

Server auth, client auth /w server, relay based p2p

graceful zephyr
grave ice
#

part of the Photon team?

graceful zephyr
#

Well me and the team yes

grave ice
#

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

graceful zephyr
#

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

grave ice
graceful zephyr
#

Yes

grave ice
#

nice nice

#

deterministic hitboxes & rollback too, right?

graceful zephyr
#

Lag compensation yes, with rollback, etc

grave ice
#

oh so its a full implementation like Quantum ?

graceful zephyr
#

We have ability to predict any state on any object during client side prediction

grave ice
#

or only hitboxes you said?

graceful zephyr
#

We do full physics prediction also

grave ice
#

right haha

graceful zephyr
#

If you want

#

Rigid body prediction etc

grave ice
#

since u said PhysX lol

graceful zephyr
#

Correct- if you want determinism we have quantum so

shadow flare
# graceful zephyr The entire game state preferably or as much as possible of it

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.

graceful zephyr
#

But most games can’t

grave ice
graceful zephyr
#

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

shadow flare
# graceful zephyr Well for a small game you can send all state to all clients all the time then su...

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.

graceful zephyr
shadow flare
graceful zephyr
#

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

shadow flare
#

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

lyric osprey
#

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

shadow flare
spring crane
#

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

lyric osprey
#

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

spring crane
#

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

lyric osprey
#

Ill try

spring crane
#

And yea some networking libs allow you to add data to the initial message

grave ice
dry egret
#

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?

plush needle
grave ice
#

@dry egret a ClientRPC allows a client to call a function on another remote client

#

A command is client to server

stoic gull
#

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?

austere whale
#

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?

spring crane
#

@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

real dome
austere whale
stoic gull
real dome
#

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

austere whale
#

I have been searching the whole day and would like to hear advice from people who have already done something similar...

verbal lodge
#

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.

austere whale
#

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

real dome
#

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

austere whale
real dome
#

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

austere whale
#

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 =?

real dome
#

Battlestate Games, makers of Tarkov

austere whale
#

Or did you mean I could only use a database and handle hosting on clients?

real dome
#

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

gleaming prawn
#

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

gleaming prawn
#

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)

austere whale
#

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?

olive vessel
#

If you use MLAPI, you get to choose where the servers go (Because you host them)

#

Or you let players host as clients

gleaming prawn
#

That’s what we see from all customers in avg

verbal lodge
#

Epic Online Services do not allow you to host dedicated servers.

gleaming prawn
#

Mirror and mlapi you host wherever you want, paying for that…

austere whale
spring crane
#

@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.

olive vessel
#

Not what I said

#

You can host a server literally anywhere on Earth

#

But it is you (or the community) who hosts them

real dome
austere whale
#

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?

olive vessel
#

How'd you get that?

#

Photon is it's own thing outright

gleaming prawn
gleaming prawn
austere whale
#

I don't know anything anymore sorry for that but thanks for answers anyway I try to somehow get the concepts understood...

gleaming prawn
#

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

real dome
#

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

verbal lodge
#

A realtime game and a b2b app are two very different products.

gleaming prawn
#

Ridiculous amounts is relative, specially if the game is profitable and makes more…:)

#

That’s what many of us live from here.

real dome
austere whale
#

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?

verbal lodge
#

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.

austere whale
#

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

real dome
#

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 😄 😄

gleaming prawn
#

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

austere whale
#

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?

gleaming prawn
#

Photon is agnostic to databases, you can use whatever you want

real dome
#

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

austere whale
#

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?

gleaming prawn
#

I mean to know what to do

real dome
#

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

gleaming prawn
#

Need to leave the discussion guys, sorry

real dome
#

I'm learning game dev. I'm a full stack person 😄

gleaming prawn
#

I suggest you read a bit more about these topics EP

#

There’s a lot of good info online

real dome
#

and we deal with problems by letting google and amazon handle these things 🙂

gleaming prawn
#

Like gaffer on games, Gabriel gambetta blogs etc

real dome
#

laters man! Have fun at work! And thanks for all your work ofc ❤️

austere whale
#

This graph talks about players in one session but does it also include synchronised NPC AI "players"?

verbal lodge
#

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.

weak plinth
#

need some help with networking

#

i installed fizzyworks and mirror and it keeps giving me this erros

#

im following this tutorial

gray pond
# weak plinth

Mirror has its own Discord for support...link is in Mirror's ReadMe

plush needle
#

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 .

austere whale
#

[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.

robust cypress
plush needle
grave ice
#

you can also deploy photon on EC2 with autoscale and save hellaaaa money

sweet mason
#

The type or namespace name 'Pun' does not exist in the namespace 'Photon' (are you missing an assembly reference?)

How can i fix this?

grave ice
#

vs code, the ide, has nothing to do with the error message he's getting...🤣

austere whale
austere whale
#

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...

honest crow
#

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?

frosty crystal
#

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?

vapid grove
#

hello,im having an error building my app does anyone know the fix?

olive vessel
#

Tried running Unity as an administrator?

frosty crystal
#

firabase is a database right?

#

so database suggest me "networking"

#

if Im wrong I can remove it

olive vessel
#

I was not talking to you

frosty crystal
#

🙂

olive vessel
#

You're not having build perm issues

vapid grove
#

@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

olive vessel
#

Their errors couldn't possibly have been related of course Nevermind now, did you try Administrator mode?

vapid grove
#

yeah but it not working 😦

sick plank
olive vessel
#

Actually it's on you to block others, they don't need to do a damn thing you say...

sick plank
honest crow
olive vessel
sick plank
honest crow
sick plank
#

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.

honest crow
#

Ill take my own advice, Welcome to my block list.

olive vessel
#

Again, this is not really the place for it, ask for a Moderator to help you in #531949462411804679 or something

sick plank
#

Already did. @spring crane did shit about it.

spring crane
#

Warning was issued. Sorry for not informing about the action.

haughty heart
#

There is also a handy block feature.

austere whale
#

Excuse me,
but after all confusing discussion and searching online could someone recap without messing up the terms:

  1. 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?

  2. 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?

  3. 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?

sweet mason
#

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?

high night
#

@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

azure oracle
#

How to synchronize shooting(kill) in photon 2?

gleaming prawn
#

Just search for tutorials on photon on YouTube, you’ll find many of them

austere whale
honest crow
#

Any Photon pun 2 experts here? ><

#

I know the creator lurks here somtimes

weak plinth
#

is there any way i can make my game multiplayer without someone hosting the server in their computer

grave ice
austere whale
grave ice
covert haven
#

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?

grave ice
#

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

gleaming prawn
#

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

grave ice
gleaming prawn
#

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

grave ice
gleaming prawn
#

Ask the developers of that demo. It’s stated in the demo website

grave ice
#

Can I see the demo you are talking about ?

#

@gleaming prawn

gleaming prawn
#

Bossroom

austere whale
# gleaming prawn In the end, use whatever you feel more comfortable with

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

gleaming prawn
#

Mlapi does not require photon in general

#

But they used it for bossroom for convenience

grave ice
austere whale
#

So you can make a Amazon hosted game with only using included things of 1) MLAPI 2) Mirror 3) Photon?

grave ice
#

i guess they used photon in that demo for the dedicated servers and for the room flow

gleaming prawn
#

It’s not for dedicated servers

grave ice
gleaming prawn
#

It’s to connect over the internet without need to port forward or host dedicated servers yourself

#

Just read their docs

grave ice
#

yeah thats what i meant

#

im guessing its bolt that they were using

gleaming prawn
#

O

#

No

#

Bolt has nothing to do with Mlapi

grave ice
#

i said bolt because they said relay servers

gleaming prawn
#

Bolt is a different photon product. Mlapi has none of the features bold provides (lag compensation, client side prediction)

gleaming prawn
#

Bolt is a much superior netcode solution

grave ice
#

right but bossroom says "..and integration with a Photon relay service."

gleaming prawn
#

Mlapi devs explicitly said they want to implement the features that bolt has

grave ice
#

so my guess was they were talking about photon cloud relay service with bolt

austere whale
#

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?

gleaming prawn
#

They used photon, but the opposite is not necessary

grave ice
#

to satisfy 1) you can use playfab, amazon, azure, anything

gleaming prawn
#

2 is Mlapi, mirror, bolt etc

grave ice
#

^^^^

austere whale
#

Oooo

gleaming prawn
#

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

honest crow
#

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.

grave ice
#

according to the website

grave ice
honest crow
#

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.

grave ice
#

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

honest crow
#

I'll take a look, thank you.

grave ice
#

No problem! Research "frame buffers" and extrapolation or interpolation for ore information.

austere whale
#

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

robust cypress
#

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

honest crow
#

@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

grave ice
#

@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.

honest crow
#

the syncing between the 2 browsers is choppy

grave ice
honest crow
#

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.

grave ice
#

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?

honest crow
#

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

honest crow
#

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.

azure oracle
#

I can't join random room. Photon is sending error with "PeerCreated". OnErrorInfo or something else is not catching this error. Any ideas?

honest crow
#

Post the exact error might help

#

SCrenshot it

azure oracle
#

What

honest crow
#

Oh sorry I think I missread, are you saying it doesnt join and u get 0 errors

covert haven
# grave ice Is the data sensitive? For sensitive data like passwords and anything you don't ...

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?

azure oracle
#

But this error is very odd

robust cypress
#

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

honest crow
candid tundra
#

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:

  1. Using Unity server builds, each game instance brings up a new process of the server build
  2. 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?

azure oracle
olive vessel
#

How helpful...

#

Has an error, whines about it, won't post the error until later...

azure oracle
#

i said error code

olive vessel
#

Actually, you did not, but that's irrelevant anyway

#

If you wanted help, you'd have to actually show some form of issue

olive vessel
#

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

grave ice
grave ice
#

But theres a million different things you could do for security

honest crow
frosty crystal
#

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?

honest crow
#

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

spring crane
#

Might just be observing the work the browser is doing preventing sites that you aren't even on from hogging resources 😛

grave ice
#

^^

spring crane
#

You might be able to address that by increasing the limit on max framerate and physics deltas

honest crow
#

It has the same behavior in a client as well, If u have 2 clients full screened and then alt tab between them.

spring crane
#

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

honest crow
#

right but say i open up agar.io in 2 browsers

#

and do the same test, it doesn't exhibit this kinda behavior

spring crane
honest crow
#

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.

spring crane
#

You can change the max timestep in Time settings of your project to test it out

honest crow
#

timestep, ill have a look.

gray merlin
#

does anyone know how to implement DNS in MLAPI?

torn lily
#

Hii, is MLAPI worth implementing right now or is using Photon/something similar a better bet

grave ice
#

upto what suites your project more and personal preference, but you can't go wrong with either or Mirror

stable igloo
#

Can Photon based games have player created servers? Do privately hosted servers cost money with Photon?

covert haven
#

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...

sonic badger
#

What is the easiest way to do multiplayer?

olive vessel
#

I'd say Photon PUN allows you to get started relatively easy

#

20 free CCU

lean jungle
#

What's the best way to do peer to peer multiplayer game?

olive vessel
#

Mirror or MLAPI can have a Client which is also the Host

#

But you'd need port forwarding or some form of punch through

lean jungle
#

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

olive vessel
#

Yeah I believe so

#

You can have a server build, and a client build which allows hosting as a client

grave ice
winged geyser
#

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

scarlet sphinx
#

i just downloaded photon but i cant select that transport layer

gleaming prawn
#

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.

weak plinth
#

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?

spring crane
#

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.

honest crow
#

Photon IMO making networking extremely easy though it does come with its own limitations and issues.

spring crane
#

Again, should probably say Photon PUN if you are talking about PUN.

hexed sorrel
#

Is it possible to make Casino Online Game with Photon Realtime?

honest crow
#

Like the graphics is just a smokescreen

gleaming prawn
spring crane
torn lily
#

Hi, is there still only allowed 1 network object per parent-child relationship with mlapi?

floral jacinth
#

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?

gray pond
umbral geyser
#

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 UnityChanShocked

floral jacinth
#

what type of game are you planning to build?

umbral geyser
# floral jacinth what type of game are you planning to build?

I need it in general.
The things I need to have are quite simple actually:

  1. A connection to the Server side (where the DataBase and its info resides)
  2. 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 Unity

floral jacinth
#

Okay, for this requirement, Playfab should be good. They have generous free quota. I found this tutorial easy and helpful.

#
#

Playfab already has all the features you are looking for.

gleaming prawn
#

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
sweet mason
#

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?

high night
#

@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

sweet mason
high night
#

@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

sweet mason