Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for synchronizing custom resources with MultiplayerSynchronizer #7653

Open
ywmaa opened this issue Sep 13, 2023 · 6 comments
Open

Comments

@ywmaa
Copy link

ywmaa commented Sep 13, 2023

Describe the project you are working on

a TPS Multiplayer Hero Shooter

Describe the problem or limitation you are having in your project

custom resources can't be added to MultiplayerSynchronizer to be synced automatically

Describe the feature / enhancement and how it helps to overcome the problem or limitation

MultiplayerSynchronizer allows syncing custom resources or resources in general

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

I think the MultiplayerSynchronizer will just convert the resource into Dictionary and vice versa when receiving values.

If this enhancement will not be used often, can it be worked around with a few lines of script?

I need to handle resources sync manually by RPC Calls.

Is there a reason why this should be core and not an add-on in the asset library?

MultiplayerSynchronizer is a core node.

@Calinou
Copy link
Member

Calinou commented Sep 13, 2023

@nlupugla
Copy link

One issue with sending custom resources (or in fact any Object derived class) is that there is a security risk due to the fact that they can run arbitrary (and potentially malicious) code.

It's not apparent from the PropertySelector UI, but it is possible to sync resource properties by manually typing in their property path, eg: my_resource:my_property. It would be great if the PropertySelector showed these available properties in its UI. Even better, if the dialog supported multi-select or allowed regular expressions to be entered into the text box, it would be quite quick to synch all the relevant properties in a resource.

@ywmaa
Copy link
Author

ywmaa commented Sep 16, 2023

Lol, all I wanted was this

it is possible to sync resource properties by manually typing in their property path, eg: my_resource:my_property

this needs a proper documentation, and needs this :

It would be great if the PropertySelector showed these available properties in its UI.

@ywmaa
Copy link
Author

ywmaa commented Sep 16, 2023

but my proposal may allow using the resource system as Structs (Just like the proposal linked by Calinou)

@puremj
Copy link

puremj commented Sep 24, 2023

We need annotations to mark that "this type is simple a simple value struct".

@m21-cerutti
Copy link

m21-cerutti commented May 15, 2024

For me serialisation/deserialisation option would be a good enough solution for this use case. For now, without that solution we can't use MultiplayerSynchronizer for more complex sync.
In order to do that, I suppose it would mean reimplement a custom RPC with timer implementation or send on update mechanism, and that clearly the core principle of MultiplayerSynchronizer.

Maybe we could give an object as option, like a parser into a Dictionnary or PackedBytesArray, or whatever, and that we can set optionally in the UI.

Even adding custom send/receive API in code could do the trick, and at least give one simple possibility to exchange more complex data (even if for performance a custom low level solution could be more appropriate).

Related to
#7435,
#7329,
#7653,
#9510.

@Calinou Calinou changed the title MultiplayerSynchronizer syncs custom resources Add support for synchronizing custom resources with MultiplayerSynchronizer May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants