Tuesday, November 22, 2016

Javascript World Generation

My fingers are aching after spending the past 3 days converting my fractal world generation code to Javascript.  My vision is to produce a D&D world editor in Javascript with the following features:

  • Intelligent terrain generation.
  • Editing tools to "raise" and "lower" parts of the map with the mouse to shape the terrain.
  • Try different, randomized weather patterns to see how they modify the terrain.
  • Control the temperature and moisture levels of the world, get desert or jungle worlds.
This is the first step in my grand plan to create the ultimate DM's toolbox online.  Imaging having civilizations, cities, dungeons, all generated on the map for you as a starting point for a new campaign.  And then have the ability to add and track new information as the campaign progresses.  Need a new city?  Click a button and have a randomized city appear, leveraging the community-driven random tables of dmmuse.com.  

It feels good to have this much code working smoothly in Javascript/HTML5 canvas in such short order!

Here's some sample output of my Javascript world generator, I hope to get it running in a live page soon.

The mini-map.  Note that desert areas appear in a more washed out color, and swampy areas (lower right) appear in a swampy greenish.

A portion of the wetlands that appear in the lower right of this generated world.  I can imagine the tribes of heathen lizardfolk and bullywugs just looking at this!