#archived-networking

1 messages · Page 96 of 1

weak plinth
#

You know you don't need to take 100% of something right?

#

You can simply look at how they used both a client and a server in the same project

still pier
#

I understand that. Say I wanted to use #if directives. How would I go about doing that?

nimble moss
nova mural
#

Hi Guys, I have the following code with some errors I cant solve. I did ready the documentation regarding it but still I am not sure what it exactly means (or how to solve it). It's Photon Pun2:

#

BarrackItem item = PhotonNetwork.Instantiate(gm.purchasedItem, new Vector2(transform.position.x, transform.position.y), Quaternion.identity);

#

Errors are:
PhotonNetwork.Instantiate: barrackItem ist not available in the global namespace (this only apperas when using photonnetwork.instantiate with only instantiate it is fine)
gm.purchasedItem: conversion of barrackitem into unity.engine.gameobject not possible

stiff ridge
#

The error names barrackItem, which is lowercase. Maybe that's the issue?

grim violet
#

photonetwork.instantiate return a gameobject, barrackitem is not a gameobject

nova mural
#

thank you...yes that is true I have another Script with it being public class BarrackItem : MonoBehaviour

#

is there any way to instantiate like this or however?

midnight bane
#

hey, So when i run the server in unity, it works fine. so i built it i am trying to run the build as dedicated server but i am getting this error. after a few seconds the server becomes active.

Server Thread stopped. That's okay. System.Net.Sockets.SocketException (0x80004005): Operation on non-blocking socket would block
  at System.Net.Sockets.Socket.Accept () [0x00033] in <6b80e2850f1c48e6a227f0818ca6b227>:0      
  at System.Net.Sockets.TcpListener.AcceptTcpClient () [0x0001e] in <6b80e2850f1c48e6a227f0818ca6b227>:0
  at Telepathy.Server.Listen (System.Int32 port) [0x00080] in <f2bef9456cf344faadd577c73c8957f7>:0
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)

What is this, how can i fix it ?

#

i am using telepathy transporter and i have made no changes to the network manager

thick epoch
#

hey, im wonderng if anyone can help with a rabbitMQ implementation issue.

#

so i have this bit of code to retrieve and consume data from a direct exchange queue and write it to a global string globalstr. I am able to get the message into the string, however when i try to display it in a text field, text, it appears in the inspector but not in the field in the scene. Furthermore, when i try to write the recieved message to a file, it is not written. Any advice?

simple yew
#

any good photon pun tutorials out there?

#

i am trying to make a game using pun

jade glacier
#

I would always start with the Getting Started tutorial on the PhotonEngine.com site.

signal oracle
#

@jade glacier thanks for the advice about pun2 man!

#

read it late but right before i started anything on my game

opal tundra
#

Hi, I currently use Photon for a racing game and want to use RPC to create a Dictionnary where to stock player name and time when they end the race but RPC dont like it sad_cat

#

EndRace is another script and Dic into is a static dictionnary

weak plinth
nova mural
#

Hi guys,

I need an advice. Below RPC is doing nothing (not even an error lol), it works for one client but that's it. I am not sure if I am missing a huge thing or if I just use the RPC on the wrong method, but yes I tried and tried and nothing.

On the Gameobject there is a PhotonView which I am ofc calling in the Script.

Code (CSharp):

public void UpdateTheHealthOfKing()
{
view.RPC("UpdateKingHealth", RpcTarget.All);
}
 
 
[PunRPC]
public void UpdateKingHealth()
{
if (isKing == true)
{
kingHealth.text = health.ToString();
}
}

Can't this work for an obious reason that I just didnt understand?

Cheers

paper stone
#

Hello guys, is there any wiseman who had done load testing with Photon Server?

#

I want to do stress testing without real users engagement. Trying to optimize my client-server bandwidth.

stiff ridge
#

@nova mural, I replied to your case in the forum.

nova mural
#

you are everywhere are you 🙂

stiff ridge
#

@paper stone, you can run multiple LoadBalancingClient instances in a single process. Make them act similar to real users and you can simulate a lot of them and analyze stuff. It's probably enough to simulate what is being sent.

paper stone
#

@stiff ridge Ohh, that make sense! Thank you.

stiff ridge
#

There are options to do load tests with server 2 server connections. This will allow even more scaleability. But if you run several clients per process and can distribute this across several machines and networks, you get there, too.

paper stone
#

Gotcha

spring crane
woven grail
#

Hey folks.. not sure if this is the right channel, but in order to have in app purchases and all that, I need a login/database system in place right?

sonic marsh
#

@woven grail yea dont think this is the right place

#

but also i dont belive you need a login/backends/database

#

depends on where your app and dlc is sold by

#

'in app' probably means google and apple, unity have tools for that

zinc hinge
#

Hey guys has anybody any experience with connecting unity to an aws lambda call?

inner walrus
#

How do I teleport players in multiplayer?

glossy dragon
#

Hello everybody.
The project I'm working on connects to an online database. I managed through a PHP call to make friend requests between two users, and I wanted to make sure that if the recipient has the game open, he receives a notification in time in the game settings (maybe just show a red dot in the image, But this is not the point). To do this I thought of starting a thread that remains active as long as the game is open, and every 3 seconds it contacts a PHP page to see if it has received new requests. I was wondering if there is a better way to do this, or if my idea is the most obvious and convenient thing, thanks in advance.

lucid valve
#

or by something like a websocket

#

where when a request comes in you can check to see if that client is actively connected

#

and rather than having the client continuously poll just send a message via the websocket

#

but you should be able to handle this approach just fine with polling

glossy dragon
#

I understand, but I was wondering if there is a more optimized way, because in this case I would contact a web page every 3 seconds, but I could not find other better solutions

lucid valve
#

3 seconds is a very fast poll

#

at that rate you'd be better off doing something like websockets

#

alternatively

#

you can do what's called a long-poll

#

where a client sends you a request

#

and you don't answer it

#

you let it sit on the webserver

#

for a couple of minutes

glossy dragon
lucid valve
#

and then if a request comes in

#

you check against your active long poll clients

#

and respond to the long-poll

#

this is basically the same as a websocket approach just without the active socket

#

there's some really big scalability issues that come into play here

#

idk what kind of size you are targetting

glossy dragon
#

but in this way I only move the therad that has to work on the server instead of the right client? and if I have several clients this might not be convenient for me

lucid valve
#

having an open request doesn't necessitate a dedicated thread

#

you'll want to be using asyncronous responses

#

I have never written php

#

so I have no clue what that would look like in php

#

in C# you could do this stuff using couroutines

glossy dragon
#

ye don't worry about that, but on c# i'd necessitate that thread, even with async tasks

lucid valve
#

well you could just have 1 thread that manages all of them

#

you don't need a thread per client

glossy dragon
lucid valve
#

on anything

#

I'm talking about on the server

#

clients will need a thread that they can send messages from

#

but I don't see a reason it has to block waiting for a response

#

sends request out, each tick checks if anything has come back yet

#

that can be done on any thread

#

not a dedicated thread that just blocks until response is recieved

glossy dragon
#

it kinda make sense

#

but still a little thing is not clear to me

#

i send a request to a php page, making a long poll so the server won't response until it noticed something happened right?

lucid valve
#

yea

glossy dragon
#

on the server side, i will need to check with a while true to see something happening right? like a variable chances to the databse or something like that

#

and that while true will freeze my server, so i'd need a thread for that no?

lucid valve
#

if you chose to write it that way yea I guess you'd need to do that

#

I would personally do something like

#

hash table of userid to long poll

#

when a different request comes in that triggers something related to a user id

#

look up whether or not that user has a long poll waiting

#

then trigger thatlongpoll to continue it's work

#

via a lambda or continuation function

#

depends on the framework

glossy dragon
#

sorry but this is not really clear to me

lucid valve
#

as I said I've never used PHP, it's a really odd choice of language to be implementing this in imo

#

so I'm not sure how to answer further

glossy dragon
#

okay maybe I understand, in the server every time I receive a new communication I save it in a list, and when I check that particular event I check in the list if the communication is present and I reply to that?

lucid valve
#

yea but use a dictionary

#

not a list

glossy dragon
#

yeah

#

dictonary my bad

#

yeah

#

brilliant solution, thank you very much !!

ashen pagoda
#

Hey everyone! Quick question: what networking solution would be best for a modular card game asset (customizable, make your own designs, works for any type of card game) that will be sold on the Unity Asset store?

PUN probably wouldn’t work since you can’t “resell” other asset store stuff. So that probably leaves either Mirror or MLAPI. From what I gather, Mirror is more stable/reliable, but MLAPI is now part of the Unity family so it’ll be the more future-proof option. I’m just hesitant to use it because I’ve been burnt by trying out Unity’s WIP packages before.

So to be concise:

  • Is MLAPI functional and stable enough for a card game system (playing cards, CCGs, etc) that is going to be sold on the Unity Asset Store?
  • Or would Mirror be the better option?
ashen pagoda
#

