Lantern's server to date

For Lantern I am going out of my comfort zone. Way out of my comfort zone and all of this is new to me, so this post is going to double as a way for me to remember what I’m doing and as a way to ask about improvements/suggestions for my set up.

Firstly, I am using JS on the front end for my map. I’ve decided to go with jQuery as my library since  I find it makes things similar to AS3 which is where I’m most comfortable.

Next, I’m using nodeJS for the server. I’ve never before used anything but apache and it’s really different for me to handle the way it serves pages.

Since I’m using nodeJS and I’m trying new things, I decided to use mongoDB for the database. This is the first time I’ve used something other than MySQL so you can image the shock for me when I first started storing objects or when I had to set up a driver. The one that looked most promising to me and the one I went with in the end is Christv’s node native mongodb driver.

Finally, since my map system for Lantern will have real time updates I decided to lean on to handle my clients/communicate. This sits nicely on top of nodeJS but was the one that gave me the most trouble. First with it’s repo and the zip’s not having all the necessary files and then trying to figure out where the hell all the files belong. The client folder belongs in the root of the file you are running in node just in case anyone is wondering.

And as it turns out, today I was finally able to get all these different components running through nodeJS on my Ubuntu VM. Over the next few days I hope to be able to merge all these different tests into a single working example that I can hand to a few friends maybe that will be interested in helping.

But anyways, this setup is coming along nicely and it pleasant to see all the pieces fall in line. Hopefully the login;register will be rewritten soon to use with new system without too much trouble.

Lantern version goals

Here’s my plan:


  • Player creatation/login
  • Some sort of design – rough
  • A working home page – This break down into:
    • Inventory
    • Player stats
    • Equipable items
  • A working map page
    • Players can see other players on the map and move around
    • Can engage in combat
    • Map will update as players move
    • Actual art and proper layout
  • Admin tools for:
    • Item/NPC/Creature/Quest creatation
    • Map editting tool – Torn on how to make this tool. If I use AIR it would be much faster for me to make and would, I think, run faster with all the elements beinging on the local machine.  Web based has the bonus of access from anywhere. I’m leadning towards AIR but I’ll put more thought into this after I get the map mostly working with nodejs

v0.2 – Private alpha

  • Forum
  • Parties
  • A 30% (at least) complete map with art
  • NPC with basic quest


  • player levels/skills/stats/crafting options complete


  • Complete implementation of the living universe quest system
  • Game libraries – Records of the games history


  • First major story arch added.
  • Creature AI
  • Creature population


  • Map art 75% complete
  • Market


  • Populate world with towns/npcs

v0.8- Beta

  • Site’s final art/layout
  • Minor quests and major arch 2


  • Balancing
  • Load testing / optimizations
  • Bug fixing

v 1.0 – Launch

  • Donatation page
  • Site Ads
  • Ad campagain
  • Dance party

Lantern Map

Look at this awesome map! Look at it!

