#archived-networking

1 messages ยท Page 44 of 1

earnest wave
#

any more info on this Set Value method?

#

docs or something?

jade glacier
#

He just means make your changes through a method that also sets your dirty flags I believe

#

Not an actual PUN built in thing

#

you wouldnt want that anyway

#

the concept of "dirty" is really on you and your data design

#

So don't just change values, change them through a property or a method that also sets your dirty flags accordingly for the change made

earnest wave
#

ok yeah i'm doing that

#

i realize bitshifting would be a cleaner way to pack/unpack bits here but to me this just makes more sense so for now, is this a reasonable appraoch to OnSerializeView

jade glacier
#

I have a writer for that if you want to just use mine

#

literally can bitpack right into and out of a byte[]

earnest wave
#

maybe i will here when i'm a little more settled down

#

thanks

#

for now just trying to slog through the meat of it

#

i'll suss out the details later, as long as them bits get packed /unpacked i don't care if theres some extra if()'s in ther efor now

#

really just... so frustrated by this right now

#

its hard to explain how much pressure i'm under to make this game real, finished, and successful

jade glacier
#

yeah, that's a bad idea

gusty pumice
jade glacier
#

where is that pressure coming from?

earnest wave
#

oh amnod thanks, whoops

gusty pumice
#

yw

earnest wave
#

emot poverty, desperation

#

general hopelessness

gusty pumice
#

๐Ÿ˜„

jade glacier
#

yeah, networking is not the place to put your foot into the pool for that @earnest wave

#

I'm 2 years into it and only now feel like I am qualified to make a proper game

earnest wave
#

well i've done a bit of multiplayer networking before

#

with unity's library, and i wrote client/server for flash games years ago

jade glacier
#

ahh, nm then

earnest wave
#

i just... can't finish anything

jade glacier
#

yeah, that's networking

earnest wave
#

my attention span is a real struggle

#

it's why i'm so OCD about this stuff

jade glacier
#

Main thing is to not drown in the big picture

#

you need to be aware of it, but when coding you code VERY small parts at a time

#

The goals thing... can't help there. That's just ADD in general

earnest wave
#

do i have to make changed data as dirty explicitly with pun somehow?

#

the code snip i pasted earlier is working now with reliable on change but only the first time a non master client picks up a stone

#

after that, no update.

#

i'm using an array of custom data types that I defined and registered and am successfully serializing and deserializing

jade glacier
#

nice

earnest wave
#

thanks

#

i still don't feel really solid about how i'm doing it though

#

it just seems like photon is trying really hard to make this easy for me and i'm just making it much harder than it needs to be

jade glacier
#

If you are serializing there is nothing PUN related tracking dirty and such... you just are being asked by OnSerialize .. "Do you have anything to say?"

#

That's the case with any HLAPI for networking

#

they do a lot of stuff for you, but it does require you to do it the way they wrote it

earnest wave
#

do i have to explicitly mark my arrays as dirty for pun to actually call onserializeview on the non master clients/
?

#

because with reliable on change only the first change is going through

jade glacier
#

I don't believe it has any way of knowing, unless your data is derived from some class or something they provide (not aware of any)

#

Pun will call onserializeview on a regular schedule of some kind, forget what that timing is based on

#

Its a unified method isn't it? One method for both read and write?

#

It should only call with isWriting being true when the photonview has authority though, pretty sure

#

On dumb clients it is a callback for when that photonview has an event right?

earnest wave
#

on clients it just calls when it feels like calling i guess

#

i can't make sense of it

#

yes it's unified

#

it's only isWriting on the masterclient for this scene-owned object i'm trying to serialize

jade glacier
#

its a callback, so it will get called on clients when it has something

#

The timing is in FixedUpdate, that is when the incoming message queue gets dispatched (in PUN2)

#

in PUN1 it was in Update()

#

There is a Photon singleton called PhotonHandler I think that manages that stuff

#

Its a weird callback, because it has two sources

#

If it has authority, the source is the send rate timer

If its not the authority, its the callback for incoming messages

earnest wave
#

i don't think the timing is the issue, it's whether it happens at all

#

theres some sort of flag in the mix I think, 'hasChanged' or something like that

jade glacier
#

If its not happening, then likely the message is not getting generated

#

Are you debugging your OnSerialize write to make sure its actually writing something there?

earnest wave
#

yes it's definitely writing

#

if i change it to Unreliable it works

#

so for now, that's what i'm doing... but... packet loss

jade glacier
#

Ahh, it might be doing a delta compare to the objects (ick)

earnest wave
#

little worried about that especially since its a mobile game

#

they're all instances of a class, maybe it expects new instances in order to trigger that update?

#

i dunno

jade glacier
#

try changing something minor, like at a int counter to the front of the write? So you know its changing

#

If its not sending, it may be doing a rough delta check, and your data isn't changing

earnest wave
#

yah it only sends if something changed anyways

#

right now its just an int that changes from 1 to some weird negative number (negative stone-holder viewID)

jade glacier
#

Not sure then, if its having your write in OnSerialize... I would expect that to send. But again - haven't used it much.

#

I don't like wondering what its doing, I just to right to raise event myself to avoid any of this wondering

earnest wave
#

yeah still havent ruled that out

#

just want to really get a headlock on this serializeview

#

so if i choose not to use it, it's not for a lack of ability to, it was a deliberate decision

indigo current
#

you still here? ๐Ÿ˜›

#

also packet loss is normal, very very normal.

jade glacier
#

Sounds like he is getting nothing past the first,which seems a bit much to be pl

#

PUN does pass everything as objects, so it might be seeing that its the same reference and calling that the same yeah @earnest wave

earnest wave
#

hmm

#

yes still here

#

ok so if i send an array of custom classes as Unreliable, they send, each time i trigger a new send. Not sure they always receive but apparently they usually do

#

if i send as Reliable, they send the first time and thats it

#

i'd prefer not to create new instances of those classes every time i want an update that seems lol.

#

and yes multiple tests always same result, first is consistent then never again

#

so i'm doing something wrong.

jade glacier
#

Yeah, that clearly sounds like its check for delta is coming up with the conclusion its the same

#

so sending the same ref with changes is no good

earnest wave
#

but, good news is my custom class serialization / deserialization / registration with Photon is all working a champ

jade glacier
#

You will find PUN as a garbage collection generating machine.... another reason I avoided all of this

#

with byte[] you can send partials in a wrapper

#

However, that technique may work for you if you are writing to a byte[] ?

#

(hint... you should be serializing to a byte[])

#
{
    int bytepos = (bitposition + 7) >> 3;
    System.ArraySegment<byte> byteseg = new System.ArraySegment<byte>(buffer, 0, bytepos);

    optsTarget.TargetActors[0] = connId;

    PhotonNetwork.NetworkingClient.OpRaiseEvent((asServer ? SVR_TO_CLIENT : CLIENT_TO_SVR), byteseg, optsTarget, sendOpts);

    if (!Time.inFixedTimeStep)
        PhotonNetwork.NetworkingClient.LoadBalancingPeer.SendOutgoingCommands(); //.Service();

}```

My PUN2 send code
#

System.ArraySegment<byte> is pretty critical to keeping it from spewing out garbage

earnest wave
#

yeah i serialize to byte and if needed i could just serialize the entire array of custom classes to a big long byte stream i'm just trying to keep it all as HL as possible

jade glacier
#

If you are writing to byte you need to use System.ArraySegment<byte> anyway

earnest wave
#

yah using a lot of arraysegments in my deserialize now

#

sec i'll paste code

jade glacier
#

And those are triggering the dirty? Odd

earnest wave
#
[System.Serializable]
public class StatusStone
{
    public int status;
    public Vector3 location;

    public StatusStone()
    {

    }

    public static object Deserialize(byte[] data)
    {
        var result = new StatusStone();

        int offset = 0;
        int nibble = 0;

        nibble = sizeof(int);
        result.status = UtilitySerialize.BytesToInt(new ArraySegment<byte>(data, offset, nibble).Array);
        offset += nibble;

        nibble = 12;
        result.location = UtilitySerialize.BytesToVector3(new ArraySegment<byte>(data, offset, nibble).Array);
        offset += nibble;

        return result;
    }

    public static byte[] Serialize(object customType)
    {
        var c = (StatusStone)customType;
        List<byte> obytes = new List<byte>();

        obytes.AddRange(UtilitySerialize.IntToBytes(c.status));
        obytes.AddRange(UtilitySerialize.Vector3ToBytes(c.location));

        return obytes.ToArray();
    }
}
jade glacier
#

You are serializing to them as well right?

earnest wave
#

public class UtilitySerialize
{
    public static byte[] IntToBytes(int inVal)
    {
        return BitConverter.GetBytes(inVal);
    }

    public static int BytesToInt(byte[] inVal)
    {
        return BitConverter.ToInt32(inVal, 0);
    }

    public static byte[] Vector3ToBytes(Vector3 inVal)
    {
        byte[] oBytes = new byte[12];

        Buffer.BlockCopy(oBytes, 0, BitConverter.GetBytes(inVal.x), 0, 4);
        Buffer.BlockCopy(oBytes, 4, BitConverter.GetBytes(inVal.y), 0, 4);
        Buffer.BlockCopy(oBytes, 8, BitConverter.GetBytes(inVal.z), 0, 4);

        return oBytes;
    }

    public static Vector3 BytesToVector3(byte[] inVal)
    {
        Vector3 oVec = Vector3.zero;
        oVec.x = BitConverter.ToSingle(inVal, 0);
        oVec.y = BitConverter.ToSingle(inVal, 4);
        oVec.z = BitConverter.ToSingle(inVal, 8);

        return oVec;
    }
}
#

by triggering the dirty i'm not sure what you mean

#

btw there's a lot of room for optimization here i'm just trying to keep it readable for now

jade glacier
#

I mean sending something that PUN Reliable sees as different than the previous send

earnest wave
#

sec i'll paste the serialize

jade glacier
#

I suspect its just running a hashcode on the objects you feed it

earnest wave
#

woops too long for discord, pastebin sec

jade glacier
#
    {
        var c = (StatusStone)customType;
        List<byte> obytes = new List<byte>();

        obytes.AddRange(UtilitySerialize.IntToBytes(c.status));
        obytes.AddRange(UtilitySerialize.Vector3ToBytes(c.location));

        return obytes.ToArray();
    }```  I don't see that using ArraySegment