I did a quick google search and it turned up more tutorials for Mirror than MLAPI, so at the moment I’m leaning towards Mirror. (New to networking so tutorials are a must). But all the same would love feedback from the community on Mirror vs MLAPI for a card game system.

weak plinth
#

How compatible is IL2CPP with directly using the OSSock methods in .Net?

weak plinth
#

I'm wondering if it would work to use the OSSock send/recv functions directly without breaking IL2CPP

prisma warren
#

Are code reviews allowed in here? PUN2 specific

#

LSS: I've made a wrapper class to handle all RaiseEvents and OnEvent() calls. Is there any downside to centralising them in one class instead of having multiple classes inherit from IOnEventCallback?

jade glacier
#

What you do with the events is your business. Pun2 is just a messaging layer when you use it for RaiseEvents. Up to you how to process them.

prisma warren
#

fair enough, cheers

analog venture
#

Can anyone help me here? I've been trying to fix this for a while. I am currently getting an error for my shooting system. spawned object not found when handling command message netid=0
Here is my source code. I'm sure that it's a simple mistake that I'm overlooking since I'm a beginner and I would appreciate all the help.
https://hatebin.com/hclnrtvqvc

#

^^ Mirror in unity

random matrix
#

how do you guys test ur networking? i use parrelsync and its insanely laggy for the unfocused instance

#

it also lags if i build and run and use that as my second instance

prisma warren
#

Desktop + laptop / Desktop + housemate's pc usually

#

Alternatively Desktop + someone on the internet that you've wrangled into being your guinea pig

sonic marsh
#

@random matrix Copy your whole unity project, then in the copy delete the Asset directory and then make a junction link to the original

#

then you can open the 'same' unity project 2ce

#

code and asset changes 'copy' instantly

prisma warren
#

Smort

#

Issue if a build and editor is causing lag tho

#

2 editors would no doubt be worse

sonic marsh
#

mklink /D Assets PATH HERE

#

yea depends on pc specs

#

need a kinda good one to run 2 unity instances

prisma warren
#

That is good though I gotta remember that one

sonic marsh
#

so worth it

#

run that command above in the copy, and change the PATH HERE to the path to the origional assets dir

#

it dosnt work with project setting or the new unity packages

#

got to recopy those

random matrix
#

the issue was the lack of an fps limit

prisma warren
#

that'll do it

floral turtle
prisma warren
#

What's a sustainable amount of network calls per second for something like syncing player movement?

#

IIRC csgo uses 32/64/128 tick servers, is this the amount of network calls they make per second?

dense hedge
#

Tick rate usually refers to the update frequency of the game simulation on the server.
Data can be sent over the network at different rates (often an exact fraction/multiple of the tick rate).
How much is sustainable depends on how much data you're trying to send, how often it updates, and how quickly you can serialize and deserialize it.

prisma warren
#

Thanks @dense hedge I picked 20 per second and it seems to satisfy my needs

unique sail
prisma parcel
#

hello? I want to make an multiplayer game with photon but i never used it.Someone wanna make game with me with collabration system?

oak flower
keen plover
#

Its @prisma parcel but on mobile

#

Im not very good at English idk what do you mean

oak flower
#

@keen plover This is not a advertising board. You can find links where to post collab requests pinned in #💻┃unity-talk

#

Which you've been told already on this account.

keen plover
#

But where is the link

#

Can you send me here

#

The link

#

Thats stupid, why just dont make section for collabration

oak flower
teal obsidian
#

Is a lockstep car going to feel very unnatural?

#

Assuming you're in the < 120ms ping range

floral turtle
#

@teal obsidian there's a lot more to it, but if you want a really rough idea how your game will feel you can just simulate 120ms input latency (buffer your inputs for X ticks before populated them). Lockstep determ is also a pretty big topic, since anything using Unity's physics will not work deterministically for networking.

there are options like Quantum for rollback determ, and you can always just do state sync (send the car positions/velocities over the network) that might work for your use case

teal obsidian
#

Is Quantum it's own physics engine?

#

or does that still use physx?

floral turtle
#

uses its own physics engine, with fixed point numbers (floats are not deterministic cross platform)

#

PhysX will diverge even between intel/AMD, so not an option even with PC only for determinism

teal obsidian
#

Do they have their own version of a wheel collider or something similar to what physx has?

floral turtle
#

not entirely sure. There's been some driving games published for it, but not sure if they used kart physics tricks or have a built in component

pure vector
#

i don't understand why people are still using photon... it uses rpcs which can be manipulated on the clientside

teal obsidian
#

How would you re sync a character controller when doing prediction? Do you just call cc.move multiple times in one frame?

#

I know the process of it, but the docs say not to call cc.move more than once per frame

opal tundra
#

Hi, I'm currently trying to make a firebase realtime database for a game that will store XP and level, but when I want to RootReference the data base it never end

#

It never Debug.Log(...) so DBReference is always == null

#

:/

graceful zephyr
#

Quantum has its own vehicle simulation even, not just wheel collider.

floral turtle
rapid horizon
#

Can anyone help me??? How do i instantiate a gameobjects in my scene with mirror(from the networkmanager spawnables)

pure vector
# floral turtle Photon makes a few different networking packages that handle authority different...

that's interesting is quantum something new they've brought out? previously people could manipulate rpcs with photon which would generally end in situations where they can crash servers or kick players simply because of this for example look at phasmophobia that used rpcs and those could even be manipulated on the api level since unity can be fairly easilly disassembled and reassembled I won't name programs for sake of not spreading it but when your able to manipulate it like that it's an issue mind you that's also partially on unity and while l2cpp is alot more secure for that its still quite easy to manipulate there is actually public tools which can do it as well atm

serene owl
#

Can anyone help? If i have a big project that have a lot of objects in it some which a user might never use should i include everything in the client's side or keep it in a server and send them the object when the client need it (if sending unity object from server to client is possible)

graceful zephyr
#

@pure vector quantum has been out for a while

#

since 2018-ish

pure vector
#

gotcha I've always just used mirror instead of photon so never tried it

graceful zephyr
#

again photon is a set of various technologies

#

photon is the umbrella name

#

photon bolt, photon quantum, photon fusion, photon PUN, photon realtime, photon server, photon voice, photon chat

#

they are all different techs/products

weak plinth
#

What are strategies for syncing AI-entities? Aside from just including them in the snapshot

#

Is deterministic AI possible using Unity built-in tools?

gleaming prawn
#

I mean... determinism is normally all or nothing

#

You can achieve some things like: same decision be made (given ALL of the data you use is very very same - which is a challenge in itself)

#

I would not count on that being a given

#

better just to make bots part of your state... Assuming you have interest management... Should be fine

weak plinth
#

Can result in very large snapshots given many AI-entities, no?

gleaming prawn
#

well, yes and no

#

Depends on:

  • how efficient your snapshots are
  • how good your interest management is (and how well your game benefits from it)
  • how many AI bots
#

But determinism is really a full commitment... if you go, you go all in, there's no mid term...

#

And nothing in unity is deterministic, so if you want to go that route, know in advance that you will give up on:

  • physx
  • unity navmeshes
  • any asset store asset that messes with gameplay
  • float numbers
weak plinth
#

Does Pun 2 free support cross platform multiplayer between Mac and PC

grave ice
#

@weak plinth yes it does

arctic iris
#

Hey guys so im using photon for networking i have everything understood amd working the onpy issue i cant wrap my head around is how to make a party system like in games apexlegends, cod warzone, fortnite where before a match cam be started friends can join and chat and stuff

#

Should i create a room when connected to the master server with custom properties having the name Party

#

And so before the players joins a match room they get removed from the party room

arctic iris
#

#hopefullysomeonereplies 👉👈🥺

shut yarrow
#

You can do that, or just keep them in same room and just start the game when it needs to

#

There is no 'right' way to do it

grave ice
#

Scroll down to Matchmaking Slot Reservation

#

@arctic iris you use a third party service for party, and in Photon you simply create a room with the expected players

west quarry
#

hello, use firebase to make a database of the leaderboard,
In android it works, but when I want to make the webGL version it won't let me do a compilation, can anyone help me?

frank quiver
#

@west quarry the firebase Unity plugin doesn't support webGL, you have to use alternate solution to make firebase available on webGL

arctic iris
#

@grave ice third party services such as? Could i user mirror networking to create the party system and then photon for the rest

#

@shut yarrow i cant do that since i cant join the game room once already in a party/lobby room and when i try to leave the party room to join the game room it outputs and error

west quarry
frank quiver
#

I remember there third party library available

#

try google firebase unity webgl github

west quarry
# frank quiver I remember there third party library available

the only thing I have found is this:https://www.youtube.com/watch?v=fg_aiGVeKc4

Are you looking to develop a WebGL Unity App and you want to use Unity but just found out the Firebase SDK doesn't work? This might solve your problems!


Firebase WebGL Realtime Database library I made: https://github.com/rotolonico/FirebaseWebGL
Firebase WebGL Implementation example: https://rotolonico.github.io/FirebaseWebGLIm...

▶ Play video
frank quiver
high night
#

Should one worry about sending frequent packets
Or is it just about bandwidth i need to worry about?

Is it okay to send some light stuff at higher frequencies while sending the heavy stuff 10hz for example
using mirror rpcs btw, i'll be calling frequent rpcs for the light stuff

weak plinth
#

Frequent packets results in extra bandwidth

#

Since packets have a header

high night
#

I guess i wont have to worry about that as i am packing all these little things into a single rpc
Its always gonna be the same amount of rpcs called per second

weak plinth
#

And if you are concerned about bandwidth, consider bitpacking data

high night
#

bitpacking?

#

like rle compression?

weak plinth
#

Using less precise floats, 1 bit per bool, min/max values etc

#

Results in less data

high night
#

i see

weak plinth
#

At the very least you can use some of the compression algorithms used

high night
#

allright, i won't write my own then

#

i had a something similar going going on in my project but no compression and stuff

arctic iris
#

is it possible to use Mirror Networking to create Party System like, Apex Legends, PUBG, Fortnite, Warzone and use Photon networking to be used as the primary multiplayer networking option since i can't create lobbies/parties with photon

weak plinth
#

Probably

#

But I'd not use Mirror for things like that

#

Since it shouldn't have anything to do with Unity

arctic iris
#

What do you mean exactly by that?

weak plinth
#

I assume you are talking about a matchmaking server?

arctic iris
#

Yes

#

Basically i can't make a lobby system using just photon like in battle royale games

#

Where friends can join u on the lobby scene

weak plinth
#

A matchmaking server doesn't have anything to do with Unity

#

It just tells clients where they can go

#

So you shouldn't make it with/in unity

arctic iris
#

Matchmaking side photon covers doesn't it? When creating rooms and such

weak plinth
#

If they have a matchmaking service available, I'd use that

arctic iris
#

Okie

grave ice
grave ice
#

that room is your lobby scene

#

@arctic iris then follow the matchmaking procces for multiple players, like the guide i sent you yesterday

arctic iris
#

@grave ice i tried that it can't create or join another room if a player is already in one hence being in a lobby room and when i do leave room before joining another it doesn't work and outputs an error which i will show in a bit

patent fog
#

You can use third-party tools like Playfab, Steam API, ....

#

that's only 2 of many examples bringing you matchmaking features

#

If you don't wanna code your own matchmaking server

arctic iris
#

@patent fog talking about Mobile platform!!

patent fog
#

Oh I missed that detail

#

should work though

arctic iris
#

it;s gucci lol

patent fog
#

Or I don't know, go for Google Firebase for example

#

Whatever server tech is easier for you

arctic iris
#

photon is good i just don't know how to make a party/lobby system imma look at it

patent fog
#

Photon has a matchmaking API

#

does not suit you ?

arctic iris
#

yes they do it does but just some technical problems im facing imma post the errors in a bit wait

patent fog
#

Errr I won't help you debug multiplayer, that's time I should spend on my project :p Maybe someone else will 🙂
I guess you started from here https://doc.photonengine.com/en-us/realtime/current/lobby-and-matchmaking/matchmaking-and-lobby

arctic iris
#

haha lol it's ok imma post it so i get help from anyone who can!! and yee

arctic iris
#
public override void OnConnectedToMaster()
{
      RoomOptions roomOptions = new RoomOptions();
      roomOptions.IsVisible = false;
      roomOptions.MaxPlayers = 4;
      roomOptions.CustomRoomProperties = new Hashtable() { { "roomtype", "lobby" } };
      PhotonNetwork.CreateRoom(PlayerInfo.username, roomOptions, TypedLobby.Default);
}

// Player Joined His Own Lobby!!

public override void OnJoinedRoom()
{
      SceneManager.LoadScene("LobbyScene");
}

// On Click Ready Button!!

public void OnClickReady()
{
      PhotonNetwork.LeaveRoom(); //Leave The Current Lobby Room Before Joinning The Game Room
}

// Once The Player Leaves i Join/Create The Room For Game Scene

public override void OnLeftRoom()
{
      PhotonNetwork.CreateRoom("TDM");
}

