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

MultiplayerSynchronizer modifies value independently of property setter #63308

Closed
jgillich opened this issue Jul 22, 2022 · 2 comments
Closed

Comments

@jgillich
Copy link
Contributor

jgillich commented Jul 22, 2022

Godot version

b42bbca

System information

Fedora Silverblue 36, Ryzen 2400G

Issue description

When synchronizing a property with MultiplayerSynchronizer, the value is modified before the setter is called. Example:

var health : int = 100:
	get:
		return health
	set(value):
		if not $MultiplayerSynchronizer.is_multiplayer_authority():
			prints("set health", health, value)
               health = value

Modifying the value calls the setter, but with the value already being replaced:

set health 100 100
set health 85 85
set health 70 70
set health 40 40

Steps to reproduce

Standard MultiplayerSynchronizer setup with a node that contains a property like above

Minimal reproduction project

No response

@Faless
Copy link
Collaborator

Faless commented Aug 2, 2022

I'm unable to reproduce, I used the project in #62961 .
Edited the script to add:

@export
var setter_value := 0.0 :
	set(value):
		if not is_multiplayer_authority():
			printt(setter_value, value)
		setter_value = value

Then I started adding process delta to the value server-side.

Which resulted (client side) in:

5.93297141666652	5.94963808333319
3.58313999999999	3.59980666666666
5.94963808333319	5.96630474999986
3.59980666666666	3.61647333333333
5.96630474999986	6.02295174999986
3.61647333333333	3.67312033333333
6.02295174999986	6.07295174999986
3.67312033333333	3.72312033333333
6.07295174999986	6.08687108333319
3.72312033333333	3.73703966666666
6.08687108333319	6.08961841666653
3.73703966666666	3.73978699999999
6.08961841666653	6.09007579165674
3.73978699999999	3.74024437499021
6.09007579165674	6.09840912499008
3.74024437499021	3.74857770832354
6.09840912499008	6.15628508333319
3.74857770832354	3.80645366666666
6.15628508333319	6.22295174999986
3.80645366666666	3.87312033333333
6.22295174999986	6.23127274999986
3.87312033333333	3.88144133333333

@jgillich
Copy link
Contributor Author

jgillich commented Aug 2, 2022

Hmm, I also can't reproduce this anymore 🤷 sorry for wasting your time

@jgillich jgillich closed this as not planned Won't fix, can't repro, duplicate, stale Aug 2, 2022
@akien-mga akien-mga added archived and removed bug labels Aug 2, 2022
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

4 participants