earnest wave
#

deserialize is using arraysegment

#

serialize just adds them into the list

jade glacier
#

I don't fully follow what you are doing, but it looks like you might be doing some pointless stuff there

earnest wave
#

seems pretty certain

#

story of my life.

jade glacier
#

Why the object uses and just just straight up byte[] everywhere?

earnest wave
#

feel free to change it up how you would do it and i'll try it out

jade glacier
#

I can't poke around without it being in VS.. .but the use of object anywhere rather than byte[] seems bit odd

earnest wave
#

i'm not married at all to the serialize / deserialize its just what is basically functional at this point

jade glacier
#

I would have a reusable byte[].... clear it and write to it... then ArraySegment it off to OnSerializeView

#

Just makes it hard at a glance to tell what the object is and where it would be coming from

#

normal flow is pretty basic for this stuff... serialize to a byte[] ... hand that to the transport.... get a byte[] back... hand that to the various things that need to read it

#

If you turn your byte[] into a ArraySegment and give that to PUN, it will come out the receiving end as a byte[]

#

Other side note... doesn't have to be byte[] most likely for PUN a ulong[] would work I suspect. I just use byte[] so my libraries work with all transports

earnest wave
#

i've just been trying to keep to the PUN docs/samples as much as possible

#

they used byte[] in/out so thats what i went with

jade glacier
#

I would really avoid that for anything you want to optimize

#

ahh, the byte thing is fine, thats standard

earnest wave
#

dont care about optimization at this point just want it working and reliable

jade glacier
#

just ulong[] offers faster bitpacking and such

#

yeah, byte[] is the way to go then

#

however, that reliable method with its automatic whatever for detecting changes seems like more hassle than help

earnest wave
#

there will come a day when its all working and we can sit down and tear it to pieces

jade glacier
#

I would really just raise your own events

earnest wave
#

i'm compartmentalizing all the bottlenecks so it should be easy to address them one at a time

jade glacier
#

I think that reliable delta option is meant for beginners, not for advanced stuff

#

if you send reliable events, you can do your own delta check

earnest wave
#

how did i leapfrog from 'knows nothing' to 'advanced' ๐Ÿค”

jade glacier
#

You are aren't just RPCing structs and values

earnest wave
#

i see

jade glacier
#

I suspect you are trying to serialize objects, and they are hashcoding out as unchanged

#

Just guessing, really you can find out for sure by just following the code and see what it is checking

earnest wave
#

maybe i need to use unity's internal 'mark as dirty' mechanism?

jade glacier
#

Not even sure how that would interact, but I would avoid all of that

#

your data set is going to need you to manhandle that anyway

earnest wave
#

i think the unity mark as dirty is an Editor thing anyways

jade glacier
#

Later down the line you are going to want to decide how to fragment the sends, and what to repeat and what not to repeat

#

yeah, its not really related

#

regardless.. I would just use a mechanism that sends every time - and add code later for culling those sends

#

Or, dig a bit and see what the check is in Photon

#

it should be uncompiled C#

earnest wave
#

yah for now that's the plan, if there's packet loss it'll get fixed up the next time someone triggers an update

#

and all game referee actions are conducted by the master client anyways so it's not like loss of sync means someone can pick up a stone twice etc

jade glacier
#

Eventual consistency works for most things, its my preference when I can avoid reliable

#

I generally focus my energy on making things self correcting

#

rather than dealing with order of execution and events nightmares

stable cairn
#

Hey! Quick question (hopefully). Can someone confirm or correct me when I say that I though the maximum payload size one could use with the new transport package is 1466 bytes?
(That is 1470 - 4 bytes, due to the NetworkConnection header)

jade glacier
#

Haven't touched it, though if you can't find documentation to confirm it you could try sending it a byte more than that and see what happens

stable cairn
#

I already had the error. Fixed it by setting my own size limit 100 bytes lower, than what I thought I needed, so 1366. Tried 1462 at first but that also failed.
The UdpCHeader struct from the transport package looks like this:

[StructLayout(LayoutKind.Explicit)]
public unsafe struct UdpCHeader
{
    public const int Length = 4;
    [FieldOffset(0)] public fixed byte Data[Length];
    [FieldOffset(0)] public byte Type;
    [FieldOffset(1)] public byte Flags;
    [FieldOffset(2)] public ushort SessionToken;
}

Basically I'm just wondering if it's my own code that's wrong or if I've missed something in the package.

knotty dust
#

Hi there ๐Ÿ˜„ is there some PUN expert here ? :p I'm currently creating a FPS and I was wondering how to manage the end of a round. I want to "reset" the Scene,reset the score and have all the player RE-instantiate.. is there a PhotonMethod for that? Thanks by advance.

jade glacier
#

There are pun users here

knotty dust
#

It's what I asked? ๐Ÿ˜ƒ

#

I am ๐Ÿ˜ƒ but I need some advices .

jade glacier
#

"experts" no clue about that

#

@stable cairn those field offsets seem a bit whack - not what you are asking though

#

nm, I see what they have going on there

#

I dont see any length info restrictions in that. the only length ref is just so that the unsafe fixed is sized the same as the whole struct

#

But it definitely consumes 4 bytes, if that is the question

stable cairn
#

Yeah that Header is what I have so far assumed to be all of the overhead added by their Transport package. But actually when I think about it the errors I'm getting are on the client, so I'm getting some data, seems to be some buffer in WinSock not having capacity for the UDP MTU, would've expected those to match the MTU

jade glacier
#

I don't know what layer this is, and if it includes any of the actual actual low level buffer stuff for UDP. I really don't ever get that deep into the transports sorry ๐Ÿ˜ฆ

#

1462 is a very odd size

#

so that seems like its got extra padding for something

#

I would expect the limits to be nice even numbers

stable cairn
#

1470 is the MTU for UDP, unity's transport layer is supposed to use 4 of those. I just gave 4 extra to check if it could be some for loop going slightly too far. But assuming my packet was maxed at all times, the limit must in reality be between 1364 and 1462 based on my understanding so far. It could also be lower than 1364 if my packet wasn't maxed when it worked.

jade glacier
#

Ahh, nm then - you know way more about this than I do

#

Its all C# code no? Or is some of that compiled?

#

How far can you dig down to see whats going into that packet?

stable cairn
#

It's C#. The transport package is from unity's open-source multiplayer repository. I'm working strictly with byte arrays though. I added some size checks right before I give it over to unity's network driver, so I was expecting the exact same data on the other end, but I get internal buffer exceptions before then, and they seem to be part of WinSock which I suppose is what the transport package is using, and which I know very little about. I don't have the error message currently, as I did a workaround, but when googling I got some stuff, but no clear answers.

#

And the part of code that throws the error is pretty deep in some unsafe pointer stuff with a buffer that I didn't immediately find the construction of.

jade glacier
#

yeah, I'm more out of my depth there than you. I literally never go deeper than handing my byte[] to whatever net transport I am using

stable cairn
#

But I remember the error code being 10040, which I believe is specific to winsock, or at least handled by it.

jade glacier
#

It may need some space for winsock junk yeah.... wish I had a clue about any of this ๐Ÿ˜ƒ

stable cairn
#

Yeah it's pretty low level, but I think it would be nice to get it right the first time to avoid having to revisit this code part for this kind of stuff.

jade glacier
#

I assume you would just be picking a byte count for your split point for your own writer?

#

So seems like whatever you code for overflow... will just need that one constant to be changed?

stable cairn
#

Yeah, unless it's my own code that is flawed

jade glacier
#

I mean, you are passing it a byte[] with a size?

stable cairn
#

Well currently I'm not splitting at arbitrary points because I wanna receive whole objects

jade glacier
#

What's the write method though to the transport? I assume it is pretty simpllistic?

#

like Transport.buffer.Write(myByteArray, lengthInt); kind of thing?

stable cairn
#

Unity uses a DataStreamWriter, so it's more like

writer.Write(data);
_networkConnection.Send(_networkDriver, writer);
jade glacier
#

hmm... what is 'data' ?

stable cairn
#

whatever I want it to be, but in my case that's the byte[] I wanna send. And right before that I would check if it's more than my limit.

jade glacier
#

is it a specific overload for byte[] ? or is it taking object?

#

And why no length info??

#

I hope it has a write method that lets you write only the used parts of your byte?

stable cairn
#

Yeah it takes in byte[] in it's overload. The DataStreamWriter seems to also be written by Unity as part of the transport package.

jade glacier
#

So if you send it a byte[1024] but you only wrote to like 500.... how do you send that to the transport with their methods?

stable cairn
#

I think the remaining 524 would have default byte values upon initializing the array. So unless I specifically truncated unused bytes it should be valid values. Also, the length of the array should have triggered my failsafe if it was greater than my limit, even if I only used 500

jade glacier
#

hmm, that doesn't seem right.

#

A byte[] write should really offer a length. Making you right size it = garbage generation. There would be no way for it to know that all those zeros are useless

#

which cs file is the writer in?

#

can look at the git now

earnest wave
#

@knotty dust either raiseevent or rpc i guess

#

probably raise event

jade glacier
#

dataWriter.Write(1234); derfug

#

nm, thats just sample code