Operation LeaveRoom (254) not called because client is not connected or not ready yet, client state: Leaving
UnityEngine.Debug:LogError (object)``` @grave ice
arctic iris
spring crane
#

@civic cave Remove the old one when moving questions

civic cave
#

sorry mb

pure trench
#

Using latest Netcode package, can't uncheck any rendering components for server. Is there a step I'm missing?

grave ice
#

@arctic iris yessir exactly

distant bolt
weak plinth
#

Can anyone suggest a networking library I should use right now?
I'm using mirror right now but are there any better alternative like is MLAPI usable right now?

weak plinth
#

Something Photon-related

#

Costs money, but it works

prime stag
#

if (photonView.IsMine && Input.GetKeyDown(KeyCode.Alpha1)) { photonView.RPC("Equip", RpcTarget.All, 0); } [PunRPC]
void Equip(int p_ind)
can anyone tell me what wrong with this the equip does not go through the network

tawdry trench
#

Does anyone who uses Mirror know if there's a way to Serialize a private Sync Dictionary so it shows that read only view in the inspector? [SerializeField] doesn't seem to work, though it shows if it's public

lean mauve
#

What is the multiplayer type of coin masters called? Trying to look at tutorials for this kind of multiplayer interactions

#

All the stuff i can find is either realtime or turn based

pallid atlas
#

Okay so after I imported Pun (Photon Unity Networking) i realized the resources folder that has the PhotonServerSettings isnt there, I re imported Photon again and still not there. What should i do?

#

Photon\PhotonUnityNetworking`Resources\PhotonServerSettings.asset` - That is missing

#

I would also like to note that im on Unity 2018.4.32f1

pallid atlas
#

Okay I got it

#

After a cleared all of my errors in the code, the Photon setup popped up, which created the resources folder and the ServerSettings

vast grail
#

I have a character controller that uses a dynamic rigidbody. Would I run into issues if I were to make a multiplayer game using it?

#

I have no experience doing online multiplayer and was wondering if that's something that would be problematic for online play

teal obsidian
#

@vast grail If you're using prediction on the client then yes, the client rigidbody and the server rigidbody will diverge over time

#

when they diverge enough, you need to initiate a process called "reconciliation". Essentially you just move the character back to the last known position from the server, and then re-play all clientside movements on that rigidbody, all in one frame, from that last movement, up until the client's present.

nimble ermine
#

anyone here good with pun2?

#

I want to make a region change system with drop down, I wa sable to make one in pun classic, when I recreated it in pun2 it would connect to the region but I couldn’t join/create a match

leaden tapir
#

Whats the easiest Networking solution atm?

spring crane
#

PUN is probably the most convenient one to put something together. More expensive Photon products deal with more complex requirements. Mirror's community makes dealing with stuff easier if you are looking for something free.

leaden tapir
#

I quess ill try both then :D

#

Thanks

grave ice
grave ice
grave ice
leaden tapir
#

@grave ice roger roger!

paper stone
#

Hello peeps, do someone know if there is a possibility to test the state synchronization with LoadBalancing tools for the Photon's PUN components?

gilded compass
#

which type of P2P is better can anyone explain me or give me a doc for that ?

weak plinth
jade glacier
#

P2P is just a bad term, best to be more explicit about what you mean by that. Typically people who say P2P either mean Relay (like Pun2) or ListenServers (like Mirror or Bolt where one of the players hosts) @gilded compass

#

There are no actual P2P options with the libraries you are looking at. P2P implies every client directly attempting to connect to every other client.

gleaming prawn
#

So, a bit short notice, but here we go.
I’m starting a regular stream (every Wednesdays and Fridays at 22h CET).
Main topic will always be developing an online game prototype from start to finish:

  • game design ideas
  • discussion of which netcode technique to use (will always be either quantum or fusion, representing determinism and state transfer approaches)
  • implementation of gameplay, view, UI, and other things when apply (matchmaking ideas, spectating, persisting sessions, etc)
    I’ll start today with a guest to discuss game design for the first game (which will be with quantum) and implement a few basics depending on what we decide to create (not defined - whoever joins will participate with ideas).

https://www.twitch.tv/erickpassos76/schedule

Twitch

Programmer, game designer, craftsman.

▶ Play video
patent fog
#

Looking great, looking forward to it 👍

full light
#

where should I get started to add multiplayer support to my project?

spring crane
#

Adding networking to an existing project is the uphill way to go about it

#

Probably wanna get some experience doing some multiplayer projects from scratch. Also allows you to evaluate potential networking solutions

gilded compass
jade glacier
#

Your options are very limited if you don't want to pay anything. Best you will do there probably is maybe Mirror and trying to use Steam's relay service. Which is going to be Listen Server (client hosting) with a relay fallback for nat punchthrough.

#

I don't actually know what people have made work on that front, but if you join the Mirror or Mirage channels they may have some ideas.

#

Mirror has fragmented into three groups as far as I know, so I have no clue what people are using on that front.

gilded compass
spring crane
#

I imagine host migration would be a problem with Mirror.

jade glacier
#

I don't think host migration is something you want to deal with. If the host leaves... just let the game die 🙂

gilded compass
#

I want to make the multiplayer part like Left 4 Dead games one player gonna host and others will join from room loby or something i did an example with photon but i dont wanna use it

weak plinth
jade glacier
#

You probably are working backwards.

#

You have limited yourself to about one type of possible network topography with your budge restriction of zero dollars... so I would first do tutorials with your only options, and see what they are good at and not good at doing.

#

THEN think about your game.

gilded compass
spring crane
#

For a game like Left 4 Dead you probably don't want the match to die

weak plinth
#

^

jade glacier
#

Oh I am sure.

weak plinth
#

Vermintide 2 has no host migration. Which has continuously led to great annoyance of its playerbase

jade glacier
#

Not saying people want that, just that you are bordering on begging chooser here... first see what the tech available to you can do before dreaming up your game.

weak plinth
#

Because if the host ragequits after 15 minutes, gg everyone else just wasted 15 minutes of their time

gilded compass
#

is vermintide dedicated ?

spring crane
#

Doesn't it use PUN?

#

Why

weak plinth
#

Vermintide 2 uses its own engine and netcode

jade glacier
#

You have eliminated like 90% of your network lib options, so see what is left can do first.

weak plinth
#

The netcode is pretty 👌

#

But no host migration ¯_(ツ)_/¯

spring crane
#

Ah. Thought I remembered the name from PUN network culling tips. Maybe it was Vermintide 1?

jade glacier
#

You can make host migration work on any platform, you just may have to do a lot of that coding yourself.

#

PUN doesn't have a host, so migration isn't a thing. The relay is always there as long as there are players. So different animal.

weak plinth
#

Bitsquid engine

#

Apparently

jade glacier
#

What network libraries have you tried making something with so far?

gilded compass
#

actually i just try to make my own dedicated sever with c# and i did also with Photon too but than i realize i dont have a budget

spring crane
#

Oh was thinking Verdun.

weak plinth
#

No idea what they are developing their new game in. Don't know what it's called either

full light
#

i cant even get mirror to show up in unity

#

im on 2020.3.0f1 so asset store is gone

#

on the website i try the open in unity button and it doesnt do anything

spring crane
#

Grab it from the package manager

full light
#

it isnt showing up there either

spring crane
#

Are you viewing "My Assets" on the package window?

full light
#

its set to Unity Registry

spring crane
#

It's not made by Unity, switch to "My Assets"

full light
#

oh i see it

full light
#

so for adding chat how would I do that?

shell shoal
#

Has anyone here used unity collab before? I need some help.

spring crane
#

@full light Looked up Mirror chat tutorials?

full light
#

ill do that now

drifting turtle
#

Hi I am building my own Socket Networking Solution and I basically want to run the project twice on the same machine( using different ports) as I dont have 2 devices. I am able to connect both Games with each other, but as soon as one game is out of focus, it is on hold somehow and the sockets dont do anything anymore until the client that should have received the message regains focus.
I am basically building a fighting game with peer to peer networking for a project

Does anyone know a workaround for this or is my approach generally wrong?

weak plinth
#

Are you sure the game isn't 100% paused once you alt-tab out of it?

drifting turtle
#

I open them windowed beside each other, so i dont really alt tab

weak plinth
#

That doesn't matter

#

Lost focus = lost focus

#

No matter how you achieve it

teal obsidian
#

@drifting turtle Build your game with exclusive fullscreen and it will continue to run in the background

sonic marsh
#

@drifting turtle look into junction links

#

You can clone the unity project and link the asset directory to the original

#

Now you can open 2 instances of unity on the same project

#

And changes are copied

topaz roost
#

Hi, how do you get username and password forms to use unitywebrequest from a website

drifting turtle
high night
#

How does one design a system that rollbacks on states and can also predict object destruction/creation as well?

#

It's very hard to keep track of what object gets created, what object gets destroyed, what objects creation was predicted

#

Unless i send the whole data of all objects everytime/every tick from server, it gets very complicated

#

Any tips/suggestions?

weak plinth
high night
#

@weak plinth Allright, ill check this out thanks

#

Does this also talk about prediction of creation of objects?

#

@weak plinth

weak plinth
#

Afaik, yes

high night
#

I am trying to do a system that players projectiles are handled just like local player, with rollbacks

weak plinth
#

You can throw grenades for instance, so that's prediction of object creation for the client

high night
#

oh, i see

weak plinth
#

They include some data in the header of the state in a very creative way to solve this

jagged lantern
#

Hi, does anyone want to help me create a simple discord bot for our server? I want to be able to pull images random images from Reddit with it, e.g with a command /cat would return something from r/cats

So far I haven't been able to read the reddit API, I am wondering how is this done, I am using Node JS with the Axios package.

I have it setup ATM like

    {
        await axios
        .get('https://www.reddit.com/r/cats/random.json')
        .then((res) => {
           console.log('RES:', res.data[0])
        })
        .catch((err) => {
            console.error('ERR', err)
        })
    } 
#

This returns

RES: {
  kind: 'Listing',
  data: {
    modhash: '',
    dist: 1,
    children: [ [Object] ],
    after: null,
    before: null
  }
}

In the console

#

I am not sure how can I get the "url" that is inside the children array

serene owl
#

Can anyone help? If i have a big project that have a lot of objects in it some which a user might never use should i include everything in the client's side or keep it in a server and send them the object when the client need it (if sending unity object from server to client is possible)

patent fog
#

@jagged lantern children is an array of objects containing among others a data.url (or thumbnail - lots of things in here, dunno if that's the most interesting for you as an image, but it gave me a nice pic of a cat). So starting from your example, smthg like that

else if (command == 'cat')
    {
        await axios
        .get('https://www.reddit.com/r/cats/random.json')
        .then((res) => {
           console.log('RES:', res.data[0])
            // early-exit if no children
            if (res.data[0].data.children.length < 1) return
            // assumed multiple iterations because children is an array
            // but I guess will always give only one as it's a "give me a random one" query ?
            res.data[0].data.children.forEach(child => {
              const url = child.data.url
              // or if you prefer the thumbnail: 
              // const thumbnail = child.data.thumbnail
              console.log(`My nice cat URL ${url}`)
            })
        })
        .catch((err) => {
            console.error('ERR', err)
        })
    } 
jagged lantern
#

Never mind, my bad, I had one equal sign too few

#

I got it working, thanks a lot

#

(message.channel.send(`${url}`));

To actually get it in the text channel

patent fog
#

Other than that, glad you made it work

teal obsidian
#

So for my lockstep car, when I receive the info packet from the server I:

  • Set position of the car to server's position
  • Set rotation of the car to server's rotation
  • Set steer angle to server's steer angle
  • Set motor torque to server's motor torque
#

The only problem is that cars are not deterministic, so after the motor torque, it ends up in a very slightly different position than the server's

#

am I doing this right? Lerp should take care of the inconsistancies right?

#

I watched a tutorial online and they only did position and rotation, but when I do that, the car just doesn't feel right when driving it. It only feels right if you apply steer angle and motor torque

full light
#

i set up mirror in my project and got player movement working

#

but im not sure how to get each player to have their own camera

shut hull
#

I am trying to create a basic program that uses LAN WiFi to link two or more mobile devices but I have no clue where to start. Does anyone have a W3School style link that chould point me in the right direction? Please and Thank You

weak plinth
#

Does anyone know whats the most taxing resource for a multiplayer game server? Im planning on making my game multiplayer and was wondering which resource is most heavily used; cpu, ram, or gpu. Also what is a "good" internet connection for said server?

shut yarrow
#

It heavily depends but GPU probably isn't used that much because the server typically doesn't need to render anything. I'm not saying that it can't be used for other math heavy tasks but I don't think that is very common on a gameserver. How much CPU and RAM is used also depends on how much data has to be processed, and how many operations have to be done with the data. The more connected users you have, and the more operations you have to do on the data, the more CPU it will take and the more RAM you'll need. To give an idea, I know about multiplayer servers that had 150 connected users and they would run on what now would be considered old hardware (this was about 10 years ago) while your typical desktop today would be much more powerful. How much bandwidth you'll need and how fast the network has to be is also very depending on how many users you'll have and how much data they are sending. It's difficult to say because there are so many variables, and the efficiency of how you deal with this can make a big difference. Are you going to use 4 bytes to send someone's age over the network or are you going to use 1 byte because the same number can be represented while also saving 3 bytes? How often are you going to send this data, and how often will you send positional updates? It could be 100 times a second but you might be able to get away with only sending 10 times a second with some clever tricks (or even less depending on the game)

weak plinth
#

wow, thanks

teal obsidian
#

Is there a way that you guys interpolate properly when lerping a visual model to a networked entity? Obviously lerp by itself in update() is pretty useless because of fluctuations in frame rate so I've defaulted to using vector3 smoothdamp with OK results

#

just would like other people's opinions or if there's another method I'm missing

jade glacier
#

That's why most systems use buffers and fixed tick rates

teal obsidian
#

Can you explain a bit more?

#

My system uses a fixed tick rate

#

I think I've asked this question before and people say "just lerp the position" and don't really give any further information on how exactly you lerp it properly

topaz roost
#

How do i get the forms variables from a website to put on the unitywebrequest.post?

arctic iris
#

Hey guys so i have created a lobby using photon chat as @grave ice suggested. All works friends can join the channel of a player but i wanna show everyone the player who joined physically in world space so how can i use photonRPC to show everyone the player Cube for example in the scene

nimble jewel
#

Hi everyone, new to Unity3D networking here, I was wondering what was the recommended system for an instanced game with up to 10 players for an action based third person game. Would it be MLAPI or maybe DOTS?

worthy gale
#

Hi guys, I am here with a bug I can't solve 😦 (using PUN 2 btw)
I've got a button on a scene to create a room, when the user clicks that button the room is created successfully, I know this because OnCreatedRoom and OnJoinedRoom trigger, although they trigger twice for some reason (not sure if this is a problem).
Then I've got another scene where I want to list all the created rooms, on this scene I've got OnRoomListUpdate but this callback never gets called, any thoughts?

toxic zenith
#

I'm using PUN 2 and this ain't working if tried Photon.Pun.IPunObservable and just IPunObservable

#

This is my errors

#

Fixed the issue

weak plinth
#

What's a good way to deal with Tcp Partial sends?

#

Just throw out the client?

charred mason
#

does anyone know of an http client library that allows me to add parameters to web requests? I know i can just tack on "?key=value" to the end of the url but i hate doing that

thorn zinc
#

Are you looking for POST requests? Any Http Client should be capable of that.

full light
#

im using mirror for my project and having some issues. so far i just have it so the player is a ball that can be moved around with wasd physically, for the host this is normal. but whenever a client joins it appears to them very jumpy

this is what it looks like to a client

full light
#

and for some reason the client player moves significantly slower

amber delta
#

where is a good place to start out learning about syncing data to a server - for example, a player is playing a single player game that requires an internet connection only for the purpose of preventing cheating (prevent changing how much money they have in the game etc) ?

grave ice
amber delta
#

that is for sure

#

thanks

grave ice
#

@amber delta not exactly your question but it applies https://www.youtube.com/watch?v=BxQAqADGY_k&t=1900s

This is a deep-dive straight into the guts of running a low-latency multiplayer game, such as a first-person shooter, on a global scale. Amazon Gaming Solutions Principal Nate Wiger dives into architectures that enable you to split apart your back-end APIs from your game servers and Auto Scale them independently. He explains how to run game serv...

▶ Play video
amber trench
amber delta
#

i will do a bit of all of the above 🙂 thank you

full light
#
using UnityEngine;
using UnityEngine.UI;
using Mirror;

public class PropSlot : NetworkBehaviour {
    [HideInInspector] public GameObject model;
    public GameObject propPrefab;
    [HideInInspector] public Text slotText;

    private void Start() {
        slotText.text = model.name;
        GetComponent<Button>().onClick.AddListener(SpawnProp);
    }

    [Command]
    void SpawnProp () {
        RaycastHit hit;

        if (Physics.Raycast(ClientScene.localPlayer.transform.position + new Vector3(0, 5, 0), Camera.main.transform.TransformDirection(Vector3.forward), out hit)) {
            GameObject instance = Instantiate(propPrefab, hit.point - Camera.main.transform.TransformDirection(Vector3.forward) * 2, new Quaternion(0, 0, 0, 0));
            instance.name = "Spawned" + model.name;
            instance.GetComponent<MeshFilter>().mesh = model.GetComponent<MeshFilter>().sharedMesh;
            instance.GetComponent<MeshCollider>().sharedMesh = model.GetComponent<MeshFilter>().sharedMesh;
            instance.GetComponent<Renderer>().material.color = new Color(Random.value, Random.value, Random.value);
            NetworkServer.Spawn(instance);
        }
    }
}``` i have this code but I cant figure out how to make it so props spawn for all clients with mirror
red bough
#

