#archived-networking

1 messages ยท Page 62 of 1

high night
#

@jade glacier
Do you serialize effects and sounds?
Even if you don't send them anywhere

#

It looks to me like serializing such stuff is going to be necessary because rollback is necessary on such objects

jade glacier
#

of course not, effects and sounds are reactions to the "fire" state/event

#

On the player and on all clients, you should have a method for the cosmetics of a weapon fire react to the state being applied

high night
#

do you do rollbacks on effects and sounds?

jade glacier
#

That's up to you

#

its not part of the sim, it is a reaction to the simulation

high night
#

Do you do the effects on verified states only?
Or predictions too?

harsh dew
#

Well it would be kinda weird if the player does something and the feedback effect plays10 ticks later

high night
#

@harsh dew But only after 10 ticks later that info is reached to your pc
You are spawning that effect then

It's easy to predict how will that effect look after 10 ticks just looking at the reliable tick.

#

Looking at the predictions or verified state while spawning effects make no difference if that effect is directly and instantly caused on player input:
Like gunshots and stuff

#

.
For a case like this:
A cube is falling down, hits the ground then you get the sound effect

If you use verified states, you hear it 10 ticks later
If you use predicted states, you can hear it instantly

This is where it makes a difference.

#

.
.
It looks to me like it's acceptable to act on verified states when figuring out effects/sounds
(not using any information in predicted states)

jade glacier
#

I wouldn't even get bogged down in any of those choices

#

your state is a history of simulation results... you render for the player an interpolation between any two of those at a time....

#

when you consume a new state (take it from the buffer and make it the new interpolation target), apply the events of the previous state (the snapshot)....

#

when you apply that now completed state... you trigger the cosmetics

#

You do no rewind the players world view

#

you only resim the details of things like transforms on the clients

#

so none of what you are asking applies

#

When you apply tick 10... you trigger any resulting cosmetics for tick 10. If tick 10 says "I fired a gun"... then that should trigger your guns "OnFire()" or whatever method that handles the pretty sounds and lights.

#

The simulation has no interest in your cosmetics.

high night
#

So in your architecture, when a cube object falls down from some height by itself, you get the hit sound effect after a small delay when it touches the ground in your sceen (what your player sees sitting if front of his screen playing the game)?
(That cube object is not a player, it does not get disturbed by player inputs, it's perfectly predictable)

#

Answer to the question will help me narrow down on what your architecture is

jade glacier
#

I think we might be not talking about the same things

#

If the cube hitting the ground triggers and state flag of some kind, then it is tied to that exact tick moment

#

Its not really a proper comparison, because the cube hitting the ground is not a player input.

#

If the player pulls their trigger, that queues a weapon for trigger for the next proper tick on that client.

high night
#

when does the player head the sound?

#

on this cube

jade glacier
#

As soon as that tick comes off the queue and becomes the "input struct" for the following tick... the player makes that the new interpolation target for the local sim... and it sends that input to the server

#

Right away, why would they not?

#

The cube hitting the ground is a state event. In this case not networked, just a physX state of "OnCollision"

#

I feel like I am not helping you at all with any of this. You should really just go complete your first attempt at this stuff, and if you aren't fully getting the standard architectures go read up a bit on Counter-strike, quake and Overwatch

#

They are pretty well documented, better than I can explain

high night
#

inputs?
inputs don't do anything on this object

#

@jade glacier

jade glacier
#

Then I don't get the question at all

#

The client is reproducing this cube falling from server states?

high night
#

yes

jade glacier
#

then the cube hitting the ground if you were to produce an event from that, would trigger when the cube finishes its interpolation into the ground

#

Either determinsitically on the client, with it detecting that collision itself... or as a state flag in that tick if the server dictated that that cube hitting the ground should produce some action. Which is not a great example, unless this is like a grenade and the server needs to say when it pops.

#

For this question, lets call it a contact grenade. After bouncing around the server decides that when it hit the ground this time, it explodes. It would set the "you go boom now" flag for that grenade on the tick where it hit the thing that triggered it.

#

So now, when anyone interpolates that grenated from the frame before that to that frame... it will end in a POW

#

tick 10 hits wall and goes boom.

#

so if the current interpolation is 9 to 10... its moving toward the wall

#

at the end of that interp (when we move the 10-11)... it triggers the boom graphic callback

high night
#

I understand how you are saying effects/sounds are done just by looking at interpolation (interpolation: what person sees on screen)

#

But what if interpolation is wrong because it was based on prediction

#

Cosmetics manager doesn't care?

jade glacier
#

again, you are confusing your wacky system with the standard

#

if I am interpolating server states... there is no resim

#

those are final

#

server states to clients = final word from god.

#

there is no taking anything back

high night
#

client doesn't predict the present time?

jade glacier
#

no, this is snapshot interpolation

#

you are talking about snapshot extrapolation, which is a layer of hell no one should wander into

high night
#

i am not doing the snapshot architecture

#

i am doing the state sync architecture in that website you said

jade glacier
#

I post a lot of stuff, but I assume gafferongames - he has lots of experiments in different systems

#

but his primary article is about snapshot interpolation

#

trying to predict other clients weapon fire would be pretty impossible

high night
#

but cubes like that can be predicted

jade glacier
#

because you can't guess a "bang" nor take back a "bang"

#

Cubes you can take back, because its just mushing around time if you try to extrapolate

#

RocketLeague has a lot of mush built into it

high night
#

your player is seeing the past

#

if you are not extrapolating

jade glacier
#

in snapshot interpolation, yeah

#

Thus "the player lives in the future"

high night
#

sends input for future

jade glacier
#

Yikes, we are so going in the same circles

high night
#

i didn't look too far into snapshot interpolation

jade glacier
#

I am not sure again what the question really is

high night
#

but can you make the controls responsive some way?

jade glacier
#

I don't know your architecture then, so the answer really comes down to what is best for your architecture

#

what you originally described was a low send rate, VERY low server state non-deterministic system... which is going to hurt.

#

With snapshot interpolation can you make controls snappy?

high night
#

I believe you cant without some funky stuff

jade glacier
#

That funky stuff is called prediction

#

its what all the articles I posted are about

#

Its how CS:GO, Quake, OW and most fPS games deal with it

#

Photon Bolt has it all bake din

#

client prediction with server shot rewind

#

player lives in the future, server checks their claims with some funky rewinds

#

The altnerative is to extrapolate the world, but that leans very heavily on determinism and constant re-simulation.

#

Quantum is capable of that, but I have no idea how they make it work with FPS games.

#

My guess is things like weapon fire cosmetics are held until the simulation is certain it has all player inputs.

swift surge
#

Okay so I've caught the late train but hopefully this will be quick: How do I do multiplayer if my game is not based on DOTS and isn't intended to be? Do any networking features in Unity (not a third party system) still exist that aren't part of DOTS or deprecated along with the HLAPI?

jade glacier
#

All the usual candidates @swift surge Bolt, Mirror, PUN2, MLAPI, Forge

swift surge
#

If I understand correctly, those are all third-party

jade glacier
#

Depends how "hobby" your game is and the game type - which is going to be ideal

swift surge
#

Say hypothetically that I can't tolerate third parties and I want to do that "write your own networking system" thing from that flowchart the Unity site has. What API exists?

jade glacier
#

Most first attempts at mp games are a terrible wreck, so give yourself time to do tutorials and generally fail before trying your dream project.

#

The Unity flow chart is just them trying to pretend they haven't created a radioactive wasteland of networking

swift surge
#

That's the plan, actually. Get started way early. I don't actually have any (necessarily) multiplayer games in development, but I want to start learning a system that doesn't have its days numbered.

jade glacier
#

Do tutorials for a bunch of the libs

swift surge
#

The third-party libs?

jade glacier
#

To see how they annoy you... and see if you can start to understand why they kind of suck. Then you will have to make some hard choices.

high night
#

The snapshot interpolation i understand from gafferongames is
client doesn't simulate anything?
@jade glacier

But it looks like you are simulating

So your architecture is snapshot interpolation + simulation for prediction (are velocities included in your snapshot too?)

swift surge
#

um ok

jade glacier
#

Depends o which article, he breaks things down into a lot of small pieces

#

he does have articles about client prediction

#

I have a bunch of libraries, but my current work is just on PUN2, so there is no server auth - there is just owner auth, so its almost entirely state transfer

high night
#

Thats very different than what i'm trying to make

jade glacier
#

yeah, only some parts will apply

#

like the state transfer concepts

#

but you aren't even doing state transfer, you are trying to do some semi-deterministic thing, with very rare state transfers that try to clean up any mess

#

which I don't see ever working

high night
#

no, i am doing the

reliable info in memory: inputs0, inputs1, inputs2, inputs3, inputs4, state0
all info in memory : inputs0, inputs1, inputs2, inputs3, inputs4, state0, localInputs5, localInputs6, localInputs7

#

in this example player is viewing timeframe:7

jade glacier
#

Sending inputs to the clients... and is the server simulating and sending out states?

high night
#

5 inputs + 1state sent from server at 10hz

jade glacier
#

The server sending inputs implies a deterministic system

narrow oriole
#

Will die with 5-10% packet loss

#

@high night

high night
#

its determinism that relies on 5 frame long determinism

jade glacier
#

Will die just to butterfly effects even with perfect lockstep

high night
#

@narrow oriole state is transferred

#

i send states, man

narrow oriole
#

No need to mention genders

jade glacier
#

How is that not what I said? You are sending inputs with rare states to try and clean things up? Is that not accurate?

narrow oriole
#

I like these funny people with these funny "meme" pictures on their profile asking funny question in Unity discord.

high night
#

those inputs are only there for knowing which frame player shot the bullet @jade glacier

#

i drew that

#

@jade glacier that was the first idea i had

#

what you said

#

i am not doing the
state send each 2 seconds thingy

#

not planning to do it

jade glacier
#

I am not following your current arch - you just need to make it and see. You can't really ask for tips on it, because you are out on a wild limb of your own creation right now.

high night
#

Yeah, i really though you were doing state syncronization though all this time, that made our communication difficult
But it's been helpful

#

thanks for your time for the past few days @jade glacier

jade glacier
#

Let us know what your tests come up with

high night
#

I think i know what im going to with effects, i may not have a question for a while

regal mesa
#

Would you guys recommend focusing more on limiting network bandwidth or better performance? For example, Iโ€™m sending a input frame every 20 frames that contains 4 float values, each only sending a value of -1 0 or 1. The rational thing bandwidth wise would be to convert them from floats to sbyte, but that means that the game will need to convert the sbyte to int when performing its calculations. My question is whether not I should keep them as floats or if the use of sbyte is the right thing to do

#

This would condense 16 bytes to 4 bytes of data sent every inputframe

#

I could also probably use bit-masking in the future to condense it to a single byte, but first we need to come to a conclusion of whether not the extra performance cost is worth it

gleaming prawn
#

@swift surge that chart is kind of a "joke" and was probably put together by a PR department, contrary to the third party libs (and many advices (you get here), which come from actual developers. Make your choice.

#

@regal mesa It depends if one will become a problem or not. The focus is more dependent on the architecture you are using. With predict rollback determinism bandwidth does not become a problem unless you need more than 32 players or so... And then the solution is to compress the input as much as possible.
With state transfer you need to first care about scoping (sending data to who needs data only) and scheduling (updating remote entities with different frequencies based on priority).
Then, on top of that you think about compression

#

Of course if you are sending full snapshots all the time you need to think about compression first and foremost

regal mesa
#

Thank you, that was very helpful ๐Ÿ™‚

gleaming prawn
#

The units FPS sample uses snapshots with a neat compression approach, for example. (current implementation seems to limit it to games with a low player count and small complexity, but the approach can be stretched fine for many game types, including battle royale stuff)

#

Bolt does scheduling compression and scoping for you... I'm not very familiar with Mirror, but MrGadget here is the lead dev (am I correct?) And they have a nice discord server.

#

If you are building your own, that is a super short description of a few things. Guys like emotitron have a lot of advice recorded here on state transfer techniques (just read through the history).

gray pond
#

@gleaming prawn Thanks for the props but I'm not the lead dev...just more visible than others on the team ๐Ÿ™‚

gleaming prawn
#

Still the face of it here...:)

gray pond
#

And yes, Mirror has byte-packing built in. Bit-packing would be a small trade of +CPU for -bandwidth over byte-packing.

gleaming prawn
#

Cool

jade glacier
#

You can spot apply bitpacking when using a byte aligned reader/writer as well. Generally though, don't get buried in those weeds until you have your game working. Optimizing serialization is pretty easy after the fact - since its not an architecture change.

#

You will mostly find with first networking projects is that you are going to hit the same walls everyone else does, and that they try to warn you about. So the goal isn't to make a great networking attempt first try... the goal is to make all of the mistakes quickly so you can restart/refactor with a better plan before investing too much time into code you will end up throwing out. @regal mesa

#

Things like net/sim rate should be a simple variable setting if you code things right.

gleaming prawn
#

Latest update on my progress with Car Physics in Quantum.
From the video description:

Testing Quantum's predict/rollback fully deterministic simulation to implement 3D car physics.

Two game clients connected to same server, input being exchanged between them (via server). 

No input-delay used (full rollback netcode mode), 100% WYSIWYG physics.

https://youtu.be/he_qd2nDPBQ

Testing Quantum's predict/rollback fully deterministic simulation to implement 3D car physics.

Two game clients connected to same server, input being exchanged between them (via server).

No input-delay used (full rollback netcode mode), 100% WYSIWYG physics.

โ–ถ Play video
stray scroll
#

Would be more interesting if you introduced network delay and packet loss

teal hound
#

Hi everyone,
I just started creating a rogue-like (xp/stats loss on death) 2 players coop 2d game with a classmate and since we're both beginners we'd like to get some advice whether we should use Mirror or Photon to get it running.

Our goal is to have a host player and a client player and if possible singleplayer/local coop.

Our max player/server would be 2 and maybe 4 later but not more. From what I read Photon is made for games that don't require a lot of players connected at the same time?

Looking forward to get your advice on this.
(I hope this is the right channel to ask this)

gleaming prawn
#

@stray scroll I tested with another player in Brazil (250ms ping) yesterday... This doesn't affect your local view. But yes, I can add that to a video (just to highlight how well it adapts)

#

But we'll do that later when we record a better video, with a better rendering as well, etc

#

Also Jaws, the bandwidth numbers in this video are "bogus", because this test project has a "mammoth" input struct (we just keep adding more data to it, as it's a shared project).

#

We're now just cleaning up the code, setting up a few different cars, so these small temporary things will be gone. Thanks for the suggestion (I'll include a section with network lag + loss added)

#

It will be fun to see...:)