#
{
    if (length < 0)
        length = value.Length;

    fixed (byte* p = value)
    {
        WriteBytes(p, length);
    }
}``` They have nonalloc byte[] writes
#

public int Capacity you should be able to check that to see what the total size of the buffer is

#

and Length to see how much is currently written to

stable cairn
#

This is from the "DataStream.cs" file

/// <summary>
/// Copy byte array into the writers data buffer, up to the
/// given length or the complete size if no length (or -1) is given.
/// </summary>
/// <param name="value">Source byte array</param>
/// <param name="length">Length to copy, omit this to copy all the byte array</param>
public void Write(byte[] value, int length = -1)
{
    if (length < 0)
        length = value.Length;
    
    fixed (byte* p = value)
    {
        WriteBytes(p, length);
    }
}
jade glacier
#

yeah, just pasted that same code LOL

stable cairn
#

Oh xD

jade glacier
#

That's the one you want to use

stable cairn
#

I'm using that

jade glacier
#

oh, so you are sending the length

#

it looked like you werent giving it your length int

#

If you check the Length and Capacity of the buffer do they look like what you expected

stable cairn
#

So if I get it right, the WriteBytes method adds bytes to describe the length? Is the capacity size also added? If the only thing added is the int describing the data length, then it shouldn't have failed when I gave my limit 4 extra bytes to go on :S But at least I now have something to go on ๐Ÿ˜ƒ Thanks

jade glacier
#

I would expect if its like the old UNET and others

#

Let me look at the git

stable cairn
#

Here's the method used to add bytes to the buffer:

        public void WriteBytes(byte* data, int bytes)
        {
#if ENABLE_UNITY_COLLECTIONS_CHECKS
            AtomicSafetyHandle.CheckWriteAndThrow(m_Safety);
            if (m_Data->length + bytes > m_Data->capacity)
                throw new System.ArgumentOutOfRangeException();
#endif
            UnsafeUtility.MemCpy(m_Data->buffer + m_Data->length, data, bytes);
            m_Data->length += bytes;
        }
jade glacier
#

wish I was less of a C# nubbin, because I never use ->

stable cairn
#

Me neither, to spoiled with all the C# lately. Didn't do enough unsafe coding yet. I do however feel like that will happen sooner rather than later now.

jade glacier
#

I think its just adding the bytes of that write to the total count

stable cairn
#

Yeah, but I'm only calling the write once, so that's why I'm expecting it to only add the 4 bytes for the length of the bytes

jade glacier
#

You can check the length value before and after your write and see if it all adds up

#

debug Length and Capacity at each step

stable cairn
#

Yeah I'll have to do some research and some debugging. This class has some documentation too that may help.

jade glacier
#

You aren't exceeding that writer though, that would give a different error

stable cairn
#

But I'll look at it once I have a context where it would fail. Yeah as far as I know I'm getting all the data, so nothing from the sending side is failing here. Error happens on the receiving end, so perhaps I'm accidentally triggering IP segmentations, thus getting a combined UDP package bigger than the MTU

jade glacier
#

hmm, yeah tricky to debug that when it happens in the ether

jade glacier
#

-> is basically . in unsafe in this context

stable cairn
#

Yeah I've done a little C++, but that was 10 years ago.

stable cairn
#

In case anyone encounters the same issue - Here's the detail I missed in com.unity.transport's code:

/// <summary>
/// Default NetworkParameter Constants.
/// </summary>
public struct NetworkParameterConstants
{
    /// <summary>The default size of the event queue.</summary>
    public const int InitialEventQueueSize = 100;
    public const int InvalidConnectionId = -1;

    /// <summary>
    /// The default size of the DataStreamWriter. This value can be overridden using the <see cref="NetworkConfigParameter"/>.
    /// </summary>
    public const int DriverDataStreamSize = 64 * 1024;
    /// <summary>The default connection timeout value. This value can be overridden using the <see cref="NetworkConfigParameter"/></summary>
    public const int ConnectTimeoutMS = 1000;
    /// <summary>The default max connection attempts value. This value can be overridden using the <see cref="NetworkConfigParameter"/></summary>
    public const int MaxConnectAttempts = 60;
    /// <summary>The default disconnect timeout attempts value. This value can be overridden using the <see cref="NetworkConfigParameter"/></summary>
    public const int DisconnectTimeoutMS = 30 * 1000;

    public const int MTU = 1400;
}

In short, the default MTU value set when using default NetworkParams to initiate the BasicNetworkDriver is set to 1400.

jade glacier
#

Great, sounds like you solved it @stable cairn

untold plume
#

@stable cairn and what is an option? to extend MTU?

jade glacier
#

I assume they picked 1400 as a safe value for some reason

#

https://en.wikipedia.org/wiki/Maximum_transmission_unit

It probably is just a number below the cases they anticipate

In computer networking, the maximum transmission unit (MTU) is the size of the largest protocol data unit (PDU) that can be communicated in a single network layer transaction. The MTU relates to, but is not identical to the maximum frame size that can be transported on the da...

stable cairn
#

Yeah, that's a very common thing to do

jade glacier
#

Unless you really plan to overstuff your packets, probably best to leave it there

stable cairn
#

But you can insert custom NetworkParameters to the NetworkDriver when initiating it. I think the MTU may be changed that way, although I'm not sure. At least most of those can be overridden.

#

Then again, since the transport package is open-sourced I could change it if I wanted to, but I'm content enough just understanding how it works. I don't have a current urgency to maximize my networking capacity.

untold plume
#

hm. so if you want to make it stable i think a good solution is to send fixed sized packets. like 1kb. there are several reasons for it:

  1. you will have "extra" space below mtu for custom headers to define what kind of data you're delivering and some extras
  2. you will get a stable fixed load over network
    also in this case you'll be able to use fixed sized 1kb buffer for transported data, so it'll be easy to fit chunks in it before sent (like using offsets and so)
    the 2nd also is an ability to batch small packets that need to be sent between sendrate steps, it will reduce net load by using single UDP header per several packets (26 bytes)
    i've did this several years ago for webplayer and it works pretty good in production
jade glacier
#

I would def not do that

#

99% of my networking work is in trimming every bit out of packets

#

sticking a bunch of padding back on them seems a bit... counter to that?

#

I can see fixed being fine in a game where the states are always the same size but generally the server outgoing stream would get pretty expensive wasting that much data

#

All modern networking you are buffering updates on the clients and server, and they will absorb any jitter anyway

#

Not saying it wouldn't work for some cases, just that as a general practice that seems like a bad idea

untold plume
#

the main concern is to keep packet size under MTU and have a fixed sized buffer below it's value . you don't need to send trailing zeroes actually, in any way you know actual size of data before sending and can also put it in a custom packet header

#

then read on other size

jade glacier
#

you just use the Write(yourByteArray, length) call for that yeah

#

but that would be sending variable sizes, which I would recommend

#

The transport adds the header and you just write to it with a standard serialization write method, he was just hitting a weird arbitrary number or bytes written that couldn't get through

#

@stable cairn That's a bit odd that the writer let you write past 1400, and that it isn't aware of the that const?

untold plume
#

it'll be weird if writer will NOT let you to write data bigger than MTU

jade glacier
#

yeah, that was why it was strange... he would write and send it, and it would break on the receiving end

untold plume
#

as i see he sends a packet size

#

2k for example, and got only 1400 cause packet were fragmented, and then tried to read 2k

#

EOF (end of stream actually)

stable cairn
#

@untold plume Yeah I got errorcode 10040 from WinSock on the clientside, which was something about a buffer not having capacity for the data, but it was within the internals of com.unity.transport. Either way when you mention "extra space" for custom headers etc, that's handled on a higher layer in my model. So the number I was looking for is going to be the upper limit before the data must either be segmented or reduced in size, with all necessary custom data included in that number. The perfectionist in me would like to not limit the system out of lack of knowledge and guesswork basically.

untold plume
jade glacier
#

I think that is mostly about rolling your own RUDP for fragmented packets

untold plume
#

RUDP is next article ๐Ÿ˜ƒ

stable cairn
#

Thanks! This is going to help future me a lot ๐Ÿ˜‰

jade glacier
#

Next article is relaible order not really RUDP

#

fragments don't need to be ordered

#

but for what the article is talking about its for when they have to get through

#

rather than usual UDP... fire and forget

stable cairn
#

I'll need all of the above unless Unity implements them as part of transport

jade glacier
#

does the MP transport not have a reliable channel opt?

untold plume
#

gafferongames is a good point to start as for me

jade glacier
#

yeah, gaffer is great

#

just saying that that article is a slightly different topic

untold plume
#

okay

jade glacier
#

all great stuff though, I always give his page as a reference to others

stable cairn
#

The new transport package is very barebone currently, I don't think it has anything. Well it does do multiple attempts at establishing connections, but for data I don't think it cares

jade glacier
#

hmm, I would expect them to add some RUDP handling if its not there already

#

since all of the basic libs do that

untold plume
#

and i would expect for specs

#

_>

#

i need it in golang ๐Ÿ˜„

jade glacier
#

If it isnt going to, I would just stick with like a LiteNetLib in the meantime

untold plume
#

LiteNetLib is pretty good

vital hawk
#

@stray scroll no idea on your issue but you can put your links like <https://thing> and it will not fill half the screen with the link previews ๐Ÿ˜ƒ

stray scroll
#

Will think of that to the next time^^

vital hawk
#

it's no big deal, just thought to mention it (you can also edit the original message, add those <> and it will remove the previews)

stray scroll
#

Yeah, I just realized I might've phrased it bad anyways : )

stable cairn
#

Well, Assert.IsTrue(true) won't do anything I believe, seems more like a placeholder to be replaced with proper handling. The if check is just checking if the connection hasn't been established properly, so I would imagine that you'd want to skip checking events for it? Perhaps using a continue instead of the asser... I may have missed something.

#

Assert is a special kind of failsafe check that will give you error prints if the assertions give unexpected values, and if I understand correctly they will be skipped during compiling, so it's like a good way to print things that go wrong without worrying that your end users will see all the errors meant for dev's eyes only.

Someone correct.me if I'm wrong. But In the example the Assert is "making sure that true is true".

stray scroll
#

Hmm, that's what I thought as well. : ) Thanks anyway.

sly shard
#

Feel free to ask me questions if you need some help

sand lotus
#

Hey @sly shard why did you decide to use TCP for reliablity and not RUDP with difirent forms of reliablity, for instance out of order but reliable etc?

#

woulden't that be much better

sly shard
#

@sand lotus I'm not the dรฉvelopper of the library

sand lotus
#

okay.

#

Darkrift also has no sequencing and is open for replay attacks

#

it is full UDP based

stray scroll
#

I think DarkRift is supposed to be an alternative if you want to get your hands dirty and as barebone as it gets to have a minimal overhead, so its basically just connection wrapped sockets?

sand lotus
#

but it performs worse than enet

stray scroll
sand lotus
#

It has lower bandwith because it includes no sequencing

stray scroll
#

Yeah, I fully understand its not a fair comparison x) Would be nice to know what all includes and what not.

sly shard
barren fractal
#

Any network library recommendations?

gray pond
#

@barren fractal Several - depends what kind of game you're making.

barren fractal
#

Give me a rundown on them all

#

I hear Proton

#

and I've attempted to use LiteNetLib at one point, haven't really done any Unity3D work for a while

gray pond
#

Unet is Deprecated, Mirror is the replacement. Also there's DarkRift, Forge, MLAPI, and Photon Bolt

barren fractal
#

Is Mirror the Google Cloud partnership one?

gray pond
#

no - Unity is a year away from having much to show there, and they're not doing a replacement HLAPI

barren fractal
#

So.. what is Mirror?

gray pond
#

Mirror took UNet, forked it, fixed all the crap, made a bunch of enhancements.

barren fractal
#

Interesting

gray pond
#

multiple transports, all source

barren fractal
#

Are all these except photon, open source?

gray pond
#

has nearly all the same outward facing classes and API as UNet, so it's easy to migrate...there's a migration tool for existing projects, and 3rd party assets built for UNet generally work without too much trouble.

barren fractal
#

I never really touched Unet, when I got interested in making a multiplayer project, Unet was already announced for being depreciated.

gray pond
#

DarkRift I think is $100 one time for the source - can't remember

#

don't bet the farm on that factoid - check for y'self on that

barren fractal
#

Project I have in mind is an Android game that is locally hosted

#

so, someone makes a "lobby" and people connect to it via "ip"

gray pond
#

Probably all of them can do that

barren fractal
#

So maybe NatPunchThrough

#

I'm not sure about Photon

#

Don't they charge CCU?

gray pond
#

OpenNAT

barren fractal
#

OpenNAT? Is that a library or feature?

gray pond
#

open source NAT library on GitHub

#

and yes - anything with Photon has a CCU $$

#

It's probably easier to use a service like GameLift, Steam or some such to get you past the NAT / Relay issue

barren fractal
#

Will I be able to do Peer to Peer with Mirror? Such as LAN, or will it connect to some external server?

#

Doesn't Photon have an external server that forwards users to be peer to peer

gray pond
#

the time and effort you'll spend making and supporting your own will be worse than some nominal fee to a service

#

they do

barren fractal
#

Relay's

#

So they all have relays?

gray pond
#

NAT isn't 100% assured to work, especially with mobile, so you'll end up relaying as a fallback

barren fractal
#

What about LAN only?

gray pond
#

sure that'll work

barren fractal
#

Will it still force a relay?

gray pond
#

make a server on a PC and have all the phones connect to it

#

not if they're on the LAN wifi

#

it's the cellular that is flakey

barren fractal
#

The game is more of a party game, so it could work with LAN.

#

It's a "spyfall" like game

#

What about options for dedicated servers like if I did something with AWS / Azure / GCP?

gray pond
#

That's what all of these solutions are really built for

#

They can be used for small party games, but they're designed to be headless servers on a VPS

barren fractal
#

So far Mirror is sounding the most interesting to me

vernal remnant
#

photon has a 100 ccu free license

#

anything more and requires money

barren fractal
#

I thought it was 20 ccu

#

and I don't want to use relay services

vernal remnant
#

I think pun2 was 100 and pun was 20

sand lotus
#

The question is really if you want to write your own higher level parts

#

or you want to rely on some middleware

#

the lower level stuff, the transport

#

there are plenty of options around

#

that take care of reliable UDP for instance

#

their free, their opensource, they work well

#

if you need high level API stuff you can look at mirror

#

but make sure to switch our their default TCP transport, its horseshit

#

not because its TCP, but because of how that is implemented

#

anyway mirror is basically just the unity HLAPI and it's having some features removed and a bunch of bug fixes

#

if the HLAPI/mirror is too high level and too generic for your project you can also look at the MLAPI which is on github too

#

or you can just roll your own higher level code which what most people are doing

#

if you are unable to roll your own things you can choose to go for photon or something, there is also smartfoxserver and I believe partialOS

#

but you will have to take their expensive CCU prices

vernal remnant
#

SpatialOS not partialOS

sand lotus
#

right.

vernal remnant
#

You are allowed small deployments for testing, anything more you need a quote; based on multiple deployments or amount of users

sand lotus
#

yeah that sounds scary

#

no in front-prices

#

so they can ask anything really

barren fractal
#

I don't want to use anything CCU related

#

I think Mirror is the best High level I've been browsing, especially because I have no experience in networking

#

Several months ago I was suggested LiteNetLib but it feels like I have to reverse engineer that library to just use it.

slow bay
#

I'm working on a legacy project that is using unity HLAPI. We have held objects that become parented to the player object. Anyone know if there's a callback method I can use to deparent the object when a player disconnects, before the server destroys the player object?

gray pond
#

@slow bay See if you have OnServerDisconnect available

indigo current
#

@barren fractal Forge is an option too

barren fractal
#

I was looking into the 3

#

Mirror seems to be the most active

indigo current
#

interestingly enough I dont remember Mirror being one of the big hitters when I last did networking

#

it looks new.

#
  • [SyncVar]s and SyncLists are used to automatically synchronize state.
#

that looks nice

#

Seems to be pretty to the point if you can manage your own matchmaking.

quiet apex
#

//f

barren fractal
#

I just need to start finishing projects.

sand lotus
#

mirror is just a fork of HLAPI from unity

#

they removed some things, fixed some other

gilded marsh
#

So I'm working on a game and I want to use steams p2p stuff, I have Facepunch.Steamworks which let's me create lobbies and send p2p data but I don't know the best way to seralize and send it

serene hornet
#

Bit pack into a byte stream and send that?

jade glacier
#

That's the end of the line for most networking... if you have access to the byte[] stream... you serialize to and from that no matter the transport.

serene hornet
#

I'd say your package would work too.

The basic concept would be BitConverter.GetBytes(i)
just take whatever you want, break it into components, like position x as either a float or an int, get the bytes for that, and send the bytes, then do the opposite on the other side. Thus the basic concepts of how to do networking in any instance

jade glacier
#

Yup, what you do in side of the serialize desrialize methods is totally up to how nutty you want to get with packing. You mentioned bitpacking (as opposed to bytepacking) so as just offering up my bitpackers if he wants to avoid getting his hands dirty in bitshifting.

#

Or just keep everything in even bytes. Not nearly as compressed but fine for development

barren fractal
#

@paper stone I tried using LiteNetLib but it feels like I need to reverse engineer it to know how to use it.

paper stone
#

Well - I'm using it only for connection + data transfer using 3 QoS channels. I'm not going deep into it's core because that's why I'm using framework nor my own network implementation. ๐Ÿ˜„

#

@barren fractal

#

You can access source code though

#

its open-source

barren fractal
#

I know, I have it on a project

#

All I managed was making my phone connect with my computer

#

But trying to figure out how to get packets to send between clients is a major shrug from me.

paper stone
#

Check this out

#

The idea is registering packets on both sides and communicate by sending byte arrays (the first data type is packet id and can be byte, short etc.)

#

whenever server/client send it to other side it unpacks byte array and take out bytes chunk by chunk so you can get info like array.GetByte() and turn it into id

vernal remnant
#

Anyone know of a good source for getting a full tcp server going? Not just connectivity, can easily do that, mean practices for handling events and for packet encryption/decryption; pushing the correct packet IDs into the correct methods (send a vector over the server for example, dont want it to get confused between the three position/rotation/scale).
Ideally I think i need to find something that creates a copy of client1 on client2 and when client1 does something it simulates it for client2 rather than sending values

#

books are also accepted

tidal shard
#

i really need to use proxy in my game and i'm currently using 2018.3 and network.useproxy is deprecated. then i see mirror asset but that didn't contain this api on it.
so any solution for using vpn and proxy or anything like that in unity?

gray pond
#

@tidal shard That would be at transport level, not HLAPI level, in Mirror. The transports would have to reimplement that.

weak plinth
#

^^

tidal shard
#

@gray pond thank you for reply but could you please be a little more clear it has nothing about proxy in transport

gray pond
#

@tidal shard In UNet Networking everything was jammed together and the only transport was UDP. In Mirror, we've separated the transports out to be independent, and interchangeable, components that handle all the connectivity and msg traffic, and that's where I think proxy-related code would be implemented. Your original question above is what first brought this to our attention, honestly, so we'd need to dig into it a bit further. I don't yet know if all transports would have proxy stuff or not.

paper stone
#

It is possible a nodejs websocket server is more performent than for example WebSocketSharp in C# server?

#

trying to find decent Websocket solution in C# for multiplayer game like agar.io that will have decent performance

native fossil
#

Can someone tell me the name of Unityโ€™s network namespace? I have done some research but everything seems to be deprecated or removed.

gray pond
#

@native fossil It was Networking - gone

paper flint
#

it was recently depreciated yes

#

there's a new system in development to replace it

#

The netcode is using Unityโ€™s new transport layer, which was just released in preview.

#

is the only example of using it i know of

#

and where they announced the depreciation

#

it's going to continue to be supported for awhile

#

so you could still use it even though it's depreciated

#

approx. 2-3 years from now

#

but i know next to nothing about networking so there may be a lot i don't know about

compact bramble
#

run and never look back

stray scroll
sand lotus
#

a repo not touched for 4 months

#

And a bad one too

#

This will not scale at all

#

maybe workable for 10 player games

#

I'm pretty sure this is even worse than LLAPI/HLAPI Unity made before

#

the samples are horrible

#

a simple Ping pong shouldent take thousands of lines of code over 10 files

#

and the transport itself is a wrap around udp sockets

#

without anything really

#

no reliablity channel even

#

so what's the point of that

stray scroll
#

Its a first view of the llapi and how to use it, from what I see same used in the FPS demo. Not including the packet there are 3 scripts needed for the ping pong(client, server,gui), so from a user perspective not a thousands line of code? And the transport layer is connection oriented UDP sockets with no reliability that are compatible with the ECS. Sure it would be nice with some RUDP, but it can be implemented in many ways and that in regards to the game, and who uses TCP anyway ๐Ÿ˜‰

sand lotus
#

Nobody should be using TCP for a game

vital hawk
#

just to update a bit about UNet

#

from https://forum.unity.com/threads/unet-deprecation-thread.543501/```
Update 2/14/19
We've been following user feedback, and took some time to discuss internally; we want to share a few updates:

  • LLAPI guaranteed in 2019 LTS build - due to demand for more time to transition and give the new transport more time to mature, we've decided to guarantee that the LLAPI will remain in the engine in the 2019 LTS build at the end of this year, and therefore will be supported with critical fixes in that build until Spring 2022. This is a 1-year extension from the original plan, and we will soon update the original blog post to reflect this change.

  • Plan of Intent for Networking - the networking team has published their current priorities and focus areas to the public git repo - it's their goal to keep this up-to-date with each of the projects we're currently working on. We've been seeing solid progress internally, and we're hopeful that some of the work-in-progress items listed in Github will be in the hands of the community soon.

  • DOTS-compatible - the new networking stack will work with ECS, Job System (for multi-threading), and Burst Compiler to reach the best possible performance and scale. AND, it does not require you to use DOTS for everything, most of your game can still be written in classic unity if you prefer that.

  • HLAPI support LLAPI and new transport - HLAPI will be released soon as a full-source package, and will be supported according to 2018LTS terms, so critical fixes will be provided until Spring 2021. This has not changed from the original plan. For clarity, The HLAPI will support LLAPI and the new transport (once it reaches a sufficient feature set) throughout this transition period. We feel confident that before 2021, the new networking stack will be a much more performant solution than the HLAPI, and we strongly recommend developers move over by this date.```

#

so in other words, you are not in a hurry to move out of UNet if you like it (many don't)

#

"the networking team has published their current priorities and focus areas to the public git repo" <- where is this?

#

oh snap

vernal remnant
#

depends on the game for the protocol

vital hawk
#

not a greatly detailed plan ๐Ÿ˜„

sand lotus
#

Just ditch that stuff and simply put it in a public repo

#

even if it doesent run in the current released unity build

#

get code in our hands so we can comment on it

#

put in issues

#

and help the development

#

like the scriptable render pipelines

#

or the post processing stack

vital hawk
#

I dunno, people shit on Unity for even doing preview releases ๐Ÿ˜„

#

some people have really hard time grasping concept of wip

#

modern devs *sigh

#

but I don't really disagree, I love more transparent development

#

especially since they are doing it for us, the engine users

sand lotus
#

right.

vital hawk
#

there's really not all that much reasons to hide what they are working on

stray scroll
#

I hate being in this dilemma if I should wait for them to complete their features or build something that works myself(but probably not as good as they will do it). I don't want to halt my gameplan, but I don't want to "waste" hours if I will just replace and throw it away either.

sand lotus
#

Just use the available things now

#

not made by unity

stray scroll
#

Sure, but I want to use ECS, so something that would neatly integrate with that and be replaceable without too much of a hazard ^^

sand lotus
#

nothing with ecs will be easy but there is somebody that did it

paper flint
#

I don't think it's bad they release a preview, but immediately depreciating the current solution leaves devs trying to write a networking game in Limbo

#

they shouldn't start depreciating anything until the new solution is up and working.

vital hawk
#

In general yes. But unet wasnt a great solution for most to begin with

paper flint
#

so I've heard many say heh

knotty dust
#

Use other existing product like Photon is probably the best option.

weak plinth
#

Does anyone know if the PhotonNetwork.LoadLevel() do anything besides telling the clients in the room to load a certain scene? some behined-the-scenes-magic?

#

Or can it be replaced by an RPC-instruction to tell the clients to load a scene with the SceneManager.LoadScene()

coarse sleet
sand lotus
#

yes its kind of depricated right now

stray scroll
night radish
#

What I don't get is why there is a package that still get updates with the old networking

stray scroll
#

I must say, I would have appreciated if the guys working at the FPS sample would've commented their code a bit better ๐Ÿ˜…

knotty dust
#

@weak plinth there is probably callback called

weak plinth
#

Hey, I'm looking for an asset which is similar to the Master Server Framework. Master Server Framework is out of date and crashes. My goal is that the player can create rooms where other players can join.

indigo current
#

@weak plinth it can be replaced with a rpc

#

The only noteworthy difference is that I believe with photon load level other player scenes will update if automatically sync scene is true

#

Which even then iirc that only applies to on connect.

vital hawk
tidal shard
#

hey, can somebody please tell me how i use any sort of VPN , Proxy or best option change DNS for My android game I've been desperately looking for something and even tried using java sources but didn't get anything

solar garden
#

Is the new networking system out ?

#

idk where to begin

paper flint
#

its still in preview

#

but the FPS Sample uses it

#

and i guess this is the repository/documentation?

solar garden
#

hey, oh cool i didn't know there was a preview thx

proud ice
#

best protocol that's possible to use with unity to open a socket for a server side Python script that talks with the database? latency isn't a gmaechanger, but I'm thinking 50ms ping is too high? I read above TCP is bad for games which is what I had been trying to set up for localhost testing

gray pond
#

"TCP is bad for games" is a nonsense blanket statement of absolute. It's challenging for twitch FPS. It's fine for a lot of other types of games.

proud ice
#

@gray pond ok, cool, I have my answer then, I just need a localhopst based mockup as a placeholder to structure my framwork around anyway, thank!

gray pond
#

Unity has UnityWebRequest if all you need to do is hit a web service

#

you can then write the web service in anything you like

#

it's HTTP(S) / REST

#

That's not deprecated - it's what asset bundles use

proud ice
#

I'm going to put my SQL DB and python scripts on a linux cluster at somepoint, not sure if http will suffice

gray pond
#

web service will be a lot easier to load balance across a cluster than a socket

#

socket is connect and stay - web service is request-response-done

proud ice
#

xml isn't my thing, and I need the listen stream open the whole time, going to be reading writing buffers both ways

gray pond
#

that's different - now you need a socket

#

web service != XML btw

proud ice
#

php, cpanel?

gray pond
#

could be JSON, could be raw text, could be binary etc.

proud ice
#

gotcha

gray pond
#

the payload I mean

proud ice
#

81 or 80?

#

I'm network retarded

gray pond
#

http=80, https = 443

proud ice
#

telnet still exist lol?

gray pond
#

but if you need a connection to persist so you can sustain bi-directional data over time (minutes or more) then you need a socket, not a web service

proud ice
#

yea, I can open sockets with python, by I don't know the ins and outs of validation/certificates and how unity handles all that

#

on the .Net end

gray pond
#

outside of UnityWebRequest (which hits a web service, not a socket) Unity doesn't anymore

proud ice
#

that answers my question..

#

what about a plugin?

#

a dll and seperate process?

#

that's a pretty nastly limitation

gray pond
#

what's the player side of the game like?

proud ice
#

Not going to have access to 90% of the data on the client

#

maybe, idk, I need to figure this out before I develop further

gray pond
#

I mean what the play style...turn-based card, rpg... ?

proud ice
#

open world, think EVE:Online

#

simpler graphics ofc

gray pond
#

so what are you going to do for server-side collisons, physics, navmesh, etc.?

proud ice
#

not much physics involved, just use EVE's bounce if your kinda cloe approach

#

and the meshes are 2d "cutouts" in a 3d world

#

just orbitabl mechanics at a basic level and isTargetted = true; kinda stuff

#

maybe even forget collision altogether and leave the shaderqueue to decides who's in front

gray pond
#

I think you're going to quickly find you need Unity on the server side unless you're going full client-auth (cheat mode)

proud ice
#

I just don't want to waste access to a server I can rent for free that hosted 1000 minecraft servers in the past

#

I'll have to find a way to open a socket, there has to be some solution besides WWW

gray pond
#

You could start with DarkRift2 that runs as a stand alone on server (no unity) but if you think you're going to want Unity goodies at all on the server side that's going to be a lot of work compared to something like Mirror.

proud ice
#

I don't need unity on server side

gray pond
#

k, then look up DarkRift2

charred patrol
#

Hello, I know very littlie of network coding but I am trying to update some old code that is using the old WWW, what is the new way to get www.text in UnityWebRequest or is there something I should be doing differently.

low jackal
#

Can someone help me brainstorm best way to sync a canvas?

#

For multiplayer drawing

tidal shard
#

hey, i have no experience on networking in unity and i have to implement Realtime multiplayer in short time.
so i have to choose between Mirror and Forge Networking Remastered which one you recommend for someone like me?

sand lotus
#

Photon

indigo current
#

Photon is the easiest to learn but expensive in the end if you have regular players. If you use photon make sure you use photon bolt

sand lotus
#

well yes its expensive but the dude sais he has no experience and has to build realtime multiplayer in short time

#

well there are your options

split rapids
#

Hey, is there any library that you guys use for web socket connection in your unity games? I am using WebSocketSharp for a turn-base online game in unity and it has major issues in android devices change network detection.

dusky storm
#

@split rapids we use a slightly modified Ninja.Websockets version for Mirror

weak plinth
#

Is there anyone her who has tried to use CorgiEngine together with Photon?

candid cove
#

I have an idea for a project that would involve displaying either a user's personal Google Photos
OR
the results of a public search using Google Image Search.
Can anyone tell me
a) Is either approach possible in Unity?
and
b) What is the best strategy for displaying image data pulled from the web inside Unity?

vernal remnant
#

you can use rest/httprequest for google drive things, you do need an access token though so you would have to find out how to get through that
(User sign in, you need to contact google for the access key, find *.png/bmp/jpg/jpeg etc)

solar garden
#

Any tips for a dedicated server setup ?

sand lotus
#

you mean hardware?

glass bobcat
#

For a game set in space, I figured rigidbody would be my best bet with all of the physics around space and I needed some freedom that the CC doesn't really offer

#

How would I go replicating players with a rigidbody?

jade glacier
#

with server auth? Or client pos auth? @glass bobcat

glass bobcat
#

@jade glacier server auth would be better but not critical

#

It's a coop survival game

#

Nothing competitive but I might add other modes

jade glacier
#

with server auth its a bit challenging with phsyx, since you don't control the simulation

glass bobcat
#

F

jade glacier
#

People deal with it by allowing some amount of error, because its hard to push corrections from the server back onto the owner

#

For client position authority, you just send the transform to the server, using whatever form of compression you see fit, and with some form of buffering to smooth out jitter

glass bobcat
#

I'll check it out

#

I'll also try the first solution for server auth

jade glacier
#

server auth with RBs isn't a lot of fun. with 2018.3 though they changed phsyics

#

so you can resimulate, but its still a bunch of extra steps to do that

glass bobcat
#

Yeah

#

I could use CC but for a space game with 0 gravity in some cases, players floating around etc it might not be as good/as easy to use

jade glacier
#

Yeah, look at my demo scene

vital hawk
#

why on earth you would have server auth on co-op?

#

that's like asking for trouble for all the wrong reasons

glass bobcat
#

Nothing competitive but I might add other modes

jade glacier
#

its floaty quaternion based dudes with RB forces being synced.

#

client auth has downsides, but for a coop it very well may be worth going that direction. I would only recommend server auth if you are looking to either become a networking guru, or if your game is really going to need that kind of anti-cheat and fairness built in

vital hawk
#

server auth is one thing

jade glacier
#

You can server auth some stuff

vital hawk
#

doing that for physics is total another level difficulty

jade glacier
#

like you can server auth to check on hitscan claims

#

and tracking score and such

#

but the movement as server auth really needs you to manhandle the simulation, more than you probably want

solar garden
#

How would you do if you wanted to go from spectator to joinning a team ?

#

do you destroy the spectator and instaciate a new player but you have to pass the id to the new player prefab

#

or do you just change the player inside the gameobject

jade glacier
#

Unet?

glass bobcat
#

ty for the tips @jade glacier

jade glacier
#

helped I hope

glass bobcat
#

yeah i'll probably go with client auth on pos

#

with a couple of sanity checks

cerulean bluff
#

hi guys, i have a question i'am searching in the unity Manual when i look for the Network manager Section, there is only written Obsolete but no link whatsoever to the new Manual.
๐Ÿ˜ฉ

compact bramble
#

It's now on package manager instead

#

Unity's removed HLAPI from newer versions and provides it here for people who still want to use it + newer unity

cerulean bluff
#

@compact bramble hey very cool thanks!

#

@steep wigeon would be cool if you write such things into the manual instead of just obsolete ๐Ÿ˜‰

gray pond
#

Everything's still deprecated in the package, isn't it? There's no HLAPI planned for the new ECS thing Unity is making. They've just tossed this out for legacy.

compact bramble
#

Their new networking will be ready by then, it's being developed alongside

#

one doesn't advance without the other

#

they have it implemented in their fps sample project, partially as hybrid and low level transport. the rest is coming, so they'd love me to keep saying

#

the reality is I have no idea the progress of it.

#

but that's the plan

#

in any case I'm not fussed, photon is always there and @graceful zephyr always grimly looking down from his throne of dead modems

sand lotus
#

I think the new networking is going to be even worse than HLAPI

#

I have 0 trust in unity to do it right

#

their current project they put up is horrible

#

and their FPS example is also very badly implemented

#

I think it will be the end for unity in the topic of networking

#

the average dev will go to unreal because of the lacking multiplayer on Unity.

void burrow
#

Which networking solution would be recommended for a game of for example 4 people without a dedicated server, so peer to peer?

sand lotus
#

for such low player numbers anything can work

#

choose any of the 297982 options that you like the most

void burrow
#

The reason why I'm asking @sand lotus is because I don't really know all the 5239723 options. The only one I've heard of is Mirror. That's why I'm asking in here, since the people in here have more knowledge about it than me ๐Ÿ™‚

sand lotus
#

For small project like your making mirror is probably OK

#

It's not really very performant but who cares at 4 players

#

just don't use their standard TCP transport, switch it to some UDP variant, I believe they offer two

void burrow
#

Are there any with a mix of both TCP and UDP?

sand lotus
#

Why would you want that?

void burrow
#

In case I've packets which are important, and some which I simply don't care about.

#

So it's less performant.

sand lotus
#

In a game situation you should never want TCP, let alone a mix of TCP and UDP, there are plenty of good Reliable UDP libraries around, that have the option to send things in reliable channels (they will always arrive, data gets resend when lost) and unreliable channels ( data lost is lost)

#

Mirror itself is also having some UDP options that both implement reliable UDP

#

if you mix TCP with UDP things start to break fast, TCP will make UDP pretty much die.

void burrow
#

But why does TCP exist if you've reliable UDP lol

sand lotus
#

Because some people have no option to use UDP, for instance their making browser games

#

Or TCP simply works for their slow paced turn based games

void burrow
#

Alright!

sand lotus
#

TCP is supposedly easy, because you don't care you send something and it will arrive for sure, and in the right order

#

sounds awesome

#

the problem is if something is lost, the data is resend

#

but maybe some data you dont care about

#

Lets say your sending 20 movement updates per second

#

if movement update 11 is lost

#

12 13 14 15 16 get ignored

#

till 11 is finally resend

#

then all are pushed to the game

#

but by then the information in update 11 is useless

#

and 16 arrived super late

void burrow
#

I see the problem yeah.

#

But mirror is probably going to be the best one for me?

#

(The UDP variant)

sand lotus
#

There are many options, if you want something really simple for 4 players that is fine

#

if you want to get a bit more dirty you can try implementing any of the transports yourself directly

#

You can also choose to go with the solutions around

#

like Photon etc

#

if you don't want to bother about a lot of things

#

but that can cost money

void burrow
#

"can", what's the point you've to pay?

sand lotus
#

100 CCU i think

void burrow
#

And mirror, does that have paid features?

sand lotus
#

no

#

it's just a fork of the Unity HLAPI

#

open source project

#

missing some features from HLAPI

void burrow
#

And are any of those missing feature's important ones?

sand lotus
#

depends your use case

#

I think they removed the whole lobby system but recently brought it back

#

more than that I'm not sure.

#

What kind of game your building anyway

#

except 4 players

void burrow
#

I just simply want to test with some small scale networking solutions, not planning on doing really anything with it. ๐Ÿ™‚

#

Just expanding my knowledge ๐Ÿ˜„

sand lotus
#

alright

#

if you want to really learn something you can just use mirror to get things working

#

and if you want to learn more about actual networking

#

serializing data and so on

#

you could do code it yourself

void burrow
#

Building my own networking solution on a low level API you mean?

sand lotus
#

yeah

#

if you want to learn something

#

that is fun!

void burrow
#

Hmm

#

Which API would you recommend :3

sand lotus
void burrow
#

Only one I've ever seen was something called lidgren

sand lotus
#

Lidgren should be depricated

#

the one i linked is the fastest one around right now

#

but its having unmanaged code

#

if you want to stay in managed code

#

you could use this one

void burrow
#

Sorry, I don't quite get what you mean with "unmanaged code".

sand lotus
#

Unmanaged code is non C# code

#

enet is simply C code

#

so it's a native binary you interop with C#

void burrow
#

I think I'm going to play around with LiteNetLib a bit. :3

#

Thanks for the help โค

#

@sand lotus One question though, why shouldn't I use a precompiled .DLL? I also don't really know how to include the library sources in Unity xd Always use library sources instead of precompiled DLL files..

sand lotus
#

Unity has to just use the source

#

so don't use C# dll's

#

unless there is no other option

#

Ofc you can use native Dll's like in enet.

#

You can use C# dll's but sometimes that can be troublesome

void burrow
#

But how would I let Unity use the source?

sand lotus
#

Copy the files into the project

void burrow
#

Just that?

sand lotus
#

under assets make a folder drag it in done

void burrow
#

Oh lol

#

๐Ÿ˜‚

#

Even the example on their github page use a .DLL >_<

sand lotus
#

you used that?

#

maybe is going to work better for you

void burrow
#

Seems to work!

void burrow
glass bobcat
#

gj

wheat flower
#

I'm having a bit of a struggle. I have set up a simple tcp client and tcp listener (more or less indentical from the examples in https://docs.microsoft.com/en-us/dotnet/api/system.net.sockets.tcpclient?view=netframework-4.7.2 and https://docs.microsoft.com/en-us/dotnet/api/system.net.sockets.tcplistener?view=netframework-4.7.2)
Running the server through the Unity Editor, clients using a built instance are rarely are able to find and connect to the server. When the server is running on a built instance and client in either the Unity Edtior, or a built instance, everything works fine no problem.
Does anyone have any experience with this issue? I'd like to be able to run the server through Unity to have better debug capabilities

void burrow
#

@sand lotus Do you've by any chance an example for the NetPacketProcessor? Since I'm really confused on how it works, and can't quite figure it out.

sand lotus
#

i never worked with litenetlib

#

i did make my own packet processing algoritms though

#

but can't really show you something

void burrow
#

Seems like I'll have to use something else then, since the examples from the person them self aren't finished and the wiki really lacks information ๐Ÿ˜

sand lotus
#

most lower level libs don't have much documentation

#

you just have to get it to work ๐Ÿ˜ƒ

#

with your own code

#

i thought your point was to learn something

void burrow
#

That's the problem. I can't get it too work, even with the most spaghetti code ever.

#

And yes, it's still to learn something.

#

But how am I suppose to learn something when there are no tutorials, barely any documentation and half finished examples?

sand lotus
#

i saw that on the git

void burrow
#

Yes, and I followed that.

#

And it ended up to even be able to send the packets with a big mess of code, and second of all still doesn't receive the packet.

sand lotus
#

you folowed the unity example right

void burrow
#

It's not finished.

sand lotus
#

I see

#

I haven't checked the contents of the lib too much

#

I only saw people use the transport to great success

#

If you want something that is more higher level

#

poking at transports is not the way

void burrow
#

I'll take a look at that ๐Ÿ™‚

sand lotus
#

It has examples a wiki and everything

rocky shore
#

Hey, I'm trying to talk with an API but am having some trouble. The code that worked before was:

private string url = "http://api.site.com/api.php/function"

IEnumerator CallApi() {
    WWWForm API = new WWWForm();
    API.AddField("name", "value");
    WWW APIReturn = new WWW(url, API);

    yield return APIReturn;

    if(!string.IsNullOrEmpty(APIReturn.error)) {
        Debug.Log("ERROR: " + APIReturn.error);
    } else {
        Debug.Log(APIReturn.text);
        //DO STUFF WITH RETURN VALUES
    }
}
#

After installing a SSL certificate (and changing the url to https) however this stopped working

#

I now get the following error: "SQL server does not exist or access denied"

stray scroll
#

Looking at the FPSSample server side, is there any other reason than possibly having multiple Receive and Send over clumped Ticks for not using FixedUpdate instead of their own loop?

sand lotus
#

I suppose because fixedupdate is not really reliable to get anything at a certain pace

#

if the server slows down it could run multiple fixed updates after eachother

#

because it can never miss one it HAS to execute them

#

even if you run lets say your fixed update at 30

#

and your server fps at 30

#

sometimes a frame happens without fixed update

#

and then next frame will have two fixed updat runs

#

it's just not a good way to handle that stuff.

stray scroll
#

Hmm, that's true. So in that case you would try to tweak the normal Update rate anyway to try to keep fixedUpdates spread out.

#

Which is presumably harder since you don't have access to the timers...

sand lotus
#

So the best thing to do is just run your frames at a set rate

stray scroll
#

Now I think I'm going outside the realm of networking, but I'm trying to find a way to run the ComponentSystems "manually" in that loop. Like World.RunSystems();, and the closest I've found is that it is tied to PlayerLoopSystem, but then you get back to using your own Update method. :/ I need some more code exposed x)

sand lotus
#

or decouple you're game from your networking side and leave it in it a dedicated thread?

stray scroll
#

For the server side?

sand lotus
#

yeah

#

This is pretty much how fixed update works

#

it's very based on physics

stray scroll
#

Yeah, I've read that.

sand lotus
#

but maybe for networking you don't want that

#

Personally I run the game at server side at set framerate (32) and hopefully the server processes everything in that time (31,25ms)

stray scroll
#

And done it in my old game engine, but this question was more aimed at ECS than networking ๐Ÿ˜ƒ Still don't get what you would get out of splitting the send/recv from tick on the server.

sand lotus
#

ah

stray scroll
#

Thanks for the help : )

void burrow
#

@sand lotus Little update, Iโ€™ve given LiteNetLib another chance and it now works! ๐Ÿ˜„

void burrow
#

So question, how would I go about making pathfinding on the server side?

#

How is the server suppose to know how the map looks like?

jovial rapids
#

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

tender falcon
#

whatโ€™s a reliable method to securely send POST requests to a server from Unity?

gray pond
#

UnityWebRequest @tender falcon

#

does https POST, GET, etc.

vernal remnant
#

you still have access to the actual WebRequest class as well

tender falcon
#

@gray pond @vernal remnant got it. If im uploading a mic recording, would you recommend base64 encoding it and sending it in the metadata? Or a different strategy?

gray pond
vernal remnant
#

Would search around, things like NAudio or manually using winmm.dll come to mind... Or find other sources that assist with it; I think they mostly send wav bytes... Create audio, save, send to server; if success delete saved file, or attempt to send again... Receive bytes, create wav, play file, delete file

#

or you could probably just stream bytes out and play it on the receiver

#

only problem is that you wont have any fallback if there is packet loss (depending how important the voice clip is)

#

And you will still need to process chunks, because some people just dont shut up

void burrow
#

Question, how do games normally connect to servers on other IP's without port forwarding? The Forest does this for example, but I'm wondering how.

#

And with server I mean a client which is a server / client ๐Ÿ˜„

vernal remnant
#

Forest probably uses 7777, common game port and is usually open

sand lotus
#

Probably through relay servers

vital hawk
#

@void burrow forest uses steamworks as the middleman

#

So steam itself takes care of that

sand lotus
#

Yeah so relay

vital hawk
#

They use photon bolt so technically they could use photon cloud too, but pretty sure they used the steamworks setup (it is not offered automatically anymore as it doesnt help them to sell ccu plans)

rigid fiber
#

@void burrow @vital hawk Either way that comes out to relays. steamworks and photon cloud are both relays

undone sigil
#

@vital hawk i've seen The Forest on Made with Photon page

vital hawk
#

It uses photon bolt

#

@undone sigil

weak plinth
#

^^

solar garden
#

does somebody knows a good solution to make a server authoritative dedicated server ?

gray pond
#

Depends on how your game works and what your server needs to be able to do @solar garden

solar garden
#

Im aiming to do the same thing as counter-strike or the source engine in general i tried photon bolt and other Unet tutorials but it seems either way you still need to go through a cloud

gray pond
#

Dedicated server implies you intend to host it someplace like GameLift, PlayFab, Vultr, Digital Ocean, etc.

solar garden
#

but they are just servers or they are more than that ? i mean i could host my game on a home server ?

gray pond
#

Some service that will either run a perpetual world non-stop or will spawn instances as needed for matches

#

hosting at home is problematic because of NAT

#

There are solutions but they don't work 100% so you end up needing an actual public server as a relay, which will add latency, so you end up putting it on a public server anyway

#

Some services have free tiers where you can run your server with a limited CCU and bandwidth for free or very cheap while you're doing development.

solar garden
#

and for the game logic part what can be a good solution to build the authoritative setup while also being able to host on whatever Service i want ?

gray pond
#

That's back to the original question of what the server needs to be capable of. A turn-based card game doesn't need what a WoW game does

solar garden
#

oh it needs to be realtime

#

its a basic multiplayer fps

gray pond
#

Physics? Collisions? Raycasting? NavMesh?

solar garden
#

can it have all ? haha

gray pond
solar garden
#

it says that it was built for MMO's, could it work with fps ?

gray pond
#

yup

solar garden
#

well i'll give it a shot thank you

gray pond
#

There's a Chat link there that takes you to our Discord - we're there when you need help

solar garden
#

great ! i'll be sure to ask thx

rigid fiber
#

sounds like you guys are talking about Noble Connect

#

oh I was looking at some junk way in the past...disregard

solar garden
#

@gray pond Mirror uses TCP ??

gray pond
#

@solar garden Mirror has 5 transports to chose from: TCP, UDP (2), Steam, and WebGL

solar garden
#

steam too ?

gray pond
#

They're interchangeable components, so you can just swap them out

#

yes

solar garden
#

What does it means like it is using the steam cloud ?

gray pond
#

yup

solar garden
#

didn't even know it was possible this mean that you can get steam id's for the player ?

gray pond
solar garden
#

oh cool

#

isn't there a version for unity 2018.2 ?

gray pond
#

Unity has a mem leak in 2018.2

#

we're stable on 2018.3.6+

solar garden
#

oh i didn't even knew

gray pond
#

.3 also got us c#7

solar garden
#

i was staying on 2 because i dont like the new prefabs workflow

#

is it better ?

gray pond
#

Mixed reviews - depends who you ask (nested prefabs)

solar garden
#

aha ok

#

oh there is a liteNetLib implementation too this is good i wanted to use it but it lacks documentation

sand lotus
#

Prefabs suck

#

.3 is still unstable

gray pond
#

like I said - mixed reviews

#

It's like asking if Tofu is good

solar garden
#

i dont understand why you have to open your prefabs instead of just modifing like this

gray pond
#

this is off-topic for networking

solar garden
#

mirror supports physics too right ?

undone sigil
#

At least it'll stop occasionally corrupting your scene when modifying a prefab

gray pond
#

networking doesn't care what data you send

#

so yes

solar garden
#

true just making sure ๐Ÿ˜„

gray pond
#

that said, making physics sync right over network isn't for the feint of heart

#

regardless of what you're using

#

prediction, replay, interpolation, buffering, etc.

solar garden
#

does it matter in a authoritative setup ?

gray pond
#

auth is harder for a lot of things, including physics

#

not gonna sugar coat it ๐Ÿ˜ƒ

solar garden
#

i can see that it has been two weeks and i still didn't started ๐Ÿ˜„

gray pond
solar garden
#

tried bolt it was fun but there is the clout restriction problem

#

cool

gray pond
#

Everyone wants to make a full physics character controller over network and then they find out just how hard that is

solar garden
#

i thought it was as simple as to make clients kinematic and sending their velocity from the server

gray pond
#

and you found out it isn't

#

if you're going to make them kinematic, than there's not much point in doing rigidbody physics

#

may as well do a regular character controller...much easier

solar garden
#

no but their velocity is set by the server

gray pond
#

read the article - it covers all this ground

solar garden
#

yeah i think i will ๐Ÿ˜„

gray pond
#

it steps through all the challenges, and how to overcome them to the extent reasonably possible

#

There's even a github linked from it

solar garden
#

sweet

#

crazy to think that the guys at valve nailed it back to 2004

weak plinth
#

How do you adjust for interpolation of character movement while using RPC for actions like shoot?

#

I've implemented Valve's character-interpolation on 20 network-ticks and previous 200ms of data

#

but my RPC-action are nowhere near in sync

#

I'm using PUN2 by the way

wind quest
#

I'm starting to experiment with turn-based multiplayer on Android. I just wanted to ask before I got too deep: Is there a commonly accepted way to do this kinda thing? Or at least a good place to start, before I go barking up the wrong tree? I'm new to trying online multiplayer in Unity and I'm having trouble sorting through the old/contradictor/expensive advice.

I found this post that seemed like a good start:
https://medium.com/@div5yesh/turn-based-multiplayer-games-in-unity3d-using-unet-abcd8360ddd5
but then found out Unity recently announced they are deprecating UNet, so I'm not sure what to think.

So, any general pointing in the right direct would be wonderful.

Medium

Note: This article uses unity3d multiplayer networking concepts, learn more here โ€œUnity-Multiplayer Networkingโ€.

gray pond
#

While Mirror is a very good direct replacement for the deprecated UNet, such packages may well be overkill for a turn-based game if you don't need server-side physics, collisions, raycasting, or nav mesh agents. If that's the case, a simple server, or perhaps even a web service might suffice. Just sayin' think through your needs carefully.

vital hawk
#

Unity is still updating UNet too

#

they just released new package for HLAPI today

#

an HLAPI package is going to stay around throughout 2018 LTS, so for next 2 years

#

LLAPI is going to say for year longer with 2019 LTS

#

## [1.0.2] - 2019-03-18

### Changed
- Fixed issue with population of Syncvar variable on a class derived from a networkbehaviour base class (case 1066429)
- Fixed issue with IsDynamic not working on .net 3.5 profile (use something else)]
- Fixed file lock error when building under certain conditions (case 1115492)
 
## [1.0.1] - 2019-02-14

### Changed
- Disabled warnings around the usage of the 'new' keyword in the NetworkTransform, it's needed sometimes but can trigger when building (likely because of stripping) and the warning messed with CI/automation

## [1.0.0] - 2019-02-13

### Changed
- Only updating version to 1.0.0 to reflect the status of the package

## [0.2.6-preview] - 2019-02-13

### Changed
- Got rid of all warnings generated when the package is built, so it's CI/automation friendly
- Readme updated

## [0.2.5-preview] - 2019-01-29

### Changed
- Fixed Syncvar variable update issue. Modify both the writing and reading syncvar data as per channel. (Fixed cases 1110031, 1111442 and 1117258)

## [0.2.4-preview] - 2019-01-11

### Changed
- Fixed issue with assembly dependencies not being found by the weaver during certain conditions (like when doing full reimport).

### Added
- Added API documentation, migrated from unity source repo, only some formatting changes, text itself unchanged.

## [0.2.3-preview] - 2018-12-17

### This is the first release of the *Unity Multiplayer HLAPI \<com.unity.multiplayer-hlapi\>*.

Initial release of the Unity Multiplayer HLAPI (or UNet HLAPI) moved into a package. This will
work with Unity 2019.1.0a12 and onwards.```
#

