0 FPS

Geometry, graphics and solids

Archive for the ‘Rambling’ Category

Making an MMO in 48 Hours

with 7 comments

Ludum Dare 23 is done, and here are my results:

I really doubt that I am going to win any awards for graphics…  or gameplay… or sound..   BUT!

  • It is multiplayer
  • It has persistent state
  • It is HTML5
  • And it actually works!

How cool is that?  Pretty amazing what you can do in a weekend.  I’m not sure if this is the first successfully completed MMO made for Ludum Dare, but I daresay that it is not something which is frequently attempted (possibly with good reason).  The tools I used to create this monstrosity were node.js, mongodb and crafty.  In terms of development, here is what went right:

  • Node.JS is a fantastic platform for making multiplayer games.  Event driven concurrency is basically the model most games use anyway, and I have yet to see any system which does this better.
  • Even though it would not be my first choice of language, if you are doing web programming you are stuck using javascript.  Being able to use the same language on the server (and share code) is a huge advantage.  The result was I didn’t have to write, debug and maintain two different versions of A-star while doing the development.
  • MongoDB is also quite a nice tool for game programming.  While in most situations I would say the lack of a structured column format is a disadvantage, it actually turns out to be a real help for gamedev and rapid prototyping.  In particular, it was very convenient to make a table with player stats and just keep adding fields to it while developing without worrying about it.  Of course you could probably get similar results by just making a raw string column in a SQL table, but this is a bit ugly and does not integrate as well with node.js.
  • Nodejitsu is a very nice host.  Nuno Job graciously offered me a coupon earlier, and I have to say I was very impressed with their service.  Compared to nodester, one of their best features is the automatic database set up and configuration.
  • Making a click based system for navigation is a cheesy way to handle latency, but it works.

Now for what went wrong:

  • Unfortunately, I was not very disciplined with the amount of time I spent programming.  For me coding stuff is the most fun, and I tend to procrastinate on the drawing side of things.  As a result, the graphics in the game look pretty terrible.  The grass texture in particular turned out eye-bleedingly bad :(
  • The other consequence of over indulging in coding was that I didn’t spend much time on the game itself.  There is really only one type of enemy (a rat), and not much to do in the game besides kill people.  The map is also very empty/boring.  (Though there is a boss battle/final secret.)
  • No sound
  • This was my first time using crafty.js, which I selected using the “deliberative” method of random google search for “HTML 5 game engine”.  As a result, I spent some time up front trying to figure out how to get everything working.  Crafty itself seems like a fine piece of technology, but the documentation and examples really need some work.  In particular the “RPG tutorial” is out of date and doesn’t work with the latest version.  This cost me maybe 2-3 hours trying to get it to work, which I would say was the low point of the whole competition.  In the end I just gave up with the docs and read the source code directly, which turned out to be much easier to understand.  However, despite this setback, using crafty was still a net savings over doing everything from scratch, especially taking into account debugging and portability issues.

In the end, I had a lot of fun making this (although the final game is kind of terrible).  Once again, if you want to give it a try here is the link:

http://ludumdare23.nodejitsu.com/

Written by mikolalysenko

April 24, 2012 at 11:18 am

Posted in Programming, Rambling

A call for more technical blogs

with 5 comments

There is a trend these days to avoid writing about technical things in programming — and in particular game development — blogs.  Just go to places like r/programming or altdevblogaday, and so on and you find plenty of articles giving you great advice on everything EXCEPT math and programming!  What gives?

There’s just not enough articles any more that get down to the nuts and bolts of algorithms and data structures, or at an even more basic level actually bother to try explaining some interesting theoretical concept.  Once venerable clearing houses like flipcode or gamedev.net have either shutdown or become diluted into shallow social-networking-zombies.  Perhaps this is a symptom of our ever decreasing attention spans, or even more pessimistically a sign that indie devs have simply given up on trying to push the technological envelope out of fear of competing with big studios.  It seems that trying to innovate technically is now viewed as `engine-development’ and derided as unproductive low-level tinkering.  Wherever it comes from, I am convinced that these insubstantial discussions are making us all stupider, and that the we need to start writing and paying attention to hard technical articles.

So, rather than sit back and complain, I’ve decided to do something proactive and try to update this blog more often with useful — or at least interesting and substantial — technical content.  But before that, I will start by listing some of the things I am *not* going to talk about:

  • Industry news
  • Business advice
  • Coding “best practices”
  • Social networking
  • Marketing
  • Project management

As I’ve just described, there’s already an abundance of literature on these subjects, possibly because they are trivial to write about, and it is easy to have an opinion about them. As a result, I don’t really feel particularly compelled, or even much qualified as an industry-outsider-academic-type, to discuss any of those things. More pragmatically, I also find that discussing these sorts of “soft”, subjective issues leads to either pointless back patting or unproductive bickering.

Instead, I’m going to use this blog to talk about the “harder” foundational stuff.  When possible, I will try to provide real code here — though I will probably switch languages a lot — but my real focus is going to be on explaining “why” things work the way they do. As a result, there will be math, and this is unavoidable.  I’m also going to make an effort to provide relevant references and links when possible, or at least to the extent of my knowledge of the prior art.  However, if I do miss a citation, please feel free to chime in and add something.

I don’t have a set schedule for topics that I want to cover, but I do have some general ideas.  Here is a short and incomplete, list of things that I would like to talk about:

  • Procedural generation and implicit functions
  • Physical modeling using Lagrangians
  • Mesh data structures
  • Spatial indexing
  • Non-linear deformable objects
  • Collision detection and Minkowski operations
  • Fourier transforms, spherical harmonics and representation theory
  • Applications of group theory in computer graphics
  • Audio processing

I’m also open to requests at this stage.  If there is a topic that more people are interested in, I can spend more time focusing on that, so please leave a request in the comments.

Written by mikolalysenko

August 30, 2011 at 11:49 pm

Posted in Rambling

Follow

Get every new post delivered to your Inbox.