online rpg written in javascript and node.
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Basjian is a multiplayer game written in node.js. The client is... you guessed it, all javascript.

I wrote Basjian because all the retro RPG's I've played over the years have either gone away or
just turned into something other than they used to be.

I did a 3 month sprint when I wrote Basjian.. trouble is, that's also when I learned node.js, so
the code is a little unmanageable.  I also let the excitement get the best of me so several pieces
of the client are a little rushed.  On top of that, I got busy and put the project away for a while.

So now, I'm rewriting Basjian, and making it open source.  Maybe I'll find another developer who
is looking for a retro RPG to feed their nostalgic craving. But if not, I still enjoy playing what
Basjian is so far.  You can get a taste of whats to come right now at

Once the code here catches up to what's live now, I'll move it into production and hopefully keep
on truckin!

Server flow:

start server: node app.js
server loads mapfile into memory, cuts out the client related code
server connects to mysql and loads all the assets (fixtures, items, portals)
server spawns any initial npcs (shop keepers, guards, etc.)
server sets timers to handle npc spawns and weather / night and day effects.
server waits for clients
server waits for packets/events

Client flow:
index.jade      player is present with login form
client.jade     player makes it to client if successful
game.js         client connects to server
                server adds the user to the players array
                server sends assets (fixtures, items, etc..)
game.js         client preloads assets
game.js         once preload is done, intervals are set to render graphics and handle input in mainloop.js
render.js       terrain, fixtures etc.. are all rendered on an interval

the remaining functionality is all event driven

packets.js routes all incoming events to their respective functions