You really should make it clearer that this is against other humans. When I saw the page, I thought the other pixels were just automatons. Even when I saw some forming letters in the corner, I just thought “interesting, some of them are programmed to not participate”. And I thought moving around was pointless because I couldn’t predict where the computer would move its pixels, so I had no idea how to get into position but to just stand there. It was only by reading these comments that I realized that the other pixels were other players, which increased my enjoyment of the game immensely because of the feeling of cooperation with others, and the understanding of why the other pixels act the way they do.
I’m actually quite proud of having implemented the scoring client-side. It helps keep the load on the server down. Looking up all possible formations is somewhat computationally intensive.
It does create some problems when some clients have high latency and don't detect the formation in time, but I think it's fixable. One way could be to make the computation redundant, e.g. get three pixels to do the detection instead of one, and consider the formation valid if 2 out of 3 of them report success.
Don't get me wrong. I totally agree that you made the right choice, especially for the node knockout.
This might be completely over the top but perhaps you should look into lag compensation technique that FPS games use. There is a global state on the server and the clients send their command with a timestamp. The server then looks at the global state XXXms ago.
You're going to need global state and scoring if you ever want a leaderboard (otherwise people will just game it).
You could also just make it so that it doesn't show the clock during the last three seconds or something. Show "calculating..." or something and give people whatever the greatest lag time is grace period.
Verifying that a pixel is valid is much, much, much less intensive than searching for all possible valid pixels. You could do the scoring client-side, with the server verifying.
That wouldn't take care of a formation not being detected because the pixel responsible for it has very high latency or is disconnecting. I think this kind of false negative is a much bigger issue than the false positives.
Thanks for all the feedback. This was my entry in the Node knockout competition, along with @ollerac and @steadicat. This app was built using the awesome sockets.io library which made it simple to send realtime messages without dealing with cross-browser compatibility issues. Really the server's only job is to pass messages back and forth between the clients, who do all the work of detecting the formations and updating the other players when they move.
Really happy to see socket.io working for you guys. As someone mentioned, not only should it enable WebSocket for Firefox, but also IE6-8, iPad, iPhone, Android, WebOS, Safari 3, and others (even if connected through cross-domain)
Some other projects from the knockout leveraging it:
What I find amazing is how much fun people are having with it despite the fact that we had no idea what the game mechanics would be until the last minute.
We basically started with a board of pixels, and everything else just evolved through testing and laziness ("what's the simplest thing we can do to make the game slightly less pointless?").
I love how reliable everyone is when Block comes up. WHERE WERE YOU WHEN I ALMOST HAD LOBSTER?!
addicting.
edit: hmm. I think the match-algorithm is a bit too forgiving. Several of the forms can be "solved" by just clumping together. Though, given how many are still missed, maybe that's not a bad thing.
Yes, this game is absolute genius. Felt really sorry for the guy (X) who got stuck running around in the middle of the Fortress formation a minute ago. Like:
#####
#X #
# # #
# #
#####
I'm the one in the blue, by the way.
Edit: This makes me think about mathematical morphology^, used in image processing. You win when you are inside the opening of the set of pixels by the given structuring element.
i.e. you win when you are in any place where the shape can fit.
Here's a fun idea: split players up into multiple teams i.e. only pixels of the same team can make formations, and points are awarded to each team as a whole
There is a little bit of communication. For instance, if you want to lead someone somewhere, you can try running circles around them and then running in a direction, and then running back to them. I don’t know if they would understand, but you could try.
is this a good thing? we were considering adding the ability to chat as a special power, but i kind of like the simplicity/anonymity of the current setup
Yeah found myself in the same situation. Or sometimes I was part of the pattern that matched, and I didn't win. I think this is just a bug and they'll probably fix it soon.
This is SWEEET. My requests 1) Leaderboard: show the top 10 players plus my rank. Much more incentive to keep playing. 2) Tag the leader with some kind of color. 3) Bring a little more structure. No idea how to do this.
If people call it Web 3.0 I'll shoot myself in the face, but I think there's really something about this whole realtime web.
What has been most interesting to me is to watch the game as more and more people join. When I first started watching, there were about 30 or so pixels was swarming around the middle of the board - now, there are three distinct swarms in different areas of the board, each comprised of about 20-30 pixels.
Many thanks for this. It's a joy to play. I'm surprised by how good the vibe is in the game. I think there's a bug with the Y pattern - it never gets recognised in the games I participate in.
It would be nice if you could get a reward at a thousand points - for example - being able to write a message.
1) Leaderboard (all scores periodically reset? countdown to reset?)
2) Top scorers colour-coded.
3) Ability for my fellow pixels to hear me swearing at the top of my lungs at them.
This is alarmingly addictive. Only problem was it took me about a minute to figure out my browser window was too small to see the target shape, so I had almost no idea what was going on. Still, incredibly cool.
For some reason when I start the game I lose connection with everyone after 5 or so seconds (all pixels are at a stand-still after they had been moving). The counter continues to count down as well.
A good place to start is http://html5boilerplate.com/. This provides a good starting point and includes the modernizr library by default, which makes it very easy to check for compatibility with HTML5 features like canvas, video/audio tags and websockets.
Dive into HTML5 by Mark Pilgrim has also been a helpful reference for me.
is there anything wrong? I tried it with firefox, chrome, safari - i can move my pixel, but I always stay alone, seeing only a "wait" in the top right and no shape to create.
This is on one of the SmartMachines that Joyent donated to the Node Knockout competition. We’ve been very impressed with it. Very easy deployment, and the server's been chugging along smoothly since launch (save the occasional restart due to invalid HTTP requests crashing some of our Node.js libs).
It's a tough one though. They need to ignore some random pixels but then again making a giant block shape is a loophole. Maybe calculate match as a percentage of the pixels that would be blank? Dunno. Tricky but doable :)