#archived-networking
1 messages Β· Page 63 of 1
once you reduce your entire system to a near deterministic simulation of Inputs + State[x] = state[x+1] then you are ready to network
yeah, its hell
Its problematic because RPCs and Syncvars give you a real sense of fast progress. You have have two players moving around in like 30 minutes... so you are like "fuck, that was easy.... this is going to be a breeze"
What's your all's thoughts on the new netcode? I've been looking into different solutions for deterministic/lockstep. Thought about photon quantum but thats really expensive for a non-established project
Then 4 months later you are still trying to unbork your "who shot who first" garbage
ECS can lick me balls π
lol
Not touching it
Nope, just won't touch it in general
Am i thinking of wrong person?
I don't build for games that needs 10000 entities swarming
Ou..
fholm has his own experiements
I am
@jade glacier heres something that will even utilize the newest threadripper to its fullest
but with Unity ECS he has tried a few times and thrown in the towel every time. Its just too much work to get basic stuff happening.. and you run into "Not implemented yet" every step of the way
That is another thing... big networked games do not want you threading stuff
Unless you can achieve partial states that are commutative :)))))
threaded server = cost. If you chew up 4 cores to run your net game - that is bad.
Then it doesnt matter what order the states come in the result will synchronize to the same thing
In theory yeah
the networking chans are full of guys trying to bend treading to their will with networking, and the results are mixed.
Its touchy
And takes a lot to do
I had to use assembly to achieve user space threading that is
If you are after some insane level of player/entities net objects - and have succeeded with single thread at making a solid engine... for sure why not.
Had to look at shit like SysV ABIβs just to see what registers to save
Yeerp
The only issue with user space threading is that if you want full utilization, EVERYTHING needs to be thread safe
Because literally all of it will get turned into jobs
My net work comes at it from the opposite angle. I am fully component based and OOP... my goal is to make components that all drag on and play nice together for users. And I worry about scale as a secondary concern.
For sure, i mean a vast majority of games only go to a few dozen players
You know, in order for the last of us: remastered, to achieve 60fps on their ps3 they had to create user space threads
Let me get the article
Everything became jobs
Networking
Graphics
Etc
It makes sense on the client side to make use of any cores you can make use of
But the client side of networking typically isn't going to need that much CPU, not like the server does for huge state transfer systems
I can't get my vid capture to not screw up the frames for some reason, but this is the stuff I am making for PUN2. All of this stuff going on with weapons, heath, movement/anim sync are all without any coding. This kind of stuff I could not even think of writing with DOTS in its current state.
seems that codec is even worse and isn't recognized by discord
and isnt recognized as an mp4 either
weird
Not sure why capping video is such a problem on this laptop
windows or linux
windose
Win + G might work for you
its meant as the game overlay, but it records stuff too if you want
I'll play around with that stuff and see if its cap does any better, thanks
lmfao
got something WAY different
I am using ShareX, but its making videos that encode some messiness on the frame order
Or maybe they just play back wanky and they are recorded fine
the vp9 codec right now is the best one i think
make sure your using that one for encoding
yeah, only seeing vp8
that video source is GDI though
I wonder if maybe because I am dragging to select the cap area I am ending up with a non-8 factorable size
could be- except I never make sure its the right size
maybe I always get lucky π
whats wrong with GDI source?
Capture at like 30 or 60fps?
When I say 60... it definitely doesn't look like its delivering that
30 for reduced size, 60 for smoother picture
record uncompressed
oh
Yeah 50 MB for all members
Still looks nothing like how smooth it was playing
was capped at 60
I'll play around the the xbox stuff tomorrow
lel
can you just make use of vector3int for all of your simulation and never let it go to float? @urban jackal
@jade glacier what? I need highest resolution. Vector3int?
Hello all, I wondered if you guys could help me.
I'm working on a survival multiplayer game and I started working on placing items. Then I found a strange bug, when sending the data for a new entity, it only sends the packet once and then never works again. But if I put a Debug.Log in front of it, it suddenly starts working?
(I work with a self coded server btw)
public void SendData(byte[] data)
{
Debug.Log("test");
handler._clientsocket.Send(data);
}
I pasted my senddata class in hastebin. The bug is happening at SyncEntity() (at the bottom).
The 'SyncEntity Finished' debug always gets triggered. Even if SendData doens't get called.
@urban jackal I didn't look at your code, but you said you are doing compression of your vector2, so is your compression lossy and is that error not expected as a result of that loss? If you hatebin.com your code I can take a peek at your compression.
hi
"The object type 'AudioSource' has been destroyed but you are still trying to access it"
The Coroutine still runs after the object was destroyed and gives me 500+ errors..
stop the coroutine ondestroy
save a reference to the coroutine when you start it, ondestroy, stop it
how do you store a value for a coroutine?
or i mean
set it
nvm i just changed the method π
Is there a way to add multiple Ioperation handlers of peer in v4 photon server?
I got this issue using networkanimator that doesn't exist for the user's client side. When my character sees another character running (using the network animator) they're facing the direction that they first pressed. So lets say that you pressed W to go forwards, and then started pressing A before letting go of W then it'd still play the animation for W.
yeah I'm using the transform sync and using the unity multiplayer thing @jade glacier
but wdym by owner authority? the player is using local player authority in the networkID component
You also are disabling your controllers on all non authority versions?
yes
the player has no control over the other character's animations or movements
^ is on the player prefab
all of those are on the "Player" (root) object in the prefab and the traditional animator is on the "player" object which is the child of "Player"
@stiff ridge I made a test project file that still exhibits the problem...i uploaded to google drive: https://drive.google.com/open?id=1EymvpEulTnwHtPMJMFJnVgTNxpxHocS6 I cleared my photon app IDs before compressing. W key to move cube up, S key for down.....key input is only allowed at master client. Make two copies of the directory so you can open up project in 2 unity editors. WHen running, you will notice that the scene object IDs do not match across the 2 clients. USing Unity 2019.3.0f3
@marsh marlin you should probably consider moving to Mirror if you are sticking with UNET HLAPI. They can also probably help you figure out where things are going wrong with that.
what's Mirror @jade glacier
Group that has an open source lib going that is actively expanding on the hlapi library.
Worth looking it up
alright I changed to mirror
uhhh
so it's much snappier
and I like it since unity isn't screaming all the time
but the issue is persisting
I'll get a video recording of it
I think this has less to do with the actual networking than it has to do with the way I check for up/down/left/right
here, I'll continue this in the #π»βcode-beginner chat but this is basically what it's doing
uhh they came up with that I had to put all the animations on one layer for networkanimator to work
and just... if there's any other way then hmu
yeah I'm not doing that
if there's any other framework (like photon), or if I can just make my own script etc. hmu cause I'm pretty lost for what to do from here
@marsh marlin DM me and let me know what you're looking to do.
We're the team behind Scene Fusion. We have something that might be able to help.
I make an asset store asset that handles animator and transform sync in a much better way, but I don't officially support mirror with it. It does work with Mirror/MLAPI/UNet if you are desperate. @tough siren
With HLAPI and Mirror, I believe all NetworkBehaviours have to be on the root, so not sure there is any getting away from that with the built in components. @marsh marlin
I'm just getting started, anyone here messing with the new NetCode preview? I cant get this to work https://docs.unity3d.com/Packages/com.unity.netcode@0.0/manual/getting-started.html I found t issues with it and found fixes here https://forum.unity.com/threads/getting-started-with-netcode-error-cs1503.820878/ but no matter what I do I cant get the cube to spawn when I join using playmode tools
Trying to follow:
https://docs.unity3d.com/Packages/com.unity.netcode@0.0/manual/getting-started.html
Got the following error below after installing...
@weak plinth Not many people in here are playing with netcode for networking, you might want to ask in the DOTS channel as well.
thanks, I found the pin with the project code working. I'm now comparing it to what I did to see where I went wrong.
@marsh marlin Please join Mirror's discord for support. I don't watch this channel much but I'm active over there.
Discord link isn't allowed here, but it's in the Asset Store description.
If you are using Mirror or even UNet HLAPI the Mirror discord will get you faster responses for sure.
@jade glacier all the network components are on the root, but what I heard in another channel (which is most likely the reason that it's not working is that there are blend trees in the animation, and I can't really afford to put them into individualized blocks)
You can try my asset, people have used it with blend trees. You can put in for a refund if it doesn't do the trick. I don't like recommending it for Mirror, but you seem to be running out of viable options.
@marsh marlin
np
@weak plinth did you find the problem?
I didn't find what I did wrong but the package from the pin works so I'm just reading all of it
If you don't find it you can DM me your project and I can give a quick check
@jade glacier I just got your asset and it works perfectly. All I did was attach it along with the mirror networking objects and there have been no new problems ^^ tysm
Glad it worked for you. Let me know if any future Mirror/Unet/MLAPI changes break it. I don't actively monitor their breaking changes (which is why I don't officially support them), but I will make fixes when I can if they do break things. @marsh marlin
alright, will do so
Hello. In photon I have a problem. My player is not colliding with the platform when I build the game. Why? Thanks.
PUN2? @frosty crystal
yes
would need to know a bit more about what you are doing
What does your player object consist of for components and such?
Ill sent photos 1 min.
the player has these componentes.
rigidbody is not kinematic.
non-kinematic is going to ignore colliders
in unity editor works. but in the build one, not colliding
sorry. not not kinematic
I mean not clicked
are you telling your non-owned versions on the network to not apply any of your controller code?
Which versions of the player are not correct? The owner is incorrect? Or networked clones of that player?
there is no problem on owner. but remote player is not colliding
falling down to endless
I would switch to the transformviewclassic, that transform sync is super limited
I am working for Exit on a replacement system for all of that you are welcome to try the beta of.
Ill take a look now.
Ill prepare a video to clarify for 30 sec.
thank you for your help.
The tutorial file needs to be reuploaded though, right now I have some stuff in it that shouldn't be there.
Anybody wants a job ? Rewrite the 3rd person controller into mobile & with TNet sync DM me with your price
The standard asset one if possible
Right, will you supply the project with it setup or do you expect that being sent to you?
I can send you a character and the things you need. I think it's pretty much drag & drop once it's done, or am I wrong ? If you need the whole project let me know. It's only a login system and then it spawns you, I just need controller/animations form the standard asset to sync, and make it work with mobile, I can purchase a joystick asset if needed
Right, which price range are you expecting here?
(Doesn't the standard character come with mobile controls? I know Unity has a joystick package as well)
I don't know how long such a job would take, is it a big job ? I read the script quickly there is a define for mobile input somewhere, I think it semi supports it, don't take my words though.
I am not on pc atm. But I can go through it again later
Not particularly big, the joysticks isn't a big deal, they supply you with input axis
2-5 hours tops, assuming you just want the network position synced, as is
Yes, want it to work with mobile input, and the animations from the 3rd person character, ducking and jumping that is. Adding 2 clickable buttons that toggle ducking and the other jumping.
The networking is TNet.
Tell me a price in private and I will reply
You've seen the TNet 3: AutoSync Example In-Depth right?
for the transform sync
Been a while since I dabbled with TNet, switched to other solutions instead
seems familiar enough though.
I have made myself a basic movement controller. Works great and is synced. However the amount of time that it would take to get to where the already made controllers are would be a long time for me. Hence why I am checking if anybody wants to do me a mobile joystick script that uses TNet. I have a hard time understand the third person controller script.
It should be yes. There are example scripts I can show you as well, there is a car controller script for example.
hello can someone help me on a small networking issue concerning tcp sockets ? i managed to make my unity send some data no problem. but the reading data is blocking the program and unity.
@cedar marlin you are never calling readSocket() but you are calling theReader.ReadLine() which will wait until their is data
so it will freeze
question, does the HLAPI package support playing with people far distances or just lan/local players?
if you have a server @ocean slate you could use wan too i think
Asked on the dots channel, but Has anyone ran into Unable to find internal function Unity.Networking.Transport.NativeBindings::network_sendmsg when building NetCode for iOS?
It seems the netcode features are not yet supported by iOS il2cpp, which I don't know why does not surprise me.
Is Zero tier one good software?
I've been looking for something to use since evolve died
and its ok but i just dont like how its always on and there
Does anyone know of any good also slightly more user friendly options?
@gleaming prawn are you trying it on 2019.3 or 2020.1?
IL2CPP is broken with 2020.1 and entities in general
I'm not trying... Just an educated guess based on the message
And some cases we had when trying to manage threads on iOS (and then we found IL2CPP generated code with this kind of comments: // not implemented yet.
Is there an easy way for making a multiplayer game?
Can someone help me?
I'm using PhotonNetwork
But when I create a room and want to join with an other client, He doesn't find the room π
https://hastebin.com/rohusosawa.cs
(mention me)
Make sure nicknames aren't identical
They're not the same (because I choose them...)
@vital hawk @gleaming prawn I tried it on 2019.3 using entities 0.5.0 and NetCode 0.0.4. Everything seems to run fine in the editor, but as soon as I install it on iOS devices, it dies when trying to send network request. App just crashes. I tried building out a MacOS one and it runs fine. Seems to be iOS specific the errors.
have you checked netcode docs if IOS is even supported atm?
hi!
I'm currently using a very simple php program to do some multiplayer communication and I've come across a bit of a snag with the webrequest. I'm trying to do a flush() / ob_flush() and get a quicker responsetime. The problem is that I don't receive the data after the flush but only after the whole programm is done. I have not found much when googling this. Anyone know if this is possible?
I'm currently doing a
yield return request.SendWebRequest();
Do I need to check it repeatedly and how do I know if the data I have is complete or not etc... :)
@rugged crater I very common oddity with PUN/Photon is the editor tends to find a different region than builds. For development I always enter a fixed region into the PUN settings to avoid that.
@jade glacier can you give me An example?
Go into PUN settings and set the region to like us, eu or sa
What would you guys recommend, outside of using UNet?
I'd like to make simple matchmaking, possibly with a master server and possibly some server side code.
It's a very small project (or atleast should be) and everything is done except the networking logic, which I don't even know where to start with..
@jade glacier Like this?
yup
it worked!! thx
np
Is there any public matchmaking solution with Forge Networking?
Not sure. Best to join their channel for questions about Forge though. Don't find many users in this channel. @grave ledge
Yeah I'll ask when I get back, no phone number on my work discord and they are annoying like that π
Can anyone help me understand how to implement Online Multiplayer (Network Manager) into my game?
Quick question, can I use OnPhotonSerialiseView on a game object in the scene instead of spawning it?
If not, is there any way of adding any conditions or something to those OnPhotonSerialiseView?
Like I have two variables, I only want to change or write one of the variables if it is the master client and change the other if it is not the master client.
I don't have any issues if I spawn it as prefabs, just curious if this is possible without spawning a game object?
If it is I could technically avoid spawning prefabs for players and just the two default gameobjects in my scene as player objects as it looks a little bit hassle free
You could technically use a single serialize view to send complex updates, but why would you? It's a super complicated design trying to do something that would be much better done if you don't use pun
I mean, if you want to do custom state transfer, you better start from photon realtime (flexible transport layer with reliability options)
Or just use photon bolt (which does all that automatically in a well designed approach)
Pun is great as it is because it lets you finish a game with very little effort
If you are trying to design around it, chances are you would be better using something else entirely
It is super complicated like you said and I'm not going to use it, I was just curious it an approach like that is possible.
The game I'm working on is pretty simple, all I have are two players who don't move or do anything. They are empty game objects where the only thing I have to keep track of is their health. There is no shooting or anything as well since this is a 2D game, all I have to do is press an UI button on player 1 and that automatically reduces player 2's health, and the button on player 2's instance reduces player 1's health.
When I spawn them as prefabs, this works, I have no issues at all. Just the idea of having them in an empty gameobject in the screen where I could change their variables seemed a wee bit easier instead of spawning prefabs and referencing them.
ok, so in that case it makes sense, you can do either OnSerializeView of each one, or use a single "manager" game object per client to do it separately from the objects you want to control.
Thanks, this is exactly what I was looking for. Will let you know if it works out π
You don't actually need any gameobjects at all if you are controlling the entire system. You just raise events, which just lets you send byte[]s between connections. @quasi tapir
PhotonNetwork.NetworkingClient.OpRaiseEvent() might be worth looking into
Though at that point you aren't really using PUN, you are just using the Exit relay servers. Not that it matters much.
I'm using Photon Network and I'm getting a bug when the third client joins.
On the third client, players are seen flying. However on the first and second client it's normal.
@jade glacier The method @gleaming prawn suggested works, will check this method as well, thanks mate
Mine is the same, its just skipping the creation of net objects to serialize through, so its a little less traffic and skips the middle man of running it all through that component.
(using NetCodE) I have these empty "build spots" in my game, the player can go close to it and a world gui pops up where she can select what she wants to build. Apart from changing net engine, what would be the best way to solve this x) req; within vicinity of build spot, multiple players can choose build on spot (first one will be approved).
I was thinking either checking input on server, but that would require me to resim the world gui sort of. Other way I thought of was to basically send a state with my input to server which is basically tickOBuildRequest + buildSpotID, where if the server notice a change of requestTick, it has to make the distance check for the player and approve or not.
@stray scroll client side prediction should be able to handle this
@graceful zephyr So having the world GUI part of the server simulation? Just thinking if there would be some hickup by packet loss or something and the server instead notices the player "clicks" on a adjacent button instead, that would be sad.
@stray scroll Store the state of the GUI in the simulation
That is pretty much always the answer, even for not networking yeah
Sim should produce callbacks on changes, GUI code should subscribe to those and defer them and whatever accordingly.
There is no server code, since it's a relay. You would need to look into server plugins for photon server
@weak plinth
Anyone here got experience with Photon Pun? Trying to setup OnPhotonSerializeView to stop the syncing being all 'glittchy' but its giving me a cast error butit looks fine to me
im pulling my hair out
{
if (stream.isWriting) //iam the owner
{
stream.SendNext(transform.position);
}
else if (stream.IsReading) //im a client
{
transform.position = (Vector3)stream.ReceiveNext(); //InvalidCastException: Specified cast is not
}
}```
I never make use of that since its kind a recipe for garbage (what you are doing I believe is going to produce a fountain of garbage collection), but at a glance it seems right.
@past wren
That i how the built in synctransformview does it. does the second test need to be else if (stream.IsReading) rather than just else?
i dunno if i change the else if to just else i get a nullreferenceexception
im about to give up with photon tbh
it either doesnt work or if it does its just glitchy
The components that are in the vanilla are largely placeholders and demo code. You can give the beta of the SNS stuff we are making for it a shot, it automates all of this stuff.
what are you getting a nullref on with out that else if ?
Because that seems a bit odd.
stream.isWriting that is being lower case is suspect
Are you using PUN or PUN2 ?
@past wren
i'm using PUN2, tho i did notice 1 issue im just checking now. It should be 'IsWriting' not 'isWriting', somehow i hda created a local bool and so it wasn't actually using the photons stream.IsWriting
That would definitely break things
ok cool that works, it will sync over network now. Shame its still jittery asf
but at least that explains that ><
all the libraries that are not full stack will be jittery
Bolt, Quantum and the SNS stuff in beta are really the only libs that are going to be able to be smooth, because they are the only ones that work on proper tick based systems
ah isee, i had looked into bolt briefly what solution would you say is the best?
I really recommend giving the SNS lib and tutorial above a try. Its going to become part of the PUN2 library eventually and it handles a lot of the stuff people get bogged down in with PUN
There is no best, they are all very different
and have very different use cases
fair enough, i'll give the SNS lib and tut above a go see how that pans out
You can also use messaging/transport libs like Mirror/MLAPI/Forge
But you will run into the same issues of things not just being "smooth", because they are messaging layers and not simulation management layers
ah yeah i dnt want that my goal here is really just to making something that syncs up smoothly
ping me if there are any faults in the tutorial. We haven't had many test it outside of the PUN2 dev circle so its still early
For casual coop stuff PUN2 is likely going to be the preferred option.
I'm heading out, so you are on your own with the tutorial for a while. GL. π
@graceful zephyr I still didn't get how to deal with packet loss that would change where the player is looking in turn marking wrong GUI? Or just ignore such slim cases?
It is possible to send your intended target along with the tick
you can then use that when the server applies your "use" or whatever. You just turn that from being a state to being an input
Its just an input that the server has to verify, with a distance check or whatever you deem essential
Why are ports for TCP: 4530, 4531, 4520 working but not the UDP ports? I'm using Photon Server.
@jade glacier Ok, so both of my options I presented are valid x)
@weak plinth: This is related to your local setup. By default, the server listens to UDP and TCP ports. Check firewalls.
@stiff ridge My firewall allows TCP and UDP for Photon. I also have TCP and UDP port forwarded. TCP only works but not UDP.
After checking that the UDP ports didn't work I tried the TCP and it works for some reason.
The upper screenshot shows a lot of settings. Some of which are for a specific path, some are generic. Hard to say if that's correct.
The lower shot is .. what?
I am not an expert in setting these things up. Head over to our forum and I'll ping my colleagues to have a look.
The lower shot is the port forwarding.
The upper shot is the firewall. It shows different paths because I have 2 Photon Servers that I tried testing but it didn't work.
I think this image will be better:
Two Photon Servers won't work at all, because they can't both listen to the same ports.
I can't really help with the port forwarding aside from high-level knowledge. Get it going with the client on the same machine, then change the Game Server "public IP" in the config and try from the outside.
Use Wireshark to see if network traffic arrives from the outside.
I can connect to the server, it's just the the UDP isn't working.
The TCP ports 4520, 4531, 4530 work but the UDP don't work for some reason.
I can connect to the servers fine even without the ports, it's just the UDP won't work, but TCP does.
I use canyouseeme.org to check if the ports work.
I even tried changing the UDP ports to 20000, that didn't work either.
@stiff ridge I posted on the forums, but haven't got any replies yet.
This is my PhotonServer.config, it's default.
Yes, the forum can be slow. We are always busy. I will ping the server guys.
Keep in mind that we try to give free support. It has to be done on the side.
I use canyouseeme.org to check if the ports work.
I don't know them and can't say anything about it. Maybe Photon won't reply to them via UDP.
@stiff ridge So you don't exactly know what's the problem? It can't be a port forwarding issue because TCP ports work fine.
No, I don't know exactly what the problem is. It has to do with your setup and .. I only know the few things about it that you posted.
I also tried different port checking site besides canyouseeme.org, it still says UDP ports are closed.
Most likely they don't get any reply. Which is fine, as Photon won't just reply to any random message.
I'd say forget about that and use a photon client instead. You can use TCP in the client for the time being.
@stiff ridge I didn't change any setup too, I downloaded the Photon Server SDK straight from the Photon Engine website then port forwarded the UDP ports and TCP ports.
TCP works, UDP doesn't work.
You are skipping a few things...
Try to get TCP working. For the time being, forget about UDP.
TCP works perfectly. It's just that UDP doesn't work.
Follow the guide I already gave you and make sure TCP works with Photon from external.
Did a client connect via TCP from the outside?
A Photon client?
Outside my network?
Why do you setup port forwarding?
So players can connect outside my network.
π
I can connect perfectly with TCP but UDP doesn't work for some reason.
What could be wrong with UDP @stiff ridge ?
Just tested that TCP works fine, UDP still doesn't work however.
My firewall allows TCP and UDP to go through too.
@stiff ridge I sent Photon Engine a mail, maybe it's a bug in the latest Photon Server SDK?
Is there a possibility that TCP is running instead of UDP in Photon Control?
The server runs both
It's an issue with the port forward + the server IP setup....
Your email will be taken care of
Here we normally answer quick inquiries about the APIs, etc
Is it possible it's a bug? Both TCP and UDP ports are port forwarded. TCP ports are working but UDP ports are closed.
It's not a bug
My firewall is off as well.
UDP and TCP work fine locally.
Udp port forwarding is tricky
If the router is acting on behalf of the external client correctly, for the photon server it should look like it is a local client
I also tried changing the UDP ports to 20000 and 200001 to see if any ports were interrupting it but that didn't work.
I think I know what it could be
The first connection is with the master server role, then the master sends out to the client the IP of the game server
If that is not configured correctly for port forwarding in the server config, clients will receive a local, in accessible IP
Wait for the email
This has been done several times, there's not a bug, it's just tricky to do
I got this issue when running from inside a VM (in that case it was easy to fix)
I'm just telling you what it might be. I'm not from the server team
Wait for your email answer
I'm from the photon quantum team (I cannot directly handle server support, sorry)
I might bljust help with a few guidelinws
I port forwarded TCP the same as UDP, it's just the TCP works and UDP doesn't work.
(typing from phone, btw)
That log shows that the Master knows the Game Server. This is not related to connections from the outside.
As Eric said: When you setup the port forwarding correctly, the connections from the internet will look like local clients. The router will translate the connections accordingly.
I would run wireshark once to confirm that external clients can send UDP data to the local client (via port forwarding).
Maybe the server's responses (also Datagrams) are not forwarded correctly and never reach the client.
There is one thing you have to config manually for the external users:
Photon-OnPremise-Server-SDK_v4-0-29-11263\deploy\Loadbalancing\GameServer\bin\Photon.LoadBalancing.dll.config
Has a node "PublicIPAddress". Set this to your public IP. Else, clients will only be able to talk to your Master Server and not reach the Game Server.
(So you could not join a game from outside.)
That is the one... The public IP in the config must be set to the router external IP
For some reason it's automatically set to the public IP already.
@stiff ridge I'm not sure how to use Wireshark with the Photon Server.
Here's some help: https://doc.photonengine.com/en-us/pun/v2/troubleshooting/analyzing-disconnects#wireshark
Photon Unity Networking framework for realtime multiplayer games and applications with no punchthrough issues. Export to all Unity supported platforms, no matter what Unity license you have!
@stiff ridge Looks like I'm getting TCP and UDP networks connecting.
I checked by connecting through TCP and UDP clients.
However the UDP ports seem closed.
This is the result I get when I check if TCP or UDP are working.
The top is TCP and the bottom is UDP.
Again: Photon will not reply to some service. It may be able to detect that a TCP connection is possible, yes, but UDP does not have connections.
So if Photon itself does not reply to random UDP datagrams, then this test is not telling you much.
Use a client.
Thanks @stiff ridge it appears that after checking with a UDP port checker it seems to be opened.
I never knew that UDP had no connections.
But it appears that UDP is open.
Hey i'm working on mobile game similar to worms this is my first contact with multiplayer games so i decide to use networking engine like photon instead of code it by myself, i thought about photon or unity multiplayer services but im not sure wll photon be enough for game with 250-500k estimated users
so i have to choose something else than photon bcs photon pro has only 100ccu, thx for help π
no
we have plans for any number of CCUs
we have games with 100 million users...
500k is a small game.
this is my first contact with multiplayer games
I suggest you first try to make the game...
If your game is successful, than you'll a "good" problem to tackle.
If you have any business specific questions, feel free to send an email to developer@photonengine.com
Here we normally discuss more the technical aspects of online multiplayer (which approach or SDK to use, based on your game itself).
@left cobalt I think you got confused by the link on the Unity Asset store (selling from there you can get the 100 ccu plan for 5 years). Check our website for all plans.
@left cobalt u can choose mirror networking same as unet but have some little changes
If you are using deprecated Unet, moving to a Mirror/MLAPI might not be a bad idea. Just be aware that both are regularly making breaking changes since they are being actively developed.
Hi guys how can i implement TCP at transport package?
I read pipeline but its implement a pipeline with an structure, where is behavior?
Hey guys trying to use photon, whats the easiest way to just connect the user to the server. its not for a game just a demo
There are two built on components
In the prototyping folder
ConnectAndJojnRandom our something like that, and OnJoinInstantiate
@twilit lion
When does the new unity networking thing come out?
it's in early preview now
but who knows when it's actually going to be production ready
That's what I was wondering... Thanks for the link though, I will take a look at it when I have time
Also, does the photon networking use unitys current deprecated net code or is it something else entirely
@weak plinth Photon has it's own netcode, doesn't rely on anything from unity when it comes to socket/transfering of data/etc. it's all bespoke
@jade glacier do you know how can i implement tcp at transport?
Just use a tcp transport
Can I use Photon Chat for Photon Server?
Just use a tcp transport
@jade glacier
? How? Its not contain tcp.
Use mirror our MLAPI or some library that is tcp
What lib are you using now? @urban jackal
Unity multiplayer transport package. @jade glacier
You mean netcode?
Yes but without netcode
Not familiar with unity has going atm. But pretty sure it's all just rudp
hey, can any one give me a easy tutorial lik /how to setup my first little unity server?/ wood be very nice
Pliex, keep in mind that networking is HARD, and it's going to take a lot of time to learn. There is nothing "easy"
@remote sail hmm. the problem is that I can play my simple game with my friends
@remote sail do u have an Idea what i shoud do?
@gleaming prawn no only like a little shooter
yea
Sorry, suggestion is first study a lot about how to make a game multiplayer
Setting up a server is the LAST thing you'll do (if you'll need at all)
Check the tutorials on how to use Mirror or Photon Bolt (these are the most convenient ones for a shooter).
But as said... this is HARD
Making games is hard... Making network games is 100x HARDER.
hmmm
don't be discouraged, just recognize the effort and patience required with networkign
Many of us here have 10+ years experience with game development (a lot with netcode development), and even for us it is never trivial
ok so I shood make my game like on local host and practise more
so don't give up fast...
yes
make it work multiplayer with super super basic things
Check Mirror, PUN, Photon Bolt, etc
These are easy to use APIs for multiplayer. Mirror is open source, photon has free plans for small games
ok thant you. I do programmiring like 3 months π€£
one has to start somehwere, right?
Hope you're having fun
Programming = super powers
@gleaming prawn i done check mirror, but can I play it like with my friend with (hamachi)
@gleaming prawn yea u are right
Didn't understand the question
If you can play online from different locations?
In that case mirror is a bit more challenging because you'd need to host a server...
hamachi is a LAN emulator. makes your PCs think they're on the same LAN
Try PUN or Photon Bolt
ohh
should work
Should work over VPNs
as long as you can bind the server to an IP that is in the VPN range
Just don't know if out of the box, or with some setting up... Mirror has a discord and people are normally nice there
Photon Bolt runs without Hamachy (it has builtin pucnh through)
ahh. ok I will try both
so you can run the server on your PC, and your friend connects no problem (falls back to relays in case punch doesn't get it, etc... always works)
thank you for you help π
Disclaimer: I work for photon (but on the Quantum team). Mirror is an open source SDK (based on the deprecated UNet). I'm not involved with it.
oh ok (;#
there are guys here from the Mirror team, but they also have their own discord
Same for Bolt. Ramon Melo (lead dev) + Stanchion
bolt originally developed by fholm (now lead dev of quantum).
ahhh
Hi folks, I'm currently a complete beginner to using Photon PUN and I'm having a pretty bad bug in both of my projects using it that I'm unsure how to fix:
My current setup has me on a second monitor actually building the game with the launcher, and then also playing through the Unity editor so that I can have both clients at once. The trouble is, JoinRandomRoom() fails on the second one despite maxPlayersPerRoom being 2 and the first client already creating an empty room. Instead my second client creates a new room that works just fine, it's just that my two clients aren't in the same room anymore. I tried using a Debug statement that called PhotonNetwork.CountOfRooms and displayed it to console but that turned up 0 for the second client as well, even after the first room was created
As far as I'm aware, I didn't touch anything in my launcher script or in the PhotonNetwork scripts (save to make that debug statement i mentioned a second ago) and I'm really confused on what the problem is
Sorry if it's a silly question or if I'm overlooking something super obvious.
Be sure to set the fixed region in pun settings to something.
The editor often can get a different best server region choice @solid crow
may be a silly question but how exactly do i do that
it gives me a whitelist but im not sure what im supposed to be typing or looking for
Open Window > Photon Unity Networking > Highlight Server Settings
okay yeah i put only usw in and it worked, wasn't expecting that to be that easy, thank you guys so much!
Np
Is there any statistics on how many active users there are of Play Games Services? Im thinking about which authentication method i should implement
is it easy to make a online game in unity? o.o its 2020 now
Probably should mention what library you are using
Whats the Update() equivalent in Photon for a "Bolt.GlobalEventListener"
Not sure what that does in Bolt, but I assume its registering a handler for a certain message id? @stable epoch
hello, I have a problem with mirror. If i try to conect to my server, but than the spawn prefeb is spawning but nothing is happening on my client
Hello there, can i get some little gelp
Help
I is there any script that instantiate a object, soo every player that joins can see it
I have a object that moves, soo every player eho joins sees it
I have a script, but that script instantiate for each player joining another object
So i want just one object for all players
You should first say which net library you are using. Then show the code you are using to try and do it. @hallow fractal
And one object for all players is not a thing. That involves changing authority dynamically and is one of the more complex tasks in networking.
@jade glacier im using pun 2
I just want to instantiate one object, and all player who join behind me can also see it
That should happen naturally if you are using PhotonNetwork.Instantiate
How are you instantiating now?
paste it in like hatebin.com
or if its small paste it here inside of
```cs
// your code
```
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Photon.Pun;
using UnityStandardAssets.CrossPlatformInput;
using UnityStandardAssets.Characters.ThirdPerson;
public class MobileFPSGameManager : MonoBehaviourPunCallbacks
{
[SerializeField]
GameObject playerPrefab;
// Start is called before the first frame update
void Start()
{
if (PhotonNetwork.IsConnectedAndReady)
{
if (playerPrefab!=null)
{
int randomPoing = Random.Range(5, 15);
PhotonNetwork.Instantiate(playerPrefab.name, new Vector3(randomPoing, 0f, randomPoing), Quaternion.identity);
}
else
{
Debug.Log("Place playerPrefab!");
}
}
}
// Update is called once per frame
void Update()
{
}
}
thats what i use for the players
Start is a bit of a risky place to call your instantiates, you generally want to keep those in a callback like OnJoinedRoom or something
hmm
Use the built in prototyping classes for starters to get it working before trying to guess the correct code
OnJoinedInstantiate
i actually got this from a video
Videos mostly suck - I can't speak to what you have going there
If you followed the video and it doesnt work, either the video was wrong, or you made a mistake copying it
it woks, for the playrs
but i want to instantiate a moving platform
Then just put that in the scene with a PV on it
and it will become the property of the MasterClient
does the moving got translatet to all?
wait, i try
you have to be very explicit
hmm, well it works, im wondering, i thought i have tried it before
but theres a issue that im noticing
the player that im playing from my scene looks good and moves along with the moving platform good, but the player from the build i made dosent move smooth, its like teleporting
@jade glacier you know the reason maeby?
You mean the owned version is smooth, and the networked clone is not smooth?
The built in transform syncs are notoriously not good, they are just for prototyping, so you may just be dealing with that.
There are also two transform syncs, try the classic version as well.
As we speak I am adding moving platforms to this tutorial. It's definitely not trivial to do.
@jade glacier hmm should i add only the classing or both
now i have both addet to photon view
but it looks weird
One or the other
theres a issue when i put only the classic version, the players dont syx anymore
even i didnt touch them
can i show you the error it show me?
Can post it in the channel sure. Someone might have an idea.
I don't use any of those components. I work for Exit/Photon making a replacement for most of that stuff, so I don't actually know it limits.
this happens only when i put the classic tranform to the moving object
and this is how its set up to the object
Those are a bit more of basic how to use C# and Unity questions with the unassigned reference issue there. I guess first question is if you have made a single player game with Unity before?
You cut off the error message so I can't see where outside of of PUN in your code the error originated
Line 369 in PhotonView for me is a comment, so we are on different versions.
Where did i cut the error message?
Are you using PUN or PUN2 there?
I may just be out of sync since I am working on other stuff with the lib, and may have modified my code
Pun 2
It was just clipping your component ss in my windows, was fine once I opened the source - so ignore the thing about not having the full error.
It might be because of the second empty slot in your PV, but I doubt that. No idea why you are getting a script error there.
Either of those transform syncs are pretty rough regardless, they are just there as a reference and for prototyping. People typically make their own or buy 3rd party assets like mine.
Soo you might think of the empty slot? Might try it
I never got the error before
Its werid
No idea, seems like a problem with the classic component. Which again I never use so I can't speak to. But I am not aware of any such bug in it.
Which var is not being set? What is the error pointing at?
Its pointing to that PhotonMono under the dontdestroyonload
Thers the screenshot
Need ti try it till it works
Not sure I understand, how is that the undefined field?
it saying that a field that is being used has never been set... which field is it referring to.
I can't debug this stuff for you, I only see what you have pasted so you have to dig a bit yourself.
Or just don't use Classic, if its being busted.
Hmm sure i will see what i can do, maeby the empty field is the issue, if i fix it i will tell you
Thank you alot for the help π
@jade glacier thanks
I would start with a working tutorial before trying to figure anything out
How to give thanks point or so ahaha
Or deconstruct one of the built in sample scenes
@jade glacier soo i fixed the issue, and it comes out that i dont need the classic one, but the problem was solved when i put the photonview in child gameobject, because the object i was talking about was made by mother and 2 childs, the mother was the rotating
before it the mother had the photonview script that was just an empty gameobject with the moving script on it
ah, yup
hello guys..
i'm trying to upload an image to the server using unity webrequest...however when i do so i got an error code return with
"Curl error 7: Failed to connect to (website url) port 80: Timed out"
I research a bit and i heard something about firewall blocking..but when i check my firewall it is allowed for unity...anyone got any idea for this error?
this error would only happen sometimes...and if it happen, it will keep happening for a few minutes...
hi does anyone here still use unet?
@native anchor you know about mirror?
i guess you can look up unet tutorials since api is almost same
there should be some mirror tutorials as well
can I use that with the current versions of unity?
yes
im using unet right now and im having trouble synchronizing animations
im just trying to make a pretty basic local multiplayer mobile game
@native anchor maybe if you syncronize the inputs, animations should syncronize pretty well
if you are also run the inputs of other clients
@native anchor search for Mirror's Discord. Guys can help you out better in there. It's in active development, so you can expect some nice support from community + updates.
@gleaming prawn thanks I'll give that a try
With the release of unity 2019.3 is it possible to make multiplayer games using DOTS? tried searching for it but got vague answers. Any answer is appreciated!
[Almost] everything DOTS seems to still be in an Alpha state (buggy, not complete, etc)
So ok for learning/experimenting
Not-ok for developing a game for real... Specially the networking part.
Hey, so I would like to do a Multiplayer game with a dedicated Server, as this is used for the learning effect, not for publishing, I will try to go for a relatively low level networking library (Lidgren).
Now I stand in front of my last setup decision, should I go for a plain C# project as server (maybe possible to import the unity dll and use physics functions for serverside calculations?), a detached unity project to run headless on a server or an integrated project that switches between server / client based on a configuration.
Again as this is for learning effect I'd like to write much of it myself, but I am scared that without unity functions this is to much of a task and even stop me from learning by just being to much of a workload. Anyone to talk to about this or who could give me his opinion about this?
General networking already works in a test build, I am familiar with the basics.
Also I'd appreciate a ping if you answer to this π
What are you trying to learn? Because your post goes "all over the place"
I mean, are you trying to learn how to implement netcode strategies like state transfer, scheduling, compression, etc?
Or more like how to code the gameplay parts for a networked game?
Or are you trying to learn scalability of server components.
Also important to understand what kind of GAME you are aiming at, as the gameplay dictates a lot about the strategies you'll have to use.
Assuming you want to learn how to create a state-transfer-style netcode library from scratch, I'd start reading resources like the Tribes Networking model... And would go for Unity headless instances as server (no need to re-write physics etc). Importing Unity libs on a server is ilegal unless you acquire proper licenses for that with them (not even sure if they let you do it)
And last, if you are trying to create a GAME (even for learning), don't write a library...
The game I am orienting at is dead by daylight
What i want to learn is calculating physics/movement serverside with interpolation, client side predictions and other lag and cheat prevention techniques, basically I know how net code works (dont get me wrong here, I know the bare basics) and I am able to sync a game object to one on another client without a problem but I want to learn further than just the basic yeah he moves and thats it
For your question, learning to program the gameplay parts would be the fitting answer yes
Also I'm not about to write a library, I'm implementing the Lidgren library
Lidgren is just a transport layer, isn'Γt?
so in that case you ARE implementing the netcode library
Ok then I understood you wrong, but yeah then that is part of what I want to do, that has been the best way to learn for me, just doing it. All of that has no time limit so if it takes long that's the way it is
But my question for now is rather "Should I use UnityEngine to implement the server, or use a bare C# project"
I removed the dll option as you said it's not in scope with their ToS
For learning purposes, yes
otherwise you'd have to write your own engine (physics, navigation, etc)
If you were going for predict/rollback determinism (which is what I work with), then you'd have to write your own stuff... But not the direction you are choosing.
Ok thanks for the answer, any patterns I should have a look at / consider before starting when looking at dead by daylight as a base?
Ah yeah you mentioned that one above, I'll take a look at it, thanks
check out the features in Photon Bolt (for reference), the Unity netcode, and the old UNet (and Mirror, its FOS version)
IMHO the state of the art Unity lib for most of these features is still Bolt... So look at how you'd implement stuff like scoping, scheduling, lag compensated raycasts, etc
for these, of course... There's a lot more to netcode than state transfer...:)
Bolt offers self hosting right? Might even switch over to that at first
Yeah, for server auth with a Unity build as the server - Bolt is pretty much you only option on the full stack side of things. You can go with a transport or messaging library like Mirror, but you will have to learn and apply the concepts of how to transfer states and make your simulation net friendly on your own that route - which may or may not be your goal. @plucky bramble
since UNET has been deprecated. what can i use instead? i really dont want to use photon tho
Mirror has very similar API to UNet. Strong community support.
MLAPI seems to have more powerful API. Don't know anyone who uses it.
Forge Networking used to have a lot of problems, still might have, but it used to, too. They went open source at some point, so maybe it has gotten better.
Photon provides some great out of the box solutions, so don't ignore the whole shop for no reason.
hello, I need help with photon. I want that other players can see my particals and dont no why it is not working. And I want that I can demage one, but it dont work too here is my code: https://hastebin.com/ekevevecid.cs
and here is the other code forom the player scirpt https://hastebin.com/dulelatewa.cs
@lofty ferry Photon PUN is well worth it, it's a very reasonable price and works really well; They have some nice tutorials online too, I'd definitely recommend it as a UNET replacement!
(Plus you get 20 CCU for free!)
@nimble eagle thanks and it dose seem like pun is the best bet since unity is always changing their system
Anyone have any practical experience with SpatialOS? Seems like a really solid ECS-oriented system for medium to large game worlds
@lofty ferry Yeah! I was in a similar situation, I first implemented UNET, but I got super frustrated when I realized that if the host leaves the room the entire room closes, and that there was no work-around. I was ambivalent about switching to Photon, but I got it set up in about a week of work, and it was really powerful and well made! It's pricing system scales nicely too π
Consider what networking model you are going for. Peer to peer over relay is not for all games.
in Photon PUN, is there a solid way to do lag reduction? additionally you can also see a simple teleport to coordinates turning into something really wacky for the other player - this game is dependent on being able to see what the other is doing too
specifically how the jump on the local client looks like a weird little jumpy-floaty thing on the other client
Teleports are a tricky aspect that requires special handling with the sync transform. The vanilla transform syncs in PUN I don't think handle them well, but haven't really tried.
lag reduction is a much larger topic, but are you referring to doing extrapolation? Or are you talking about lag compensation, where the server tries to correct for client prediction?
@solid crow
https://docs.google.com/document/d/1moPBIt8cNe-h1uG01pvaOZQvrIjZfSBfDmVa793X6AQ/edit#heading=h.qql6b8eo9tfa There is a beta for a set of PUN2 stuff, part of that is an improved SyncTransform, but its a whole system - not just a component.
whichever one would be less complex in getting the movement and position of a player synced over the network or as close to accurate as it can get i suppose
im like brand new to this and i dont know all the big words oops
They are all complex, because you are dealing with trying to hide the fact that players exist in completely different timeframes
you have to bend time in creative ways to hide that fact. It's the voodoo that is game networking.
What you are describing requires extrapolation. Which involves making a guess about the world around you before it arrives, to push it into your timeframe. It is prone to rubberbanding
which is why most games opt for snapshot interpolation. In that case the player is allowed to live in the future, but reality is tinkered with to work through the paradoxes
that sounds like its not as good for something like player movement
Player movement usually uses prediction... the player moves locally immediately
In a server based environment, the server will just rewind other objects to match the players timeframe to test things like weapon fire.
OR... the game is just designed to be tolerant of the differences in time.
OR.. the clients extrapolate other players, and constantly resimulate as real info arrives.
this sounds like its out of my scope for now
for your first attempt just make whatever. You will run into all the paradoxes, and then discussion about how to work around it will make more sense.
ill give it a shot, i'm just worried about messing up my game into some sort of irreversible state at this point
save your work before starting
I promise its going to be a trainwreck
Networking games is about the hardest thing there is to do in game dev atm, especially with Unity. Your first attempt is going to try to make all kinds of shortcuts work, and you will end up with a huge pile of out sync race conditions
and you will code it into knots trying to make things just work
You have to try though, to understand the problem before doing it for real.
is this something where i can at least keep my launcher? i'm using the tutorial you sent
as in like keep the photon pun stuff i have already
You are using the SNS stuff?
The PUN launcher stuff will still be valid either way yeah, thats just setting up the connections
i'm going to look into it before i start but yeah
just want to be 100% certain before i do anything
Fork your project and give yourself a month to just make a mess and refactor a bunch of times
You have a near 0% chance of your first attempt being anything but hot garbage. You just have to be ok with that.
i'll give it a shot i suppose
i dont know if i have a whole month for this but if its what i have to do ill try
Then you really should rethink doing networking as a game project. Most people who fall into the networking hole end up there for years.
fair
Not usually ideal for networking. Adding multiplayer after the fact is brutal work
oh im just a kid learning to make games haha
thats the idea yeah
im sure there are tons of like seasoned veterans at it on here, so i apologize if im like oblivious to anything here haha
We all started in that exact spot
I would recommend as a starting game to try to make Pong, passing control of a ball between two players highlights a lot of the difficulty in networking, in a very easy to digest problem.
Can Photon Network get hacked since it's client side?
You mean PUN?
on Mono builds should be easy... IL2CPP also possible, yes, but not so easy.
Photon Bolt is server-authoritative, and Photon Quantum is deterministic, so these are a lot more hack-resistant by definition.
I'm using Photon Server, while using PunRPCs to transfer information. Can the game still get hacked? I haven't wrote any network code for the photon server, I just downloaded it and connected to the server with the client.
Is it still the same or different?
it's the same...
IF you want to have full control, don't use RPCs... Fallback to RaiseEvents, and write server logic with server plugins
But this would be a lot of work (but you can go very very far with it)
This is the approach used by some top grossing games like Golf Clash (full server authority, not hackable) - photon server plugin implementing logic + raise-event messages from the clients.
Where you will have a hard choice to make is if you are relying on clients for physics and simulation. Trying to replicate physics and such on the server will become more work than its worth, and at that point you should consider Bolt or Quantum. @weak plinth So the first question is really what does your game simulation consist of, and what kind of network architecture are you ultimately needing to make that game type work.
IL2CPP is quite trivial too with very basic CheatEngine usage.
You can make it less trivial with memory scrambling plugins
Its more to do with the server being out of their control, and it being able to enforce some level of control over what players claim.
In a pure client authority environment, a player can literally send a packet that says "I just shot you all in the head"
In a server auth environment, the user's cheats become limited to valid inputs. They can do things like use shader based aimbots and such, but that still has to translate into valid user inputs.
PUN2 without any server plugins is full client authority, so its not a great candidate for competitive real time shooters and such. It is viable though for coop or casual competitive stuff.
I am saving whole scene state into a byte[]
And i can load the scene the same way
But i have some weird stuff going on, i don't think i am able serialize or load a scene completely.
I stuff that changes for example: positions, velocities, ang velocities etc. etc.
But when a collision happens, it gets weird.
My system on host:
initials;
-host only has one scene and uses that for both prediction and reliable
sim by switching states
-host has a reliableState stored in byte[].
-localInputs: host's local inputs
-reliableInputs: recieved inputs from everybody
-host's scene is always in future with a varying offset to realiableState
when it's displayed on the screen
everytime a tick occurs;
-host reverts its scene back to reliableState LINE A
-host simulates its the scene with reliable inputs of next tick
-host saves the scene back into reliableState
-host adds it's local inputs LINE B
every frame;
-host simulates it's scene until realtime (future)
-simulated frame count is higher just after a tick happened otherwise just 1
.
What i did was to disable the LINE A
And i still saw that a collision happened
A collision that reliableState and reliableInputs have no way of knowing about
.
I saved all the frames occured in "everytime a tick occurs" part
And i replayed it
I saw a collision without the object that caused the collision
.
[question]
What do you think i am doing wrong when serializing or loading the scene with bytestream states?
Does destroying an object don't immidently destroy it's instance in physics scene?
I think it's clear that at LINE B, information is leaked from last prediction state into the reliableState.
Oh wait, i think i got it.
I had to use DestroyImmediate instead
That seems to instantly destroy the physics instance
That's a lot of text. Lost me a bit at host loves on the future. Host typically is there final word on the present. So your model is already too far from the norm for me to comment.
host is not in future when it's sending the state
it sends the state and jumps back to future
It's fine, i fixed it.
It was about information leak when switching between states
A destroyed objects information leaked to the next state i was loading and caused a collision.
Because i didn't call DestroyImmediate
ah
Hey, any good networking library for c#?
I already Trier lidgren but i dont Like it
I always get failed to get server instance, but the server works after restarting the server. But how do I fix this?
if you are just looking for a transport, LiteNetLib is C#. @ripe stratus
Tried that too, didnt worked @jade glacier
The transport didn't work? Not sure how that's possible.
Hi! i have a server and a client. And I can connect to my own server in the same computer. Now, I was trying to connect from another computer, but it gets disconnected (I can see the incomming connection). In the linked script he jumps into the line 75, what can it be? https://pastebin.com/ZZkzunzw
@weak plinth do port forwarding
@fair cosmos What do you mean? Sorry, I started recently with a few tutorials
You'll need to research Port Forwarding. It's something you do to your router... not something you do in Unity.
Assuming that is the issue and you are trying to connect from outside of the local area network to your server.
"another computer" is not descriptive enough for networking talk. You need to indicate how that other computer is connected.
Its in the same network (I have the computer at my side)
I found the problem, it is that the UdpClient.BeginReceive callback wont trigger from another computer but it will in the same (tcp works even from another)
Now I need to find why
Sounds like a firewall issue if TCP works and UDP doesn't
Potentially Windows firewall
I think I allowed it when it asked
Can always go check, or explicitly add it again, or make a custom rule for UDP, etc
I just disabled it, but same thing
I'm looking at something
UDP is fundamentally different than TCP and lower level socket read/writing calls can have different semantics
You're using NetworkStream for both types
Sorry, misread. You're calling methods on the Packet type in the UDP class.
Maybe this helps. I have an start method and here I setup the udpListener and start receiving with a callback. This callback only triggers if host - client are in the same computer, if I use another one only will trigger the tcpListener callback https://pastebin.com/3KpPHm1P
Helps yeah. What port are you using, btw?
So, couple things. In your server's handle receive callback, you're restarting the listener. Which makes sense for treating it as connection-oriented. But you're not using a Connect call on the client side. I suspect you are running into an issue that happens when binding to IPADDR_ANY, which is 0.0.0.0, and using unsteered UDP packets
There's like 5 different stacks and systems involved here, but I think all you have to do is use the .Connect in the client
There's a strong chance it can work on localhost connections but not remote
Which matches your problem
local->local works a bit different than local->remote and remote->local
@prisma girder Thank you! Ill take a look as soon as I can
np, hope it helps
A question about networked physics:
When a collision happens, it looks like unity buffers that information and invokes OnCollisionEnter for next physics update.
When i switch states, that information becomes irrevelant.
Can i serialize this information?
How do you handle such things?
There is no test for collisions in real time. After all FixedUpdates run, physX simulates, and that produces the collision events.
you can do overlap checks immediately if you need to
it's extra cost for each check
they are queries like raycasts etc
I think i'll switch to dots, i heard i can serialize a physics scene without missing stuff like unapplied addforces
Looks like i can force-apply them before executing the next update
I'd just finalize the frame (have all the addforces and collision calls done with) and then i could serialize without missing anything
It doesn't look like i have that kind of control with default physics
Now you know why we had to develop our own as well...:)
anyone had tested zapnet ? seems very very close to bolt (entities,states.. even has AssignControl(player))
but author claims it can hold 300 players so.. maybe not just clone of bolt https://forum.unity.com/threads/zapnet-game-networking-framework-for-programmers.824946/
Author claims they AIM TO support up to 300...
" with an aim to support up to 300 players with our scoping system."
I didn't see any real numbers with a proper Unity-based server build... Not that is not possible, just didn't see it stated (maybe I missed it).
you are right, didn't found any real benchmark just his feelings
if it can, it's awesome
but normally this comes at a cost... in a unity build for the server, serializing packets to 300 clients is a serious task (depends a lot on how efficiently you can traverse the entity graph, detect delta changes, packet and compress, dispatch)
I expect these guys to know what they are doing, but this is not super simple...
Doing this at 10Hz is not super difficult, but doing this at 60Hz is a different story...
It has a lot of implications on how the gameplay code is exposed to the game developer as well. I mean: if you expect the game loop to happen from a single unity main thread, and applying changes to regular MonoBehaviors, etc...
It's interesting that a few new libs are coming out trying to do what Bolt does (or better, since 2015)
@graceful zephyr new goal is to support 20k connections/players + 200k NPCs from a single server running 30Hz updates, so you get the point...:)
its just weird how much it takes from bolt even have setScope, so i guess its just flattering to the bolt terms
Β―_(γ)_/Β―
also i know bolt can run 100 players, I've seen it in the forest 128 players mod with stacked up server, donnu how much Hz thought
forest ran at 20hz AFAIK, and its not possible to change via config
its baked into the asset resource
its not that option from settings ?
yes but not when game is built π
or you guys removed it
forest has a custom bolt version i modified
in what way it made it different then the normal bolt ?
dont know if i can say technically
@weak plinth There's a lot of these various mid-range type libraries popping up, saw at least 2 others vs the one above. My take is this... they're aiming way to high and they tend to trivialise the problems that they will run into. Saying things like "300 players", etc.
Also if you're aiming that high you will need your own custom socket library, and most of them use Lidgren (not very good) or LiteNetLib (good, but not feasible for a 300 player scenario imho)
Most cases its a lib built by 1-2 guys, they have never shipped a multiplayer game, etc.
btw you don't mean the world grid in the forest is that something special for bolt right ?
dont remember details, its like 6 years since i worked on the forest
k i'll compare the two dlls and see for myself
same versions
Β―_(γ)_/Β―
i have archive of bolts versions somewhere
btw 50 players in one place, crazy achievement π
The Forest is full of survivors. Lets see how Megan holds up!
β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬β¬
COST FREE DONATION ON MOBILE β₯ https://rechaaarge.com/maddvladd
MADD Army Merch β₯ https://akquire.ca/maddvladd/ %5 PROMO CODE : Vladd
PATREON PLEDGE β₯ https://www.patreon.com/user?...
My personal take (might be wrong here @graceful zephyr ): 50-100 player range with Bolt is possible. Higher part might mean you need to relax on update rate, of course. That's the trade of for the GameObject/MonoBehavior/Single-threaded architecture it uses...
Going after anything higher than that is not trivial, as discussed.
This makes it pretty clear what he is trying to do - for better or worse.
That is DoA...:=)
Its listed on the store as $30 to buy right now. Which is like about double what I am charging for just my Transform/Animator sync components.... so the support to $$ ratio is going to be painful, unless he is just writing the most immaculate and self-explanatory code ever. @gleaming prawn
Which I have never seen be the case with networking. Even the best code is going to require a LOT of documentation, forum support and generally just being available to help.
That's what I mean
He's going to learn it the hard way
I can't tell looking at his code how he is handling timing. Seems like he is trying to recreated Bolt, in which case it should be all ring buffers and fixed ticks. Which means this does stand out as being one of the few complete networking stacks available.... but not enough info to tell atm (or I have not looked hard enough)
He makes references to Mirror and such, which indicates he is trying to throw into that ring, which suggests he's just making another messaging layer.
All verbiage relating to syncing and timing is just super vague "Automatically syncs" stuff
My gut says that he is just making another MLAPI-like library, and the rewinding he is talking about is all RTT based... but again... can only guess from what I see.
@jade glacier very accurate
Which part? @weak plinth I actually can't tell anything for sure so I'm speculating like mad. π
Which is why I suspect he isn't doing a lot of hard interactions with the simulation.. that would be something he would want to mention.
Did you read or see anything relating to how he is dealing with state sync /input sync and controlling the simulation?
all of it, specially recreate bolt part, he admitted in chat he ex-bolt user and uses the exact terminology (entities, states, event, commands, freeze, setscope... etc) but uses lidgren instead of udpkit and relies on its delivery methods
All of the terms can line up, but that doesn't mean he did the really hard parts - which is controlling the whole simulation/player inputs/controllers part of the stack.
that's pretty easy to add later. The place most of this libs faceplant is that they are just messaging layers, so good on him if he is competing the stack.
How he deals with the whole delta and state consistency stuff for each connection is a whole other set of questions... esp when he starts talking huge player numbers like that.
hmm from what he posted in public
seems ticks simulation are in fixedupdate so guess not multithread
I wouldn't expect anything to be multithreaded regarding simulation/serialization
But he is calling Simulate manually in that Fixed, so that does indicate he is going the route of respecting the simulation timing with his networking. If that is in a Singleton I am surprised he isn't producing callbacks prior and post that Physics.Simulate() call.
@kindred surge First one you need to grab pl.NickName, second one needs a player object as first arg
I know nothing about Photon, just looking at your code and a brief glance at their docs. Read your error messages and code carefully
Hi, I'm trying to get started on addressable's and I'm having trouble understanding how it works. I want to have Assets( models, prefabs, etc. ) on a server that I can load at runtime and instantiate as needed in my game. The official unity docs for addressable's v1.6.2 were not clear to me on how I would go about setting up the connection between game and server. I understand Unity does not provide server setup but I'm just not sure how set up a link from game to server at runtime. If anyone has resources or insight on how I can begin solving this would be greatly appreciated.
That's a strange name for networking
This is the networking channel, poking fun at you :P
Animation? Game-design? 2d? 3d? I mean, there's a few options I'd expect will net more fish than Networking ;P
Not that kind of networking.
oh damn xD sorry
Hey Guys, has anyone played with DOTS/NetCode for a RTS? I had a older prototype based on Planetary Annihilations Curves (https://www.forrestthewoods.com/blog/tech_of_planetary_annihilation_chrono_cam/). I'm wondering if I should brush it off and update it, find some other package (not heard of any), wait for unity's rts netcode (no news that I know) or adapt/extend unity's netcode myself somehow
If anyone has any ideas/recommendations that would be awesome π
without a doubt photon quantum for rts
Its not really targeted at hobbyists or people just making a game to see if they can yeah.
yea, i'm definitely in the hobbyist category
and im crazy enough to be willing to custom build something π
Just be aware that getting into that kind of netcoding on your own is about a 2-5 year learning adventure.
yea
that prototype took me ages, to make it actually solid... will be a very long time
but for DOTS compatibility i think its the only way
If you are doing this in dots then you pretty much have to keep an eye on netcode. Most of the higher level options for networking are MB based.
yea, i've already figured out that most of the high level options wont fit
tho that photon quantum would be the closest ive seen
except for the $$$$$
its also not going to like dots all that much. You build with quantum using its math library and simulation mechanisms, and then networking just happens as a result.
It would not work well for a retrofit of an already made SP game.
Though really, almost nothing works well for adding MP after the fact. You typically start with networking to ensure your simulation is fully networking friendly.
its a new game, mostly prototype atm aiming for a small MVP to confirm the core loop/gameplay works
then will build in MP
so ill have to rewrite stuff, but not as much as the game wont be done
my current thought it use unity's netcode for the low level sockets and some smaller high level stuff
but mainly build on the curves based on Planetary Annihilation's networking
Keep us posted on how that evolves. Not a small undertaking for a first networked game.
yup, pretty sure im insane sometimes π
- having a full time job π¦
but about to get a 4 day week π
I wouldn't personally recommend trying to go it alone making an MP RTS just as a hobby, unless you really are ok with never finishing it and will really just enjoy the process.
yea i know
and thats the same advice i would give anyone trying to do this π
Β―_(γ)_/Β―
@kindred surge : OnJoinedRoom should not be a RPC. It's a callback of PUN 2 and it's called on all clients anyways, so you don't need to write network messages regarding joining.
Do the Basics Tutorial from your doc page to get a grip.
Read and code-along: https://doc.photonengine.com/en-us/pun/v2/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!
hello can somebody help me get a functional socket in unity ?
i have already try this like 2 weeks ago some people help me there but coundt get it to work so switched to something else
var socket = new System.Net.Sockets.Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
thats a fully working tcp socket
ok i was unclear in my request functional tcp server/client in unity would be maybe more precise.
if i recon u were the one to help me last time fholm
Β―_(γ)_/Β―
so jsut to put some context i need to send some data from a linux computer to my unity on another machine i suppose sockets would be the easiest way
yes, could print it to paper and scan it on the other computer of course
but that seems cumbersome
cumbersome meaning like its too much for that application ?
Hey, so I'm trying to get a replay plugin working over a small photon room.
The levels themselves are fairly small mainly only vehicles, but I'm told in order to record I would need to first have a scene for gameplay, and a scene for replays.. Is this accurate, also is this the preferred way of doing it
basically I'm being told it's not possible or reasonable to expect photon to be able to handle that kind of data exchange between players
If I'm only recording say a handful of transform, and the rest (static) ignored.. still not possible ?
really just wanting the last 5 seconds of action before player death.
That really is more a function of your simulation buffering, and how friendly it is to being rewound. I wouldn't networking any kind of replay.
https://forum.unity.com/threads/released-ultimate-replay-complete-state-based-replay-system.479977/
anyone familiar with this?
I would not start your travels down the path of networking with an asset dump
I've come across some others but this seems to be optimized enough to work.. but then again I'm not a network guy.. If anyone here is available for this kind of work feel free to dm !
Have you made a MP game yet?
Yep, working within a functioning project already, Implemented some more basic syncing like animations or damage, that kind of thing
I do love a challenge I'm not afraid to work for it, just seems a fairly sparse topic on the forums
That isn't really a game though, most people get basic movement and some weapons firing in a week with just a messaging library. If you want to to proper rewind and replays, you need to circle back around to designing your simulation to be a tick-based buffer system
But possible within PUN2/realtime I'm assuming?
Its separate from any library, your simulation is how you reduce your entire system to a fixed tick that consumes inputs and produces states.
the networking part is just sharing those as needed.
your replay isn't tied to networking, you would use the same input/state history to rewind
replaying over the network would be a brutal waste of internets π
point being, make your game properly for networking, and replay after your game is done will be pretty simple.
I wouldn't start there.
Well the basis is already there
I was just hoping it would be as easy as recording movement in a separate instance and sending the compressed changes to the player haha.. Guess my work is cut out for me
Messaging <-> Input/State Buffer <-> Fixed Time Simulation that is the architecture you want to be building to.
You have buffered states/inputs as numbered ticks and your simulation is abstracted from your messaging already?
Ah no when you mentioned "replay after your game is done"
But if I have to change the foundation for replay instead of using a plugin, seems a bit tedious
Sounds like you are pretty firm on a path you have in mind, so yeah... just go for it and see.
Thanks, appreciate it
Without determinism, at least use sparse full snapshots + inputs in between to interpolate with a loose SIM... Full state based replays are massive
Just love that with quantum nothing is needed. Replays are a given.
Full match and killcams
That your values are corrupt
anyone ever make python scripts talk to unity game?
I got it working using sockets, what form of IPC would you recommend ?
Also im using ironpython so pretty difficult to integrate any python packages/libraries that arenβt already in ironpython so I think Iβm pretty much stuck with sockets which is fine
Hello guys. Is there any chance using addressables with PUN2?
really just depends on how you handle anything asynchronous. I don't see any inherent reason why you wouldn't be able to use them.
Mh, because PUN2 says it needs to have the Prefabs in /Resources/. That's a little confusing.
If you want to use the standard instantiation method, but if you trace that to what its doing, its just using that so it can find resources by the prefab name.
Looking at the spawning code, I think you would have to recreate their Instantiate methods, and replace the string -> prefab lookup with your addressable lookup.
But nothing like that is built in currently that I know of.
Okay. Thank you @jade glacier .