Multiplayer Problem.

Get help using Construct 2

Post » Thu Apr 24, 2014 7:12 am

Hi guys,

Im messing around with the multiplayer plugin and I have built an extremely simple multiplayer game with it. It works pretty well, I can log in from my other computer and play. Everything syncs up and runs fine... for about a minute. And then the peer side seems to always loose sync, and freezes for bursts of time. There are no actions that would be causing this, as its very simple, and the controls work just fine until that happens. Anyone have a similar problem? Anyone know how to fix it? Oh, and its not a network issue either, it happens if I run the game in two browsers on the same machine as well.

Thanks
Adam
B
36
S
5
Posts: 156
Reputation: 3,310

Post » Thu Apr 24, 2014 8:24 am

Without having a sample capx of your game, it is hard to tell if it is a problem in your game code or just your internet connection :)
If you could share your capx, I am sure someone is able to help out on your problem.
B
44
S
10
G
8
Posts: 437
Reputation: 6,463

Post » Thu Apr 24, 2014 8:34 am

Ubivis wrote:Without having a sample capx of your game, it is hard to tell if it is a problem in your game code or just your internet connection :)
If you could share your capx, I am sure someone is able to help out on your problem.


Hey,

Here is a link to the file. https://dl.dropboxusercontent.com/u/5611065/Test.capx

Thanks!
B
36
S
5
Posts: 156
Reputation: 3,310

Post » Thu Apr 24, 2014 8:46 am

hmm, on IE and Firefox the game throws JavaScript errors on me after some time. I will have to let someone else have a look on your code, as I can't find a problem :(
B
44
S
10
G
8
Posts: 437
Reputation: 6,463

Post » Thu Apr 24, 2014 8:59 am

Ubivis wrote:hmm, on IE and Firefox the game throws JavaScript errors on me after some time. I will have to let someone else have a look on your code, as I can't find a problem :(


Hey,

Thanks for taking a look. Thats interesting. Is there any way you could tell me what error you are getting? It just starts acting weird and then freezes for me, but I never get any error messages.
B
36
S
5
Posts: 156
Reputation: 3,310

Post » Thu Apr 24, 2014 11:30 am

@mELTINGsKYsTUDIO - I think the problem is event 11. It's supposed to be a subevent to event 10 (check the original example). Because it's not a subevent it will run that action every tick, when it only needs to be run once. I checked the Multiplayer plugin and it will actually memory leak if you do this (meaning the game will slow down and eventually crash). I've fixed the memory leak for incorrect usage of the action for the next build, but you should still fix your events - only enable input prediction once, in a subevent to "on created".
Scirra Founder
B
395
S
232
G
88
Posts: 24,368
Reputation: 193,756

Post » Thu Apr 24, 2014 3:45 pm

Ashley wrote:@mELTINGsKYsTUDIO - I think the problem is event 11. It's supposed to be a subevent to event 10 (check the original example). Because it's not a subevent it will run that action every tick, when it only needs to be run once. I checked the Multiplayer plugin and it will actually memory leak if you do this (meaning the game will slow down and eventually crash). I've fixed the memory leak for incorrect usage of the action for the next build, but you should still fix your events - only enable input prediction once, in a subevent to "on created".


Hey,

Thanks a ton! Im upgrading to stable now. But I think youre right, that seemed to fix it. I really appreciate the help!
B
36
S
5
Posts: 156
Reputation: 3,310

Post » Thu Apr 24, 2014 8:06 pm

@Ashley

Hey, thanks again for the help, but Im still having sync issues. I made a video. It seems to work fine for a bit again, and then it seems like they lose sync. The player will be on completely different parts of the map. here is the video

https://www.youtube.com/watch?v=jRbpPoPwfcM
B
36
S
5
Posts: 156
Reputation: 3,310

Post » Fri Apr 25, 2014 2:18 am

Ive tried several things, nothing seems to be fixing that. Not sure whats going on. If I turn input prediction off it makes the controls a little laggy (as expected) but they stay synced. Im thinking it has to be something with that.
B
36
S
5
Posts: 156
Reputation: 3,310


Return to How do I....?

Who is online

Users browsing this forum: dop2000, purplemonkey, tdcostas, zenox98 and 5 guests