#

Hi @teal hound photon works fine with a lot more than that as well... Try to follow the basic tutorials and you should be able to have something running quickly

teal hound
#

Ok will do, thanks!

weak plinth
#

nice work erick

#

interested to know if quantum replay on disconnects

#

or sends world's states for that frame and play from there

graceful zephyr
#

@weak plinth we have 4 different ways of re-connecting to a game

#
  1. replay all inputs
  2. store a snapshot of the latest verified frame when you're in game, use this when you reconnect and replay inputs from there
  3. get a snapshot from one of the other clients
  4. get a snapshot from server (if you're running a server-side simulation, this isn't required - but an option)
weak plinth
#

hey fholm, tnx for detailed answer, btw how many players could you host if it just relay inputs ?

graceful zephyr
#

@weak plinth we have a live game with 32 players, we've tested up to 50 ourselves

#

we can go higher, just never had any customer ask for it so

weak plinth
#

never saw deterministic system with this numbers, nice

graceful zephyr
#

no, we're pretty much world first with that AFAIK (i could be wrong, ofc.)

weak plinth
#

you use ecs like system for you new project ? the mmo one

gleaming prawn
#

Quantum API is an ECS yes

#

Not the same as the MMO stuff...

#

And the actual tested limit was 64 players (for Quantum - currently a hard cap we put - we're lifting for the next version)

weak plinth
#

i'm still amazed from the 20k number and tried to think how it was done

gleaming prawn
#

Lol, that has a lot of history from Fredrik involved

weak plinth
#

the physics system can handle more ?

gleaming prawn
#

Depends, what are you talkiing about?

weak plinth
#

if all players simulate then must be hard to compute complex physics like cars and such

#

if its more then 64 players

gleaming prawn
#

Quantum's physics engine is a stateless fully deterministic engine... It can handle a pretty decent amount of load (and we're not even yet done with optimizations)... BUT it's a full rollback netcode system, it really depends on your game load.

#

Oh, that normally is NOT a big problem because we do prediction culling (was discussed here a couple of days ago)

#

So we do not need to predict/rollback the WHOLE game state...

#

So, depending on how the game scenes are, you'll have 90%+ of the game running one-tick-at-a-time, and a small portion running full predict/rollback

graceful zephyr
#

For reference, MMO thing is my own hobby thing, not related to quantum or any of my professional work

gleaming prawn
#

Yes, I'm strictly talking aout quantum @weak plinth

#

Fredrik's MMO stuff doesn't have anything todo with the videos I posted, our determinstic physics, etc

#

IMHO (and I think Fredrik agrees) Running 20k players + 256k NPCs you will NOT even try to use a fully fledged physics engine... It would not handle it.

weak plinth
#

you added 3d physics to the 2.5d one ?

gleaming prawn
#

We've had a fully 3D physics since a while already.

#

We're constantly adding more and more features.

weak plinth
#

never saw deterministic fps, made hitbox for each body part ?

gleaming prawn
#

Vehicle physics was essentially implementing:

  • wheel colliders
  • spring/damper + stabilizer bars
  • tire friction models
  • putting all together as a car-solver, adding data assets for calibrating cars, etc
#

@weak plinth Doom was deterministic, so you probably saw at least one..:)

weak plinth
#

sounds like fun with no floats

gleaming prawn
#

Fredrik posted a video of our deterministic FPS a couple of days ago...

weak plinth
#

first doom was deterministic ? not bad

gleaming prawn
#

The bigger question I always had about a deterministic FPS with quantum has always been:

  • will it be fun? Because quantum might be TOO accurate....
weak plinth
#

hmm most games favor the shooter

#

so you got a point

gleaming prawn
#

Lag compensation with favor the shooter helps a lot to make hits "easier"

#

BUT

#

Our tests show it's just as fun...:) Maybe we'll just publish a demo sometime, who knows....;)

thorn maple
#

Hello all! I am having a bit of a problem running a Command in my client. Host works fine but Client has an error

steel gyro
#

Hello anyone know a good tutorial about networking fps game for 2020

#

THANKS

#

also can I play a game online with somone else from another wifi?(not lan) in unity

mental beacon
#

@steel gyro fyi Wifi(is a certificate) = WLAN = LAN

steel gyro
#

So can I play with someone from other WiFi Not lan

void oak
#

