#archived-networking
1 messages · Page 72 of 1
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 🙂
how burdensome? https://github.com/ValveSoftware/GameNetworkingSockets
@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
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.
Entire game state? whats the limitation?
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
Really cool, Gonna check Quantum
In like one sentence how does it differ from Bolt / Pun
Sorry for making you write a lot :]
- Quantum is a game engine (deterministic), Bolt and PUN are networking add-ons
So, it's a completely different approach for everything
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
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
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
+
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
looks like it's working fine
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
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
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
Ok but i do that with whatever the Networking Framework ? which is optimize for this gameplay-issue ?
@jade glacier and we talk to me about "Lockstep system", what do you think ? Do you know ?
@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
hi, i have script throwing a out of memory error, only i have plenty of free memory... anone ever seen it do that?
Probably out of bounds error?
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.
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?
bump
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
@jade glacier It would be great to just use a different prefab for the remote instances for example
e.g. FPS games are using a first person representation on the client and a third person character for everyone else
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
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
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.
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
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.
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
Yup, you'll need to dig into the code a bit yourself.
One message removed from a suspended account.
One message removed from a suspended account.
"good" in what what? @silk bolt
It is terrible in all always except that it is human readable.
One message removed from a suspended account.
One message removed from a suspended account.
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
One message removed from a suspended account.
Most net libs have something like that built in, Which Networking Library are you using?
@silk bolt
One message removed from a suspended account.
One message removed from a suspended account.
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.
@silk bolt you might be interested in google protocol buffers
One message removed from a suspended account.
MessagePack is pretty neat
Anyone have experience Networking Final IK avatars?
Hi, why does everyone says that UNET is bad and recommend me to use photon or some kind of instead of UNET
Unet has been scheduled to be unsupported for a long time.. therefore the community behind it has migrated to newer solutions
Wrong channel.. appologies
can UNET be used not just for LAN play? How?
Just because the buttons say LAN doesn't necessarily mean it's LAN only
@surreal totem UNet is deprecated. Mirror is the closest replacement
https://assetstore.unity.com/packages/tools/network/mirror-129321
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
@surreal totem Ports of the host needs to be open
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.
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?
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.
well, thanks for the info, but still doesnt help much. I have 0 idea how to do or make any of that ¯_(ツ)_/¯
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.
@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
so basically PUN = Not having to do port forwarding if I wanna host?
Well, yes, but if you can program networked games, you can probably type your local IP to your browser and open the necessary ports...
photon can also do punch-through, so you only go through the relay fallback as last resort to make sure you can connect
Did you mean Bolt or Quantum? I thought PUN always went through relay
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.
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..
@trail parrot It's going to be extremely hard to adapt a single-player controller to networked.
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
@trail parrot afaik none of the CCs on the asset store work well in MP
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
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
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
you could shoot rays at different parts of the path
that'd probably be the only way huh
yea I like the idea of particles also for the sake of easy access to spray patterns
you could also move a sphere collider along the whole path in a single frame
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
particles with colliders might get pretty slow if there's a lot
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
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
how would the speed be?
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
yea I'm just using a straight line atm, will have to look into that thanks!
i'd call that a "WaveCast" wonder if anyone's done that before
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)
@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...
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!
Is this a feasible strategy for unit pushing?
- Disallow walk from input/pathfind into other unit
- All units are trigger colliders
- Allow knockback and dash, which is hard value move vector over duration
- When dash and hit another unit (inside their trigger), hard move value is saved, but the dot product is in effect
- When inside multiple units, only the closest unit gives this effect
- The secondary unit getting the ripple effect will also be in dash state, but the vector is always away from the incoming colliding unit
- All this is done in server. Server always syncs move vector (including result of dash) and real position.
- Client always updates move vector, but interpolates into real position. Unless it's over a threshold
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.
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!
Found the solution
@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.
@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.
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
Photon Unity Networking framework for realtime multiplayer games and applications with no punchthrough issues. Export to all Unity supported platforms, no matter what Unity license you have!
@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
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 😉
https://answers.unity.com/questions/1723360/how-to-get-gameobject-from-prefab-to-script.html could someone take a look and help me :)
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
Hmm okay. So when game starts that "nosta puu"script need tp find that "käsi"
ya
Thanks!
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.
@stiff ridge wait, some random day my game can stop working because no more PUN1 hosting is given?
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
No one should be starting new projects with it
It exists to not break working titles
So a customer with Enterprise will receive PUN1 bugfixes, and a customer with less-cost plans won't?
Money rules i guess
Fixes will always get pushed to the store as long as pun is there
Support and bug fixes are not there same thing
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
I don't actually know how ccus work
I only connected 3 devices to the game, its not already published
Not my side of the code base
but before setting the game ccu to 2,didnt you try any demo or run a test using the same appid?
nop i didnt
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
1
something could have changed
yea
but as someone stated before,enterprises get better bugfixes and probably have their own specialized debug/analytics view
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 :/
https://doc.photonengine.com/en-us/pun/v2/getting-started/migration-notes. You followed where this leads?
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
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.
how long has your domain been around?
maybe some robot who knows about it managed to appear as a user
Nah, you must register to go to the lobby @slim ridge
and theres no one new
in the database
xD
👍
I know little about GetScore or the extension it is part of, but it exists in two it sounds like.
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
I see the cs file for PunPlayerScores.cs
Did you right click on the red text to see how it suggested fixing it?
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
Typo maybe
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
LocalPlayer ?
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
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
ah found it
PhotonNetwork.NetworkingClient.LoadBalancingPeer.RoundTripTime;```
now its this
xD
what a big change lol xD
practically the whole line
It was a refactor, so lots of things that were in the wrong place got moved like that.
@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
Implement that interface is what it looks like
Im not a C# pro coder
it is a callback and will get called
I don't know how to implement an interface :/
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
np i understand
if its not SNS related I am pretty much not the one to help
thx anyway
np
@frozen canopy PhotonNetwork.GetPing() is what I use for the RTT
But that just leads to the same place you are using
why PhotonNetwork.GetRoomList() gone :/
public class MyClass : ILobbyCallbacks
{
public void OnRoomListUpdate(List<RoomInfo> roomList)
{
}
}
I put this inside any script and thats it? @slim ridge ?
the important part is : ILobbyCallbacks put that on any class and you can implement the OnRoomListUpdate callback there
yeah, i see you found the autogenerate interface thing
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)
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
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
docs dont say D:
probably only when something changes
probably
It should, right?
i hope xd
im pretty bad at coding yet
as you see xd
Im bad af*
are you a scientist? programming is really just employing the scientific method on logic
coding xd
well i started coding 1 year ago
its good my level with 1 year? @slim ridge
lol i dunno anymore im too old
how old are you? @slim ridge
34
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
AppSettings is not static, means you need to make an instance of ServerSettings
but i dunno, never used photon im just interpreting documentation
Never used any of that myself, so I only am looking at the docs as well.
should be in a file in called PhotonServerSettings
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
ah, well there's a wizard now
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
hmm, i'd make a new project, run the wizard, then see if i can manually move over the file
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
you'll get there, keep on truckin
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
i bet it's there somewhere in your assets
then i guess you defeated the wizard, congratulations. you got 0 xp and lost 20 gold coins
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
rooms is null until you get the first callback
if (rooms != null && rooms.Count != 0)
true okay
the condition is evaluated from left to right, so it will only evaluate rooms.Count if the first condition is true
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
thats a good thing 🙂 you'll appreciate it the more work you've done
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
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
@slim ridge cant i do this?
public class PhotonNetworkManager : MonoBehaviour, IMatchmakingCallbacks
{
}```
is this incorrect?
technically, but you might get PhotonNetworkManager mixed up with photon's PhotonNetworkManager
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
according to docs that's only called when this client created a room and entered it
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?
too many bugs @slim ridge
I think ill stick to PUN1
as my Skins breaks when i move to PUN2
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?
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.)
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
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
I think there is something like isLocal
I assume you're using PUN or UNET or MIRROR <.<
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.
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?
Also how could i optimize the data sent over the network, currently i send a vector3, a Quaternion and velocity
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
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.
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?
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 )
Likely normal. You might wanna tweak your debug level in whatever is creating those messages if you don't want to see them.
okk thank 🙂
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
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
@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
Bolt comes with more tools for high quality netcode, but it isn't free
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
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
@spring crane The only thing I see with Photon Bolt is this https://www.photonengine.com/en/bolt/pricing - but I don't think this applies if I want my players to be able to throw up a server?
Networking middleware for Unity 3D and realtime multiplayer games and applications. Get started without having to know the details of networking or write any complex networking code.
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
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..
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
Lmao
and i would hold off on the job system a bit 😛
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 ?
no, i build everything custom 🙂
Fair enough.
I just want a convenient user-friendly API to hold my hand
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 😄
That's true. I'm just looking for something to implement world persistency.
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?
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.
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
Ah, I mean I'm going to host one server myself.
@sacred patrol ur putting every1 on one server?
or are you hosting one server, but players can host their own also?
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 ?
then just use whatever storage solution ur hosting provider has
azure table storage, amazon... whatever it's called
etc.
Amazon S3? idk
Wouldn't playfab (that you are using) let's.you store something for the game itself?
AFAIK it does
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.
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
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
The prices are tiny. I think it'll end up being nearly free in my case.
https://azure.microsoft.com/en-us/pricing/details/storage/tables/
Learn about pricing tiers for Azure Table storage. With many tiers to choose from, pay only for the storage capacity you need with no upfront costs.
Thanks a lot man.
Np
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.
Wow, tobi's also here. I like this chat.
A bunch of guys directly from Photon, or who work with us stay around here.
Noice, glad to see you guys.
I'm gonna have a hard time constructing this key from a playfab function. I wonder if I should use javascript auth somehow instead.
https://docs.microsoft.com/en-us/rest/api/storageservices/authorize-with-shared-key
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 : 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?
Yes that is per month.
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.
@tacit grail not really a unity question, maybe find a library that already exists to communicate with that api and study what it does
@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
@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?
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
Has anyone here actually managed to get something working that would allow your players to download a server build and host a server themselves?
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
@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...
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)
before i try messing with ipfw myself, does anyone know a good tool to simulate packet loss / bandwidth / lag for OSX?
@weak plinth yes many times
I though the Rooms and the Lobby were in the same Server
We run clusters of these servers, with load balancing, etc...
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
Be sure to indicate which networking library you are using when asking questions here btw
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?
I suddenly got it to work but now visual studio isn't recognizing the Mirror namespace??
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
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.
Hey, i'm looking for some help with the networking. I want it to be like this https://www.youtube.com/watch?v=49MWFNUtZkc
@keen dune do not cross-post. #archived-unitytips is also not for questions.
so sending and receiving stuff like position and rotation is rather "simple" but what about playing an animation?
@weak plinth I will be able to stuff like that i just need help with the networking. @distant bolt Sorry im new here.
@jaunty ocean Mirror has its own Discord for support. Link is in the Asset Store description.
@ripe pasture Mirror is the most direct replacement for UNet and we have our own docs and videos.
https://assetstore.unity.com/packages/tools/network/mirror-129321
@keen dune Nobody can help you make that via discord, sorry.
Oh ok.
Yo
what should i use
to make a simple 1v1 fps?
i want to make it as smooth and accurate as possible
what should i use
@fair roost
As in Photon vs Unet??
if you want an incredibly tight and accurate 1v1 fps
the only way in unity atm
is to build it from scratch yourself
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).
@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
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
@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.
@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
maybe you're not releasing the connection every time you run. does the number correlate to the number of times you ran the client?
release the connection?
connections timeout in 5s or so if the game is closed
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
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...
Normally these AVG counters are irrelevant when the total numbers aare small
Just ignore the AVG stuff like Disconnects / peer / hour, etc
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?
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
Yeah, it's peak CCU combined from regions
wdym?
For example
i can have 250 people playing in EU, and 250 perople playing in US
if i have purchased 500 CCU
right?
yes...
okay
And it will count as 500 even if they do NOT overlap
Okay
peak(us) + peak(eu), etc
Yep, makes sense
reason is the capacity need to be there
in the clusters
We can't shift capacity, etc...
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
Well im just sending over a Vector3, a Quaternion and a Velocity in OnPhotonSerializeView()
Just keep an eye on bandwidth
I don't clearly know how could that generate that amount of messages per second
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
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
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
But isnt there an alternative in PUN in sending a whole 2 Vector3, and a Quaternion, way faster to syncronize the players even better?
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?
So if i put both players walking side by side, they see each other like a little laggy
just a little
well...
I already implemented the lag compensation thing on the OnPhotonSerializeView() and it improved but still a bit laggy
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.
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
it's updated in "realtime"... It lags by a few minutes only
Okay, thanks
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.
I use PUN1 @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.
is there a limit to how much latency photon bolt will tolerate, with regards to latency compensation/rewinding?
ie: if i have 300ms ping will it really rewind hitboxes on the server that far when i shoot?
You should ask that on bolts discord
Sure there's a limit
I just don't remember
eh i always see fholm in here so i figured he'd chime in 😆
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
will do. thanks!
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
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
I believe I have that all set up
bbboooiii
If you are controlling objects you don't own... then its not set up right
Im not sure what Im doing wrong cant I send my code?
ye im not sure what im doing wrong
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?
not sure how would i check?
Stick debug.log everywhere that matters and see what you see. Standard debugging.
so everywhere i use if (photonView.IsMine)?
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.
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
I feel like I have debugged everything I should debug in my script
Are the IsMine values correct?
I believe so
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?
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
Photon Unity Networking framework for realtime multiplayer games and applications with no punchthrough issues. Export to all Unity supported platforms, no matter what Unity license you have!
But you must check if their architectures fit your needs first before diving in
Thank you @burnt axle for your reply. Sorry for the late reply I was having dinner with the kids.
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?
@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
Isn't connected games also their cloud solution stuff?
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 😄
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
¯_(ツ)_/¯
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
@loud eagle Depending a bit on what game you;re building, Photon Server + Photon Realtime has successfully been used for MMOs in the past
I'm taking a look at something called Mirror
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
have you used that before?
Have you used Photon Realm time?
Oh well cool
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
Well what I'm looking to do is create a kind of medieval mmo game
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
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?
realtime is the client lib
server is the ... well server lib
photon server + photon realtime is what albion online uses for example
interesting
so yes it's been used for actual commercial MMOs
Kind of like a Runescape-ish style game
yes i suppose
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
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
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
alright, I think I'm going to look deeper into real time and see what it can do for me.
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
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
I have to take my kids out into the forest now... so I'm logging off, best of luck.
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
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?
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.
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!
@graceful zephyr dude u are wrong https://store.steampowered.com/app/1104390/Ravenfield_Multiplayer_Mod/
The Ravenfield Multiplayer Project (RFMP) is a community created project with the sole intent of creating multiplayer support for Ravenfield. You can now battle against other players using teamwork and communication, in a fast-paced online multiplayer version of SteelRaven7's ...
based on Mirror Networking 😄
a free mod for an existing game, with a "Mixed" ~800 reviews...
yeah that's not what i call "proven"
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)
¯_(ツ)_/¯
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.
Its a community made mod, not by the orginal game developer 😄
I said Mirror is fine for hobbyists
And if that your ambition level, mirror is fine
U'r also right, have a good day
Could someone have a look at my code to see what I'm doing wrong please https://pastebin.com/2gSfg1jV
You'll need to be more specific about what isn't working as expected.
The movement for each charecter is inverted
Inverted?
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
Sure you have which object is which right? Your code definitely is checking IsMine
its a prefab
Not sure that that matters. Is each connection controlling one player object?
yeah i have it so when a playr joins it spawns a player in
the prefab that has the movement script on it
Dunno, the script looks right, so something maybe with how you are spawning.
Perhaps
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);
}
}
}
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
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
Im not sure what the avatar part is about its there some kind of customization in ur game?
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
do u have the player prefab already in the scene?
nope
id say to try commecnting out the avatar part and then see what happens
attach the camera to the player
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
odd do u have the script attacheed to multiple objects?
wait I think the room hasn't been destroyed
looking at my logs and no new room is created
could u use onjoined?
OnJoinedLobby()
@jade glacier this is my code for spawning the player
omg I feel stupid...
what was the issue?
what part u in?
I used this tutorial https://www.youtube.com/watch?v=onDorc3Qfn0
For this tutorial on how to use the Photon 2 plugin in Unity, I will be teaching you how to make a custom matchmaking system. This will allow you to connect to lobbies, create rooms, search rooms, and join rooms. This type of matchmaking system can be found in popular games su...
But my controls are messed up and I have no idea why
I haven't gotten that far yet but are the controls only inverted in multiplayer
yes
but what do you mean inverted?
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
Hi I'm having problems zooming into objects using the 'F' key, anyone else having the same issue? (using unity 2019.3.5f1)
Where can I start to learn how to make fast efficient multiplayer games?
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?
any steamworks.net users here?
I've put steamworks.net as upm package here: https://github.com/0lento/Steamworks.NET/tree/unity-package
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..
@gray mortar Decide today if you are going to make it multiplayer or singleplayer and start building it appropriately.
alright thanks. i guess ill look up some tutorials on multiplayer then. i've never done anything with networking before.
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?
I’m having trouble with multiple entries being made into my sql data base when only one is supposed to be made
Hi, how can i connect manually to Photon Cloud??? @everyone
@brisk briar Maybe you need to do a some clear or push of msgs before disconnecting?
@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
@lilac creek I did look around for such package but didn't see any?
also this does have the IL2CPP build fix
ahh sorry
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 🙂
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
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:
Anyone able to help me make the connecting like this i dont want the game but like everything from when he clicks play game to when he touches the ground (excluding the player) https://www.youtube.com/watch?v=49MWFNUtZkc
@vital hawk sorry I just saw your messages, will definitely give this a try, thanks!
anyone know how to close a socket that's blocking without an exception?
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
@brisk briar create some kind of mapping table with callbacks
an array with 256 length of serialization delegates should work
@slim ridge how do you mean?
@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.