Hello Everyone,
I have a script that procedurally generates textures which gets generated by the Master client of the room.
After the master client is finished generating the texture I want to send it to all other players in the room.
I have tried converting it to a bytearray and sending it using RPCs but the file size is too large so that does not work.
I also tried some compression scripts I found here which also wasnt enough.
What would be the best way for me to approach this issue?
I am using Photon Fusion 2 for multiplayer.
Hi
Use TcpClient for this
Two ways:
- upload the file to a cloud file sharing service or web server and send the download URLs to clients
- send clients only the necessary information (eg random seed) for them to generate the textures themselves
I would opt for the latter unless the generation process is extremely time consuming. And even if it were, I’d first look into optimizing this process, perhaps multithreading with bursted jobs.
If we’re talking about a possible dedicated server doing the texture generation you will want to offload this to clients as a means of avoiding unnecessary high server operation costs and/or degraded server responsiveness.
1 Like
Seconding the “send clients only the necessary information (eg random seed) for them to generate the textures themselves”-approach.
1 Like