Multiplayer Sync Object not syncing object size/scale?

Discussion and feedback on Construct 2

Post » Fri Jun 27, 2014 9:38 am

Hi. I used the Sync Object on Start of Layout to sync some objects and their instance variables. To make it work all synced objects are destroyed on the peers and then recreated by the host. This works fine so far BUT all ojects on the peer appear in the wrong (original) size and dont have the reduced sice from the Host. I tried syncing positon + angle but it seems the scale/size is not synced. Can't you resize objects which are synced? :?:
Bl4ckSh33p-Soft - Custom Software and Indie Games
B
58
S
18
G
6
Posts: 756
Reputation: 9,591

Post » Fri Jun 27, 2014 10:00 am

It seems the collision poly changes size when you sync an object and change its size on the host but the actual sprite does not increase in size. Is this intended and I have to set the size on host and peers individually (in common group for both)? But why does the collision poly increase?
Bl4ckSh33p-Soft - Custom Software and Indie Games
B
58
S
18
G
6
Posts: 756
Reputation: 9,591

Post » Sat Jun 28, 2014 9:02 pm

No, it does not sync the size of objects.
Since the host handles the collisions and positions of objects, it also handles the collision polygon size,
so it may seem like the collision polygon is synced, but it is not ;)
You have to set the object size on both sites, yes.
- Conti
"It's done when it's done"

Shadows of War
Buy on Steam ;)
B
24
S
10
G
7
Posts: 253
Reputation: 4,931

Post » Sun Jun 29, 2014 12:41 pm

It's by design that the Multiplayer object only syncs the absolute minimal set of properties that you specifically tell it to, in order to avoid wasting bandwidth. If it synced all the object's expressions that would likely use a huge amount of bandwidth and make it impractical to use, so anything extra you want to sync you have to explicitly add.

The easiest way to do that is add an instance variable, sync the variable, and use it to store the intended width/height (or just a single scale value if that's all you need and want to save bandwidth).
Scirra Founder
B
402
S
238
G
89
Posts: 24,613
Reputation: 195,993

Post » Sun Jun 29, 2014 12:48 pm

Ok, I will do that. Thank you. :)
Bl4ckSh33p-Soft - Custom Software and Indie Games
B
58
S
18
G
6
Posts: 756
Reputation: 9,591


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 4 guests