Player objects not syncing in All like in Windows

Posted by colinator27
Whenever I log in as one user and then have another join, the first player cannot be seen by the second one, but the first one can see the second one.

Also, when changing rooms, neither players can see each other.

This is in All, where in Windows this did not happen.

Any idea on how to fix this? (i'm probably a noob)

Replies (28)

Last message on 5 Mar 2017

Size43 (Administrator) on 6 Jan 2017, 10:02:10
Did you add a call to gms_network in the GMS object when switching from the Windows to the All version?
nthung90 on 16 Feb 2017, 18:19:26
Hello Size43, I have the same problem with colinator27.

"Whenever I log in as one user and then have another join, the first player cannot be seen by the second one, but the first one can see the second one.

Also, when changing rooms, neither players can see each other.

This is in All, where in Windows this did not happen.
"

Do you know why? How to fix it?

Looking for your reply soon. Thanks :)
colinator27 (Topicstarter) on 6 Jan 2017, 21:20:04
Yes, I did.

Oh, and sorry to change the subject suddenly, but strangely on some network connections I am unable to connect to the server in general. The game takes a while to load the window. (GMS object is in the first room)

Because of this, I'm now unable to re-test this and I don't know what to do...
colinator27 (Topicstarter) on 7 Jan 2017, 13:55:45
InitGraphics()
Finished PrepareGame()
Run_Start
Socket timeout connecting
Socket failed to connect to server!
Connected.

^ This is what I see whenever I launch the game (inside of Studio, and then the game fails to connect)
Size43 (Administrator) on 10 Jan 2017, 15:32:17
This seems to sometimes occur. I'm not quite sure why it is happening, as both the Windows and the All version connect to the same socket.

Would you be able to check what the following 4 functions return on a network that's normally not able to connect to the server?

network_resolve("gamemakerserver.com")
network_resolve("http://gamemakerserver.com")
network_resolve("www.gamemakerserver.com")
network_resolve("http://www.gamemakerserver.com")
colinator27 (Topicstarter) on 10 Jan 2017, 23:26:46
Okay, so I'll test these out, but something strange just happened. It actually connected one time, and then the next time I tried it resulted in a fail. (within the same few minutes)

network_resolve("gamemakerserver.com") = 0.0.0.0
colinator27 (Topicstarter) on 10 Jan 2017, 23:27:10
network_resolve("http://gamemakerserver.com") = when in a show_message, nothing returned.
colinator27 (Topicstarter) on 10 Jan 2017, 23:28:37
Sorry, I didn't mean to hit send so many times. I'll keep the rest in one message.

network_resolve("www.gamemakerserver.com") = 149.210.181.182 (seems to be the website's IP)

network_resolve("http://www.gamemakerserver.com") = Also nothing in a show_message
Size43 (Administrator) on 11 Jan 2017, 16:42:14
Seems like the IP is somehow being resolved incorrectly. It'll use "0.0.0.0" instead of the actual IP.

I think I've fixed this issue. Please check if the following version fixes the connection problem:

http://gamemakerserver.com/staticcontent/GameMaker%20Server%201.9.3.zip
mpgame on 11 Feb 2017, 14:37:31
Size, I have a strange problem like above.

I can't login with asus fonepad tablet... when I set every username and password, login box says "wrong password"! but usernames and passwords are correct because they work in my LG phone and my PC. However I can register a new account and shows "Registration complete" but I can't login by same account. I tested this problem by 2 different wifi and mobile network data and another asus fonepad, also!

My question is that why login box says "wrong password"?!
mpgame on 16 Feb 2017, 17:15:55
PS: such as for Samsung Galaxy S6 Edge... even register box says email is Repetitious, mistakenly.
mpgame on 11 Feb 2017, 14:55:11
I think, that is an unwanted banning or something...
Size43 (Administrator) on 16 Feb 2017, 16:15:40
If you're banned, it would just tell you that. Wrong password most likely just means that the password is somehow incorrect.

Which export are you using for this?

Are you able to login to the account on the site if you register on your tablet?
mpgame on 16 Feb 2017, 18:29:02
Usernames and passwords are correct but in some phones this problem exists. I publish my game for android and feedback says: for Samsung Galaxy S6 Edge and asus fonepad this problem appears so far... They can't register or login by their phones but I can by their accounts!
mpgame on 22 Feb 2017, 19:02:19
Huawey y520 is a new case with that problem. Register box says username has already been taken, for any new username!
Size43 (Administrator) on 5 Mar 2017, 19:47:33
So is this all running the same package? If yes, this might be a GameMaker bug. The same GML is used for every device, and GameMaker should make sure it runs the same way on each device.
colinator27 (Topicstarter) on 11 Jan 2017, 21:31:08
Alright, I'll test it out. Thanks!

Okay, so it seems to work properly now! Thank you so much for helping me out. (and for creating this entire project in the first place.)
Size43 (Administrator) on 11 Jan 2017, 22:00:01
Awesome! I'll release the bugfix in the next few days for everyone else.
colinator27 (Topicstarter) on 14 Jan 2017, 22:26:14
Anyway, now that these bugs have been fixed, how would I fix the players not properly syncing? I believe it may be all client-side, but I don't know.

The syncing range may impact it as well. When a player walks off-screen, they disappear forever, strangely.
Size43 (Administrator) on 22 Jan 2017, 09:20:06
Are you destroying or deactivating (instance_deactivate) the instances at any point? You'll need to add exceptions for player objects, the GMS object, and synced instances.
colinator27 (Topicstarter) on 22 Jan 2017, 14:15:19
I don't believe so, but I ran some tests and found out that the other players' x and y coordinates end up being -1000. They actually ARE there for both. What does this mean?

Oh, I looked in the extension scripts and found that this means it detected that the players aren't in the same room, but they are in the same room... odd.
Size43 (Administrator) on 30 Jan 2017, 10:53:21
Do you switch rooms after logging in? If not, the extension might not detect the room properly.
colinator27 (Topicstarter) on 4 Feb 2017, 17:16:44
I do switch rooms, hmm. What could cause the extension not to detect rooms properly other than that?
Size43 (Administrator) on 5 Feb 2017, 14:16:20
You can check what room the game thinks a player is in by checking the room_id variable on the other player object (needs at least 1 step after create before it is set). What value does it have?
colinator27 (Topicstarter) on 6 Feb 2017, 00:56:00
Huh... it seems to be 0.
Size43 (Administrator) on 16 Feb 2017, 16:01:39
Does the variable exist at all? You can use gms_other_exists(player_id, "room") in the other plaer object to check.
colinator27 (Topicstarter) on 17 Feb 2017, 18:35:27
Strange... it returns true, or just "1."

I also decided to test what the value of the "room" variable is actually is after they walk away (in normal testing it starts at 5), and in a show_message, it seems that "" appears now. It still reports the value exists, though. I think this blank value may appear now because last time we tested it through the object's room_id itself and not through the GMS extension, which resulted in 0.
Size43 (Administrator) on 5 Mar 2017, 17:11:12
Would you mind mailing me your project (or a minimal test project that has the same bug) so I can take a look?