Is there going to be a feature where a certain value can be two or more types? For example:
local packets = byteNet.defineNamespace("namespace", function()
return {
event = byteNet.definePacket({
reliabilityType = "reliable",
value = byteNet.array(byteNet.either(byteNet.uint8, byteNet.vec3, byteNet.cframe))
--There could be more than one type that can be sent in the array
})
}
end)
So wait iâm so confused especially since those struct and other things were added,
i have been basically trying to send packets stuff that could sent data values like that for a tower defense game:
[12] = { -- enemy ID that was attacked by towers in the same frame
53, -- ID of the first tower that attacked
57, -- ID of the second tower that attacked
12, -- ID of the third tower that attacked
38, -- ID of the fourth tower that attacked
{ -- Additional data for a specific tower's attack (5th tower)
98, -- ID of the tower that attacked with more data
{ -- other data, here IDs of enemies affected by explosion (secondary targets)
38,
85,
97
}
}
-- other towers that could have perhaps attacked that enemy
}
-- other attacked enemies during this frame
but i donât really understand how can i put that under struct and etc
since well ofc itâs never gonna be the same
Thatâs not true. You donât need to know (exactly) whatâs being passed around. In fact, ByteNet already provides something similar to this with optionals.
Itâs not, and stuff like this has been in use for centuries now (e.g. tagged unions, std::variant), and Iâd argue it does matter if itâs provided, because it shows the library author does not seem to think âitâs bad practiceâ.
Anyway, ByteNet specials are already dynamic by nature, so enums (or tagged unions, if you prefer) wouldnât be that different from whatâs already in ByteNet today, and Iâd like to see you argue that maps are bad practice because âyou donât know whatâs being passed aroundâ.
Well, I tried this library and it seems insanely good compared with BridgeNet2 in terms of low receive stats, but I have a few questions:
When sending 200 blank events per frame the ping stats go crazy due to the fact that the receive value is actually much lower than when using BridgeNet2. Is it possible to further optimize this module so that ping doesnât kill the game? Will you actually work on the ping optimizations?
Is there any functionality close to RemoteFunction:InvokeServer() ? Yes, this module does a great job of reducing the amount of receive close to 0, but there definitely needs to be something to invoke the server on the client.
It seems that this module is indeed one of the best network modules at the moment, but its functionality should definitely be increased, because now you canât invoke server on the client, so you have to use other networking modules to do that, for example, BridgeNet2.
thereâs another thing thatâs unfortunate and itâs that it doesnât work well when placed inside an actor
it will bug out and only 1 person will have it work like normal
in multiplayer, it just wonât work
The reliable and unreliable event data queues get cleared after all the data is processed into a buffer and the cumulative buffer sent (every Heartbeat), so no, there wonât be any memory leaks.
Just now trying out ByteNet
When calling the define packet, how would I go about demonstrating a table w/ an unspecified amount of members that have an unspecified string index? What Iâm talking about is in line 45. I couldnât find an example of this within any comments or the documentation.
Hello ffrostfall and any other readers, i have a question i want to ask:
in the documentation, at the specials section (Specials - ByteNet)
it says:
Using these types incurs 1-2 bytes of overhead due to the dynamic nature.
They take drastically more time to parse
They are heavier on memory usage, as a new closure is created each time. You will never have to worry about this unless you have dozens of packets, though.
It is talking very negative about these types, however is ByteNet still better to use for these special types compared to normal RemoteEvents?
Currently trying to send data trough remote events, which would send data like this:
({"Path1", "Path2"}, value)
I would like to know if it is worth to use this module to send data like that from server to client.
It would also be possible to make a array of those data values:
{
-- the length of the array which has the paths can vary (1 or larger)
{{"Path1", "Path2"}, value},
{{"Path1", "Path2"}, Some_Other_Value},
{{"Path1", "Path2"}, Hello},
{{"Path1", "Path2"}, value},
}
Would it be usefull if the data i sent would look like this?
i am using bytenet on my game (congrats on the excelent job by the way) and was wondering, would it be more efficient to create a single packet with a struct of 5 different valuess, and only pass the required ones, or create 5 different packets one for each value, and only require them when needed