This is a rough map I made in a few minutes for my friend William aka jetfx ( William is a cartographer, a world builder freak and an aspiring author. He will hopefully be helping me with my maps and story for Lantern as we move forward. Whenever he has a better map that the pretty epic one I drew, I’ll post it for you all to see.


William, being pretty damn quick, thought my map looked too crappy to share so he cleaned it up for me as you can see. I decided to leave mine so you can see how much better he is and why I’m pretty stoked he’s agreed to help.

Random Encounters

Progress on Random Encounters, a mini-game of sorts that I am using as a test bed for some of my Lantern concepts, is slowly trucking along.  The game engine along with it’s content creation tools are almost complete. Skinning hasn’t been thought about yet, but the game itself is close.  Something that I need to do and haven’t yet is find a *cheap* host that will allow me to install mongo and nodejs.  Emphasis on cheap as I am broke.

Random Encounters for me is a test for mongo, some simple js. though the initial build won’t have it and some gameplay concepts that aren’t nessicairly related to lantern but ones I am playing with.

The game will constantly be in beta and will be my playground for new idea’s and tests.  After the current road map I have in mind is complete, which I will write down and post later, I will likely publish all the code for people to use if they have the urge to host a crappy game.

Anyways, here’s a little snippet of code for mongo to get a random record that took me a while to get working.

$numOfCreatures = $collection->count();
$ranCreatureId = floor(rand(0,$numOfCreatures-1));
$ranCreateObj = $collection->find()->limit(-1)->skip($ranCreatureId)->getNext();

Windows + VirtualBox + Ubuntu + nodejs = hooray!

As I’m sure some of my readers (all four of you) may know because of the IRC room, I’ve lately been trying to get nodejs running on a virtual machine (ubuntu since nodejs doesn’t like windows and I don’t want to virtualize osx) that is accessible from my host (windows) so I can use it for Lantern. Well I had a few minutes tonight to sit down and do some reading and I figured it out, hence the post so I don’t forget.

I’ll go right from step one in case anyone else is trying to do this with no prior knowledge 😉 I should also mention if you’re on *nix you don’t need to do this.

  • Get virtualbox
  • Get Ubuntu (or whatever distro tickles your fancy)
  • Install a vm of ubuntu
  • Download nodejs on vm
  • Config/Make/Install – I had to install g++ and cmake to get it to build properly
  • (The tricky part) On your host (windows) navigate to your virtualbox installation via command – something like this : C:\Program Files\Sun\VirtualBox\
  • Run these commands :

VBoxManage.exe setextradata “ubuntu2” “VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/Protocol” TCP
VBoxManage.exe setextradata “ubuntu2” “VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/GuestPort” 8000
VBoxManage.exe setextradata “ubuntu2” “VBoxInternal/Devices/pcnet/0/LUN#0/Config/guestssh/HostPort” 8000

  • Launch your vm, start node js and on your host in a browser go to localhost:8000- HOORAY!

So here’s what I know about the commands what you need to edit to make it work

  • Instead of “ubuntu2” use the name of your vm.
  • the guestssh isn’t important. Just a name use to group the settings. Call it whatever you want.
  • Guest and Host ports are the port you want to access on your vm.
  • If you change you’re installation at all from the default you’ll have to figure out the other changers yourself here :

Good luck ^^

Lantern Update

In my last post I was discussing Lantern’s combat and party system. These two features are very closely related to the map, which is going to be the main area of action in Lantern, so I have been thinking a lot about how to approach this map. I think from some discussions I have had with people in the #bbg irc room and with a few coworkers, I’m going to try to use nodejs for handling the communication and npc logic. From my understanding of nodejs (which is very limited so please correct me if I’m wrong) I can use it to push data to players that need it and create objects at run time on the server and run based on a timer. What I’m looking to do with this functionality is to run the npc’s logic independant of players input.  I’m pretty sure nodejs will allow me to do this. All I need to do is set up linux on a virtual machine and get everything all playing nicely together so I can continue to develop on my local machine.

But as I work on Lantern and think about, the need to a test bed is becoming more apparent to me. So to fix this need I’m going to take a quick break from Lantern to make myself a small game that I can use to test different parts of Lantern. This will range from Mongo scripts to game tools (for creating quests/items/etc). The scope of the test bed currently is very limited to the mongo scripts and the game tools. If I can think of a way to test nodejs in this that would be great, but for now, just testing some idea’s around those other elements would be enough. This small game test bed will be call Random Encounters. The game is exactly what it sounds like. You click a button and you encounter things. The game will suck, but it’s purpose is testing.  This small game will hopefully be online in the next few weeks. Work has be pretty busy of late, so I haven’t been able to look at anything lately.

So that’s where I am. If anyone can confirm or deny my thoughts on nodejs that would be great.

Lantern Combat and Party System

The time has come, the walrus said, to speak of many things: of swords and clubs and player groups, of adventures and rings… Ah to hell with it. Let’s talk about how to create a party system for pbbg’s that doesn’t require players to be online, but is still interactive and fun, and killing things!

The thought of a party system is by no means a new idea. The challenge arises when you try to apply the principle to an environment where players won’t be online when actions concerning them will be occurring. What I mean is that if a party of six players are on a quest, there’s a good chance a when one player logs on, everyone else is offline. What will this player be able to do if they are a member of a party? Can they move the party? Will they be able to move around themselves but remain a member of the party? If so, will their gains be party gains?  And then we have party combat; Will the leader direct each member or will combat pause until each member can log in and take a turn. Or maybe it would be better to allow players to create a rule set that will manage their character in battle for them.

Party Formation

With the party we have a few options to look at as mentioned above. First up is each player in the party has the ability to move the party. With a party of six where each player has the power to more the party this, I think, would quickly dissolve into players arguing and fighting amongst each other about how movement and combat should be handled. In a game where movement and actions will likely be limited to a tick, this outcome could actually ruin the game for some players.  You also don’t have the same clear definition of roles that can bring a lot of fun to party play.

How about party members being able to control themselves and their actions instead of being dictated by the party? This approach solves the what do players do when they are online and the combat because they are in full control. The issue is though is this is no longer party play. You are now playing the game on your own but yet remain in a ‘party’ of other individual players.  A thought that would give this style more of party play and still resolve several issues with combat is to not allow the members of the party to move more than 10 or so tiles away from each other.  Then if you make combat turn based, a player could engage an enemy and instead of fleeing stop playing until another member of the party or two and come and attack the enemy as well. I like this idea. It give players the option to still explore the world, combat and train while party members are not online but still gives the sense and benefits of a party.

The final concept I have for this is to have a leader that is the only one that can move the party. This means that when a player that isn’t leader logs in there would need to be something they could logical do while in a party adventuring. And I can’t think of anything. A player could log in and train or study, but that isn’t really that fun in contrast to the leader where when they log in they have the power to move the party, enter battle and make all the quest decisions.  While this limits player interactivity, combat and general fun… Actually, that’s pretty much all it does.


This issue is tightly related to the type of party system that is in play, and I can think of three possible (read as not necessarily good) ideas for this. Let’s start with the idea for combat and party system that I am leaning too; Turn based combat with players able to control themselves and move about the area the party is in.  This approach would allow for players to decide how to enter combat. If an enemy is spotted five tiles over, the group may decide it’s best for the tank to engage first and then have the other members join the fray. The enemies combat would also be turn based. The only point that is nagging me here is how would the enemy operate. Would they only respond when they have been ‘activated’ – attacked, tile entered? If so what happens when the tank attacks, the enemy strikes back, and then the archer 3 tiles away attacks? Does the enemy attack the tank or would it start to move towards the archer? Or maybe even move towards someone else that is in the area. Or flee. And what if the enemy is attacked simultaneously? Or if the archer attacks and then runs? Should the aggro stay active for a few turns and every time the archer moves, he calls the enemy to runs it’s AI script and decide an action?

Keep in mind I only came up with this idea as I am writing this post, so this is what I think I would do with only a few moment of thought. I would have each player that engages an enemy active it for a number of rounds, even after combat. This means if the player tries to flee, it may be chased. But what this system also implies is that the enemy when it is engaged/activated/whatever it will run it’s AI script and determine course of action around it. This means and could be really interesting, is that if a player that has attacked an enemy and decided to wait for help could still be killed when help arrives and triggers the enemy to make a move. My only concern is that this would lead to a player dying without knowing what happened. If all six members of a party attack an enemy at once and the enemies AI tells it to kick the crap out of the guy beside me six times before that player has a chance to refresh the page, they will refresh dead. This though would lead to party tactics and communication which I strongly support.

Another option for the party being control as a whole either by a leader or each member in the party is the concept of a combat rule set. What I mean is that a player will have a screen where they will see a list of options and how they would want their player to react to each own when they entered combat. For a system like this to work in my mind the players would need to receive rather detailed reports about the battle so they can tweak their rule set. And while this would be interesting, the party formation still limits much of the players actions and in the end rather boring (I think) way to do it. Not only can you not move yourself, your combat consists of conditional statements.

In the end for me, I think allowing the players to explore a limited area around their fellow members and creating some form of activated AI system seems like the best solution for me.  What do you think?


For those who are unfamiliar with how I write posts like this, I literally come into it with the topic and almost no other thoughts on the topic.

Monetizing Lantern

As I work on the gameplay and story for Lantern with my friend Lucas (who still doesn’t have any form of site), he mentioned an idea that I going to attempt to avoid for a little bit but now that it’s in my head I want to get my thoughts out about it.

As I’ve stated in the past, I refuse to allow players to buy themselves a better player, or give them an edge over others. This makes it very difficult to come up with ideas on how to get players to pay me other than out of the goodness of their hearts.  Not that my goal is to make money, but it would sure be nice not to have to worry about server fee’s.

So here’s a quick break down of lantern in case you haven’t read other posts related to it: It’s a pbbg rpg with party based combat/quests in a living universe with a hex map for movement.

Commonly, or at least by what I have seen on these types of games, monetization has meant selling action points, in game items to make you more powerful, faster regen, more xp gains etc etc. But since I refuse to do that, I need to look at other features players may be willing to pay/donate/give me beer/vodka/rum/whiskey for.  The first thing that pops into my mind is a friends list, but at the same time that to me seems to be a pretty basic feature. The thought of allowing the player to seem more of the hex map is still hanging in there for me though. While this may give players a slight edge I don’t think it’s an unbalancing one which is my problem with with buying bonuses. Another thought is to provide donators/buyers more data that is available to all players but on the map page where almost all game play will occur. For instance show them all their stats, the current quest and an overview of their party members. Another popular one is to remove ads if the a player dishes out a few bucks. This is another one I am strongly considering.

I think features that enhance the the game, but not having them doesn’t leave you crippled, is the way I’m going to go. This way the players don’t get a in-game bonus for spending their money and still feel like they are being rewarded for donating/subscribing. Of course, it would be great to be able to make these features available to all and just survive of the donations, but we’ll see what comes of it all. How do you make money with your game? Do you offer in game bonuses? How do they effect play? I would love to hear from some people that offer xp/money/items and how they feel it effects their game.

Mongo + wamp

Before I forget I just want to scribble down how I got mongo running at home. It’s actually really simple.

  1. Download wamp and get that up and running.
  2. Download the mongo driver from here. Grab the version that matches your version of php
  3. Extract the mongo driver to C:\wamp\bin\php\php5.3.0\ext
  4. Edit the php.ini and add extension=php_mongo.dll
  5. Download mongo
  6. Extract it to C:\data\db
  7. Open cmd and run the mongod.exe in bin
  8. Start wamp.


And here’s a quick test to check if it works.

$m = new Mongo(); // connect
$db = $m->foo;
$collection = $db->test;

$doc = array( “name” => “MongoDB”,
“type” => “database”,
“count” => 1,
“info” => (object)array( “x” => 203,
“y” => 102),
“versions” => array(“0.9.7”, “0.9.8”, “0.9.9”)

$collection2 = $m->foo->test;
$collection2->insert( $doc );

$obj = $collection->findOne();
var_dump( $obj );


Holy shit! It’s literally been like four months since my last post! I apologize for the lapse in posting. Life as I’m sure must of you know can turn pretty fast and where this is still a hobby, something had to give. To recap the big events I no longer work for Raised Media. I now work for RedSpace as a Solutions Developer or something like that. My focus has been flex since my move. Hopefully I’ll have a chance to do some game design related work sooner than later. I’ll try to keeps ya’s in the loop 😉

Anwyays, this isn’t a blog about my feelings so onto the game related content!

I have started designing a game with a friend, Lucas, that is currently going by the name Lantern. Lantern aims to be a rather simple RPG with a rather indepth story and few things to make it stand out from the crowd. The most notable thing will be I am making this a living universe. I have discussed this is the past on here and the reception was lukewarm at best, but it’s just something I need to do. But what I mean when I say a living universe is that players actions can and will directly shape how the game is played and the overarching story for all players. If there is a demon dragon ghost threatening to destroy all the kittens on the planet and someone kills said dragon, that dragon is dead. No one else will be able to claim that kill. Players will have a history that means something in the game and the game’s story.

Now, with a living universe like this there needs to be a strong story to support it which is why I pulled my friend Lucas in on the project. Together we have already created a rather large story line for players to explore and play through. But this means the world you sign up to may be very different in 6 months. That after a year older players will tell tales of battles that others know about through the games history which will be maintained on the site and in the game. The goal here is to make the player that completes the quest feel important and give everyone the chance to be the

The next notable feature will be the skill tree system I am currently working on and running past Lucas. I’d like to work it out a little more before going into too much detail here but the gist of it is that a player can change their character at any point during the game (of course with a penalty) to change their playing style or character to react to changes in the world.

Another feature I am looking into and received help from @jannesiera on twitter is concerning the map. I am thinking of using a hex map similar to the one here : . If anyone has any links to tutorials or articles about making a hex map in js, I would love to see it 😉 Yes, I said js. As much as I love flash, it’s all I’ve been working in for almost 3 years. I need to cut my teeth on something else.

And the final feature that is of any note is the party system. What I am wanting to do here is to allow 6 players to party together, but I am rather stuck on how to manage this without giving full control to the party leader. Being a pbbg, players can come and go as they please so I want them to remain in their party even off line but not slow down those that are online. This means that the leader should be able to move and enter combat, etc with these players even though they aren’t online. To give the players a little more control, I was thinking of creating a combat rules system where they can tell their character when entering combat to perform certain actions based on what is happening and for each encounter they would received fairly detailed reports that would allow them to constantly edit and tweak their rules.

Now, this still leaves the players other than the leader with little to do. But what if I allowed everyone in party to move control the party? Then all players get to play and control the group and aren’t left sitting around. I just need to handle if there are multiple players online at the same time.

So, what do you think? I am really interested in hearing peoples thoughts on how they would handle a party system for a pbbg.