#archived-networking

1 messages · Page 72 of 1

amber trench
#

since you're using UDP, you will be in sad town in terms of making this easy for you

#

there's no agreed upon UDP in-message routing standard like there is with HTTP, which can be used with websockets to easily achieve "connect two people to the same game computer, even though they always connect to the same load balancer computer in front of the game computer"

#

what do really big companies do? they either (1) write an in-message protocol, which is burdensome with UDP, (2) buy a lot of IP addresses 🙂

tired raptor
#

@amber trench thanks for the explanation :)
What I understand from you is that it is challenging to create your own networking layer upon udp (so that it will be reliable as much as tcp or close to it) - but its kind of the same challenges as in the software industry. Lets say if I'd built a real time location app upon udp where you can see everyone of your friends. How does this challenge differ for the gaming industry I still do not understand.

#

You will never aspire to save the entire memory state, you would like to save the only things you need of-course

gleaming prawn
#

Saving entire game state highly depends on the type of game

#

Photon Quantum (disclaimer: I'm one of the devs of the engine) gives you that out of the box (full game state save - cross platform serialization of the ECS state).

#

So for us, it's a matter of storing a Byte[] somewhere, then you can restore and continue a previous game... No problem.

tired raptor
#

Entire game state? whats the limitation?

gleaming prawn
#

Well, that you need to write your gameplay in quantum. Expected limitations for games written with deterministic predict/rollback. Not really suitable for an MMO with a few hundreds or thousands of players in the same location, etc.

#

But other than that, not much. It's pretty easy to save full game state and "continue" (it's even game-agnostic).

#

This is also the basis for killcam replays, late-joins, etc

#

The ability to save and restore a full game state

tired raptor
#

Really cool, Gonna check Quantum

#

In like one sentence how does it differ from Bolt / Pun

#

Sorry for making you write a lot :]

gleaming prawn
#
  • Quantum is a game engine (deterministic), Bolt and PUN are networking add-ons
#

So, it's a completely different approach for everything

gleaming prawn
#

With quantum, unity is used as the runtime for rendering/sound/UI (+ editor tooling), but the whole game simulation (entities, logic, physics, navigation, AI, etc) is implemented on top of Quantum ECS API

frozen canopy
#

Hello, i migrated from photon 1 to photon 2

#

and this error occurs me

#
List<Photon.Realtime.Player> newPlayerList = PhotonNetwork.PlayerList.ToList().OrderByDescending(x => x.GetScore()).ToList();```
#

It gets error in GetScore()

#

it seems its not in Photon PUN 2

jade glacier
#

Not a lot of info to go on there. Is PlayerList a thing in PUN2?

#

It is

#

ToList() isn't an option though, not sure what that is

#

Some Linq thing?

#

No idea what GetScore() is

#

yeah, that is all Linq... can't help you there sorry

hollow pelican
#
        +
            text
            +
            "/quote/?token=Mytoken```
#

this works

#

string url = "https://cloud.iexapis.com/stable/ref-data/iex/symbols?token=Mytoken"

#

this does not

#

working one calculates the value of one share of a specified stock

#

the other is supposed to give me all the listed stocks names from the api

#

I have determined that the problem is the json format

#