(from HLAPI changelog)

quaint marsh
#

what networking solution would you use for a 2d webgl game?

gray pond
#

Mirror since it's one of the few that actually supports WS and WSS

#

That's assuming you need Unity features on the server. If you don't then Mirror is overkill.

compact bramble
#

MLAPI

#

or even hlapi from package manager

#

does it matter? if it's your first game use anything, photon even has a free option

quaint marsh
#

myeah i am trying photon 2 right now but it gets compile errors when i switch build target to webgl ๐Ÿค”

sour plover
#

@quaint marsh find the PhotonUnityNetworking asmdef and add the PhotonWebSocket reference to it

quaint marsh
#

i dont have that

sour plover
#

you should

quaint marsh
#

oh there it is. i guess i cant search for *.asmdef in the project

#

there we go! boom! everything is green! :D

sour plover
#

glad to help ๐Ÿ˜ƒ

compact bramble
#

I appreciate unity's investment into multiplay but I supect it would be slightly more useful with a robust networking library :P

split crescent
#

hot take

sand lotus
#

You really expect more?

compact bramble
#

I hope so!

sand lotus
#

From the multiplay code they put on git so far I am crying hard

#

It's like they know nothing about how OS works with networking IO

compact bramble
#

But vince you would be unhappy if you didn't have something to moan about. Be thankful they give you beautiful moments of hate