My SslStream.BeginRead callback for an asynchronous socket server is consistently called when only one byte has been passed. The rest comes on the next callback. I want to define a 2 byte header for the total package size but can't since the first byte is always 1.

        {
            UnityEngine.Debug.Log("<color=orange><b>SecureReceiveCallback </b></color> ");
            Connection conn = null;
            int received;

            try
            {
                conn = (Connection)ar.AsyncState;
                received = conn.Ssl.EndRead(ar);
                UnityEngine.Debug.Log("Received: " + received);
                if (received <= 0)
                {
                    UnityEngine.Debug.Log("<color=red><b>Received is 0.</b></color> ");
                    return;
                }
            }
            catch (Exception e)
            {
                UnityEngine.Debug.Log("<color=red><b>Error in SecureReceiveCallback </b></color> " + e.ToString());
                return;
            }

            byte[] data = new byte[received];
            Buffer.BlockCopy(conn.Buffer, 0, data, 0, received);


            Dictionary<string, object> args = new Dictionary<string, object>();
            //Pass data to be parsed. Data is in conn.Buffer
            args["conn"] = conn;
            EventManager.RaiseDataReceived(args);

            conn.Buffer = new byte[8096];

            conn.Ssl.BeginRead(conn.Buffer, 0, conn.Buffer.Length, new AsyncCallback(SecureReceiveCallback), conn);
        }```
#

i'm sure im writing just once to the stream. But received is always 1 then the next time is the rest.

jade glacier
#

@gray pond To be technical, Mirror doesn't do byte packing (though it does have PackedBytes, which is more of a varint kind of thing). It would be easy though to add a couple methods to your writer to make it one. It is just missing a length field in the Write/Reads to indicate how many bytes of the supplied value would be written.

For example Writer.WriteUInt32(MyUint, 3) to indicate that you only want to write the least sig 3 bytes.

#

Unless that has been added since I last looked, then nm.

#

with the writer as it is, the only packing you can do like that is by casting down, from say a uint to a ushort or to a byte.

gray pond
jade glacier
#

Not seeing a bytepacking write at a glance (but may have skimmed to fast), but what I see there as your primary writer is like 3 lines of code from being one.

gray pond
#

I don't expect you to line-by-line review it - a skim would tell you what we're doing

#

PR's welcome always ๐Ÿ™‚

jade glacier
#
        {
            WriteByte((byte)(value & 0xFF));
            WriteByte((byte)((value >> 8) & 0xFF));
            WriteByte((byte)((value >> 16) & 0xFF));
            WriteByte((byte)((value >> 24) & 0xFF));
            WriteByte((byte)((value >> 32) & 0xFF));
            WriteByte((byte)((value >> 40) & 0xFF));
            WriteByte((byte)((value >> 48) & 0xFF));
            WriteByte((byte)((value >> 56) & 0xFF));
        }```

You already have that broken into byte writes, so just adding a count = 8 to the args, you could easily just tell it to stop at X byte writes... do the same for the read side, and you can claim bytepacking.
#

I'm nose deep in PUN2 fixes, I'm not the guy to do that for you - but you literally have it practically done - if anyone on the team decides to just add those extra lines.

