#archived-networking
1 messages · Page 96 of 1
I understand that. Say I wanted to use #if directives. How would I go about doing that?
Hi Guys, I have the following code with some errors I cant solve. I did ready the documentation regarding it but still I am not sure what it exactly means (or how to solve it). It's Photon Pun2:
BarrackItem item = PhotonNetwork.Instantiate(gm.purchasedItem, new Vector2(transform.position.x, transform.position.y), Quaternion.identity);
Errors are:
PhotonNetwork.Instantiate: barrackItem ist not available in the global namespace (this only apperas when using photonnetwork.instantiate with only instantiate it is fine)
gm.purchasedItem: conversion of barrackitem into unity.engine.gameobject not possible
The error names barrackItem, which is lowercase. Maybe that's the issue?
photonetwork.instantiate return a gameobject, barrackitem is not a gameobject
thank you...yes that is true I have another Script with it being public class BarrackItem : MonoBehaviour
is there any way to instantiate like this or however?
hey, So when i run the server in unity, it works fine. so i built it i am trying to run the build as dedicated server but i am getting this error. after a few seconds the server becomes active.
Server Thread stopped. That's okay. System.Net.Sockets.SocketException (0x80004005): Operation on non-blocking socket would block
at System.Net.Sockets.Socket.Accept () [0x00033] in <6b80e2850f1c48e6a227f0818ca6b227>:0
at System.Net.Sockets.TcpListener.AcceptTcpClient () [0x0001e] in <6b80e2850f1c48e6a227f0818ca6b227>:0
at Telepathy.Server.Listen (System.Int32 port) [0x00080] in <f2bef9456cf344faadd577c73c8957f7>:0
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
What is this, how can i fix it ?
i am using telepathy transporter and i have made no changes to the network manager
hey, im wonderng if anyone can help with a rabbitMQ implementation issue.
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
so i have this bit of code to retrieve and consume data from a direct exchange queue and write it to a global string globalstr. I am able to get the message into the string, however when i try to display it in a text field, text, it appears in the inspector but not in the field in the scene. Furthermore, when i try to write the recieved message to a file, it is not written. Any advice?
I would always start with the Getting Started tutorial on the PhotonEngine.com site.
@jade glacier thanks for the advice about pun2 man!
read it late but right before i started anything on my game
Hi, I currently use Photon for a racing game and want to use RPC to create a Dictionnary where to stock player name and time when they end the race but RPC dont like it 
EndRace is another script and Dic into is a static dictionnary
https://github.com/DennisCorvers/BitSerializer
New release.
Better performance and added support for Unity types,
Hi guys,
I need an advice. Below RPC is doing nothing (not even an error lol), it works for one client but that's it. I am not sure if I am missing a huge thing or if I just use the RPC on the wrong method, but yes I tried and tried and nothing.
On the Gameobject there is a PhotonView which I am ofc calling in the Script.
Code (CSharp):
public void UpdateTheHealthOfKing()
{
view.RPC("UpdateKingHealth", RpcTarget.All);
}
[PunRPC]
public void UpdateKingHealth()
{
if (isKing == true)
{
kingHealth.text = health.ToString();
}
}
Can't this work for an obious reason that I just didnt understand?
Cheers
Hello guys, is there any wiseman who had done load testing with Photon Server?
I want to do stress testing without real users engagement. Trying to optimize my client-server bandwidth.
@nova mural, I replied to your case in the forum.
you are everywhere are you 🙂
@paper stone, you can run multiple LoadBalancingClient instances in a single process. Make them act similar to real users and you can simulate a lot of them and analyze stuff. It's probably enough to simulate what is being sent.
@stiff ridge Ohh, that make sense! Thank you.
There are options to do load tests with server 2 server connections. This will allow even more scaleability. But if you run several clients per process and can distribute this across several machines and networks, you get there, too.
Gotcha
@unkempt goblet Wrong type of networking. Post these to #archived-resources.
Hey folks.. not sure if this is the right channel, but in order to have in app purchases and all that, I need a login/database system in place right?
@woven grail yea dont think this is the right place
but also i dont belive you need a login/backends/database
depends on where your app and dlc is sold by
'in app' probably means google and apple, unity have tools for that
Hey guys has anybody any experience with connecting unity to an aws lambda call?
How do I teleport players in multiplayer?
Hello everybody.
The project I'm working on connects to an online database. I managed through a PHP call to make friend requests between two users, and I wanted to make sure that if the recipient has the game open, he receives a notification in time in the game settings (maybe just show a red dot in the image, But this is not the point). To do this I thought of starting a thread that remains active as long as the game is open, and every 3 seconds it contacts a PHP page to see if it has received new requests. I was wondering if there is a better way to do this, or if my idea is the most obvious and convenient thing, thanks in advance.
generally speaking this situation is handled exactly the way you described your approach
or by something like a websocket
where when a request comes in you can check to see if that client is actively connected
and rather than having the client continuously poll just send a message via the websocket
but you should be able to handle this approach just fine with polling
I understand, but I was wondering if there is a more optimized way, because in this case I would contact a web page every 3 seconds, but I could not find other better solutions
3 seconds is a very fast poll
at that rate you'd be better off doing something like websockets
alternatively
you can do what's called a long-poll
where a client sends you a request
and you don't answer it
you let it sit on the webserver
for a couple of minutes
this is brilliant, I hadn't really thought about it!
but doesn't the same problem remain? assuming the client is online, from the web how do I tell to contact him? it still has to have a listening thread right?
and then if a request comes in
you check against your active long poll clients
and respond to the long-poll
this is basically the same as a websocket approach just without the active socket
there's some really big scalability issues that come into play here
idk what kind of size you are targetting
but in this way I only move the therad that has to work on the server instead of the right client? and if I have several clients this might not be convenient for me
having an open request doesn't necessitate a dedicated thread
you'll want to be using asyncronous responses
I have never written php
so I have no clue what that would look like in php
in C# you could do this stuff using couroutines
ye don't worry about that, but on c# i'd necessitate that thread, even with async tasks
well you could just have 1 thread that manages all of them
you don't need a thread per client
on php you mean
on anything
I'm talking about on the server
clients will need a thread that they can send messages from
but I don't see a reason it has to block waiting for a response
sends request out, each tick checks if anything has come back yet
that can be done on any thread
not a dedicated thread that just blocks until response is recieved
it kinda make sense
but still a little thing is not clear to me
i send a request to a php page, making a long poll so the server won't response until it noticed something happened right?
yea
on the server side, i will need to check with a while true to see something happening right? like a variable chances to the databse or something like that
and that while true will freeze my server, so i'd need a thread for that no?
if you chose to write it that way yea I guess you'd need to do that
I would personally do something like
hash table of userid to long poll
when a different request comes in that triggers something related to a user id
look up whether or not that user has a long poll waiting
then trigger thatlongpoll to continue it's work
via a lambda or continuation function
depends on the framework
sorry but this is not really clear to me
as I said I've never used PHP, it's a really odd choice of language to be implementing this in imo
so I'm not sure how to answer further
okay maybe I understand, in the server every time I receive a new communication I save it in a list, and when I check that particular event I check in the list if the communication is present and I reply to that?
Hey everyone! Quick question: what networking solution would be best for a modular card game asset (customizable, make your own designs, works for any type of card game) that will be sold on the Unity Asset store?
PUN probably wouldn’t work since you can’t “resell” other asset store stuff. So that probably leaves either Mirror or MLAPI. From what I gather, Mirror is more stable/reliable, but MLAPI is now part of the Unity family so it’ll be the more future-proof option. I’m just hesitant to use it because I’ve been burnt by trying out Unity’s WIP packages before.
So to be concise:
- Is MLAPI functional and stable enough for a card game system (playing cards, CCGs, etc) that is going to be sold on the Unity Asset Store?
- Or would Mirror be the better option?
I did a quick google search and it turned up more tutorials for Mirror than MLAPI, so at the moment I’m leaning towards Mirror. (New to networking so tutorials are a must). But all the same would love feedback from the community on Mirror vs MLAPI for a card game system.
How compatible is IL2CPP with directly using the OSSock methods in .Net?
I'm wondering if it would work to use the OSSock send/recv functions directly without breaking IL2CPP
Are code reviews allowed in here? PUN2 specific
LSS: I've made a wrapper class to handle all RaiseEvents and OnEvent() calls. Is there any downside to centralising them in one class instead of having multiple classes inherit from IOnEventCallback?
What you do with the events is your business. Pun2 is just a messaging layer when you use it for RaiseEvents. Up to you how to process them.
fair enough, cheers
Can anyone help me here? I've been trying to fix this for a while. I am currently getting an error for my shooting system. spawned object not found when handling command message netid=0
Here is my source code. I'm sure that it's a simple mistake that I'm overlooking since I'm a beginner and I would appreciate all the help.
https://hatebin.com/hclnrtvqvc
^^ Mirror in unity
how do you guys test ur networking? i use parrelsync and its insanely laggy for the unfocused instance
it also lags if i build and run and use that as my second instance
Desktop + laptop / Desktop + housemate's pc usually
Alternatively Desktop + someone on the internet that you've wrangled into being your guinea pig
@random matrix Copy your whole unity project, then in the copy delete the Asset directory and then make a junction link to the original
then you can open the 'same' unity project 2ce
code and asset changes 'copy' instantly
Smort
Issue if a build and editor is causing lag tho
2 editors would no doubt be worse
mklink /D Assets PATH HERE
yea depends on pc specs
need a kinda good one to run 2 unity instances
That is good though I gotta remember that one
so worth it
run that command above in the copy, and change the PATH HERE to the path to the origional assets dir
it dosnt work with project setting or the new unity packages
got to recopy those
the issue was the lack of an fps limit
that'll do it
I have an editor tool for the above https://gist.github.com/IronWarrior/005f649e443bf51b656729231d0b8af4
What's a sustainable amount of network calls per second for something like syncing player movement?
IIRC csgo uses 32/64/128 tick servers, is this the amount of network calls they make per second?
Tick rate usually refers to the update frequency of the game simulation on the server.
Data can be sent over the network at different rates (often an exact fraction/multiple of the tick rate).
How much is sustainable depends on how much data you're trying to send, how often it updates, and how quickly you can serialize and deserialize it.
Thanks @dense hedge I picked 20 per second and it seems to satisfy my needs
@prisma parcel https://dontasktoask.com
hello? I want to make an multiplayer game with photon but i never used it.Someone wanna make game with me with collabration system?
@prisma parcel Links to collab posts are linked in pins in #💻┃unity-talk
@keen plover This is not a advertising board. You can find links where to post collab requests pinned in #💻┃unity-talk
Which you've been told already on this account.
But where is the link
Can you send me here
The link
Thats stupid, why just dont make section for collabration
@keen plover #💻┃unity-talk message
Is a lockstep car going to feel very unnatural?
Assuming you're in the < 120ms ping range
@teal obsidian there's a lot more to it, but if you want a really rough idea how your game will feel you can just simulate 120ms input latency (buffer your inputs for X ticks before populated them). Lockstep determ is also a pretty big topic, since anything using Unity's physics will not work deterministically for networking.
there are options like Quantum for rollback determ, and you can always just do state sync (send the car positions/velocities over the network) that might work for your use case
uses its own physics engine, with fixed point numbers (floats are not deterministic cross platform)
PhysX will diverge even between intel/AMD, so not an option even with PC only for determinism
Do they have their own version of a wheel collider or something similar to what physx has?
not entirely sure. There's been some driving games published for it, but not sure if they used kart physics tricks or have a built in component
https://www.photonengine.com/quantum some stuff in showcases
The revolution in multiplayer games development! Create MOBAs, brawler, RTS, fighting and sports games with the blazing fast deterministic networking engine: QUANTUM.
i don't understand why people are still using photon... it uses rpcs which can be manipulated on the clientside
How would you re sync a character controller when doing prediction? Do you just call cc.move multiple times in one frame?
I know the process of it, but the docs say not to call cc.move more than once per frame
Hi, I'm currently trying to make a firebase realtime database for a game that will store XP and level, but when I want to RootReference the data base it never end
It never Debug.Log(...) so DBReference is always == null
:/
Quantum has its own vehicle simulation even, not just wheel collider.
Photon makes a few different networking packages that handle authority differently. If you're referring to the quantum link above I posted, clients cannot tamper with the state in quantum (though they can in PUN).
...which isn't necessarily a bad thing. Many successful projects allow clients to tamper with the state, cheating simply doesn't matter that much for many games
Can anyone help me??? How do i instantiate a gameobjects in my scene with mirror(from the networkmanager spawnables)
that's interesting is quantum something new they've brought out? previously people could manipulate rpcs with photon which would generally end in situations where they can crash servers or kick players simply because of this for example look at phasmophobia that used rpcs and those could even be manipulated on the api level since unity can be fairly easilly disassembled and reassembled I won't name programs for sake of not spreading it but when your able to manipulate it like that it's an issue mind you that's also partially on unity and while l2cpp is alot more secure for that its still quite easy to manipulate there is actually public tools which can do it as well atm
Can anyone help? If i have a big project that have a lot of objects in it some which a user might never use should i include everything in the client's side or keep it in a server and send them the object when the client need it (if sending unity object from server to client is possible)
gotcha I've always just used mirror instead of photon so never tried it
again photon is a set of various technologies
photon is the umbrella name
photon bolt, photon quantum, photon fusion, photon PUN, photon realtime, photon server, photon voice, photon chat
they are all different techs/products
yes
What are strategies for syncing AI-entities? Aside from just including them in the snapshot
Is deterministic AI possible using Unity built-in tools?
not really...
I mean... determinism is normally all or nothing
You can achieve some things like: same decision be made (given ALL of the data you use is very very same - which is a challenge in itself)
I would not count on that being a given
better just to make bots part of your state... Assuming you have interest management... Should be fine
Can result in very large snapshots given many AI-entities, no?
well, yes and no
Depends on:
- how efficient your snapshots are
- how good your interest management is (and how well your game benefits from it)
- how many AI bots
But determinism is really a full commitment... if you go, you go all in, there's no mid term...
And nothing in unity is deterministic, so if you want to go that route, know in advance that you will give up on:
- physx
- unity navmeshes
- any asset store asset that messes with gameplay
- float numbers
This bit really helps
Does Pun 2 free support cross platform multiplayer between Mac and PC
@weak plinth yes it does
for anyone who needs to download multiple files w unity web request https://github.com/jpgordon00/UnityGroupDownloader
Hey guys so im using photon for networking i have everything understood amd working the onpy issue i cant wrap my head around is how to make a party system like in games apexlegends, cod warzone, fortnite where before a match cam be started friends can join and chat and stuff
Should i create a room when connected to the master server with custom properties having the name Party
And so before the players joins a match room they get removed from the party room
#hopefullysomeonereplies 👉👈🥺
You can do that, or just keep them in same room and just start the game when it needs to
There is no 'right' way to do it
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!
Scroll down to Matchmaking Slot Reservation
@arctic iris you use a third party service for party, and in Photon you simply create a room with the expected players
hello, use firebase to make a database of the leaderboard,
In android it works, but when I want to make the webGL version it won't let me do a compilation, can anyone help me?
@west quarry the firebase Unity plugin doesn't support webGL, you have to use alternate solution to make firebase available on webGL
@grave ice third party services such as? Could i user mirror networking to create the party system and then photon for the rest
@shut yarrow i cant do that since i cant join the game room once already in a party/lobby room and when i try to leave the party room to join the game room it outputs and error
you know some simple and free solution. I want to be able to upload the game to icht.io
I remember there third party library available
try google firebase unity webgl github
the only thing I have found is this:https://www.youtube.com/watch?v=fg_aiGVeKc4
Are you looking to develop a WebGL Unity App and you want to use Unity but just found out the Firebase SDK doesn't work? This might solve your problems!
Firebase WebGL Realtime Database library I made: https://github.com/rotolonico/FirebaseWebGL
Firebase WebGL Implementation example: https://rotolonico.github.io/FirebaseWebGLIm...
https://github.com/rotolonico/FirebaseWebGL
think can try this, i never use it before
I'll look at it, thanks 😀
Should one worry about sending frequent packets
Or is it just about bandwidth i need to worry about?
Is it okay to send some light stuff at higher frequencies while sending the heavy stuff 10hz for example
using mirror rpcs btw, i'll be calling frequent rpcs for the light stuff
I guess i wont have to worry about that as i am packing all these little things into a single rpc
Its always gonna be the same amount of rpcs called per second
And if you are concerned about bandwidth, consider bitpacking data
i see
https://github.com/DennisCorvers/BitSerializer
You can use this. Or anything that accomplishes the same
At the very least you can use some of the compression algorithms used
allright, i won't write my own then
i had a something similar going going on in my project but no compression and stuff
is it possible to use Mirror Networking to create Party System like, Apex Legends, PUBG, Fortnite, Warzone and use Photon networking to be used as the primary multiplayer networking option since i can't create lobbies/parties with photon
Probably
But I'd not use Mirror for things like that
Since it shouldn't have anything to do with Unity
What do you mean exactly by that?
I assume you are talking about a matchmaking server?
Yes
Basically i can't make a lobby system using just photon like in battle royale games
Where friends can join u on the lobby scene
A matchmaking server doesn't have anything to do with Unity
It just tells clients where they can go
So you shouldn't make it with/in unity
Matchmaking side photon covers doesn't it? When creating rooms and such
If they have a matchmaking service available, I'd use that
Okie
no u need a third party service such as photon chat or firebase chat or some chat service
you can though. Have all of your friends join the same private room, either name it something consistant (all friends named alphabetically joined) or use a service to communicate the name
that room is your lobby scene
@arctic iris then follow the matchmaking procces for multiple players, like the guide i sent you yesterday
@grave ice i tried that it can't create or join another room if a player is already in one hence being in a lobby room and when i do leave room before joining another it doesn't work and outputs an error which i will show in a bit
You can use third-party tools like Playfab, Steam API, ....
that's only 2 of many examples bringing you matchmaking features
If you don't wanna code your own matchmaking server
@patent fog talking about Mobile platform!!
it;s gucci lol
Or I don't know, go for Google Firebase for example
Whatever server tech is easier for you
photon is good i just don't know how to make a party/lobby system imma look at it
yes they do it does but just some technical problems im facing imma post the errors in a bit wait
Errr I won't help you debug multiplayer, that's time I should spend on my project :p Maybe someone else will 🙂
I guess you started from here https://doc.photonengine.com/en-us/realtime/current/lobby-and-matchmaking/matchmaking-and-lobby
Global cross platform multiplayer game backend as a service (SaaS, Cloud) for synchronous and asynchronous games and applications. SDKs are available for android, iOS, .NET., Mac OS, Unity 3D, Windows, Unreal Engine, HTML5 and others.
haha lol it's ok imma post it so i get help from anyone who can!! and yee
public override void OnConnectedToMaster()
{
RoomOptions roomOptions = new RoomOptions();
roomOptions.IsVisible = false;
roomOptions.MaxPlayers = 4;
roomOptions.CustomRoomProperties = new Hashtable() { { "roomtype", "lobby" } };
PhotonNetwork.CreateRoom(PlayerInfo.username, roomOptions, TypedLobby.Default);
}
// Player Joined His Own Lobby!!
public override void OnJoinedRoom()
{
SceneManager.LoadScene("LobbyScene");
}
// On Click Ready Button!!
public void OnClickReady()
{
PhotonNetwork.LeaveRoom(); //Leave The Current Lobby Room Before Joinning The Game Room
}
// Once The Player Leaves i Join/Create The Room For Game Scene
public override void OnLeftRoom()
{
PhotonNetwork.CreateRoom("TDM");
}
Operation LeaveRoom (254) not called because client is not connected or not ready yet, client state: Leaving
UnityEngine.Debug:LogError (object)``` @grave ice
oh wait i think i know what you mean basically photon.chat will connect a player to a chat which is a room on it's own so that friends can be in the lobby/party room together!! right? or am i wrong again lol
@civic cave Remove the old one when moving questions
sorry mb
Using latest Netcode package, can't uncheck any rendering components for server. Is there a step I'm missing?
@arctic iris yessir exactly
There is no job advertising here. #💻┃unity-talk message
Can anyone suggest a networking library I should use right now?
I'm using mirror right now but are there any better alternative like is MLAPI usable right now?
if (photonView.IsMine && Input.GetKeyDown(KeyCode.Alpha1)) { photonView.RPC("Equip", RpcTarget.All, 0); } [PunRPC]
void Equip(int p_ind)
can anyone tell me what wrong with this the equip does not go through the network
Does anyone who uses Mirror know if there's a way to Serialize a private Sync Dictionary so it shows that read only view in the inspector? [SerializeField] doesn't seem to work, though it shows if it's public
What is the multiplayer type of coin masters called? Trying to look at tutorials for this kind of multiplayer interactions
All the stuff i can find is either realtime or turn based
Okay so after I imported Pun (Photon Unity Networking) i realized the resources folder that has the PhotonServerSettings isnt there, I re imported Photon again and still not there. What should i do?
Photon\PhotonUnityNetworking`Resources\PhotonServerSettings.asset` - That is missing
I would also like to note that im on Unity 2018.4.32f1
Okay I got it
After a cleared all of my errors in the code, the Photon setup popped up, which created the resources folder and the ServerSettings
I have a character controller that uses a dynamic rigidbody. Would I run into issues if I were to make a multiplayer game using it?
I have no experience doing online multiplayer and was wondering if that's something that would be problematic for online play
@vast grail If you're using prediction on the client then yes, the client rigidbody and the server rigidbody will diverge over time
when they diverge enough, you need to initiate a process called "reconciliation". Essentially you just move the character back to the last known position from the server, and then re-play all clientside movements on that rigidbody, all in one frame, from that last movement, up until the client's present.
anyone here good with pun2?
I want to make a region change system with drop down, I wa sable to make one in pun classic, when I recreated it in pun2 it would connect to the region but I couldn’t join/create a match
Whats the easiest Networking solution atm?
PUN is probably the most convenient one to put something together. More expensive Photon products deal with more complex requirements. Mirror's community makes dealing with stuff easier if you are looking for something free.
why would you want to switch from mirror
mirror is easier in my opinion
im using mirror in my companies app thats launching in july so its def production ready
@grave ice roger roger!
Hello peeps, do someone know if there is a possibility to test the state synchronization with LoadBalancing tools for the Photon's PUN components?
which type of P2P is better can anyone explain me or give me a doc for that ?
Because there's other options which are more mature, robust and optimised
P2P is just a bad term, best to be more explicit about what you mean by that. Typically people who say P2P either mean Relay (like Pun2) or ListenServers (like Mirror or Bolt where one of the players hosts) @gilded compass
There are no actual P2P options with the libraries you are looking at. P2P implies every client directly attempting to connect to every other client.
So, a bit short notice, but here we go.
I’m starting a regular stream (every Wednesdays and Fridays at 22h CET).
Main topic will always be developing an online game prototype from start to finish:
- game design ideas
- discussion of which netcode technique to use (will always be either quantum or fusion, representing determinism and state transfer approaches)
- implementation of gameplay, view, UI, and other things when apply (matchmaking ideas, spectating, persisting sessions, etc)
I’ll start today with a guest to discuss game design for the first game (which will be with quantum) and implement a few basics depending on what we decide to create (not defined - whoever joins will participate with ideas).
Looking great, looking forward to it 👍
Good luck!
where should I get started to add multiplayer support to my project?
Adding networking to an existing project is the uphill way to go about it
Probably wanna get some experience doing some multiplayer projects from scratch. Also allows you to evaluate potential networking solutions
if i remember correct someone write in a blog about 2 type of "peer to peer" architecture one is like "One player host and others are clients" and the second one is "All of players client and they are connecting themselves" i dont wanna use photon cause of the budget issues i am looking for a totally free option to do that
Your options are very limited if you don't want to pay anything. Best you will do there probably is maybe Mirror and trying to use Steam's relay service. Which is going to be Listen Server (client hosting) with a relay fallback for nat punchthrough.
I don't actually know what people have made work on that front, but if you join the Mirror or Mirage channels they may have some ideas.
Mirror has fragmented into three groups as far as I know, so I have no clue what people are using on that front.
you mean this https://assetstore.unity.com/packages/tools/network/mirror-129321 right ?
I imagine host migration would be a problem with Mirror.
I don't think host migration is something you want to deal with. If the host leaves... just let the game die 🙂
I want to make the multiplayer part like Left 4 Dead games one player gonna host and others will join from room loby or something i did an example with photon but i dont wanna use it
Many, many many people do not agree with that sentiment
You probably are working backwards.
You have limited yourself to about one type of possible network topography with your budge restriction of zero dollars... so I would first do tutorials with your only options, and see what they are good at and not good at doing.
THEN think about your game.
ure correct but my game is not gonna be a long term game i guess one match will take like 20 min max
For a game like Left 4 Dead you probably don't want the match to die
^
Oh I am sure.
Vermintide 2 has no host migration. Which has continuously led to great annoyance of its playerbase
Not saying people want that, just that you are bordering on begging chooser here... first see what the tech available to you can do before dreaming up your game.
Because if the host ragequits after 15 minutes, gg everyone else just wasted 15 minutes of their time
is vermintide dedicated ?
Vermintide 2 uses its own engine and netcode
You have eliminated like 90% of your network lib options, so see what is left can do first.
Ah. Thought I remembered the name from PUN network culling tips. Maybe it was Vermintide 1?
You can make host migration work on any platform, you just may have to do a lot of that coding yourself.
PUN doesn't have a host, so migration isn't a thing. The relay is always there as long as there are players. So different animal.
Uses the same engine as VT2. VT2 just has a newer version
Bitsquid engine
Apparently
What network libraries have you tried making something with so far?
actually i just try to make my own dedicated sever with c# and i did also with Photon too but than i realize i dont have a budget
Oh was thinking Verdun.
@spring crane https://en.wikipedia.org/wiki/Bitsquid
Might be an interesting (or weird) read
No idea what they are developing their new game in. Don't know what it's called either
i cant even get mirror to show up in unity
im on 2020.3.0f1 so asset store is gone
on the website i try the open in unity button and it doesnt do anything
Grab it from the package manager
it isnt showing up there either
Are you viewing "My Assets" on the package window?
its set to Unity Registry
It's not made by Unity, switch to "My Assets"
oh i see it
so for adding chat how would I do that?
Has anyone here used unity collab before? I need some help.
@full light Looked up Mirror chat tutorials?
ill do that now
Hi I am building my own Socket Networking Solution and I basically want to run the project twice on the same machine( using different ports) as I dont have 2 devices. I am able to connect both Games with each other, but as soon as one game is out of focus, it is on hold somehow and the sockets dont do anything anymore until the client that should have received the message regains focus.
I am basically building a fighting game with peer to peer networking for a project
Does anyone know a workaround for this or is my approach generally wrong?
Are you sure the game isn't 100% paused once you alt-tab out of it?
I open them windowed beside each other, so i dont really alt tab
@drifting turtle Build your game with exclusive fullscreen and it will continue to run in the background
@drifting turtle look into junction links
You can clone the unity project and link the asset directory to the original
Now you can open 2 instances of unity on the same project
And changes are copied
Hi, how do you get username and password forms to use unitywebrequest from a website
I solved this by having 2 build folders, I realized that it is not an out of focus issue but rather that my code had some undefined behaviour
How does one design a system that rollbacks on states and can also predict object destruction/creation as well?
It's very hard to keep track of what object gets created, what object gets destroyed, what objects creation was predicted
Unless i send the whole data of all objects everytime/every tick from server, it gets very complicated
Any tips/suggestions?
Watch the unity fps sample network talk. They solve this in a very interesting way
@weak plinth Allright, ill check this out thanks
Does this also talk about prediction of creation of objects?
@weak plinth
Afaik, yes
I am trying to do a system that players projectiles are handled just like local player, with rollbacks
You can throw grenades for instance, so that's prediction of object creation for the client
oh, i see
They include some data in the header of the state in a very creative way to solve this
Hi, does anyone want to help me create a simple discord bot for our server? I want to be able to pull images random images from Reddit with it, e.g with a command /cat would return something from r/cats
So far I haven't been able to read the reddit API, I am wondering how is this done, I am using Node JS with the Axios package.
I have it setup ATM like
{
await axios
.get('https://www.reddit.com/r/cats/random.json')
.then((res) => {
console.log('RES:', res.data[0])
})
.catch((err) => {
console.error('ERR', err)
})
}
This returns
RES: {
kind: 'Listing',
data: {
modhash: '',
dist: 1,
children: [ [Object] ],
after: null,
before: null
}
}
In the console
I am not sure how can I get the "url" that is inside the children array
Can anyone help? If i have a big project that have a lot of objects in it some which a user might never use should i include everything in the client's side or keep it in a server and send them the object when the client need it (if sending unity object from server to client is possible)
@jagged lantern children is an array of objects containing among others a data.url (or thumbnail - lots of things in here, dunno if that's the most interesting for you as an image, but it gave me a nice pic of a cat). So starting from your example, smthg like that
else if (command == 'cat')
{
await axios
.get('https://www.reddit.com/r/cats/random.json')
.then((res) => {
console.log('RES:', res.data[0])
// early-exit if no children
if (res.data[0].data.children.length < 1) return
// assumed multiple iterations because children is an array
// but I guess will always give only one as it's a "give me a random one" query ?
res.data[0].data.children.forEach(child => {
const url = child.data.url
// or if you prefer the thumbnail:
// const thumbnail = child.data.thumbnail
console.log(`My nice cat URL ${url}`)
})
})
.catch((err) => {
console.error('ERR', err)
})
}
Thanks for help, but it returns "UnhandledPromiseRejectionWarning: TypeError: Assignment to constant variable", what did I do wrong exactly?
Never mind, my bad, I had one equal sign too few
I got it working, thanks a lot
(message.channel.send(`${url}`));
To actually get it in the text channel
Should be okay to just `.send(url), no need for the string literral
Other than that, glad you made it work
So for my lockstep car, when I receive the info packet from the server I:
- Set position of the car to server's position
- Set rotation of the car to server's rotation
- Set steer angle to server's steer angle
- Set motor torque to server's motor torque
The only problem is that cars are not deterministic, so after the motor torque, it ends up in a very slightly different position than the server's
am I doing this right? Lerp should take care of the inconsistancies right?
I watched a tutorial online and they only did position and rotation, but when I do that, the car just doesn't feel right when driving it. It only feels right if you apply steer angle and motor torque
i set up mirror in my project and got player movement working
but im not sure how to get each player to have their own camera
I am trying to create a basic program that uses LAN WiFi to link two or more mobile devices but I have no clue where to start. Does anyone have a W3School style link that chould point me in the right direction? Please and Thank You
Does anyone know whats the most taxing resource for a multiplayer game server? Im planning on making my game multiplayer and was wondering which resource is most heavily used; cpu, ram, or gpu. Also what is a "good" internet connection for said server?
It heavily depends but GPU probably isn't used that much because the server typically doesn't need to render anything. I'm not saying that it can't be used for other math heavy tasks but I don't think that is very common on a gameserver. How much CPU and RAM is used also depends on how much data has to be processed, and how many operations have to be done with the data. The more connected users you have, and the more operations you have to do on the data, the more CPU it will take and the more RAM you'll need. To give an idea, I know about multiplayer servers that had 150 connected users and they would run on what now would be considered old hardware (this was about 10 years ago) while your typical desktop today would be much more powerful. How much bandwidth you'll need and how fast the network has to be is also very depending on how many users you'll have and how much data they are sending. It's difficult to say because there are so many variables, and the efficiency of how you deal with this can make a big difference. Are you going to use 4 bytes to send someone's age over the network or are you going to use 1 byte because the same number can be represented while also saving 3 bytes? How often are you going to send this data, and how often will you send positional updates? It could be 100 times a second but you might be able to get away with only sending 10 times a second with some clever tricks (or even less depending on the game)
wow, thanks
Is there a way that you guys interpolate properly when lerping a visual model to a networked entity? Obviously lerp by itself in update() is pretty useless because of fluctuations in frame rate so I've defaulted to using vector3 smoothdamp with OK results
just would like other people's opinions or if there's another method I'm missing
That's why most systems use buffers and fixed tick rates
Can you explain a bit more?
My system uses a fixed tick rate
I think I've asked this question before and people say "just lerp the position" and don't really give any further information on how exactly you lerp it properly
How do i get the forms variables from a website to put on the unitywebrequest.post?
Hey guys so i have created a lobby using photon chat as @grave ice suggested. All works friends can join the channel of a player but i wanna show everyone the player who joined physically in world space so how can i use photonRPC to show everyone the player Cube for example in the scene
Hi everyone, new to Unity3D networking here, I was wondering what was the recommended system for an instanced game with up to 10 players for an action based third person game. Would it be MLAPI or maybe DOTS?
Hi guys, I am here with a bug I can't solve 😦 (using PUN 2 btw)
I've got a button on a scene to create a room, when the user clicks that button the room is created successfully, I know this because OnCreatedRoom and OnJoinedRoom trigger, although they trigger twice for some reason (not sure if this is a problem).
Then I've got another scene where I want to list all the created rooms, on this scene I've got OnRoomListUpdate but this callback never gets called, any thoughts?
I'm using PUN 2 and this ain't working if tried Photon.Pun.IPunObservable and just IPunObservable
This is my errors
Fixed the issue
does anyone know of an http client library that allows me to add parameters to web requests? I know i can just tack on "?key=value" to the end of the url but i hate doing that
Are you looking for POST requests? Any Http Client should be capable of that.
im using mirror for my project and having some issues. so far i just have it so the player is a ball that can be moved around with wasd physically, for the host this is normal. but whenever a client joins it appears to them very jumpy
this is what it looks like to a client
and for some reason the client player moves significantly slower
where is a good place to start out learning about syncing data to a server - for example, a player is playing a single player game that requires an internet connection only for the purpose of preventing cheating (prevent changing how much money they have in the game etc) ?
you should learn about game backends
@amber delta not exactly your question but it applies https://www.youtube.com/watch?v=BxQAqADGY_k&t=1900s
This is a deep-dive straight into the guts of running a low-latency multiplayer game, such as a first-person shooter, on a global scale. Amazon Gaming Solutions Principal Nate Wiger dives into architectures that enable you to split apart your back-end APIs from your game servers and Auto Scale them independently. He explains how to run game serv...
i would probably just do a PlayFab tutorial
i will do a bit of all of the above 🙂 thank you
using UnityEngine;
using UnityEngine.UI;
using Mirror;
public class PropSlot : NetworkBehaviour {
[HideInInspector] public GameObject model;
public GameObject propPrefab;
[HideInInspector] public Text slotText;
private void Start() {
slotText.text = model.name;
GetComponent<Button>().onClick.AddListener(SpawnProp);
}
[Command]
void SpawnProp () {
RaycastHit hit;
if (Physics.Raycast(ClientScene.localPlayer.transform.position + new Vector3(0, 5, 0), Camera.main.transform.TransformDirection(Vector3.forward), out hit)) {
GameObject instance = Instantiate(propPrefab, hit.point - Camera.main.transform.TransformDirection(Vector3.forward) * 2, new Quaternion(0, 0, 0, 0));
instance.name = "Spawned" + model.name;
instance.GetComponent<MeshFilter>().mesh = model.GetComponent<MeshFilter>().sharedMesh;
instance.GetComponent<MeshCollider>().sharedMesh = model.GetComponent<MeshFilter>().sharedMesh;
instance.GetComponent<Renderer>().material.color = new Color(Random.value, Random.value, Random.value);
NetworkServer.Spawn(instance);
}
}
}``` i have this code but I cant figure out how to make it so props spawn for all clients with mirror
how do i do the network
I need help making a P2P connection
When one device hosts, others should be able to connect by "Searching" for a game
Does anyone know a good tutorial series on how to create a dedicated server executable for your unity game for playfab?
This Unity Multiplayer tutorial will teach you how to set up your own dedicated server using Azure PlayFab.
PlayFab: https://playfab.com/
Demo Repo: https://github.com/natepac/playfabmirrorgameexample/tree/master
--------------------------...
Or do a google search with words you used in your question. Or search for "headless" builds, thats how they are often called
Thanks!
I'm trying to run 2 networked editor instances using photon. I've duplicated the project files, and created a symlink for the assets folder. Is that all I need to do?
Can anyone put me along the right lines on how to research this topic? I'm trying to create a game that has many NPCs walking around randomly. I want to sync the NPCs positions over a network but I want to remove as much of the bandwidth requirement as possible. Originally I had just sent over the initial seed for spawning them all which worked until it didn't. Useful, but not 100% accurate. I'm struggling to put the question into words that yield good google results. Anyone know of any resources that have attempted similar?
Context I'm using PUN if it makes any difference, although I think what I'm looking for is more of a design pattern which I would presume to be framework agnostic
Mirror has their own Discord for support. Link is in asset store description.
I am making a racing game to play with my friends but am stuck trying ti figure out how to spawn everyone on the starting grid
My idea so far is to make a lobby and wait for everyone to connect and when pressing the start game button everyone will be sent to a random starting position based on the number of players
My questions are :
-How can I make a lobby for everyone to join?
-How do I spawn players at different loations
Those questions require quite different answers. For the first one, about a lobby, it's probably larger scope that can be handled in Discord
You'll want to pick a networking solution and learn how to make a lobby and server in that, Mirror is a common choice
Second question isn't necessarily related to multiplayer. You'll probably want fixed points on your starting grid where cars start. And then yeah, your guess about sending everyone to a random position is a good solution
It appears that forgot I to add that I use Photon to handle the multiplayer
guys i want to ask a stupid question i think but ..... when i type Network in add component i don't see any of network manager or network identity or any of that, so how can i get them or i have to buy a version of unity or what's the deal??
Are you following an old tutorial? Unity no longer has it's own networking solution
yes i am
so is there any solution? 🤔
Mirror is probably the closest to what you're following. Other option is photon PUN2
which one is the best or it depends?
Depends
I'll stream again tonight (regularly every wed/fri, 22h CET): https://www.twitch.tv/erickpassos76
Stream: creating an online "roguelite" on Photon Quantum
Expected for tonight:
- Animated graphics for character controller
- Comments on strict decoupling of simulation vs view and other best-practices
- Playtest with community!
- Discuss next mechanics to implement with community
- faster pacing when coding (first stream was a bit slow)
Hey guys so i have created a lobby using photon chat everything works friends can join the channel of a player but i wanna show everyone the player who joined physically in world space so how can i use photonRPC to show everyone the "player Cube" for example in the scene to everyone without creating a room!!
Anyone know the difference between the Unity networking package coming out in April vs Mirror?
Hello guys, has anyone seen this error? Unable to open archive file? I'm using assetbundles
So I'm using the difference of UTC to try to calculate the latency between client and server, so that the client can estimate which tick the server will be on
however it doesn't appear that UTC is synced at all. It works fine on lan, but when my friend connects, he's off by like 20 ticks
is this normal or does it sound like I'm just doing something wrong?
DateTime.UtcNow.ToString("yyyy-MM-dd hh.mm.ss.ffffff"); This is how the server sends the UTC time ^
DateTime.UtcNow - DateTime.ParseExact(getData.Time, "yyyy-MM-dd hh.mm.ss.ffffff", System.Globalization.CultureInfo.InvariantCulture); ^ And this is how the client processes the difference
I'm probably doing something wrong
Client is off by like 200ms. Like it's not even close
time will never be sync'd. Each side of the connection can use time in it's own behaviour but the best you can do is bank on time passing for each side at a predictable rate and then fix any drift as you detect it.
alright
What I'm planning on doing is when the server detects that client sent a late packet, tell client to increase tick
or if hes sending packets too early, tell client to decrease tick
I just wanted to make sure I wasn't doing UTC wrong or something
i had a lot of problems with that myself and still do sometimes. I run my server(s) in a virtual machine and sometimes that thing has it's time all messed up
Yeah I had a friend run my server in new york, I live in california, and the times are completely desynced
and then I restarted my game and it was somehow fixed, then it was broken again even when I was hosting
very weird
in my solution i throw all the input ahead by a certain amount and when that starts falling behind/getting ahead i do a resync to force the client back into the right sequence
You mentioned you use time, are you using UTC?
yeah
i just get the now in utc every frame and check whether i need to do another step
ok
well, it's a bit more complex than that but it's the general idea 😄
I don't think I do that. I make the server send it's current tick, along with a timestamp UTC and then client uses that to determine how many ticks have passed
to estimate which tick he should be on
ah, so i guess the key point here is you need them both to determine how many ticks have passed on their own 👍
if the server doesn't, then he can't have authority
Server ticks on his own
so he keeps ticking every 20ms no matter what
client just needs to get his packets in by that tick
if client sends a packet with a late tick, it gets dropped
but yeah UTC is acting very weird despite a lot of people recommending syncing that way.
it should be able to run even if the client has his clock set back 3 and a half years
actually I might be doing it completely wrong
I'm only doing server->client and getting 1/2RTT from that
I think you're supposed to do client->server->client
so you know exactly how much time has passed
you got a good RTT calculation?
on lan it works
but across a network UTC is around 200ms off, when I do the server->client timestamp
I'm most likely going to ditch that method all together. I'm most likely just going to have the server send it's un-altered current tick to client, then client applies that un-altered tick
then server tells the client to either increase + 1 or decrease - 1 every tick
until he's sending ticks at the proper time, not late or early
I think that's what unity does with their multiplayer, or something similar but a bit more advanced
They only do an initial estimate when the client connects
Is there an FAQ for this channel? I'd imagine questions like "how do i look into interpolation with Photon PUN" probably get asked a million times a week on here
never mind, i have thought of a little workaround but if someone knows of an FAQ still @ me so i can learn things
Official documentation for whatever package you are using is probably your best bet
@teal obsidian UTC is not usable for calculating rtt 🙂
@graceful zephyr Thank you
you need to calculate rtt some other way
easiest is to piggyback on your network protocols acks/nacks
and figure out approximate rtt that way
can't I just timestamp on the client, send it to server, and have the server reply
and just measure the time it took
yes you can do a separate ping msg if you want
alright
what are you using ping for?
syncing tick
ping isn't really useful for most things in networking
at least not if ur talking about client prediction
server reconcilliation
snapshot interpolation
etc.
that kinda stuff
wait I'm not using pings
well rtt/ping same thing
I was originally (wrongly) sending UTC timestamp from server -> client
and trying to measure latency
I'm new to this stuff, thought it would work
definitely did not work
alright
My new way of syncing tick, is just to tell the client to either increase/decrease his tick
if its too soon or too slow
some people use ping/latency to mean one-way (which is impossible to figure out without a third party)
and some dont, etc.
shit gets confusing when there's no standard meaning to the terms
I did however get to test my lockstep cars the other day, when my friend hosted the server on his machine on the other side of the US
the delay was alarming
then again, it was across the entire US
My goal is to move all of my vehicles from physx to something more custom, with the hope of getting better prediction going
I've found that physx sucks for doing anything prediction, but that's just my personal opinion
I have system as such:
Rollback for local player and local players projectiles or things local player instantiate
Snapshot interpolation for others
What kind of callbacks would you want to have per networked component in a system like this?
its looking like this for now, this is the base class for my objects components
i am wondering what you guys would do
i made these serialization functions so i could easily rollback local player or update remote players
but now, i wanna sync some delta-based stuff (that doesnt get predicted ever)
the way i'm going with this, i'd have to define a new function to use the BinaryReader
or should i keep delta based stuff in another system
like for inventory system
Hi,
I'm trying to figure out what a proper solution would be for creating a lobby and from the lobby users can create there co-op game, when starting a game I want a dedicated server to get started were the users in the co-op party connect to. Once everyone leave the server will be closed again and progress is saved.
The questions I have is,
How to approach the logic of setting up a way to start dedicated servers and close them when needed
Anyone have experience with photon pun 2 and physics?
I think you might be talking about kubernetes
So say I have a client who's ping fluctuates between 50-53 milliseconds which always causes him to re-synchronize his tick with the server, in order to get his packets in on time. will that cause problems like jitter?
@teal obsidian if you have a timestamp for each packet and do that different interpolation i was talking about, you wont have issues with that
I would only be worrying about client prediction for this problem mainly
predicting the main player
you have your time deltas fixed?
when you wanna do prediction via simulation,
you wanna have your world running on integer time
and you should not use deltatime in your logic code
or use a fixed delta time
alright
@teal obsidian and inputs should also be timestamped with same integer time when you send them to server
server should execute them at the right time
All inputs are stamped with a tick number, I'm not sure what you mean integer time
unless that is what you mean
yeah that would be it
but yes, my client does try to predict which tick the server will be on by the time it receives the packet
your networking solution should provide a networked time
you should be able to see servers time
and then you could figure out what tick server is on
and you should know a client time offset from recent roundtrip delay averages
and you could figure out a target client tick
I don't do it based on roundtrip time. My server tells the client to either increase or decrease the tick
if hes sending late or early
its extremely accurate that way
That's where the problem stems from though. If the client, somehow, has his ping increased/decreased by 1ms and is now sending late ticks, and has to resync every few seconds
will that cause issues?
obviously that would be sort of rare, but still
can you maybe put the client 100ms further in time?
Preferably not, since cars aren't predicted
definitely going for responsiveness
It might not be a massive deal
I don't think it's going to be a problem for interpolated entities, because they don't rely on ticks, they just get the latest packet from the server and instantly apply it
maybe you just need to seperate local characters visuals from logicals
and make visual object lerp follow logical one
Yeah thats what I do
now that I think about it, it might not be that big of a deal
that advanced lerp should also be used there
alright
the simple lerp behaviour changes when packets arent arriving with good timings
that advanced lerp would be immune to it
but i dunno, my local players predicted ticks are smooth even without any of the these lerps
@teal obsidian
client executes its ticks in a smooth manner
in my case
Have you tested over a real network?
yeah
and have you measured how often the client needs to recalculate its tick to match the server?
ah I see
if that's smooth for you, then I don't think I'll be faced with much of a problem
clientOffset = rtt * (1/2) + tickTime * 1.5f
its like that but it also lerps to target
Do you know about how often you reconciliate your predicted player?
@teal obsidian everytime server sends a stream
or world state
i dont care about it now
i can optimize later on maybe
Do you use physx for movement?
yeah
Ok
i reconciliate 30 times per second pretty much
for local player
and its projectiles
That seems like a lot for physx
you might run into performance issues down the road
I noticed tons of spikes when reconciliating every tick on a single rigidbody
projectile would be something like an arrow or spear though
logical tickrate is 30 anyways
yeah
If I were in your position, I might just do the "fire arrow" animation predicted and let the actual arrow be serverside
might save you some headaches down the road
but you know your game better than I do 😉
@teal obsidian well lets say the arrow missed on client
and on server it sticked on a character
id want to reconciliate that arrow to stick the character and play the blood effect
and while doing all that, i dont want to know about networking at all
in my "world", objects dont know about network stuff
they dont even know if they are on client or server
they just have a bool "isSimulated"
hmm thats an interesting approach
and you can flip it on and off at will
you can turn some other renote character into predictive mode
though i will probably never use that
but it would be useful for accurate physics interactions
because for rust, they do have spears and arrows, and the animations are all predicted, but the actual thrown spear and arrow is all serverside
same with any thrown object or bullet
I would love to predict more stuff on my client, but physx is just way too heavy on the CPU
unless im just misunderstanding your approach
i will have to do different stuff for fast firerate guns for sure
its gonna be costly
at some point my objects will have to know if they belong to server or not i guess
definitlely interesting
i like that for now, when local player wants to spawn a projectile,
it just spawns it through a special function
and theres nothing more to it
when server spawns the same thing, the object knows its pair on server
.
you are basicly predicting object creation
can predict destruction too
by just destriyong the projectile on contact with something
object creations and destructions are included in rollback and reconciliation
my pc doesnt seem to have any issues
its just for one player anyways
all the prediction is around one player
and instantiation/destructions are pooled when possible
my pc doesnt have any issues with that, i havent checked what the profilers doing
alrght
ill try on a small laptop
but i doubt bottlenect will be the predictions or physics
although, i am not very happy about the way i implemented all these
i assume the memory access isnt very efficient when you are iterating gameobjects and monobehaviours for serialization
well keep me posted because I'm definitely interested to see how physx performs in that matter
they are just mere frictionless and sometimes collisionless spheres and capsules
i doubt physx will give me any performance issues
whats the best way to store objects on a multi-client/server game?
i’d assume things like game maps, entities and game data needs to be stored on the server side and each client would connect to it, whereas clients would store sounds and textures.
what would be a good approach to do this if each client needs to regularly grab things from the server? should i create an FTP server for each client to connect to?
How to Destroy a GameObject on the server and all clients?
@opal kite if that gameobject has a network identity or something, you probably need to use your networking assets methods to destroy it
more advanced:
if that object doesnt have any networking asset related components, you'd need to call an rpc on some object with network identity and from the rpc parameter you need to figure out to destroy that object
that does not appear to work
what did you try
the stuff you said above
Unity is the ultimate game development platform. Use Unity to build high-quality 3D and 2D games, deploy them across mobile, desktop, VR/AR, consoles or the Web, and connect with loyal and enthusiastic players and customers.
@opal kite the object should also be spawned with assets methods
you using unet?
unet is outdated
unet guys have been switching to Mirror now
yeah i just added it
they have thier own active discord
I don't know how people make complex games. It takes me a long time to make simple stuff.
it helps to know what you want in the beginning
and plan ahead
i think one should be making like a "core system"
that provides all the complex functionalities with simple interfaces
and then you build the game on top these "simple interfaces"
oh great, changing out the NetworkIdentity components is going to be tedious
@opal kite you got many prefabs?
I'd hold back creating content until i am sure i will be able to do anything i want with my simple interfaces
A few, but there are a lot of scripts that require a NetworkIdentity, and it looks like I have to remove and re add them all.
curious what qualifies as a simple interface
fewer than 10 stubs
@opal kite like for example
a character
it should take some inputs and do its thing
inputs should be Vector3 movement,look bool attack,jump etc etc
.
another example, if you want server authority projectiles and damage, you'd wanna do something like a projectile system
ProjectileSystem.ShootProjectile(projectilePrefabId, pos, velocity, isServerOrClient);
It should "spawn" a netobject on server
and it should just instantiate a dummy object that looks the same for client
a simplification like this will also make it easier for you to handle remote players' characters
you can just send and play their inputs and you wont need to worry about their animations and projectile shootings
depending on your case of course
it seems like what you are calling an interface is a class that contains some [Command]s
or multiple classes
what i mean by "interface" when i say simple interface doesnt refer to c# interfaces
im just saying simplify your access inbetween your logic
so far, i have a controller, which contains a [Command] for each action available to the Player object
the [Command]s execute server side logic, which then executes a [ClientRpc] to update the clients
a controller seperate from character that calls commands from local player?
that sounds good
It is a component on the player GameObject. It maintains some state to determine which actions are available. It checks isLocalPlayer, and only calls [Command]s if true.
The commands reference other components that are on the GameObject.
@opal kite hm, i usually seperate it to a playercontrol object
that also handles the camera stuff in Update
my character logic doesnt know anything about camera
just takes in a look vector
i guess there aren't any channels for streaming
it would make it easier to explain things
i need to finish re adding things first
Friday, time for another stream on Creating an Online Roguelite (with Photon Quantum)
22h CET on https://www.twitch.tv/erickpassos76
Summary on what to expect:
- simple physics-based ranged attack
- UI with nickname, healthbar and damage received
- (if enough time) physics based rotating door
- Playtest with Audience (again)!
Hello everyone ^^
I'm using Mirror Networking for a multiplayer game but I'm stuck on a big issue. Just for you to be sure, I asked help on Mirror discord but no one responds ... I try my luck here
I'm wondering how to reconnect to a server without losing the authority on the player object ? Is that possible ?
Thanks 🙂
UUID binding?
I have another problem with Photon Pun (classic)
This is the first time testing if the multiplayer works and when I join with a second player in a game, that second player can't move and also the 2 players can't see each other
Its like they are on totally different lobbies but they are not because the one that joins second always can't move
Mirror is great btw. I've been using it since december. If you got any questions ask the discord or shoot em to me
Is it common for a server to ever become overloaded and get stuck processing packets at a lower tickrate?
what do you do then?
like if the updates per second on the server ever drop below the tick rate (mine is 50hz but I'm probably going to lower to 30hz because of this problem in general)
Same with client, what if his game is running slower than the tickrate?
like I think source engine has the capability of having the client run at different tick rates, but then the client and server would always be out of sync?
is there a way to sync an object across all clients inside a photon chat channel other then being in a room an using photonnetwork
anyone knows why when connecting intially it just shows the name but when changing region is shows a /*
using photon
Hello!
I'm searching for a Networking solution that supports P2P, has no CCU Limit (or CCU limit should be really high) and cheap or free. Can somebody help me out? 😅
Try and see if PUN 2 (Photon Unity Network 2) suits your need
Yep, i tried. But sadly it's heavily limited to 20CCU.
How many users do you have/expect ?
(also, spoiler alert, but solutions with "unlimited" and "free" in the same sentences are scarce)
what? does that exist?
@frank edge steam?
steam gives you free p2p relay
as long as your game is on steam
or not, if you use a spesific steamapp id 480
you can use steam relay while you develop your game without the need of releasing on steam
if you choose that steamapp id, you will be looking to be playing "spacewar" on steam
and you will be able to join your friends and stuff
there arent any limits to ccu even if you dont release your game and keep using "spacewar steamapp id"
only thing is you need every player to be logged in on steam
well i'm not planning to put my game out on steam
it costs $100 :/
i'm on really low budget.
you dont have to until you wanna release it
@frank edge
you can still use the relay for free
probably not a good idea for itch io
well it's the only free platform that i know
you should probably host a server
yes
people playing your game at the same time
its hard to get 20 of them at the same time
so max player is 20
yeah i would may pass that sometimes, but not always
you should be able to run up to 100 ccu with free photon
@frank edge
if you host the relay server yourself that is
it should be less costly than hosting the game
i am looking for it now
it should let you have up to 100ccu if you host the relay server yourself
@frank edge
how can i host the relay server myself?
hmm, i cant seem to find it, they may have changed it
well yeah it seems to be paid
its the cloud option, i cant find what i'm looking for
Manage your global cross platform multiplayer game backend.
Redistributable cross platform multiplayer game backend for realtime games and applications. Develop authoritative logic with SDKs for android, iOS, .NET., Mac OS, Unity 3D, Windows, Unreal Engine, HTML5 and others.
i dont know what that is
https://www.photonengine.com/en-US/Server/Pricing
@frank edge i am looking at this
Redistributable cross platform multiplayer game backend for realtime games and applications. Develop authoritative logic with SDKs for android, iOS, .NET., Mac OS, Unity 3D, Windows, Unreal Engine, HTML5 and others.
yep
yeah i downloaded the license. what should i do now?
nope its not
well
it should have transports doing p2p
mirror has many transports
what i'd do with my game is, let people self host
and use a list server
when you host a server, you publish your ip to a list server as long as your server is active
when a player wants to join a server, list server lists the ips of available servers
and client uses those ips to directly connect to host
yeah that's kinda like p2p.
if you wanna host a game yourself in that scenario, you'd need to have a static ip or do some port forwarding and stuff i think
it should be like hosting a minecraft server
just take the 20ccu deal imo
if you can surpass 20ccu, i think your game is already at a point that can be monetized to cover the costs
or get a publisher or something
it means the game is good
well yeah but the next deal is around $99, i don't think that my game would collect that
well i'll just try out Forge, as i know it's pretty simple and supports p2p
yep.
any ccu limits?
i didnt saw ccu limit here
not sure there's ccu
no ccu limit
p2p
if you wanna do simple p2p like that, it often means the packets are going through some server
so you occupy that servers bandwidth
i wonder how this forge works
perhaps with forge, you are required to run the relay server yourself?
hmm i'm not sure about that
well, there's got to be a catch
Got a question just started using mirror and I'm having a weird issue.
Found no receiver for incoming Command [-162642072] on Capsule(Clone), the server and client should have the same NetworkBehaviour instances [netId=2].
One client & host and the other is just the client, everything works fine until I add on a networktransform.
Kind a clueless why mine is not working. I've added the player in the networkmanager
yeah so i found it
it needs port forwarding
like for a minecraft server
well yeah haha
but i don't really know how does it works
and i didn't found any docs or something helpful for that
i have a question about CCU in Photon Bolt
i'm sure this question has been asked somewhere sometime but I can't find it anywhere.
Do offline players in a Photon Bolt game always count towards CCU?
I just want people to play offline most of the time but when they need online functionality, then they can use it, i'm sure i can even get away with 20 CCU in that case.
I could even try to make a workaround to deactivate Bolt altogether when I don't need it.
I'd just like to know if it's possible.
Is there a lesson on how to use raknet networking?
Redistributable cross platform multiplayer game backend for realtime games and applications. Develop authoritative logic with SDKs for android, iOS, .NET., Mac OS, Unity 3D, Windows, Unreal Engine, HTML5 and others.
?
yeah idk how to use selfhosted costum servers and sounds like it would took a lot of time
If you have a server 100 ccu is free, but you should get 20 CCU for the server to be free.
I'm sorry I did not understand
do i have to run something 24h/day order to work?
yeah that's the problem
i'm on low budget.
how much?
well around maximum $5.. but it's mainly for advertising the game. really really low budget.
i was thinking about to start making courses or beginner tutorials to get some money for server hosting, but there's too much of them.
that's enough for now
yeah but i'm not going to use photon, because i usually have around 100-200ms with all of my test players which is bad for a fast paced game
thats what you get with relay servers
I can tell you a few alternatives
well i'm currently thinking of getting a host for cheap or free and write this code and send to them
https://www.youtube.com/watch?v=uh8XaC0Y5MA&list=PLXkn83W0QkfnqsK8I0RAz5AbUxfg3bOQ5
In this first part of my C# networking tutorial series, we set up a TCP connection between a dedicated server and a Unity client.
If you get stuck or have questions, ask them on my Discord server: https://tomweiland.net/discord
Kevin Kaymak's channel: https://www.youtube.com/channel/UCThwyD-sY4PwFm7EM89shhQ
List of commonly used ports: https://...
Ccu capacity of mirror networking is low
I said for the previous
oh
a solution to write your own server.
yep
nice solution
isnt the fundamental problem here the regular players needing to do port forwarding?
cant get around that even if you write your own server
oh really?
hmm
for p2p?
it's p2p?
you dont want p2p?
no
it's not?
I guess not
not maybe p2p
@frank edge how do you use your networking assets?
how do you implement your netcode
i pack all my data into bytestreams
and send em via rpc
if you do it like me, its very easy to switch networking assets
so none of my netcode cares about the networking asset im using
except the IO part
well
in that case, you'd just start out with photon 20ccu
and then decide what to do next later on
imagine only using 5-6 rpcs/commands only
.
learning the advanced ways of the networking asset can be pain in the ass i suppose (i remain a mirror noob)
writing your own serialization can also be a pain in the ass depending what you want
well yeah it really seems like it is
if you got some programming and and debugging exp and you wanna deal with all that, that could be pretty nice to do it like me
or raksnet , forge networking
i used forge but it's not p2p as i know
do you want p2p
I hope I find a solution
you'd probably wanna do some custom serialization anyways if you need some more advanced predictive networking architectures that lets you
have full server authority with no client input latency
well no input latency is not that important, but would be good if it would be around mid- or low.
and umm i'm not that advanced in network coding so i want to find the most cheapest and flexible/easiest mode to implement multiplayer networking for my game.
yeah found that but it's kind of outdated.
so what's wrong
well true. but i didn't found any documentation how to really use it.
Someone who understands a little more can tell us about it
well do you know anyone who understands it?
i know a little
oh
i guess yes
yeah haha
I do not know .d
NetworkComms.Net is a high performance cross-platform network library written in C#. - MarcFletcher/NetworkComms.Net
pls wait
I couldn't find any pricing
I'm sure that there's some limitations for that
whaat
it's completely free and no limitations at all, with p2p support?
yep p2p
God willing
Please don't post gifs*
man you can restrict this from settings
You can share your thoughts about that in #531949462411804679. We're mods, not admins.
i understand
@weak plinth are you online?
P2p how? Does it provide a punch through signaling service? Doubt it.. does it include a relay fallback for the 15% cases where punch does not work? Doubt it...:)
Seems like the last commit was in 2017 with all issues reported left open
Does not look like something useful (have never seen this being mentioned before)
It’s not about no p20
P20
Sorry, phone
P2p... what I mean is that this is a lot more complex than downloading a lib
P2p online requires a service (punch through only works if you host a signaling service + a relay fallback for the cases where punch does not work)
I believe that library is talking about P2p on a local network (this is easy, and actually not really useful for games)
yeah that's what i was going to tell him about haha
Forge is a library with P2P support, but it's local too..
If you want just to have p2p, why not just use steam networking? That one includes everything I said
Well