The Photon Forum
is Closed Permanently.

After many dedicated years of service, we have made the decision to retire our Forum and switch to read-only: we´ve saved the best to last! Your search result can be found below. Plus, we offer support via these channels:

Try Our
Documentation

Please check if you can find an answer in our extensive documentation on Fusion.

Join Us
on Discord

Meet and talk to our staff and the entire Photon-Community via Discord.

Read More on
Stack Overflow

Find more information on Stack Overflow (for Circle members only).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

How to handle large data chunks in Fusion

WARdd
2022-03-16 14:04:02

I'm trying to build a game where players can build their own vehicles and have them fight eachother online. I'm using the Tanknarok example to figure out the particulars of this, which corresponds closely to what I'm doing but there's a few aspects that worry me.

First of all each player can have up to 2000 parts each with their own HP count and some settings, is it a good idea to just have a networked array of 2000 ints per player to sync these sort of stats? RPCs seem like a bad idea since I would be spamming them with for example machine gun fire doing 10 damage raycasts per second.

Second question is how to sync the structure of the vehicles themselves, I have a data structure for them based on arrays of strings and primitive data types, but the total file breaks into 10kb easily. Can you set such a file as a sort of custom property for players that gets downloaded as soon as anybody joins a room?

Note I'm using Fusion for the first time, so any basic info is welcome

Comments

ramonmelo
2022-03-31 06:14:41

Hi @WarlordMSM**@WARdd** ,

is it a good idea to just have a networked array of 2000 ints per player to sync these sort of stats?

How often would you need to update those parts?

It should be fine to have that amount of elements, but it really depends on how often do you will update them and what else is included on each part.

Can you set such a file as a sort of custom property for players that gets downloaded as soon as anybody joins a room?

No, but you can use the Stream System for that, as I imagine this is sent only once.

Using networked properties to sync this simply does not work because of its massive size.

Take a look at:

--

Ramon Melo

Photon Fusion Team

Back to top