#
        {
         for (int i = 0; i < bytecount; ++i)
             WriteByte((byte)(value >> (8 * i)))
        }```
Along those lines... I am sure that is bad what I just typed, but the idea is there.
#

I don't think your & 0xFF are needed. The byte is nuking anything left of FF anyway

#

That wall of text was for @gray pond

steel gyro
#

any good tutorials for networking?

#

or what to do with networking?

#

what to elearn

jade glacier
#

most libs have some tutorials for that libs usage

steel gyro
#

what you suggest?

#

easier or more powerfull

jade glacier
#

Give yourself a week, and play with Bolt, Mirror, PUN2, Forge - those are all mid level to high level

#

Bolt being the only actual full stack

steel gyro
#

so you suggest bolt?

jade glacier
#

PUN2 is relay based

#

I suggest nothing, I have no idea what you are making

steel gyro
#

for fps online?

#

for fps online?
@steel gyro xD

jade glacier
#

FPS if you plan to make an actual competitive game and you have funding to promote it - Bolt is made for that.

steel gyro
#

Ok thnxx

jade glacier
#

It is CS:GO in principle. But it is a bit of a learning curve. And you will have to host your servers.

steel gyro
#

you know photon?

jade glacier
#

I work for Exit

steel gyro
#

?

#

exit?

jade glacier
#

They make PhotonEngine and the various libraries

steel gyro
#

Wait confused so what is bolt

jade glacier
#

I specifically am doing work on PUN2

steel gyro
#

kk

jade glacier
#

Yeah, this is why you have to go do a bunch of tutorials

#

you can't even form the right questions until you just play with what exists

steel gyro
#

bolt is virtual scripting no code?

jade glacier
#

networking is a mess, is hard, and is a long road. But you have to start by doing a lot of reading and playing with what exists for libraries.

#

You will not get away without scripting if you are making a networked game in Unity

#

Have you made a single player game?

steel gyro
#

kinda yeah

jade glacier
#

Photon Bolt is different from Bolt Visual Scripting

steel gyro
#

with what i done I can make an online gmae

jade glacier
#

they are to unrelated products

steel gyro
#

OH LOL

#

so its photon bolt not just bolt

jade glacier
#

Bolt Visual Scripting failed to notice that the name Bolt was already taken

#

and now they confuse a lot of people

steel gyro
#

rl now xD

#

so I should search for photon bolt tutorials?

jade glacier
#

If you chose to try it, yeah - you will want to go to the PhotonEngine site and dig around

#

you will also likely want to join the Bolt discord server

steel gyro
#

ok thanks so much ๐Ÿ˜„

burnt axle
#

Any source/docs on this syntax? (C#) Action<List<RoomInfo>>

#

This is understandable: var myList = new List<ListElementType>();

jade glacier
#

Not sure sure that be a networking question @burnt axle

jade glacier
#

I would argue the opposite

#

Unity events are bloated, and should really only be used if you intend to make use of the Inspector serialization aspect of them.

#

Actions are just sugar, and they compile into delegates

#

I think he may be looking at existing PUN2 code and wondering what it is doing?

burnt axle
#

Not sure sure that be a networking question @burnt axle
@jade glacier Not directly no, i just saw it being used in a code for Photon. Nevermind ๐Ÿ™‚

jade glacier
#

Just more likely to get answers to that stuff in busier rooms fielding general Unity/C# questions

mental beacon
#

emotitron, youre right, i look at the C# docu right now, it looks like its simpler than unitys Events

#

shame on me :<

jade glacier
#

no worries, this is why we all talk in a public room

#

I get corrected all the time by people who know something I don't.

gleaming prawn
#

That is against the EULA @teal hound

#

Ilegal then. You either pay the one time fee for 100 CCU, or get into one of the plans if you get higher concurrent users

teal hound
#

I don't understand, if players host a lobby themselves, how is this related to Photon? Is there a connection made to Photon still?

#

newbie here

gleaming prawn
#

Lobbys are hosted on photon servers

#

And even if you run your own copy of a photon server, it is proprietary software, built by us...

#

It's the same as running a machine with windows, you need a license for it...

#

According to the EULAs

#

You have open source alternatives if you think they would be cheaper (for LAN games they would, for hosting server, hmmm not always really). Check for Mirror anyway (the open source actively in development version of the old deprecated UNet)

#

The guys are nice and give good support as well...

#

If you are building a game for PC/Steam only, check the option valve offers for free (unlimited basic punch + relay)

teal hound
#

On the other hand, Photon does it all for us right?

gleaming prawn
#

I'd say "Yes" (depends on what you consider ALL)

teal hound
#

Because checking for the pricing plans 100 CCU for 5 years for 100$ seems really fair

gleaming prawn
#

it is, really

teal hound
#

I mean, if we don't want to annoy our players with opening their ports and stuff it's better to just have Photon imo?

gleaming prawn
#

For hobbyists this is a bargain, as many times you are not planning to sell millions of copies (if you are, then the pricing there will be fair as well)

teal hound
#

got it, thanks for the info

gleaming prawn
#

Yes, there's no need for opening ports whatsoever

teal hound
#

I have a better understanding of it now, thanks!

gleaming prawn
#

Including if you go for Photon Bolt

drifting ridge
#

Hi guys, Heartstone was created on unity. Does anyone know what they used for networking? Was it Photon or Unet?

gleaming prawn
#

Neither

#

Their own network stack.

drifting ridge
#

Oh... so they made their own

#

Any recommendation on which to go for? Photon is quite pricy if the game scales

gleaming prawn
#

When you have a 500-people team you CAN, and you normally need to justify why aou are paying them...:)

drifting ridge
#

Hahaha true

gleaming prawn
#

(disclosure: photon employee here) I'd argue Photon is quite cheap when you scale...:)

#

I could explain why with a lot of numbers...

#

But...

#

It never works to just say it...:)

drifting ridge
#

Ok I guess you'll be right person to ask then

gleaming prawn
#

One of the reasons we've been doing good business all these years is because our pricing and benefits are super fair.

drifting ridge
#

For 500 ccu does it mean that if 500 users installed my game for just 1 minute and then uninstalled it will I still be charged that much?

gleaming prawn
#

No

#

500 is CCU (simultaneous)

#

Running online at the same time

#

let me give you a quick rule of thumb:

drifting ridge
#

Running online for how long?

gleaming prawn
#
  • to get to 1000 CCU you normally need around 20000 DAU (daily active players), which translates to around 400000 MAU (monthly), or around 0.5 million downloads.
#

Simultaneously Vind

#

It doesn not matter how long, it only matters how many are playing ONLINE at the SAME time... We count the peak of that... That is it...

#

Our experience shows the rule above

#

To peak at 500 CCU you need to be very successful already (250 thousand downloads)

#

if you get 500 downloads you will not even show in the dashboard (the free 20 CCU tier would work)

#

The other rule of thumb we also tend to say is:

  • focus on making a fun game...
  • if you get successful, our pricing will NOT be a problem (quite the opposite)
drifting ridge
#

Because what I'm mainly worried about is that during maybe the first week I will definitely go crazy and market it like a mad cow. But after that, people may uninstall and prolly find my game stupid, etc. So I'm worried I'll be charge for just that 1 time

gleaming prawn
#

well

#

if you get 1000 CCU one month, and not in the other it is a shame..:)

drifting ridge
#

But your numbers are good for me to understand things ๐Ÿ™‚

gleaming prawn
#

because a game that has the potential to reach that, if it doesn't sustain is a failure of the studio on how to market/retain players

#

And if you get 500 and pays that for one month, then next month you don't peak, you can go down to a cheaper tier, no problem

#

It won't bust your bank

drifting ridge
#

Ahhh ok so if my CCU drops I will be charged the lower tier

gleaming prawn
#

We expect you to signup for the right plans

#

Example:

  • say you have the 100 CCU tier (one time fee for 5 years), and in one month you peak at 273 CCU;
  • we expect you to change the App ID for the 500 CCU max tier for that month (we won't stop your players from being able to play, we won't hard-cap the CCU at all);
  • if you do NOT change, we'll send you an email after a few days, etc
  • if you are SURE it was an Undesirable (is there such a thing?) peak, you can switch down back next month, ec
#

Trust me, if you get to the point of having good numbers, you'll be very happy to pay (it would be much much cheaper than hosting your own servers)

drifting ridge
#

Quick question if I have 1000 CCU for only 1 min in the entire month, will I be charged for the 1000 CCU?

gleaming prawn
#

Valid argument: if you are aiming for Steam ONLY, and you do NOT need super accurate netcode (like Photon Quantum or Photon Bolt, just a basic thing like photon realtime), than you could go for Steam "free" offer (they get your money from the 30% cut)

#

Yes... Based on the EULA yes... But if you have 1000K for only one minute you probably have a problem.

#

And we won't blame you for sending an email asking us to reconsider that...:)

#

Again: first make a game

drifting ridge
#

I understand and I agree with you

#

Are there photon servers globally located to support regions?

gleaming prawn
#

I think currently we have around 15 regions

drifting ridge
#

Ahh ok! Thank a lot man ๐Ÿ™‚

#

I will go learn unity now

cedar marlin
#

hello guys

rough garden
#

Hi everyone. I would be extremely thankful for some advice regarding backend between my game and my database.

  • is it best practice in gamedev to use rest api for this purpose? May i ask for any kind of material to read and increasy my knowledge about it?
  • Where i work (it's not a about games) we use aspnetboilerplate. Would it be consider an overkill to use it in gamedev backend (if anyone knows about it, oc)?
graceful zephyr
#

@rough garden most games use stateful custom TCP/IP connections for backend

#

not sateless http stuff

cedar marlin
#

asynchronous tcp server in unity seems hard to implement no ?

#

cant make it work

rough garden
#

@graceful zephyr even for information like: If i include a market in the game where it gets a table of equipment (swords, gloves, armor...), wouldn't this information be better using stateless?

graceful zephyr
#

no

cedar marlin
#

i have a linux with a tcp client un python waiting to send data to my unity with tcp sserver but cant make it happen :/

#

should i do a python server outside of unity to wait for the data and then communicate it to my unity scene ?

graceful zephyr
#

thats not for tcp connections @cedar marlin

cedar marlin
#

oh

#

im confused then

graceful zephyr
#

that is for udp

#

and you need to have both client and server in unity, using the same API

#

for it to work

cedar marlin
#

aww ok

graceful zephyr
#

and use that

cedar marlin
#

yeah im into that actually

#

but unity freeze when i launch

#

have to kill it

#

will try tcp listener then thx

#

@graceful zephyr i fear i have the same behaviour as with synchronous server. it freezes unity

graceful zephyr
#

because you have a while(true) loop

#

probably

cedar marlin
#

ok yes i guess it stays inside i suppose

#

oh yes since we put it into update no need for while right

#

ok got rid of the while true still does the same ๐Ÿ˜ข

#

but if i understand well tcplistener is also a "blocking" server right ?

#

it waits and block everyhing while receiving the data ?

gleaming prawn
#

don't you have to run this as a background thread?

cedar marlin
#

idk i'm not very familiar with networking to be honest

#

and i cant find any quality intel on the subject in internet

cedar marlin
#

lol how am i supposed to take these reacts ? ๐Ÿ˜‚

graceful zephyr
#

there isn't a lot of good information online about this

#

trial and error is the way

cedar marlin
#

yeah

#

i'm lacking the basics on this anyway

high night
#

I did the thing i was doing with state syncronization

Left screen is client
Right screen is server

There are two of each object

On the client first one is, last snapshot(state) from server

On the server first one is, servers simulation 15 frames in the past (300ms in the past)

On both client and server, second scene is predicted scene from recieved inputs, snapshots and local inputs.

#

I press space for that effect,
that information is recieved from inputs
By looking at characterInput.attackInput

graceful zephyr
#

this doesnt look correct

#

to me

high night
#

which part? which screen?

#

packet loss is causing misspredictions
but i'll probably swich to udp send send duplicate packets

graceful zephyr
#

okey so it's with packetloss

#

but this sentance

#

"On the server first one is, servers simulation 15 frames in the past (300ms in the past)"

#

seems wrong

high night
#

it's not?

graceful zephyr
#

no, server simulates 'now'

#

clients simulate 'future'

high night
#

you can both see the simulation and prediction on server

#

one is 300ms in the past

#

one is now

graceful zephyr
#

prediction on server?

high night
#

yes

#

server also plays

#

as a player

graceful zephyr
#

both should be 'now'

#

on server

#

client should play in future

high night
#

here is one without packet loss

#

i move the client

graceful zephyr
#

has nothing to do with packet loss

high night
#

it does see,
client predicting itself doesn't make any errors this time

#

(client is left)

graceful zephyr
#
  1. server is jittery
#
  1. server should simulate all players, including himself in 'now'
#
  1. client should simulate his own player in 'future'
high night
#

I will run interpolation on both server and client based on the prediction result

graceful zephyr
#

has nothing to do with interpolation, you can see the 'leading' cube on the right screen jumping around

#

just look at the left 'leading' cube and the right 'leading' cube, its smooth on left, not smooth on right side

#

that has nothing to do with interpolation

high night
#

thats the prediction?
it has to jump because input has changed and that change was from 120ms ago (network lag)

graceful zephyr
#

why are you predicting the clients on the server?

#

maybe this isn't for authoritative input stuff

high night
#

server plays too as a client and wants to see "now"

graceful zephyr
#

no... that's not how it works

#

or well

#

that's not how it should work

#
1) server is jittery
2) server should simulate all players, including himself in 'now'
3) server should never 'predict' anything in relation to clients
4) client should simulate his own player in 'future'
#

there you go.

steel gyro
#

eh help I am using photon bolt and I made some fps kinda game but when I shoot it doesnt reduce other`s health I use states but it doesnt work

#

plz help

graceful zephyr
#

go to the bolt discord

jade glacier
#

There is a Bolt Discord btw @steel gyro where you might get better results

#

what he said

steel gyro
#

ik but they are offline

#

dont answer

#

the half of them are just offline xD

jade glacier
#

that's a lot of networking chat in general, its a small number of people compared to users of basic unity stuff

graceful zephyr
#

@high night anyway take my advice or not, what you describe to me 1) doesn't sound like proper implemented authority and 2) doesn't look right in the example (even with 0% packet loss) - no matter if you do interpolation or not

jade glacier
#

@high night You are going to get the same advice from fholm you got from me. Start with a standard known architecture and make it work before you start getting wackado.

#

You are jumbling up concepts without actually having made a very straight forward working system.

high night
#

so what you are suggesting is
no player should ever predict other players than its own character

#

for both server and client

graceful zephyr
#

I'm not suggesting anything

#

I'm telling you that what you described and showed, to me, doesn't look like proper client side prediction /w server authority

jade glacier
#

If your system is designed for that you can, but you are starting with nothing so straight forward

high night
#

i was grabbing the last recieved input when simulating ahead of last recieved state

#

instead ill just pass in a default input

#

if input was missing

jade glacier
#

What you described over the last week as I understand it is a partially deterministic input based system, but not deterministic, so you are trying to correct it with very lazy state transfers from the server

steel gyro
#

Sorry to interupt can I anyone help with photon bolt it says Only owner can modify "health"

jade glacier
#

but then you have the server trying to predict its own client as well, which is messy to say the least

graceful zephyr
#

@high night if client is jittery on server, then something is wrong.

#

assuming there's not a bunch of packet loss/etc causing it ofc

jade glacier
#

Server having packetloss to its own client? ๐Ÿ™‚

high night
#

only reason im sending inputs is recreate events that happened in a single frame but not included in the snapshot
@jade glacier

#

that was the old idea i had you talked about just now

jade glacier
#

yeah, we have discussed it quite a bit... I can't follow your architecture (the devil is in all of the details of making these things actually work)... so you really do just have to go make whatever you are going to make and see.

#

unless you are asking us about a standard architecture, we can help there.

high night
#

i believe i will fix the jitter fholm was talking about in a minute

#

by not predicting inputs

jade glacier
#

I am not getting what you mean by prediction then

#

unless you mean you are extrapolating inputs

#

prediction doesn't involve any guessing... its just applying inputs locally immediately, and checking later to see if the server agreed

high night
#

prediction for other players

#

something you don't do i suppose

jade glacier
#

that would be extrapolation

high night
#

yeah