sand lotus
#

๐Ÿ˜ฆ

#

I spend 90% of my time making solutions and code or using assets for basic things an engine should have

#

I got annoyed over the last 6 years working in unity

#

forgive me

compact bramble
#

honestly I don't know what is happening with unity networking, just make sure you never use @ followed by these letters without spaces: f h o l m

sand lotus
#

after the LLAPI/HLAPI fiasco I don't trust unity

#

and then they came with this new multiplayer layer

#

and it's like the worst implementation for scalable network interfaces you can come up with

compact bramble
#

same, I coded an FPS tank battle game in HLAPI and realised it had really bad memory management

sand lotus
#

especially since they slap it into jobs without even knowing how IO scaling works on the Operating System, a big overhead layer that will not scale.

compact bramble
#

then I looked into LLAPI, then unity depreciated it all.. so I dropped it and now my trust is a little burned

sand lotus
#

I really enjoy what some unity teams are making, like what is happening on PostFX, Scriptable render pipelines and so on is amazing. but why can't they not invest the same into multiplayer

split crescent
#

they are, is my understanding

#

it's just very early

#

and I agree with the skepticism, overall

sand lotus
#

LLAPI dies with more than 8 players ie reliable messages never arrive, so that's useless, HLAPI is just a broken mess by itself

