Procedurally Generated Planet, Viewed as a Rectangular Map
Today I back-ported some of my flat map code from Worldbuilder to the planet generator prototype that I made last year. So for anyone who has been wanting to view a flat map rendition of those really cool planets, but isn’t ready to spend $4 on my Worldbuilder early supporter discount offer, you can give the new version of the old prototype a spin. No procedural generation code was altered, so seeds from the original version will work in this one, generating the same planets as before.

For the past two and a half weeks, I’ve been working on a procedural planet generator.  This weekend I finally polished it up enough to talk myself into putting it online.  You can check it out here.  (It’s heavy on the JavaScript, so I recommend Chrome.  Firefox and IE are slower, but manage.  I haven’t tried any other browser yet.  Also, I’ve never yet delved into supporting touch controls, so it’s pretty much keyboard only.  Sorry mobile users.) (The above link is for version 2, uploaded April 7th, 2015; version 1 is still accessible here.)

Update, October 2015: Worldbuilder Version 0.2.2 has been released, inspired by this prototype. Includes flat map projections and per pixel detail!

A lot of different steps go into generating the planet, utilizing a variety of algorithms and techniques.  They’re not perfect, and some of them are in fact quite finicky, requiring a lot of cautious tweaking of parameters and behaviors.  Some of them are bad enough to make me cringe.  But they work.  At least well enough to make some pretty pictures, and some planets with enough variety that they might be a half decent foundation for some strategy mechanics.  So in case anyone might be able to glean some useful ideas from my work, allow me to delve into some of the details (and include tons of colorful pictures along the way). (more…)

A few weeks ago I introduced you to what I felt was an impressive little data structure that can provide constant time complexity for the standard operations, stores data contiguously, and provides stable handles that remain valid across all operations other than removing the referenced items themselves.  Today I want to extend the basic data structure with some additional functionality which will be focused on iterating over the contiguous items in order.  While iterating, we may wish to modify the collection as we go (such as conditionally removing some items).  We may also wish to rearrange the items so that a simple linear traversal will also happen to hit the items in a particular order (such as sorting 3D objects from front to back to take advantage of a depth buffer and reduce fill-rate). (more…)

I recently ran across a couple of blog articles describing a data structure that provides a set of properties that I often am seeking:

  1. Contiguous data storage, good for linear iteration and maximizing cache utilization
  2. Constant-time insertion, deletion, and relocation of elements
  3. Stable external references to elements regardless of internal relocation
  4. Constant-time look-up from external references without hashing

(The two articles were from the makers of the Molecule Engine and the BitSquid engine, respectively.)

Fascinated by data structures and algorithms in general, and lured by the appeal of these properties, I set out to study the concept and implement my own version.  It’s quite simple to implement in a basic form to achieve the above four properties, and can easily be extended to acquire some additional behaviors at the cost of additional memory or extra operations.  In this first article, I’ll walk through the basic concept, as well as a simple implementation in JavaScript.  Later articles will explore some of the possible extensions. (more…)

Last week I was able to finish my preliminary work in porting my Lua scripts to JavaScript, and get a bonus by integrating them with jqPlot to get nice line graphs just like I had in Excel.  The syntax and features are ever-evolving, but take a look at what I’ve got so far. (more…)

A couple months ago I had a crazy idea:  Dump my Excel spreadsheets and just stick all my financial data in script form.  Languages like Lua or JavaScript (through JSON) are naturally designed for representing data, but then they’re complete programming languages too, which readily allows me to implement any amount of custom reporting I want.  So upon starting my game development business, I began tracking my finances using some evolving Lua scripts.  Now that my move to a new place is complete and I’ve finally recorded all the frightening purchases I made over the last two weeks, I’ve been updating the scripts, and chose to port them to JavaScript to gain some advantages from HTML/browser integration and existing high quality JavaScript libraries.  Let me describe the budget scripting experience so far. (more…)