#

let me just try

jade glacier
#

you should study RocketLeague

high night
#

if you inputs don't immidenly take major effect input prediction can be possible without minimal jitter i believe

jade glacier
#

rocket league extrapolates other players on all clients, it behaves somewhat like a deterministic system as I understand it

high night
#

it involves rollbacks and resims as i remember from the video

jade glacier
#

in that it is constantly resimulating and is extrapolating other users so the player can exist in the present rather than the future

graceful zephyr
#

easier in a physics driven stuff

#

prediction with instant acc/deacc

#

is always hairy

jade glacier
#

yeah, RocketLeague is a bit of a marvel.. wouldn't make that my first networking attempt

#

its also messy

#

even at its best

#

How does Quantum deal with hard events like weapon fire btw @graceful zephyr since you can't really resim those?

#

like once a gun goes bang... you can't really change that, the player has seen/heard it

graceful zephyr
#

we have event cancellation, we can tell you if you wrongly predicted an event so you can do a graceful fade out of audio/visuals/etc

jade glacier
#

ah, interesting

#

Seems like that would be one of the edge cases where FPS type games would really get tricky for you guys to code for

#

I guess worst case for that is you hear/see an extra gun blast - that just doesn't do anything

gleaming prawn
#

that's pretty rare though

#

but yeah, leads to no simulation desync, and as for false-positive feedback, we give canceled/confirmed callbacks for our event pub/sub API (which is the recommendation to inform the "view" of stuff that happened now)

#

reliable events, false negatives and duplicates were all handled even before we added canceled/confirmed

jade glacier
#

smart

high night
#

This is what i was talking about,
No more prediction of other players' inputs this time.

However i predict the velocities just like any other rigidbody
So can still see into the future a bit.

#

I predict all rigidbodies and all objects (also run behaviour update for all objects)

#

but i don't predict an input for a missing input from another player

#

.
Does this look right?

#

I both move in server and client, you can see which one i control by me clicking on screen

#

.
left is client, right is server

#

.
no interpolations yet though

gleaming prawn
#

Being honest? I'm used to quantum, no it does not look right... Even the distances are off...

#

as you add internpolation, it would look ok-ish as long as you don't compare the two screens

#

But it's still not getting anywhere good IMHO.

#

Don't get me wrong, I think it's GREAT that you are trying for real

#

And showing it so others can give a few ideas... That's one way to learn (a good way I'd also say)

high night
#

distances wouldn't be off in the previous gif

since is was feeding the last recieved input

as long as i kept pressing the button for more than a tick delay

gleaming prawn
#

Getting hands dirty with code... Always good... But after some more experience you'll understand that what Fredrik said is the right way to do (for server authority approach)

high night
#

server is the authority over everyhing in the gif you see

#

What makes you think it isn't?

gleaming prawn
#

I said: after more time you'll see that the CORRECT approach for server authority is what Fredrik said

#

I'm not saying server is not the authority

#

I'm saying it looks really bad from a synchronization perspective

#

And this is your sample test, not even a real case... You prepared for this case

jade glacier
#

You already have my answer. Make a standard snapshot interpolaiton server authority model, with player prediction... get that working. Then get creative.

gleaming prawn
#

I disagree just with the above...:)

jade glacier
#

which part?

gleaming prawn
#

I think it's cool that you are getting hands dirty instead of just talking BARGOS

jade glacier
#

Oh, thought you were disagreeing with me

high night
#

@gleaming prawn It's 10 hz tickrate plus 150 ms of prediction

could that be why you think it's looking bad?

gleaming prawn
#

In that he should immediately implement a standar snap-interpol

#

Yes, I'm disagreeing with you emotitron... lol

jade glacier
#

I think if he is doing a variant of that, he should get something working first

gleaming prawn
#

no, I think it looks bad because the distances were off. And we know from experience that your approach is not adding anything good

high night
#

i don't think my implementation is similar to snapshot interpolation

jade glacier
#

I would start with some model that works, and then creatively tweak from there for a first networking effort

gleaming prawn
#

you are doing a variation of snap-interpol

#

you are doing snap-extrapolation

high night
#

i am trying to do a state-syncronization

jade glacier
#

I wouldn't get creative until you have completed a working system of any kind... imo

#

snapshot interp IS a form of state sync

gleaming prawn
#

this

jade glacier
#

the snapshots are the syncs

high night
#

i sent velocities,
and when i resimulate over the last recieved state

i get the future

#

but you just show the past

#

except for local player

#

i predict everything

jade glacier
#

sending velocities is more of sugar, that you can use to EXTRAPOLATE stuff better

high night
#

looking at the velocities n stuff

jade glacier
#

but careful with the terms, predict and extrap have different meanings in networking circles

high night
#

I don't want extrapolation, i like simulation

#

I want to build a game with melee mechanics @jade glacier

jade glacier
#

Buy Quantum ๐Ÿ™‚

high night
#

something like mordhau/chivalry

#

not as much tho

#

I really think i have control over what i am building ๐Ÿค”

jade glacier
#

Why are you sending velocities, if you are not extrapolating states?

high night
#

because what if the object bounces back

graceful zephyr
#

what you are implement is client side prediction with server authority, server then sends correct state down to client and client extrapolates for remote objects and his own based on his input

high night
#

from something

#

@graceful zephyr yes, but extrapolation is archieved by simulation

#

rocketleague style

graceful zephyr
#

doesn't matter how extrapolation is achieved

#

the only difference between snapshot interpolation and state synchronization is that SI interpolates between two known values, and SS extrapolates based on known values and then uses visual smoothing techniques to hide the prediction error (if any)

jade glacier
#

you are employing some means to "guess" where things will be, and as such you will need to constantly be resimulating as new info arrives.

graceful zephyr
#

no matter it doesn't look smooth and correct in the gif you sent @high night so idk what ur doing ยฏ_(ใƒ„)_/ยฏ

jade glacier
#

Does State Sync commonly mean that you attempt to align the timeframes? Just so we are all using the same terms @graceful zephyr

graceful zephyr
#

that's a different problem, state synchronization generally just refers to syncing full object state + extrapolate

#

instead of sync smaller object state + interpolate

jade glacier
#

State Sync to me just always has mean that an authority creates a state, and shares it with others.

graceful zephyr
#

that's ~kinda the definition

#

i mean there isnt any proper terminology defined here really

#

so

#

ยฏ_(ใƒ„)_/ยฏ

#

there isn't an official 'name' for anything

jade glacier
#

regardless of interp/extrap... but if that is not the case I will revise my terminology usage

#

yeah, kind of just agreeing here is all

#

so at least we all are using the same meanings

high night
#

@graceful zephyr are you saying that because i don't interpolate the last result from prediction?

graceful zephyr
#

i have no idea what u r doing

#

but it looks jittery and stuttering

high night
#

client sees server update every 15 frames

graceful zephyr
#

on both sides

high night
#

thats probably why

jade glacier
#

But as fholm is saying... how you predict/extrap the future doesn't so much matter. what matters is that if your model is trying to put the player into the present, it does it by guessing and that requires constant resims

#

Which I personally think is diving into the deepest end of the pool for a first attempt... but that is me

gleaming prawn
#

This is at 30Hz simulation:

jade glacier
#

doing a state transfer every 15 frames is going to be messy regardless. 15 frames in a non-deterministic sim is a lot of frames for things to go off the rails with bad guesses

high night
#

I'll figure out a way to smooth the last result of prediction and display it, remove visuals and both of the simulations,
and then i think you'll see what i mean

#

@jade glacier was just trying to show the worst case

jade glacier
#

Yeah, I would say just go do what you are trying to do. You already have all of our opinions and advice.

graceful zephyr
#

15 frames is really low

#

30 hz network rate is probably minimum for a decent competitive game today

#

most want 60 if its a few player game

#

hell my 20k CCU MMO backend targets 20hz minimum

high night
#

oh wait that was 10 hz

#

sorry

#

tick each 15frames is wrong, that makes a different hz value

#

i send tick every 5 frames

#

i probably will increase it to 20 hz

weak plinth
#

are these transforms move inside a 3d grid ? @gleaming prawn

graceful zephyr
#

no just very simple movement system ๐Ÿ˜„

#

4 directional

weak plinth
#

so grid layers ?

graceful zephyr
#

no i mean only WASD

#

up/down/left/right

#

or w/e

jade glacier
#

What's the latency/loss rates about for that vid? @gleaming prawn Looks in very in agreement

graceful zephyr
#

think its just a local test

#

like 25 ping or something

jade glacier
#

someday I will have time to actually play with Quantum. Its fascinating.

gleaming prawn
#

@weak plinth that's a fully 3D KCC working with slopes/steps/surface tangent movement over a Triangle Mesh + Primitives (boxes, etc)

#

movement input is WASD + Jump

#

There's also melee attack with that hammer + pickup/drop dynamic bodies in this demo. Just found this video.

#

This video shows two clients side by side. Let me grab a newer version of this same system on a slightly more interesting setting..:)

weak plinth
#

you should try a test of max players possible, sending only inputs and let the clients simulate everything should let you get high capacity

jade glacier
#

I would be most interested to see it handling the uglier edge cases, like missed attack guesses and such.

weak plinth
#

and you said you cull by distance? so even better

jade glacier
#

@weak plinth It only sends inputs, its a deterministic system

gleaming prawn
#

Player cap is game dependent GCat

#

We have games live with 32 players on mobile...

#

we have customers testing with 64 players, which is our hard-cap for current SDK version (lifting to 128 for next one)

#

It pretty much depends on how fast the game is, how expensive the simulation is, the target hardware min specs, etc

weak plinth
#

old machine can run 1k moving entities like starcraft