#

They are not Jason

#

What they uploaded is the worst implementation on UDP i ever seen

#

and i've seen a lot

compact bramble
#

thing is it's not "early"

#

it's been quite some time between stopping work on unet (2+ years ago) til now... that's time enough, surely?

split crescent
#

whats the new shit called again?

sand lotus
#

IT's like somebody that doesen't know anything about how Networking works, or Operating systems, decided to just take a wraper around native sockets, slap it in some jobs and say it's scalable (which it isent)

split crescent
#

that sounds like something I would build

#

๐Ÿ˜„

compact bramble
#

well it's fine for a 4-8 player game i think if allocations are pooled

sand lotus
#

The most important thing you would expect from an UDP network library to have Reliable channels perhaps, be low level and fast and be scalable

compact bramble
#

but i didn't know LLAPI was also flawed

sand lotus
#

all of that is not in the networking unity released

#

It's very flawed hippo

split crescent
#

meaning an rUDP impl?

sand lotus
#

yeah

split crescent
#

got it

sand lotus
#

But great reliable UDP libraries exist

split crescent
#

yeah

compact bramble
#

enet would be a good bet

sand lotus
#

why re-invent the wheel (badly) and then slap Jobs on it

compact bramble
#

photon is built on enet btw

sand lotus
#

enet is just 5000 lines of C code

