6 ms·
Show HN: Multiplayer Snake in Go
- drKarl 14y agoYou could do a Tron from that
- phasevar 14y agoPretty cool. Although when you start, you have no idea which snake you are. I end up in the wall half the time because I suspect I'm the other snake.
- phasevar 14y agoOk, so I figured out that you're always the red snake. Might want to point that out on the page.
- deleted 14y ago[deleted]
- wizz15 14y agoToo bad for colorblind people like me, I can't distinguish the snakes by color. I end up hitting the wall most of the times.
- paulrosenzweig 14y agoSorry. Red/Green was a bad choice.
- melvinmt 14y agoHad the same thing.
- bmiranda 14y agoIn my first game we were both confused about which snake we were and ended up hitting the wall at the same time.
- ruswick 14y agoIt's a fascinating concept, but the implementation is untenably slow.
- zemo 14y agothat's not the implementation, that's the design. It gets faster as you keep playing it.
- SeanLuke 14y agoWho thinks that north/south/east/west is the right way to control a snake? The proper controls are left and right.
- dkarl 14y agoI agree. It's very hard to get used to. I can handle it when the game is slow, but the faster it gets, the more my decades-old instincts take over.
- graue 14y agoThe old QBasic Nibbles game that shipped with DOS 5.0 used up/down/left/right, and that was the one I always played as a kid. All the clones I've seen over the years use up/down/left/right as well. Which versions did you play that only use left/right?
- SeanLuke 14y ago> The old QBasic Nibbles game that shipped with DOS 5.0 used up/down/left/right, and that was the one I always played as a kid. Sigh I am old.
- Timmmmbob 14y agoEvery snake game since Nibbles uses north/south/east/west.
- phasevar 14y agoDoes anyone else think the stages ramp up too quickly? How about cranking down the speed multiplier a little bit for each round? By the time I get a long snake I spend more time just not running into an outer wall than actually trying to corner my opponent.
- loceng 14y agoBig friendly FU to all you bastards who cut me off to win...
- phasevar 14y agoThe controls don't react if you press them too quickly. How about queueing up key presses and then each additional step of the snake would dequeue a key press?
- shmageggy 14y agoAs an expert in this area (I implemented snake, once, in ascii for kicks) the problem with that approach is there's no way to undo your presses. So if you erroneously press left when you meant to press right, you're screwed. The best control strategy I found, and the one that seemed to correlate with classic implementations, is to simply take the most recently pressed key at each tick, and only allow the keys that correspond to left and right relative to your snake's direction.
- meaty 14y agoThis. Nokia 3310 style.
- a1k0n 14y agoAh, but then you can't do a quick U-turn. I think ideally you'd queue up to two moves, the second always being a 180 if any, but if you change your mind it clears the queue. E.g. you're going right, you can queue up-left or down-left but if you hit up-left-up you just go up, up-left-right you just go right, etc.
- josh2600 14y agoThis is amazing. I have fond memories of playing Lightcycle/tron-style games on some older computers against my brother as a kid. We got that program installed and we played forever. This has a lot of potential, some suggested improvements: * Chat System * Rematch (both players agree, then yes, one says no, then no) * Names for players I like this and I'm sure you could monetize this with ads if you wanted to. Have you thought about supporting more than 2 players? There are many directions you could go with this, but this is an excellent MVP, if you want it to be an MVP.
- paulrosenzweig 14y agoThanks for your feedback! A chat system might get a little ugly, but I like the rematch idea!
- orangethirty 14y agoI would pay to play snake tournaments! Look into this please.
- josh2600 14y agoAlso, have the two snakes face each other when they start. This teaches the users from the first second into the match that they can, and must, control the snake. Great job; totally wasted a morning on this.
- paulrosenzweig 14y agoGood idea. I'll add that.
- jiggy2011 14y agoMight be hard to chat and play snake at the same time. I guess you could smack talk between matches.
- psionski 14y agoI've played WAAAY to much tron to be bothered to collect the blue dots :P If nicknames are added, mine's gonna be Mongoose.
- kappaloris 14y agoif you try the U turn too fast you die. for example you're facing south and press est and then north immediately after: insta death.
- cowholio4 14y agoRemoving the background makes it much more useable. $("html").css("background","white")
- deleted 14y ago[deleted]
- moccajoghurt 14y agoIt's quite addicting, but it doesn't seem to be stable. I often just stop moving and have to refresh the browser and some enemies snake right into the wall without moving.
- lprubin 14y agoI really enjoyed playing this while it works but maybe 33% of the time the game just freezes on me and I have to refresh to get it to start working again. I have a strong internet connection so I don't think that's the problem.
- rasur 14y agoI had similar issues - glad I'm not the only one.
- HunterV 14y agoWithout a point system the one thing I've found is that the multiplayer makes it a disadvantage to play the normal game. The bigger you are the harder it is, you win when the other player crashes. Just a thought.
- lotu 14y agoIf you are bigger it is easier to make the other player crash into you.
- tjbiddle 14y agoAwesome! For some reason when I want to turn around very quick (Left/Right + Down or Left/Right + Up depending which way I'm going) I just "Die". I wouldn't run into myself in that case, so not sure what's going on. Apart from that, very cool!
- afterburner 14y agoI think it turns in on itself inside one pixel, which I don't think is right compared to the way the classic played (one turn always meant at least one pixel in that direction, no matter how fast you pressed)
- testuserrrr 14y agoThe colors scheme of the snakes/points/bg are pretty painful for the eye - even though I like background stashsnake a lot!
- paulrosenzweig 14y agoThanks! The background was drawn by draculafetus on Fiverr (http://fiverr.com/draculafetus http://fiverr.com/draculafetus). I agree that the colors/opacity combo is really ugly. Clarification: my colors, not the background's
- afterburner 14y agoNice. One complaint: when it's really slow in the beginning, you can apparently do a 180 in place and kill yourself, but it looks like you didn't turn at all. Unless that's how the classic played too... EDIT: I've had a few TRON-like cut-off or near-cutoff moments. Very cool.
- lotu 14y agoI agree the ability to kill your self with a 180 kinda sucks. It's not fun when you do it to yourself and it is not satisfying when your opponent does it either. I would make sure that it was impossible to do.
- paulrosenzweig 14y agoJust fixed the bug. I need to take it down for about a minute to deploy, so I'll deploy this when the traffic is lower.
- JulianMorrison 14y agoFor your next trick, structure it for hot redeploy.
- deleted 14y ago[deleted]
- eknkc 14y agoNow we need a HJKL plugin for this.
- paulrosenzweig 14y agoCool idea. I'll add that. ...added. Will go out in next deploy.
- smokinjoe 14y agoLove it. Refreshingly addictive. Only complaint is that I can't automatically tell which color I am to start. Maybe I'm missing something, but it's never immediately known - I need to jiggle left and right.
- paulrosenzweig 14y agoYou're red. Sorry I should have made that more clear.
- shoo 14y agomaybe the game could start paused for the first second or two, and visually indicate which snake is yours e.g. by making it flash, or explicitly labeling it ("this is your snake, there are others like it...")
- zackbloom 14y agoIt seemed really slow to take my control movements. Is it sending each move to the server before moving the snake? Maybe it needs to make the change locally (optimistically), and reconcile it after.
- mfonda 14y agoIs the Go source for this available somewhere?
- b409ba0801cd21 14y agoI have a feeling that it is going to appear at https://github.com/paulrosenzweig/hipstersnake https://github.com/paulrosenzweig/hipstersnake in the near future.
- paulrosenzweig 14y agoHaha yup, just pushed it.
- NateDad 14y agoAwesome :)
- orangethirty 14y agoHa, I just went Kamikaze on someone. This is so fun. Hope traffic does not die for a while, because I plan to play the shit out of this one. Anyone interested in forming an HN league?
- jaredsohn 14y agoIt would be nice if it would let me restart via the keyboard (spacebar?) rather than having to move my hand from the arrow keys to the mouse/trackpad.
- thekeeks 14y agoAnyone else have issues where it seems that your input is incredibly laggy? This is a great concept though. I like the simplicity.
- CoryG89 14y agoAnyone know if this is open source, github or google code project?
- paulrosenzweig 14y agoJust posted it on GitHub: https://github.com/paulrosenzweig/hipstersnake https://github.com/paulrosenzweig/hipstersnake
- Raphael 14y ago"You both lost at the same time." Nice attention to detail!
- tantalor 14y agoThe changes in speed are too discontinuous. It would be nicer if the speed smoothly transitioned (e.g., ease-in-out).
- dgudkov 14y agoCan you tell a bit more about Go's performance in this project? Number of connections, RAM footprint, etc. Thx.
- paulrosenzweig 14y agoCurrent load: Load average: 0.02 0.01 0.00 Looks like it's using about 50Mb, but I think that's just the reserved memory. It's preforming well, but even more than the performance, I think Go was a good fit due to the concurrent nature of a multiplayer game.
- feocco 14y agoTry to limit the amount of games played per minute by each IP. That way you don't have anyone sabotaging the game constantly for fun.
- Timmmmbob 14y agoNice, but doing everything server side kills the game unless you have really low latency. You should synchronise clocks between the players, then run the game physics client-side, and resolve conflicts after-the-fact.
- martinced 14y agoI thought Go was for server side "systems programming". What's the entire stack here? Is JavaScript in the browser generated from Go or!? It would be great if you could give a one-liner overview of what's going on : ) Love it btw
- kepzorz 14y agoNice, lots of fun. How about a rating system (Elo) and a leaderboard for ratings?
- warmwaffles 14y agoReally enjoyed this. The speed up was a bit annoying. The first step up in speed would have been great through out the game.
- daGrevis 14y agoThis is pretty awesome! Where I can find Go code?
- gren 14y agoRight now, It's more a 2-player than a "multiplayer snake". I would love to see how your game will evolve. It reminds me another cool multiplayer snake https://twitter.com/syl_mat/status/154136259588141056 https://twitter.com/syl_mat/status/154136259588141056 (it supports more than 2 players, the game is never ending but player accumulate points, it also has bots)
- srikrishnan 14y agoI saw quite a few opponents mistake themselves to be the wrong snake and crash out. A little callout saying "this is you" at the start of a match would help! Took me back a decade to days of playing Gnibbles with 3 others on the same keyboard in my computer lab in school :D.