#

so why not getting near number like that

graceful zephyr
#

1k entities != 1k players

#

the bandwidth for 1k players is massive

gleaming prawn
#

1k moving entities, as long as you:

  • do not rollback at all (RTSs use lockstep)
  • run at a somehow slower frame rate (these you mentioned run at 10Hz, or so...)
  • use a navigation system designed for many many units (like flow fields)
weak plinth
#

but you just send inputs

#

and you cull

#

rest is the cpu simulating

gleaming prawn
#

RTS do not have 1k players

#

they have 1k ENTITIES

#

We do not cull input

weak plinth
#

ah

gleaming prawn
#

Maybe you are misunderstanding a basic fact here

#

RTS are normally 4-6 players

#

with up to 40k simulated entities, etc

#

Quantum can be used for these just fine... Although they require some GENRE-specific pieces we're not pursuing due to lack of interest from customer so far (like flow field navigation)

jade glacier
#

Keep in mind as well that to be deterministic all simulation is fixed point, no floats allowed.

gleaming prawn
#

Most customers are leaning towards twitchy gameplay more than strategic

weak plinth
#

sure, i thought you had culling for the input by player distance, so only send input of players near them let them simulate the stuff, when meet a player from far then send snapshot of their stuff and continue simulation from there

gleaming prawn
#

there's no way to cull input on a deterministic system

#

By definition this is impossible

jade glacier
#

I'm only half watching this, but seems like @weak plinth you might not be following what Quantum is?

gleaming prawn
#

You can only do that on State Transfer systems, not on purely input based deterministic ones

jade glacier
#

when meet a player from far then send snapshot of their stuff and continue simulation from there That is not a thing in deterministic

weak plinth
#

k

gleaming prawn
#

That is state transfer or snapshot interpolation.

#

You do not need determinism for that...

jade glacier
#

And you can't splice that into determinism, the states would be enourmous

#

I think you can do a state transfer to get caught up as a late joiner though? @gleaming prawn

#

Or do you just resim all of history?

gleaming prawn
#

Determinism gives a lot of OTHER advantages:

  • straightforward killcam and full match replays;
  • authoritative result validation from input stream (without the need for a live server running the sim);
  • testability;
  • 100% accurate collision detection + 0-lag physics simulation
weak plinth
#

fholm said disconnected players can get snapshot of verified frame, so why it would not work also distance based

gleaming prawn
#

Yes, Quantum supports full one-time state transfer for Late-Join/Reconnects, both from a buddy client and from the server (in case you are running a live sim there)

weak plinth
#

i thought the all point is its not traditional lockstep

gleaming prawn
#

because snapshot transfers use bandwidth

#

And that's the whole point...

weak plinth
#

you dont meet new player every frame

gleaming prawn
#

quantum is NOT traditional lockstep

weak plinth
#

one time

gleaming prawn
#

It's predict/rollback

#

With server authority for input (so you never wait forever)

jade glacier
#

there are two different things in play with what you are talking about. The ACTUAL state (final and real) requires a complete simulation of all inputs and all entities.

There is the cosmetic side that can do partial sims, for the "guesses" that make up the extrapolation - is my understanding of it @weak plinth

gleaming prawn
#

I think you underestimate how complex this whole problem is...:)

#

40 years of game dev experience pretty much resulted in these basic frameworks: deterministic lockstep, state transfers, snapshotting, deterministic predict/rollback... It's difficult to summarize in one discussion why the small details apply.

#

you do variations, etc

jade glacier
#

But for the love of god... people should start with one that is known as a starting point ๐Ÿ˜›

gleaming prawn
#

Quantum is a server based deterministic predict/rollback (on steroids because of all the features we give out of the box from the past few years working on it).

high night
#

Is there a math library for c# that you can use for deterministic math calculations
Something that has all the operations in unitys Mathf
Something that does all the floating operations in the lowlevel as integer operations i mean
Not that i would use it now but just wondering
My googling didn't get me far on that

jade glacier
#

That is one of the difficulties @high night

high night
#

What would be the difficulty?

gleaming prawn
#

There's no point in using "determinism" to simulate a partial world when just ONE bullet traversin in could break the whole thing @weak plinth

jade glacier
#

Why would it be difficult to make a math and physics lib that doesn't use floats?

weak plinth
gleaming prawn
#

that's why you either go full determinism (no need to transfer all the time), or state transfer/snap-inter (transfer frequently)

high night
#

Oh
I wasn't talking about physics though just for regular Mathf. operations

gleaming prawn
#

FP math is public domain

weak plinth
#

fine erick, just was an idea, got my answer

gleaming prawn
#

You can find Q48.16 C# implementations anywhere

high night
#

@weak plinth thanks

jade glacier
#

the fixed point math though by itself won't get you far, since you need your simulation to be all FP... which means fixed point physics

gleaming prawn
#

yeah

#

don't tell me about it

high night
#

if you don't have physics?

#

you could do AABB collisions n stuff

weak plinth
#

it has also physics

gleaming prawn
#

Better said then done

#

Trust us

weak plinth
#

download the example and use as is @high night

jade glacier
#

if you can reduce your sim to all fixed point and ints... then you are golden yeah

high night
#

hmmm interesting @weak plinth

gleaming prawn
#

You WILL need some form of physics, navigation, etc

#

you say: just do AABB... well, yes...

weak plinth
#

but it won't work with instant movement like in the quantum example, will have to wait after each click

jade glacier
#

at least golden until you start dealing with how to make your extrapolation work with constant resims, and the cosmetic mess that creates

gleaming prawn
#

Implement that, add a broad phase, add callbacks, add a solver (if you need movement), implement different shapes...

#

Add raycast and shape queries... HEY you are implementing a physics engine...:)

high night
#

i see what you mean

gleaming prawn
#

will have to wait after each click
That's traditional lockstep, yes

jade glacier
#

You can cheat and use floats on the cosmetic side.. but they can't infect your states in any way.

gleaming prawn
#

Welcome to what I spend most of my days at @high night

#

Implementing physics

high night
#

Don't you use quantum?

#

you mean before that?

jade glacier
#

Game networking is all about the simulation.... not about the messaging. He writes Quantum with fholm @high night

gleaming prawn
#

I'm one of quantum developers

high night
#

oh, nice

jade glacier
#

They solve this stuff so we don't have to ๐Ÿ˜›

#

aight, enough chit chat. I have my own hacky netcode to complete ๐Ÿ™‚

#

and wife wants breakfast.

high night
#

@weak plinth Is there a lockstep mit lisence framework that includes 3d physics?
This one is 2d physics only

gleaming prawn
#

there you go...:)

#

AFAIK, No

weak plinth
#

you build rocketleauge like game ?

high night
#

I haven't completely decided on what kind of game i want to build yet

#

Something with many 3d rigidbodies though (as many as i can have)
and explosions

gleaming prawn
#

you realize you are starting with the most complicated thing of them all, right?

#

Synchronized physics, 3D...:)

#

That's one of the "holy grails" of networking

weak plinth
#

he will release his asset in few days check it out if with will be worth it for your game

gleaming prawn
#

this looks cool

high night
#

hmm, so this is lockstep too?

weak plinth
#

nope

#

don't think so atleast

gleaming prawn
#

It probably is

high night
#

i mean deterministic physics? don't know how it may be archieved

gleaming prawn
#

if it's a rollback one without a server, fine for a few game clients probably

#

i mean deterministic physics? don't know how it may be archieved
You write your own, with FP

weak plinth
#

and if you get the same results your player won't give a fuck if its deterministic

#

just to keep on your mind

gleaming prawn
#

if it's determinsitic?

#

By definition you DO get the same results

#

If it is

#

Where do you have info this guy will release anything?:)

weak plinth
#

talked to him, smart guy

#

donnu if will deliver but more options for us none networking guys

gleaming prawn
#

oh nice

graceful zephyr
#

lol im mentioned like 4 times in that thread

gleaming prawn
#

This is NOT a determinsitic system

graceful zephyr
#

no its not

weak plinth
#

@graceful zephyr cuz you are like a networking guru

#

who said it is deterministic ?

gleaming prawn
#

Funny

#
No, A lot of time was spent in this area looking at all the other solutions on the AssetStore, I chose a different path for physics. The players will set their Ridged Bodies off the host / server will control all of the physics and or movement.Put your application into headless mode for the server/host not sure what its called now but I remember 4.6 if you know about Fholm more then sure you were around then.
#

Not deterministic, standard state transfer / snapshot... Cool stuff though

#

BARGOS was asking for 3D determinsitic physics

high night
#

yeah

gleaming prawn
#

Then you showed this as the solution to him...

weak plinth
#

i said if to the players it looked synced then it doesn't matter to them if it is deterministic, only to people who love the technical stuff

gleaming prawn
#

๐Ÿ™‚

#

It doesn't have to... no... But for physics it's normally the simplest way to have it 100% accurate and twitchy

#

"simplest" if you have a framework, of course

weak plinth
#

@high night you only want deterministic ?

gleaming prawn
#

What I said as this being the holy grail is that networked physics is NEVER simple

weak plinth
#

then my bad i though you wanted any solution

graceful zephyr
#

tbh i wouldn't jump on using some small solution develoepd by one guy on the forums, nothing bad or anything

gleaming prawn
#

He wants to do a 3D game with lots of dynamic bodies and explosions, this is networked physics...

high night
#

Just wanted to know there was such a thing under mit licence and as a small framework

graceful zephyr
#

but it's gonna be full of bugs, etc.

#

note that while both lockstep and predict/rollback are both deterministic, MOST deterministic C# stuff out there will only work for lockstep

#

which doesn't really work well for an action game

