#archived-networking
1 messages ยท Page 67 of 1
Thatns will try and let you know ๐
Thanks @high night
Need to go take my dog out before the army comes ahahaa
What a time
how does one simply set a varable on photon from another script
so basicly i have a gun that photon spawns a bullet then tells that bullet who its sender was
only problem is that is doesent update on ther clients
causing problems in the script
i begith of anyone to help
hey guys
im trying to install pun 2
and im getting this error
before importing it, the game compiled perfectly fine
iv tried importing it multiple times, and it doesnt work
any ideas on why?
it seems to be a popular error
nvm fixed it
@high night this is my situation right now. https://www.youtube.com/watch?v=lXBC9YSvy8g&feature=youtu.be
@hallow fractal You still have photonview or notworktransfrom on child objects
But in this case as you see, which object needs to have the photon view
Child object are the one who are the objects
This must be your hierarchy:
Segment0
Segment1
Segment2
Segment3
@hallow fractal
No parents
NetworkTransform and view on each Segment
You should probably deactivate joints and rigidbodies on clients
Have them only on server
.
Or do this:
Have only one network view for train (the parent you have)
have no network transform
Sync the transform of all segments in the parent with code (photons streams)
But what if one segment has other childs
You seen the video i suppose, im really nee at photon, thought i only need to out a photon view on the objects
@high night soo here i have a other scene video, soo the parent (Seg) doset have any photon view on it attached inly these 3 childs that are also the meshs of the train,
Object with a photonview cant have a parent
In your case
parent: Seg
object with photon view: Train
@hallow fractal
Soo if I get all the child outside the parent does it work
Can try
No it dont work
Whats the new hierarchy
Soo all these were before child of Seg, now i got them out and each have a photon view and transfer view
Are you moving them in server?
Or in client with commands
@hallow fractal
It dont, the train moves like its bugged
@hallow fractal Is it bugged in server?
The first player that joins the train is all well, but the second player that join the train starts from beginning and it koves like its bugged
First player is host/server thats why
Here's what i think is happening:
On hosts screen, everything is fine train is moved in code and affected by joints
However on client, train is moved by the code, the joints and the network transform
And network transform is messing with it
because Physics don't go well will direct position sets which is what network transform does
@hallow fractal You will need to disable all joints and train-movement code for the train on client
And let the network transform handle it's position
With code?
Yes
@hallow fractal
@high night maeby its the assets fault, because now i notice that even i move the train a little bit in front and when i start the game it goes automatically back to its first position
@hallow fractal moving on client i assume?
second joiner i mean
second joiner is cleint
I made a short video to show better, dont lnow how to tell better ahah
@hallow fractal
Right now it's expected that client won't be able to move the train
Since i told you to disable client from running that code on train
soo this is what i noticed, the train goes back at the possition, dosent metter where i put th train
but i dont know how to make disable that with code, not good at that
@hallow fractal This is got to be something to do with train movement code
you think thats the issue why it dont work
@hallow fractal I think your code is snapping the train on a spline
every frame
and it doesn't care about trains initial position
or any position
i just send the owner of the asset a message, maeby he know or already did this through photon
@hallow fractal You should be just looking into the train moving code
It's supposed to be moving the train only with one float variable that spesifies position on the spline
And you should sync that value in photon stream
@hallow fractal These stuff are not plug and play type of stuff
You need to understand the code to some extend and modify it at your will
if (photonView.IsMine)
you mean something like this
@high night i know only a little photon coding
yeah something like that if you already authorized the object as it should've been
i have found a other way and it works, yes it was the asset fault, but i found a better train and it works just fine
@high night
this is the other train if you want to know that works https://www.youtube.com/watch?v=NzrGFTBQj6I
Train system using Stand Assets in Unity
Unity Project:
https://drive.google.com/file/d/1Vr5ACjvyQnBcDaEN8egGQgzlbRpX37Wg/view?usp=sharing
How do you handle packets ? Do you send a different kind of structure where you call the send method wherever you need it or do you have a single packet structure where you store all requests in a list until you can fire the next packet and cram everything into the packet before sending it kind of like a bus ?
Is there any guide about making networked physics-based controlled characters with the new NetCode? Server authoritative but with client-authoritative movement following physics in the owner client, interacting with other similar players (reacting to remote player's physics while not affecting their physics remotely)
In any network system, that just come down to deciding input authority vs object authority.
if you however give players authority over their own movement, you will have to reconcile sync issues if they can interact with world objects
People need X many years netcode experience to understand what you said @jade glacier, Lol
Tired of answering with a lot of details like you normally do?
I just landed in Connecticut after 48 hours of fighting my way home from the tip of South America...
So a little at capacity at the moment with life stuff LOL
@gleaming prawn
Pretty beat up from all of the airports and planes, but better off than most.
Glad we didn't get to sea before all of this happened, ships returning from Antarctica are looking like they might get stuck in port. Our ship would have left Tuesday.
How can i call a [command] function by another script?
@gleaming prawn
That's the score script
and I want to call the CmdAddScore by another script in a EnterCollider2D
That would be the projectile
I've never used Mirror
You should ask this in their own Discord
I'm one of the developers of Photon Quantum, sorry
It is same of Unet
Never used, sorry
command only works on the local player object that your connection owns
has to be on a NetworkBehaviour, and has to be on the root with a NetworkIdentity component
That it is named score, leads me to believe you are not putting that script on your player object
I'm using Photon Pun, and I don't understand what the Photonview component is, Yes, I know it synchronizes clients with the server, but do I have to add it to everything?
For example, for my character do I have to add it to both the capsule (character model) and the camera?
(The camera is a child of the capsule)
Also, I'm a noob in networking so don't really understand anything at the moment..
@lapis valley you dont want to sync camera position in multiplayer
camera is supposed to be a locak object
Yeah that's what I thought but every prefab spawns with a camera
and only one camera needs to present scene
or is this not the way to go
you will need to deal with that
Alright, thanks
guys anyone here who has experience with photon?
Oh, also, how do you set the IsMine variable on the photonview?
Or is it done whenever the object is instantiated by the client?
Yeah that's what I meant by instantiated by the client
if that's the case then that's neat
IsMine won't be meaningful until after OnJoinedRoom
Yeah yeah
Typically for net stuff use the OnJoinedRoom instead of Start for stuff
So basically I just wanted to know when it gets set
so basically after what point do I know that the objects that should be "mine" have the isMine set to true
Assume before OnJoined is called, it will be false
OnJoined is the answer
Can watch for changes with OnChangedAuthority or whatever... don't know off the top of my head without VS code hinting in front of me sorry
anyone knows what this is?
It's hard to assert without further info
lol
nvm i fixed it lol
btw anyone here has any idea how i can implement a timer in photon?
@rancid anvil you could make a public function in class Score that just calls CmdAddScore, and make the other script call that public function
@jade glacier thanks for the answer, thinking more about it I actually just need to disable physic simulation on remote players (so they are fixed to whatever the servers says like rocks, and only simulate the local player)
yeah, that is typical for physics simulations if you aren't resimulating. Only the authority version does physics work - networked clones get moved by their transforms and stay as kinematic.
is there an "elegant" way to do it as a setting in NetCode or I just set them as kinematic manually?
Never touched netcode, so can't speak to that at all sorry
ah no problem thank you, actually is not that hacky anyway
its not. Setting non-authority versions to kinematic is the standard for interpolation
If you are instead doing a predictive extrapolation you do that with real physics on all clients - but that is a very different animal.
@prime nexus You can specify in your ghost authoring component, what components should be for predicted resp interpolated resp server side entity.
If you want to use same components but different data, e.g. kinematic on one, dynamic on one, I think you'll need to set up the prefabs yourself and extend the spawning system.
in the latest NetCode preview is it possible to sync IBufferElementData components (dynamic buffer) within a Ghost?
Hi, I really need a unity dev experienced with socket io to help with my networking. I'm willing to pay for help. Can anyone help me?
we have all the software built, we're just having a problem when we link to a https site vs http.
I'm having a problem with Photon Pun - I'm calling an RPC for a character to pick up a tool, but this is the error I'm getting:
https://gyazo.com/e27d3d84d7501ea464254de36d54f54b
The call is coming from a PlayerCharacterController and goes to a PlayerCharacterController
This is my code:
//Server (Master client)
[PunRPC]
public void S_requestToolPickup(PlayerCharacterController playerPickingUp, Tool tool)
{
if (PhotonNetwork.IsMasterClient)
{
bool allowToolPickup = true;
foreach (GameObject obj in GameObject.FindGameObjectsWithTag("Character"))
{
foreach (Transform toolObj in obj.GetComponent<PlayerCharacterController>().ToolSet.transform.GetComponentsInChildren<Transform>())
{
if (tool.gameObject == toolObj)
{
allowToolPickup = false;
}
}
foreach (Transform toolObj in obj.GetComponent<PlayerCharacterController>().armViewPosition.transform.GetComponentsInChildren<Transform>())
{
if (tool.gameObject == toolObj)
{
allowToolPickup = false;
}
}
}
if (allowToolPickup)
{
PhotonView photonView = PhotonView.Get(this);
photonView.RPC("CharacterPickupTool", RpcTarget.All, playerPickingUp, tool);
}
}
}
// Client
[PunRPC]
void CharacterPickupTool(PlayerCharacterController player, Tool tool) {
tool.gameObject.transform.parent = player.ToolSet.transform;
}
And this is the snippet calling the above function (Also in PlayerCharacterController)
private void handleUse() {
RaycastHit useRayHit;
if (Physics.Raycast(cameraTransform.position, cameraTransform.forward, out useRayHit, useRange))
{
if (useRayHit.transform.GetComponentInParent<Tool>()) { // We hit a tool - put it in our toolset
Tool toolHit = useRayHit.transform.GetComponentInParent<Tool>();
pView.RPC("S_requestToolPickup", RpcTarget.MasterClient, transform.GetComponent<PlayerCharacterController>(), toolHit);
}
}
}
Any help would be greatly appreciated !
@hazy pike no, not that I know of
Also, I looked it up and saw that script references cannot be passed into an RPC - so I changed it to Gameobject references and the error still shows up
Are you only allowed to send floats/ints/strings to RPCs?
Guess I'll try it out
New question: Is there any way for a specific client to ignore the automatic scene synchronization for a certain object?
For example, I have a character holding a tool, and I want it to move seamlessly for them and have the server handle distribution to everyone else
you are referring to the transform sync?
Which library?
PUN has no server in that sense, just the relay
For holding object, you would typically network who is holding it, and network some way of identifying what on that object it is mounted to.
The new stuff we are making for PUN handles a lot of this, you can look at what its doing or make use of the extension library.
@lapis valley
Oh my bad
Yeah basically objects on my (non-master) client seem to be lagging a lot even though the client is supposed to be "holding" it
which would be expected
@jade glacier I mean the networking is working perfectly, I just want the client to set the position of the object instead of the server
since the client owns the parent object through the "isMine" flag
So since the client already has the information of what the transform should be, I would like to override the "automatically sync scene" calls
I don't know if what I'm saying makes sense cause I've never done networking before
There is no server, so you mean the master client, and that master client has authority?
You will be fighting the nature of what is going on
What does that mean?
Best practice is to have the owner tell all non-owners to change its parenting
no point syncing the position of a thing that is attached to another thing
Yeah that's what I did but it's still changing the position
Ohhh
Ok, then another problem
The reason I'm syncing the position is because the tool can be outside of the player's inventory (I.E. when they die)
and I want it to be in the same position on all clients
so is it possible to enable/disable position sync?
From either master client or non-master
So, for instance I'm sending an RPC from client -> server (master client) to request a pickup of an item, and then the master client -> all other clients that the pickup has occured, so in that moment I would unsync position
๐คฆโโ๏ธ Just ignore me, I'm an idiot.
https://gyazo.com/896c4cc7802d7bdb044da801617122d0
I never use the vanilla stuff, but I would assume disabling that component will stop it from broadcasting
anyone know why Server.Start(50, 88888); it throwing an error?
port limit is 65535
fixed had it set to private not public
Hey guys - not sure if this is the right channel, but has Network Emulation been removed from the editor in 2018.3+? If so, anyone know how to add this back in?
Specifically - this: https://docs.unity3d.com/2018.1/Documentation/Manual/NetworkEmulation.html
Ah damn....reading the docs, it only affected NetworkView & Network, so probably wouldn't have helped. I'm wanting an easy way of testing functionality for WWW / UnityWebRequest / similar in limited connection situations.
I use clumsy for that https://jagt.github.io/clumsy
Cheers - I'm Windows-challenged, unfortunately, so no joy for me. I guess enabling / disabling the network connection is the pragmatic approach.
anyone got a network player movement script i could use?
find a tutorial and download its code
@glass goblet
its finding it tho
type pun tutorial in youtube
or unet
most likely you'll see a simple character controller
you should be able to unet code for mirror
and you should be using mirror instead of unet
or pun
ok thanks
I'm having a weird problem - I used to be able to have two players in the same room but now for some reason they never get put in the same room
I created "Room1" on one client
and then tried to connect to "Room1" on another, but the second client does not see it
Code:
public override void OnConnectedToMaster()
{
Debug.Log("Launcher: Successfully connected to Master");
if (isConnecting)
{
// #Critical: The first we try to do is to join a potential existing room. If there is, good, else, we'll be called back with OnJoinRandomFailed()
PhotonNetwork.JoinRoom("Room1");
isConnecting = false;
}
}
public override void OnDisconnected(DisconnectCause cause) // We dont have internet or PUN servers are down
{
Debug.LogWarningFormat("Launcher: Disconnected from Master");
}
public override void OnJoinRoomFailed(short returnCode, string message)
{
Debug.Log("The server is not up, starting server");
PhotonNetwork.CreateRoom("Room1", new RoomOptions { MaxPlayers = maxPlayers });
}
The problem is that it was working perfectly fine before and is acting up now
Debug.Log(PhotonNetwork.CountOfPlayersInRooms); returns 0 even when another person is online
Should I just switch to mirror? I've heard that it's way more consistent than PUN
hey guys im trying to make a multiplayer game for my first time using photon, i got everything ready i got player movement but when i try to add a camera to the player prefab and play the game, the second player that joins the game uses the first player camera
Well, you don't really need to have a camera on the playerprefab cause you will only have one camera per player
What I did for my game is that I had a single camera that is added to whichever prefab has the "isMine" flag set to true on its photonView
hm
Probably not the best way to do it
im quite new to unity and c# can u explain a bit more
So basically, you have a single camera in your hierarchy, and when you instantiate an object using Photon, change the camera's parent to the object you instantiated
Because the client doesn't really need to know the position of all of the other players' cameras
Unless your game depends on it
Yeah so not having to update the positions of other players' cameras will actually remove some of the overhead
should i do all of the camera code where i instantiate the player?
and i think the camera should be disabled as well and then set it as active
You don't have to, it all depends on what you want to do for your game
Then you're gonna have to set the correct one to display to every player
i think i did it(not instantiating)
i hope it works
if not im gonna go back to instantiating
noup ๐ฆ
haven't read all above, but set the region in settings when developing to ensure all clients and the editor end up in the same region
the next PUN2 release has Dev Region added that uses a specified region for development builds and the editor, and gets ignored for production builds. @lapis valley
How would you set the region?
Same file you set your AppID IIRC
in the the PUN settings @lapis valley
Hello, can someone help me on this issue, soo i have a train in my game and that has a photonview and photon transform view on it, soo when the player joins everything is fine but when the master leaves the room than the train acts weird to the other player on the room
Whats the problem?
I would try to debug what is happening with the ownership of the object.
But there will be a period of confusion with the vanilla components as ownership gets passed over to the new Master, assuming that is happening at all.
Hmm
The train just follows the track, and when the masters leave the train goes off the treck and acts no normally
For example i have a object on the scene, it has only a rotation script, and when thr master leavs everything is fine
Might be extrapolating on clients due to no more incoming updates
the vanilla transform syncs are pretty terrible
I am part of the Exit team and my project right now is an extension system for all of that
So you are welcome to try out the SyncTransform component in the extension library. Its based on my Asset Store asset that fixes a lot of this stuff. @hallow fractal
https://docs.google.com/document/d/1moPBIt8cNe-h1uG01pvaOZQvrIjZfSBfDmVa793X6AQ/edit#heading=h.qql6b8eo9tfa this tutorial has info on where to get the beta, and the tutorial is helpful too to show what the system is.
hi guys ^^ does anyone have a video tutorial for a multiplayer game for the latest version of unity?
not that I know of, but if there are any you should be able to find it with a search on youtube.
NetCode is quickly shifting sand, so no idea how current things would be.
@jade glacier will look at this when i get my project beck up, literally the worst thing happened, i tested the project and it stoped, so i closed it through task manager amd when i open the project back up everything is messed up
Unity projects are pretty resilient. If you just delete everything but the assets folder and project settings, it should rebuild itself.
And GIT.
(first time asking for help, hope i did nothing wrong; friend recorded this btw)
so this is the issue im having, if im hosting the game i can move around freely, but once my friend joins i get teleported back to where he spawns, and i cant move the camera. both of the players move around but not by themselves. its really hard to explain but once you actually play it you know whats happening. this is a big issue with my project and i cant figure out whats going on. can ANYONE here help me with this? im using Mirror as my multiplayer framework. thanks.
@mint cedar Mirror has its own Discord for support - you'll get better answers there.
oh thank you i will repost there!
@jade glacier well it was photons fault
oh?
Yeah, i had a back up folder of the project, and after importing step by step files from the corrupted project and testing them in multiplayer i noticed that when i imported a project that had a photon view on it was the cause of the trouble, i dont know why but when i played multiplayer and when that object was on my master controller also controlled the other players but on its perspective,
Maybe both objects had the same id or dont know
But all that happened after my project stoped working and i had to use task manager to close it
PUN2 broke things, or SNS?
That doesn't sound so much broken, as just something is set right in code or the inspector.
Can't really say though, not much to go on there.
stopped working like you are describing indicates an endless loop
@jade glacier no stop working, but the players acted weird in the scene when they joined the room, i couldn't figure out the issue till i imported each object step by step to a new project
Is there PUN2 help here?
I'm just barely trying to set up multiplayer. I have them connect to Master, that works. I have them join a room, and if it fails, it gets created then they try to join again.
The big issue is that when testing two instances of the game, the player count only shows 1 on both.
Make sure nicknames are unique and you have set it to fixed region
you will want to touch the region setting to be sure your editor and built games end up in the same region
The next PUN release has a Dev Region, but for now setting Fixed Region is the way to go get around that happening
Are you able to describe where I can set that in the editor, or is it through code
Have you run the tutorials yet?
I was watching one on youtube. I figured after watching a portion of them, I'd be able to simply have two players in a room
Do the getting started tutorial first, or you are going to be stuck a lot
Alright. thanks @jade glacier
Hello Everyone,
it's a very basic questions but strangly i cant find any tutorial or course explaining it.
i read some scripts from unity's new Dots Netcode, but im having difficulties to understand the principles behind Clients & Server Ticks.
from what i understood, Clients and Server are running simulations, the server is sending snapshots for every tick (amount of time) and clients are doing the same but also trying to fix wrong simulations for all Client Side predictions.
- how clients and server sync their Ticks ?
- what is garanting that all clients are running into the same Tick and not running into individual Ticks ?
Thanks!
Its beyond bleeding edge, so its going to be very hard to find anything solid
The DOTS channel though will likely have some advice
Please help me understand why my clients have separate PlayerCounts
I set the region and it works now. I'm gonna double thanks @jade glacier
has anyone here used Zapnet? Looked through the documentation, it looks really programmer friendly, minimalist and well structured. Downsides are no open source + definitely not battle tested, but curious if anyone has had any experience with it.
semi-related: I've done several multiplayer projects, but nothing super long-term or robustโdoes anyone have any strong feelings about loosely coupled networking systems? Stuff like Unity's HLAPI is very, very tightly coupled, so I'm curious if anyone has worked with any packages that are the opposite. I'm a huge fan of stuff like facade pattern to promote iterative development, but networking packages can seem pretty daunting
zapnet is not bad and you can get source access upon request, but photon bolt is better and battle tested so i'd go with that or just wait for new networking assets (or wait for zapnet to add missing features)
@dapper night Clients send command to server and not snapshots.
You can choose to have fixed tick or not on client.
- They don't run tick at same time, Server runs tick, then client predicts when it should runt he same tick. The tick we should run is calculated from
((uint) estimatedRTT * (uint) tickRate.SimulationTickRate + 999) / 1000;
from NetworkTimeSystem. You should check out the Client & ServerSimulationSystemGroups for how the update works.
ill try to read it again and ask here in case something is not enough clear to me ๐
Thanks
[Generic Mutliplayer question, using DOTS NetCode] So, I'm starting to move into the phase of implementing my projectiles and how to handle them. My game consists of fast moving spaceships that are controlled by players. Now you'll be able to shoot from pilot seat, forward, and monitors controlling rotating guns on the shipsurface as crewmembers.
So I haven't really set up the limitations yet of how many projectiles/etc can exist in the game. But as start generally maybe there are 4 forward guns, 5 off guns, x 8 ships, with fire rate of 2/sec? Networked entitiy, Raycast + start end vs trigger collider? Local entity with some sync values?
The architecture I assume is snapshot interp with server auth?
Yes
The main thing you will be dealing with is deciding how to gloss over the timeframe differences between players and the server
if you want tp predict the guns firing on the shooters side, those will be decidedly out of sync with reality
So you get into the questions of server rewind vs cheating reality on the clients
I would strongly suggest making a very basic testing scene for getting your head around how you plan to cheat this stuff
having players mounted to other player controlled objects, shooting projectiles that originate from that other players object, but a triggered in the players timeframe.... involves a lot of timeywhimey
For slower projectiles I typically cheated them on the shooters side. As in I would try to induce as much latency as possible before feeling icky first... then also reduce the initial velocity on the shooters side... so that projectiles would converge with the world timeframe. Player fires... projectile spawns and starts moving... 50-100ms later server says "you fired" and you then start tracking where the projectile would be based on that, and lerp your current cosmetic projectile into agreement @stray scroll
Hmm
You can also cheat it a bit if proximities aren't close by having the projectile on the server originate already X ms into flight
Are you using projectiles or raycasts?
Basically cheating the server projectile into the players timeframe a bit more
this is just for slower moving projectiles yeah.
for hitscan, you likely just go client auth or server with with rewind
I guess simplest would be to do some pre animation that concludes into the server doing the shot.
I assume you are using a collection of weapons so some slow movers and some hitscans
yeah, if you can get away with full server auth and no client prediction, things get way easier
But might feel to unresponsive.
But that does make aiming kind of hellish if its a point and shoot thing
The thing is my spaceships are flying really fast rn, so the projectiles has to be really fast as well, so they could really be raycasts with a start+endpoint for visuals.
The upside is everyone sees reality, with no weirdness
Raycasts are a lot easier since you can just shoot your vfx on the tick that the thing actually fired
raycasts if you predict though require either server rewind or client authority
So they aren't without downsides
Hmm yeah, so I would need to put back the states of the ships and check if hit right?
Unless again you opt for no prediction
yeah, for bullethell its not recommended
its fine for like CS where the number of bang bangs is limited
Hmm, I like my bang bangs
but those rewinds will really start to add up in a shitstorm
Thanks, I'll try with no prediction and some animation to start, then predict with client correction.
If you are server auth, it all starts there yeah
see how bad things are with no prediction, and then work in the cheats
Alternatively, do client auth and wait for the cheats ๐
Client auth has all kinds of other downsides in fast shooters, like the illusion of them shooting at where you were rather than where you are becomes more obvious
@jade glacier you have an asset about sych?
a transform and animator sync extension for some of the middle layer networking libs yeah
having some syncing headaches?
@hallow fractal
You remember my train issue? Now that my train get sych i have another problem im facing ๐ , soo when two players enter the train and become child of the train both of the players dont get the same position well sych, what i mean is from one players perspective the other player is outside the train like its flying
But this happens only when i enter the train
Are you syncing their positions based on transform.localPosition? and you are syncing their parenting?
Which library are you using again?
Hmm so im using pun2, both player have photon view with photon transform view and animator view on it attached, the train has only photon view with transform view on it
No, the trains mother has photonview and the childs have photonview and transform view
Soo these are my setup
You can give the Extensions I am making for PUN a try, they do try to address a bunch of that.
They are Beta, but they are official Exit stuff that will eventually be part of PUN2.
Extensions you mean your asset
They handle it with mounts that index things netobjs can be children off, and the parent id is synced on the same ticks as localposition/rotation
There is my store asset which is just the Transform/Animator sync - not that
the extensions are the work I am doing for Exit to give PUN2 better components, syncvars etc
I will make a video and maeby you will see the whole picture of my issue, than tell me if your asset can help me on thag, is that ok?
If its not an impossible paradox you are dealing with, it can be dealt with
A video can't hurt, sure
The issue with all of this stuff is dealing with ownership, and the latencies involved that create state disagreements in client prediction
For me that im dealing with objects sych for the fitst time its a little hard ๐ , will send the video later on
So there are some unsolvable issues, like if you hop on and off a train that you don't own, others will see you teleport a bit as you move between time frames
nested netobjs is kind of the deep end of networking
you are very much in the thick end of the time paradoxes you have to deal with.
does unity networking system use C# to code
?
like to code a server side for a mulitplayer game, is it written in C#?
@mighty snow Are you talking about the new DOTS Netcode ?
ugh no
Then be more precise
So the old networking solution "UNET" is deprecated, so you shouldn't use it. You could use MIRROR which is a fork of it, downloadable from assetStore. You can also use Photon, which is 3d party solution, which I think is most popular. Then there is the preview very early DOTS NetCode which you can try out if you're using DOTS ECS.
well ye lets skip the DOTS thing
so if i want to use photon to create a multiplayer game for example, am i gonna write the whole game in C#? or do i have to use another language for the photon networking
or mirror
If I'm not mistaken Mirror and Photon both don't use a client-server architecture, but you can use one client as server if you want to. So all logic, you'll write in C# if you want.
does that mean that the game will be client sided?
Photon PUN uses master client.
Really you could make two fast googlings and get info for this
you can use Photon Bolt @mighty snow
Which is a production-ready (and battle tested) pure client-server architecture (with full server authority).
Both client and server are unity instances, so all C#
If you go for more basic photon realtime, you can also write server logic (to run on photon servers, no Unity APIs) in C# (photon server plugins)
so all iam gonna use is C#
All of the options discussed so far are c# yeah.
Yes, unless you want to insist in using C/C++... In all these options you can call native code anyway...:)
@stray scroll Mirror is classic server-client
Why objects seems losing their authority when another object get spawned?
Trying to send command for object without authority. ChatSystem.CmdSendMessage
UnityEngine.Debug:LogWarning(Object)
Check how you are spawning those
You can only have one local player object
Any number of authority objects
But only one is your local player
The mirror discord server can help you with that
Yeah but when i spawn another player , the one i spawned before lose his authority
Yeah, how are you speaking it?
Losing authority? Or just changing local player
As you see It starts with OnStartAuthority
Islocalplayer is not the same as hasAuthority
I'm on a small phone
So can't read text in screenshots sorry
is there a way to change the starting function from OnStartAuthority to something simply like OnStart , or local player
Because i think that's the bug
You can only send command through your local player object.
With messagebase
Command sucks like that.
The local player object model sucks like that. Just send messages.
Otherwise you end up with 100 components on your player object
So what will you suggest me
Messages
And hitting up the mirror channel for details
They keep changing the message layer, so I have no idea what the current methods are.
is using gRPC w/ Unity recommended?
Can anyone direct me towards a proper networking tutorial in Photon Bolt using authoritative architecture? Preferably a shooter, thank you!
Photon Bolt is inherently server auth - so just the standard tutorial. It is an FPS example no?
The Advanced Tutorial is an FPS example yeah. But tbh, didn't really understand it so was hoping for a tutorial(as in a vid)
Someone out there may have made one.
But generally companies who build this stuff DO NOT want to make vids. They are time consuming to make, generally a bad way to learn, but mostly they are impossible to change as minor library changes are made - so the videos are constantly out of date.
If you want to get into networking, I would let go of any hopes for hand holding. Networking is hard, even with the best tools.
@vivid owl really depends what your objectives are
Hi, how would a proper game server loop looks like ? more specific id like to create a tick based system for sending / receiving data but I'm not quite sure. I've written some pseudo code ```cs
var sw = new Stopwatch();
sw.Start();
while (running)
{
var begin = sw.ElapsedMilliseconds;
//receive
//update stuff
//send
var elapsed = sw.ElapsedMilliseconds - begin;
if (elapsed < hz)
{
Thread.Sleep(hz - elapsed);
}
}``` i appreciate any help/hint.
Tick based usually implies doing something on a fixed timing, and that usually for Unity is best if its based on FixedUpdate()
Unless you have NO usage of FixedUpdate() as part of your simulation
Well its not in Unity.
Ahh, then sure
Just learning some networking (PUN 2) and I am having difficulty spawning a player death particle effect. The effect spawns and appears fine to the opponent however when the killed player rejoins (they are kicked when they die, in lue of proper respawns just yet) the effect is spawned again and I believe only the killed player sees it. I have a code sample (below), I am using PhotonNetwork.InstantiateSceneObject() and have a timer to wait and then destroy it once the particles have finished. Would anyone be able to help me sort this out? Thanks very much!
Code:
Easier answer is to pool the death effect and not make it part of the player object
Though that may not be what you are after. If you are not networking it as an event like an RPC - no one else will know abou tit.
And why are they kicked when they die?
Kicked as in literally the player is forced out of the room?
Yes kicked from the room. Following a tutorial
Thank you admins for your assistance!
The admins don't actually speak here much or at all
AskAlice helped get me unblocked I beleive
Oh, for that
Tried to post the code to show you what I have so far and it blocked me
Sounds like way too much code then ๐
You mentioned using an RPC, I've only done that once so far, the examples Ive been able to find are not very clear
I would make your death effect not part of the player object if you are wanting it to stick around after the player departs.
Not really, I just fat fingered pasting it and I think the system took it as spam haha
Ok, so who should be responsible for spawning it? the game manager?
Each client, when they get the "I just died" RPC
specifically make a component on the player object itself
that detects the death, and have that spawn a pooled death "poof" or whatever you are doing there.
Ok, so the player still does the spawning, just through a special component, and through an RPC?
Sure
No hard correct answer. Just sounds like you want the "poof" to exist after the player object is destroyed, so that would be a way.
Yes, so that the rest of the player's see it
Thank you, I will run with that and see what I can do
You don't need an RPC for that btw
Oh?
just have your player OnDestroy trigger it
but that might cause a weird delay if its depending on a complete disconnect
so either an RPC, or really triggering it on whatever triggers your death animation if you have one.
Right now it spawns it, it starts a coroutine to wait 0.25 seconds, then the player leaves the room, and aafter the 0.25s it calls a PhotonNetwork.Destroy
Perhaps, I'm just learning so it will probably be messy until I get some practice ๐
I would STRONGLY recommend against learning Unity by doing a networked game
Have you completed a single player game?
Im not new to unity or coding
Ah, nm then
Just new to PUN / networking
Gotcha
If you have something already being sent as part of your death that you can latch onto, use that.. like when your timer expires if that is the trigger... go with that.
I understand the basic premise of views and syncing and view ownership, just the exact code to do some things eludes me
Making extra senseless messages will bite you later.
I have an OnDie function already, I simply did the Instantiate call then the LeaveRoom, thats it. I later added the timer thinking that would help, it hasnt
Once you start throwing around coroutines, you are on a path to misery IMO
avoid them like death itself
Not sure what you are trying to make happen, but anything that is meant to linger and finish out its life, should probably a pooled or instantiated object that has its own built in death timer.
How would I, over a networked space, find the end of a particle effect that is instantiated and then destroy it when its done?
I don't see the reason for networking being involved in that?
Effects are not something you networking typically
they are "Effects"
you want to network "causes"
Well it is. Something has to spawn it and all clients have to see it, right?
You just networking "Player died"... and that is it
the rest each client does on its own after that, since its deterministic in nature
Reduce all thinking in networking to What is Cause? What is Effect?
Which also turns into normal networking speak "Inputs" and "States"
It is a particle effect, I understand cause vs effect, I said effect because this is a particle effect
You want to avoid serializing the outcomes when the input is all that is needed.
What does the particle effect though have to do with causation of anything though?
The player dies... that is the cause no?
Player dies.... series of things happen after that
That series of things is deterministic
the clients don't need to be told each thing that happens after that, they just need to be told "Kill player X"
the rest is all just a timed set of events on the client
They need to see the particle effect
its a visual confirmation of the kill to all the other players
yeah, so spawn that as part of the response to "You Dead"
I'm not sure you are following me here
I shoot you... you register that and tel all players "He Got Me... I am dead"
That is the only event needed
Every client now knows that you are dying for good....
So they start the death animation... then despawn your body... then show particles... or whatever
There is no reason to sync all of the stuff that happens to your corpse. And its problematic trying to anyway.
How do you then explain/achomplish ragdolls? There are tons of games where some guy gets blown up and tossed and we all laugh at his body ragdolling all over the place.
that is typically done locally
But you can network that state if its still important
and then once the body comes to rest the owner says "Ok I am done dying now"
and THAT starts the decomposition process or whatever
So in Unity multiplayer, how does the game tell who's the enemy and who's the player? Could tags be used to differentiate the two?
@amber trench building a turn-based game
@forest dove UNET or DOTS NetCode?
I don't know?
He is asking which lib you are using
I just use whatever Unity uses
Right now, I'm still learning Unity, but I want to know how multiplayer works so that I format my game in a correct way that if I wanted to transform it into a multiplayer game, I already have the code in place to do so
And more importantly, it would be important to know how to tell the raycast system to ignore the player, but not enemy players
@forest dove The thing is that unity deprecated their old system called UNET, and their new system DOTS NetCode is for when using their new Entity Component System.
So if you're learning unity, you shouldn't use any of them. And I don't think it would we wise to start of with a multiplayer game when learning unity.
I get you man, but I want to tell my Raycasts (for the gun script) to not hit the player, but I'm concerned layercast will not work in a multiplayer sense as it may also think the opponent is also the player, which would be bad
I think you should really read what Jaws said: do NOT start with a multiplayer game...:)
People will not even answer to you here, because the questions will not make much sense. Please take your time, learn to program with Unity, finish a few fun single player games first.
Ok
They all two have ClientAuthority
But i still get the error
why
//ASSIGN PLAYER AUTHORITY
p = transform.GetComponent<PlayerScript>();
p.GetComponent<NetworkIdentity().AssignClientAuthority(this.GetComponent<NetworkIdentity>().connectionToClient);
CmdSendMessage(message);
inputField.text = string.Empty;
p.GetComponent<NetworkIdentity().RemoveClientAuthority(this.GetComponent<NetworkIdentity>().connectionToClient);
}
I also tried giving authority
Answered in Mirror's discord. ^
I assume it was a case of confusing authority with localPlayer
@vivid owl for turn based games, almost any decision at that level of abstract will be a good one, as long as you're comfortable with it. you will probably have the most luck using something like Google Play Game Services
unless you are making a massively multiplayer turn based game or something that will be an esports game, the exact pattern and constraints of GPGS is really good
I don't want a lock-in
we do have some MMO aspects
but in terms of networking, my project is more closer to a turn-based arena
depending on your meaning of lockin, i would recommend looking at something like https://github.com/Cysharp/MagicOnion
don't think I need a real time networking
and depending what skill level you are at with devops
hmm
i really think GPGS is going to be your speed
if you need something that says "turn based" in its feature list, you're looking at a commercially hosted solution
GPGS is free
you should probably take a look at MagicOnion then, it is authored by a very thoughtful and experienced developer
a little bit more carefully
you are going to have a bad user experience with a purely one-way communications concept
if that is what you're looking for, the most pure definition of "not real time"
you're just going to wind up polling, and what would be the point of that
every fully open source framework will advertise itself as real time
i have had a positive experience using just SignalR too, if that is more your speed (asp net core)
it Just Works, but neuecc already "fixed" everything with signalr for games
in magic onion
hmm
the only games that do not do polling use push notifications to tell the client when to poll, which to me seems basically just as bad
a lot harder to test, etc.
also, we already have a pretty large amount of backend written in Go already
currently relying on HTTP and websockets
if you are already familiar with protoc, you will have a fine time using it to generate code for unity
you will be reinventing a lot of a wheel here
which is okay
JSON.Net / Newtonsoft.JSON works fine in unity too, and depending on what you want to do, having a JObject in addition to strongly-typed casted objects may be more useful to you
there does not exist an swagger/openapi-like generator for UnityWebRequest
windows unitywebrequest doesn't even support gzip
you have to decompress it yourself
i don't believe UnityWebRequest supports HTTP/2
so generally, i'm just saying, you're walking into a relatively immature platform compared to what you're used to building web apps
i don't know if go's websockets whatever (is it gorilla?) will even let you set the headers that websocketsharp needs
for compressed frames
is this helpful @vivid owl ?
cool
yes personally i have had a lot of success with WebSockets
i use java as a backend, but it sort of doesn't matter
if you are writing something from scratch, i would strongly suggest going pure csharp
if you're turning a web-based game / experience into unity3d
you will probably have the best time continuing to use JSON
and not trying to innovate there
you will have a bad time doing automatic reconnection on ios / android
lots of stuff to learn
@amber trench i think that UnityWebRequest is just a wrapper over curl which does support HTTP/2
what is the network SDK you are using?
@undone sigil libcurl also supports gzip, and yet
Hello there, i'm making a Snake 3D Online game, when i try to implement the Multiplayer side, it gets everything really weird. The snake has the joystick and button on its prefab, and OnStart it assigns that joystick and button from his parent so it should not get weird, i can pay someone if can solve this im really desesperated.
Please ๐ฆ
I'm having trouble getting gRPC to work with IL2CPP
Just what is going on with the UNet depreciation stuff? I have been googling but all stuff that I have seen is outdated by years. What is the new system? Should I wait for the new system?
I'm new to Unity and I'm trying to make a multiplayer (<10 players per session) game as my first project to get some actual practice. But seems like a lot of things is going on in the networking section.
Your first project should just be for learning networking concepts anyway
I wouldn't try to pick "the perfect" engine
Do tutorials for Bolt, PUN, Mirror and NetCode if you want to get bleeding edge.
Isn't Unity NetCode under development?
Daaaamn
So until then I should either stick with UNet (which sounds plausible for a new developer like me but its getting depreciated soon so Ill need to stick with a more future-proof plan) or the ones you recommeneded
Thank you
TBH I'm not really familiar with networking because I was a Roblox developer and all those networking was done by the Roblox developers
I'd definitely use Bolt PUN or Mirror over Unet
Mirror is basically a 3rd party clone of Unet
(that's not abandoned)
if you want a backend managed by someone else (with a cost), probably PUN
if you want to host everything yourself, probably Mirror
I see
if you want to host everything yourself, probably Mirror
Meaning I host my own dedicated server?
yeah, and do all your own matchmaking and stuff
steam integration
So I'll sell (or upload) my game on steam with steamworks
And perhaps add an achievement or two
Not really
I guess valve have their own servers
What about the "join friend" feature on steam?
sorry i haven't used it, i assume that could be done through it
:3
Looking For: One experienced Unity (C#) programmer ----- but offering no salary (future share split)
This is mutual exclusion right there.
At least it's not a 4 year project ๐
Yes, it's somehow valid because he's very honest about the scope: prototype for kickstarter pitch...:)
If you want to use same components but different data, e.g. kinematic on one, dynamic on one, I think you'll need to set up the prefabs yourself and extend the spawning system.
@stray scroll thanks for the response didn't see it before. Extend the spawning system? Can't I check within a script if the given instance is the local player or remote one, and in the case is remote client then set as kinematic?
@prime nexus Sure, that would basically be the same thing, just possibly less control on when it happens.
๐
One question about extending the ClientServerBootstrap as in https://docs.unity3d.com/Packages/com.unity.netcode@0.1/manual/client-server-worlds.html
I see is done in the multiplayer example too, but the script doesn't seem to be referenced anywhere (or I am missing something)
the documentation about this seems lacking
so what's the flow? You create a class like the one in the example and...
@prime nexus Bootstrap is from Entities package, so it checks for the most descendant script of the original bootstrap, and calls it
Cool!
Where do I ask questions
Thanks Jaws
@ocean talon depends what your question is about, generally in the channel as category of which your question fits in.
Why even if i get the player component it give me error
Object reference not set to an instance of an object
Next time when you ask for help, remember to post 50 lines of the most relevant code and the full error message. @rancid anvil
Well here brings my (potentially stupid) question
To make a multiplayer game
If all objects can be seen by the clients
do they (or their ancestors) need a NetworkIdentity?
hey if i am calling a death animation in unity how do i call it?
hey if you're asking about #๐โanimations you can have more luck with that or in #๐ปโcode-beginner
oh
i am asking like if i want to play a death animation in photon
i dont want the player to be controllable while the animation is playing
so would i destroy and then play the animation(does'nt look possible)
can someone help me with that please?
@weak plinth
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using TMPro; //TEXT MESH PRO
using Mirror;
public class ProjectileScript : NetworkBehaviour
{
[Header("Projectile Settings")]
public float projectileSpeed = 10.0f;
public float projectileDamage = 5.0f;
[Tooltip("Projectile timeout in seconds.")]
public float timeout = 5.0f;
PlayerScript p;
PlayerScript s;
void Start()
{
Destroy(gameObject, timeout);
}
// Update is called once per frame
void Update()
{
//ONLY SERVER CAN MOVE PROJECTILE!
//This prevents hackers from executing injection to make bullets change value like damage and speed.
if (!isServer)
{
return;
}
ProjectileMovement();
}
[Server]
void ProjectileMovement()
{
//later we can add special movement effects and maybe trails
transform.position += (transform.up * projectileSpeed * Time.deltaTime);
}
[ServerCallback]
void OnTriggerEnter2D(Collider2D col){
if (col.gameObject.tag == "Player"){
p = col.transform.GetComponent<PlayerScript>();
p.TakeDamage(projectileDamage);
s = GetComponent<PlayerScript>();
Line 62 s.AddScore(10);
//ADD SCORE IF YOU HIT
Debug.Log("You hitted a player");
//Destroy the projectile
Destroy(gameObject);
}
}
}
NullReferenceException: Object reference not set to an instance of an object
ProjectileScript.OnTriggerEnter2D (UnityEngine.Collider2D col) (at Assets/Scripts/ProjectileScript.cs:62)
hey plz help me out
hey is UnityWebRequest for Android correct here?
@harsh dew 1 for health bar
2 for score
and
The p is the collider get component of the player
@rancid anvil just check if Bullet hit player for Healt and parent the bullet to the Player to check who shot
s is just the get component of the player
pls dont spamm
maybe just ignor player controlls in that moment and then play the anim?
yea thats exactly what i was thinking
@bitter flame How could i parent it to the player who shot
wait
Bullet.transform.parent = Gun.Transform.parent
cant I make something like a transform
In ProjectileScript
So i put the player on the field
try and find out
Yeah but i cant getcomponent of a Transform
Hi all, I've realized that moving something according to a trig function with Time.time isn't a good idea in Photon PUN because the syncing and movement becomes incredibly off really quickly- is there an accepted way to make something that like work consistently?
My text editor is telling me PhotonNetwork.time doesn't exist
im a little sad that it was a capital letter stopping me but thank you
Your text editor should handle this stuff for you. Make sure your editor is selected as the external editor in Unity
hello
wow this section was 8 hours unactive
just asking a question, is this the right place to ask questions about animation sync in unity?
@hallow fractal If regarding syncing animations of networked games yes
@solid crow: I'd recommend having a look at Simple Network Sync 2. It's an addon for PUN 2, which gives you a tick based sync system, sync vars and more. It should give you better results than TransformView and you don't have to figure out how to time things.
Make sure to do the tutorial. Feel free to ask questions about it on the discord server for Photon (see readme).
Should always indicate which lib you are asking about, since this channel covers so many @rancid anvil
Mirror
For UNet/Mirror/MLAPI only the server sets syncvars, and it will be started in whatever state you initialize it to normally
Hey any tutorials out there to implement a lan multiplayer where players host their own server and join host ip?
Every networking library from basic transports to full stacks do that - so you likely want to narrow down the kind of game - so you can narrow down which networking library makes the most sense for what you are doing. @echo maple
You basically just asked for the equivalent of "how do find a tutorial on how to build a vehicle"
I would if you are just totally new, do some tutorials for the upper layer libs like Bolt, Mirror, PUN2
or NetCode if you are determined to go ECS
Otherwise just connecting... any transport layer can do that
For lan though, PUN2 is off the table, as well as Bolt
Alright thanks, i'm trying to allow clients to create lobbies of 4 but i want the client to create their own servers, and one joins the host ip...
That is not lan then
I already have Pun2
You want actual lan? like only players who are inside of the firewall?
Or you mean you want players to be able to host internet games?
Then leave lan out of that description or you will confuse people
whoops
LAN means people all on the same local area
Bolt, Mirror or PUN2 would be the tutorials I would run first
Just to see the various architectures
what mirror comes by default is an ip field
which works same as in minecraft
you can host lan
you can host with hamachi ip
you can do port forwarding and host worldwide
@echo maple
I think he is more looking for what will become nat punch
its not going to be easy what he is after
im thinking something like this
That is actual lan
but than they would have to port forward themselves
for other people to join
which would suck...
Most people will not do that nor understand what that even means
so for a real game, you have to either host yourself, use a relay, or build in nat punch
steamworks is basicly a relay but with infinite CCU limit afaik
Mirror has steamworks transport
if your game is going to be on steam, you might wanna check it out
yeah it is on steam ^^
ill forsure check that out
just having troubles
thanks for the help tho
ill look into that
Some of the libs I think have steam transports in them. I would check the Mirror and MLAPI channels about that.
alright thanks
Hello there, how could i host a Photon multiplayer in a server? so i dont pay per onliline player quantity
@echo maple May I be blunt and ask if you have license to use that music piece by Whitesand?
Might be me being too hasty, but you linked your steam page before didn't you? @echo maple
This is a First Person Shooter Tower Defensive Strategy Game, you can chop trees, mine rocks, and gather scrap metal to build your base. Defend yourself from the horde of enemies, and try to be one of the Survived.StoryAn apocalypse occurred due to a strange virus, fortunately...
$8.99
yah
Ok good was just making sure
thanks tho
Can i get the link to the music piece please
@frozen canopy you always have to pay to use our software.
It's way cheaper when you host the server yourself
But you still have to pay something.
yes but lot cheaper
@gleaming prawn
i could pay myself a 140โฌ per month OVH Game Dedicated
that is able to handle thousands
of players
thousands of players in Photon costs like 500-600โฌ
per month..
LOL
how many GB usage of traffic?
Why was my message deleted?
@stray scroll https://www.youtube.com/watch?v=YqJgEqCycEo
๐ Support my work on Patreon - https://www.patreon.com/Whitesand
๐ณ Hang out in our amazing Discord Community - https://discord.gg/mD7As9h
Listen to my Music on Spotify: https://goo.gl/hh7Fwo
Facebook: https://www.facebook.com/martynlaur
This is completely free music, that y...
How many GB of traffic usage
@frozen canopy when you self host we do not acare about GB traffic
Traffic, etc, only means something when hosting in our own machines
I'm a core devloper of Photon quantum
And I'm well versed in our business model (we = company)
Anywhere you want, AWS, whatever
Yes, first you dowload the photon SERVER binaries
Host it somewhere of your choice
and i dont need t otouch anything in code?
You are talking about the client SDK only
Well, you need to read the docs to setup the server, signup for the license,e tc
If you are talking about PUN, code is the same
Yes
No changes whatsoever, just setup a photon server, add a license file to it, from the client games, set to self host, point to the server you set(ed)
okay so i just need to setup the server and change this to the server ip and port right?
yes
and the code to create rooms and everything is exactly the same
yes
can a photon server run in Linux?
we run the very same photon server software in our clouds...
No, Photon Server runs on Windows, using IO completion ports (not regular sockets)
We have a Linux/Mac version under tests
But it's a new version, not available to public
And yes, you can host some thousands of players in a single machine
Amazing
Pay attention to bandwidth fees from the host providers...
There's a reason why even big publishers host with us (instead of just picking the server)
a single 80โฌ per month dedicated could handle more than 1000 players i guess
Photon server handles a "bit" more
hosted by photon
then why the plans costs that much
Bandwidth
oh can i just purchase a Photon Server? and put that there with unlimited bandwith?
oh okay when im purchasing a server
just download photon server
Free to a limited CCU number even
No, you are using the 20 CCU PUn free, in OUR servers
Download the SERVER binary, host it... I think it starts with 100 CCU free,..
Oh okay so im not purchasing a Server, im purchasing the licence to run photon in a server with specific ccu
right?
here i though i was purchasing like a vps
or something
to use it for photon
You need to specificy what you mean by a SERVER... I always refer to server = Photon Server (software)
Not hardware
i was refering to a VPS or Dedicated server
You download the photon server (software)
Host it anywhere you want (physical server baremetal, VM, at home, whatever)
At home too? xD
Yes... Just run it
License is limited
But when you need to scale, prices for the large licenses is a lot lower, like I said
The free one isnt
It's all in the website
ah yea, in ccu
yes
going to watch a tutorial to setup the server
It should be easy
hmm
You'll pay a lot more money to these guys than to us... Keep that in mind..:)
lol
xDDD
i love photon then
ill purchase 100โฌ month windows server
and pay the 175/month
licence
of photon
it isnt
You can also develop everything yourself for "free"
it isnt overpriced paying 275โฌ per month if i can handle +2000 players
at the same time lul
Or "free" like Unreal...:=
That is out of my scope...:)
my game has paid skins, ads to unlock some skins
so lot of revenue i hpoe
hope
and the webgl
has ads
3 banner ads
on the sides
To get 1K CCU you need about half a million players
what
Yes
no
Because your players never play at the same time
to get 1k CCU i need 1k players playing at the same time
Yes... But in REALITY
What WE know is:
MAU = 20x DAU = 20x CCU
so 1K CCU -> 20.000 DAU (daily active) -> 400.000 MAU (monthly active) -> 0.5-1M downloads
So before you think about pricing, you should know that you need a VERY successful game to even SCRATCH our pricing...
i know, but my game is a game that the players play at the same time yes or yes
You normally would be getting revenue by 7 digits
and i could easily have 100 players playing at the same time
in the same room
at the same moment
Well... To have 100 players in the same room you'll have a lot more things to solve first..:)
what things??
Easy
Ok.
whats the second issue
but not all of them have the same contact as me
contacts*
potential contacts
to assure a good campaign
already have an APP with 150.000 downloads and 1k downloads every day
Have you ever published a multiplayer game?
nop, just APPs
never
ok
I suggest you start with a single player game then
You have no idea what you are getting into...:)
why xD
multiplayer brings lot of problems?
already tested it multiplayer mode with 5 other people and works like a charm
creating games is difficults
creating successful games is 1000x more difficult
why?
creating successful multiplyer is 10x more difficult than a successful SP
Well, it is what it is
you just need to implement things that make the user return to the game
every day
gifts
etc..
It's what the industry experience shows
When you say "just", is "just" shows you have no idea...:)
Sorry
Have to go back to work
Hello, how can i Instantiate a Prefab in a specific room?
oh okay just got it thanks
anyway
what happens if a player has high latency internet?=
with photon
othe rplayers see him lagged?
or he sees other snakes lagging?
k
Hello there, the distance between my players in each screen doesn't match just by a little cm, how can i fix that?
move them a little cm
how
// Update is called once per frame
void FixedUpdate()
{
if(!view.isMine)
rootBody.transform.position = Vector3.Lerp(rootBody.transform.position, newPos, Time.fixedDeltaTime * smoothing);
}
void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info)
{
//sending and receiving the position
if(stream.isWriting)
{
stream.SendNext(rootBody.transform.position);
}
if(stream.isReading)
{
newPos = (Vector3)stream.ReceiveNext();
}
}```
thats my code actually @jovial rapids
whats bad?
That Lerp though
Lerping into eternity
lol
Just trying to change the player object's name
well actually, the debug isn't going through
does it not like passing gameobjects/
It does not like passing gameobjects
i solved it, passed the photonview id, although not the one i wanted
What happens if in Unity Multiplayer game, the first person that joined the game disconnects? Tag me on answer please
If host disconnects, everyone gets kicked. If the first client disconnects, only that client is removed and nobody else is affected.
not sure why it's giving me issues about the ids
How do I properly DontDestroyOnLoad with PUN2?
I want to keep the data from the gameobject while changing scenes
Is a Singleton the solution?
@empty yew Typically, I set AutosyncScene to true on all clients, and then on the master client only, use the PhotonNetwork.LoadLevel to change scenes. That way everyone stays connected and the PhotonViews are all preserved. Does that apply to your problem?
My computer is off for the night, but I will try this tomorrow. I just loaded the scene normally with scene manager
If I can't get your advice to work, I may just forgo changing scenes
Yea, that will destroy anything that isn't DontDestroyOnLoad like normal, I think it's easier to use the PhotonNetwork.LoadLevel instead, that way you don't have to worry about it.
I'll try that tomorrow. Thanks!
You're welcome!
I did have dontdestroyonload though