#

it is so simple

compact bramble
#

and its tight

sand lotus
#

we use it too btw

#

you could opt for a more modern way to interact with OS

#

but at least that works yes

#

better than unity networking for sure

compact bramble
#

i don't use enet because i want a lot of things taken care of - i need matchmaking, i need host migration and I need relays done for me - i simply have no time.

all of those are only covered by photon atm :(

#

so I need an overall package solution

#

this does not exist really does it

sand lotus
#

yeah not really

#

MLAPI maybe

compact bramble
#

no servers

sand lotus
#

you need build in hosting?

#

then really only photon i guess

compact bramble
#

i need the server infrastructure to be fully managed not by me

sand lotus
#

so i guess your options are Photon, SpartialOS

compact bramble
#

that's actually the main thing i need, because code is not a problem... having servers get hit or compromised or just slyly hacked for furture ddos purposes (quite common) can add up to a seriously expensive mistake on my part...

#

so having that properly managed with the provided having accountability is good

paper flint
#

I don't know how anyone can talk about Spatial after the crap they pulled with Unity

#

i'd never touch them with a 10 foot pole now

compact bramble
#

lol @ spatial

#

any company reacting like they did instead of coming to the table to talk.... reacting by immediately running to the nearest competitor ... what a joke

#

i will never use them.

#

they lost badly though, they may be able to use all of unity's tech for free but their name is now mud fo the biggest game engine in the world

split crescent
#

in their defense - I'm pretty sure this is at the end of a lot of failed talks

compact bramble
#

no, I know the full story

#

I'll not be talking about it but spatial sucks.

split crescent
#

haha