weak plinth
#

tbh i wouldn't jump on using some small solution develoepd by one guy on the forums, nothing bad or anything
@graceful zephyr heh bolt ?

graceful zephyr
#

sure, but bolt was buggy as hell in the start

gleaming prawn
#

Yeah...

weak plinth
#

but sure if you made bolt 2 i would be on it in a second

graceful zephyr
#

yes but i already have a proven track record now

gleaming prawn
#

This is cool... Something in town to replace Mirror?

weak plinth
#

true

graceful zephyr
#

ยฏ_(ใƒ„)_/ยฏ

weak plinth
#

don't want to say i'm a fan but i'm, bolt source is like a book

#

too bad now everything you make belongs to exitgames

gleaming prawn
#

Hope it has a proper good approach, and not just asset store mambo jambo for non-programmers

weak plinth
#

but gotta make a living i guess

gleaming prawn
#

we all got to

#

one way or another

jade glacier
#

Please no more messaging layers. Someone complete a stack already.

gleaming prawn
#

He did yet another one, yes

#

Including this spooky thing: :)

Also I forgot I dont use a window slider for the reliable layer so there is that.. Happy figuring that one out to all networking developers :p
jade glacier
#

wrapping messaging into RPCs, syncvars etc is fun and all... but its not needed

weak plinth
#

he will release source so we will find out

gleaming prawn
#

under licenses... AFAIK

#

which I think is 100% fair

#

So I will NOT see the source...:)

jade glacier
#

you will hear about it I am sure

#

but from all that is being said there, it sounds like a variant of HLAPI/MLAPI/Mirror

graceful zephyr
#

like this is... some type of magic lol

#

that's easy as shit to do

jade glacier
#

I'm not opposed to syncvars in theory, but they have to be how I am handling them for SNS, which is tie them to your tick/snapshot engine

#

having your monoBs spewing out Write()s in a completely undeferred way, is just going to burn people.

#

What is a "window slider?" @graceful zephyr Something in Unity I completely missed?

graceful zephyr
#

i assume he means a sliding window

#

i.e. what you do with sequence numbers, send window, etc.

#

that he did reliability without a sliding window... that's not very hard

jade glacier
#

I somehow have gone this long without ever hearing that term

gleaming prawn
#

yep...

#

not very hard, you trade of bandwidth and do it like ENet?

#

or you do like we do in quantum for inputs...

#

Sliding window is just efficient in certain cases...

jade glacier
#

ahh, is this more transport layer stuff? I am pretty clueless about that stuff.

#

ah yeah, its relating to reliable UDP... for my systems it has always been ack-less so totally slipped by me.

graceful zephyr
#

yeah its related to transport / reliable udp @jade glacier

jade glacier
#

yup, I did some quick reading on it. Pretty straight forward concept.

elfin jolt
#

Is this channel only for Networking outside of NetCode (DOTS). New to the Discord so trying to see if I should keep all DOTS/ECS related questions in that channel, or go to more specific channels.

jade glacier
#

All networking code, but there aren't may in here with much working knowledge of DOTS. Never hurts to ask though.

#

If the question is more about networking theory, this channel will be better - but for DOTS specific questions, prob better to ask there.

gleaming prawn
#

It's not that this channel is outside of dots

#

The fact is that dots networking is not even nearly close to being usable in real production grade games.

#

Nothing against discuss networking in a dots based approach... It's just not ready as a framework

jade glacier
#

Most questions in this channel are fielded by Exit peeps. Unity doesn't have any community support people in here - so you are pretty much limited to help from others who are also playing around with Netcode. I think the DOTS chan would tend to yield more answers on that front, just because of the number of active bodies.

elfin jolt
#

๐Ÿ‘

weak plinth
#

Does anyone know if the snapshot interpolation of the Unity dots netcode is reliable? so if i set an bool for only 1 update cycle, will it be received 100%?

high night
#

120ms second ping and no packet drop

Predictions are 150 ms ahead of servers reliable sim

10hz send tickrate
50hz simulation

#

Did that smoothing i was talking about, that will be as good as it gets

jade glacier
#

I assume you are running the misc boxes as non-kinematic and you are applying the same inputs to the player on both there. That should hold together since you aren't dealing with any late/lost user inputs or different machines running the sim. You are basically doing determinism right there.

#

But the system itself isn't deterministic, so you are going to need to test how that falls apart when your TCP packets logjam and arrive too late

#

And how it appears on a second client

high night
#

@jade glacier i send states every tick

#

this handles packet loss, i just tested

jade glacier
#

Ah, so this is now snapshot interp?

#

or extrap it sounds like

#

with snapshots every tick, you should be able to get that into a usable state yeah

high night
#

server state recieved
rollback prediction scene back to servers state
resimulate prediction scene forward for 150ms
set lerp targets to new positions

#

@jade glacier yes i guess

jade glacier
#

That is much more sane, seems workable

high night
#

but theres more

#

to handle effects

#

let me put the model to the next level which is a little more complicated

#

i send inputs, but you dont see their use in this gif

#

it wouldn't matter if server didn't send inputs, gif would be the same

#

but heres what they are for

#

.

server state recieved
rollback scene back to state **before** the state server sent just now

resimulate scene for a tick with servers inputs  ****
resimulate scene for another tick with local inputs
total simulation : 300ms

set lerp targets to new positions
jade glacier
#

If you are extrapolating with them, yeah - they are useful

high night
#

not extrapolating

jade glacier
#

similar meaning in this context

high night
#

at the * * * * part, all the effects, sounds are created that local client didn't know about

jade glacier
#

I avoid the use of the term predicting because it implies something else in state transfer

#

but there are no hard defs, so extrap and predict are kind of overlapping in meaning here

high night
#

yeah sorry about that

jade glacier
#

you aren't wrong, I just am avoiding using prediction in this context

high night
#

fixed it

#

i wont ever need to tell anything about which bullet spawns in which direction

jade glacier
#

You are going in a Rocket League like direction there

high night
#

thats the point of all this

#

if bullet is just an effect i mean

#

and you are doing hitscans

jade glacier
#

Generally you shouldn't have to give bullet origins and vectors in any system, they can be inferred by the shooters state yeah

high night
#

player look is already given in inputs

#

and its from the server so reliable

#

see what i'm doing?

jade glacier
#

The only dicey part is if you are allowed to predict weapon fire

#

like if the player holding down the fire button = continuous fire

#

Then you do have to deal with cleaning up a bad prediction that said the player fired, when they have not

high night
#

i believe with this system i got, all sounds will be delayed by 150ms

#

i will play the sound immidently on that * * * * line

#

and wont keep track of it ever again

#

and wont predict holding down trigger

jade glacier
#

If you aren't trying to time align your sounds and effects like that, you may as well just trigger the effects as soon as the server state arrives

high night
#

yes

jade glacier
#

That may feel a bit odd, but only will know if you try

high night
#

if player shoots 5 bullets in 5 frames and sends one tick,
all 5 bullets will be spawned in same frame right now

#

but i might deal with that later

#

its better if i paced them out a bit

#

could introduce a delay which depends on which frame of the tick it occured and that would be it

jade glacier
#

yeah, that just involves making masks and such in your serialization that you use as part of your snapshot mechanism. It will be messy with what you are doing, since your fire effects are all a bit detached from the state consumption.

high night
#

this is only for detached things

#

if i have a grenade, it will be a network object

#

just like a player is

#

serialable n stuff

#

but character doing the throw animation will be figured just like effects are in my system

weak plinth
#

I am having a problem with Photon PUN2: when using InstantiateSceneObject method, the IDs of the instantiated objects are not same across clients....

#

The call looks like this, and is only called on the master:
GameObject newBot = PhotonNetwork.InstantiateSceneObject(currentPrefab.name, spawnptV3, Quaternion.identity, 0);

#

Prefab is in Resources folder. Object gets instantiated on both master and client, but view IDs are different, and this is causing other problems. I noticed with the inspector, when running, that the object on the master is NOT owned by Scene, which also seems wrong....why would this be? I wouldn't think it possible to have an object created using InstantiateSceneObject to be owned by anything other than Scene.

#

I can work around this problem by placing static objects in the scene instead of using InstantiateSceneObject....then I can finally stream messages to change position and what not...but I don't really want to do it this way, it's kind of cumbersome. I have spent days googling for a solution....the closest thing I have found is the Asteroids demo, which seems to work properly using InstantiateSceneObject....but after examining the code, is not apparent what I might be doing differently that is causing InstantiateSceneObject NOT to work.

#

anyone his a project that i can work on.

jade glacier
#

@weak plinth I have had occasional issues that actually were just because when I tried to create/join a previous game would still be up and running, and it would be joining that.

#

You can test for that by changing the app version in PUN's settings and see if it persists

#

Regardless, if it was that - the problem should vanish after not starting a game for like a minute

weak plinth
#

but even if it was somehow joining a previous game.....the scene object is spawned in both clients I test when the method is called....so at least the objects are in the same room....

#

it's just that the ID assigned are different

jade glacier
#

@stiff ridge Might have some ideas - he is the PUN2 specialist - though he is on Germany time

weak plinth
#

ok....do you think's OK if I leave a DM for him, asking for help?

#

or just wait for him to respond here?

jade glacier
#

He will notice it when he is on next

#

best to keep it public, so others who are doing this stuff might see it.

#

I personally ignore most PMs for that reason, not to be rude, but because the whole point of the pub chans is everyone can see and contribute to convos.

#

Like I would like to see what he has to say.

weak plinth
#

ok, thanks for the advice!

lost herald
#

Ive been wanting make my game dedicated, but gamelift is not compatible, so I dont know much ๐Ÿ˜ฆ Im really confused, ive been really demotivated since then