how do i do the network

#

I need help making a P2P connection
When one device hosts, others should be able to connect by "Searching" for a game

elfin cradle
#

Does anyone know a good tutorial series on how to create a dedicated server executable for your unity game for playfab?

patent fog
#

Or do a google search with words you used in your question. Or search for "headless" builds, thats how they are often called

elfin cradle
#

Thanks!

prisma warren
#

I'm trying to run 2 networked editor instances using photon. I've duplicated the project files, and created a symlink for the assets folder. Is that all I need to do?

prisma warren
#

Can anyone put me along the right lines on how to research this topic? I'm trying to create a game that has many NPCs walking around randomly. I want to sync the NPCs positions over a network but I want to remove as much of the bandwidth requirement as possible. Originally I had just sent over the initial seed for spawning them all which worked until it didn't. Useful, but not 100% accurate. I'm struggling to put the question into words that yield good google results. Anyone know of any resources that have attempted similar?

#

Context I'm using PUN if it makes any difference, although I think what I'm looking for is more of a design pattern which I would presume to be framework agnostic

vital hawk
gray pond
full light
#

ah ok

#

thanks

winged ridge
#

I am making a racing game to play with my friends but am stuck trying ti figure out how to spawn everyone on the starting grid

#

My idea so far is to make a lobby and wait for everyone to connect and when pressing the start game button everyone will be sent to a random starting position based on the number of players

#

My questions are :

#

-How can I make a lobby for everyone to join?

#

-How do I spawn players at different loations

bold quest
#

Those questions require quite different answers. For the first one, about a lobby, it's probably larger scope that can be handled in Discord

#

You'll want to pick a networking solution and learn how to make a lobby and server in that, Mirror is a common choice

#

Second question isn't necessarily related to multiplayer. You'll probably want fixed points on your starting grid where cars start. And then yeah, your guess about sending everyone to a random position is a good solution

winged ridge
#

It appears that forgot I to add that I use Photon to handle the multiplayer

slow flower
#

guys i want to ask a stupid question i think but ..... when i type Network in add component i don't see any of network manager or network identity or any of that, so how can i get them or i have to buy a version of unity or what's the deal??

slim ridge
#

Are you following an old tutorial? Unity no longer has it's own networking solution

slow flower
#

so is there any solution? 🤔

slim ridge
#

Mirror is probably the closest to what you're following. Other option is photon PUN2

slow flower
#

which one is the best or it depends?

bold quest
#

Depends

gleaming prawn
#

I'll stream again tonight (regularly every wed/fri, 22h CET): https://www.twitch.tv/erickpassos76
Stream: creating an online "roguelite" on Photon Quantum
Expected for tonight:

  • Animated graphics for character controller
  • Comments on strict decoupling of simulation vs view and other best-practices
  • Playtest with community!
  • Discuss next mechanics to implement with community
  • faster pacing when coding (first stream was a bit slow)
Twitch

Programmer, game designer, craftsman.

▶ Play video
arctic iris
#

Hey guys so i have created a lobby using photon chat everything works friends can join the channel of a player but i wanna show everyone the player who joined physically in world space so how can i use photonRPC to show everyone the "player Cube" for example in the scene to everyone without creating a room!!

analog venture
#

Anyone know the difference between the Unity networking package coming out in April vs Mirror?

gleaming prawn
#

It’s a similar api

#

Joint their official discord, it’s called mlapi

vale furnace
#

Hello guys, has anyone seen this error? Unable to open archive file? I'm using assetbundles

teal obsidian
#

So I'm using the difference of UTC to try to calculate the latency between client and server, so that the client can estimate which tick the server will be on

#

however it doesn't appear that UTC is synced at all. It works fine on lan, but when my friend connects, he's off by like 20 ticks

#

is this normal or does it sound like I'm just doing something wrong?

#

DateTime.UtcNow.ToString("yyyy-MM-dd hh.mm.ss.ffffff"); This is how the server sends the UTC time ^

#

DateTime.UtcNow - DateTime.ParseExact(getData.Time, "yyyy-MM-dd hh.mm.ss.ffffff", System.Globalization.CultureInfo.InvariantCulture); ^ And this is how the client processes the difference

#

I'm probably doing something wrong

#

Client is off by like 200ms. Like it's not even close

slim ridge
#

time will never be sync'd. Each side of the connection can use time in it's own behaviour but the best you can do is bank on time passing for each side at a predictable rate and then fix any drift as you detect it.

teal obsidian
#

alright

#

What I'm planning on doing is when the server detects that client sent a late packet, tell client to increase tick

#

or if hes sending packets too early, tell client to decrease tick

#

I just wanted to make sure I wasn't doing UTC wrong or something

slim ridge
#

i had a lot of problems with that myself and still do sometimes. I run my server(s) in a virtual machine and sometimes that thing has it's time all messed up

teal obsidian
#

Yeah I had a friend run my server in new york, I live in california, and the times are completely desynced

#

and then I restarted my game and it was somehow fixed, then it was broken again even when I was hosting

#

very weird

slim ridge
#

in my solution i throw all the input ahead by a certain amount and when that starts falling behind/getting ahead i do a resync to force the client back into the right sequence

teal obsidian
#

You mentioned you use time, are you using UTC?

slim ridge
#

yeah

#

i just get the now in utc every frame and check whether i need to do another step

