#archived-networking

1 messages · Page 97 of 1

frank edge
#

i wouldn't have enough money to upload it on steam

gleaming prawn
#

Then you don’t have any “free” option

#

There is no free lunch

#

Online games require servers, even if just to relay data or coordinate the punch process

#

But if you don’t have many players, why not use@the free tiers of normcore or photon?

#

As long as this is just a hobby project (you mentioned no money)

#

Perhaps other complete services also offer free tiers. Just remember these

frank edge
#

well i'm not sure that how many players will play my game.
there's 5 players/room. photon is heavily limited to 20 ccu, so only 4 team of players can be able to play the game? that would suck..

#

normcore? never heard of that.

gleaming prawn
#

It’s similar to photon

frank edge
#

20 ccu limit?

gleaming prawn
#

Same limitations, but works

frank edge
#

hmm.

gleaming prawn
#

I mean, if you don’t plan to make any money with your game

#

Perhaps you should not try to make an online one

frank edge
#

well i do want to release dlc-s and earn some extra money from that

gleaming prawn
#

Online games cost money to run, there is no other way

frank edge
#

well i maybe can figure out hosting my own servers, but i'm not really sure about that.

gleaming prawn
#

These relay based services are the cheapest options in the long term

#

If@you understand what you are@doing

#

Hosting your own servers will only@sabe you some bucks (compared to photon or similar) if you are really an expert on this

#

But sure...:)

#

You can try

frank edge
#

well i know some people that host servers for free. i know them from my minecraft age haha

#

i'm not sure they are still hosting servers tho.

gleaming prawn
#

Well, do that then

frank edge
#

it's been a long time

gleaming prawn
#

I normally answer considering potential for growth, etc

#

Hobby projects you do whatever you feel happier with

#

It’s about having fun and learning in that case

#

Just started talking because that lib looked like a dead end

frank edge
#