#

If someone can guide me I would appreciate it a lot, Ive been off the game for a couple months, and I really wanna come back.

gleaming prawn
#

What is the question you have?

gaunt zealot
#

it sounds like he wants to set up a dedicated server

lost herald
#

@gleaming prawn yes I want to setup a dedicated server but im a solo dev and im pretty lost, it works pretty well with photon PUN, but to switch to dedicated servers i need guidance

#

I want to know what is better for my game, i tried gamelift but its not supported with the unity version so thats not gonna work

gaunt zealot
#

probably best if you just set up your own sockets

lost herald
#

sockets?

#

sorry im very bad at networking

#

i was lucky enough to setup photon, i know what rpcs are and photon related stuff other than that im clueless

gleaming prawn
#

If you use photon, why do you need dedicated servers?

#

I mean, if you are using photon bolt, than it would make sense

#

But I assume you wrote the game with pun, in that case it doesn't make much sense to try to run a pun client as a dedicated server, it would be wrong in many levels. Primarily the clients would always use photon relays and that would make things bad for no reason.

#

But you said yourself: I'm bad at networking... It's difficult, to say the least, to develop a multiplayer game without that.

#

Try to ask a very specific question, maybe someone can help

gaunt zealot
#

@lost herald you might look at tom weilands stuff on YT

stiff ridge
#

@weak plinth : Are you around?
I would have to test but by all means, the IDs should be the same. As only the master client should be able to use InstantiateSceneObject, it's not a case where you call it on all clients alike.

#

I think we'd have to take a look at a repro.

#

I noticed with the inspector, when running, that the object on the master is NOT owned by Scene, which also seems wrong.
This is likely a confusion by the inspector. Each networked object is controlled by some player. Including scene objects. The master client typically controls scene objects and maybe the editor then shows it as "mine".

#

Make sure the prefab you instantiate is referenced correctly or in a Resources folder.
In doubt, I would check the prefab's PhotonView. Remove it and add a replacement, if you think anything could be "stuck".

#

Or: Use a new, very simple prefab with just a PhotonView on it to test with.

#

For me, the viewID is matching...

lost herald
#

@gaunt zealot What do u think about Photon Server?

#

Im probably just gonna hire someone to do the multiplayer stuff for me

stiff ridge
#

Is there a specific reason why you want dedicated servers? What are the benefits you need?

#

By the looks of this, Photon Bolt might be best suited. Dedicated matchmaking servers but players host matches in Unity and others connect directly.
Great features for shooters.
A steeper learning curve than PUN but also more powerful.

lost herald
#

@stiff ridge but what about hacking

gaunt zealot
#

I really enjoyed using PUN back in the PUN1 days..... but the relay server adds too much additional latency

#

so instead of figuring out some solution

#

I decided fuck multiplayer

#

and my lifes been better since

#

๐Ÿ˜‚

stiff ridge
#

@lost herald : In Photon Bolt, one client is authoritative. It can be hacked, for sure, but you can gradually make it harder.

gleaming prawn
#

@lost herald Photon Bols is as authoritative/hack-proof as a tool can be...

#

You can host dedicated servers (unity headless instance) or one of the players can be the authoritative listen server

wanton scroll
#

Anyone willing to answer a quick question about PUN2 and how to make a damage RPC ?

jade glacier
#

If the shooter is the one you are giving damage authority and you are not making any anti-hacking attempts - the shooter would message the target' object on the owners saying "I hit you"... that owned version of the target would modify its health accordingly, and the health system would broadcast that to all. @wanton scroll

spring valley
#

Any Firebase Users?

weak plinth
#

thanks @stiff ridge .... prefab is in the resources folder, as I already mentioned....I think I will have to make a small test project that exercises this issue, and if it continues to have the same problem, I will post the code somewhere for you. About the inspector: everywhere else i checked, including the Asteroids demo, showed the owner for scene objects as 'Scene', even for the master client. Only in my project, where the IDs are not matching, did one of the owners not say 'Scene'.

jade glacier
#

That's usually the ideal, if you can make a small repo that causes the problem, makes it super easy to either find the bug in your code or in the library. @weak plinth

urban jackal
#

hello, i'm try to map vector2 to an int. then i have a little problem at my code that i cant debug it! please check this 3 files and help me

#

i have 0.3 error. whos can help me? (if you want to check code, please open tests file first. because there is some other functions at "GridCalculator.cs", that not used at [test]s file.)

#

at next level, it is vector compression, to send vectors over network.

#

sry ,test fail when x ~= 99.9f

jade glacier
#

can you just make use of vector3int for all of your simulation and never let it go to float? @urban jackal

lost herald
#

@jade glacier but cant i just host a dedicated server to it then? so nobody has authority of damage and health

jade glacier
#

post your code btw using like hatebin.com, rather than posting files that need downloading

#

There is no dedicated server with PUN2, unless you are making plugins for the relay

#

PUN2 is a bit different from most of the libs, in that its relay based. The server is just a message conduit between clients. It doesn't host any game logic.

#

Assuming you are still talking about PUN2 and not Bolt now? @lost herald

lost herald
#

photon bolt

jade glacier
#

ah, then disregard that answer

#

For Bolt that is the expectation, that you will be coding it all as server authority. Most of what Bolt is based on making server authority work. Its architecture is the same as CS:GO

#

I missed earlier discussion though, so I don't think I know your actual question @lost herald

lost herald
#

I already have a multiplayer game running client hosted with PUN 2 but its very unsafe to release since client hosted has bring lots of issues like hacking, delay etc depending on the host so Im looking for a solution if I should switch to Photon Bolt or try Gamelift but gamelift is uncompatible with my unity version

#

so Im very lost now

#

Ik the basics of PUN 2 and stuff but for dedicated server im lost

jade glacier
#

If its in Bolt you should be able to just host it on a game hosting service that lets you host Unity game instances. I don't know what those are, but they definitely exist.

#

PUN2 won't be an option, since you are that far along with Bolt. Changing libraries this late in the game is hard enough, but you are talking about leaving Bolt - which is the most complete HLAPI there is for this stuff, so you would end up having to completely rearchitecture your game when giving that up.

#

Anyone in the Bolt discord able to give any tips on how to host?

lost herald
#

Im not in bolt rn, im in PUN 2

#

I wouldnt mind switching to Bolt if its better

jade glacier
#

Ooooh, thought you were saying you already were in Bolt.

#

Totally different animals. Bolt is a complete Server Auth statck, so it does a lot more for you... but also restricts you a lot more.

#

I would give yourself a few days to go make a tutorial with it and just see if it seems like a fit.

jade wharf
#

If i may butt in, your client and server should be able to be ported into anything. If you are making your own network solution

jade glacier
#

If they are built currently for a client authority model with relay servers, its going to be quite a bit of work to move to Bolt.

#

Bolt wants to take over your controllers and physics in order to provide rewind and resim, so its more than just changing the messaging layer, its switching from any handling for desync from your own rolled stuff to Bolt's

jade wharf
#

Probably why making your actual game being completely separate from the networking api is an importance

#

Takes a lot of work to change the actual code instead of using an interface

jade glacier
#

Fo sho, or fully committing to your HLAPI, which means really being sure its going to not fail you down the line.

#

You don't port away from Bolt, but its has a lot of proper shipped titles and is trusted... so as long as what it does matches your needs - worth getting entangled.

jade wharf
#

I thought hlapi was already removed explicitly and delegated to a package

#

?

jade glacier
#

I mean HLAPIs in general

jade wharf
#

Right..

jade glacier
#

stacks that force you to hard code to them

#

though ironically HLAPI is not a HLAPI

#

its just a messaging layer

jade wharf
#

Bolt was made by a guy i looked up to when learning networking so investing your project in that i wouldnt disagree with fo sho

jade glacier
#

its fholm, he works on Quantum now. Is active in this channel

jade wharf
#

Ah gotcha, i thought UNET was the hlapi

#

Oh hes still active?

#

@graceful zephyr hemlo

jade glacier
#

They called the transport LLAPI, and then misnamed the next layer HLAPI... I think expecting to one day make it a complete stack. They never did.

jade wharf
#

Rip

jade glacier
#

very active, have no not talked to him in here many times?

jade wharf
#

Unity didnt have some insane network devs did they, i dont even know of the ones there now

jade glacier
#

He and Erick were pretty much most of the channel convo this AM

jade wharf
#

I think its time zones preventing me from ever seeing him online

jade glacier
#

The issue is that HLAPI, PUN2, Mirror, Forge, MLAPI try to complete the stack, but since they have no simulation/state/input control they really are just messaging layers.

#

Commands/RPCS/Syncvars are nice wrappers for new users to not get buried in the serialization process. And the assigning and managing NetObj Ids is nice... but they all avoid the actually hard work of simulation.

jade wharf
#

I remember when i was fucking with syncvar and got SO confused

jade glacier
#

Which is also why they are pretty interchangable and abstractable

#

Syncvars are troublesome because of the timing mechanisms of the libraries. They write to the message buffer adhoc, with no handling for deferment or tick alignment or deterministic order.

#

So for complex games that try to make MP with those things, they tend to get buried in race condition hell.

jade wharf
#

Thats what i went through

jade glacier
#

yeah, its unavoidable

#

that and without it being tick based... good luck getting a smooth interpolation of anything every happening

jade wharf
#

โ€œWHY IS MY Y DIFFERENT THAN MY X

#

REEEEEEE

#

That day i stopped using unet

jade glacier
#

proper networking is about creating a very strict simulation, with very strict division of timings

jade wharf
#

It made me so mad because i didnt identify the problem immediately