{"symbol":"NTDOY","companyName":"Nintendo Co., Ltd.","primaryExchange":"US OTC","calculationPrice":"previousclose","open":null,"openTime":null,"openSource":"official","close":null,"closeTime":null,"closeSource":"official","high":55.23,"highTime":1587585583000,"highSource":"15 minute delayed price","low":54.64,"lowTime":1587562278000,"lowSource":"15 minute delayed price","latestPrice":55.12,"latestSource":"Previous close","latestTime":"April 21,

#

that is the json response from the working api call

#

[{"symbol":"A","date":"2020-04-22","isEnabled":true},{"symbol":"AA","date":"2020-04-22","isEnabled":true},{"symbol":"AAAU","date":"2020-04-22","isEnabled":true},{"symbol":"AACG","date":"2020-04-22","isEnabled":true},{"symbol":"AADR","date":"2020-04-22","isEnabled":true},{"symbol":"AAL","date":"2020-04-22","isEnabled":true},{"symbol":"AAMC","date":"2020-04-22","isEnabled":true},{"symbol":"AAME","date":"2020-04-22","isEnabled":true},{"symbol":"AAN","date":"2020-04-22","isEnabled":true},{"symbol":"AAOI","date":"2020-04-22","isEnabled":true},{"symbol":"AAON","date":"2020-04-22","isEnabled":true},{"symbol":"AAP","date":"2020-04-22","isEnabled":true},{"symbol":"AAPL","date":"2020-04-22","isEnabled":true},{"symbol":"AAT","date":"2020-04-22","isEnabled":true},{"symbol":"AAU","date":"2020-04-22","isEnabled":true},{"symbol":"AAWW","date":"2020-04-22","isEnabled":true},

#

that is the json response from the non working api call

slim ridge
#

looks like it's working fine

hollow pelican
#

it is on google

#

not in unity

#
public class Finance
{
    public Stocks[] stocks;
}
[System.Serializable]
public class Stocks
{
    public string symbol;
}
[System.Serializable]
public class Prices
{
    public double latestPrice;
}
#

public class Stocks
{
public string symbol;
}

#

is used for the non working part

#

when I call the non working api it returns object not set to the reference of an object

#

the other api call returns $45

#

or whatever nintendo's stock is worth

#

I think public class Stocks
{
public string symbol;
}

#

is the problem

#

but i don't know how to fix it

#

anything else needed?

#

plz

eternal heart
#

Hello, not sure where i can post my question, tell me which channel if its not good here.
I develop a game on Unity with fast balls bounce on another fast objects in movement (the term is : "Non-Deterministic" if i understood), like a Pong for explain simply but its not that at all..but same situation but very fast.
Then i need to know which techno Networking solutions you advice for that ?
Thanks you

jade glacier
#

For snapshot interpolation - In the case of pong, one strategy is to take advantage of the deterministic nature of the ball. It will bounce and move in a predictable way, except when it hits a player paddle. So you can shift the local ball's timeframe as it moves from one side to the next. You use RTT or the tick differences to figure out how much to advance the balls simulation. @eternal heart

eternal heart
#

Ok but i do that with whatever the Networking Framework ? which is optimize for this gameplay-issue ?

eternal heart
#

@jade glacier and we talk to me about "Lockstep system", what do you think ? Do you know ?

amber trench
#

@eternal heart emotitron is sort of describing the "right answer" for pong, in terms of how you do that game multiplayer

#

it's kind of your responsibility to turn that abstract but correct solution into, commands between two processes on a computer

#

it's really challenging to make a game like Rocket League

#

but it has some important similarities, a lot of it is just understanding where you can hide latency

#

these are really high level concepts, networking libraries don't solve these problems for you

eternal heart
#

Hum ok :/

#

Thanks for answer

unborn spire
#

hi, i have script throwing a out of memory error, only i have plenty of free memory... anone ever seen it do that?

gleaming scarab
#

Probably out of bounds error?

safe drift
#

I have managed to get a message from the game that the form upload is complete, but when I checked at the database, no data was displayed in the table. How can I check if there are errors in the php side of things when I sent the data.

grave moon
#

I am trying to get a VR multiplayer setup quickly with the possibility to join a running session and thus preserve/reconstruct room/scene state on joining. I was looking at Photon PUN but it does not really seem to be intended for async joining and the requirement for networked Prefabs to be in Resources collides with the setup of some VR SDKs etc. Can anyone recommend a Network solution for this use case?

safe drift
#

bump

jade glacier
#

Which SDKs don't work with prefabs in resources? I'm adapting the Pun2 SNS beta right now too quickly make networked VR, and it's not been a problem with Oculus Integration. @grave moon

grave moon
#

@jade glacier It would be great to just use a different prefab for the remote instances for example

jade glacier
#

you can do that with PUN, just requires some extra steps.

#

Why a different prefab?

grave moon
#

e.g. FPS games are using a first person representation on the client and a third person character for everyone else

jade glacier
#

Typically you just set up the prefab with handling for removing or disabling components specific to owner/non owner

#

I still use one organ for that

grave moon
#

My VR scene setup is quite complicated and has a lot of dependencies so I would prefer to not spawn it in but just "link" it to a remote prefab

jade glacier
#

And enable and disable based on IsOwner

#

You can do that

#

It's just some extra steps

#

The basic spawn options use resources to simplify it, but if you follow those calls you can see what it is actually doing.

grave moon
#

Thanks thats good to know

#

It has been some time since I last used networking with unity and I remember that it was a pain to link 2 objects in unitys network system because there was no way to sync their network IDs with each other

jade glacier
#

There is, PUN is doing just that behind the scenes

#

Typical practice is to make one prefab, just to avoid that dance.

#

For SNS I just made a component that toggles GOs and components based on authority changes. That spares me from having to code IsMine into everything.

grave moon
#

For SNS I just made a component that toggles GOs and components based on authority changes. That spares me from having to code IsMine into everything.
@jade glacier sounds good for most cases but in my case there will be a big difference between both representations. I appreciate the help. Its a great starting point

jade glacier
#

Yup, you'll need to dig into the code a bit yourself.

silk bolt
#

One message removed from a suspended account.

#

One message removed from a suspended account.

jade glacier
#

"good" in what what? @silk bolt

#

It is terrible in all always except that it is human readable.

silk bolt
#

One message removed from a suspended account.

#

One message removed from a suspended account.

jade glacier
#

I would look into how byte writers and bitpackers work if you are looking to get into that layer yourself.

#

But typically for easier starting stuff you will be using some kind of bytestream writer/reader

silk bolt
#

One message removed from a suspended account.

jade glacier
#

Most net libs have something like that built in, Which Networking Library are you using?

#

@silk bolt

silk bolt
#

One message removed from a suspended account.

#

One message removed from a suspended account.

jade glacier
#

If you are willing to take on a pretty massive learning curve it can be done. But you are starting the the very bottom layer of what will become a very complex stack.

#

So I would recommend before doing that, use some higher level libraries and sniff around what they are doing.

slim ridge
#

@silk bolt you might be interested in google protocol buffers

silk bolt
#

One message removed from a suspended account.

spring crane
#

MessagePack is pretty neat

merry verge
#

Anyone have experience Networking Final IK avatars?

frozen canopy
#

Hi, why does everyone says that UNET is bad and recommend me to use photon or some kind of instead of UNET

merry verge
#

Unet has been scheduled to be unsupported for a long time.. therefore the community behind it has migrated to newer solutions

gloomy sage
#

Wrong channel.. appologies

surreal totem
#

can UNET be used not just for LAN play? How?

spring crane
#

Just because the buttons say LAN doesn't necessarily mean it's LAN only

gray pond
surreal totem
#

yes indeed, I did use Mirror

#

though I couldn't get it to work over different networks

#

I had to connect with my friends through hamachi

spring crane
#

@surreal totem Ports of the host needs to be open

surreal totem
#

and how do you do that?

#

or better yet, what does that even mean?

gray pond
#

Means even using Hamachi, someone still has to be the server/host and they need firewall rules and ports opened for others to connect. @surreal totem

#

...and a cooperative ISP. If the ISP is blocking remote connections, there's nothing Mirror can do about that.

surreal totem
#

is there really no way around having to manually open the ports/disable firewall altogether for every client/host just to play using UNet/mirror?

gray pond
#

dedicated public server, or a relay, or uPnP if the host's router has that feature enabled (and still requires a cooperative ISP).

#

steam & discord are relays, and we have a transport for each.

surreal totem
#

well, thanks for the info, but still doesnt help much. I have 0 idea how to do or make any of that ¯_(ツ)_/¯

gray pond
#

firewalls and port forwarding aren't specific to Mirror - that's just how the internet works

#

The link I put above shows you how to do port forwarding, and windows firewall rules are pretty easy if you google them.

#

One of our transports has uPnP built in, you can try that as well.

spring crane
#

@surreal totem Most people have to open ports in their router to host servers

#

Hamachi gets around this by going through thirdparty, a bit like PUN's client<->relay<->client setup

surreal totem
#

so basically PUN = Not having to do port forwarding if I wanna host?

spring crane
#

Well, yes, but if you can program networked games, you can probably type your local IP to your browser and open the necessary ports...

graceful zephyr
#

photon can also do punch-through, so you only go through the relay fallback as last resort to make sure you can connect

spring crane
#

Did you mean Bolt or Quantum? I thought PUN always went through relay

graceful zephyr
#

Bolt

#

quantum doesnt work like the others so its a different setup

gleaming prawn
#

And pun is always.through relay, yes... The low level photon realtime (native c++ version) also does punch through... But in that case it's a raw socket, so very low level.

trail parrot
#

Hi all. Any advice on what to look for for a CharacterController for network purpose?
I'm not using UNet, but a proper dedicated server-client

#

Willing to pay. Store's got a sale now
But there's just so many options and well, can't really taste test all of them..

night plover
#

@trail parrot It's going to be extremely hard to adapt a single-player controller to networked.

trail parrot
#

That's what i reckoned..
Currently also considering scaling down player controls greatly

Currently, it's between "no jumps" and "no pushing/unit blocking"

#

Really considering spending on some kind of character controller tho (up to 70$ lol hope i'm not turning this to a marketing channel...)

#

The 50$ is for A* project, authoritative server should be able to utilize that regardless of how things move

graceful zephyr
#

@trail parrot afaik none of the CCs on the asset store work well in MP

trail parrot
#

What would make it "work well"?
Wouldn't prediction/correction matter more?

#

Ok, so i've decided there won't be jumps. Players only move in XZ.
But, there's still Y movement as result of slope

There's definitely gonna be unit blocking. The pathfinding can handle that, and player movement wise, it can be marked "invalid" when server processes it

Pushing, however... I really want it. And if using these dynamic RB CCs they're handled in server, then server will handle the resulting vectors. Client will need to be corrected.
Push will only from a dash (so there won't be any "continuous pushing" from moving) or knockback effect
But, if every initiator of push at least has to get the authorized starting position, then at least client's prediction can start only after a corrected initials, which hopefully won't look so bad

undone sigil
#

Litenetlib is easier to use and actually has a support instead of a dev who archives the repo after pushing to not get issues opened

graceful zephyr
#

@weak plinth doesn't matter

#

both are fine

somber drum
#

Howdy guys, I'm trying to avoid physical projectiles on my server, someone told me I could probably emulate it with particles, though I'm not sure if I could get away with it

#

anyone done something similar?

#

obviously a ray would be terrible for a bullet

slim ridge
#

you could shoot rays at different parts of the path

somber drum
#

that'd probably be the only way huh

slim ridge
#

or you could build your own squiggly ray

#

but i have no idea how you'd do that

somber drum
#

yea I like the idea of particles also for the sake of easy access to spray patterns

slim ridge
#

you could also move a sphere collider along the whole path in a single frame

somber drum
#

but I was hoping it wouldn't devastate performance

#

firing rays all along

#

yea that's whats in the concept

#

they can have colliders right? so that'd be ideal

slim ridge
#

particles with colliders might get pretty slow if there's a lot

somber drum
#

they'll be used very sparingly, no full auto weapons + limited ammo

#

but just as long as it's not "physical" projectiles should be fine.. servers on java apparently that dosint play nice lol

slim ridge
#

how is your line defined?

#

If you define it as a wave with frequency and amplitude that makes it really easy for a server to detect collision

somber drum
#

how would the speed be?

slim ridge
#

you just have to send the start time/position, frequency, and amplitude then the server can draw the line and check if any point on it is inside a collider

somber drum
#

yea I'm just using a straight line atm, will have to look into that thanks!

slim ridge
#

i'd call that a "WaveCast" wonder if anyone's done that before

surreal totem
#

Hello, I'm using PUN2 and I am trying to make a Room List. However, no rooms are showing up. I am connected to a lobby and the Master Server, and I am following FirstGearGames's tutorial series, however it is very unclearly explained how to fix this issue there. Can someone help me? (Code: https://pastebin.com/j7T42hbN)

frozen canopy
#

@surreal totem

#

Im making room list

#
        RoomInfo[] rooms = PhotonNetwork.GetRoomList();

        Debug.Log("Theres existing " + rooms.Length + " ROOMS ACTUALLY");```
#

@surreal totem

#

And with the RoomInfo you can get if the room is opened or not, if the room has x quantity of online players

#

etc...

night scaffold
#

I'm having a problem with UnityWebRequest in WebGL builds. I understand that there are issues mixing HTTP and HTTPS connections, so I got a Let's Encrypt Authority X3 HTTPS SSL certificate for the site I'm using to host my highscores. However, I'm still having problems. Does anyone know how to fix this? Do I need to wait 24 hours or something for it to process? The weird thing is that in Opera GX it says "Not Secure" even though it states the certificate is "Valid", but in Google Chrome it has no problem with it. So... what's going on? Thanks in advance!

trail parrot
#

Is this a feasible strategy for unit pushing?

  1. Disallow walk from input/pathfind into other unit
  2. All units are trigger colliders
  3. Allow knockback and dash, which is hard value move vector over duration
  4. When dash and hit another unit (inside their trigger), hard move value is saved, but the dot product is in effect
  5. When inside multiple units, only the closest unit gives this effect
  6. The secondary unit getting the ripple effect will also be in dash state, but the vector is always away from the incoming colliding unit
  7. All this is done in server. Server always syncs move vector (including result of dash) and real position.
  8. Client always updates move vector, but interpolates into real position. Unless it's over a threshold
night scaffold
#

I've found the solution! It might be a bit hacky, but it works. I found out by accident that the way itch.io embeds the web versions of games into the page seems to be using an iframe, and putting links within it will display within the frame instead of actually opening the page. So with this knowledge, I tried making a JavaScript redirect to the page on my site:

<!DOCTYPE html>

<html>
    <head>
        <script>
            window.onload = function () {
                window.location.href = "my game's url";
            }
        </script>
    </head>
</html>

And it worked like a charm! What's more, the highscores work as well! I haven't tested browser compatibility yet, but I don't see why it shouldn't work.

night scaffold
#

I've got a new problem now

#

I have a highscore system set up on a webserver, on which there is a PHP page that is accessed to get data from the MySQL database indirectly. For some reason, UnityWebRequest is caching the highscore data and it is showing old information, both in WebGL and in the Editor, even after restart. The only way I could fix the problem with WebGL is opening an incognito window. I tried www.useHttpContinue = false;, UnityWebRequest.ClearCookieCache();, and even messing with the .htaccess file on my webserver, but nothing helped. I've checked in the database and the data went through properly, and it updates on the PHP page that Unity accesses properly as well. Any ideas? Thanks in advance!

night scaffold
#

Found the solution

stiff ridge
#

@surreal totem, @frozen canopy, use PUN 2. Join a lobby and the server will send the list plus updates. Implement ILobbyCallbacks and register the script instance for callbacks. Then, the callback OnRoomListUpdate(List<RoomInfo> roomList) will get you the list to show. Rooms are identified by room name, so if an update contains a room name you already show, you can update those values.

surreal totem
#

@frozen canopy PhotonNetwork.GetRoomList(); is not a function?

#

anyway, got it working. However, now there is an issue, that when even when I exit a room, it instead of removing that room from the list, adds a clone of it. Why could that be?

edit: also solved. Simply checking for if the room has more than 0 max players, if its visible and if its opened before creating another item in the list does the job. I also had an issue where closed rooms would stay in the list. Also solved that by storing the item i create in a variable, and checking the else of the 0 max players, if visible, if opened check, and simply destroying it there.

stiff ridge
#

PhotonNetwork.GetRoomList(); is not a function?
It's been removed from PUN 2. We saw that almost everyone was copying the data into some UI or backup value and in the end, the data was held in several places.
PUN 2 provides the updates and you can handle it as you see fit.

#

Use Room.IsVisible to hide a room from the list (players in a room must do this). IsOpen and IsVisible are distinct but in most cases, you can set both to false, when the room is "in use" and nobody should join anymore.

#

In best case: Use random matchmaking! Avoid room lists.
Once your game is successful, hundreds of rooms listed, won't make a good basis for users to select anything but one of the top 5. They join those rooms in flocks and when it's full, some users might still see it (there are delays) and fail to join.
This is a bad experience.
Just forget about showing room lists and join random with some parameters.
https://doc.photonengine.com/en-us/pun/current/lobby-and-matchmaking/matchmaking-and-lobby

frozen canopy
#

@stiff ridge

#

or i can just do PhotonNetwork.GetRoomList()

#

in PUN1

#

and thats it xD

#

PUN1 is okay for me, as they have much simpler sentences

#

also i can do PhotonPlayer:GetScore()

#

and get his photon score

#

can't do that simple with pun 2

#

You can handle when a user fails to join the room and send him back to the lobby, basically checking if he is in room or not after x seconds, if he is in the scene that is supposed to be in the room, but he isn't, it means that he couldnt join, so just send him back or search him another room

stiff ridge
#

PUN1 is okay for me, as they have much simpler sentences
Just keep in mind it's not going to be around forever. The first Unity version we don't support is likely 2020 in PUN 1.
PUN 2 is not much harder, imo.

#

also i can do PhotonPlayer:GetScore()
This is an extension to the Player class and it's still in PUN 2 😉

neat echo
slim ridge
#

u cant

#

you have to do it at runtime in Start() or Awake()

#

already forgot my unity account and password so i cant post the answer sorry

neat echo
#

Hmm okay. So when game starts that "nosta puu"script need tp find that "käsi"

slim ridge
#

ya

neat echo
#

Thanks!

slim ridge
#

to understand why just imagine a prefab with a script and you put two references and try to assign to them objects from different scenes.

frozen canopy
#

@stiff ridge wait, some random day my game can stop working because no more PUN1 hosting is given?

gleaming prawn
#

No

#

But you will not be able to update the unity version anymore, or get bug fixes. Pun 1 is inmaintenance mode.

#

Support will be stopped, except for enterprise customers, etc.

#

Anybody starting a new game should switch to pun2

jade glacier
#

No one should be starting new projects with it

#

It exists to not break working titles

frozen canopy
#

So a customer with Enterprise will receive PUN1 bugfixes, and a customer with less-cost plans won't?

#

Money rules i guess

jade glacier
#

Fixes will always get pushed to the store as long as pun is there

#

Support and bug fixes are not there same thing

frozen canopy
#

Alright

#

The CCU count is bad, from the panel

#

From photon panel

#

@jade glacier

#

As in my panel appears that average CCU per room is 8, but my rooms are limited to 2 players per each

#

So why does appear that 8 CCU per room

jade glacier
#

I don't actually know how ccus work

frozen canopy
#

I only connected 3 devices to the game, its not already published

jade glacier
#

Not my side of the code base

frozen canopy
#

All the 2 are correct

#

but the 8, wtf xD

hard oasis
#

but before setting the game ccu to 2,didnt you try any demo or run a test using the same appid?

frozen canopy
#

nop i didnt

hard oasis
#

if not,congratulations,you found a bug

#

its probably photons fault

frozen canopy
#

Its imposible i run my tests with my mobile and my PC, connecitng an user from the PC and an user from my mobile

#

No one has the apk

hard oasis
#

yea

#

so photon just broke itself

#

you are using photon 2 or 1?

frozen canopy
#

1

hard oasis
#

oh

#

maybe thats it

frozen canopy
#

.-.

#

Pretty sure theres a lot of games

hard oasis
#

something could have changed

frozen canopy
#

using it

#

xD

hard oasis
#

yea

#

but as someone stated before,enterprises get better bugfixes and probably have their own specialized debug/analytics view

frozen canopy
#

I was trying to move to photon 2

#

i was 1 step away

#

1 code line away

#

from getting it well migrated @hard oasis

#

But then i couldnt make PhotonPlayer.GetScore()

#

Because in photon2 doesnt exist

#

Idk why the hell that was removed but its not existing :/

#

that really f#$%& me because i wanted to use photon 2, but i cant :/

jade glacier
frozen canopy
#

Yeah, there doesnt talk about the GetScore()

#

method

#

i only encountered that issue

#

it doesnt talk about the scoring system

#

Will try it right now again to migrate everything as i see that theres some photon users here

#

Syncronization and gameplay things are improved in PUN2? @jade glacier

jade glacier
#

I think PUN2 was more just structural refactoring that needed to break some things to be done.

#

Tobi is big on not making breaking changes, so PUN2 was all the things they wanted to refactor but would break running games, so they forked to do it. I don't know much about the differences other than that.

slim ridge
#

how long has your domain been around?

#

maybe some robot who knows about it managed to appear as a user

frozen canopy
#

Nah, you must register to go to the lobby @slim ridge

#

and theres no one new

#

in the database

#

xD

slim ridge
#

👍

jade glacier
frozen canopy
#

thats why i find it strange

#

xD

#

Yes but when i use GetScore it tells me that it dont exist @jade glacier

#

When i saw it in the pun2 documentation i though the same as you, then, they didnt remov eit

#

But nope, its not there

jade glacier
#

I see the cs file for PunPlayerScores.cs

#

Did you right click on the red text to see how it suggested fixing it?

frozen canopy
#

What, lol

#

that didn't appear to me

#

when i tried it

#

It just told me the Generate property, field , etc...

#

but not the using one

#

let me check, im making agian th emigration

jade glacier
#

Typo maybe

frozen canopy
#

in 1 minute we will know

#

look @jade glacier

#
PhotonNetwork.player.SetScore(1);```
#

player is marked in red

#

but it doenst suggest me any using

#

ah wait this is LocalPlayer

#

nop

#

setscore

#

doesnt exist xD

slim ridge
#

LocalPlayer ?

frozen canopy
#

Omfg

#

i written manually

#

using Photon.Pun.UtilityScripts;

#

and now SetScore and GetScore are working

#

...

#

But i was doing
using Photon.Pun;

#

and it wasnt finding the setscore and getscore, needed to specify in the Using the UtilityScripts

#

strange

#

LocalPlayer ?
@slim ridge Yes

#

Instead of

#

PhotonNetwork.player.SetScore

#

PhotonNetwork.LocalPlayer.SetScore

#

player word got replaced for LocalPlayer

#

in the docs says

#
PhotonNetwork.networkingPeer.RoundTripTime;```
@jade glacier
#

This tells me that networkingPper doesnt exist

jade glacier
#

Probably moved too then, Not remembering off the top of my head where RTT is now

#

I use it though, so I know it exists

frozen canopy
#

ah found it

#
PhotonNetwork.NetworkingClient.LoadBalancingPeer.RoundTripTime;```
#

now its this

#

xD

#

what a big change lol xD

#

practically the whole line

jade glacier
#

It was a refactor, so lots of things that were in the wrong place got moved like that.

frozen canopy
#

@jade glacier can you help me just 30 secs with something?

#
PhotonNetwork.GetRoomList() is gone. You get rooms list and updates from ILobbyCallbacks.OnRoomListUpdate(List<RoomInfo> roomList) callback. You can optionally cache it, update it and clear it when needed.```
#
RoomInfo[] rooms = PhotonNetwork.GetRoomList();```
#

how could i replace this line of code

#

it tells GetRoomList is gone

jade glacier
#

Implement that interface is what it looks like

frozen canopy
#

Im not a C# pro coder

jade glacier
#

it is a callback and will get called

frozen canopy
#

I don't know how to implement an interface :/

jade glacier
#

I can't help there, you should hit up the general channels for that stuff

#

I've literally gotten 4 lines of code written in the last hour helping people in various chats - sorry

frozen canopy
#

np i understand

jade glacier
#

if its not SNS related I am pretty much not the one to help

frozen canopy
#

thx anyway

jade glacier
#

np

#

@frozen canopy PhotonNetwork.GetPing() is what I use for the RTT

#

But that just leads to the same place you are using

frozen canopy
#

why PhotonNetwork.GetRoomList() gone :/

jade glacier
#

Because it should be cached by the dev

#

is my guess

slim ridge
#
public class MyClass : ILobbyCallbacks
{
  public void OnRoomListUpdate(List<RoomInfo> roomList)
  {
  }
}
frozen canopy
#

I put this inside any script and thats it? @slim ridge ?

slim ridge
#

the important part is : ILobbyCallbacks put that on any class and you can implement the OnRoomListUpdate callback there

frozen canopy
#

like this?

slim ridge
#

yeah, i see you found the autogenerate interface thing

frozen canopy
#

yes xD

#

Problem is, as you see, i do the GetRoomList() inside a method called SearchForRoom()

#

this SearchForRoom() is called by clicking a button

#

i want the user to loop over the rooms when method SearchForRoom() starts (User clicked button)

slim ridge
#

what emotitron means by caching is you keep that roomList you get in the callback as a property of the class and use that when you SearchForRoom

frozen canopy
#

Okay, let me touch something

#

OnRoomListUpdate

#

How many times per second is that called?

#

i mean

#

how many times per second Photon updates the room list

slim ridge
#

docs dont say D:
probably only when something changes

frozen canopy
#

is this correct? will this work? @slim ridge

slim ridge
#

probably

frozen canopy
#

It should, right?

#

i hope xd

#

im pretty bad at coding yet

#

as you see xd

#

Im bad af*

slim ridge
#

are you a scientist? programming is really just employing the scientific method on logic

frozen canopy
#

coding xd

#

well i started coding 1 year ago

#

its good my level with 1 year? @slim ridge

slim ridge
#

lol i dunno anymore im too old

frozen canopy
#

how old are you? @slim ridge

slim ridge
#

34

frozen canopy
#

lol

#

im 19 xD

#

@slim ridge

ServerSettings.EnableLobbyStatistics is moved to ServerSettings.AppSettings.EnableLobbyStatistics```
#

It tells ServerSettings.AppSettings.EnableLobbyStatistics doesnt exist xD

#

ServerSettings.AppSettings

#

doest exist too

#

Anyway, i dont think i need it tho

slim ridge
#

AppSettings is not static, means you need to make an instance of ServerSettings

#

but i dunno, never used photon im just interpreting documentation

jade glacier
#

Never used any of that myself, so I only am looking at the docs as well.

frozen canopy
#

Where is the photon config to set the APP ID @slim ridge

#

in the new Photon folder

slim ridge
#

should be in a file in called PhotonServerSettings

frozen canopy
#

Theres 3 errors when i click play lol

#

dont have it @slim ridge

#

xD

#

i deleted the old one from PUN 1

#

and it seems it didnt generate me a new one for PUN 2

slim ridge
#

ah, well there's a wizard now

frozen canopy
#

Yea, i clicked on Setup Project

#

pasted the APP id

#

there

#

and it told me "Done"

#

But when i click play, this error appears @slim ridge

#

and this one too

#

only those 2 errors

slim ridge
#

hmm, i'd make a new project, run the wizard, then see if i can manually move over the file

frozen canopy
#

Yeah prrobably is because i cant finish configurating it

#

because it says in their docs that when i click on Setup Project, a file msut be generated automaticlly

#

Wait wtf, now i click Import again

#

from the asset store

#

and there are other files?

#

ah no its okay

#

idk why :/

#

im at 1 step of my game working with photon 2 xd

slim ridge
#

you'll get there, keep on truckin

frozen canopy
#

When i click Hightlight Settings File @slim ridge

#

That it should take me to the place where my settings file is

#

just it doesnt take me

#

anywhere

#

so i dont have a Settings File xD

#

@slim ridge

slim ridge
#

i bet it's there somewhere in your assets

frozen canopy
#

it isnt

#

already searched it in my files, outside unity

#

xd

slim ridge
#

then i guess you defeated the wizard, congratulations. you got 0 xp and lost 20 gold coins

frozen canopy
#

how can this be posible

#

Nah, you must b e kidding me @slim ridge

#

You have to create a folder called Resources

#

manually

#

when you create it, the wizard opened for me automaticlly

#

asking me the app id

#

and now it generated me the file in Resources

#

xD

#

But now what you told me to make with the room info thing makes an error @slim ridges

#

the interface you told me

#
        if (rooms.Count != 0)```
#

this line have error

#
Object reference not set to an instance of an object```
#

with the interface that you told me

slim ridge
#

rooms is null until you get the first callback

frozen canopy
#

And how can i enter the if only if i got a callbakc

#

xD

slim ridge
#

if (rooms != null && rooms.Count != 0)

frozen canopy
#

true okay

slim ridge
#

the condition is evaluated from left to right, so it will only evaluate rooms.Count if the first condition is true

frozen canopy
#

Yep, its working, now the problem is that calling void OnCreatedRoom()

#

doesnt work anymore @slim ridge

#

i have to implement an interface for that too, it seems

slim ridge
#

thats a good thing 🙂 you'll appreciate it the more work you've done

frozen canopy
#

Yes but the problem is that i cannot change from

#
    void IMatchmakingCallbacks.OnCreatedRoom()
    {

    }```
#

to

#
    IEnumerator IMatchmakingCallbacks.OnCreatedRoom()
    {

    }```
#

@slim ridge

#

Because when a room is created, i need some WaitForSeconds inside it

#

and i cannot do WaitForSecconds without IEnumerator

#

any solution about that? @slim ridge

slim ridge
#

Time.time this will give you the current time in milliseconds. You just have to check how much time has passed in an Update function

#

or use a coroutine

frozen canopy
#

@slim ridge cant i do this?

#
public class PhotonNetworkManager : MonoBehaviour, IMatchmakingCallbacks
{

}```
#

is this incorrect?

slim ridge
#

technically, but you might get PhotonNetworkManager mixed up with photon's PhotonNetworkManager

frozen canopy
#
void IMatchmakingCallbacks.OnCreatedRoom()
{

}```
#

This is not getting called when the user creates a room @slim ridge

#

Its not getting inside there, as i put a Debug.Log and it doesnt do it

#

why @slim ridge

slim ridge
#

according to docs that's only called when this client created a room and entered it

frozen canopy
#

going to test a build

#

Thanks for all the help @slim ridge ❤️

trail parrot
#

Hi all. Not unity related but figured ill ask this here

Renting vps is per hour?
Hours an instance is on, or whether theres active connection to it?
So for development where i mostly test local, and only need to test in hosted, i can effectively turn it on ~2hours a day and in the end only billed ~60hours in a month which is like 1/12 the monthly cost?

Specifically for vultr for example, whats the difference between all that package(baremetal, cloud compute, storage). Can i for example, rent a "storage" for a game server? They all "work" for gameservers, right?

frozen canopy
#

too many bugs @slim ridge

#

I think ill stick to PUN1

#

as my Skins breaks when i move to PUN2

frozen canopy
#

One question, i have 300 GB , so 3GB / CCU, this traffic, goes to 300 GB every month? Like, if i spend like 100GB this month, when the month ends, illl be filled again with 200 GB?

stiff ridge
#

Photon's 100 CCU Subscription includes 300GB of traffic for all players combined. If you go over, there is a surcharge. This translates to: If 100 players would play all month and stay under 3GB of traffic, this would be OK.
(It's not actually a subscription, because you pay only once for 3 years of service.)

jaunty thistle
#

Hi all. I am a student who is completing a final project in which I use Photon Pun and I do not have much idea. I have seen a video where it's explained it and more or less I have advanced. But after a while, problems are arising that i cannot be solved. My project is based on an online mobile game, similar to Hearthstone. Whoever has knowledge of the program. Whoever has knowledge of the program, I would like you to add me to the discord and we will talk about the project in general by sharing the screen, it is not very complicated since they asked me to be a prototype, thank you.

#

@meager sphinx

small condor
#

How can I instantiate only local, a UI for the local player without instantiating another one when another player spawns in?

#

i use object.Instantiate()

#

the PlayerScript is supposed to only spawn 1 UI for its own player inside start() method but when another player joins, its spawns another UI on top of the other 1 which is i dont want

stray scroll
#

I think there is something like isLocal

#

I assume you're using PUN or UNET or MIRROR <.<

small condor
#

im using PUN2 and i think i found the probable cause. Im using a script that i give for each player so that when the match starts, it disables the scripts that are not its own.

#

nvm i found the problem.

frozen canopy
#

Photon's 100 CCU Subscription includes 300GB of traffic for all players combined. If you go over, there is a surcharge. This translates to: If 100 players would play all month and stay under 3GB of traffic, this would be OK.
(It's not actually a subscription, because you pay only once for 3 years of service.)
@stiff ridge but if i pay once every 3 years

#

I wont get 300 gb every month no?

frozen canopy
#

Also how could i optimize the data sent over the network, currently i send a vector3, a Quaternion and velocity

frozen canopy
#

yes

#

sending velocity over makes it smoother @weak plinth

#

also, implement the lag compensation

#

but right now im trying to instead of sending the Vector3, send 3 floats @weak plinth

#

yes sorry it is the same @weak plinth

#

now im trying to make an struct

#

so i can send the Position, rotation, and velocity

#

in just one SendNext()

#

yes you can

#

but its not recommended to touch the default one

#

20

#

you mean the sendrate of the information no?

#

like vectors and rotations and etc..

#

yes, its setted to 20

#

the more, the faster

#

yeah but if your player changes the position all the time

#

like mines

#

that is constantly moving forward

#

the user cannot stop moving forward

#

i need to send every packet

#

the position

#

rotation

#

and velocity

#

if your game is the typical cards game

#

like you work with clicks

#

its innecessary to send them every packet

#

unnnecessary*

#

define fairly quick

#

your player moves pressing a key right?

#

yeah then you will need to send it every packet i guess

#

"every packet"

#

OnPhotonSerializedView

#

idk how often does OnPhotonSerializedView runs

jade glacier
#

For more advanced networking stuff, I would try to get out from under "send rate" as a time value and instead raise your own events and send them based on the simulation ticks.

runic sierra
#

I cant shoot a projectile on a client
i do see movement on client and host
and i see bullets fired on host on the client

#

Could anyone help me?

dusk cargo
#

Hi all, i'm new in the dev of game but i want test the integration Steam to unity, and this this is good but when i start a server i have a lot of message in the console "sending message to ...... " and server received X bytes from " ... I would know if it's normal pls 🙂 ( sorry for my bad english )

spring crane
#

Likely normal. You might wanna tweak your debug level in whatever is creating those messages if you don't want to see them.

dusk cargo
#

okk thank 🙂

weak plinth
#

hey maybe it's best to ask here, was just wondering what would be the best solution to let players host their own servers?

#

I don't mean P2P servers, I guess a dedicated server type of solution where a player can throw their own server up on their computer and their friends can connect with an IP address etc

slim ridge
#

what you describe is P2P

#

perhaps the product you're looking for is Photon Bolt

spring crane
#

Sort of. You can do this with any dedicated networking solution by just having the server build available

#

Or just by shipping it with the game

weak plinth
#

@spring crane Yeah that's what I want, having some sort of server build. I'm working on an API or at least plan on doing so for this game I'm working on to let the community contribute

#

Do you agree that Photon Bolt would be ideal? I was thinking of mirror

#

@slim ridge I don't think this is considered P2P, since it's a server being hosted, where players can connect to

#

A dedicated server, I guess that's the wording

spring crane
#

Bolt comes with more tools for high quality netcode, but it isn't free

weak plinth
#

Is it not, the asset store has it listed as free unless it has a pro tier version etc

#

Judging by the looks of Mirror, I think that could do the job @spring crane

spring crane
#

Yea double check the licensing with Bolt. Yea I went with Mirror too, but it does require more backend setup to get replicate the features that you would get with Exit Games stuff

weak plinth
weak plinth
#

Ah shit did not see that, interesting

#

I will probably go with Mirror for now then, even if it requires more on the backend side, probably for the best so I get a better understanding of replication, etc

#

Thanks for the clarification

weak plinth
#

Hi guys, regarding multiplayer, let's say 20 people join your game, do they all work off their own scripts or is it possible to have them all running off a single script? unless thats what servers are for, you connect to the server and use the scripts present in that one instance?
thinking about diving into the jobs system if I can get everyone running off a few scripts, rather than 1 for each player..

graceful zephyr
#

your question makes zero sense.

#

really it does

#

you dont execute different scripts for 20 players? I mean you could i suppose if they all have unique functionality

#

but... yeah i don't even understand what u mean

sacred patrol
#

Lmao

graceful zephyr
#

and i would hold off on the job system a bit 😛

sacred patrol
#

Ay peeps, did anyone use Parse Server REST API ? (and maybe LiveQuery through Websocket if lucky). Are there better alternatives, or it's just as good as it gets when it comes to firebase-like realtime database ?
I want to save world state and user-generated content to work in tandem with PlayFab (since playfab only saves player-specific data).

#

@graceful zephyr Have you used anything like that ?

graceful zephyr
#

no, i build everything custom 🙂

sacred patrol
#

Fair enough.

graceful zephyr
#

i mean

#

i wont build a custom database

sacred patrol
#

I just want a convenient user-friendly API to hold my hand

graceful zephyr
#

but i wont use something like a REST API to do persistance

#

also parse server hardly seems targeted towards games

#

and it's all in JS?

#

ugh 😄

sacred patrol
#

That's true. I'm just looking for something to implement world persistency.

graceful zephyr
#

my latest project uses an append-only disk b-tree to persist the game data from memory straight to drive

#

or well, it's intended to, only done a bit of work on that part so far

#

also depends on what ur building i suppose

#

because the parse server stuff is a public API ain't it?

sacred patrol
#

It's a server build that you can deploy on your own hardware or VM

#

It's open source.

#

I'm building fallout-like grid map where every cell represents Photon room. I just need to save room state and update other players about what's happening in the room. That's the main goal of that thing.

graceful zephyr
#

and does parse server go into that?

#

it seems like ur convoluting shit like crazy

#

why not just use sqlite or something?

#

it's been around for ages

#

but maybe abstract the db interactions through an interface so u can switch it out if u want

#

but if its just per-server storage, that players host themselves

#

then just use sqlite

sacred patrol
#

Ah, I mean I'm going to host one server myself.

gleaming prawn
#

Photon internally even offers sqlite fholm

#

But for enterprise AFAIK

graceful zephyr
#

@sacred patrol ur putting every1 on one server?

#

or are you hosting one server, but players can host their own also?

sacred patrol
#

Nah they can't. In case of really high CCU count, I want to build it on top of docker container.

#

I'm overcomplicating things like crazy ?

graceful zephyr
#

then just use whatever storage solution ur hosting provider has

#

azure table storage, amazon... whatever it's called

#

etc.

#

Amazon S3? idk

gleaming prawn
#

Wouldn't playfab (that you are using) let's.you store something for the game itself?

#

AFAIK it does

graceful zephyr
#

its only per player data i think?

#

not like "room" data ?

gleaming prawn
#

I think it has options for that

#

I'll ask a couple of guys later

sacred patrol
#

PlayFab only allows per-player data. They don't care about the world state. You can save data that relates to a group of players up to 100 I think.

#

But uh thanks for suggestion about table storage and similar stuff. I'll go google it now.

graceful zephyr
#

why deal with complexities of hosting storage yourself, when you have a way better storage solution, provided out of the box to all of your servers, that works everywhere and is globally replicated and backed up 😄

#

yes it does cost money, but its minor for Azure Table Storage at least, they also have Blob storage and a few other kinds

#

Used that in the past

#

I know amazon has equivalents, i just tend to use Azure

sacred patrol
#

I've used Firebase Storage, but it was a bit of a cancer to work with, and cost a lot. Hopefully I'll find something better.

#

I really don't want to host things myself either.

#

Wow wtf. Table storage looks alright. I wonder why Microsoft doesn't expose an api for it through Playfab

#

Thanks a lot man.

graceful zephyr
#

Np

stiff ridge
#

Photon's 100 CCU Subscription includes 300GB of traffic for all players combined. If you go over, there is a surcharge. This translates to: If 100 players would play all month and stay under 3GB of traffic, this would be OK.
(It's not actually a subscription, because you pay only once for 3 years of service.)
@frozen canopy : Err, yes. I meant "per month". Sorry for the confusion. Got distracted.

sacred patrol
#

Wow, tobi's also here. I like this chat.

gleaming prawn
#

A bunch of guys directly from Photon, or who work with us stay around here.

sacred patrol
#

Noice, glad to see you guys.

tacit grail
#

trying to read events stream from websockets from Planetside 2 api
i got it working to connect and read server response, but server do not see message what i send to subscribe to start receive events
i have very simple script on Python whats works pretty well

#

if u want to test, its just connecting to wss://push.planetside2.com/streaming?environment=ps2&service-id=s:test
and on connection send this {"service":"event","action":"subscribe","worlds":[13],"characters":["all"],"eventNames":["all"],"logicalAndCharactersWithWorlds":true}
if u see jsons with payload - its working

frozen canopy
#

@frozen canopy : Err, yes. I meant "per month". Sorry for the confusion. Got distracted.
@stiff ridge then if i paid for the 3 years subscription, my traffic available will fill to 300GB every month, yes?

stiff ridge
#

Yes that is per month.

tropic adder
#

Hello. How I can spawn Prefabs as a Child of the GameObject Player, if the PhotonView is mine. If its not, the Entity has to spawn as a Child of the GameObject Player1.

#

How I can do this?

#

Please nick me, if you have an idea.

amber trench
#

@tacit grail not really a unity question, maybe find a library that already exists to communicate with that api and study what it does

tacit grail
#

@amber trench i found no existing solutions, there not so big fan base. And I found there must be problem around sending message via websocket.
An exception has occurred while receiving a message websocket-sharp.dll says

frozen canopy
#

@stiff ridge if my game has for example 100 people connected to the lobby, but in rooms, only 100 msg/s are sent because they are 1v1 rooms

#

Will there be lag? because 100 people are connected in the lobby

#

or more than 100?

amber trench
#

i think it's just a bit out of scope here

#

you might want to use a websockets library from the asset store that's tested for your unity version and platform

#

a random websocket-sharp from the internet may or may not work

#

there are issues with SSL, Windows, compression, etc.

#

it's a little complicated

weak plinth
#

Has anyone here actually managed to get something working that would allow your players to download a server build and host a server themselves?

glass bridge
#

just give them your server binaries? unless you are using a managed cloud service in which case you're forced to use them

#

you'll also need a master server of some kind

gleaming prawn
#

@frozen canopy if they are in rooms, they are NOT in the lobby... In photon you are either connected to a game server (in a room) or to the master server (lobby), not both...

#

But your question is about LAG... Lag is about the time it takes for messages to be sent from one to each other, and this depends on where they are, which server they are connected to... Etc-..

#

1v1 rooms are very efficient, so there will be no issues from the photon end...

frozen canopy
#

Okay thanks so much @gleaming prawn

#

I though the Rooms and the Lobby were in the same Server

#

(in the same machine or part of machine)

slim ridge
#

before i try messing with ipfw myself, does anyone know a good tool to simulate packet loss / bandwidth / lag for OSX?

graceful zephyr
#

@weak plinth yes many times

gleaming prawn
#

I though the Rooms and the Lobby were in the same Server
We run clusters of these servers, with load balancing, etc...

jaunty ocean
#

I keep getting a warning that there are duplicate networkmanagers in a scene but I only have one that is DDOL and initialized in the first scene?

#

I get the warning when I host or join a server

jade glacier
#

Be sure to indicate which networking library you are using when asking questions here btw

jaunty ocean
#

Mirror

#

It's interesting because it seems like I can actually host and join lobbies when I completely delete the network manager from the scene

#

So something is making another networkmanager when I click on the host button...

#

Is it because I have the networkmanager as a prefab and reference it in the main menu UI?

jaunty ocean
#

I suddenly got it to work but now visual studio isn't recognizing the Mirror namespace??

frozen canopy
#

One question, a user that connects to EU server, will be able to play with US users? Or the rooms are per region in photon? @jade glacier

jade glacier
#

Yup it's all region based

#

Us players won't know about eu players.

ripe pasture
#

Hey guys, I apologize if this is too broad/basic of a question for the channel but I'm trying to find a good starting place for a basic 2d sidescroller multiplayer game. I see that UNet appears to be getting phased out, is that still the recommended library/framework regardless as Unity hasn't released the replacement? I see PUN also being used, but am still looking into differences. My main concern has been a lack of tutorials/walkthroughs/courses from within the last year/6 months, although I don't know how big of a concern that should be.

keen dune
distant bolt
weak plinth
#

so sending and receiving stuff like position and rotation is rather "simple" but what about playing an animation?

keen dune
#

@weak plinth I will be able to stuff like that i just need help with the networking. @distant bolt Sorry im new here.

gray pond
#

@jaunty ocean Mirror has its own Discord for support. Link is in the Asset Store description.

graceful zephyr
#

@keen dune Nobody can help you make that via discord, sorry.

keen dune
#

Oh ok.

fair roost
#

Yo

#

what should i use

#

to make a simple 1v1 fps?

#

i want to make it as smooth and accurate as possible

stable epoch
#

what should i use
@fair roost
As in Photon vs Unet??

graceful zephyr
#

if you want an incredibly tight and accurate 1v1 fps

#

the only way in unity atm

#

is to build it from scratch yourself

stable epoch
#

Wouldnt the Unity official fps template work??

#

Ive never used it myself personally

#

-- Ive recently imported Photon PUN (Web Socket Secured) into my WebGL project. And anytime i test I get this (only showed up after Photon was added and only happens in the browser version - in editor works fine).

grave moon
#

@stable epoch did you test this in an empty project? If it also happens there I would try to report it to photon

#

does anybody have experience how to handle an existing (non runtime instantiated) Player with Photon? I would like to give it a viewID and spawn a simplified remote representation on the other clients. It seems like I cannot request a viewId for the player because it already gets one when the scene loads

hollow sable
#

Does anyone know where I can learn to do a multiplayer connection to one server?

#

I see this is a networking text channel, thought it would be best to ask here

stiff ridge
#

@stable epoch , which PUN version and Unity version is that?

#

Does it happen with our demos, too? Just import into new, empty project, setup the Asteroids scenes in the build, switch to WebGL export and "Build and Run".

#

Also: Which browser?

#

As it's late here, maybe you mail us: developer@photonengine.com. There is a bank holiday where we are based, so PUN questions will take until Monday.

frozen canopy
#

@stiff ridge can you explain me that please?

#

My game is private, theres no release yet.

#

My rooms are 1v1, and i just test with my pc and my mobile

slim ridge
#

maybe you're not releasing the connection every time you run. does the number correlate to the number of times you ran the client?

frozen canopy
#

release the connection?

gleaming prawn
#

connections timeout in 5s or so if the game is closed

frozen canopy
#

yeah going to say that, when the game closes he is no longer in photon network after a bit, anyway, when they close the game, the LeaveRoom is executed

#

also when they unfocus

#

from the game screen

#

The room is limited by its properties to 2 people in total, and when the second joins, the room gets closed

gleaming prawn
#

What does your total CCU looks like?

#

The CCU/room is a division based on averages, and NOT really a counter of the actual CCUs in individual rooms

#

Your total CCUs are the billed ones...

frozen canopy
gleaming prawn
#

Normally these AVG counters are irrelevant when the total numbers aare small

#

Just ignore the AVG stuff like Disconnects / peer / hour, etc

frozen canopy
#

Oh okay

#

the real number of CCU and what i will be charged for is the Peak CCU number from the last screenshot that isent, right?

gleaming prawn
#

They are meaningful only statistically when your game has relevant numbers like > 500 ccu

#

The only important ones for you are total CCU and total bandwidth

frozen canopy
#

Total CCU is the Peak CCU

#

no?

gleaming prawn
#

Yeah, it's peak CCU combined from regions

frozen canopy
#

Alright

#

Then i will just not look at the other graphs xd

gleaming prawn
#

peak(region 1) + peak (region 2), etc

#

That's stated in the EULAs

frozen canopy
#

wdym?

#

For example

#

i can have 250 people playing in EU, and 250 perople playing in US

#

if i have purchased 500 CCU

#

right?

gleaming prawn
#

yes...

frozen canopy
#

okay

gleaming prawn
#

And it will count as 500 even if they do NOT overlap

frozen canopy
#

Okay

gleaming prawn
#

peak(us) + peak(eu), etc

frozen canopy
#

Yep, makes sense

gleaming prawn
#

reason is the capacity need to be there

#

in the clusters

#

We can't shift capacity, etc...

frozen canopy
#

one other question, 90 msg/s per room, is a good amount?

#

for 2 players

gleaming prawn
#

Msg/s is not really something thataffects servers much...

#

It's there because the game clients on unity sometimes have limited capacity to process a super high frequency

#

90 looks like 45 per client (up + down)

#

seems ok

#

Quantum games run something like 500-800 msgs/room/s

frozen canopy
#

Well im just sending over a Vector3, a Quaternion and a Velocity in OnPhotonSerializeView()

gleaming prawn
#

Just keep an eye on bandwidth

frozen canopy
#

I don't clearly know how could that generate that amount of messages per second

gleaming prawn
#

that should be fine (I think)

#

Messages per second:

  • 2 clients * (20 messages up + 20 messages down) = 80
#

then you have some extra acks, etc

frozen canopy
#

Bandwidth is okay i think, every match 10-20 MB are used, i think its a good number, having 300 GB per month.. I don't think im gonna use them all with 100 CCU

gleaming prawn
#

I think it's even more...

#

1 msg you send up from one client, it it's targeting only OTHERS, it becomes 2... But if you target ALL (like an RPC that even falls back to itself)becomes 3 (one up, 2 down, one per receiving client)

#

This is considering PUN... Quantum has a server plugin that batches, etc

#

But AGAIN, message rate is more because of the caacity of the client to be able to PROCESS these messages in time

#

For the server/cluster it's about ccu and bandwidth, that's it

frozen canopy
#

But isnt there an alternative in PUN in sending a whole 2 Vector3, and a Quaternion, way faster to syncronize the players even better?

gleaming prawn
#

So 2 game clients running at 20 Hz network updates regularly show up as 80-90 msgs per room per second AFAIK

#

But isnt there an alternative in PUN in sending a whole 2 Vector3, and a Quaternion, way faster to syncronize the players even better?
Out of my scope... It's been said several times here

#

Define "way faster"

#

What do you mean by that?

frozen canopy
#

So if i put both players walking side by side, they see each other like a little laggy

#

just a little

gleaming prawn
#

well...

frozen canopy
#

I already implemented the lag compensation thing on the OnPhotonSerializeView() and it improved but still a bit laggy

gleaming prawn
#

There are two things:

  • physical lag (actual time it takes for data to arrive, this is not about photon, it's about physics, actual physics, the speed of light, etc);
  • perceived lag (you can use a different synchronization strategy with EXTRAPOLATION to hide that a bit better)
#

But then... I'll let this for others to discuss with you.

#

Like @jade glacier and guys who really like to dig into that.

frozen canopy
#

Okay, thank so much

#

Also , the peak CCU from the panel, is updated on a realtime basis? or at the end of the month? @gleaming prawn

gleaming prawn
#

it's updated in "realtime"... It lags by a few minutes only

frozen canopy
#

Okay, thanks

jade glacier
#

Lag compensation in the context of PUN2 is not really a doable thing in the sense that most games use that term

#

But it is a generic term, so depends what you are trying to "compensate"

#

In extrapolated environments you have "timeframes" and no actual "real" time.

#

So all compensation strategies are about shifting things as much as possible into the desired timeframe.

#

An example would be if a player fires a rocket. If they predict, that rocket on that players screen is in their timeframe. The player is predicted as well. However all of the other networked objects are in essentially the past relative to that player.

That means that its very possible for the player to see their rocket hit someone in the face, but on the server or on other clients that rocket clearly missed.

#

Any lag compensation strategy is going to involve making choices about how to hide/resolve that paradox.

frozen canopy
#

I use PUN1 @jade glacier

jade glacier
#

Same deal. It is a relay environment, so it leans heavily on client authority

#

Which means every client has their own timeframe

#

And every client sees the world a bit differently

#

Rather than lag compensation, the main strategy with client authority is just deciding where authority belongs to get the best "feel" for the player, and for general sanity of programming.

#

You can cheat timeframes. For example have the players rocket delay slightly, fly slower and then speed up, so on to help make the predicted rocket on the client be closer to the way it will be seen by others.

#

But all client authority/client prediction environments require the timeframe paradoxes to be worked out.

last hornet
#

is there a limit to how much latency photon bolt will tolerate, with regards to latency compensation/rewinding?

last hornet
#

ie: if i have 300ms ping will it really rewind hitboxes on the server that far when i shoot?

gleaming prawn
#

You should ask that on bolts discord

#

Sure there's a limit

#

I just don't remember

last hornet
#

eh i always see fholm in here so i figured he'd chime in 😆

gleaming prawn
#

He's not working directly with bolt anymore, but I think these limits were not changed

#

But Ramon will know all details now, just ask them there

last hornet
#

will do. thanks!

empty quiver
#

Hi Im new to the server I wanted to ask for some advice regarding Photon Im using the Photon 2 plugin and Im trying to add multiplayer to my game but unfortunaly when player 1 moves player 2 moves and vise versa if anyone knows how to fix this it would be greatly appreciated

jade glacier
#

For all networking, you need to disable your controller code on non-owner/non-authority instances

#

so your controller code needs to include photonView.IsMine checks @empty quiver

#

and should only run if IsMine == true

empty quiver
#

I believe I have that all set up

delicate elm
#

bbboooiii

jade glacier
#

If you are controlling objects you don't own... then its not set up right

empty quiver
#

Im not sure what Im doing wrong cant I send my code?

jade glacier
#

You can post whatever here in the channel

#

and someone might have an idea

empty quiver
jade glacier
#

I'm not seeing the IsMine checks at a glance

#

Found them, up the code

empty quiver
#

ye im not sure what im doing wrong

jade glacier
#

At a glance I can't tell. Are you running Debug.Log(IsOwner) in place to make sure that that connection isn't getting ownership of both?

empty quiver
#

not sure how would i check?

jade glacier
#

Stick debug.log everywhere that matters and see what you see. Standard debugging.

empty quiver
#

so everywhere i use if (photonView.IsMine)?

jade glacier
#

For starters yeah, you need to isolate where what you think is supposed to happen is not happening...

#

so you can focus you attention there.

burnt axle
#

Whenever i instantiate a networked object in PUN with custom data (last parameter in instantiate method), the instantiated object never becomes active. Any idea why this happens?

#

The statement go.SetActive(true) never gets reached, the execution stops after calling SendInstantiate(parameters, sceneObject);. So i can see where its happening but i dont get why. Both statements are in the PhotonNetwork class

empty quiver
#

I feel like I have debugged everything I should debug in my script

jade glacier
#

Are the IsMine values correct?

empty quiver
#

I believe so

loud eagle
#

I keep seeing this multiply thing for unity about being able to scale your network but I can't seem to find any information about it.

#

I was using FNR but I need a different solution that will scale as my game does.

#

Would anyone here recommend Pun2?

burnt axle
#

Pun2 is very easy to setup and just works right away. They have a standard cost per ccu after 2k users up to 50k users, you can check out there pricing here:https://www.photonengine.com/en/pun/pricing

#

But you must check if their architectures fit your needs first before diving in

loud eagle
#

Thank you @burnt axle for your reply. Sorry for the late reply I was having dinner with the kids.

loud eagle
#

I looked into Pun2 and it's client-auth which is something I don't want.
What ever happened to Unity's connected games? There was supposed to be some big multiplayer thing coming out. Whatever happened to that?
Also what service would someone here recommend for a persistent world with possibly hundreds of clients connected at the same time?

graceful zephyr
#

@loud eagle the connected games thing

#

is only for ECS/DOTS

#

it's their new "dots netcode" thing, or well it's a big part of it

#

and as the name implies... it's only for dots

night plover
#

Isn't connected games also their cloud solution stuff?

graceful zephyr
#

you mean unet?

#

or their orchestration stuff?

#

i think the orchestration stuff is under that umbrella also

#

but you need something to run the game networking lol 😄

night plover
graceful zephyr
#

yeah, but this is all based on their new dots netcode

#

as the underpinnings for all of it

#

and that isn't working yet so

#

¯_(ツ)_/¯

loud eagle
#

They say War never changes, But it seems that's true for unity being completely unable to ever finish anything.

#

Thanks for the help everyone. I'll have to find another solution.
Pun2 is client-auth and I don't want to go down that rabbit hole of beating cheaters over the head with EAC.

#

FRM is lacking docs and so does Bolt so.. idk

graceful zephyr
#

@loud eagle Depending a bit on what game you;re building, Photon Server + Photon Realtime has successfully been used for MMOs in the past

loud eagle
#

I'm taking a look at something called Mirror

graceful zephyr
#

Bolt is built for up to maybe 40-50 players tops, and you have to manage performance carefully even at that range with bolt - it was never intended for large scale games with 100s of players in a single machine

loud eagle
#

have you used that before?

graceful zephyr
#

i know about it yes

#

it's... fine i suppose, it has a big community

loud eagle
#

Have you used Photon Realm time?

graceful zephyr
#

yes, I work for exit games :p

#

i'm also the original author of Photon Bolt

loud eagle
#

Oh well cool

graceful zephyr
#

mirro is based on UNET which is kinda a "meh" base to start from

#

mirror is... "fine", there hasn't been any big game launched or proven on it

#

from what i know

loud eagle
#

Well what I'm looking to do is create a kind of medieval mmo game

graceful zephyr
#

mostly hobbyists using mirror

#

i'd say straight up to just give up if you have no previous networking experience, and trying to make an MMO as your first multiplayer game

#

is not going to work, simple as that

loud eagle
#

this wouldn't be my first multiplayer mmo and if I was going to give up I wouldn't of ever learned Unity or C#

#

Photon Realm time you say would handle my needs?

graceful zephyr
#

realtime is the client lib

#

server is the ... well server lib

#

photon server + photon realtime is what albion online uses for example

loud eagle
#

interesting

graceful zephyr
#

so yes it's been used for actual commercial MMOs

loud eagle
#

Kind of like a Runescape-ish style game

graceful zephyr
#

yes i suppose

loud eagle
#

Alright so this is something I think you'd know most about

#

The cost of the CCU is that just to use a relay service or would it be hosting the game as a server?

#

Maybe a little of both?

#

@graceful zephyr

graceful zephyr
#

Photon Cloud/PUN1/PUN2 is for CCU you pay using our relay infrastructure

#

for Photon Server you pay for the server itself, and connect directly to servers you host the software on

loud eagle
#

interesting

#

thank you for the help

graceful zephyr
#

np

#

note that you can use PUN1/PUN2 to connect to photon server also AFAIk

#

But they're more commonly used with our cloud and relays

loud eagle
#

alright, I think I'm going to look deeper into real time and see what it can do for me.

graceful zephyr
#

RealTime is just our low level API which isn't tied directly to Unity

#

Which has bindings for C#, C++, JavaSCript, etc.

#

it can be used to connect to both our cloud and your own servers, and can be used to build pretty much any type of game

#

it's the specific combination of realtime+server which would be used for an mmo

loud eagle
#

What I find very interesting is the whole scaling aspect

#

It's not some computer in the closet but a data center which is cool

graceful zephyr
#

I have to take my kids out into the forest now... so I'm logging off, best of luck.

loud eagle
#

So if I sell 50 copies then fine but if I sell say 10,000 copies it's not like the whole thing falls apart

#

Alright

#

Thank you for the help

#

Have a good time hiking

graceful zephyr
#

thank you, afk now.

#

o/

summer bobcat
#

Hi, I would like to ask how PUN 2 handles UI.
I'm trying to create a shared arcade-like character select where players are loaded into once they find a match, where the players see who picked which character.
And then ingame, a UI that is owned and only shown to a player, and SO info like abilities within it.

I've been doing research for several hours, but I just cant seem to find any resources about PUN and UI elements, such as buttons being selected by a player disables it for the other. Do I have to do workarounds like instantiating the UI elements to be owned by the players, and then disabling it on selection for the other if !IsMine?

spring crane
#

I would figure out how to transfer that data using network messages and then build the UI on top of it. State of the UI could depend on that data, like you can probably close the character selection once you see that masterclient has accepted your character choice. Room properties can be handier over network messages.

#

You wanna go through masterclient if you need to enforce any kind of limit, like max players in a team or how many players can choose the same character, since 2 clients can decide to do things before knowing what the other client did, bypassing any sort of restrictions by accident.

summer bobcat
#

the characters can only be picked once.
so the UI isn't actually shared between players? Instead I just transfer the data to the server of who they picked, and disable the character for everyone if they do press something like a "pick character" button.

#

It does make more sense that way, thanks!

fair cosmos
#

based on Mirror Networking 😄

graceful zephyr
#

a free mod for an existing game, with a "Mixed" ~800 reviews...

#

yeah that's not what i call "proven"

fair cosmos
#

dude each and everything is written in rush

#

However mirror has capability to do most of the stuff, for me just 2 things which are not in mirror is Lag Compensation(u can solve by some assets or do ur own) and Smooth Movement(u can solve on ur own or by assets)

graceful zephyr
#

¯_(ツ)_/¯

#

When a decent studio has invested years into a developing a game on Mirror, and a game that actually works really well... that is proven.

fair cosmos
#

Its a community made mod, not by the orginal game developer 😄

graceful zephyr
#

I said Mirror is fine for hobbyists

#

And if that your ambition level, mirror is fine

fair cosmos
#

U'r also right, have a good day

empty quiver
jade glacier
#

You'll need to be more specific about what isn't working as expected.

empty quiver
#

The movement for each charecter is inverted

jade glacier
#

Inverted?

empty quiver
#

yes player 1 controls player 2 and player 2 controls player 1 but player 1 doesnt control player 1 and player 2 doesnt control player 2

jade glacier
#

Sure you have which object is which right? Your code definitely is checking IsMine

empty quiver
#

its a prefab

jade glacier
#

Not sure that that matters. Is each connection controlling one player object?

empty quiver
#

yeah i have it so when a playr joins it spawns a player in

#

the prefab that has the movement script on it

jade glacier
#

Dunno, the script looks right, so something maybe with how you are spawning.

empty quiver
#

Perhaps

vestal elm
#

has anyone worked with photon that could help me solve a bug?

#

I'm trying to spawn a player, so first I spawn a prefab that then spawns the avatar, this is so that I can destroy the avatar without having to destroy the actual player, anyways problem is that for some reason I'm spawning an avatar twice which shouldn't be the case

#

**Snippet of PhotonRoom, which spawns the player into the room
**```csharp
void OnSceneFinishedLoading(Scene scene, LoadSceneMode mode)
{
currentScene = scene.buildIndex;
if (currentScene == multiplayerScene)
{
CreatePlayer();
}
}

private void CreatePlayer()
{
Debug.Log("CreatePlayer");
PhotonNetwork.Instantiate("NetPlayer", transform.position, Quaternion.identity);
}


**NetPlayer prefab, this spawns the avatar**
```csharp
public class PhotonPlayer : MonoBehaviour
{

  private PhotonView PV;
  public GameObject avatar;

  // Start is called before the first frame update
  void Start()
  {
    PV = GetComponent<PhotonView>();
    int spawnPicker = Random.Range(0, GameSetup.GS.spawnPoints.Length);
    if (PV.IsMine)
    {
      Debug.Log("CreateAvatar");
      avatar = PhotonNetwork.Instantiate("NetAvatar", GameSetup.GS.spawnPoints[spawnPicker].position, GameSetup.GS.spawnPoints[spawnPicker].rotation, 0);
    }
  }
}
empty quiver
#

I think u only need the code that spawns the player into the room

#

right now u are saying spawn 2 players into the scene so I would remove either the top or bottom code and see if that helps or at least comment it out

vestal elm
#

and attach the avatar to the player prefab? because otherwise there is no avatar spawning and if I remove the top one, then no player is spawned into the room

empty quiver
#

Im not sure what the avatar part is about its there some kind of customization in ur game?

vestal elm
#

Also weird thing is that the Player and Avatar get spawned before OnJoinedRoom gets triggered

Basically I have NetPlayer and NetAvatar

NetPlayer spawns NetAvatar, so that when the player dies I only need to respawn the avatar

empty quiver
#

do u have the player prefab already in the scene?

vestal elm
#

nope

empty quiver
#

id say to try commecnting out the avatar part and then see what happens

vestal elm
#

the avatar doesn't get spawned so no camera in scene

#

which makes sense

empty quiver
#

attach the camera to the player

vestal elm
#

The camera is attached to NetAvatar, net player exists only in the background

#

okay so I was inspecting a bit and seems that the net player gets spawned twice

empty quiver
#

odd do u have the script attacheed to multiple objects?

vestal elm
#

wait I think the room hasn't been destroyed

#

looking at my logs and no new room is created

empty quiver
#

could u use onjoined?

#

OnJoinedLobby()

vestal elm
#

omg I feel stupid...

empty quiver
#

what was the issue?

vestal elm
#

I see you following info gamer 😛

#

I had a build instance running on my laptop

empty quiver
#

XD

#

Ye not sure why its not working the controls are inverted

vestal elm
#

what part u in?

empty quiver
#

But my controls are messed up and I have no idea why

vestal elm
#

I haven't gotten that far yet but are the controls only inverted in multiplayer

empty quiver
#

yes

vestal elm
#

but what do you mean inverted?

empty quiver
#

player one controls player two and vise versa

#

fixed it by using this code on the charecter script and disabling the camera on the player prefab

fickle cove
#

Hi I'm having problems zooming into objects using the 'F' key, anyone else having the same issue? (using unity 2019.3.5f1)

sour jungle
#

Where can I start to learn how to make fast efficient multiplayer games?

slim ridge
#

depends how deep you want to go

#

do you want to understand it or just use it?

gray mortar
#

so im making a card game that i will eventually want to be online multiplayer. is there something i have to do from the get go to make this happen or can i just make the card game functioning and then add in online functionality later?

vital hawk
#

but I haven't really tested that extensively. It does build both samples (which are included on the package) using IL2CPP without issues on my computer but I've seen people reporting you'd need additional tag for the build to work so could still miss something..

spring crane
#

@gray mortar Decide today if you are going to make it multiplayer or singleplayer and start building it appropriately.

gray mortar
#

alright thanks. i guess ill look up some tutorials on multiplayer then. i've never done anything with networking before.

summer bobcat
#

Hi can someone please point me in the right direction?
I have a button with PhotonView in it so I can use RPC, but Observed Components is 0 since I can't put the button in it; But I also can't set the PV's ownership to anyone.
Now, that I'm debug.logging PV.Owner.Nickname, it doesn't have an object reference.

#

is there another way to display the nickname of whoever called the function?

weak plinth
#

I’m having trouble with multiple entries being made into my sql data base when only one is supposed to be made

jaunty thistle
#

Hi, how can i connect manually to Photon Cloud??? @everyone

stray scroll
#

@brisk briar Maybe you need to do a some clear or push of msgs before disconnecting?

lilac creek
#

@vital hawk confused as to why you uploaded steamworks net as a package when it already has a package version released?

#

unless this is just an up to date version based on the latest repository of steamworks.net

vital hawk
#

@lilac creek I did look around for such package but didn't see any?

#

also this does have the IL2CPP build fix

lilac creek
vital hawk
#

unitypackage != upm package

#

it's totally different thing

lilac creek
#

ahh sorry

vital hawk
#

upm package lets you install the thing using Unity Package Manager

#

basically zero Assets folder bloat

#

in this case, it also lets you install both SteamWorks.net samples through package manager 🙂

lilac creek
#

yeah that makes sense, I was actually getting annoyed by that

#

I just started messing around with steamworks net today but I am running into an issue where visual studio doesn't recognize the steamworks namespace

#

even though steamworks functions fine in game

vital hawk
#

that's probably more related to the wonky VS integration with Unity

#

if your unity version supports it, try to use visual studio package 2.0.1 on package manager as it has improvements for this

#

basically 2.0.1 is the first version Ive used that can reliably put packages into separate projects on your VS solution (once configured on Preferences->external tools)

#

as for the upm package thing, this is how it shows up when used from my fork:

keen dune
lilac creek
#

@vital hawk sorry I just saw your messages, will definitely give this a try, thanks!

slim ridge
#

anyone know how to close a socket that's blocking without an exception?

rich basin
#

I just updated my Photon pun and its not there. I see Realtime and Chat but no Pun.... It just keeps saying import. i've deleted and imported again. nothing works

graceful zephyr
#

@brisk briar create some kind of mapping table with callbacks

#

an array with 256 length of serialization delegates should work

graceful zephyr
#

@slim ridge how do you mean?

jade glacier
#

@brisk briar When you start hand serializing to a byte[], it can get pretty long fast. Lots of regions and I use lots of comments to indicate the write/read sections.

All of the Write and Read methods need to be symmetrical obviously, so you just want it to be easy at a glance to see that they are in fact matching read/writes.

If you really hate long CS you can make some of the read/write pairs into their own Extension methods.