I recently got tasked to document some databases for a project I’m working on.  I happen to enjoy writing documentation, so I thought it would be no big deal.  How wrong I was.  There’s so many tables, and all of them are filled with columns that lack comments.  It’s my job to find out what all of them do, and document them.  My initial thought was to create a markdown document and capture all of the data in some tables.  As I started to do that, I was really pleased with the result.  Beautifully rendered tables that accurately describe what column does what, how it’s formatted, and why we need it.

Unfortunately, my extremely manual documentation process doesn’t scale.  When I realized that several tables all share the same column name, I started to wonder “what happens if I make a typo and then copy and paste it everywhere throughout my documentation?”.  I started to think of ways to centralize the content, while still being able to keep my content in markdown.  The solution I came up with was Mustache and Grunt.

Continue reading

I’m currently working on a game using the Javascript game engine Phaser.  It’s going to be set in a city, so as part of the development process, I’m going to make a working city simulator and build the game on top of that.  The last month has been spent generating landscapes, roads, buildings, and more.  Once I had all of the items I wanted to generate created, I joined them together and found that it looked beautiful, but ran terribly.  I had gotten to the place that every developer gets to at some point in their project: optimization.

As I started racking my brain thinking of ways to optimize, I decided to write down all the steps to show later.  I’m going to be giving a short talk at work about optimizing javascript games (Optimizing Javascript Games PDF), but I wanted to write a slightly larger companion blog post about it.
Continue reading

As my previous posts have discussed, I’m currently building an isometric city simulator.  As I post screenshots to Twitter and tell my friends about it, they inevitably want to see it in action.  I have web hosting here at Evil Mouse Studios, but if I want to put my project online here, it requires uploading all the files manually and it’s kind of a pain.

Enter Github Pages.  Github offers a service called Github Pages that hosts a running version of your project for you.  All you have to do is branch off of your project, call it “gh-pages”, and then you can see your site online.

I use Grunt to automate my build process, and it works great.  It takes all the files I need to run my game and copies them (after processing) to my dist folder (where the game is run from). For my game to work successfully, the entire “dist” folder needs to be hosted somewhere.  This normally wouldn’t be a problem, but “dist” isn’t stored under version control.  It’s the built version of my game, and having it on Github would just be a waste.  So how do I deploy my “dist” folder to Github Pages?

Continue reading

I’m working on an isometric city simulation with procedurally generated terrain, and as I started to generate terrain, I ran into a bit of an issue.  I’m using the isometric tiles from Kenney (which are amazing), but I was struggling to think of a way to handle edges.  Take this island for example:

iso-island

You can see that on the left side, there’s some sloping that lets the sand tiles blend into the water tiles.  That’s great, but I wanted a programatic way to handle those kinds of transitions.  I thought of 9-slice scaling and thought that might be a solution.  If you’re unfamiliar with 9-slice scaling, this tutorial might explain how it works.  The basic idea is that you can take a rectangle, and divide its parts into 9 (4 corners, 4 edges, 1 middle), and through scaling those 9 parts, you can maintain the look no matter how big (or small) it is.

Continue reading