#archived-networking
1 messages ยท Page 56 of 1
It's not off topic at all. I'm trying to tell you that you are trying to do right things in wrong places
player A shoots B through a wall - server says no hit, period
Has no relation to seeing though a wall
player A can spend all the ammo he wants, server isn't going to score that hit
This still has no relation to seeing through a wall
doesn't matter if A has a wall hack to see through the wall
Have you ever played an FPS game?
Being able to allign a headshot at someone that is running around a corner
Makes you have a pretty good advantage
And the server will say ๐ to this
Mostly I play Rpg's but doesn't matter - server decides what you hit
Also, imagine in games like siege, where you can literally shoot through a lot of walls
As far as the server concerns it's legit
at close range you'd have made that hit anyway - not much advantage
Same bad assumption
server's not going to allow a long range shot
Why not?
You are limiting the range of weapons because? To prevent wallhacks?
Or because of the silly assumption "you'd have made that hit anyway"
I think you need to look at some footage of highly competitive FPS games like CSGO or Siege
And estimate how much benefit seeing through a wall would have
(There's plenty of videos showcasing wallhacks in these games)
I'm limiting the raycast distance on the server, sure, to some sane makeable shot distance
Again, trying to solve the right problem at the wrong place
sure, knowing someone is about to peek out from behind a wall would help a bit I get that, but outside 50m that target isn't known to the shooter anyway
help a bit
Being able to insta-kill someone that literally has no change of reacting to you
I wouldn't call that "a bit"
And FPS games with open maps and long-range weapons are a thing
The Halo series has plenty of maps that exceed 50 metres
so where besides the server would you "solve" such a problem?
And try to make some determination on the server side if someone is abusing software
NOT by limiting people with overly convoluted systems
I don't see a raycast that only goes to 50m as convoluted
that's pretty straightforward
I do. Since you are now making a game with a hard-cap of 50m range
Rip to all Battlefield games
50m max, better drive your vehicle close to the other player before you can do something
Sounds like a serious problem to me
oh wait - you ASSUME I'd be making a modern game with modern weapons and vehicles?
Type of game has no relation to this*
closest thing to a vehicle would be a horsedrawn cart
ranged weapon would be a crossbow
If you think you can outsmart widely used solutions like anti-cheat or VAC
so no, I don't see a hit chance beyond 50m as reasonable
With some overly convoluted system that is going to drain a lot of recources. Go ahead
You are too stubborn to listen it seems. And are making far too many assumptions
Maybe some professionals in this channel are willing to weigh in on this
Maybe they can convince you you'll listen to them
Lol
It is possible to do 50 m shots
And baning people for that its just dumb
And there is lucky shots aswell
Are u gonna baan for them aswell?
Ban*
Complex has a point afterall
@weak plinth Go look at some Rainbow Six Siege lucky shot compilations ๐
They are brilliant
I have done like across the map kills in cod
More than 50 m obv
tho i want to find some moddable game
Context?
idk
Development?
Playing?
dev
i mean
i can modd it
Just in general?
well atleast use of photon
as multi
Wait...
You want to MOD an EXISTING game to be multiplayer using photon?
yeah
Uhm.
Probably not going to happen... ever
why caps?
To emphasize
why not?
To make sure that we are talking about the same thing
Why not?
Photon is meant to be used in Unity afaik
In the sense of a framework
A development framework
lol
i already modded a game using photon
And outside of that, single player games are developed to be single player
And not to be multiplayer
That's going to require a lot of hacky duct taping to get that to work
If it's ever going to work semi decently
Look at Skyrim Together
lol
That descibes pretty much what you want
well
i am looking for some light game
cuz my laptop sucks
I'm implying there that skyrim together is a mess
And many things simply cannot be networked
Because the game isn't designed for that
lol
well
it is enough to find exploits
Ask emotitron
He's very well versed in Photon and networking concepts in general
It wouldn't surprise me if he tells you exactly the same
And if I'm wrong, I want to know why ๐ค
so
recap all that again
lol
Afaik, Photon is made to be a multiplayer framework for Unity
Making single player games multiplayer is difficult if not impossible to do well because the games aren't designed for multiplayer
oh
lol
u got me wrong i think
i am looking for games that use photon for multi
does that makes sense?
So games that are already multiplayer
And already use photon?
yeah
exactly
Ah
like vr chat for ex
That's an entirely different story
If this game already has a mod API defined
It's going to probably be smooth sailing
even if it doesnt
its not a problem
so bruv
do u know any game?
Nope, no clue, sorry
rip
THis chat is funny...:)
@weak plinth he's talking about hacking a client authoritative game made with PUN, not modding a game in the classic sense of using provided sripts to create a variation.
@gray pond when I said wallhacks and aimbots I was relating to using information that's alredy on the clients for server-based games, not client authoritative ones
Like:
- if you are close enough to an enemy, the server does give the client the data... then a hacked video card driver can be used to show the enemy silhouete behind a wall
You can NOT shoot through the wall in server based games (or deterministic ones), like you said.
But just seeing already gives you advantage... And aimbotting is just moving the mouse faster to hit better stuff that you already see (so server has no way to protect against these)
This is what I was saying/trying to say
And Gadget is severely underestimating the benefit wall hacking has
wallhacks and aimbots are 100% possible in server authoritative games...
I, as a vidid FPS enthusiast, although annecdotal, can vouch for the massive benefit wallhacks have in FPS games
CS, Fortnite, Apex Legends, these are all server authoritative... Just search a bit to find these "tools" for them...:)
BUt, of course client authoritative games (or semi client authoritative like Battlefield) are easier...:)
Who hacking?
Difficult to find which ones are real for sure (there's a lot of spam )
https://youtu.be/fkuNS_7Y2UM?t=95
But this one is authentic
Tbh cheaters suck cuz they got no skillz so they use cheats
Here's a wonderful combination of wallhack and aimbots
It's only a bit of advantage though lmao (/s)
Cheaters just ruin the game for everyone.
I mean...
https://youtu.be/9sHn-ZJZ61g?t=156
Both not the videos I was trying to find
But it does illustrate that client-side hacks are very well possible
@gleaming prawn Oh, I just now entirely understood what he was saying ๐
2 people having 2 diferent conversarions (:
Client side can do many things xd
And with exploits even server side
Which is cool
Is it possible to make a multiplayer game without going through Unity's infrastructure? I'm curious what it offers over other services.
Yes
Well, for one UNet is deprecated
And quite bad in the first place
And you can use anything to make a multiplayer game you want
You can use pre-existing solutions, like photon
Or implement something yourself
What ever suits your needs
Im new to unity and networking(on unity).
So im searching the best "base" for my game.
Do i understand it correctly that photon can only be hosted on their cloud system ?
Or can i host a server my self on a dedicated server ?
Is photon good or should i use a other one (unet ?)?
Oh as i see in the documentation you can host it your self.
But the documentation/tutorial use the cloud, is there a tutorial for selfhosting ?
oh wait you also have to pay for self hosted server ? wtf
UNet is dead
And in the case of photon, you always use their service
There's a free option as well afaik
Is there a other good networking stuff which is free on self hosting ?
Uhm, good is subjective here
But I don't know all of the options on the top of my head
Your first networked games will pretty much be garbage, so save your dream game for after doing some tutorials and prototypes.
Give yourself a couple months of just making tests and learning projects before even trying to ask which is best.
That will give you a starting point for asking the right questions.
Sure i will not start with my "dream game", but why should i start learning with Software X if this is dead (e.g. unet as Complex said) ?
Hello everyone,
im looking for advices for wrong simulations correction,
im using ECS and ENet to sync the Game between clients and server.
for the moment im sending only inputs from client to server then the server send them back to all clients and they do the simulation again.
this approach is working like a charm on local networks but there's sync problems for players with high latency.
so what im looking for is how can correct wrong simulations on clients knowing that i can predict where the client should be in the present? (from it's input , past position and it's latency )
@dapper night is this only syncing inputs and depending on simulation results being the same everywhere?
@graceful zephyr yes im trying to do the simulation everywhere and correct if something went wrong
@dapper night so you are trying to do prediction/rollback determinism?
exactly and im looking for good approaches to do the rollback determinism
What do you mean by good approaches?
knowing after few frames the server will send the current state + the inputs so the client can predict the real present (in server side simulation) and correct the client side wrong states.
i mean do you guys did that before ? and what are your advices (it's my first experience in game networking )
i saw a lot of GDCs but still not really clear
If you are sending state you don't need determinism
Yea I've implemented this several times and several variations of it
Unity's new networking does this, check their github
for example , how do you correct client side predictions for the local player when the user is actually moving it at the same time?
do you override user inputs or just move the character over the user inputs
im sending states at a very low rate due to it's bandwidth consumption, im sending inputs 30/s and states 3/s
my inputs are just 4bytes
each player and states are 8 bytes/player
Is someone using unity as standalone server build with custom networking?
@weak plinth yes im using unity as my headless server instance with ENet for networking stuff
@dapper night you store the old state of the simulation and reset it? inject the inputs and re-run
dots netcode is where things are moving towards
not sure how useful the public commits are and documentation is pretty much non-existing afaik
I'd hold off on DOTS if you are planning to release a product
yeh they made a nice chart that can push you into the appropriate direction but im having trouble finding it
tada
Yup
If Unet's dead, what's replacing it and is it out already?
What is the best way for a baby nublet such as myself to start learning networking on Unity?
Depends what you want to learn
If you want to just make a game, there's libraries available such as photon that allow you to network your game somewhat easy
You of course still need some knowledge about networking to make it work
I know a tiny bit about networking, but not much.
Once made a basic two-player localhost thing years ago using Unity
There's a big difference between wanting to learn networking or wanting to make a networked game
One of the people here, Emotitron, often recommends spending some months making a simple pong game networked
That sounds like a good idea.
It also spares you from a lot of failure and a sense of futility
more fun to actually have a couple successes
So what tutorial do you recommend?
Is there a RUDP library out there with LAN discovery?
@final depot LiteNetLib
Who was an expert on photon here?
Photon has a bunch of libs, but there are a few guys who work for Exit usually around
So I can use the principles used in the Unity FPS sample in a diablo-like game? ๐ค
Well i was curious to know
Why they changed tcp bytes form like udps one
I don't get the question, sorry @weak plinth
yeah, all networking is byte[]
Yes
But the header and all bytes were different from protocol to protocol
But now they are all the same
Is there some documentation you are referring to for this? Still not sure what that means in this context.
You mean how big the headers are?
Different how?
Example bytes were 1,2,3 etc on udp
And on tcp
They were 2,3,4
The start
Or header
It was always different on both protocols
Dunno sorry, not sure how you are reading those bytes or from where
the photon dll is a big place
Yes kind off
But i checked on enetpeer and tpeer
Which is where all data bytes spread on other places
Like for ex going to protocol
Guys like Erick have more experience with the Photon Server and may know what you are referring to
I'm starting to work on a multiplayer game. Are there any "must read" articles/books for the network communication and design patterns?
@regal forum nah there's not really anything like that sorry
there's a few GDC talks, a few articles spread around, etc.
but that's about it
I'm looking more and more into that Unity FPS sample. It's quite nice
Even that they use basically just UDP
But I wonder, does this fit with a game like Diablo?
@weak plinth it can, but games that want A LOT of perfectly replicated units on screen
usually need to do some bespoke stuff
A lot? ๐ค What do you mean "bespoke stuff" ?
I don't mind adjusting my game to have less entities on screen
I'm perfectly fine with having a cap of, say 16 enemies or something
D3 for example is some weird blend between state sync and determinism AFAIK
yes
I'm not aiming for the bullet-hell like gameplay like Diablo has anyway. Just want to know if state sync is viable for such a product
Good to know! Thanks ๐
I've watched a talk that explains some things about that demo. Was really useful
state sync generally has two sub groups:
- snapshot interpolation
- state extrapolation
and generally has two transfer methods:
- delta snapshots
- eventual consistency
As I understand that demo has 1 and 1
IN GENERAL, there's probably many more variants in the wild
yes
fps sample is snapshot interp with delta snapshots
photon bolt is 1 and 2, snapshot interp with eventual consistency
And they have some determinism in there as well. The guy explained that it was for missing or out of order packets
It serves more for interpolation I think
He sounded like it ๐
Too bad he didn't have time to explain some of the other things
He went over interpolation very briefly
And had no time to address the leading shots thing
you mean lag comp?
I think so. The presentation called it "leading shots"
It has to do with the player having to shoot in front of the player
So when the message arrives at the server, he's shooting where the player is
lag comp is simply setting the state of the game on the server to whatever the client saw when executing the clients fire cmd, so the client doent have to lead the shots to compensate for lag by hand
Yeah, that
Hmm. Strange though that games like Halo 2 and 3 didn't have this
If it's that simple
xbox360 can't do that for a 16 player match
Yeah, I figured
its VERY expensive
What about Reach then? That was a 360 game also
it's expensive enough that not even battlefield V does it for example
because its a 64 player game
it also has issues with animation replication accuracy and such
i much prefer battlefields model
where they have client side hit detection, but the server 'verifies' the hit by doing a plausible/simplified check
gives clients full accuracy locally
but still allows server to verify hits to combat cheaters, etc.
Sounds like a reasonable idea. But I'm sure it also has its drawbacks
https://youtu.be/jn9nFPxTyNg?t=1531
I've always wondered about this
What do you think is going on with the networking of this game?
That other players are jerking about so much
It looks like there's no interpolation at all
@weak plinth PSO is an mmo right?
Yeah
The only thing I know for sure is that it's TCP
impossible to know
Im struggling with server reconciliation, when you send your inputs you have to store them on the client for reconciliation. On the wayback the server has to tell witch inputs had been consumed by returning the last input id so the client can drop every inputs after this point and then use the rest to create the new prediction is this correct ?
Really ? Oh waw
But then how do you create the prediction with the unprocessed inputs ? Do you localy move the player as you would with its movement script and then return the final position ?
Inputs and State results are all stored with the tick/frame ID
And you set up your serialization to and from the server to make it so you can work out which tick was which. There are different ways to handle that. I personally let every machine have its own current tick number and I create an offset to translate that to other connections ticks, or you can make them all conform to the server. Its not simple to do, but its just a math problem.
The client applies its input struct to the previous state, and stores that struct with the frame ID it was applied to.
Then it sends that struct out with a header indicating which tick it was for
the server gets it, and buffers it, and soon after consumes it (when it ticks its sim)
When the server sends that out, it includes the tick number and the state results
The owner client compares the state results with what it had gotten for that tick to determine if it is still in sync. If not, it resimulates from that disagreeing tick (changing its state results to the servers state results)... and resimulates by applying each input struct that ticked after that.
@solar garden
Some of the things I've come across in the Unity FPS Sample look like they have been very hastely implemented to get it working/done ๐ค
๐
Makes it hard for a noobie like me to understand though
which part do you mean?
I'm looking at the local player part.
And the Game.cs and Inputsystem.cs look like a mess
Especially Game.cs
tbh nothing that looks weird there
looks pretty tidy
maybe they could split each type into its own file
but i mean its not a big thing
95% of the file is one class
@jade glacier Ok wow thanks for the detailed answere i'll focus on it for a bit, so this was for the server reconciliation, about the client prediction you have to store the inputs locally until the server returns the input frame id then you delete all inputs from the local list up to this point and then from the last position known you add the inputs to it so you have the next position to lerp to is it correct ?
You want the server to correct?
you can, but you have to ask yourself what you are protecting against at that point
no no the client
ah
the client has to work to be in sync right ?
As a starting point, store all inputs and all states in a buffer
but i struggle with the prediction
and number them, as a ring buffer or however you see fit
prediction itself is easy, you just apply the same inputs locally that you will on the server... using the same simulation code
I personally modify my results on the owner side to quantize to the lossy values being used by the networking
so if you compress your positions, you want to apply the decompressed value locally, so that your owner has the same rounding applied that the server will be coming up with
ahhh but in practice i should do this on a empty transform for to return to the player entity to render right ?
And the other way as well, the server sends out states, and if they are compressed in a lossy way, you will probably want to apply those lossy values after simulation... to keep things as deterministic as possible... but that is getting a little more advanced that what you are on now.
Lost me there
You mean when you actually resimulate?
i mean like in unity how would you do this local thing where you predict the movements with the movement script and stored inputs, i guess i shouldn't do it on the player it self because it will be jittery i saw videos where there would be "two players" one would be invisible and process the finale position and the "render player" is the one who is lerped the other ones target porsition
idk if it was only for show or something you has to do
There are two are three worlds in play here
there is the states... which are the actual tick results
server*
there is the scene, which is the mostly cosmetic view of those states being interpolated for smoothness
and there may be a 3rd, which is your ghost world for resims and such if you want to do your scratch work for resims without playing around with your main physics scene
The state buffer contain the actual history of stuff in tick form. The Scene is always interpolating/extrapolating from that.
And resmins is the going back into your history and changing things
you mean like actuall additive scenes ??
Nope
oh
The scene is messy in Unity
because its a merger of states and interpolation
PhysX is an example of that... like in Update() if you get the position of a rigidbody with rb.position and rb.transform.position .... they will be different
rb.position is the LAST tick result (the state)
rb.transform.position is the current transform state in the scene... which is framerate dependent interpolation/extrapolation (depending on your settings) of the previous PhysX states
Your states are more like rb.position
What you see in the scene is more like rb.transform.position
Not sure what you mean here but thank you for all the info i'll focus on it !
Hey, I'm looking for a solution to import prefabs at runtime. Basically instead of having all content in my app, I want to have the prefabs hosted on my server, and import them when the user wants the prefab, then giving the user the option to also remove prefab again from their phone. This is to save space, as we'll have a ton of prefabs that would greatly enlarge the app size. Just importing an obj or fbx isn't an option because we need to keep the components with their settings intact. Is there any solution for this?
Bundles and Resources
more bundles for prefabs
With the AssetBundle system, you can store multiple files in an archival format that Unity can index and serialize. So using Assetbundles brings benefits suc...
Thanks!
hello dani everybody i need some help
i have built my game on the singleplayer mode
and when i tried to make it multiplayer
i face some issues
in some scripts i need some components and objects in the player-object
and when i delete it from the scene to make it multiplayer
it says missing objects and nothing works
does anyone know how to solve that?
Oh, the FPS sample uses ACTUAL ECS ๐ฆ
@weak plinth it uses hybrid yes
That makes it a tad bit more complicated for me to understand ๐
ยฏ_(ใ)_/ยฏ
@random drift Don't delete your controllers from player objects, you just want to make them conditional based on if the local connection has authority/ownership
Not entirely sure what you are deleting, but that sounds a bit extreme
@jade glacier
i delete that object the character
and when i do that these vars be missing
those should be pointing at assets, not scene objects I suspect
and i do that so the player spawns
No idea what Respawning players is doing, but when you start you will have no player object in the scene and one will be spawned.
in OnStartLocalPlayer on that object you will want to add it to your list
Have you done any unet or mirror tutorials?
uNet
i used that tutorial
We start adding multiplayer functionality by setting up a NetworkManager and spawning the player on the network. โ Download cool Weapons: http://devassets.co...
And you got it working?
it works but i have some issue with vars
it worked well on a project has a character only
My guess is the problem you currently are having is you are referecing your scene object in that list of items
rather than the prefab in assets
i think u r right
but still there another issue when i use prefab in asset
i cant play sounds it says
Can not play a disabled audio source
UnityEngine.AudioSource:Play()
thanks! anyway @jade glacier
I can't seem to find where the UserCommand is applied locally
@weak plinth in fps sample?
Yeah
@weak plinth should not be hard to figure out? Just find references on user cmd
Any one has info/news about: https://coherence.io/ ??
.SetComponentData<UserCommandComponentData>(m_LocalPlayer.controlledEntity, userCommand);```
Here was my guess
But I don't know the implementation details of SetComponentData
Definitely interesting
What is "Modules" in the FPSSample?
Some big claims on a small page there. Curious to see the actual software.
@karmic void I know the guys behind it
Nice guys, know what they are doing
But no details yet afaik
@weak plinth it sets the component to the value passed in as 2nd param
Does that also update the game sim? Like the transform?
I'm going to try and do this with a whole less ECS.
I think I'm beginning to understand the inputs to the state and rollback though ๐ค
@graceful zephyr The solution will be only for ECS in coherence? Hope no :-(
@karmic void I don't know their stance on ecs/not-ecs stuff
I think I'm beginning to understand the inputs to the state and rollback though
I lied
This ECS is making it so much harder for me to understand
Also the idea that 1 map/scene = 1 server in that example. At least, I think it is
@jade glacier So uhm...
My project is kindof messy atm. And I'm not sure if anything about the current tick system is correct
But that aside....
I'm checking for player inputs at every frame, buffering them, and applying them immediately (this is for single player/the server player)
Am I heading the correct way here?
I have 1 "central" object in the scene that updates the GameManager (where I guess eventually a lot of the systems will be, for now there's only the NetworkManager)
Applying them on the next tick is normal for this yeah
if that is what you mean by immediately
not like in Update() immediately... that is too immediate
@weak plinth
Uhm, I do like... really immediate now ๐
yeah,that is not a simulation then really
Why would I need to wait a tick?
You need to apply inputs to your simulation
and your simulation runs at a fixed tick
You are collecting inputs in Update() I assume, which is totally frame dependent
I've took some inspiration from the FPS sample (let's call it inspiration...) for the timings
If you control your simulation firing (not using FixedUpdate) - you can collect inputs and then run the sim if your tick engine says a tick is due
So I don't currently know exactly what's going on
Not sure how they simulate, if its based on the fixed, or if they call Simulate themselves
I saw somewhere that they call their own Update based on... something
I can't find it atm
// This is called at the actual client frame rate, so may be faster or slower than tickrate.
It says this in the source
At the Update
But they do some shenanigans with ticks
That again, I don't fully understand yet
They likely are running their own fixed tick timer or something, and fire simulate manually
I haven't looked at FPS, so I can't speak to it
They have a lot of ECS stuff in there, which I completely fail to understand
They might apply the mouselook immediately in Update() just for smoothness and quick feel
So I'm doing my best to interprete it for my use case
But still actually sample it later on the tick for the simulation
The scene as you see it is NOT the simulation
Uh... ok
that is the interpolation/extrapolation that is totally update rate based
PhysX is a simulation
as was saying to someone else earlier, if you check rb.postion and rb.transform.position in Update... they will not match
Don't I apply stuff to the scene, and pull the states from there after the tick?
States typically are all virtual
like physX knows what the last tick results were, and applies inputs to that and produces a new tick, the results of which you don't actually see directly in the scene (unless you turn off interpolation)
Let's forget physX for a minute to keep it a little easier ๐
PhysX knows the last two "states" of the physics sim, and what you see translated in the scene are those results interpolated or extrapolated
I am using physX because it does what you need to do
The state and input buffers are virtual ticks... totally abstracted from the frame updates
But how does one do this in Unity?
By only using your states in your simulation
Rendering stuff to the scene (moving your objects in Update) you do by interpolating or extrapolating the resulting states
How do you do this locally?
Everything?
I thought you said input + sim = new state
State[1] player is at 0,0,0 + Input W = State[2] player is at 0,0,1
if state one fired at .02 seconds and state two fired at .04 seconds... and it is now Time.time = .05 ......
player will RENDER at 0,0, 0.5f
The player in the scene likely will never be at 0,0,0 or 0,0,1
Those are the states from the simulation
Time.fixedTime vs Time.time
I'm not sure how much time you have spent doing like the normal Unity stuff, but a healthy understanding of how FixedUpdate() fires is pretty critical to getting this stuff right
OR... not using it at all and running your own simulation timer
But to do that, you have to understand fixed time, because you will be rewriting it yourself
I think I have to reread this tomorrow with a fresh mind
I've been at it for like 12 hours today ๐
definitely don't try this stuff tired
As always, thanks for the info ๐
hopefully it eventually helps LOL
public void FixedUpdate()
{
if (Command.MoveMagnitude > 0)
{
Vector2 direction = Quaternion.Euler(0, 0, Command.MoveYaw) * Vector2.up;
//TODO Move Rigidbody!
Vector2 n = direction * Command.MoveMagnitude * Time.fixedDeltaTime;
transform.position += new Vector3(-n.x, n.y, 0);
//MyRigidBody.AddRelativeForce(direction * Command.MoveMagnitude * Time.fixedDeltaTime);
Debug.Log(direction);
}
}
How bad is this ? ๐
(At least I have my Palm-Tree player substitute moving via buffered inputs ๐ )
I'm guessing I should probably update this in some interval that comes from the network/game manager ๐ค
That technically counts as simulation looking at it
The main thing there is to not scatter code like that all over the place.
If you want it to exist in methods in components on and gameobjects rather than some master Simulation class, just be sure that you are able to call all of the methods in a pretty deterministic manner.
So when you get to resim, you can pretty much fire all of it off in a single call
scattered code in FixedUpdate is less than ideal for that - since you can't easily call a master FixedUdpate() call yourself that then calls all of them.
Which is were moving to an updatemanager really starts to make sense
Yeah, I'm planning to call a self-made update function from the network manager probably
And include the "frameduration" is what the FPS sample uses
That's their "deltatime"
I thought about this yesterday, no idea why I didn't think of it at the time
You shouldn't look at that FPS sample @weak plinth there is way to much things to understand with the Client/Server architecture in it self, the sample was made when Unet was dead adding to that the complexity of trying to learn a foreign project that you never had any involvement in.. this is just not worth the time
What are you talking about? The last commit was from 14th of march
So ?
So what's even the relation to UNet
It's a well working networked project with interpolation and snapshot delta compression
I mean they are not using Unet but the new implementation
Yes, and thank fuck for that
Yeah idk what is new tho
The networking API is a very basic layer on UDP
I don't know what your objections to FPS Sample project are
But as far as I'm considered, and heard from people who have knowledge in this field
It's a good, working product that suits perfectly for getting to understand the type of networking implemented
I said that it is hard enough to understand all the components of the Client/Server architecture in it self adding to that trying to understand a project that you have never had any involvement in might me even more harder to be worth the time
If you have a better source, feel welcome to mention it
i mean if you are happy with it good for you i didn't know you would be so defencive about it
basically the whole google and this https://github.com/MFatihMAR/Awesome-Game-Networking
This project is already a very small one. It's basically a vertical slice of a client-server networked FPS game
Ok ok whatever
@weak plinth @solar garden the fps sample is probably the best example a fully implemented client-server model with all the bells and whistles you're gonna find open in source code.
It's big? yes. Is it as big as real game? no even close.
It's in C#, so no need to try to go through C++/C code ur not familiar with (if you dont know those langs ofc)
The FPS sample is great, it really is.
Has anyone tried playing the actual game? I can't run it on this laptop, but curious how it actually feels
feels pretty good
Nope
I wonder why they haven't chosen to take it all the way to F2P then and go the Unreal Engine route
@jade glacier because its still just 5% of a full game
they did 95% of the work
That last 5% can usually be 90% of the time spent though
I haven't seen its current state, so I have no concept of whats missing
The FPS Sample?
yeah
Nothing is "missing". It's a fully playable game
It's just very limited
It's pretty much 1 map, 2 characters
its a mess
2 weapons I think
Adding weapons and player characters isn't super hard, but the game design sounds very Quake Arenaish, without any of the new BR qualities people are hot on.
Going from QAish to OWish is a major amount of work
If you'd want to expend a game like this, you'd be looking at adding more maps, characters, weapons, unique game mechanics
@solar garden if you think they did 95% of the work of turning that into a fully finished game, you've never actually finished a game with a proper studio/team
I've seen million dolars AAA's that were less pollished than that
at best they did 50% of the gameplay code
once you have the networking in place its just a matter of coding your gameplay
lol
so naive
first of all, the networking is not even close to 90%
of a game
anyway, im gonna watch strangeparts and chill
im saying its easier when you have made your netowrking with the tools needed after this its just like making a solo game with some caution on what you network and what you don't
yeah do that
just... one thing
im saying its easier when you have made your netowrking with the tools needed after this its just like making a solo game with some caution on what you network and what you don't
How do you know this? Have you actually made and finished a networked game? Because the questions you've been asking here the past week or so seems to imply you have very little knowledge about networking
i didn't i am making one
im not claming anything i have made games before i know what is hard and whats not from my point of view
That's fine, learning is great, but then please don't speak with such certainty about things you've not done.
The networking is maybe like 5% of a game
code-base wise
i'll be sure to add the little "in my humble opinion" next time sorry
It's crazy this contrast between the networking community and the solo community
Networking is the wild west of Unity
Yeah you won't tell me that twice, only few will actually help you the rest is peoples being either full of themselves or very defensive on anything
i don't get that
What did you get your feelings hurts because I told you that you are wrong? lol
i started a few months ago and in that time period i have been told "just learn to code" or "a solo game would suit you better"
No man
I wouldnt attempt networking with unity without a game or two under your belt without networking for sure.
Never heard anyone say that, but network stuff isn't just doing a hello world of unity.
i just advised to Complex to learn networking outside the FPS sample because it is a bit comfusing and he got defensive
the fps sample is not confusing, it's a fully working 'game'. That's how they look.
There's tons of little domain specific fuckery all over the place
i told that for a networking game the network is 95% of the game and you straight up told me that i was naive dude
Yes you are
If you think its 95% of a game
It's not even 5% of a finished 'full' game
just load CSS and just spot what is not networking
huh?
you mean start CS:S as a game?
you can just look at the source code, it's HUGE, the actual networking part is probably something like 2-3% of the code base
i mean load CS:S and spot what is not networking based
I wouldn't deep dive into FPS sample as entry point of learning how to do networking in games. But I think it's a good source if you want to learn low level stuff of how to do things: )
@solar garden dude you have no idea what you are talking about, really
It's also weird to talk about how many % of a game is what and whatnot? Also depends if you're building the network engine from scratch by yourself, what your polish standards are etc x)
Idk, i have taken CS:S as an example because its the closest of what the FPS sample is and its basically just networking logic with movement script, game logic and shooting logic
@solar garden fholm is one of the people in this channel, together with Erick and Emotitron that helped me getting into networking
Me too man im not trying to step on your Net familly bro
you speak like i said that everyone i a fraud ๐
We all a big net family ๐ช โค
im just arguing that networking in a multiplayer is not only the half of the game
then im the cousin that no one likes at the dinner party ๐
Dunno about any of this. I just answers questions as best I can with best practices. There are groups that have different philosophies. Like the Mirror channel is far less concerned with good practices, and focus more on "just getting something working" - but any of the hardcore net guys are going to indicate just how hard doing this stuff correctly is... to not lead anyone down a bad path.
Always ๐
lmao ๐
Though they have a place in the convo
because some people ARE just looking for that first layer of just syncing some stuff and being happy there
Who don't want to hear all of this talk about simulations and determinism and such
@solar garden you can take my word for it or you can not, i really don't care, I argued way more than I should've about this, fuck it.
gee ok...
These channels are frustrating, because on one hand you want to help
on the other hand... you are fighting against a tide of people giving very bad advice, or refusing to take good advice
guys like fholm don't gain anything from participating here, his products sell to large studios - not to entry level devs. So I get the frustration of trying to help here.
I understand that but i never bash peoples of how bad they are
He could have told me this too :/
I have no idea what the debate here even is actually... I just look in now and then and see something other than best practices being discussed... oh well
"Hey i dont want to be all pretencious here but i have worked in companies, i know what networking is and what you are saying is wrong"
there
no biggy
Is it bashed though? This is a programming channel... programmers are not trying to win elections. He was just straight up saying you were wrong, because he knows what is right in this area.
not "YOU KNOW NOTHING SCRUB" kind of speach
I get that from him when I say something dumb as well, and I give it to others.
If someone in programming says something wrong, they will hear about it fast.
@solar garden you realize how annoyed people would be if i prefaced everything with "UH DUDE I ACTUALLY BUILD TECH FOR BIG STUDIOS"
lol
idk seams legit to me :/
but anyway if 2 pros are telling me im wrong then its safe to say that i should be wrong ๐
Im sorry @graceful zephyr
no worries, you dont need to apologise for not agreeing with me lol
Its more for the whole commotion thing lol
@jade glacier Most of the code from the FPS sample originates from a Game.cs Update function (monobehaviour)
How does this work with physics? Since everywhere online suggests using FixedUpdate
frameTime = (double)m_Clock.ElapsedTicks / m_StopwatchFrequency; It uses this as a "frameTime" calculated every Update call ๐ค
m_Clock is just a Stopwatch
float frameDuration = m_lastFrameTime != 0 ? (float)(Game.frameTime - m_lastFrameTime) : 0;
Using this as a deltatime ๐ค
At a glance, that would be the fixed tick
That stuff might just be to make a double buffered Delta or something
I really know squat about fps sample
I really know squat about fps sample
That goes for both of us ๐
@weak plinth what file is your second snippet from?
You mean what class or?
'float frameDuration = m_lastFrameTime != 0 ? (float)(Game.frameTime - m_lastFrameTime) : 0;'
They are both from the FPSSample
yeah, but what script file
frameTime = (double)m_Clock.ElapsedTicks / m_StopwatchFrequency; <- delta time in seconds (as a double)
float frameDuration = m_lastFrameTime != 0 ? (float)(Game.frameTime - m_lastFrameTime) : 0; <- how long the last frame took to execute, i.e. the simulation speed
ClientGameLoop or ThinClientGameLoop
@graceful zephyr Why do they do it like this?
Instead of using Time.Delta?
๐ค So I should use these timings for all networked objects?
we do the same in quantum
not exact same, but similar
with stopwatches, etc.
manual time, not relying on unitys delta
I mean, it would be preferable if I didn't have to make the entire game ECS-like
They also use a statemachine for the game state. It's pretty simple but ingenious ๐ค
Are there any strong pros for using the high precision timers compared to unity deltas? Only thing I remember was that they talked about about targetFramerate drifting, hence why they used the high precision timer to nudge it back and forth.
...is it possible to retrofit online play into a game? I didn't originally envision online play in my game, but now I'm considering it.
@graceful zephyr Can you elaborate?
...yes. I can tell that's what you meant. But why?
because you built a game for singleplayer
and now want it to be multiplayer
a lot of stuff is not going to work properly in MP, with lag, jitter, other clients, etc
so a lot of re-writing is needed usually
Got any reading I can refer to?
Make some small test mp tutorials and such before even thinking about doing anything for real.
If you value your time and happiness
Making a game from scratch with multiplayer in mind is difficult enough
I wouldn't task my worst enemy having to sift through an existing codebase making these things multiplayer
Considering all this tickrate, interpolation,prediction,rollback stuff
Hm...what if I can take advantage of my game's particular mechanics?
Advantage?
For example, I have a match-3 puzzle game. Both players have their own grid; the player do not directly interact as they would in a fighting game. When a player does certain things, the other player's grid will be filled with hazards or otherwise changed. But not immediately; whenever it's convenient for these state changes to apply
(For a game-specific notion of "whenever it's convenient")
It's not slow-paced but the players each have their own "stages" that don't directly interact
Tbh, you can slap some TCP variant on there and just sync everything
It's this https://jessetg.itch.io/chromavaders
It's not efficient at all, but it gets the job done as easily as possible for your case
Jesus that volume
Sorry. It's on my to-do list
Yes, they see each other.
Oh.. Well seeing your game
That makes things more dificult
I don't know... I'm by no means an expert
I'm figuring out how to do it from scratch.
Thank you anyway.
Ok, I think I have player/camera movement done correctly locally....
@jade glacier http://www.codersblock.org/blog/client-side-prediction-in-unity-2018
This might be a nice source for me. But why does this use Physics.Simulate?
Or better... Why does FPS sample not use Physics.Simulate?
Depends if PhysX is part of your simulation
calling Physics.Simulate() yourself makes it very easy to create a PostPhysX callback, which is missing from Unity
Without it you have to make your own that fires sometimes in Update, when the time is already off the tick.
@weak plinth
PostPhysX would be the place you would capture the physics results as a state. With future DOTS that will be a bit easier, as I think you will be able to just store the stateless results from the physics sims.
@jade glacier I use it only to detect collisions; my game does not actually have physical behavior.
The 2D physics engine is still PhysX, right?
@JesseTG#4752 no, that's always been Box2D
Do I need to call it as well without PhysX?
I think in the FPS sample they use collision systems etc in ECS for this
@weak plinth fps sample uses physx
hello everyone,
i would like to test my networking code so i ported my headless instance to the server (Ubuntu 19.10),
im trying to connect but the client cant reach the server at the specified Port (9000) by calling the command "sudo lsof -i -P -n | grep LISTEN" the specified port do not appear within the list, but by calling this one "sudo lsof -i:9000" i get this:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
ServerBui 24342 root 6u IPv6 7764598 0t0 UDP localhost:9000
which seems for me that the headless instance is listening.
(i'm not really comfortable with linux stuff)
did anyone had this issue before ?
Isn't the headless instance in this case bound to the localhost loopback interface @dapper night ?
I think you need to force it to bind to the local valid IP address itself (it depends on how Unity does these socket bindings)
i just fixed it, the problem was the server il listening to 127.0.0.1
yep that was problem ๐
Cool
thanks anyway !!
sorry i didn't get what you mean ?
ServerBui 24342 root 6u IPv6 7764598 0t0 UDP localhost:9000
You are running the headless process as root (user ID)... This is super dangerous. If there are vulnerabilities on your server binary/unity, people can get root access to this machine by exploting them remotely
Then havoc.... your VM is compromised, etc...
It's a general rule, don't run these things as root, sandbox them as much as possible (also with these sandbox deployment methods, etc)
I hate this, glad we have another team dealing with these details...:)
lol
XD thanks you very much i didnt know that !!
for the moment im using the VM just for testing our Headless instances are running in containers within Kubernutes VMs
yep, try to search for resources on that topic. Not expert on that, but IMHO it's worth doing some homework on it.
ill Thank you very much!
@graceful zephyr @jade glacier
https://support.unity3d.com/hc/en-us/articles/360015178512-Determinism-with-2D-Physics
So, what now...?
You are trying to be deterministic?
Then use a diff physics engine ๐
Or don't go for full determinism
The fps sample is deterministic as well though
There's Physics2D Simulate. Perhaps I need to use that...
Or wait for Havok
There's no waiting (espacially waiting for anything Unity...) when you're making a product
is it a personnal project or is it commercial ?
If you mean by commercial that me or anyone working on the product has any commercial background, no
And if personal means, Some hobby project that will probably be shelved, neither
I didn't assumed anything
I didn't say you assumed. I answered your question. maybe
(Notice the if in my answers)
trying to be deterministic with physics is way to painfull anyway
there is to much variables playing here
in my opinion
There's plenty of products that achieve this.
Question is, is it something required for my product
@weak plinth the fps sample is not deterministic
havok is not deterministic
unity physx is not deterministic
or rather, let me clarify
none of the physics options in unity, atm, is cross platform deterministic
SOME of them, have the ability to be deterministic on the same machine, i.e. so you can repeat something in sequence on the exact same hardware.
but not between different hardware, between server/client/etc.
@solar garden you can always do what we did, we wrote our own fully deterministic 2.5D and 3D physics engines.
When syncing states you still look for determinism where you can find it, because anything deterministic is always a bonus you can take advantage of
Like with PhysX the more you can keep the results of sims in agreement the less resimulating needs to be done, which is good.
And there are things you can do to make that happen, like trying to keep the server and client states in agreement, or doing things like quantizing your values to the lossy values being networked. But it is a far cry from actual determinism
๐ค I think I'm mixing terminology again
Yes I am. I mean prediction...
Not determinism...
Its easy to do
im still struggling with this idk if you have to make an actual transform separated from the player to create the prediction target or if you can do without with some vector addition
but as you have to run your movement script i don't think its posible without an actual transform to apply the movement to
@weak plinth you said this: There's plenty of products that achieve this.
I'm not sure there are plenty of (commertially available) determnistic engines out there, specially cross platform...
The full havok is single-platform deterministic, but not stateless (full state is too big with cached data to be rollback-able).
There might be some...
Yeah, I was mistaking determinism with prediction ๐
Even for prediction, I'd count in one hand, IF
Source engine, UE4, FPS sample, Photon Bolt... yeah, probably a few more I just don't know
but determinism... hmmm... not really many (I actually don't know any apart from what we have internally)
In the past I made 2 other open source physics engines deterministic (but not with super high performance or small enoug state for practical rollbacks).
You can make probably any open source physics deterministic by:
- replacing floats by fixed points (careful with accuracy) - or carefully playing with compiler flags to achieve single-platform float determinism;
- making sure you have stable sorting, and deterministic randoms (if using any in the solver);
- making sure any multi-threaded parts are "well behaved" (this can be tricky in some designs);
Now, making this stateless (super light weight state + compute full tick without cached data) to be practical for rollbacks... That's why we wrote ours...
You're making it sound quite impossible to make a multiplayer game with Unity
If you are trying to make a technical marvel on your first attempt of course.
Don't try to make a technical marvel the first go
I'm not trying to make a technical marvel
I just want a multiplayer game with the same features something like FPS sample uses. Or better yet, some of the features
Like predict/rollback
You can definitely pull that off just with OOP
The DOTS stuff only really starts to shine if your states are getting pretty hefty, but for midsized games some basic resimulation and such isn't all that outlandish
I'm trying to stay away from DOTS as well
I literally just want to start out with something predict/.rollback server auth
I mean. I'm not trying to make THE perfect multiplayer game by all means
But I do want a product that feels nice to play over network
And to at least get a sense of networked architecture
I just said there are a FEW (publicly available) libraries that implement that (non deterministic client side prediction).
And they are all super easy to use... This is very far from stating it as impossible... More like: just go for it...:)
You can also do it (some of these are even provided with sources, and considering client side prediction dates back to quake arena... learning material is everywhere).
What I said is more rare was:
- "stateless" determinsitic predict/rollback (which is something totally different than client side non determinstic prediction).
- I stated I do not know of an off-the-shelf publicly available determinsitic predict/rollbackable Physics engine... We have our own for that reason.. BUt I might be wrong, of course (I just contested when you said that there were many - But I realized later that you were trying to describe client prediction, not rollback determinism),
IMHO it's just that a lot of people confuse:
- deterministic predict/rollback (Quantum, GGPO, etc);
with - client side prediction on state-transfer/snapshot interpolation client-server solutions (that can benefit from SOME quasi-determinism).
I'm working on the latter
Where the client predicts the next states based on the given inputs
And rolls back when server sends different results
And yes, I was definitely mixing up the terminology. That happens when you want to talk about something you don't quite understand yet ๐
If I am reading that right, you are doing snapshots combined with extrapolation, rather than snapshot interpolation, which is totally a reasonable variant.
There's interpolation as well on the client? ๐ค
Interpolation between the current and next state (received from the server)
Yes theres interpolation on the client also
Not sure you would have that great an experience if it wasnt interpolated on client
Would be choppy
So now that UNET is deprecated, I'm trying to choose between mirror, mlapi, pun 2, what do you all recommend? the comparisons I see are quite outdated
If you are just getting started it really won't matter that much.
The main choice you will want to make is the architecture of the thing you are making, and if it needs Server/Client or if Relay/P2P makes more sense. But even that I wouldn't mess with until you do a tutorial for a couple of those.
I started with Mirror because rucksack needed it, but I'm throwing away rucksack and decided I should re-evaluate mirror. I'm not 100% happy with it (it's custom editor code breaks odin, it's based on UNET which was deprecated, etc) but am not building anything insane either.
the mlapi project has a blog post detailing a lot of problems with mirror but considering the source, I wanted to look for other opinions
MLAPI doesn't have the weavering, but it does have less baggage that came over from UNET, so its kind of a tossup
however they are similar enough, that really you can refactor back and forth later without that much pain
The basic architecture of them are similar
PUN2 is a different animal, since its pure relay, so it being a candidate depends on the game type really.
The main upside of PUN2 is there are no server/hosting consideration involved in hosting. How you dev is how it plays. The relay acts as a very lightweight server.
@ebon sun That blog post is a biased hit piece and should not be trusted. I'll help you in Mirror's Discord, or you can go another way, that's up to you. I'm sorry there's a conflict with Odin, but that's on them. We've been open to working with them, as you know.
thanks, you've been helpful previously so I don't doubt it. I'm toying with mlapi now to get some idea of it but I am not impressed - zero examples, the wiki is bare bones, no asset supports this, etc. it may be a good product but it looks like a turd to me
We stuck with Unet's model because it's approachable by people migrating from UNet, but we've gone a very long way improving it.
are any of those thread/performance issues (from the blog post) accurate or just twisted to serve the narrative
twisted
I'll admit we still have a couple components that are being replaced that may not be perfectly optimized, but for the most part we've got most of the garbage out.
NetTransform and NetAnimator, specifically
we're aware of them and working on it.
perf isn't a huge concern for me, my game will really only support small groups, but given I had to toss rucksack I figured this would be an ideal time to make sure I'm happy with my networking choice
One of our transports runs into Unity's 1200 thread limit at 600 clients, but we have others that don't suffer that.
ya I won't get anywhere near that
ok then never mind - you won't hit those limits...most people won't.
Anyway - do your due diligence, perfectly understandable. You know where to find us ๐
Beyond those, if it was made to work with UNet already, we can usually help them make a Mirror version pretty easily.
off to bed, but poke me in the other if I can help further ๐
thanks, I'm going to stick with mirror, there's just more support overall, better docs, better discord, wider asset support, etc. whatever mlapi offers isn't worth losing all that
Mirror will definitely have the most active support
Hi. I have a problem with cache server. I installed it through Node.js on PC1 with correct result. After that i tried to connect PC1 with PC2 by putting my PC1 local IP address in Unity cache server window. On PC2 I have a message "connection was successful" but on PC1 node.js command prompt I have this result. What Am I doing wrong? Is there any better documentation with examples than Unity official?
Please help, I'm stuck :/
I'm setting up a unity game which is going to be played on twitch, will likely have 4000-8000 people watching and using chat, I'm trying to set up a "twitch plays" type mechanic. Is there any good way to stress test my set up? or any advice you guys would have?
You can try to use a second system and spam the socket that's receiving the twitch stuff
Meaning, just use fake chat messages in large volume with an automated system
u reckon twitch are going to call me a naughty boy for flooding a chat?
or is that probably okay?
oh wait
fake chat system.. got you
Yes, not the actual Twitch chat system.
I mean, you can go test that, but that's out of your hands anyway...
At the entry point of your twitch chat messages, enter a whole bunch of fake messages in there
From a different application
So you're not including the overhead of this fake message program in your profiling
Anyone know how one would go about creating the effects of multiple "channels" of a world, frequently seen in MMOs I guess?
If anyone got any vid of the subject, that would be extra cool ๐
What do you do when the size of the state(snapshot) exceeds the MTU?
Oh no. More scary words ๐ฆ
I guess I'm more asking for the effect that one have with seamless transition between servers then, I guess simply not unloading the static world and your character would work. But would the two servers talk to each other directly? Or would there be some orchestrator that would fix that... hmm ๐ค
@jade glacier Some days back you mentionned a multi scene setup to calculate client prediction right ?
with the new physX yeah, you can do it
But it does involve some front work
basically making a system that replicates the objects of interests into that scene, but with greatly simplified versions of them
@weak plinth Its basically a way of sorting what parts of the state need to send more urgently, but still ensure that everything eventually gets through
I've never made one, so I have very little advice to give on the topic
Why is it usefull to have multiple scenes to do that ?
So you can leave your primary scene in tact mainly.. really comes down to how much furniture needs moving to do your resim
The issue with Unity is the state simulation with PhsyX IS the same scenes that the player's game... with all of its interpolations and such
I would stick with that though until you have reason to run resims in a separate sim
without being stateless and having efficient memory copies like you get with ECS, you really want to have a reason to do it before just doing it.
I've made use of it on the past for the server, since when the server would rewind for testing shots you didn't want to have to also move everything back
For client resims it makes less sense, since the furniture all needs to get moved anyway
The main issue to fight with there is that you may be doing this mid Update() unless you are taking control of the Simulation() call yourself - which you should. Mid Update means there may be some PhysX interpolation/extrapolation that will get stomped on.
So I recommend if this is your own game, immediately start down the pat of making your own update manager - and create your own PreSim, Simulation() and postSim callbacks
Does anyone here have a reference to how to use Photon matchmaking and using them as a simple relay?
Slowly going through the work being able to sync 2 players
So much setting up to do at first before I can even test networking
I think some of the build in samples demonstrate that no? @final depot
Like is there a transport level communications layer for Photon
I can't seem to find the actual code samples for that
If you use the pun2 demo scenes, you can see how those talk to and through the relay
How can I send a variable from the host to the client once the user is connected?
With what API?
I am using the unet
Then for sending I think there are a few ways, you can use SyncVars if the object is spawned, Network Messages, or RPCs.
Question:
Can I make a game in 2 separate projects, one being the server which houses all the game data and is always the predetermined โhostโ and another project which is client and gets the data from the server project?
@stray scroll My actual issue is how to send the value the players are spawned automatically by the network manager
SyncVars are supposed to be used with a NetworkBehaviour script my main script is a NetworkManager one
I forgot to mention that
@ancient depot So what is the issue then?
@solar tendon Are you talking about streaming content from server to client? Or simply just have one project as server and one as client and share some resources/scripts between them?
Basically how Iโd like to do it ideally is: one project which is server, that houses all the data, client sends commands via internet and the server reacts to those commands by using a switch to decider which action needs to be sent back to the client
Interger* not internet but also over binternet
Example:
Client sends server itโs ID and an int, server then using a switch look for that matching case to the int sent and then sends back information to the client appropriate for that int that was initially sent
@stray scroll sorry forgot@to tag
Uhm ok. Well, please define what you mean with "that houses all the data". The rest seems to be basic sending data back and forth?
@solar tendon
And if by that you simply ask if you can have two different projects with executables sending data back and forth, the answer is yes.
hello guys,
i have a question about state sync im using UTC to sync Clients to Server, but the time received from server seems to be in the future instead of the past which is weird.
in server side im getting the DateTimeOffset.Now.ToUnixTimeMilliseconds() then delete the GameCreationTimeStamp (to send a uint instead of Long).
in client side while reading the message i do :
var messageAge = DateTimeOffset.Now.ToUnixTimeMilliseconds() - ( timestamp received +GameCreationTimeStamp )
the messageAge is always negative which really weird looks like my Server is leaving in the Future XD.
if anyone have an idea that will be awesome.
Thanks!
@stray scroll yes thatโs exactly the jist of what I was asking, having 2 separate executables sending data to each other. โHouses all the dataโ in reference to data tables etc that shouldnโt be available on the client due to the ability to cheat super easily
@dapper night just use a stopwatch and count in seconds
do not use datetime
its inaccurate and weird
sorry @graceful zephyr i didnt get what you mean, how can i sync client and Server using a Stopwatch ?
@dapper night i mean use System.Diagnostics.Stopwatch as the clock on both ends
instead of DateTime.Now
oh i got it, so the System.Diagnostics.Stopwatch should return the same value on both ends ?
yes but how can i sync the start time between both ends ?
You can "ping" client/server and measure round trip time and use as offset.
this exactly what i was doing until they told me that the RTT i not procise and i should i use timestamp instead. XD
also im reading message at the beggining of every frame (60/s) so a message can arrive at the end of a frame but will be processed at the beggining of the next one, so few ms will be lost if i rely ony on RTT
only*
@graceful zephyr ok but how can i be sure that it started exactly at the same ms on both ends ?
you cant
its impossible
as in, literally impossible to know that it started on the exact same ms
Someone can correct me on this, but this is what I've done the few times I've done low lvl net code, is to set it up to buffer the data/snapshot/input on both ends so you know you generally always have data. Which will ofc create some additional small delay between input and action, if not using any sort of prediction.
Anyone building a game with DOTS and a RESTful web server? (E.g. for inventory storage). If so what kind of stack / APIs are you using?
@stray scroll that's a common technique yes
@misty shale From what I could read RESTful means I think I am? ๐ I'm new to web programming things. But I'm simply using the "UnityWebRequest" with POST to my server that uses php to talk to database. For game server that wants info, I use a system using EntityManager directly to add a managed class derived of "Component" holding the request and operation, then another system checking the operation and see if it's done and then read the reply.
And I'm currently using WAMP when testing it out : )
@stray scroll RESTfull just means that it doesnt keep any state between queries, and everything needed is sent in the query and returned as the response, etc
Hello, could someone help me by suggesting me a network server that suits my future project?
I have been looking for many but I am not sure which one could adapt to the needs of my MMORPG project.
I am looking for a network server that can handle an indefinite number of players (minimum 500) fighting in real time, without delay, all in the same place.
I planned to start with Photon, but then I saw that it seemed useless for the project I planned, and researched others like SpatialIOS, Gamelift, Playfab, etc. And among all those who seemed more like me was Gamesparks and is also indie friendly, but I don't know if he is the one I need, what I would need would be a server that allows those battles without any delay, something like League of legend but with hundreds or such Once thousands of players at the same time. I hope I have explained myself my english is not perfect, well I am beginning to learn so what I need is to know where to start
@tough oracle I am looking for a network server that can handle an indefinite number of players (minimum 500) fighting in real time, without delay, all in the same place. with that sort of requirement you're gonna be building your own stuff, or use SpatialOS (assuming it can even handle it)
@tough oracle Also for reference, the MMO Albion Online, uses Photon Server for it's backend networking - which i would think is pretty close to what you want
well, I really expected an answer like that, i test albion and its not what i want, well for now
What you are asking for is incredibly hard to build
im starting with some small project
a 500+ players real time battle is not a small project
o no im not starting with that project, like i say im starting to learn
i jsut dont see a way to slowly get there
Because there isn't really a way for a hobbyist to finish something like that by themselves /w a very small taem
it's too big and complex
and too hard to build
best bet is photon server or spatial os
yes i will start with spatial ios, thanks for the answer!
Why the minimum of 500?
because less player dont work for what im thinking, or i can say to you
i use to play a mmo named Ragnarok online , in that mmo there is a event called War of emperiun
i want to do something like that, in that war you Guild and the guilds alliance fight to conquer castles
i use to play with my guild 70+ players and two more guilds alliance so 170+ player fithing agains the guilds that want to stealh our catle so like 200+ maybe and the Solo people that only want to pvp
i dont think that something like that will worth with less than 500 minimun
i have to say, in that mmo you fighted with LAG XD BUT really good lag
sorry if my english is too bad
so you want to build an mmo, as your first game, with no networking experience
... gl hf
its not imposible
btw i checked more info about spacialos because u say me and that is exactly what i need, thx for that
Even with SpatialOS, 500 is a real stretch, especially realtime and all in the same place
i mean in the same map
Most games that have a large player count in a smaller area, will do things like phasing, or slowing down time
What would stop 500 players in the same map, from moving to the same area?
not leting entrances open in your castle xD
This is a pipedream
I think you're missing the point here
You are not going to do this
i can try
While I agree you should play around with networking and get a feel for it. Please don't aim so high as a start