teal obsidian
#

ok

slim ridge
#

well, it's a bit more complex than that but it's the general idea 😄

teal obsidian
#

I don't think I do that. I make the server send it's current tick, along with a timestamp UTC and then client uses that to determine how many ticks have passed

#

to estimate which tick he should be on

slim ridge
#

ah, so i guess the key point here is you need them both to determine how many ticks have passed on their own 👍

teal obsidian
#

only the client really

#

but yeah thats the idea

slim ridge
#

if the server doesn't, then he can't have authority

teal obsidian
#

Server ticks on his own

#

so he keeps ticking every 20ms no matter what

#

client just needs to get his packets in by that tick

#

if client sends a packet with a late tick, it gets dropped

#

but yeah UTC is acting very weird despite a lot of people recommending syncing that way.

slim ridge
#

it should be able to run even if the client has his clock set back 3 and a half years

teal obsidian
#

actually I might be doing it completely wrong

#

I'm only doing server->client and getting 1/2RTT from that

#

I think you're supposed to do client->server->client

#

so you know exactly how much time has passed

slim ridge
#

you got a good RTT calculation?

teal obsidian
#

on lan it works

#

but across a network UTC is around 200ms off, when I do the server->client timestamp

#

I'm most likely going to ditch that method all together. I'm most likely just going to have the server send it's un-altered current tick to client, then client applies that un-altered tick

#

then server tells the client to either increase + 1 or decrease - 1 every tick

#

until he's sending ticks at the proper time, not late or early

#

I think that's what unity does with their multiplayer, or something similar but a bit more advanced

#

They only do an initial estimate when the client connects

solid crow
#

Is there an FAQ for this channel? I'd imagine questions like "how do i look into interpolation with Photon PUN" probably get asked a million times a week on here

#

never mind, i have thought of a little workaround but if someone knows of an FAQ still @ me so i can learn things

spring crane
#

Official documentation for whatever package you are using is probably your best bet

graceful zephyr
#

@teal obsidian UTC is not usable for calculating rtt 🙂

teal obsidian
#

@graceful zephyr Thank you

graceful zephyr
#

you need to calculate rtt some other way

#

easiest is to piggyback on your network protocols acks/nacks

#

and figure out approximate rtt that way

teal obsidian
#

can't I just timestamp on the client, send it to server, and have the server reply

#

and just measure the time it took

graceful zephyr
#

yes you can do a separate ping msg if you want

teal obsidian
#

alright

graceful zephyr
#

what are you using ping for?

teal obsidian
#

syncing tick

graceful zephyr
#

ping isn't really useful for most things in networking

#

at least not if ur talking about client prediction

#

server reconcilliation

#

snapshot interpolation

#

etc.

#

that kinda stuff

teal obsidian
#

wait I'm not using pings

graceful zephyr
#

well rtt/ping same thing

teal obsidian
#

I was originally (wrongly) sending UTC timestamp from server -> client

#

and trying to measure latency

#

I'm new to this stuff, thought it would work

#

definitely did not work

graceful zephyr
#

well ping/rtt/latency/etc.

#

is just diff words

#

for same thing

teal obsidian
#

alright

#

My new way of syncing tick, is just to tell the client to either increase/decrease his tick

#

if its too soon or too slow

graceful zephyr
#

some people use ping/latency to mean one-way (which is impossible to figure out without a third party)

#

and some dont, etc.

#

shit gets confusing when there's no standard meaning to the terms

teal obsidian
#

I did however get to test my lockstep cars the other day, when my friend hosted the server on his machine on the other side of the US

#

the delay was alarming

#

then again, it was across the entire US

#

My goal is to move all of my vehicles from physx to something more custom, with the hope of getting better prediction going

#

I've found that physx sucks for doing anything prediction, but that's just my personal opinion

graceful zephyr
#

oh no it 100% doess

#

it's shit at it

high night
#

I have system as such:
Rollback for local player and local players projectiles or things local player instantiate
Snapshot interpolation for others

What kind of callbacks would you want to have per networked component in a system like this?

#

its looking like this for now, this is the base class for my objects components

#

i am wondering what you guys would do

high night
#

i made these serialization functions so i could easily rollback local player or update remote players

#

but now, i wanna sync some delta-based stuff (that doesnt get predicted ever)
the way i'm going with this, i'd have to define a new function to use the BinaryReader

#

or should i keep delta based stuff in another system

#

like for inventory system

tulip ledge
#

Hi,

I'm trying to figure out what a proper solution would be for creating a lobby and from the lobby users can create there co-op game, when starting a game I want a dedicated server to get started were the users in the co-op party connect to. Once everyone leave the server will be closed again and progress is saved.

The questions I have is,
How to approach the logic of setting up a way to start dedicated servers and close them when needed

glacial sierra
#

Anyone have experience with photon pun 2 and physics?

slim ridge
teal obsidian
#

So say I have a client who's ping fluctuates between 50-53 milliseconds which always causes him to re-synchronize his tick with the server, in order to get his packets in on time. will that cause problems like jitter?

high night
#

@teal obsidian if you have a timestamp for each packet and do that different interpolation i was talking about, you wont have issues with that

teal obsidian
#

I would only be worrying about client prediction for this problem mainly

#

predicting the main player

high night
#

you have your time deltas fixed?

#

when you wanna do prediction via simulation,
you wanna have your world running on integer time

#

and you should not use deltatime in your logic code

#

or use a fixed delta time

teal obsidian
#

alright

high night
#

@teal obsidian and inputs should also be timestamped with same integer time when you send them to server

#

server should execute them at the right time

teal obsidian
#

All inputs are stamped with a tick number, I'm not sure what you mean integer time

#

unless that is what you mean

high night
#

yeah that would be it

teal obsidian
#

but yes, my client does try to predict which tick the server will be on by the time it receives the packet

high night
#

your networking solution should provide a networked time

#

you should be able to see servers time

#

and then you could figure out what tick server is on

#

and you should know a client time offset from recent roundtrip delay averages

#

and you could figure out a target client tick

teal obsidian
#

I don't do it based on roundtrip time. My server tells the client to either increase or decrease the tick

#

if hes sending late or early

#

its extremely accurate that way

#

That's where the problem stems from though. If the client, somehow, has his ping increased/decreased by 1ms and is now sending late ticks, and has to resync every few seconds

#

will that cause issues?

#

obviously that would be sort of rare, but still

high night
#

can you maybe put the client 100ms further in time?

teal obsidian
#

Preferably not, since cars aren't predicted

#

definitely going for responsiveness

#

It might not be a massive deal

high night
#

i mean for predicted cars, client is ahead of time no?

#

its not?

teal obsidian
#

cars are not predicted

#

only player on foot

high night
#

yeah yeah my bad

#

maybe you are just talking about natural network jitter

teal obsidian
#

I don't think it's going to be a problem for interpolated entities, because they don't rely on ticks, they just get the latest packet from the server and instantly apply it

high night
#

maybe you just need to seperate local characters visuals from logicals

#

and make visual object lerp follow logical one

teal obsidian
#

Yeah thats what I do

#

now that I think about it, it might not be that big of a deal

high night
#

that advanced lerp should also be used there

teal obsidian
#

alright

high night
#

the simple lerp behaviour changes when packets arent arriving with good timings

#

that advanced lerp would be immune to it

#

but i dunno, my local players predicted ticks are smooth even without any of the these lerps
@teal obsidian

#

client executes its ticks in a smooth manner

#

in my case

teal obsidian
#

Have you tested over a real network?

high night
#

yeah

teal obsidian
#

and have you measured how often the client needs to recalculate its tick to match the server?

high night
#

client recalculates every client tick

#

from roundtrip

teal obsidian
#

ah I see

#

if that's smooth for you, then I don't think I'll be faced with much of a problem

high night
#

clientOffset = rtt * (1/2) + tickTime * 1.5f

#

its like that but it also lerps to target

teal obsidian
#

Do you know about how often you reconciliate your predicted player?

high night
#

@teal obsidian everytime server sends a stream

#

or world state

#

i dont care about it now

#

i can optimize later on maybe

teal obsidian
#

Do you use physx for movement?

high night
#

yeah

teal obsidian
#

Ok

high night
#

i reconciliate 30 times per second pretty much

#

for local player

#

and its projectiles

teal obsidian
#

That seems like a lot for physx

#

you might run into performance issues down the road

#

I noticed tons of spikes when reconciliating every tick on a single rigidbody

high night
#

projectile would be something like an arrow or spear though

#

logical tickrate is 30 anyways

teal obsidian
#

yeah

#

If I were in your position, I might just do the "fire arrow" animation predicted and let the actual arrow be serverside

#

might save you some headaches down the road

#

but you know your game better than I do 😉

high night
#

@teal obsidian well lets say the arrow missed on client

#

and on server it sticked on a character

#

id want to reconciliate that arrow to stick the character and play the blood effect

#

and while doing all that, i dont want to know about networking at all

#

in my "world", objects dont know about network stuff

#

they dont even know if they are on client or server

#

they just have a bool "isSimulated"

