News for hackers. Stuff that matters.
Re:Swarmation: like musical chairs for pixels by roryokane on Monday August 30, 2010 @01:25AM (#1645474)
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.
Re:Swarmation: like musical chairs for pixels by ElbertF on Monday August 30, 2010 @04:50AM (#1645710)
I'm embarrassed by how proud this made me: http://i.imgur.com/QtIfy.png
Re:Swarmation: like musical chairs for pixels by palish on Monday August 30, 2010 @03:43AM (#1645642)
I was about to give up and call it "boring" until I read this comment!
Re:Swarmation: like musical chairs for pixels by aaronblohowiak on Monday August 30, 2010 @03:19AM (#1645619)
against or with?
Re:Swarmation: like musical chairs for pixels by igravious on Monday August 30, 2010 @07:44AM (#1645946)
Sabateours spring to mind. They stay in place right til the end and then move one pixel away. Aaaaaargh!
Re:Swarmation: like musical chairs for pixels by po on Monday August 30, 2010 @08:05AM (#1645971)
Those aren't saboteurs… I believe scoring is done on the client side so they got the point and are rushing to do the next shape.

They either need to do scoring server side, or there needs to be some sort of locking.

Re:Swarmation: like musical chairs for pixels by steadicat on Monday August 30, 2010 @12:50PM (#1646728)
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.

Re:Swarmation: like musical chairs for pixels by po on Monday August 30, 2010 @10:26PM (#1648228)
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.

Anyway, great game. You got my vote.

Re:Swarmation: like musical chairs for pixels by aaronblohowiak on Monday August 30, 2010 @02:38PM (#1647098)
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.
Re:Swarmation: like musical chairs for pixels by steadicat on Monday August 30, 2010 @04:21PM (#1647425)
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.
Re:Swarmation: like musical chairs for pixels by leot on Monday August 30, 2010 @03:42AM (#1645641)
Well, maybe. Part of the fun for me was the discovery that it was other people with whom I was playing.
Re:Swarmation: like musical chairs for pixels by devonrt on Monday August 30, 2010 @11:03AM (#1646370)
I'm sorry, but really? It was obvious to me within 5 seconds that I was playing with humans.
Re:Swarmation: like musical chairs for pixels by ollerac on Monday August 30, 2010 @10:47AM (#1646320)
it'd be super awesome if you could vote for us in the node knockout competition http://nodeknockout.com/teams/saber-tooth-moose-lion

thanks !

Re:Swarmation: like musical chairs for pixels by CytokineStorm on Sunday August 29, 2010 @08:50PM (#1645030)
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.
Re:Swarmation: like musical chairs for pixels by Rauchg_ on Sunday August 29, 2010 @10:16PM (#1645179)
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:

http://swarmation.com

http://maprejuice.com/

http://demiox-boiko.no.de/

http://piston-hurricane.no.de/

http://nodelicious.no.de/

http://virtual-design.no.de/

http://inflatable-chum.no.de/

http://fragnut.me/

http://braintree.no.de/

http://nodty.no.de/

http://tweetquestgame.com

http://speedo.no.de/

http://piratetron.com/

http://error-500.no.de

Re:Swarmation: like musical chairs for pixels by thegoleffect on Monday August 30, 2010 @12:31AM (#1645393)
Re:Swarmation: like musical chairs for pixels by steadicat on Sunday August 29, 2010 @09:00PM (#1645058)
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?").

Re:Swarmation: like musical chairs for pixels by hendler on Sunday August 29, 2010 @10:17PM (#1645181)
Congrats guys. I really enjoyed - the fact that it is playable (technically and interactively) and built in a weekend shows vision and focus.
Re:Swarmation: like musical chairs for pixels by mcantelon on Sunday August 29, 2010 @08:55PM (#1645045)
Nice... I noticed that, unlike a number of other Node Knockout entries, it worked fine in Firefox. Will have to try that lib.
Re:Swarmation: like musical chairs for pixels by Groxx on Sunday August 29, 2010 @08:25PM (#1644983)
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.

Re:Swarmation: like musical chairs for pixels by TheEzEzz on Sunday August 29, 2010 @10:44PM (#1645224)
Very cool.

Occasional bug: I found myself 'winning' even when I was clearly not part of a pattern (sometimes even totally separated). Running Vista Chrome.

Re:Swarmation: like musical chairs for pixels by ollerac on Monday August 30, 2010 @12:30AM (#1645392)
ya, this is one of the top bugs we want to fix. thanks
Re:Swarmation: like musical chairs for pixels by camwest on Sunday August 29, 2010 @08:12PM (#1644949)
Wow I can't believe how FUN this is.

Edit: I just realized no one is commenting because everyone is still busy playing it.

Re:Swarmation: like musical chairs for pixels by SandB0x on Sunday August 29, 2010 @08:13PM (#1644952)
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.

^ http://homepages.inf.ed.ac.uk/rbf/HIPR2/open.htm

Re:Swarmation: like musical chairs for pixels by v21 on Tuesday August 31, 2010 @07:50AM (#1649063)
Yaay, Bob Fisher! I once dressed as him for a party, with a cardboard cutout of his face over my face.

I'm sorry, this comment isn't strictly relevant, but I don't get a chance to tell that story very often.

Re:Swarmation: like musical chairs for pixels by giantfuzzypanda on Sunday August 29, 2010 @11:34PM (#1645302)
Everyone's own square appears blue.
Re:Swarmation: like musical chairs for pixels by DaemonXI on Monday August 30, 2010 @02:55AM (#1645586)
Thank you, panda. That was the joke.
Re:Swarmation: like musical chairs for pixels by sciolistse on Sunday August 29, 2010 @08:21PM (#1644975)
It's really made me realize how irritated i can get by gray blocks moving out of formation.
Re:Swarmation: like musical chairs for pixels by ollerac on Monday August 30, 2010 @12:36AM (#1645407)
have you managed to complete the lobster formation yet? i'm starting to think it might be impossible
Re:Swarmation: like musical chairs for pixels by caryme on Sunday August 29, 2010 @08:32PM (#1644997)
After playing for a while, I think the best strategy is to simply not move.
Re:Swarmation: like musical chairs for pixels by shrikant on Sunday August 29, 2010 @09:59PM (#1645155)
That's quite a WOPR of a discovery..
Re:Swarmation: like musical chairs for pixels by simplify on Sunday August 29, 2010 @09:52PM (#1645144)
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
Re:Swarmation: like musical chairs for pixels by ollerac on Monday August 30, 2010 @12:35AM (#1645404)
it might even be nice if the teams were forced to cooperate sometimes. if each team was a different color we could have color coded formations.

any more ideas?

Re:Swarmation: like musical chairs for pixels by muxxa on Monday August 30, 2010 @05:12AM (#1645734)
Penalize pixels which touch a correct position but are not part of it
Re:Swarmation: like musical chairs for pixels by Ayjay on Sunday August 29, 2010 @11:50PM (#1645322)
You should have your colour change when you reach certain point thresholds - when you "level up" I guess.

Also, maybe then you can push lower-level pixels around?

-- Ayjay on Fedang

Re:Swarmation: like musical chairs for pixels by jamram82 on Sunday August 29, 2010 @11:12PM (#1645267)
Probably the first collaborative multiplayer game without any element of communication.
Re:Swarmation: like musical chairs for pixels by roryokane on Monday August 30, 2010 @01:36AM (#1645491)
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.
Re:Swarmation: like musical chairs for pixels by ollerac on Monday August 30, 2010 @12:38AM (#1645412)
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
Re:Swarmation: like musical chairs for pixels by Deestan on Monday August 30, 2010 @01:26AM (#1645477)
I think a chat would just add frustration and abuse.
Re:Swarmation: like musical chairs for pixels by ANH on Monday August 30, 2010 @07:46AM (#1645950)
Yeah, no chat. Simplicity is good here.
Re:Swarmation: like musical chairs for pixels by obsessive1 on Sunday August 29, 2010 @08:40PM (#1645008)
I love how I have no idea what is going on or what to do, yet it still keeps telling me I win.
Re:Swarmation: like musical chairs for pixels by kapitalx on Monday August 30, 2010 @12:38AM (#1645414)
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.
Re:Swarmation: like musical chairs for pixels by agravier on Monday August 30, 2010 @03:19AM (#1645620)
After a few games (1 to 5), new formations stop showing up and other players stop moving.

Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.8) Gecko/20100724 Firefox/3.6.8

Re:Swarmation: like musical chairs for pixels by oldgregg on Monday August 30, 2010 @12:55AM (#1645437)
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.

Re:Swarmation: like musical chairs for pixels by mrduncan on Sunday August 29, 2010 @09:31PM (#1645112)
Fascinating.

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.

Re:Swarmation: like musical chairs for pixels by cturner on Monday August 30, 2010 @07:01AM (#1645874)
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.

Re:Swarmation: like musical chairs for pixels by brown9-2 on Sunday August 29, 2010 @09:01PM (#1645059)
It took me a few minutes to realize I was playing this game with other people, nice work.
Re:Swarmation: like musical chairs for pixels by igravious on Monday August 30, 2010 @07:41AM (#1645941)
Uh. Awesome. Best thing on the net in ages.

Feature request:

  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.
Re:Swarmation: like musical chairs for pixels by chrischen on Sunday August 29, 2010 @09:23PM (#1645098)
You should add a leaderboard.
Re:Swarmation: like musical chairs for pixels by ollerac on Monday August 30, 2010 @12:25AM (#1645388)
we plan to after node.js ko is over
Re:Swarmation: like musical chairs for pixels by ANH on Monday August 30, 2010 @07:43AM (#1645945)
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.
Re:Swarmation: like musical chairs for pixels by manveru on Monday August 30, 2010 @06:33AM (#1645824)
Well, it's easy to get almost every formation, just open 30 tabs or so and move them all into a square. Unfortunately this game eats CPU like mad.
Re:Swarmation: like musical chairs for pixels by frethaygil on Sunday September 05, 2010 @06:06AM (#1664297)
I can't play this, I've tried both Chrome and Explorer, both come up with a blank grid and the word 'wait' in the top right.
Re:Swarmation: like musical chairs for pixels by ww520 on Sunday August 29, 2010 @11:52PM (#1645324)
How do you play this game? Nothing works for me. I press left/right/up/down but nothing happens.
Re:Swarmation: like musical chairs for pixels by trafficlight on Monday August 30, 2010 @12:19AM (#1645378)
Try Chrome. Firefox 4 doesn't work for me.
Re:Swarmation: like musical chairs for pixels by mcgraw on Sunday August 29, 2010 @10:32PM (#1645201)
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.

Despite the problems it is pretty slick.

Win 7, Firefox 3.6.8.

Re:Swarmation: like musical chairs for pixels by ollerac on Monday August 30, 2010 @12:46AM (#1645424)
i think firefox 4.0 will have support for websockets but until then we have to rely on fall-backs provided by the socket.io library.

although i successfully tested this game in firefox 3.6, i suggest you try chrome or safari for a better experience.

Re:Swarmation: like musical chairs for pixels by dschobel on Monday August 30, 2010 @12:09AM (#1645356)
wow, and there's a group making swastikas in the corner. classy.
Re:Swarmation: like musical chairs for pixels by gojomo on Monday August 30, 2010 @01:38AM (#1645494)
Achiever, Explorer, Socializer, Griefer.
Re:Swarmation: like musical chairs for pixels by shard on Thursday September 02, 2010 @04:07AM (#1655577)
Maybe they're Buddhists.
Re:Swarmation: like musical chairs for pixels by hartror on Sunday August 29, 2010 @10:04PM (#1645164)
This had me smiling in seconds, love it so much!
Re:Swarmation: like musical chairs for pixels by 0x5a177 on Monday August 30, 2010 @01:34PM (#1646883)
I don't remember ever playing a game this simple that made me start giggling.
Re:Swarmation: like musical chairs for pixels by xtacy on Sunday August 29, 2010 @09:39PM (#1645124)
This looks very cool! Can someone point me to a place which lists a collection of useful HTML5 tools/libraries to build stuff like these?

Thanks!

Re:Swarmation: like musical chairs for pixels by CytokineStorm on Monday August 30, 2010 @12:50AM (#1645432)
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.

Re:Swarmation: like musical chairs for pixels by chrismealy on Sunday August 29, 2010 @09:10PM (#1645076)
This is fantastic. What a great demonstration of the limits of self-organization!
Re:Swarmation: like musical chairs for pixels by st0p on Monday August 30, 2010 @03:17PM (#1647208)
Indeed it is fantastic, But I was more surprised about the powers of self-organization than the limits of it!
Re:Swarmation: like musical chairs for pixels by chrismealy on Friday September 03, 2010 @06:23PM (#1661363)
You haven't tried to make the hat!
Re:Swarmation: like musical chairs for pixels by dilli on Tuesday August 31, 2010 @05:15AM (#1648860)
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.
Re:Swarmation: like musical chairs for pixels by Qz on Sunday August 29, 2010 @09:46PM (#1645134)
the blue pixel doesn't show up for me on firefox after the first time i go to the page (aka cant play anymore)
Re:Swarmation: like musical chairs for pixels by exit on Monday August 30, 2010 @02:24AM (#1645553)
where did you host this?
Re:Swarmation: like musical chairs for pixels by steadicat on Monday August 30, 2010 @04:26PM (#1647442)
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).

The Joyent guys have also been tweeting network graphs for our app, which makes us comfortable that they're keeping a watchful eye on our instance for us: http://skitch.com/jimpick/dwjfw/flow-saber-tooth-moose-lion0... :)

Re:Swarmation: like musical chairs for pixels by donaq on Monday August 30, 2010 @05:49AM (#1645774)
Uh, block fits all patterns.
Re:Swarmation: like musical chairs for pixels by igravious on Monday August 30, 2010 @07:54AM (#1645957)
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 :)