Discuss Scratch
- Discussion Forums
- » Show and Tell
- » Need Help Testing Multiplayer Engine
- Magnie
-
100+ posts
Need Help Testing Multiplayer Engine
I need to check if there is a difference in everyone's time-in-seconds sensor to see if my idea of automatic connecting and disconnecting system works.
http://mv.ezproxy.com.ezproxyberklee.flo.org/projects/10083509/
http://mv.ezproxy.com.ezproxyberklee.flo.org/projects/10083509/
- bobbybeetest
-
15 posts
Need Help Testing Multiplayer Engine
I think what might work well is to designate one person (e.g. a VPS running a program that speaks cloud protocol) who can be gauranteed to have an accurate timer, and have that single person be responsible for timing. Alternatively, you could try peer-to-peer load-balancing of the timers.
- Magnie
-
100+ posts
Need Help Testing Multiplayer Engine
Since I don't really have a VPS, I'm going to have to stick with p2p load-balancing. Could you (or someone else) write a script to do that for me? I think what might work well is to designate one person (e.g. a VPS running a program that speaks cloud protocol) who can be gauranteed to have an accurate timer, and have that single person be responsible for timing. Alternatively, you could try peer-to-peer load-balancing of the timers.
- botcrusher
-
500+ posts
Need Help Testing Multiplayer Engine
so idealy if you are going with the fake user idea you need
-a computer always on
-unlimited bandwith (or ridiculously high one)
-a computer always on
-unlimited bandwith (or ridiculously high one)
- bobbybeetest
-
15 posts
Need Help Testing Multiplayer Engine
Since I don't really have a VPS, I'm going to have to stick with p2p load-balancing. Could you (or someone else) write a script to do that for me? I think what might work well is to designate one person (e.g. a VPS running a program that speaks cloud protocol) who can be gauranteed to have an accurate timer, and have that single person be responsible for timing. Alternatively, you could try peer-to-peer load-balancing of the timers.
I'll attempt to, anyway. Do you mind if I only do pseudo code, for the sake of the not having to drag and drop everything? (or just write the algorithm to run in JavaScript or some ther very high level language)
- LiquidMetal
-
100+ posts
Need Help Testing Multiplayer Engine
The days since 2000 block data is hosted on the server, rather than being based on local system settings, so it should be possible to use it to eliminate the problem. See this example.
Someone reported the same bug in my version. Did I not fully understand the problem?
Someone reported the same bug in my version. Did I not fully understand the problem?
Last edited by LiquidMetal (March 20, 2013 00:11:47)
- Magnie
-
100+ posts
Need Help Testing Multiplayer Engine
example.We kind of need a “seconds since 2000” block, otherwise, disconnecting players can take 24 hours. :p The days since 2000 block data is hosted on the server, rather than being based on local system settings, so it should be possible to use it to eliminate the problem. See this
Someone reported the same bug in my version. Did I not fully understand the problem?
Edit: Oh, I didn't realize that timer included the seconds… Now I can fix this.
Edit 2: Yeah, thanks for that discovery.


Last edited by Magnie (March 20, 2013 01:03:51)
- LiquidMetal
-
100+ posts
Need Help Testing Multiplayer Engine
In my version, I replaced the (current ) block in the stage's main script with the currentTime variable. Did you specifically leave it as seconds? Also, someone reported a multiuser on mine… So I'm not sure if the problem was fixed.
EDIT: Or was that a separate problem?
You could have players add 1 to player1 taken instead of set; then check if its 2; if so, remove one and wait randomly and whichever gets it first would take it. Deadlock problem might come up then. Lists would be useful to queue. Oh well.
EDIT: Or was that a separate problem?
You could have players add 1 to player1 taken instead of set; then check if its 2; if so, remove one and wait randomly and whichever gets it first would take it. Deadlock problem might come up then. Lists would be useful to queue. Oh well.
Last edited by LiquidMetal (March 20, 2013 02:20:08)
- Magnie
-
100+ posts
Need Help Testing Multiplayer Engine
No, I forgot to replace those. In my version, I replaced the (current ) block in the stage's main script with the currentTime variable. Did you specifically leave it as seconds? Also, someone reported a multiuser on mine… So I'm not sure if the problem was fixed.

You could have players add 1 to player1 taken instead of set; then check if its 2; if so, remove one and wait randomly and whichever gets it first would take it. Deadlock problem might come up then. Lists would be useful to queue. Oh well.Yeah, I was thinking of a queue as well, but that'll get a little more complicated.
- LiquidMetal
-
100+ posts
Need Help Testing Multiplayer Engine
Would it make sense to have one server for dealing with this stuff? (Someone runs project from some computer that is always on?) I know this would be inconvenient if the server was “down” ever, but it might make some of the problems easier to deal with. Or you could just wait for cloud lists.
- Magnie
-
100+ posts
Need Help Testing Multiplayer Engine
Well, it's not as portable if someone has to always have a project running on their computer… The real point of this project was to create an automatic system that dealt with new connections and disconnections so people don't have to press a Leave/Exit button before they close the web page. Would it make sense to have one server for dealing with this stuff? (Someone runs project from some computer that is always on?) I know this would be inconvenient if the server was “down” ever, but it might make some of the problems easier to deal with. Or you could just wait for cloud lists.
- LiquidMetal
-
100+ posts
Need Help Testing Multiplayer Engine
Ok; Why do you have both users testing for both users timeouts instead of just testing the other? Testing its own could be separate for server disconnect, maybe?
- Magnie
-
100+ posts
Need Help Testing Multiplayer Engine
You can't really have users test themselves for disconnections… Could you explain what you mean? Ok; Why do you have both users testing for both users timeouts instead of just testing the other? Testing its own could be separate for server disconnect, maybe?
- LiquidMetal
-
100+ posts
Need Help Testing Multiplayer Engine
It seems to me that both users test the other player and themselves for disconnection. I don't understand why it would be like that.
Users cannot test themselves for disconnection and remove from list, but can alert player if cloud variables became suddenly unavailable.
Users cannot test themselves for disconnection and remove from list, but can alert player if cloud variables became suddenly unavailable.
- Magnie
-
100+ posts
Need Help Testing Multiplayer Engine
At most the users test everyone else, they can't really test themselves other than telling everyone else that they are still “active.” It seems to me that both users test the other player and themselves for disconnection. I don't understand why it would be like that.
Users cannot test themselves for disconnection and remove from list, but can alert player if cloud variables became suddenly unavailable.
- LiquidMetal
-
100+ posts
Need Help Testing Multiplayer Engine
I just looked at the scripts again, and I don't see the problem I was complaining about any more. Perhaps you fixed it in between, but now, it doesn't work at all. Could you add a username tracker for the p1 and p2 slots just so we can see who it thinks is in the game? Right now noone is moving but it doesn't set me into 1 or 2 and claims its full.
- Magnie
-
100+ posts
Need Help Testing Multiplayer Engine
Just fixed that bug (hopefully). It had something to do with continually checking if the other player was disconnected or not. I'll have to do some more testing later. I just looked at the scripts again, and I don't see the problem I was complaining about any more. Perhaps you fixed it in between, but now, it doesn't work at all. Could you add a username tracker for the p1 and p2 slots just so we can see who it thinks is in the game? Right now noone is moving but it doesn't set me into 1 or 2 and claims its full.
- Discussion Forums
- » Show and Tell
-
» Need Help Testing Multiplayer Engine