teal obsidian
#

hmm thats an interesting approach

high night
#

and you can flip it on and off at will

#

you can turn some other renote character into predictive mode

#

though i will probably never use that

#

but it would be useful for accurate physics interactions

teal obsidian
#

because for rust, they do have spears and arrows, and the animations are all predicted, but the actual thrown spear and arrow is all serverside

#

same with any thrown object or bullet

#

I would love to predict more stuff on my client, but physx is just way too heavy on the CPU

#

unless im just misunderstanding your approach

high night
#

i will have to do different stuff for fast firerate guns for sure

#

its gonna be costly

#

at some point my objects will have to know if they belong to server or not i guess

teal obsidian
#

definitlely interesting

high night
#

i like that for now, when local player wants to spawn a projectile,

it just spawns it through a special function

#

and theres nothing more to it

#

when server spawns the same thing, the object knows its pair on server

#

.
you are basicly predicting object creation

#

can predict destruction too

#

by just destriyong the projectile on contact with something

#

object creations and destructions are included in rollback and reconciliation

teal obsidian
#

Have you benchmarked the results yet?

#

through the profiler

high night
#

my pc doesnt seem to have any issues

#

its just for one player anyways

#

all the prediction is around one player

#

and instantiation/destructions are pooled when possible

#

my pc doesnt have any issues with that, i havent checked what the profilers doing

teal obsidian
#

alrght

high night
#

ill try on a small laptop

#

but i doubt bottlenect will be the predictions or physics

#

although, i am not very happy about the way i implemented all these
i assume the memory access isnt very efficient when you are iterating gameobjects and monobehaviours for serialization

teal obsidian
#

well keep me posted because I'm definitely interested to see how physx performs in that matter

high night
#

they are just mere frictionless and sometimes collisionless spheres and capsules

#

i doubt physx will give me any performance issues

steel lotus
#

whats the best way to store objects on a multi-client/server game?

i’d assume things like game maps, entities and game data needs to be stored on the server side and each client would connect to it, whereas clients would store sounds and textures.

what would be a good approach to do this if each client needs to regularly grab things from the server? should i create an FTP server for each client to connect to?

opal kite
#

How to Destroy a GameObject on the server and all clients?

high night
#

@opal kite if that gameobject has a network identity or something, you probably need to use your networking assets methods to destroy it

#

more advanced:
if that object doesnt have any networking asset related components, you'd need to call an rpc on some object with network identity and from the rpc parameter you need to figure out to destroy that object

opal kite
#

that does not appear to work

high night
#

what did you try

opal kite
#

the stuff you said above

high night
#

i said two ways

#

which one are you trying now

opal kite
high night
#

@opal kite the object should also be spawned with assets methods

#

you using unet?
unet is outdated

#

unet guys have been switching to Mirror now

opal kite
#

ok, so now I have to learn another thing

#

thanks

high night
#

@opal kite Mirror api should be same as unets

#

except you "import Mirror;"

opal kite
#

yeah i just added it

high night
#

they have thier own active discord

opal kite
#

I don't know how people make complex games. It takes me a long time to make simple stuff.

high night
#

it helps to know what you want in the beginning

#

and plan ahead

#

i think one should be making like a "core system"

#

that provides all the complex functionalities with simple interfaces

#

and then you build the game on top these "simple interfaces"

opal kite
#

oh great, changing out the NetworkIdentity components is going to be tedious

high night
#

@opal kite you got many prefabs?

#

I'd hold back creating content until i am sure i will be able to do anything i want with my simple interfaces

opal kite
#

A few, but there are a lot of scripts that require a NetworkIdentity, and it looks like I have to remove and re add them all.

#

curious what qualifies as a simple interface

#

fewer than 10 stubs

high night
#

@opal kite like for example

#

a character

#

it should take some inputs and do its thing

#

inputs should be Vector3 movement,look bool attack,jump etc etc

#

.
another example, if you want server authority projectiles and damage, you'd wanna do something like a projectile system

#

ProjectileSystem.ShootProjectile(projectilePrefabId, pos, velocity, isServerOrClient);

#

It should "spawn" a netobject on server
and it should just instantiate a dummy object that looks the same for client

high night
opal kite
#

it seems like what you are calling an interface is a class that contains some [Command]s

#

or multiple classes

high night
#

what i mean by "interface" when i say simple interface doesnt refer to c# interfaces

#

im just saying simplify your access inbetween your logic

opal kite
#

so far, i have a controller, which contains a [Command] for each action available to the Player object

#

the [Command]s execute server side logic, which then executes a [ClientRpc] to update the clients

high night
#

a controller seperate from character that calls commands from local player?

#

that sounds good

opal kite
#

It is a component on the player GameObject. It maintains some state to determine which actions are available. It checks isLocalPlayer, and only calls [Command]s if true.

#

The commands reference other components that are on the GameObject.

high night
#

@opal kite hm, i usually seperate it to a playercontrol object
that also handles the camera stuff in Update

#

my character logic doesnt know anything about camera

#

just takes in a look vector

opal kite
#

i guess there aren't any channels for streaming

#

it would make it easier to explain things

high night
#

just send ss if you need to its easier for me

#

shift + windows key + s

opal kite
#

i need to finish re adding things first

gleaming prawn
#

Friday, 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:

  • simple physics-based ranged attack
  • UI with nickname, healthbar and damage received
  • (if enough time) physics based rotating door
  • Playtest with Audience (again)!
Twitch

Programmer, game designer, craftsman.

▶ Play video
wide birch
#

Hello everyone ^^
I'm using Mirror Networking for a multiplayer game but I'm stuck on a big issue. Just for you to be sure, I asked help on Mirror discord but no one responds ... I try my luck here

I'm wondering how to reconnect to a server without losing the authority on the player object ? Is that possible ?

Thanks 🙂

red bough
#

UUID binding?

winged ridge
#

I have another problem with Photon Pun (classic)
This is the first time testing if the multiplayer works and when I join with a second player in a game, that second player can't move and also the 2 players can't see each other
Its like they are on totally different lobbies but they are not because the one that joins second always can't move

placid gulch
opal kite
#

i converted to mirror and now im getting exceptions in UnityEngine

#

a great asset

placid gulch
#

join the mirror discord

#

the engineers are in it and are of great help normally

teal obsidian
#

Is it common for a server to ever become overloaded and get stuck processing packets at a lower tickrate?

#

what do you do then?

#

