v.175 - Text variables don't sync for multiplayer

Bugs will be moved here once resolved.

Post » Tue Jul 22, 2014 12:18 am

Problem Description
Text variables don't sync with the multiplayer object. At one stage they did, except for one specific variable. Then, with no change to events at all, none of the text variables sync. So I recreated in minimal capx to make sure. (As a side note, it would be great if we could also sync booleans!)

Attach a Capx
Attached!

Description of Capx
Press anywhere on layout1. Open game in a different browser and do the same. When they log in and join rooms, it will go to layout2 where the host will change the variables of the array. In the debugger you will see that only the number variable syncs, the text variable stays blank for the peer.

Steps to Reproduce Bug
  • Step 1: Load game in browser, press anywhere in the screen.
  • Step 2: Load game in a different browser, press anywhere in the screen.
  • Step 3: Observe results of array variable syncing in the debugger.

Observed Result
Text variables don't sync.

Expected Result
Text variables sync.

Affected Browsers
  • Chrome: Yes
  • FireFox: Yes
  • Nodewebkit (preview): Yes
  • Internet Explorer: N/A (can't connect with MP at all)

Operating System and Service Pack
Windows 8, and don't know sorry.

Construct 2 Version ID
175
You do not have the required permissions to view the files attached to this post.
B
28
S
8
G
5
Posts: 429
Reputation: 7,007

Post » Tue Jul 22, 2014 12:08 pm

This is currently by design (although it appears to be missing from the manual so I'll update that).

Streaming text values is an easy way to design inefficient games that waste tonnes of bandwidth. 'Sync instance variable' only supports numbers. To synchronise text variables, use the message sending system.
Scirra Founder
B
399
S
236
G
89
Posts: 24,519
Reputation: 195,361

Post » Tue Jul 22, 2014 12:50 pm

@Ashley Okay, thanks for the reply. Would you have any advice as to the best way to do this? I have lots of ideas, but worry about efficiency.
B
28
S
8
G
5
Posts: 429
Reputation: 7,007

Post » Tue Jul 22, 2014 2:21 pm

Just broadcast a message from the host whenever it changes to something different. The important thing for efficiency is not to send any messages when nothing is changing, and not to change the variable constantly, or if you have to, to rate-limit the messages that are sent out (e.g. 10x a second instead of every tick).
Scirra Founder
B
399
S
236
G
89
Posts: 24,519
Reputation: 195,361


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 2 guests