Sunday, January 15, 2012

node-js-mud

I've committed the initial version of node-js-mud. It really isn't a MUD yet, but should do just fine to create a MUD. It was quite a bit of fun to create, and I realized how much time I waste on refactoring and over designing. Even with this project where my goal was to rapidly produce, I found myself trying to design when I should have just been writing code. Anyway, some cool things that are in place:

Remoting.js, server/RemotingController.js, tests/RemotingTest.js
I decided not to use now.js but instead implement my own remote service framework. The framework will essentially copy services from the server to the client and replace any functions with callbacks to server/client. That way, if a remote service returns an object that should really exist only on the server, it can stub out the methods of that object so they call back into the server.

server/mongodb.js
Very basic HTTP endpoint for interacting with the MongoDB document store.

My next tasks are to implement

  • The Socket.IO services so that multiple people can interact/get notifications
  • Refactor commands so they are easier to create

Oh and some things I learned on the way:

  • NodeMON is essential for rapid development
  • Never return anything, it will just cause you headaches later, use callback functions
  • If you want to interact with MongoDB via HTTP Sleepy.Mongoose is quite good but you'll run into cross-site issues if it runs on a different port
  • Javascript has a with keyword... i need to try it


https://code.google.com/p/node-js-mud/

Friday, January 6, 2012

Holidays

Things were crazy busy over the holidays so this blog didn't get much attention over the past two months, but I've been busy writing the back end MUD for this game concept. Hopefully this weekend I will get around to creating the remote git repository and pushing what I've done so far. The framework for the back end is javascript, mongodb, and (soon) node.js. I wanted to experience first hand some of the concepts and techniques I witnessed at the mongo conference I went to. So this "MUD" back end is essentially the result of that. Here's a link to the presentation if anyone has time.

http://www.10gen.com/presentations/mongoboston-2011/cowboy-coding-learn-when-and-how-to-break-all-the-rules-for-really-rapid-prototyping

Later I'll post more details on how I envision these two systems working together.