like if the updates per second on the server ever drop below the tick rate (mine is 50hz but I'm probably going to lower to 30hz because of this problem in general)

teal obsidian
#

Same with client, what if his game is running slower than the tickrate?

#

like I think source engine has the capability of having the client run at different tick rates, but then the client and server would always be out of sync?

arctic iris
#

is there a way to sync an object across all clients inside a photon chat channel other then being in a room an using photonnetwork

nimble ermine
#

anyone knows why when connecting intially it just shows the name but when changing region is shows a /*

#

using photon

frank edge
#

Hello!
I'm searching for a Networking solution that supports P2P, has no CCU Limit (or CCU limit should be really high) and cheap or free. Can somebody help me out? 😅

patent fog
frank edge
#

Yep, i tried. But sadly it's heavily limited to 20CCU.

patent fog
#

How many users do you have/expect ?

#

(also, spoiler alert, but solutions with "unlimited" and "free" in the same sentences are scarce)

high night
#

@frank edge steam?

#

mirror should be easy get to work with steam transport

frank edge
#

what? does that exist?

high night
#

@frank edge steam?

#

steam gives you free p2p relay

#

as long as your game is on steam

#

or not, if you use a spesific steamapp id 480

#

you can use steam relay while you develop your game without the need of releasing on steam

#

if you choose that steamapp id, you will be looking to be playing "spacewar" on steam

#

and you will be able to join your friends and stuff

#

there arent any limits to ccu even if you dont release your game and keep using "spacewar steamapp id"

#

only thing is you need every player to be logged in on steam

frank edge
#

well i'm not planning to put my game out on steam

#

it costs $100 :/

#

i'm on really low budget.

high night
#

you dont have to until you wanna release it
@frank edge

#

you can still use the relay for free

frank edge
#

that will work if i post it on itch.io?

#

and not on steam?

high night
#

probably not a good idea for itch io

frank edge
#

well it's the only free platform that i know

high night
#

you should probably host a server

frank edge
#

i can't really.

#

low budget :/

#

that's why i'm trying to make a p2p network game

high night
#

you sure you will surpass 20ccu?

#

its pretty difficult

frank edge
#

well yeah, sometimes but not always.

#

ccu is concurrent user, am i right?

high night
#

yes

#

people playing your game at the same time

#

its hard to get 20 of them at the same time

frank edge
#

so max player is 20
yeah i would may pass that sometimes, but not always

high night
#

you should be able to run up to 100 ccu with free photon
@frank edge

#

if you host the relay server yourself that is

#

it should be less costly than hosting the game

frank edge
#

wait, how?

#

photon's free ccu is limited to 20 as i know

high night
#

i am looking for it now

#

it should let you have up to 100ccu if you host the relay server yourself
@frank edge

frank edge
#

how can i host the relay server myself?

high night
#

hmm, i cant seem to find it, they may have changed it

frank edge
#

well yeah it seems to be paid

high night
#

its the cloud option, i cant find what i'm looking for

frank edge
high night
frank edge
#

found it!

#

yep

#

what does that mean?

high night
frank edge
#

yep

high night
#

oh wait

#

i see now

#

no idea what that means at all

frank edge
#

yeah i downloaded the license. what should i do now?

high night
#

i dont know, i never used these

#

i am more of a mirror guy

frank edge
#

hmm lemme google it

#

mirror is not p2p, right?

high night
#

nope its not

#

well

#

it should have transports doing p2p

#

mirror has many transports

#

what i'd do with my game is, let people self host

#

and use a list server

#

when you host a server, you publish your ip to a list server as long as your server is active

#

when a player wants to join a server, list server lists the ips of available servers

#

and client uses those ips to directly connect to host

frank edge
#

yeah that's kinda like p2p.

high night
#

if you wanna host a game yourself in that scenario, you'd need to have a static ip or do some port forwarding and stuff i think

#

it should be like hosting a minecraft server

frank edge
#

oh.. yeah i don't want that.

#

is there's any other way?

high night
#

just take the 20ccu deal imo

#

if you can surpass 20ccu, i think your game is already at a point that can be monetized to cover the costs

#

or get a publisher or something

#

it means the game is good

frank edge
#

well yeah but the next deal is around $99, i don't think that my game would collect that

#

well i'll just try out Forge, as i know it's pretty simple and supports p2p

high night
#

@frank edge how does forge work?

#

is it completely free?

frank edge
#

yep.

high night
#

any ccu limits?

frank edge
#

i didnt saw ccu limit here

#

not sure there's ccu

#

no ccu limit

#

p2p

high night
#

if you wanna do simple p2p like that, it often means the packets are going through some server

#

so you occupy that servers bandwidth

#

i wonder how this forge works

frank edge
#

yep, same.

#

brb, i'll read some docs about it

high night
#

perhaps with forge, you are required to run the relay server yourself?

frank edge
#

hmm i'm not sure about that

high night
#

well, there's got to be a catch

frank edge
#

yeah

#

but i can't find it

tulip ledge
#

Got a question just started using mirror and I'm having a weird issue.
Found no receiver for incoming Command [-162642072] on Capsule(Clone), the server and client should have the same NetworkBehaviour instances [netId=2].
One client & host and the other is just the client, everything works fine until I add on a networktransform.
Kind a clueless why mine is not working. I've added the player in the networkmanager

frank edge
#

it needs port forwarding

#

like for a minecraft server

high night
#

so you host like you'd host in mirror in the background

#

but the rest is made easy

frank edge
#

yeah

#

soo... it's kind of impossible to make a p2p game for free in unity?

graceful zephyr
#

absolutely not

#

just make p2p tech yourself

frank edge
#

well yeah haha

#

but i don't really know how does it works

#

and i didn't found any docs or something helpful for that

onyx venture
#

i have a question about CCU in Photon Bolt
i'm sure this question has been asked somewhere sometime but I can't find it anywhere.
Do offline players in a Photon Bolt game always count towards CCU?
I just want people to play offline most of the time but when they need online functionality, then they can use it, i'm sure i can even get away with 20 CCU in that case.

#

I could even try to make a workaround to deactivate Bolt altogether when I don't need it.
I'd just like to know if it's possible.

weak plinth
#

Is there a lesson on how to use raknet networking?

weak plinth
frank edge
#

?

#

yeah idk how to use selfhosted costum servers and sounds like it would took a lot of time

weak plinth
#

If you have a server 100 ccu is free, but you should get 20 CCU for the server to be free.

weak plinth
frank edge
weak plinth
#

windows server

frank edge
#

do i have to run something 24h/day order to work?

weak plinth
#

no

#

for 1 month

#

you have to pay every month

frank edge
#

yeah that's the problem
i'm on low budget.

weak plinth
frank edge
#

well around maximum $5.. but it's mainly for advertising the game. really really low budget.

weak plinth
#

nice

#

As you start to make money from your project, you will grow it

frank edge
#

i was thinking about to start making courses or beginner tutorials to get some money for server hosting, but there's too much of them.

weak plinth
#

that's enough for now

frank edge
high night
#

thats what you get with relay servers

weak plinth
#

I can tell you a few alternatives

frank edge
#

well i'm currently thinking of getting a host for cheap or free and write this code and send to them
https://www.youtube.com/watch?v=uh8XaC0Y5MA&list=PLXkn83W0QkfnqsK8I0RAz5AbUxfg3bOQ5

In this first part of my C# networking tutorial series, we set up a TCP connection between a dedicated server and a Unity client.
If you get stuck or have questions, ask them on my Discord server: https://tomweiland.net/discord

Kevin Kaymak's channel: https://www.youtube.com/channel/UCThwyD-sY4PwFm7EM89shhQ
List of commonly used ports: https://...

▶ Play video
weak plinth
#

Ccu capacity of mirror networking is low

frank edge
#

it's not mirror

#

as i know

#

not sure tho

weak plinth
#

I said for the previous

frank edge
#

oh

weak plinth
frank edge
#

yep

weak plinth
#

nice solution

high night
#

isnt the fundamental problem here the regular players needing to do port forwarding?
cant get around that even if you write your own server

weak plinth
#

for p2p?

frank edge
#

it's p2p?

high night
#

you dont want p2p?

frank edge
#

i do!

#

but not sure this is p2p

weak plinth
#

no

frank edge
#

it's not?

weak plinth
#

I guess not

frank edge
#

ahhhh... that sucks!

#

not sure what to do then.

weak plinth
#

not maybe p2p

high night
#

@frank edge how do you use your networking assets?

#

how do you implement your netcode

#

i pack all my data into bytestreams

#

and send em via rpc

#

if you do it like me, its very easy to switch networking assets
so none of my netcode cares about the networking asset im using
except the IO part

frank edge
#

well

high night
#

in that case, you'd just start out with photon 20ccu

#

and then decide what to do next later on

#

imagine only using 5-6 rpcs/commands only

#

.
learning the advanced ways of the networking asset can be pain in the ass i suppose (i remain a mirror noob)
writing your own serialization can also be a pain in the ass depending what you want

frank edge
#

well yeah it really seems like it is

high night
#

if you got some programming and and debugging exp and you wanna deal with all that, that could be pretty nice to do it like me

weak plinth
#

or raksnet , forge networking

frank edge
#

i used forge but it's not p2p as i know

weak plinth
#

do you want p2p

frank edge
#

pretty much

#

its cheap

weak plinth
#

I hope I find a solution

high night
#

you'd probably wanna do some custom serialization anyways if you need some more advanced predictive networking architectures that lets you
have full server authority with no client input latency

frank edge
#

well no input latency is not that important, but would be good if it would be around mid- or low.
and umm i'm not that advanced in network coding so i want to find the most cheapest and flexible/easiest mode to implement multiplayer networking for my game.

weak plinth
frank edge
#

yeah found that but it's kind of outdated.

weak plinth
frank edge
#

well true. but i didn't found any documentation how to really use it.

weak plinth
frank edge
#

well do you know anyone who understands it?

weak plinth
#

i know a little

frank edge
#

oh

weak plinth
#

i guess yes

frank edge
#

yeah haha

weak plinth
#

I will examine it myself

#

If I can't find it, I'll tell someone

frank edge
#

WHAAT

#

does it has any limitations?

#

or is it paid?

weak plinth
#

I do not know .d

#

pls wait

#

I couldn't find any pricing

weak plinth
frank edge
#

I'm sure that there's some limitations for that

#

whaat

#

it's completely free and no limitations at all, with p2p support?

weak plinth
#

yep p2p

frank edge
#

This is heaven

#

dang i hope it works

weak plinth
#

God willing

haughty heart
#

Please don't post gifs*

weak plinth
frank edge
#

nope, you can restrict only photos.

#

as i know

haughty heart
weak plinth
#

i understand

frank edge
#

@weak plinth are you online?

gleaming prawn
#

P2p how? Does it provide a punch through signaling service? Doubt it.. does it include a relay fallback for the 15% cases where punch does not work? Doubt it...:)

#

Seems like the last commit was in 2017 with all issues reported left open

#

Does not look like something useful (have never seen this being mentioned before)

frank edge
#

so.. no p2p?

#

hmm..

gleaming prawn
#

It’s not about no p20

#

P20

#

Sorry, phone

#

P2p... what I mean is that this is a lot more complex than downloading a lib

#

P2p online requires a service (punch through only works if you host a signaling service + a relay fallback for the cases where punch does not work)

#

I believe that library is talking about P2p on a local network (this is easy, and actually not really useful for games)

frank edge
#

yeah that's what i was going to tell him about haha
Forge is a library with P2P support, but it's local too..

gleaming prawn
#

If you want just to have p2p, why not just use steam networking? That one includes everything I said

frank edge
#

because i want to upload the game on itch.io.

gleaming prawn
#

Well