#Using entities for network packets?

1 messages · Page 1 of 1 (latest)

oak shadow
#

Would this be bad practice? Create an entity with 1 component every time a packet is received and then have a system deserializing the packets and processing them?

steel quarry
#

I don't know why you would do that but why not just use a dynamic buffer then?

oak shadow
#

well I haven't looked too much into ecs filtering but my thought was is have a seperate component for each packet type. Then I can filter incoming packets by the ones I am wanting to deal with easily without having a seperate dynamic buffer for each type of packet.

#

This would make the code clean, laid out in the memory efficiently and let me use threaded systems to process the packets

minor jay
#

Is this using Netcode for entities? Or Unity Transport directly? I wouldn't think you would be receiving that many packets for this to make much difference.

oak shadow
#

no its for enet