#archived-networking
1 messages · Page 85 of 1
alr thanks man
np
Hey, I'm using Mirror Networking, and so far I've managed to set up a simple scene where two players can move & it syncs very well. Note that it's my first time trying out implementing multiplayer.
Then, I added a pistol to the players and allowed them to shoot - in the script, I instantiate a bullet which goes to the right of the player, and there's a muzzle flash effect.
Problem
The instantiated bullet only shows on the "owner's" screen, i.e. only the player who shoots sees the bullet, the other player(s) do not. Same with the muzzle flash, it doesn't show up on the other client's screen when I do gameObject.SetActive...
I'd appreciate any help regarding that. If you think you know the solution to this, please add me so we can solve it through DMs where I can provide pics of my code and hierarchy. Thanks. 🙂
I would be sure to join the Mirror discord
I know I have to use NetworkServer.Spawn, but it's giving me an issue.
I wouldn't expect DMs for help
And you will need to post your code, or no one can guess what you are doing wrong. But that you are instantiating bullets already sounds suspect.
Bullets are events, not objects.
Nah, I'm making a 2D game and it actually instantiates a visible bullet object.
And the bullet has a set velocity to go right of the player until hit hits something or its "life time" runs out.
Then you will want to post you how you are serializing your "bullet" events
This is the error NetworkServer.Spawn gives me.
I'll ask around in the Mirror Discord.
Thanks. 🙂
NetworkServer is not active.
You are trying to perform an action that only the Server is allowed to do.
It'll be a stupid question, but, how do I activate it LMAO
It's my first time trying to make MP game.
You don't active at it. The server is is the server.
So I'm obv dumb here lol
All others are the clients
I would join their channel and do some tutorials.
You aren't really ready for this yet.
Alright, thanks.
I've watched a few tutorials, that's how I managed to set up the basic player movement sync.
using, Tom Weiland's networking solution:
(No one's responded in 5 hours on their discord)
is GameManager.players a dictionary?
is 0 a player ID or are you using it like an array index?
the problem is
I don't know if the IDs start at 0 or 1
I've looked over the whole thing and cant find where things get added to the dictionary
nvm
ah
i see
nope nvm still lost
@weak plinth I was using it as a player ID
the thing is i tried it with both 0 and 1 and neither work
maybe the code is being called before the players get added?
I haven't used that networking solution before, but generally you don't hardcode player IDs into your code. is there are reason you're doing that?
well right now im using that to debug
Since what I was trying to do is to have the client receive the colours of existing players when they join and have the gamemanager apply it to them
e.g, 2 players join, choose red and blue, then when another joins they receive "red, blue" essentially and the game manager sets players 1 and 2 as red and blue
but each time it said its not present in the dictionary
Hey all, I’m looking for a backend solution to store my game’s inventory items centrally in a server. It would need to be authoritative and the inventory would need to be synchronized constantly between the client and server.
Any thoughts on what a good stack might be for this? I’m thinking of using ECS on the client so something that serializes to / from that would be ideal
Any libraries and backend services out there that I can piggyback off?
how do get camera, scene enemy in photon unity ? (like this game or in another)
That isn't really a networking question as far as I can tell.
I can't make out the actual question. Pun2 is used for serialization of states and managing network entities. Your question seems more about cameras and creating your actual game.
Thank you! 👏
Anyone have thoughts on my question above?
It's a bit much to unpack, so probably most people are avoiding it @misty shale
Let’s start slow then 😄
What backend database providers are people using? And why?
PlayFab comes up often
so.. idk if this counts as a networking thing but, im working on a game and i wanna play live audio from a site i really like. ive tried a lot of things and nothing has worked- can anyone tell me how to use unitywebrequest to play live audio?
Hey all, I’m looking for a backend solution to store my game’s inventory items centrally in a server. It would need to be authoritative and the inventory would need to be synchronized constantly between the client and server.
Any thoughts on what a good stack might be for this? I’m thinking of using ECS on the client so something that serializes to / from that would be ideal
@misty shale You shouldn't constantly be synchronizing your inventory with a main server, instead give a inventory in game to a player, a when he leaves the game, save the inventory to the server.
@flint granite but using this model that would mean that I’d be awarding the items on the client which is not secure
Alright
@livid onyx you need to launch your HTTP request in a coroutine, and instead of yielding to it's Run method, create a while loop that constantly checks the bytes downloaded from the Download Handler and pipes them to whatever audio thing your using
oh- so
i have the statement
{
Debug.Log(www.downloadProgress);
yield return new WaitForSeconds(.1f);
}```
you wouldn't do wait for reconds. You'd just do yield return null to wait till the next update
also you need to be looking at www.downloadHandler.data
@misty shale the concept of authoritative game control and saving a player profiler (including inventory) after a match are treated separately
- if you do not have server authority (game server), clients save inventory at the end
- if you have server authority (which is the TOPIC in itself), this does NOT happen at the SAME server where DB/Profile is... ItÄs a different thing
In the later case, the gameplay server (authority) is the one who requests the player inventory (from wherever you saved it, like playfab or custom backends), and responsible for saving AT THE END of the match
As people said:
- no constant saving to slow backends
- save at the end (if from authoritative server source or another, it's a separate questions)
Treat your problems separately, then it's easy to maintain and handle
Sure thing, so I’m thinking of using the ECS server model for authority, as seen in the FPS sample. This would mean that I’d then have to from that server persist the inventory.
Does playfab / gamesparks play nice with ECS?
doesnt look like playfab has the data solution you'd need. gamesparks does though
if i was doing it i'd pick the cloud provider i know how to use (gcloud) and choose a NoSQL solution that met my requirements.
@misty shale id stay Very Far away from anything dots unless your purpose is just studying
It's nowhere near minimally useable
I am just using it for learning, yes
My project at the moment is just for fun
It’s a Diablo style click and loot thing but I don’t want to trust the client
That is a lot of new, broken and difficult to make work tech behind a development project.
If you are just learning, I would avoid anything resembling a real project, and just make small proof of concepts that you can throw out and finish in a week or two.
Because anything larger than that will turn into a multi-year time sinkhole that never gets finished.
Sure thing! I guess I want to understand what the full pipeline would be so that I can better target my prototypes, which are individually contained learning experiments.
E.g. Prototype 1 - keep track of a player’s list of items on the client (done this currently using ECS)
Prototype 2 - ??? Very much depends on where I want to go long term
@misty shale I guess you can deterministically sync the inventory (communicating only the changes in inventory)
Dont know how it would be done best in ecs though
For all DOTS ECS related stuff, best to ping the DOTS channel. Almost no one here uses Netcode or DOTS, but they do in that channel.
If I wasn’t using DOTS how would you guys deterministically sync an inventory?
Hi, I'm currently trying to stream a portion of my screen from OBS to VLC to Unity through the videoplayer. Does anyone have any experience with this?
communicating only the changes in inventory @misty shale
All deterministic means is that the same operation will have the same results on all clients/architectures
@jade glacier how I have approached this previously is through time stamps. Pull down all entities (probably in json format) for any entities that have changed since the time stamp of the last call to the webservice
I was going to manually call this operation after key in game interactions where items could have changed on the server and also every x minutes on a timer
Can anyone help when i am trying to request data from a website for my highscore table i get a error saying request made more than once in a second i've looked through my code and the Coroutine is only ever called once it works fine when i begin playing the game i only get the error when player dies and it loads back to the main menu where the highscore table is
fixed now
What was the problem out of interest?
Kept getting request made more than once in a second new to downloading and uploading data from a website
@misty shale I'm also using WWW instead on unitywebrequest because of old tutorial that I followed
I would join the Bolt Discord if you haven't. More Bolt users in there than in general. @weak plinth
Hey guys i made a test project for photon pun 2 and the movement of the players keep lagging/glitching does anyone know why?
Typically that means you haven't disabled your controller code where ismine == false
I wouldn't recommend trying to use Pun2 until you have successfully completed the main tutorial
https://doc.photonengine.com/en-us/pun/current/demos-and-tutorials/pun-basics-tutorial/intro
this is the tutorial yes?
Trying to pin this graph down, I'm fresh enough to take my time with coding something running on the network, but graphs are something else.
Would anyone care to comment if this logic pans out?
Run the movement on the server, animations on the client
That's the way to go right? I'd imagine then just syncing the variables from the server, to the client when needed like for combat etc
Not readable even magnified.
Though that kind of layout suggests a wrong and overcomplicated thinking.
All networking is just input and state buffer replication.
which network solution u use guys?
testing out photon pun 2 atm
since bolt is acting kinda gay
is there a way i can see my ping in game on pun 2?
So what you guys prefer for networked Coop Game in Unity? I need some Info on this matter because I come from a UE4 background and in UE4 the out of box UnrealNetFrame work has Client Server Architecture and it works well 99% of time unless you are making a mmo. what do you guys use and if someone is the user of both UE4 and Unity which one you prefer?
Unity's built-in networking sucks atm
most popular networking libraries are mirror/mlapi/photon
How do you guys initialize canvas panels when starting game in multiplayer?
Like loading the inventory panel,
The spawned player have no idea of server things, so i use FindGameObjectByTag, but it seems kind of wrong.. Any ideas?
I think your question is kind of vague, but for as far I can understand what you want to do, you have to send the client whatever inventory is available to him and then initialize it on the client
How you go about finding the canvas on the client has nothing to do with multiplayer really, so you can either use FindGameObjectByTag or whatever other mechanism you can think of to get a reference to a canvas
But is that the right way to to, or is the "standard" an individual canvas that spawns with the player prefab?
There is no standard really, it is completely arbitrary. However, using GameObject.Find functions are generally frowned upon because they are slow, and usually there is no need to use them if you can already set a reference through the inspector
Ultimately, it doesn't matter too much if you only set the reference once like in Awake/Start
Sorry didn't read your last question but the answer is similar. There is no standard really, but usually there is little need to spawn each player with its own canvas because only the local player needs to have one
For example players in my game have a nametag above their character, and I'm using a single canvas for all of them
Using multiple would seem like more straightforward but I don't find this to be any more difficult to use a single canvas, and it also has less overhead because typically a canvas has quite a few elements in its hierarchy
But I wouldn't worry too much about this though, just do whatever you feel most comfortable with, and only try to fix things if you notice there is a problem
Thanks!
Does anyone release games with standard UNET? Does it meet todays requirements or do i need MLAPI, Mirror or something?
mirror/pun2
RPC or RaiseEvent I'd say
To trigger the sound in each machine
Do you know how to play a sound when you press space on Unity (not with PUN)?
yes
So, just create an RPC (read the docs about it) and call THAT instead of your function that would play the sound
The RPC will trigger the sound in all machines.
can i have rpc docs
RPC = remote procedure call (fancy name for: calling a function on this object in all machines)
can i have rpc docs
https://lmgtfy.app/?q=pun+2+rpc
you should check the basic tutorials
I'm sure there's a section on RPC
This is the very basic bread and butter of PUN: serialization + RPCs
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!
follow this
this?
@gleaming prawn
also do i need to keep putting photonview.ismine in every void
@prime beacon
you should NOT check for Keypress on the RPC
YOu check for keypress, THEN call the RPC
oh ok
What you are doing makes no sense at all
Please, try to follow basic tutorials
check for keypress BEFORE you call Honk
?
remove that isMine from last function
k
well i am new to networking
its still not working
uh
u there?
@gleaming prawn
...
@prime beacon
Please, do not flag
sorry
Try to read more tutorials, we won't write the code.
you didnt respond
Sorry, that's it
i am trying i cant find anything
also i dont think it would hurt to point out what im doing wrong
I pointed you to try to learn what you are doing that's the only advice.
Have a nice one, going to sleep here.
what am i doing wrong
ugh
i have no idea what it is
well thanks for "helping" me
because all i know now is how to move 2 lines of code
anyone?
remove ismine check from your RPC
i did that
and add Debug into your RPC to see if it fire
and you should really follow tutorials
i have tried but i cant find any
as i have said multiple times by now
as if 3 tabs isnt enough
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!
finish this
i dont see anything to do with my issue
...
where is honk() being called
did you honk() in update?
aren't we all
np
Here's a game prototype I'm working on, coding the PUN network part - https://twitter.com/crookslikeus/status/1321119323746873345?s=20
Hey #PitchYaGame!
Crooks Like Us is a comical online multiplayer party game
CONTROL THE THIEVES
Steal as much as you can before time runs out
A higher stack means more multiplier points
CONTROL THE ROOM
Help or hinder the other thieves
Open doors, find shortcuts and more h...
thanks for those who commented under my graph,
my intention was not for someone to read the graph, but to see where I primitively described it's function using bold text and large boxes.
While it may seem like I'm overcomplicating it which is likely, the actual function of the graph serves more than movement and combat, such as cover, reinforcement, and even a mission he can choose to go on if certain parameters are met.
this for example, from the division looks pretty "overcomplicated" but it all serves a purpose haha
so to clarify my original question, when doing network AI it's a good idea to run the logic on the Server, and the Animations on the client- right?
@torn ermine yep
oh thanks
how can i see my ping while playing my game in pun 2?
PhotonNetwork.networkingPeer.RoundTripTime maybe that's too dated though @weak plinth
alr ill try it
Is there a way I can spawn an object from the server on a single client? Something like NetworkServer.Spawn() but, well, for a specific client.
in the docs it says "static int GetPing()" but how do i use it? @somber drum
Hello! I trying to use mirror(for a multiplayer game) but i want to instantiate a different player prefab for the second player. This is the code:
{
Transform startPos = GetStartPosition();
GameObject player = startPos != null
? Instantiate(playerPrefab, startPos.position, startPos.rotation)
: Instantiate(playerPrefab);
NetworkServer.AddPlayerForConnection(conn, player);
}```
@ruby bolt TargetRPC?
you can spawn something on the network.spawn but it doesn't have to sync to everyone
in fact, maybe this is me being naive with network stuff but if just the client needs to know it exists, almost doesn't even need to be called on the server no ?
@sinful smelt you could use the registered spawnables and leave the playerPrefab blank
spawnPrefabs
how you choose which spawnable prefab is up to you
up to the player on login / random etc
and how can i use registered spawnables?
for example the player chooses a prefab from the list, a drop down w/e
then call it on the server
Player player = CreateCharacter(chosenPlayerClasses[classIndex], name, account);
if that makes sense
PlayerClass player = Instantiate(classPrefab).GetComponent<PlayerClass>();
since you're doing this from the network manager it's available for you to choose though
and where should i put this lines ?
totally up to you how you go about it
you would be taking the NetworkConnection and listening to it's selection in a custom method, then in another creating it when player has authority @sinful smelt
but how can i make the host to get the first player and the client to get the second player ?
while inside the available players to choose from, the first character chooses x, x goes x++, second player joins, he gets the next in line would be my suggestion
{
Transform startPos = GetStartPosition();
if(x<0){
GameObject player = startPos != null
? Instantiate(playerPrefab, startPos.position, startPos.rotation)
: Instantiate(playerPrefab);
NetworkServer.AddPlayerForConnection(conn, player);
x++;
} else {
GameObject player2 = startPos != null
? Instantiate(playerPrefab2, startPos.position, startPos.rotation)
: Instantiate(playerPrefab2);
NetworkServer.AddPlayerForConnection(conn, player2);
}```
like this @somber drum ?
I'm a week into mirror I couldn't tell what's wrong with this as long as it's being registered on the server, but x won't be less than 0 if that's your starting place js
trial and error man! that's what I've been scraping by on haha, google is a lot of help as well
Ik but i didnt find anything useful
I believe the tanks example provides a showcase of multiple prefab selection @sinful smelt have you gone through any of those?
Nope
maybe I'm thinking of a plugin, I would check those demo's out though regardless
sorry I couldn't give the exact answer, probably more confusing than helpful lol. good luck with it!
No problem
@weak plinth Have you figured the ping thing out already? I don't use photon but I've read this somewhere;
public override void Reset()
{
ping = null;
}
public override void OnEnter()
{
DoGetPing();
Finish();
}
void DoGetPing()
{
ping.Value = PhotonNetwork.GetPing ();
pingString.Value = ping.Value.ToString();
}
my msg was deleted sorry for the double ping lol
i thought i was tripping
no i didnt im kinda retarded so i was just stuck there staring st my screen
lol hopefully that works for ya now, good luck with the project
I had wondered this at some point as well
I'm not uploading as of late, I should probably change it out lol
used to stream if that even counts
i still wanna sub
nothing uploaded atm it was all live stuff, probably not even qualified I'm a fraud 😬
lmfao
i used to make vids when i was like 10 and half of them got taken down for copyright
i wasnt smart
tough life out there on youtube lol, I would change my tag if I knew how 😆
i think in settings
yea if you check out bot commands you'll see me fail, I'll figure it out
@weak plinth Please don't use ableist slurs.
@weak plinth what kind of errors u getting?
post was from 2015 might be different api
GetPing is still a thing tho
ping does not exist in this current context and OnEnter, reset are not something for override
im trying something else
with the GetPing
it worked
it also broke my game
but it worked
oh well yea you need to establish the string and ping int
public Int ping;
public String pingString;
oh ok
OnEnter is a separate thing probably, so you'd do your own method for calling the ping like when someone joins the lobby etc- glad it worked
@weak plinth Invoke in update? so it's not running constantly but still has decent estimation
maybe that's not a thing and you want to base it off NetworkTime idk sorry man lol
totally guessing
u2
yooo i think its bcs it changes scenes
im not sure
cause while i was loading in it showed my ping
yeah it worked i did it @somber drum im officially built different
hell ye congrats
hey guys does anyone know how i can fix stuttery/laggy movement in pun2 i alr use OnPhotonSerializeView() and transfrom view classic but its still stuttering any ideas?
Read the gaffer on games networking tutorials. They are great.
gaffer on games?
im pretty sure they dont use photon
oh alr
We from Photon read a lot of stuff to implement these things, and that blog is one of them
It's not a bad reference... It's very good.
Although he does not need to be right in every single thing
so which article should i go to for lag compensation?
I'm biased, I always think you need to understand things to be able to reason why stuff behave like they do
So I never point specific articles, unless you have a very very specific question (which only comes when you have experience)
Your question is very generic, so read as much as possible
alr thanks
First:
- laggy is different than stuttery, these are different things
well its stuttery
I'm not sure which one you have
Stuttery normally means you need to interpolate more, because your sync frequency is not fast enough
Again, this is ASSUMING you are sending state (like PUN2 does)
As there are other techniques
my send rate is at 30
its not smooth at all
So it just looks like you are not interpolating
my send rate is at 30
That's high actually
It will not help just making it higher
You need interpolation
every other interpolating option makes the character fly to jupitor
and lag like crazy
But I believe other people have been giving you advice
and lag like crazy
Interpolation IS lag
i dont think so i probably slept through them
I think you are failing to understand that lag EXISTS, it's because the data is limited by the speed of the transmission
What you normally do is:
- interpolate to smooth jitterness
- (optional) extrapolate to HIDE lag
But I've seen you nick before, I'm sure a lot of people have been giving you advice already
Please, take everything into consideration, read a bit more
alr thanks man
If you want to hide interpolation lag, you need to understand a lot more
You might want to also grab a screen cap app like shareX, so you can capture short videos of what you are seeing, since it is easy to mix up the terms used to describe the issue.
And please don't crosspost your questons @weak plinth They end up getting answered in two places, and they litter up discord. Just ask in one place.
alr sorry
The most likely issue you are describing is what I addressed in the other channel, which is you controller code not being disabled based on ismine. Once that is sorted, you can move on to other improvements.
i did disable it
I would pick up ShareX and set that up. Easier to post videos of lag/hitching behavior than try to explain what you are seeing.
obs?
obs studio
That looks uninterpolated. How are you syncing?
transform view classic
Does TransformView produce a smoother result?
Then there is some other code still affecting that transform it sounds like
nothing exotic should happen. Do these players have the ground as a parent? Or are they unparented?
unparented
If you are just moving your transform, the build in transform views should be getting smoother results than that.
Can you post your movement code into a bin?
Can you post your movement code into a bin?
Do you realize this is "expert" jargon Mr D?
Gotta learn it sometime 🙂
That is "expert" level? Huh. Easier than I thought.
Lol... Expert means understand at least 90% of the specialized jargon... That is just one...:)
can someone help me?
i am having an issue with my networking
the other client is moving with my mouse position
Be sure to include which networking library, and relevant code. Likely the same issue as discussed above. You are not disabling your controller code on non-controlling clients. @abstract wasp
Pun2 I assume you mean
Be sure to disable all controller code using IsMine
And complete the basics tutorial before trying to do anything of your own.
Seeing and doing are not the same though.
Complete the tutorial, or you will burn hundreds of hours trying to guess your way through this stuff.
i cant find any tutorials about mouse position rotation in multiplayer
The problem is not the mouse position. It's more about control.
then what do i do to fix it?
You could read and code-along the Basics Tutorial. This section is about the camera but it highlights the same topic: Fight for control. Input you do may run on all active scripts, even if those belong to remote players.
https://doc.photonengine.com/en-US/pun/current/demos-and-tutorials/pun-basics-tutorial/player-camera-work/
disable controllers based on IsMine
i sent you working code.
you really need to learn to debug this, cause there is not always someone to send your code to.
you need to check which scripts run, which of those affects a character and why. when input is applied, where it's sent.
this is sadly essential.
it's getting late here. i'm off. hope you fix this asap.
i am using photonView.IsMine but the other client keeps rotating
paste your controller code in a bin if you would
do i send a photon or the code from hatebin?
paste your code into hatebin... save it, and post the link here
at a glance this set of code should be restricting inputs correctly. There are no other scripts on the object in question that can affect movement? And what are you using to sync rotation?
to sync rotation i am using photon transform view
there are no other scripts for movement
Which line of code in this bit is where you are applying mouse input?
at the function GetPlayerRotation
120ish, I see it now
And the problem you are having is that this rotation is happening for both player objects?
both players are rotation
How are you instantiating these player objects? You are sure they don't both belong to the same client?
If this is the only code that is affecting rotation, and it is happening on both - that indicates both are owned by the same client. What happens when you move the mouse on the other client?
Something is in play then that I am not seeing here. If you remove the sync what happens?
if remove it the players are not updating the position and rotation in the server
There is no server, you mean the master?
yes
Without the sync, both objects rotate on the second player when they move the mouse... but they do not rotate on the Player 1 (Master) when Player 1 moves their mouse?
What is targetObject? That looks suspect
You have an instantiated object instantiating another object.
Without getting too deep into your code (I am working so I can't really do work on your project) - that looks like a suspicious thing.
Not sure what "it" is you are doing. But you seem to have some needless complexity going on here.
I would step back and simplify what you are trying to do, rather than getting to far down the path of trying to fix this.
english is not my first language
No problem. But rethink the complexity of what you are doing here.
This can likely be done in a very simple way.
which is?
You have a second instantiated network object. That likely is not needed.
the one object is not instantiated on the other player's screen
because it doesnt instantiates on the master server
I'm completely lost there. Regardless. That looks suspect.
can you send a tutorial or something?
Nope sorry. I am working. I can only give general help.
ok
There is something fishy about your use of that target object is all I can say.
Someone else might have an opinion, so you can post any questions or code you want here.
I am not the only person in the channel, others might have time and knowledge.
I am around
i have changed the script
Does it work?
Looks cleaner. What is breaking?
No idea where you are going wrong. If you have debugged that this script is only firing on the owned object, then there is something else going on.
Stick a ```Debug.LogError(photonView.ViewId)```` into your IsMine == true code and make sure everyrone has proper ownership of just their object.
I can't get into that level of help - I honestly am working right now. I can't help everyone in these channels code. I can only answer questions about Pun2 and Simple.
Make sure ismine is giving the values you expect... if so - debug your code.
If not, find out why your ownership isn't as expected.
both players have different ViewID
They both own their correct object?
no
Then something is off with your instantiation handling.
It doesn't instantiate anything, i deleted that line.
Debug.LogError(photonView.IsMine + " " + photonView.OwnerActorNr);
Stick that line inside of your fixed or update and see who owns what.
How are you not instantiating?
You have two players, how do they come to exist?
How are you instantiating your PLAYER objects?
If done correctly, each Actor will own ONE object.
I mean that the players are not instantiate anything
The manager instantiates the players
Debug.LogError(photonView.IsMine + " " + photonView.OwnerActorNr);
What does this produce in your log?
both players have true photonView.IsMine
What does that produce in the log?
Error
...
what do you mean?
WHAT DOES THE LOG SAY....
True 1
every time?
inside
So is mine is working correctly. You have some code somewhere that is not checking it correctly, or there is a bug somewhere in the code you showed me.
The ownership is correct
{
transform.LookAt(new Vector3(0, 0, 0));
}``` why does that exist at all?
That is controller code
to prevent the second player to looking to the other player's mouse position
Does that make sense to you?
no
Then why is it there?
because i dont know what to put in there so it can be fixed
You do nothing there. If you are the owner of the object you move it. If not... YOU DO NOTHING.
but the problem still occurs
I don't know where your error is, but it really feels like you are doing trial and error on all of this, rather than following a working example.
IsMine is working correctly. So you have to debug your code. No one else can do that for you.
I need to get back to work. Best of luck.
i noticed that the mouse of the first player is moving based on the movement of the second player
emotitron i think i know why it happens
excellent
its happening because the mouse moves but it cant stay in the same position on the other client because I move it
on the computer
because im testing it in 1 computer
That would do it.
Thanks for the help!
Glad you found it
how to use multi aim constraint with photon. trying to create a realistic looking fps/tps
Not familiar with that term @terse relic
with all IK, you either serialize out the IK target and let it solve remotely, or you serialize out the joint rotations.
I am not sure what that multi-aim thing does that is unique, but I would assume it still comes down to that same thing.
If I got it just from the terms meanings, it resolves with constraints to avoid weird positioning of the aiming hand and arm, etc...
So it's:
- visuals
- exact source of the shot (visuals mostly, but could also be the offset of the projectile source for the tick raycasts)
With that in mind, I'm sure that syncing just the aim DIRECTION and letting the solver work for the visuals locally on each client should be the way to go.
From the original QUESTION:
trying to create a realistic looking fps/tps
Emphasis added by me...:)
Hey Guys, i'm curious if some advanced programmer would have mercy to explain (in detail, with code snippets) how exactly 'client prediction', 'server reconciliation' and 'entity interpolation' works... i just can't get my head around it, i followed all tutorials and blog post i could find, such as this: https://www.gabrielgambetta.com/client-server-game-architecture.html
but it's still a big question mark. I'm developing kind of an RPG/FPS mix, so far i have my server set up, handling tcp & udp... players can connect and watch each other moving around.
I wrote some code to simulate latency & jitter to test client prediction etc... i just can't get it to work
1 - you need the simulation to be tick-based (in that the update frequency is controlled by server, using a synced clock somehow - however you want)
2 - movement is done with a "command". Client sends command to server (attached to tick) and stores it in a local buffer;
3 - server directly applies commands when they arrive (and the POSITION computed by server is sent down)
4 - when client receives confirmations, they come with the corresponding tick-command number... So you correct the client character position to the fixed one... RE-apply ALL commands AFTER that on from the local buffer (to predict again.
add interpolations on top of everything... play with it until it's good...:)
Something in these lines...
Notice I'm not describing the SECOND thing you normally do with this type or arch, which is lag-compensated raycasts (favor the shooter) on the server side (which also requires a position buffer for all moving shootable things on SERVER, etc)
That's what done automatically with netcode tools like Photon Bolt, new Unity dots netcode, Unreal Networking, Source Networking (CS), etc...
NOT handled by tools that normally only work on the transport-data-around level, like Mirror, MLAPI, PUN2, etc
Notice Gabriel also describes lag compensation...:)
Does not look like a bad reference BTW (I have not dealt with it before - as I do not work with this type of architecture normally), looks nice...
As for code snippet, NO...:)
yea thx for nothing
I can delete everything if you are pissed
yes pls
Or you can pay someone for code..::)
I don't know how you want code snippets if you are writing your OWN code
Code snippets work for specific libraries...
i dont know why you think summarizing a whole block post in 4 steps would help me understand topic...
But from your attitude I see it's useless, so I'm done... Have a nice day.
i dont know why you think summarizing a whole block post in 4 steps would help me understand topic...
I don't know how you want people to help you by being an ass***...:)
yea sure i am... i just said, i dont get it, could someone pls have mercy explain it in more detail... and you come along thinking well i'll roast this noob even more shwoing how easy it is in 4 steps
You could have followed up with a technical QUESTION of exactly WHAT is not working in your code, which is probably very close already
But not...:) So, sorry... Maybe someone else will do like you want...
No one seeing that hostile response to Erick's answer is likely going to want to help.
Wow. seems like everyone here be on one's high horse... "if you dont get it with this information, not my problem"...I particularly highlighted, that i tried to understand it with every resource i could possible find and i would like detailed information about the topic, but people come along like here is a 4 step guide, without any detail, figure it out.
And literally say "Code Snippets? naah"...
2 options here... 1. you didn't understand what i asked for, 2. you didnt care what i asked for...
And if i didn't provide enough information, the appropriate response would be "not enough information", but no, instead hacking in your first thoughts which dont provide any value to my question and calling me an ass**** because i'm not grateful
We are all working, so any help given here is a gift to the community. There is no high horse involved. All discord help is pure charity.
If you felt his answer missed the mark, rephrase the question, or disregard it. He isn't just posting it for you. All posts here are for ALL viewers... many who are silent and just read this discourse.
This is not acceptable Discord behavior.
As for code snippet, NO...:)
But this is?
You are angry because he didn't want to write code for you?
i ask for something and "no" is a appropiate answer?
👍
Erick's answer is pretty much the gist of what those systems are. If want like a good code example for lag compensation, check Unreal Tournament's github repo.
how can i make name tags using photon pun
Can you be more specific @sleek laurel ? I did not quite understand exactly what you mean.
like a name above the players head
If you mean little names over the characters, that's more like a Unity question... Is that it?
Hmm
So... Assuming the characters are Game Objects with a photon view
yes
You have there the reference to the PhotonPlayer object that OWNS them... In all machines they will have the right PhotonPlayer object
So, from that photon player object, you have the Nickname property
ok
Then it's just about how to write the UI code... Which is same as a local game
how i do that
give me a minute
Where do you want to be pulling that players name from? @sleek laurel
https://doc-api.photonengine.com/en/pun/v2/class_photon_1_1_realtime_1_1_player.html
From NickName in the Player class?
Or UserId? Either way, those would be the things you probably want to look into as your source for the Player's name.
k
@sleek laurel NOT network related anymore, but here it is: https://answers.unity.com/questions/786022/player-nick-name-above-head.html
photonView.Owner.NickName for example
with the nickname above and the UI stuff like the link I pasted, done
Actually putting it into your scene, as Erick says, is not a networking problem to solve. That is just basic unity for that part.
Then you REALLY should hold off on networking, and go complete some single players games.
I would not even think of trying to make a MP game until you are very comfortable with Unity.
Either way, this question you should ask in General programming channels, its not a Networking question - so you won't get much help here with that.
You will not guess your way into networking happening with trial and error coding.
I don't know how else to answer this. You aren't even close to ready to take on multiplayer games if this stuff is hanging you up. You need to get comfortable with Unity before going down this path.
well i know how to do movement and stuff
You are not ready for networking.
Have a look at this tutorial. Read and code-along:
https://doc.photonengine.com/en-us/pun/current/demos-and-tutorials/pun-basics-tutorial
If you really mean it. It covers a lot of the stuff.
Else, it may be best to do another singleplayer game.
That tutorial specifically deals with a name tag and health bars correct? @stiff ridge
Yes.
Excellent
by guessing
Your choice.
now i just gotta test
Just things will take about 10x longer to complete
yeah ik
:>
still worked tho
i have a question tho
@jade glacier
how can i make it face the camera
Still not a networking question. Are you in general? Ask those questions there. You will get far more answers.
k
You can also Google that topic. It is very commonly asked.
is Mirror the best alternitive to Unet?
@full girder Unet is deprecated. Mirror is a community continuation of the UNET HLAPI
ok, so is it the best option, or is there other option?
this is a solid thread on the topic: https://forum.unity.com/threads/what-are-the-pros-and-cons-of-available-network-solutions-assets.609088/
Unity does not have many comprehensive networking packages that will handle all facets of it
thanks
dang it seems so confusing, with so many options. I might just stick with mirror. :/
what kind of game are you making?
a 4 person fps that is Player versus Enemy
note that Mirror doesn't provide any help with players getting set up together, stuff like PUN does
alright
i am not going to add the multiplayer quite yet, but I am going to soon
better to look at networking now than later
You are correct. If you'll add multiplayer, you START with that
"add later" is just a fallacy...
Multiplayer dictates how you implement the game logic... It's not about transporting and syncing data...
That forum thread is interesting, but very incomplete, as it does not even mention some of the most advanced solutions.
Is photon the lastest thing that we use in unity multiplayer games? Is there a new sheriff in the town?
how good you are with networking? Photon products are probably most easiest one to get it working
if you want to host your own server and open source library Mirror and MLAPI are other options
Ok thankyou very much my game is a small and i am just testing it so photon it is @prime beacon
yeah PUN/Bolt depending on your game
Is there a game demo on git hub where i can find a project that is made like that
Like a multiplayer setup where i am the teacher showing around something to other kids
Its like teaching a subject
To someone
you can go over this step by step https://doc.photonengine.com/en-us/pun/current/demos-and-tutorials/pun-basics-tutorial/intro
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!
uh, wut should i pick:
Mirror OR photon
They are different architectures and have different deployment models. You need to do the tutorials for each before you can decide which is right.
Any downsides of using a behavior tree over the network? I've replaced my coded fsm and it just seems ridiculously easier- though I'm wondering at what cost
Ik it depends on some factors but in general
Maybe reducing branches getting updated constantly
Is that a visual scripting reference?
Behavior trees is a ai graph, no dependencies like fsm
Ah, not enough experience in that area for me to comment. Others in here I know have dealt with AI behavior though.
anything with networking will come down to efficiency of serialization, and determinism though.
AI typically has determinism problems, so often when the system is not deterministic, you are going to end up sending states... which is spendy.
Behavior trees use more CPU in general (for their processing)
Than a well designed HFSM
At least they "encourage/let" AI designers to be less careful IMHO
We have both HFSM and BTs implemented for Quantum's Bot/AI SDK... @fleet harbor (the lead dev on those) was careful to check the references for the fastest possible approach to BTs, but I still expect that the HFSMs will be in average less costly...
In our case, neither incur in any networking changes (because quantum is determinsitic and we only exchange input).
In that sense, I think both would be a bit complex to replicate (although it could be ust signaling events like state changes or so)
in a classical network sense... IF necessary... If you have server, then normally no need to replicate the AI graph (whatever if FSM or BT) itself...
understood, thanks for the information I think I was leaning towards it being a temporary solution as I flesh out the gameplay, really see where I can take this within limits then translate to a more efficient way of doing it down the road
this confirms it really I knew it couldn't be without a downside
@gleaming prawn Exactly -- Behaviour Trees usually puts the control of too many things on the hands of the coder/designer, otherwise they wouldn't be able to be "creative" when coming up with new Decorators, Composites and Leaf nodes...
Stateful Behaviour Trees is very useful when optimizing the CPU usage, so it is a balance on "how many data can you afford to have saved on the frame data, for the BT nodes, to prevent the need of iterating over the tree to get the data needed"
So yeah, in average HFSMs will be less costly in comparison to BTs, but depends a lot on how much the BT is stateful and if the coder knows how to benefit from that
Serialization of these will be different though I assume? Unless your system is deterministic you are going to need to sort out synchronization.
Anyone i can bother for like 5 mins? Who's familiar with uhh, client authorized movement packets, but server validated (for speed hack) kinda thing?
Best to just put a question to the channel
Is the networking same for Android as well?
I found a tutorial about how to set up a dedicated server, and I wonder if it works for Android as well, cause I wanna make a game for my friends
Which library and how have you set up hosting to work?
A dedicated server means a server is hosted by you. So in that case it would be the same for all platforms.
Anyone have any luck accepting game invite from steam and then launching game, grabbing lobby info to automatically join from command line properties? Having difficulty https://garrysmod.wiki/steamworks/SteamApps.GetLaunchParam
Hey, how can I give a random player a tag like isEvil, isInnocent when he joins the game for Photon. Its like Among Us
I would think you could just have players randomly generate that when they instantiate their player object, and serialize that as part of the instantiation data. @weak plinth
@jade glacier do you have any example/documentation for that? Because i don‘t really understand what you mean
Have you completed the Basics Tutorial for Pun2?
https://doc.photonengine.com/en-us/pun/v2/demos-and-tutorials/pun-basics-tutorial/intro This covers most of the basics you need to be familiar with to start working with Pun2
So in the case that the player moves with CharaController, and then sends position packets to server (client authority move)
Then server validates it for speed check
(This is how an mmorpg template asset does it)
Should the server also simulate the player's CharaController before validating the move speed?
Bcoz i'm getting issues where if the player's moving against obstacles, there's desync and the server ends up behind (after simulating CC again on server's side), and then on next frame it thinks the player is moving too fast
Should the server just lerp the player through the move packets?
Typically you have to resimulate on the client when a desync occurs. Which means going back to the tick the server disagreed on, using the server state values, and reapplying the controller simulation for every tick that followed until current.
@trail parrot
What are you using for your reference on how to do server authority?
reapplying the controller simulation
This means, server also simulates the player through CC.Move ?
This is just how this asset is set up
If you are doing standard server authority - the server's word is the final word on states.
Ok so...
I'm currently trying to change the asset's default, which is Warp-ing when server detects an invalid speed + discarding all pending move packets of the player
No idea what your asset is or how it works, so can't comment on that sorry.
- I wanna not Warp to the last valid position, and instead ClampMagnitude that invalid speed to the max possible speed
- Not discard the pending move packet, instead edit the position of all remaining packets by the offset result of the clamp mag
Yeah...
It's uMMORPG CE btw, in case u know/tried it
From the creator of Mirror
Actually nvm this part
I am well aware of it yes
So all im asking is, if the client moves via CC.Move, and sending the resulting position updates
You will want to hit up the Mirror channel for help with that. Or whatever discord he recommends for support of that asset.
Can the server just not re-simulate CC.Move again? Can the server just lerp through the packets (or actually, just snap to the packet's position) ?
I have no idea how he chose to handle simulation. He doesn't do anything tick based, so I suspect you will have to do it how that asset wants you to do it.
Proper resimulation probably isn't possible.
What i mean by re-simulate is, the server does CC.Move again on that same player
That is not standard server auth model, so it really comes down to how he coded that to work.
The server should not be resimulating, that defeats the point of the server.
Yeah well, these kinda core changes will be very slow to be updated/fixed. So i'm asking around other place bcoz this is getting into some "general mmo" techniques
The server should not be resimulating, that defeats the point of the server.
So this is what i mean. I'll try to do a step by step of what i think should be happening:
You probably are right, the question seems to be more how to modify his asset to behave more normally - which I can't speak to since I make a point of not knowing the details of that asset.
Best to ask that in a discord with other MMOXXX or Mirror users who may have some experience with that library.
Are you going for a client auth movement model? With server validation?
- Client press W (forward)
- In client, the chara moves with CC.Move
- This client moves from 0,0 to 0,1
- Client sends move packet (positions: 0,1)
- Server receives it
- Server first check if his previous position packet (0,0) into this new packet (0,1) is within valid speed
- If invalid, then do some resync attempt for the client to do (more on this later)
- If valid, server simply moves this client to 0,1, then broadcast this new position packet to other players
So, #6 and #8 is all there is to it right?
Bcoz in uM's case, #8 is actually doing a CC.Move with a move vector of 0,1, and THEN checks the resulting position after it, which may be different
Client sends move packet (positions: 0,1)
So the client sends the input or the state?
His network movement is pretty general (network API wise), so i feel it's alright to ask here/other places
Client sends position state
I assume state, because input requires a proper tick system, which I don't think MMO makes any use of.
So this is client auth movement, with server validation. Ok
Yep
Same rules still, server replicates its validated position out to others, not the clients state state.
The player should detect that the server returned a different value than it gave it... triggering your client resimulation
The server is still the final word, and it doesn't ever retest or resim.
Once it dictates a state, that is the law.
The player should detect that the server returned a different value than it gave it... triggering your client resimulation
Ok, this is in the case of an invalid state
But specifically about step #8, the server re-do ing CC.Move towards state (0,1) is pointless, right?
No idea how his controllers work
if that is how you "set" a state then that should be fine.
Unless this is for like further cheat detection or whatever
No idea what else happens with .Move()
Lets say his CC is like standard Unity CC
As long as the state gets applied, that is fine.
But that is not a resimulation
resimulation means rewinding to a previous state and reapplying inputs.
Yeah, i shouldn't have used the term resimulate..
If .Move is just setting the state, then that is fine.
re-doing still implies a resim
Eep
just check the incoming vector value for validity
Clamp it as needed, and apply that.
Here's the thing, if there is a slight discrepancy between client and server, then the result of the server's CC.Move might make the chara land in a slightly different position. It may call CC.Move(0,1), but it may not land to that state (0,1)
That model kind of sucks yeah
What's happening in my case (and many others), is, server doing CC.Move towards (0,1) ends up making the chara land in (0, 0.8)
And then, next packet, which is (0,2) (from the client), the server will do CC.Move from (0, 0.8) towards (0, 2), which means 1.2 move vector,
And then server complains that 1.2 is invalid speed
What is causing it to come up with different values? Fixed vs Update timing?
Having seen Vis's code in the past, I would guess that the handling is wildly not deterministic, and that the movement exists in both Update and FixedUpdate
I really doubt CC.Move (or any kinda CharaController's) done in server/client can be 100% deterministic. Hence a slight timing of when the client thinks it's not bumping on the wall anymore, will be off for the server
The movement is fully in Fixed, it's fine
It can't be, which is why you have to code it to not be frame dependent and to not rely on determinism.
I dont think his CC is the problem
I think the fact that server has to call CC.Move again to "re-test" the new state packet, is the problem
I think that step is unnecessary
What is in the guts of CC.Move?
Hmm, 2 sets of move with collider cast checks. 1 horizontal, 1 vertical
Pretty standard CC stuff. And very long lines of codes like any other..
I don't see how he is making correct use of that unless he suddenly changed Mirror to make use of FixedUpdate for capturing and applying networked states.
Mirror is all time based, not tick based. Which is not conducive to any of this.
Oh
Oh yea u got a point
It's sent through Command, which is probably sent as packed packets per interval whatever thing
Yup
Oh wait
The server receives the packets via Cmd yes, but the processing is done in FIxedUpdate
And it has a buffer
He is numbering his updates?
So i still think this part is also handled fine
Last time I saw the internals of an MMOxxx library of his, I saw all kinds of no-nos with timing. Maybe he finally reworked all of that, but I suspect you are going to be up against the lack of a tick engine here.
I dont think so.. Cmd stuff are all ordered already, and as long as the fixed tick rate is the same then they'd get the same expected rate
Best bet is to try to relax the speed hack check so it can just absorb the errors.
I dont think so <-- im referring to the numbering
Oh yeah, this is all Reliable TCP too isn't it?
Yep
There'll be error
a legit error?
Hold on
like Debug.LogError("WTF"); ??
//else Debug.Log("none pending. client should send faster...");
Yo dude
I'm not trying to make fun of his asset or anything here btw..
😄
It's very educational as a simple, showing mmo stuff and it does a great job in all the other aspects
It's just the movement that's a tricky thing
It's the only script that has 2k+ lines compared to all the other stuff. I'm sure he's trying his best to also make it understandable and simple n all that
You are going to run face first into the flaws with its timing and frame buffering mechanism. Not sure what the easy answer is.
Is it that bad to have 0 remaining pending packets?
The whole mechanism is bad.
Best to just add more slop into the validity checks
And make sure the movement code self-corrects
By default the threshold has +20% tolerance
But if u see the vid, the server's detecting like 9.5 speeds when the original is 5. That's almost double
LOL. Solid.
Might as well allow people to cheat with 180% speed, that's already profit
Anyways
Step #8
It has a garbage timing system. So you are kind of in the weeds on this one.
Server hard-setting the pos to the new state is fine, right? No need for the server to call CC.Move again
I'm really just curious about this one
I would think, but if the server is also a player, it gets murky
but the standard practice is Fixed is "reality" and Update is "lerping"
No, in release the server wont be player
In that case, the server just skips all lerping
and deals only with hard FixedUpdate reality
Yeah
Update() is where clients interpolate between those hard states.
If the server is pure fixed, then just hard set the states.
In the case of games with CC, let client be the sole determiner of where his CC takes him
There is no timing system in Mirror though for properly capturing states for serialization AFTER all components have simulated.
Server shouldn't deal with or be questioning the CC
A very likely problem you will run into is that Mirror will tend to do its capture of states in LateUpdate(), unless he has reworked that.
@trail parrot arent you on the mirror server as well? I don't remember if you're a supporter or not, sorry...but if you are FPS Land is available to my supporters and is full server auth and I use a CC
LateUpdate() has no direct tie to FixedUpdate... it isn't a one for one.
So make sure all apply/capture exist in Fixed
What do u mean capture of state? Like, when the client sends the move pos packets? It's also done in Fixed
@opaque dew Server auth CC movement?
What does the client do then? Send input?
also, FPS Land uses UDP. Get that TCP garbage out of here lol
Fixed is PreSimulate, so be aware of that - but it can be workable, even though it will induce some latency.
I use a character controller to move my character. That's what you meant by CC, right?
Yep
You really want to capture states postSimulate
@jade glacier Well, if CC.Move is called in Fixed, then it will be done in that moment
U check transform.position right after CC.Move, then that's the post sim
True, it is probably setting the RB.tranform value, which will get captured... though not sure how he ensures that the serialization happens AFTER rather than BEFORE without a singleton.
delgelato, I don't want to banter you so I want to be sure, have you been able to look into fps land yet?
I would monitor your sent positions and make sure they indicate even changes
Not yet @opaque dew
Anything paid i can't do. I'm super broke
I never ever got to check out uhh, what's his name. Fish? FirstGearGame? Thingy either
Frankenfish
Alrighty. Here's the trello to it if you're interested. It's 100% server auth, everything. https://trello.com/c/8Fw2Q5mp/17-fps-land-project
and here's a playlist where I streamed a lot of the development (not a tutorial but you might find some helpful stuff, but its long) https://www.youtube.com/playlist?list=PLkx8oFug638rSz9l4nQbiVdPIeu9oXGMJ
He's not in this discord 😄
If you are seeing odd discrepancies in movement between client and server, I would check to make sure your clients are sending nice even movements - and that the server is applying them every tick. You shouldn't be getting wild variations.
I would monitor your sent positions and make sure they indicate even changes
@jade glacier Yes, checked that and it's stable. No invalid move when it leaves the client
And neither in server when he's receiving the packet
oh geez disregard that playlist. I didnt actually stream the movement code.
probably because it took so long to get it to work with mirror
The problem is, server's validation happens after server calls CC.Move again (from the server's version of the chara pos, towards nextState.pos)
delgelato, are you an adult?
@opaque dew I can't say i'm super happy with uM's movement, but it's good enough bcoz my game's only a medium-paced
Yes an adult from a third world country, whos job was related to tourism all this time and now bcoz of corona there is simply no job at all and i'm currently full timing as a farmer and coconut seller
haha. I mean, I like coconuts
I can't provide support on how everything works but if you want a free copy of FPS Land, to rummage around and figure things out, you're welcome to one. Obvious don't share source with anyone, dont reveal it's code, ect
Might help you to see how I did it. Its actual auth movement.
I also saw a really good article, let me see if I can find that too
I really appreciate it. But to be honest, i can't put too much effort on the movement for now... i just wanna get this done with and for a mid-pace game, TCP is really fine... i think
When i'm more done with the game, and when i can afford reworking the movement, i should also be able to afford to pay u in the future and will definitely check it out tho
(I can also check it out now, but i dont think i'll rework and implement the movement now...)
okay, im still trying to find that article. its the only one Ive seen so far that actually got it right
I read Dota's net movement, since that's 1 of the game's biggest influence
Basically UDP, and always lerp between 3 states
TCP is perfectly fine... UNTIL you run into some congestion.
But even that, i cant be bothered to implement it and just gonna cope with uM's design
NOTE: This post is more-so to go over the implementation in Unity3D than it is to explain the concepts of client-side prediction. Gabriel…
well, store it away for later then perhaps. 😛
If the packet's buffered, and combined if needed, then it should be fine, right?
No idea
That's just how vis does it in uM
If the fixed updates are one for one for capture and remote apply, then you should be able to make it work.
And i dont see any major issue even if i fully lag out 1 client
capture and remote apply
What's this?
Yeah it seems like it
I mean, i'm only sticking with uM bcoz they did that 500 (or 1000?) CCU test in the past and it seems legit
LOL
And my game's gonna be only ~100 CCU anyways
I would create a test at that scale before relying on that.
Find a working title using that library running those kinds of numbers and see how it plays. And make sure you can see those kind of numbers in close proximity.
Well, they did. Isn't that not legit enough?
They did what?
500 ccu test, with many people helping out logging in
Hosted a playable game where 1000 people all connected and participated in close proximity?
https://u3d.as/mAn
480 players, almost all broadcasting to each other on a small map.
Im gonna read ur article
They have 500 friends all connecting? My understanding is they are all local bots.
Im sure something will help
Haha yea that's the part that i'm not sure of
I'd really like to participate and feel the lag
Vis said he'll do another ccu test soon, testing a new transport etc. Hopefully this is a public test this time
uMMORPG is very old now, are there no released titles to look to?
uM CE is new
And.. uM is i'd say... bad and impossible to make a working title out of
Bad in terms of how there's only 1 giant script for player, etc instead of componentizing it
Anyways why am i advertising..
I would think you could just have players randomly generate that when they instantiate their player object, and serialize that as part of the instantiation data. @weak plinth
@jade glacier You told me to do that and now I've read a lot of documentations and so on.
I know how I can Instantiate a player prefab into the scene, but how can I give him a role now ? I can't figure it out
Your role is just an enum or a an enum mask I assume?
Have the client pick one, and send that choice as part of Instantiation Data
@weak plinth
Reading the docs won't really get you all that far, most of it you will just gloss over. We STRONGLY recommend completing the tutorial, not just reading it.
What is the best online game solution ? Photon or Mirror ?
Photon
ah?
Pretty frequently discussed I'd say @chrome rover
https://forum.unity.com/threads/mirror-vs-photon.792441/
Not much said in that one particularly but it comes down to need & preference imo
so no preference
If you have no preference I would ask what you need it to do
Which one you're more comfortable working with
By reading documentation, reading the api talking with the respective communities and comparing
I am using Firebase for database but I have red marked error.
https://prnt.sc/vb62io
I am following this tutorial https://www.youtube.com/watch?v=KkvLtjovkBU&list=PLVycTU8R4DEzU95f-of5x879r_BuT6tvH&index=26
This is the error code: https://prnt.sc/vb63xy
Always do tutorials for the networking libraries you are considering before even thinking about doing a real project.
yes ;P
so... any solution to correct this red marked words error?
it should work since i am following the tutorial
did u remeber to 1) Download the package for the turtorial and 2) use the using at the top
- yes, i've downloaded the SDK https://prnt.sc/vb6o56 https://prnt.sc/vb6oo3
- what using??? @full girder
something like this?
https://prnt.sc/vb6pjd
i think is deprecated or disuse
yeah. You might have to refence the turtorial, to see if you installed and refrenced everything correctly
ok. i will do it again. thank you
Hey, I've asked you yesterday about it but I still can't figure it out how to solve the problem.
First, I'm using Photon Pun 2
I'd like to give a random player in my game a role. For example in a tag.
create it locally then send RPC/RaiseEvent
hm makes sense, im gonna try that out thank you very much
Depends which client is giving it the role
The answer is still likely to have the client pick its own role, and send that as Instantiation Data @weak plinth
If the Master Client is picking one, then that means the master client will handle that, and it should be sent to all with the game instantiation data from the Master.
If you are trying to mimic Among Us, then the Master Client will have to do that, since clients can't pick themselves.
does anyone know to add/input player names in start screen/main menu using mirror?
@jade glacier Can I just use that https://doc.photonengine.com/en-us/pun/current/gameplay/instantiation ?
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!
Hi! I'm a student, for my final project I'm creating a turn-based multiplayer game in VR in Unity.
After some research I'm still not sure what is the best networking engine to use for free?
Is it possible to make a auto matchmaking with no room or anything in Mirror? just click to find a player to play against?
If not can I do rooms? one player is creating a room and will self-host and the other will pick the room out of a list and just click to join?
Forgot to mention, it will be two players, maybe 4 max...
@woven jackal You can easily connect multiple players via lan or hamachi btw
hamachi is very simple and straightforward to use
it puts you and your friends in a virtual lan over internet
it is not related to unity or anything
is there anyone here that can help me with port forwarding with xFinity xFi?
This piece of shit 24/7 security bullshit won't allow me to remove open ports, and the ports that are already open don't work
I can't 😦
Hey guys, I'm having a problem. whenever I build my game as a server build it wont let any clients connect and spams the terminal with this message? any help would be greatly appreciated.
(mirror)
does anything in your scene use that shader?
Nope thats whats wierd
you may be able to remove it from your build via project settings.
it may be in "Always included shaders"
but tbh i would not recommend anyone to use unity as a server it requires it's own license afaik
I'm choosing server build in build settings and mirror is automattically doing the rest
Ill have a look into that real quick about the always included shaders
I just checked, that shader thats giving the error isn't in that list
Does anyone know how to reinstall the legacy shaders? Perhaps i corrupted them somehow
I am looking for a consultant to help me implement Addressable Assets with Remote LoadPaths and dynamically changing Content Catalogs.
If you are familiar with Addressable Assets and I could really use your help and would happily pay your consulting rate
does anyone know what kind of system that among us and phasmophobia uses for their online multiplayer room code generator? im kinda interested
Among Us wrote their own, loosely based on photon. Phasmophobia uses pun. @frail steppe
good to know, thanks for the help!
Hey simple question (I hope), im making a multiplayer thirdperson game. How do you do cameras in a multiplayer game?
@stable epoch What networking solution are you using
@jade glacier What do you mean loosely based? Is Among Us PUN?
The devs are long time users of Pun is what I am told, and recommend it to others. But they opted to write their own variation for Among Us. I assume because they had the knowledge of how to do it, so they saw an opportunity to keep more of their profits.
If I had to guess. I haven't spoken to them so that is all third hand information.
Hmm, wonder if the game is client auth.
Been an uprising of paid client auth games haha. Guess it doesn't matter unless you make it big.
I suspect it is all client auth of movement. Nothing about the game screams the need for server auth of movement.
They have full control of their relays though, so they can add any amount of logic they want.
Hello. Can UNET work with steam ? I mean if i want to create p2p with steam, do i have to write with steam api, or after creating in UNET, can i somehow make it work on steam ? Thank you for answers in advance.
Unet is obsolete
You may be talking about MLAPI or Mirror
Their more recent maintained implementations (official UNet is deprecated by Unity)
@gleaming prawn Does it differ from UNET too much ?