Monday, March 12, 2012

GnuGo + Node.JS == Go babies!

So I was working on getting Node.JS hooked up to Fuego go engine yesterday, but I ran into a bunch of problems.  The weirdest being the stdout data buffer would cut off at 250bytes with no further data events being emitted :( uh.. wut? anyway:

No such problems with GnuGo (so far), just ran this little test alternating black/white peices on a column and displaying an ascii board (not very useful in the grand scheme, but nice to see things are working much more smoothly :D)

Maybe I'll write an actual module for hooking this up in a nice abstract and easy to use way. I was looking at the node-redis codes last night to get ideas as I was trying to write a module for Fuego (glad I gave up, it seems to be a more powerful computer go player, but all I'm interested is the system for game rules, score keeping and stuff like that).

This bridge will open a lot of web-based go goodies once established :)

One final goal for this is a webpage where everyone can vote on where the current color should move next and after 12 hours or so, count votes and place the stone: a game through democracy/hivemind antics.

and then there's the obvious thing to do: browser-based realtime games against people/cpu with socket.io!

So right now I'm at the point of deciding whether to work hard on this backend glue, or start hacking up an HTML5 canvas/codes for the frontend side of things.  Because I could say "ah screw the rest of the Node.JS devs that would like to have a nice gnugo module" and just make everything explicit (vs abstract) for the voting app.

blerp

3 comments:

  1. A cape for a superhero:

    https://github.com/bitmage/goban

    Maybe we can put our halves together. Shoot me an email: q at bitmage.net

    ReplyDelete
  2. Hey nak,

    Did you make a module? If not, I'm interested in doing so. Did you publish your code for this?

    Cheers,
    Merlyn

    ReplyDelete
    Replies
    1. I actually went a different direction with this, and yes I published the code (it's pretty bad of course): https://github.com/uberscientist/hive-go

      There's probably a much better way than what I was trying to do here. If I were going to try and plug node into GnuGo now I would probably look into doing this: http://nodejs.org/api/addons.html

      I just used the rules engine from Eidogo instead of using GnuGo :)

      -Nak

      Delete