true, but i don't really like to learn something that i can't really use in the future (for exm. photon because it's heavily limited and costs a lot of money)

gleaming prawn
#

Perhaps someone who really tried it can save you the time

gleaming prawn
frank edge
#

well yes, but mirror beats it in some ways.

gleaming prawn
#

If you mean pun (photon has many different products)

gleaming prawn
frank edge
#

it's a networking solution as i know

#

right?

gleaming prawn
#

And I won’t comment on its qualities, I am not a user

gleaming prawn
frank edge
#

oh. i see.

gleaming prawn
#

If you think@mirror makes any sense, you should check mlapi

#

Was acquired by unity, and it is now official

frank edge
#

yeah i was about to try it out, but i wasn't been sure how it really works

#

it has a lot of features though.https://mlapi.network/features/

weak plinth
#

yep bro

frank edge
#

uh yeah i wanted ask does it work?

weak plinth
#

nope

frank edge
#

yeah.. does it work on lan atleast?

weak plinth
#

I'm looking

frank edge
#

oh dang

#

webgl only? 😳

weak plinth
#

(Web)rtc 😄

frank edge
#

yeah haha

#

but it still requires a server as i know

weak plinth
#

no

frank edge
#

what? really?

weak plinth
frank edge
#

then it should be lan

#

WHAT

#

does it support unity?

#

oh

#

im dumb

#

ofc

#

its only lan, isn't it?

weak plinth
#

We'll all grow as we learn how to insult oneself

#

no for internet

frank edge
#

whoever made this should be a genius

#

let me try it.

weak plinth
# frank edge

browser without search box and it can act like exe by installing unity webgl plugin very good haha xd

frank edge
#

whaat

#

noo

#

why did you delete tho?

weak plinth
#

P2P disadvantages
Data flow congestion
Poor performance
Security.
The source of the data is not noticeable

weak plinth
#

illness

frank edge
#

oh no problem

#

but it works.. so i'll give it a try.

weak plinth
#

You can use p2p for now, as you grow your project, you get a server buddy no problem

#

works with p2p on skype

frank edge
#

yeah

weak plinth
#

😉

frank edge
#

hmm but webgl should work pretty fine tho

#

imagine playing a game without needing to download it

#

and its online

weak plinth
#

webgl also downloads every time it enters: /

frank edge
#

well true but you just have to open your browser and you can play instantly

#

imagine that :D

weak plinth
#

what do you mean by good ?

#

unity webgl game

frank edge
#

yeah

weak plinth
#

I played a lot when I was little

frank edge
#

btw where can i download webrtc?

frank edge
weak plinth
#

When unity compiles the project

frank edge
#

what

weak plinth
#

If you are going to use webgl, you shouldn't improve this game too much, it downloads too much data

#

here.

frank edge
#

well its just the base webgl not the webrtc

#

i cant find it

weak plinth
frank edge
#

found it

#

it supports 2 players only tho

burnt thunder
#

Hello there! Is anyone familiar with Unity's FPS Sample

flint flower
#

i need help with pgoton badly

#

photon*

tulip ledge
flint flower
#

oh sorry i was just looking for a server

#

i followed a toturial on making a basic server with photon but for somreason it tries to instantiate before it even connects to the server

dire ridge
#

What Is Best OS For Game Server?

frank edge
flint flower
frank edge
#

well it says its in photonPrefabs/photonPlayer

#

are you sure you're instantiating the correct object?

flint flower
#

yeah look

frank edge
#

well you just have to write the Player object's name instead of the path.combine if you placed the player in your resources folder.

flint flower
#

do get it out of the photon prefab folder??

tulip ledge
#

Resources, you have resourses ;p

flint flower
#

ok i changed code and did put in resources and it still has the same problem

flint flower
#

yeah it fq works now thank you for letting me know how stupid i am

weak plinth
slim ridge
#

should i favor many small packets over fewer larger packets in udp?

grave ice
#

udp is much faster than tcp so generally you would send small packets via udp

#

especially because if you send small packets @slim ridge you can send multiple copies for redundancy and a packet miss isn't a big deal

weak plinth
#

packets have overhead (headers)

#

But sending multiple packets in one go can also result in losing multiple packets

burnt thunder
# weak plinth Vaguely, why?

Are you familiar with the networking for it? Setting up local games on the same wifi network in the same room is perfect, but networking across different IP addresses does not

weak plinth
#

And with a very conservative MTU of 1380, packets aren't going to be very large anyway with udp

weak plinth
grave ice
#

@weak plinth tcp is much slower than udp though per packet

slim ridge
#

ok, thanks fellas. I'm gonna go with fewer larger packets because i also want to enforce order 👍

weak plinth
#

You shouldn't need packet order. If you do, consider using tcp

grave ice
#

or if you care about a package being lost or damaged go with tcp

#

@slim ridge

burnt thunder
slim ridge
#

i've already got that sorted 😄
i'm using udp just for the time-sensitive stuff

weak plinth
#

Be wary of using both protocols

#

TCP chokes UDP

#

^ Article

slim ridge
weak plinth
#

You can also opt for something like ENet

#

Built on top of udp, but has the option for reliable/in order packets

main eagle
#

There's been this tentative "UNet is being deprecated soon" message on all of the networking documentation for awhile. Is it work waiting for the (eventual) successor to UNet? Or should I just move onto a more established networking framework?

floral turtle
dire ridge
#

Is the number of players per session equal to the total number of players connected to the server?
That is, with a dedicated server we can connect 1000 players to the server?

weak plinth
#

That all depends

#

Games like Halo (assuming the dedicated servers they have nowadays) have 2-16 players per session

#

But the total amount of players connected to their server(s) is going to be far more

#

That is, with a dedicated server we can connect 1000 players to the server?
That again depends on your game

#

If you are talking about Runescape with a tickrate of 0.6, you're probably going to run 1000 players on one server

weak plinth
#

No idea. Never used MLAPI

#

But one could (and that's what happens in reality) run multiple instances of a server on a single machine

#

Which results in the usage of multiple cores anyway

#

A lot of these choices really depend on the type of game you are making (and scale)

gleaming prawn
#

a physical server with 4 hardware cores can run an average of 2-4 unity instances only... (from my experience with customers and companies I know use that approach)

#

so if your game has around 10 players per (logical) server-instance/unity-process, a physical machine you rent can run around 20-40 players only...

#

Unity (or Unreal) headless instances are still very expensive. Even if you run a game that can fit 100 players (like fortnite), you will be maxing out CPUs at an average 250 players or so... Don't expect a lot more than this... Unless you are really really optimal (MLAPI is Not optimal)

#

1000s of players per (physical) server? IMHO Not really if you are talking about engine headless instances... This is what you can get when running logic-less RELAYS

#

Perhaps you can do a bit more than what I said if:

  • game runs very slow, like 10 or 20Hz update rate
  • you don't care if gameplay is sloppy
#

I also know that Among Us, which run a very simple relay-only server can fit around 400 players in each server Node (they run cheap Linode servers).

bold quest
gleaming prawn
#

The developer shares a lot of technical details on his own Twitter

bold quest
#

Thanks! Time to do some lurking

river violet
#

Does C# have any included libraries for TCP connections like Java does with Sockets?

#

ServerSocket*

weak plinth
#

Yes @river violet
Socket class

#

And TcpClient/TcpListener

river violet
#

Thanks

weak plinth
#

Code is still wip

river violet
#

Ok nice, thanks for the help!

versed rock
#

hey guys, question.... i have dedicated server, without unity, and i need to have in the server, the walkable path. Any way to export from unity to any file or format to the server, and manage what places can walk?

teal obsidian
#

So how my netcode is setup, each new user gets his own thread for the TCP connection

#

I was told this is going to scale badly. Any suggestions?

distant bolt
main eagle
#

Anyone here familiar with Photon?

#

Specifically, Bolt?

sonic marsh
#

@distant bolt Kinda nice site, was hoping for a Transport update to go with it

tulip ledge
#

Hey,
is about com.unity.transport currently as I read it, its really barebones right? You can easily send/read messages between client and server.

Is this package going to have new features, like mirror for example networktransform or smoothing components or do we need to make them our selfs with this package?

I'm not sure using the jobs system, but regular mono behaviours

verbal lodge
gleaming prawn
#

Wednesday, time for another stream on Creating an Online Roguelite (with Photon Quantum)
22h CET on https://www.twitch.tv/erickpassos76
Summary on what to expect:

  • UI with nickname, healthbar and damage received
  • physics based rotating door
  • moving props
  • gameplay tweaks and game design discussions
  • Playtest with Audience (again)!
Twitch

Programmer, game designer, craftsman.

▶ Play video
grave ice
azure mango
#

Hi guys. Anyone knows what is the status of Unitys networking system? MLAPI?

slim ridge
tulip ledge
verbal lodge
#

The MLAPI has a flexible transport system which allows you to plug in any transport library. The Unity transport will be one of them but we also support other transports such as UNets LLAPI and community based solutions like Enet, LiteNetLib or Ruffles.

lofty grail
#

Is Unet still operational in unity 2019+? I'm stuck on 2018.4 here because all my networking is built on unet

versed rock
grave ice
#

@versed rock Gotcha, I don't speak spanish sir, sorry.

versed rock
#

?

stiff ridge
verbal lodge
azure mango
#

Hi! Im using mirror, but in the client connectionToServer and connectionToClient are both null. Am I missing something?

high night
#

@azure mango maybe your object isnt "spawned"?

lofty grail
#

so I tried upgrading my project to 2019.4 here, but this is a 3+ year old project, full of assembly shenanigans and assets from multiple locations... things did not go smoothly

#

rolled back to 2018.4 for now... will try again later with more patience

#

I did get a weird issue where I got some compiler errors about things like NetworkManager being defined in both UnityEngine.Networking and the new com.multiplayer-hlapi package assembly... is there a strategy to sort that out?

azure mango
#

@high night Yeah it is, because its what im controlling. It seems that only the player assigned in the networkmanager can check the connection

#

So i will pass it to whatever it instantiates

haughty heart
#

@high night Don't post gifs, please.

lofty grail
slim ridge
#

yeah but it's not the same anymore and probably why you got all the errors.

#

if your project used networking you'll probably have to re-build the whole solution with mirror or hlapi

lofty grail
#

idk... that kind of error is about the type definition... if it was different only internally I would have gotten other errors

#

but yea, I do have to rebuild the whole thing from the bottom up... I have some assemblies that are built against build dlls, so those require an up-to-date build to get started

#

so they were likely referencing old assemblies in teh build folder

slim ridge
#

for that error specifically it's because UnityEngine.Networking only has web request stuff now

lofty grail
#

hmm, yeah, so I probably have references to old unityengine.networking in places

#

yeah, this isn't going to be a quick-n-easy upgrade... it will take some planning

#

my project is actually three or four separate projects, sharing assembiles and libraries and making things especially complicated

verbal lodge
#

I think you should get those issues only in old Unity versions where UNet is still included.

lofty grail
#

hmm, yeah, so it definitely looks like there's parts of my code still referencing 2018 assemblies

#

so just to be clear, UnityEngine.Networking doesn't contain hlapi types anymore?

verbal lodge
#

Maybe we still shipped HLAPI in 2019, I'm not sure.

lofty grail
#

hmm

#

I do see a UnityEngine.UNETModule.dll in the 2019 files

#

not sure what's in there though

#

in any case, I'm refactoring some library code here to remove dependencies to the networking dll

#

hopefully make things easier to work with next time around

teal obsidian
#

@high night I can't remember if I asked you this or not, but say I have a tick rate of 60hz, but the client's updates per second drops below 60hz and he cant keep up with the tickrate

#

that would surely cause problems?

high night
#

Well you got to be sending the 60hz of input to server

teal obsidian
#

so he'd be screwed if he cant keep up?

high night
#

If he cant keep up i guess server will have to make do with latest recieved inputs

#

but wait

#

hm

#

this is the logical update we are talking about

#

you have to keep up with the logical update

#

if you cant, you'll crash

teal obsidian
#

my game, for example, on server and client both tick inside fixedupdate at 50hz

#

but if fps drops below 50, that cant happen

high night
#

render fps can drop

#

but fixedupdate must keep up wothout skipping frames

#

since your fixeddeltatime must be fixed, it can be hard to keep up

#

but i think thats not the issue here

#

?

teal obsidian
#

Well I did a test and locked my server at 30fps, and it definitely caused problems

high night
#

its about rendering at lowfps but fixed update is okay right?

teal obsidian
#

I think fixedupdate will try to catch up, but it will catch up too late

#

so it literally cannot process 50hz tick if client is at 49fps

#

which leads me to another question. CSGO / source engine has variable tick rate of up to like 144hz

#

surely not all players are getting over 100fps

#

I think battlefield does the same thing

#

One "solution" I guess, would just to be have a 30hz tickrate, since anything below 30fps is unplayable and most likely clients will always stay above it

#

that's more of a band-aid if anything

high night
#

@teal obsidian if server uses the last recieved input from client for each tick it processes, i guess it would be fine

#

does csgo run different logical tickrate for clients?

#

that would make local player prediction less deterministic

#

but i guess it would be fine if you dont use physics and reconsiliate with states

#

@teal obsidian your clients tick simulations should be cheap though

#

since its just the local player

teal obsidian
#

@high night Well that would cause the tickrate to go out of sync. If the server receives ticks in the past, it just drops them

#

so wouldn't that be a bit of an issue?

#

maybe im overthinking this

high night
#

@teal obsidian client time offset could take into client tickrate into account

#

but it would still be a very small part of that offset

#

if client runs at 20hz, you'd be adding 1/20 seconds

#

which is 50ms

#

id double that
number before adding to my client time offset

#

to compansate for oscillations

#

@teal obsidian if you dont discard inputs right away after using them on server, you could read the same input for the next "missing input ticks"

#

until the other inputs time comes in the buffer

#

.
I'd just want each input to get executed at least once in correct time

#

And then that input would be reused for missing inputs until its next inputs time

wooden saffron
#

Anyone use MLAPI? The mlapi.network site now redirects to the unity site, and the docs only reference the new MLAPI version. I can't find the previous version docs anywhere for the version of MLAPI we're using

verbal lodge
dense hedge
#

Semi-Pseudo Code```
Players = PhotonNetwork.Instantiate(PlayerPrefab.name, new Vector3(-66, 2, -52), Quaternion.identity, 0); //Makes an instance of the player
And then later in the code

Players.transform.position = new Vector3(-65.9f, 1.1f, -54.2f);

lapis vapor
#

Guys, I have a doubt regarding photon,
will OnPlayerEnteredRoom callback be invoked only for new player or will that be invoked to a player who is rejoining room

gleaming prawn
#

Depends on the rejoin

#

If you manage to use ReconnectAndRejoin before the server times out the client, no callback is called

#

If the reconnection goes through the master server again, you are technically joining the room again, as a new client (you get a new actor number) then the callback@is called

#

The fast reconnnect can only be used when the disconnection was caused by a socket closed reason, like when you pick up a call in an iOS phone. And it works if you call it within something like 3 seconds after socket was destroyed by iOS etc

#

@lapis vapor

lapis vapor
#

@gleaming prawn , is there any callback I can use if my player is joining back with reconnectandrejoin()

gleaming prawn
#

You get a callback on your own client that it succeeded.

#

On others no. Technically from server and others perspective you never left the room, only was inactive for a few moments

#

I don’t exactly remember the callback you receive, but this is documented on the website docs about photon realtime and pun2

#

Sorry, typing from phone

lapis vapor
#

Yeah got it @gleaming prawn , I was using OnPlayerEntered callback, so I guess in my case I have to send an RPC to the other player when the player rejoined successfully

gleaming prawn
#

Ye, you can use that

spring crane
#

@weak plinth This is game networking and that post is one year old.

nova mural
#

I have a question regarding photon - I have a script attached to a game object that uses public game objects players. if I spawn that players I dragged into the script slot in the inspector, they are ofc named as "clone". - and the functions of the script are not working as they are reacting to the name of the prefab, but without clone. is there any way around this? hope its clear what I mean lol

sweet slate
#

very simple solution would be to just use Trim("(Clone)"), but you should consider refactoring your code in a way that it doesn't need a specific name to work

nova mural
#

thank you, that sounds cool - I think that for me is enough for this little test project tbh, and I'd also like to learn it. I tried various ways with what you said and what I found on google, but it did not trim it - is there anything wrong? I tried:

PhotonNetwork.Instantiate(player.name.Replace("(clone)","").Trim(), randomPosition, Quaternion.identity);
PhotonNetwork.Instantiate(player.name.Replace("(clone)",""), randomPosition, Quaternion.identity);

as using only trim gave me an error I cant convert from string to char

#

(I can make it work with tags, but still would be cool to undertand the trim!)

teal obsidian
#

@gleaming prawn Sorry to bother you, but how should I be ticking my client and server? People are saying fixedupdate is inadequate and I'm not sure what else I would do

#

because if the fps dips below the fixedupdate tick rate, the client starts sending packets too late. For example, for testing purposes, I had my tickrate at 60hz, and locked the client's FPS to 30fps. It worked fine for a bit, then around every 7 seconds, the client would send a late packet to the server. Just want to know if you know of a way to fix this, or if it's even that big of a problem in the first place

graceful zephyr
#

'late packet' in what sense @teal obsidian ?

nova mural
#

Hey, I want to send the RPC to both players in the game. However, it does not work like I usually use RPCs?

I get the following error: RPC method '{0}({2})' not found on object with PhotonView {1}. Implement as non-static. Apply [PunRPC]. Components on children are not found.

However there are no children nor are the objects children of anything. Also, there is a photon view on the object. Not sure whats up with this...

somber drum
#

I don't know pun and have no right saying this but are you sure you're supposed to use Collision collision at line 30?

Maybe not but I think collision events are a special case.

prisma warren
#

I'm supposed to be working on some PUN2 networking for a work project, but I've just moved house and only have limited mobile data. Am I able to test the netcode locally across 2 clients or do I need a connection to the PUN servers?

nova mural
#

I think they are probably but cant find something to solve it :/

#

Calamari, I think you need connect to the servers

#

at least if I do not start with that, a lot wont work

prisma warren
#

Try removing the parentheses and the parameters from the first rpc argument

nova mural
#

you mean delete collision2d collision from the punrpc function?

prisma warren
#

I. E. Only have the name of the function in the string

#

Yeah

somber drum
#

^

#

Even then idk if that's how you'd sync a Collison event

prisma warren
#

Messages don't usually need parameters, look into unity SendMessage for a similar idea

somber drum
#

Like you can't call it as a method as it is right? Maybe photon doesnt know what to do with that

prisma warren
#

Just like how you can call Start() from a different method

nova mural
#

let me try

somber drum
#

Never had to, interesting 🙂

nova mural
#

but you mean like this do oyu

#

view.RPC("OnCollisionEnter2D()", RpcTarget.All);

#

as I cant remove the parameters from the oncollision itself

somber drum
#

It requires a parameter though right yea

#

🤔

nova mural
#

hmm I cant imagine its not possible to use oncollision with photon :/

somber drum
#

I would think you sync the results not the method itself

nova mural
#

I found an old post from 2014 where someone says he thinks its not possible..not sure but it seems to be the case

#

yes probably, would you point me to the direction how to?

#

not sure how to "save" the results and then call them...

somber drum
#

I truly believe there must be a photon tutorial where they have two characters battling- trigger/collision event must take place at some point sorry I can't help I'm just learning myself- in a different library

nova mural
#

no worries, I am searching but no luck until now ^^

teal obsidian
#

@graceful zephyr 'late packet' as in the tick assosciated with the packet is less than what the server is at, when the server actualy receives the packet

#

it's caused by a low FPS. If I'm running at 30fps and my fixedupdate runs at 60hz. Packets are sent at the end of every fixedupdate

#

so it literally just gets out of sync and cant keep up

#

When you're running a high tick server like that, should you expect all of your users to maintain frames per second higher than the tickrate?

graceful zephyr
#

No

#

That’s obviously not realistic to expect

teal obsidian
#

Ok

#

So how would I go about fixing this "issue"?

graceful zephyr
#

¯_(ツ)_/¯

teal obsidian
#

w a t

#

I thought you were big network man

#

I guess I could just run multiple servers with different tick rates. "If you don't average 60fps, go on a lower tickrate server"

graceful zephyr
#

That’s not realistic

#

To do

floral turtle
#

by 60fps you mean the client cannot run the local simulation fast enough? Is that a common problem with your game?

graceful zephyr
#

Nobody does that

teal obsidian
#

this should be a very generic problem though

#

If the client can't average 60 updates per second. How can be expected to run the 60hz tickrate

#

and send packets to the server at 60hz? Since the server is expecting every client to stay in sync

floral turtle
#

if you mean they cannot render at 60fps how can they simulate at 60hz, one is likely gpu bound the other cpu, right?

teal obsidian
#

No, so the client ticks at 60hz right

#

every fixedupdate

#

if the client is at 30fps, he gets out of sync

#

and starts sending packets late, randomly, every few seconds

#

then when the fps goes back up again >= the tickrate, the client says in sync fine

#

I'm not sure how else to explain this problem

#

because logically, how can the client tick and send packets at 60hz if he's only doing 30 updates per second? If that makes sense to any of you guys?

#

My server drops all late packets btw, so it sort of expects clients to stay in sync to play properly, unless this is the wrong way to do it?

sinful merlin
#

Hey fellas, do you know from small mirror network discord servers?

teal obsidian
#

I guess I could sort of fix my problem by allowing the clients to sync his tickrate more into the future

#

that way if he sends a "late" packet by 1 tick, its still in the future to the server's tick

graceful zephyr
#

@teal obsidian you can never expect your updates to come with even 1/tickRate spacing to the server

#

even if client can keep the render rate, which has nothing to do it really

#

as you're talking about a fixed rate step

teal obsidian
#

So just increase the allowed spacing?

graceful zephyr
#

¯_(ツ)_/¯

teal obsidian
#

bruh

#

because if I do that, clients will have more perceived latency, for non predicted controlled objects like vehicles

#

How much of a spacing would you personally allow for the games you build, fholm?

#

Assuming fast paced, first person type game

graceful zephyr
#

not sure what you mean

teal obsidian
#

How far would you allow clients to send packets into the future

#

until you tell them to resynchronize with the server's tick

graceful zephyr
#

i don't do it like that

#

i never synchronize to server tick like that

#

and sending packets into the future doesn't make sense, how would you send a packet into the future? it gets sent whenever you send it

teal obsidian
#

Right, but it gets stamped with a tick #, to tell the server which tick to process the packet on

#

so anything greater than the server's tick, when the server receives it, is destined to be processed "in the future"

#

is what I'm trying to convey.

#

Ok, did some more testing, increased the allowed spacing by 1 and that seemed to fix it?

#

if it works it works, I guess

#

I'm just worried about increasing perceived latency to the client.

amber delta
#

anyone know a good asset available with fairly simple setup for client-server multiplayer setup?

spring crane
#

Mirror and MLAPI should be relatively simple to get going

amber delta
#

I'm in the middle of writing the health and movement scripts for my game but i haven't done much else yet so it should be a fine point to add this, right?

distant dirge
#

is anyone here familiar with AssetBundle.LoadAllAssetsAsync()?

lapis vapor
#

can anyone help?

plush snow
#

How can I check/be sure a request come to the server from my unity app using webrequests? if i use a public/secret key system it is secure considering unity is setup in users devices/they can get it or not?

arctic iris
#

Can we use PhotonRPC outside of room but still connected to the master server and inside a photonChat channel

#

I basically want to sync the player character in the scene when a player joins a photonchat channel

weak plinth
#

anyone know how to exclude certain players from interacting with certain canvases on multiplayer?

wet knot
#

Hello I have been stuck on this issue for hours and cant figure out why, after watching this video (https://www.youtube.com/watch?v=l2ybEFWHsz8) at 9:45 he shows what should happen, but for some reason at the very end my player wont spawn in (In the consol it says object reference is not set an instance of an object (idk what that means))._.

Code that should spawn player:

#

oh wait only the start button is not working

#

when I click the button to spawn the charcter in

#

nothing happens

#

WAIT

#

hold up

sweet slate
#

can you put a Debug.Log in your SpawnPlayer method to see if it's actually called when pressing the button?

wet knot
#

i fixed the button

#

BUT NOW

#

it says failed to instantiate prefab

#

and character wont spawn

sweet slate
#

I have no idea of networking, as said, but try removing the .name in your instantiation

wet knot
#

oki

#

it says error

#

cant work

#

but yeah for that instantiate prefab thing this is what it says fully

#

the player is called Player 2 1 (btw)

#

i also made my own movement and camera fallow instead of fallowing the tutrial for that part

#

should I delete my movement and camera fallow code and try to fallow the tutorials version or should that not matter?

sweet slate
#

that shouldn't be the issue

wet knot
#

just saying in the tutorial they put the camera within the player mine is not

sweet slate
#

I say it again, i have no idea of networking, but (obviously) your client is not in a room, whatever that means 😀

wet knot
#

lol

#

get IN THE ROOM

#

grounded

sweet slate
#

seems like your connection is not established at the point where you're trying to create the player

#

but I may be totally wrong

wet knot
#

oof

sweet slate
#

you could also try putting the cam inside your player, as in the tutorial, but I doubt that's the issue

#

since it's not about the cam but the player itself that's not being created

wet knot
#

when I do that I get a new problem

#

mabey I shouldjust delete my movement and camera code

#

and just fallow the tutroirals version

#

mine might not even work for multiplayer

sweet slate
#

May be possible 😀

wet knot
#

oh wait

#

but he does not show how to make player jump

#

NOoOoOoOOOo

#

oh wait he says next video he shows hot to jump

#

HE LIED

sweet slate
#

🤣 🤣

wet knot
#

idk what to beleive anymore

wet knot
#

WHAT!!?!?!

#

thats what happened when I clicked the button now

distant dirge
#

can anyone here help me with AssetBundle.LoadAllAssetsAsync()? I setup what I think is a good loader here ```csharp
public static class BlueprintLoader {
static AssetBundleRequest LoadRequest;
public static void Load(Action<IEnumerable<BlueprintScriptableObject>> callback) {
var bundle = (AssetBundle)AccessTools.Field(typeof(ResourcesLibrary), "s_BlueprintsBundle").GetValue(null);
LoadRequest = bundle.LoadAllAssetsAsync<BlueprintScriptableObject>();
LoadRequest.completed += (asyncOperation) => {
callback(LoadRequest.allAssets.Cast<BlueprintScriptableObject>());
LoadRequest = null;
};
}
public static bool LoadInProgress() {
return LoadRequest != null ? true : false;
}
}

and here is some code that invokes it ```csharp
        public static IEnumerable<BlueprintScriptableObject> GetBluePrints() {
            if (blueprints == null) {
                if (BlueprintLoader.LoadInProgress()) { yield return null; }
                else {
                    BlueprintLoader.Load((bps) => {
                        blueprints = bps;});
                    yield return null;
                }
            }
            yield return null;
        }
``` and yet I never see my static property `blueprints` (sorry for non standard naming) become non null
#

I can do regular background threading and all that no problem but this funny cooperative multitasking stuff is confusing to me

sonic marsh
#

@distant dirge Can you use addressables?

#

it makes all this bundle stuff way better

distant dirge
#

basically I am in a mod and calling into load some game resources I need

distant dirge
#

I saw that briefly but I am not creating the assets just getting them from an existing game

sonic marsh
#

no clue then sorry

lapis vapor
#

guys is there any scenario where a Photonnetwork.Raiseevent be invoked in the client and not being received by others, ? in my case a raise event is invoked in the client where it was called, but not in the opponent

I'm adding the code here

        public override void OnPlayerEnteredRoom(Player newPlayer)
        {
            base.OnPlayerEnteredRoom(newPlayer);
            FFNotification.Instance.HidePopUp();
            Invoke("DelayedRaiseEvent", 2.0f);
        }

        void DelayedRaiseEvent()
        {
            FingerHandler.mInstance.RaiseOpponentReconn();
        }
        public void RaiseOpponentReconn()
        {
            PhotonNetwork.RaiseEvent(OPPONENT_RECONNECTED, 1, null, ExitGames.Client.Photon.SendOptions.SendReliable);
        }
sonic marsh
#

probably better to go to that games modding discord then

#

this is for unity Networking (as in game multiplayer) help

distant dirge
#

server link?

sonic marsh
#

no clue

distant dirge
#

this was the closest thing to a channel on async programing lol

sonic marsh
#

definitly the wrong place 😛

wet knot
#

does anyone here know where to start when making a multiplayer game

#

like a tutorial link

sonic marsh
#

first link in pinned messages

warped marten
#

that the player

#

and thats the player container

somber drum
#

I would explain the issue I for one am not downloading that

spring crane
#

@warped marten If you are using OBS, remux the mkv to mp4 before putting it on discord to have it embed

keen mirage
#

Hey guys i need help when i try to upload the image I get a Bad Request. But works fine when i dont include the image. Am i doing something wrong here

        byte[] bytes = userData.avatar.EncodeToPNG();

        //form.AddBinaryData("[user]avatar", FileSystemScript.Instance.LoadFile("Application.persistentDataPath/TestFolder/ImageTest"));
        form.AddBinaryData("[user]avatar", bytes,"testImage.png","image/png");
        form.AddField("[user]first_name", userData.first_name);
        form.AddField("[user]last_name", userData.last_name);
        form.AddField("_method", "put");

        using (UnityWebRequest www = UnityWebRequest.Put(url, form.data))
        {
            www.SetRequestHeader("content-type", "application/x-www-form-urlencoded");
            www.SetRequestHeader("access-token", authentication.token);
            www.SetRequestHeader("client", authentication.client);
            www.SetRequestHeader("uid", authentication.uid);

            //www.uploadHandler.contentType = "multipart/form-data";
            //www.uploadHandler = new UploadHandlerRaw(System.Text.Encoding.UTF8.GetBytes(jsonData));

            yield return www.SendWebRequest();

            if (www.isNetworkError || www.isHttpError)
            {
                Debug.Log("THERE IS ERROR " + www.error);
            }
            else
            {
                if (www.isDone)
                {
                    string jsonResult = System.Text.Encoding.UTF8.GetString(www.downloadHandler.data);
                    Debug.Log("Server Put Response" + jsonResult);

                    if (jsonResult.Contains("error"))
                    {
                        Debug.Log("Error Received : " + jsonResult);
                    }
                    else
                    {
                    }
                }
            }
        }```
patent fog
#

Means you didnt send a request complying to what the server expected. Could be a wrong format, missing argument or syntax error in one of those, ...

#

Check the API

#

make sure you send everything as expected

keen mirage
patent fog
#

I don't know I didnt look

#

If it emits the expected PUT request with expected params, then it's good, but I don't have a way to check that on your behalf

arctic iris
mint musk
#

Anyone who knows how to sync game objects using mirror?

#

it's pissing me off that I can't find a solution

patent fog
mint musk
#

thanks, hope i'll find the solution i need

#

hmm according to my friend, he read it but it wasn't helpful for him

patent fog
#

how to sync game objects using mirror
That's literally what mirror is for, syncing gameobjects through the network. And the best place to start is always the official documentation, when there's one.

#

🤷‍♂️ Don't listen to your friend, learn from the doc. Go through it at least one time before quitting. Network is really a complex topic if you can't even finish the doc you won't go far, as you will face a lot of bigger blockers

stiff ridge
# arctic iris I basically want to sync the player character in the scene when a player joins a...

Photon Chat does not support properties per user. In theory, you could send a binary message describing the character but this doesn't scale well when users join/leave the channels a lot.
If you are OK with this, you could show the characters for some users you already know (because you were in a room together or because they are friends). Each user can set a status (which is sent to friends) and this (again) can contain a character description.

arctic iris
# stiff ridge Photon Chat does not support properties per user. In theory, you could send a bi...

Ahhh i see and well i tried using rooms the thing is i'm trying to make a party system like apex legends, fortnite, warzone where friends can join each other before going into the game i can't do it using room since if i make a room named party and then create another room and try to put those players into that game room even when removing the players from the old party room i get errors

#

so i used photon chat to make a party system which works

#

i just dont know how to make it so whoever joins his character is showed to every player in that channel

#

ig using mirror for party system and other stuff using photon

mint musk
#

the weird thing though is that after i dragged in the prefabs in the Registered Prefabs List in NetworkManager, it still doesn't show up on the client side

#

and yes, the prefabs do have a NetworkIdentity object on them

gray pond
patent fog
mint musk
#

Yep they do spawn in the scene

#

I also discovered this, but as said, not working (edit: i already mentioned this list, my bad)

patent fog
#

You made a new build after your last modifications ?

#

got to go eat, they also have a discord for mirror if you need detailed help

mint musk
#

yes

#

ooh i'll check the server out i'm still unable to solve this

patent fog
#

Ok i don't see why just like that, good luck :p

#

👋

stiff ridge
# arctic iris Ahhh i see and well i tried using rooms the thing is i'm trying to make a party ...

I don't know exactly how you want this lobby-room to work. Here's one idea: You can put everyone in the actual room but run it as lobby, before it's full. Then, don't close the room and start the game (load scene, etc) with everyone in that lobby.
No need to change rooms, actually.
If you got errors with the lobby when someone leaves, I am quite sure it's easier to understand and fix those errors instead of using yet another networking solution in the mix. If you try again, let us know what's up.

versed rock
#

Hey guys, i'm making a server for a MMO (only for lean about how MMO server works) and need some place or any documentation or site with information that how to manage the server side of a MMO?

graceful zephyr
#

there is none

versed rock
#

nothing?

verbal lodge
#

It Hare has some books to learn some of the overall ideas. Not only specific to MMOs and won't go into the details because there is just too much to cover.

balmy egret
#

I have a question. I need to connect players to another player who is the server. How the clients are supposed to know wich is the ip of the player who is the server?
I want to avoid using dedicated servers.

graceful zephyr
#

@versed rock not really no, if you are looking for someone to teach you how to make an MMO via book, etc.

#

That doesn't exist

versed rock
#

Yeah i know, but maybe some basic architecture, examples of server loop, some ideas the how manage the packets

versed rock
#

Thanks for the info about the books

#

I see a lot of people use node.js for server mmo, im trying create with .net core

graceful zephyr
#

nobody using node.js for any mmos lol

#

at least not anything serious

#

we meet again luke ...

#

😄

verbal lodge
#

🤣

graceful zephyr
#

😉

verbal lodge
# versed rock I see the books, u know any other books with ebook format? Or any owebsite with ...

.net core (.net 5) would probably be my platform of choice as well when creating an mmo, also allows you to possibly share parts of the code base with the Unity client side. I don't think there are many other good resources around, maybe if you are looking for a specific topic there's some stuff I could link. If you need more high level overviews the talk from David about Albion is pretty good: https://www.youtube.com/watch?v=x_4Y2-B-THo

twilit nacelle
#

hello anyone can tell me the best networking for unity to develop a networking game

sonic marsh
#

First pinned link

severe owl
#

the best networking

#

subjective

#

but id say the challenge is more in design of your game then what networking you use

#

so use whats easy to prototype with and whatnot

twilit nacelle
#

there is the new networking mlapi i think its good i am watching tutorials by dapper dino he is so good i think i will use it

versed rock
terse crow
#

Hey everyone!
I'm trying to instantiate a gameobject using Photon, and then parent it to the player that instantiated the object. However, when I try to do this, the object that got instantiated only gets parented to the player for a split second, and then becomes a child of the scene. I read that you have to call an RPC instead of Instantiating it directly, but you can't set parents inside of RPCs, so how would I go about doing this, because I honestly have no idea. Any help is appreciated.

#

Here are my scripts

sonic marsh
#

yea same here

#

.net 5 + project orleans (this is the core sever/storage) maybe some sort of unity inside a docker container (if i need specific unity stuff for 'parts' of the game world, but keep this low) + a bunch of asp.net core web apis/signalr apis

versed rock
#

i think in use orleans too but i don't know...

sonic marsh
#

orleans is awesome, handles so many things

#

worst part is connection from client

high night
#

@teal obsidian I was thinking for myself, i'd serialize the heavy data every fifth second or something

And boolean packs per each tick so i wouldn't miss anything on them

teal obsidian
#

Yeah originally I would just send a TCP message to each client whenever someone entered a car, and if a player joined, send him all the TCP info that he needed if players were already in cars

#

but that was way too messy

high night
#

Maybe you are thinking about serializing booleans like that with less frequency
And thats why you are worried that if you used a boolean as a "trigger" thats true for only one frame, it might be missed?

#

@teal obsidian Either way, i think rpcs have their uses

#

I assume you are also implementing your own serialization correct?

teal obsidian
#

I use unity's serialization

high night
#

But you have control over it per tick?

teal obsidian
#

yes

high night
#

I think maybe also somehow being able to pack RPCs for same tick wouldve been nice

#

So the rpc gets called when serialized data is recieved

#

in the same tick the rpc got called in the server

teal obsidian
#

For right now I'm just building a system where server sends ALL data every tick, then client just checks if player is now in a vehicle, that he wasn't in when he received the last update

#

that seems to work, Probably optimize it a bit later

high night
#

I mean when an rpc is called from an object, server would also include that "function call" into that ticks data

#

So you are able to use rpcs

#

without causing a mess or breaking the tick based simulation

teal obsidian
#

yeah but then you have an issue, where if players are already in vehicles before the client joins

#

you would have to account for that too

high night
#

ah, yes

teal obsidian
#

that's sort of the messy part I was talking about. I got it working, but I just thought this would be a little more efficient

#

and safe

high night
#

I guess its just the "view"s job to reposition the character to fit the data

#

And "view"s job shouldnt possibly get too complicated

#

So i guess i wouldn't worry about a little code volume to make the process more efficient

#

@teal obsidian

teal obsidian
#

yeah I suppose

#

sometimes I write really shitty code then I wake up in the morning and im like "why the fuck would I do it that way"

high night
#

i listen to eurobeat while i am coding and my code is always shitty

#

then i spend days debugging

#

and debugging the client is sure pain in the ass
i cant simply step into the next tick, by then the server have already moved on without the client

sonic marsh
#

yea that really sucks for networking programming

#

i can kinda debug client playback now, Since i use curve data I can 'scroll' the time on the client as if it was video

high night
#

for a weeklong issue from some time ago i had buffered the server states on the client
onoy then i was able to figure it out

#

yeah something like that, it was messy and i didnt keep it, but i will probably remake it again when i face a big issue like that again

sonic marsh
#

yea mine is more of a side effect of my networking/data layout

high night
#

the issue was reference type inputs that i fed to character, i was modifying them in prediction 😫

sonic marsh
#

thinking of exposing some dev/debug tools that allow editing of it

high night
#

sounds nice

teal obsidian
#

I used to think I was good programmer until I started doing game networking 🤣

sonic marsh
#

haha

#

yea

teal obsidian
#

takes me 30 minutes to write 10 lines to make sure I didnt break anything

sonic marsh
#

im trying to build a networking kit/library so takes even longer

#

i have to think of as many cases, and then build examples

#

and soon build tests

high night
#

I should've just done more research

#

My serialization part is mostly a mess

#

This fps sample unity talk has some good points on serialization

sonic marsh
#

my initial serialization was a .net library

high night
#

How does that work?

sonic marsh
#

just add it to the project 😛

high night
#

like json style?

sonic marsh
#

binary

#

it was the 'fastest' .net binary serialization library

high night
#

it just serializes the data right?

sonic marsh
#

yup

high night
#

no classname and stuff

sonic marsh
#

um kinda yes kinda no

#

there was a mode for 'typeless' or something like that

#

so you can serialize anything and the client would discover the right type and deserialize into that

#

had some smarts so any types like that were optmized into a int lookup after the first

#

was cool

high night
#

I think i'd rather include my type info as headers myself

sonic marsh
#

but now im using Unity.Transport and just include my own TypeId

#

yea

#

my issue now is a packet can only contain 1 type of data

#

but since its a RTS kit i fill up most packets

#

need to optmized the data down a bit, then see if i can pack more into a packet

high night
#

rts kit?

sonic marsh
#

tool? library?

#

i plan on releasing it

high night
#

you are making an rts networking kit?

sonic marsh
#

yup

high night
#

what kind of architecture is that?

sonic marsh
#

client server

#

not lockstep or p2p

high night
#

i see

sonic marsh
#

using Curves

high night
#

what curves?

sonic marsh
#

basicly break all data into keyframes

#

and only sync those

#

and in many cases that data can be predicted quite far, which also allows optmizing the data down too

high night
#

hmm very interesting, i am still reading it, i am trying to understand in what way curves better than snapshots with timestamps

#

@sonic marsh

sonic marsh
#

yea its a tough read

#

very interesting

#

i think vs normal snapshots you can reduce further

#

depending on how smart your snapshot system is

#

you can fully exclude data that has no changes

high night
#

is it like
when you move a unit,
a curve with units current position and next position in end point and in 15 seconds(future) are sent?

sonic marsh
#

kinda yes

#

hard to tell how far in the future you can send

high night
#

and then its overridden if something changes

#

kinda makes sense

sonic marsh
#

but in the example of a RTS you could probably safly assume that 20ish secs of future path can be predicted

#

but something like health shouldnt

high night
#

it wouldnt need predicting i think

#

client can be in past compared to server

sonic marsh
#

the trick is the server is a head of the clients

#

not by much

#

my tests show around 200ms works well

#

but need to test higher latancys

high night
#

server wouldve already sent the new curve if something has changed before client can see the wrong image @sonic marsh

#

its not the client predicting

#

its the server predicting the future

sonic marsh
#

yea

#

sorry yes

high night
#

yeah pretty cool

sonic marsh
#

clients are very dumb, they dont predict (tho maybe some things could)

high night
#

thanks for sharing, this article looks nice

sonic marsh
#

all good

#

tough to find much info around that style of networking

#

so nice to have discussions around it

#

also i do think it only fits some game types

#

the faster the game needs to be the worse the 'delay' will be

high night
#

i wonder how they do the tanks wiggling out of each other when they are packed tightly

#

in planetary annihiation

#

since their paths are not linear

sonic marsh
#

hmmm not sure

high night
#

i guess curve lenghts shrink

sonic marsh
#

that could be something done all client side

high night
#

up to the point where its pretty much snapshot interpolation

sonic marsh
#

the path curve is synced, but then client could test if something is close and allow 2? units of pushing or something

#

i feel that could open other issues tho

#

eg a bullet hits on server, so the build end keyframe is sent

#

but on client the tank has moved 0.6 X and that will visually look like a miss

high night
#

i think server could send curves with same len without caring if there will be collisions or anything

if something goes wrong, server would send a new curve next frame

and clients would only use the beginnings of these curves since the new curves override previous ones very quickly
@Roycon#3914

sonic marsh
#

cients are probably all curves

high night
#

so the curves sent in these situations have completely useless "future" parts

sonic marsh
#

any client prediction/visual things cant really mess with most cutve data

high night
#

yeah clients dont need to simulate/predict anything

sonic marsh
#

that curves + DOTS feels really nice to use

#

hoping to have a 0.1 alpha out in a month or so

#

tho i kinda want to sell it too

twilit nacelle
#

can someone help me i am installing the new network system mlapi and thats error coming what i can do

weak plinth
#

hey guys in pun2 is there any override function where we can check that while we are in a room and when certain condition meets we get transferred to final scene in every connected players device synchronously...because in update its creating hierarchy overloading like this

steady kite
#

and then you can just load the scene for the masterclient and all other players would follow

azure mango
#

Hi! How is the new multiplayer system called?

patent fog
#

MLAPI ?

#

THis one ?

vernal cargo
#

Hey! Trying to add voip in a project using Mirror and haven't found any good alternatives yet. I tried https://github.com/TehMightyPotato/Heliograph however last commit was 2 years ago and the example scene doesn't even work properly. Any suggestions on where to start? 🙂

azure mango
#

@patent fog Yeah! That one thx, I couldnt find it

fringe fossil
#

How can I start with multiplayer. I’m working on a multiplayer car game. I really don’t know too much about networking

novel locust
fringe fossil
#

Is this the depicted or new

#

*deprecated

verbal lodge
#

This (MLAPI) is the new experimental networking library we are working on.

fringe fossil
languid monolith
patent fog
#

Did you try Vivox ?

languid monolith
#

Have not, will check it out thanks!

dense briar
#

anyone here good with photon here

vast swallow
#

Does anyone know why when I play my game the camera's for both players are opposite? so when I play the game with someone else I see his camera and he sees mine?
On my end it feels like the camera isn't following but the other player it shows it is following and vice versa, photon cloud?

solid crow
#

If I have a view of any kind on an object (let's say a Photon Rigidbody View for the sake of the question), do I still need to use OnPhotonSerializeView to synchronize it or is that taken care of? (if this has been asked let me know :0) )

oak flower
#

@weak plinth Not a place for ads. You can find it on forums, link is pinned in #💻┃unity-talk

fringe fossil
#

Is there an easier way to make other clients see your moving without the hello player manager and player script

hoary glen
#

Hey I need help

#

I was trying to get MLAPI working so I can make a multiplayer game

#

But when I paste the link into the package manager, I get an error saying I need to install git

#

but I have git installed

#

Can anyone help me

patent fog
#

Did you just installed it now ? If so, I'd recommend a restart of your computer to reload env vars. Can you type git --version in your CLI ?

#

@hoary glen

hoary glen
#

I installed it last night, tried again this morning same problem

#

whats CLI?

hoary glen
patent fog
hoary glen
patent fog
#

available from cmd.exe in windows or somtimes in your IDE for example

#

yeah git not found by Unity

#

SO i still recommend a restart to refresh environment variables

#

Assumed you installed git correctly

hoary glen
#

git version 2.31.1.windows.1

patent fog
#

restart Unity and/or your computer

hoary glen
#

okay

#

hmm

#

do you think it has something to do with the fact im running 2020.2.2.f1

#

instead of 2021

#

the page says you need 2019 + but idk

#

ill restart my computer brb

patent fog
#

2019.4+ should be ok

hoary glen
#

@patent fog Ok im back

#

unity is starting

#

Its loading

#

installing git package

#

AYYY it worked

#

thanks for the help

#

ill tell you if i need more help

#

@patent fog I need some more help

#

Im at step 5

#

When I hit add compoent, there isnt an option for MLAPI

#

Nevermind it just showed up.

#

sorry for the ping

fringe fossil
#

Hi can someone help me?

#

Is there an easier way to make other clients see your moving without the helloplayermanager and player script in the unity documentation because I already have a player movement script

hoary glen
#

im not sure

past oasis
#

does anyone have learning resources for aws connectivity here

fringe fossil
#

I’m having a problem where I’m using a Logitech g29 with the sdk and it won’t register input. There is a player script on my player that takes the input and moves the player but when I make a prefab the player doesn’t want to take input. There is an sdk file with a dll, lib and pdb file in the project. Any idea why when I host a game or join, the player doesn’t take input?

patent fog
versed rock
#

Hey guys, any tutorial or reference for make Relay server in .net core for Unity?

woeful wadi
#

google

graceful zephyr
#

nope

alpine pivot
agile field
#

Hey guys, anyone here has experience implementing video chat using Agora SDK on a multiplayer game using photon?

teal obsidian
#

Should commands, like "reload weapon", or "shoot weapon" be sent inside the same packet as the movement and such?

#

because what if your player predicts "shoot weapon" or "reload weapon" animations, but the packet gets lost in transit

frank breach
#

Hello, is anyone here experienced with google firebase firestore and realtime database?

silk iron
#

Hey I am trying to implement Mirror in my game, but there is a problem. Both players (Host and client) are moving together. When I move the host the client automatically moves with him

#

They are shooting to the mouse position

gray pond
# silk iron

You're probably missing a check for hasAuthority in your input handler. Mirror has its own Discord for support, link is in Asset Store page.

ember kettle
#

dont mind the server icon lmao

patent fog
frank breach
#

and what i am suffering from is i am trying save a custom object in firestore

#

but its not working for some reason

#

i can save the normal dictionary object

#

but i cant save this customized object for some reason

#

no idea why

patent fog
#

normal is the commented out ?

#

and custom is from the class PlayerLoginMessage ?

frank breach
#

yea

#

i am using this documentation

#

and i doubt i am doing anything wrong its something weird

patent fog
#

Looks okay from the docs yeah.
Is there any error or just nothing happens ? I would catch exception to make sure
Is the Uri field supported ? Is it boxed to smthg else like a string? I would just ignore that field to rule it out
What are the warnings you get from your IDE on the fields of the first screen?

#

I would also Update instead of Set, maybe it worked first time with your first example and Set does nothing if already exists ? need to double-check that

#

That's all I can see right now with that much info

#

I assume you're up-to-date, but if you don't use latest version I would check if the class payload support is a recent addition or not

#

Anyway catching the exception should help in the first place instead of guessing 🙂

frank breach
#

god i wasted so much time

#

i tried capturing exception btw

#

it was giving me nothing

#

it was like just stuck no error or anything

#

thanks for your help alot

reef jetty
#

Can i export projects which contains photon pun 2 to webgl platform

stone pendant
#

trying to enable ragdoll in multyplayer, mirror responds with "networkClient is not ready" anyone any ideas? I'm trying to enable it with a key input then running a [command] function then i run a [clientRpc] function

#

also when i go into ragdoll as host the clients disconnects

slow lantern
#

can i ask a question about Photon Pun here?

#

channel description says and networking solutions, so ill just ask

#

im trying to play an animation whenever a player gets hit, but the animation plays on all players, regardless of the fact that having those animator's bool value set has nothing to do with Photon or Networking

here's the snippet that does the RPCs:

private void OnTriggerEnter2D(Collider2D other)
 {
     if (photonView.IsMine)
     {
         PhotonView otherPhotonView = other.gameObject.GetPhotonView();
         int id = otherPhotonView.ViewID;
         if (!otherPhotonView.IsMine)
         {
             photonView.RPC("Damage", photonView.Owner, 1);
             _plrHud.TakeHudDamage(_health);
             photonView.RPC("Boost", otherPhotonView.Owner, id);
         }
     }
 }```


here's the Player HUD script, that should set bools to true for the local player and only the local player:

```cs
using Photon.Pun;
using UnityEngine;

public class PlayerHUD : MonoBehaviour
{
 [SerializeField] private Animator _healthAnim;

 public void TakeHudDamage(int health)
 {
     switch (health)
     {
         case 2:
             _healthAnim.SetBool("2Health", true);
             break;
         case 1:
             _healthAnim.SetBool("1Health", true);
             break;
         case 0:
             _healthAnim.SetBool("0Health", true);
             break;
     }
 }
}```
it should be noted that the player hud is instantiated only on the client which returns true to `if (photonView.isMine)`
#

this is how that happens:cs private void Start() { if (photonView.IsMine) { GameObject _instantiatedHud = Instantiate(_HUD, transform); _plrHud = _instantiatedHud.GetComponent<PlayerHUD>(); } }
where _HUD is a prefab set in the Editor

elder swallow
#

Hey everyone. I'm having some trouble. I implemented a database in my game using sql. I used a dll to conect the game with the database. The thing is that when I compile it for android in IL2CPP the dll doesn't work but it does in mono. I'm trying to upload it to google play so I must have the IL2CPP compiling method in order to use the 64 cpu architecture.

rustic magnet
#

Hi friends. If you were in charge of setting up an authoritative server for realtime movement for dozens to hundreds of users per map, the client is unity and the host is google cloud, any suggestions? Nothing is decided besides unity client and gcloud backend, target is desktop and mobile. I'm eager for somebody to convince me to use something for server architecture and unity client framework

paper sleet
#

Cant use photon?

rustic magnet
#

@mystic tangle vehicle riding essentially

#

@paper sleet funny, I was given the requirement of "not photon" by a developer. I just started. I didn't press it

mystic tangle
#

the photon solutions are amazing products

#

that work well

#

and have good pricing

#

I would be interested in seeing the reasoning

#

otherwise you can use any of the open source solutions

#

I would recommend mlapi over mirror for the sole reason that mlapi is owned by unity now so you have official unity support

#

do keep in mind that mlapi is in the middle of a big refactor at the moment because unity bought it

#

the unity update

slow lantern
paper sleet
#

Mirror also good

somber drum
#

I wish there was a way to generate RPC's and such, I feel like I'm repeating myself sometimes and I hate it

#

I get everything has to be manual because otherwise it'd be super inefficient not knowing what to send where but if it started dumb but got the job done- then gave the option to go in and manually edit them as you need.. I just want to prototype shit and keep getting carried away in the messy structure of code that follows a programmer new to net code

#

new programmer in general more like it, maybe it's not just me though

floral turtle
#

@somber drum this is a common criticism of the Mirror/MLAPI style of netcode, in that it tends to make for fragile code. So not just you

#

note that with MLAPI there are ways to sync the state of the game outside of RPCs (NetworkVar)

somber drum
#

Yes I've been using mirror, hopeful there's other solutions out there but I hear MLAPI is in a bit of a limbo atm

#

Photon does stuff differently I'm assuming?

floral turtle
#

Photon has a few packages available. They have PUN and Bolt, which both work a bit differently, but are also working on a new one called Fusion, that has a really nice abstraction layer between gameplay and netcode

#

MLAPI was acquired by Unity recently and so has some changes coming in the pipeline. They have a pretty active discord if you're looking to use it

somber drum
#

I've signed up for fusion a while back so I'll probably wait that out hearing all the good things planned/implemented

floral turtle
#

it's really good. Has a very strong architecture, very easy to code against. Is tick based, so can do client prediction/rollback

somber drum
#

exciting stuff, can't wait!

slow lantern
somber drum
#

I use a dictionary, wouldn't see a point in my case saving to database

weak plinth
#

Hello! I can't seem to install SSH.NET through a Git URL in Unity. I get an error saying a manifest is missing and it could not install the package. If you could help me with that it would be appreciated, otherwise please reccomend a good SSH client asset. Thank you!

weak plinth
#

Alright, probably not going to online anytime soon so please DM me if this answer get's drowned.

keen mirage
#

Any sample for code for uploading picture or file to a server? All i could find online are some outdated codes that doesnt seem to work

fringe fossil
#

Anyone here?

#

I’m working with mirror and when I host a game, the host’s gameobject which is a car, makes the texture look weird. The car is in a LOD group. It’s a model I found on the asset store.

spring crane
#

@fringe fossil Seems odd to be networking related, unless there's a link somewhere. Sure it's not just various LOD models being screwed up?

thorny gale
#

Is mlapi in preview because when I add it to the project from git URL it shows preview in front of its name in package manager.

verbal lodge
mossy kettle
#

guys what do you all use for networking? I've seen people use Mirror and Photon. Any others there? Which one is preferred

jade glacier
#

Fusion pretty much is in the works, but actual release date is still squishy.

rustic magnet
#

Hey fellas, I'm using Mirror with Authoritative server. My player component has a NetworkTransform component. The network transform is client authoritative. I'm trying to teleport the player after a scene load to 0,0,0. I have tried ServerTeleport on the server, I have tried setting the NetworkTransform's transform position on client.. nothing seems to do.

somber drum
#

make sure you're not overriding your 0,0,0 call via spawnpoint or something pre established

#

in the net manager

rustic magnet
#

@somber drum Thanks, I appreciate your response. I'll be trying again later maybe. For now I worked around it.

gray pond
rustic magnet
#

@gray pond Thanks. I would click on the Discord link on Mirror's site and it would never open the actual invite apparently, I was assuming it was just using this server. Got it now. Appreciate it.

vital hawk
#

"Running the game over internet currently requires setting up a Photon Transport for MLAPI, which uses Photon relay server to facilitate communication between clients and server living on different networks."

#

that's... surprising, don't they still support their own transport too?

verbal lodge
#

Oh the wording is a bit confusing. This means "running over the internet without port forwarding". Basically if you want to run Boss Room as a listen server game and play with friends you will need a relay server based transport instead of a direct ip connection based approach unless you open ports on the hosts router.

vital hawk
#

yeah I get that 🙂 but doesn't unity have their own relay servers too?

#

I haven't ever used unet so I wouldn't know better

#

thought that was one of the key points on using unet though

#

(or Unity's service for it rather)

verbal lodge
#

The UNet p2p service is at the end of its life cycle. We are not taking any new customers anymore as far as I know. We might offer a new relay service in the future but currently we don't have one.

vital hawk
#

ah, I didn't know it was that far gone already 🙂

#

here's hoping someone does EOS transport then

gray pond
alpine pivot
#

There is a Photon Relay Transport for MLAPI? What reality did I wake up in?

fleet lagoon
#

Can anybody with Addressables experience help me out with this one?
I'm wondering what the current good/best practice is, when instantiating and removing objects which were loaded in with Addressables.LoadAssetAsync()

Is it a good advice (or maybe even necessary) to still instantiate these objects with Addressables.InstantiateAsync() instead of GameObject.Instantiate(), even though the object is already in memory and doesn't really need an async operation to be instantiated? I've read on the Unity boards that only this way the Addressables module knows when to release an asset from memory.

Thanks a lot for any input!

sonic marsh
#

@fleet lagoon Wrong place, this is for networking/multiplayer

spiral smelt
#

Hey, which networking solution i should use ?

#

should i use the "Long discontinued" Unity networking

#

Or mirror

#

or photon

lime pulsar
#

is there anyone making a game who needs a sound designer & composer? HMU i've never worked on a games project it'd be fun to work on something collaboratively

#

wait is the networking title as in like, packet transfer kind of networking not talking to people networking

bold quest
#

This is for like, TCP/UDP networking

#

hahaha

#

Yep

lime pulsar
#

HAHAHAHA

#

lmao im stupid

#

at least i got spirit

rich narwhal
#

Does anyone know why over pun2 network things might be different like on one a moving object can do one thing smoothly on the other it's not so smooth and player jump heights are different

stiff ridge
#

It sends the positions of networked objects and the receiver will try to reach the last known/received position in some time. If you jump and send updates before and after peak jump, the receiver will never know how high you jumped.
The built-in network synchronization is not perfect. You need to adjust it your game's requirements.
You could send additional info to avoid this. E.g. you could send "i jumped this much" so the peak height is known.

#

The Smooth Sync package from the Asset Store seems to do much better than the included sync script.
We are working on a replacement for PUN 2, which will do much better...

heady storm
#

Nice, just saw that #unity put out the first example of the new MLAPI development, a example scene called boss room.
I have really high hopes for the new MLAPI setup.
https://docs-multiplayer.unity3d.com/

Found the download here:
https://github.com/Unity-Technologies/com.unity.multiplayer.samples.coop

#

Time to experiment 😉

bleak delta
#

I am not really sure where to start with implementing something like a lobby system with MLAPI. Are there any tutorials or docs that could explain something like this?

heady storm
#

Surely there must be changes, i am looking forward to it, because i all want is traditional Peer2Peer, no servers, no online mode required, etc etc.

weak plinth
#

how can i sync two GameObject in photon without instantiating the GameObject

rich narwhal
#

@stiff ridge does this apply if the other machine (The second game open) has a different jump height...

stiff ridge
stiff ridge
#

You don't sync two objects as such. Both clients show the same networked object.

rich narwhal
#

is that somewhat the same for say i have a object that constantly rotates on one side it smooth on the other it kind of just teleports back and forth while eventually getting to the area?

subtle warren
#

Hi guys.
In my app I want to spawn item by id from the server to my client (my items are stored in a array on client side).

This work well only if the server enter an id before the client connect to the server.

Everything else show me the error Key not found.

My goal is to spawn different items at the same location but each item must disappear before an another one spawn.

I use tcp/udp to send and handle data.

I've been struggling a lot on this one so if you could help me i'll be really grateful ! 😄

stiff ridge
rich narwhal
#

ok thank you i will try to see what i can do

rich narwhal
#

oh wait one more thing, is it possible to downgrade Pun2 after updating it, it is a different version, i am using the same method i did before on other projects and it worked so maybe it could be that, im not sure

stiff ridge
#

sorry, the asset store does not provide older versions. you could possibly rollback in your version control...
from which version did you upgrade and to which?

#

if the synchronization is giving you headaches, Smooth Sync from the asset store could help, allegedly (didn't try it myself).

rich narwhal
#

2.18 to 2.29, big change, but i am lucky in this situation from other projects, so i will try to copy the files from another project and put it in the new it seems like its working as of now but i havent tested it, ill test the smooth sync if this does not work

stiff ridge
#

that's some jump but not as bad as some projects, which still need to update from 1.95 🙂

rich narwhal
#

yeah i tested it still nothing i cant exactly try smooth sync yet as i dont have money for it but, i will see if i got any differences in the projects

bleak delta
#

Is there a way to create custom NetworkVariablePermissions on MLAPI?

#

I know there is a NetworkVariablePermission called Custom but I do not know how to use it

rich narwhal
#

JoinRandomRoom failed. Client is on GameServer (must be Master Server for matchmaking) but not ready for operations (State: Authenticating). Wait for callback: OnJoinedLobby or OnConnectedToMaster. does anyone know why i get a bunch of these, even though i get in the game

jade glacier
#

Are you sure you are in the game?

#

ah, you are trying to do an action that can't be performed in a room

#

@rich narwhal

weak plinth
#

Hey, im trying to use photon pun. and im just testing it out by putting this launcher script on a canvas. I get the "Attempting to connect to master" log but nothing else. i have the right appid and everything. what is it?```csharp

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

public class Launcher : MonoBehaviourPunCallbacks
{

void Start()
{
    Debug.Log("Attempting to connect to master...");
    PhotonNetwork.ConnectUsingSettings();
}

public override void OnConnectedToMaster()
{
    PhotonNetwork.JoinLobby();
    Debug.Log("Joined master lobby.");
}

public override void OnJoinedLobby()
{
    Debug.Log("Joined Lobby");
}


void Update()
{
    
}

}

I put that as a script on the canvas and i only get 'Attempting to connect to master"
i waited like 10 minutes and it doesnt show anything else
thx in advance.
rich narwhal
#

i did this (i had some other things in the script but i beleive this is more of what you need, i was able to connect with this) @weak plinth

    {
        Debug.Log("syncing");
        PhotonNetwork.AutomaticallySyncScene = true;
        Connect();
    }

    public override void OnConnectedToMaster()
    {
        Debug.Log("Connected to master");

        base.OnConnectedToMaster();
    }

   public void Connect()
    {
        Debug.Log("Connecting");

        PhotonNetwork.GameVersion = "0.0.1";
        PhotonNetwork.ConnectUsingSettings();

    }
weak plinth
rich narwhal
#

hmm, for me its around 5 seconds

weak plinth
#

Weird

#

Its been 20 seconds and nothin

#

Syncing

rich narwhal
#

alright

weak plinth
#

Connecting

rich narwhal
#

mmm

weak plinth
#

...

#

I am 100% i got the right appid

#

used photon pun

#

everything

rich narwhal
#
    public void Awake()
    {
        Debug.Log("syncing");
        PhotonNetwork.AutomaticallySyncScene = true;
        Connect();
    }

    public override void OnConnectedToMaster()
    {
        Debug.Log("Connected to master");

        base.OnConnectedToMaster();
    }

    public override void OnJoinedRoom()
    {
        StartGame();

        base.OnJoinedRoom();
    }

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


    public void Connect()
    {
        Debug.Log("Connecting");

        PhotonNetwork.GameVersion = "0.0.1";
        PhotonNetwork.ConnectUsingSettings();

    }

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

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

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

that from the github?

rich narwhal
#

try this its a really basic launcher i found on youtube

weak plinth
#

Let me try it

#

Launched....

#

syncing....

#

connecting...

#

I must be doing smth wrong

#

like maybe with my unity version?

#

or something

#

im runnning 2020.3.0

rich narwhal
#

no its not that

#

if its worth a shot are you connected to the internet

weak plinth
#

Yeah lol

#

150mbps

#

i have no idea

rich narwhal
#

i beleive it might be something outside the script

#

here are my results

weak plinth
#

hmmm

#

well i have the canvas

#

and with the canvas i have that script

#

And thats about all i have so far

rich narwhal
#

hmm i usually put it on its own gameobject seperate in the scene but that would be a almost no chance change

weak plinth
#

I can try that but i dont think that would change it, still in the scene

#

I was just following a tutorial so i thought i might as well

rich narwhal
#

yeah

#

which tutorial

weak plinth
#

Let me get it

#

Support me on Patreon! 👉 https://www.patreon.com/rugbug 👈
Today we're going to be making an online multiplayer FPS game using Photon PUN 2. This isn't just local multiplayer, you can play with anyone all over the world.

I've worked on a few multiplayer games in Unity using Photon before, and decided to make a tutorial series. Hopefully this can...

▶ Play video
#

im on like 6:26

#

more like 6:40

rich narwhal
#

hmm alright since its fps i followed this series a while back and i still use most of the photon parts

#

Welton shows us how to setup Photon Unity Networking (aka PUN) in our multiplayer fps project so we can get into the nitty gritty on Wednesday brah
(JOIN OUR DISCORD FOR A DOPE COMMUNITY, INFO, AND HELP: https://discord.gg/vrErfxa)
(CATCH UP ON OUR GITHUB: https://github.com/Kawaiisun/SimpleHostile)

Over the course of the next couple weeks, Wel...

▶ Play video
#

he has really good tutorials and quite a few of them

weak plinth
#

Should i try that?

#

k

rich narwhal
#

i usually for implementing basic connection between watch 11, 12, 13 and then 14 if you want rpc, then go ahead and skip to 22 for a short bit for a menu

weak plinth
#

Yeah thx

#

Ill try it

rich narwhal
#

the rpc episode is more usefull for if it actually is a gun game

#

and good learning material

weak plinth
#

Yeah

weak plinth
#

hey @rich narwhal u still here?

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



public class TheLauncher : MonoBehaviourPunCallbacks
{
    public void OnEnable()
    {
        Debug.Log("Connecting...");
        PhotonNetwork.AutomaticallySyncScene = true;
        Connect();
    }

    public override void OnConnectedToMaster()
    {
        //Join();
        Debug.Log("Connected");
        base.OnConnectedToMaster();
    }

    public override void OnJoinedRoom()
    {
        StartGame();
    }

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

    public void Join()
    {
        //PhotonNetwork.JoinRandomRoom();
        
    }

    public void StartGame()
    {
        Debug.Log("StartGame was called.");
    }

}
```This is what i wrote
#

Only get connecting*

#

this callback just does not want to do its job ```csharp
public override void OnConnectedToMaster()
{
//Join();
Debug.Log("Connected");
base.OnConnectedToMaster();
}

rich narwhal
#

yes

#

hmm switch enable to awake

#

you are Pun2 correct?

#

@weak plinth

weak plinth
#

Give me a sec

#

my computer is laggin

rich narwhal
#

ok

weak plinth
#

im on 2.29

#

@rich narwhal

rich narwhal
#

alright i figured

#

let me see what a difference could be

weak plinth
#

K

#

take your time

#

thx for helping :)

#

appreciate it

rich narwhal
#

no problem

inland fog
#

Sorry if I am being ignorant but the last time I was involved with network programming was over 10 years ago.
Are "we" still limited to 64 entities in a high-paced action game and a couple of hundred entities when "we" are talking about slow-paced games like RTS and MMO's?

subtle warren
#

Hy guys !I need to spawn different Prefabs, all at the same location on Client.
Let's say server sends : "Spawn Prefab 1" and some time later : "Spawn Prefab 2"... and so on....

Now when I do this, Client says:
KeyNotFoundException: The given key was not present in the dictionary.

Any idea on how to Spawn different Prefabs from Server to Client via TCP-UDP ?
Any help would be more than appriciated 🙂

weak plinth
#

Pretty sure you can have more then 64 as long as your networking sollution lets you

inland fog
#

Yes that is, of course the truth, but there will still be a tipping point where the actual logical design of the TCP/IP stack won't handle any more traffic or the network congestion of the "internet" makes it unusable

weak plinth
#

If you go with something that has you run a server as long as you have good internet you can easily get more then 100 i know for sure

inland fog
#

Yes I have no interest in a peer-to-peer design but a true authorative server-client setup

weak plinth
inland fog
#

Well, I am looking for potentially 800-1000ccu

vast lantern
#

anyone here use mirror?

graceful zephyr
#

@inland fog nothing that exists out of the box for unity does 1000 CCU on a single unity world/instance/etc.

inland fog
#

@graceful zephyr Thank you for confirming this.

graceful zephyr
#

If you put server outside of unity you can get to that

#

But inside unity? espc. classic-gameobject-workflow, not happening

weak plinth
#

whats a good fps tutorial for photon bolt?

gleaming prawn
#

Honestly, you should just line up for fusion

#

Quick video on fusion’s client side prediction, server reconciliation, lag compensation. All with full server authority: https://www.youtube.com/watch?v=MfEbjFH3Zwo&ab_channel=ErickPassos

Core principles to follow when developing a competitive FPS using Photon Fusion. This is the companion video for the "Hello Fusion FPS" sample.

Features demonstrated in this video (all server authoritative):

  • Character controller movement with client side prediction and seamless reconciliation.
  • FPS Camera setup for lag-free controls at rend...
▶ Play video
#

Part 2 will show tick-accurate animation syncing with playables and using that to get each body part injected accurately into the lag compensation system

#

Expected for early next week

weak plinth
#

Hey yall, anyone have experience with sending server to client messages containing SuperMaps from SuperTiled2Unity?

#

I tried to serialize and deserialize using JsonUtility but it wont deserialize the type SuperMap

#

it does serialize however.