» roguelike Home of Ebyan Alvarez-Buylla Sat, 03 Mar 2018 23:55:35 +0000 en-US hourly 1 World Generation Breakdown Sun, 20 Mar 2016 05:46:54 +0000 A large part of Dance of Death v0.6.136 was the addition of world generation. Although the world is little more than a large island at the moment, the results are rather satisfying, even considering that the current method of generating terrain is purely based on elevation. After experimenting with a number of techniques, I settled on this simple formula: 1) Generate Fractal Perlin Noise, 2) Multiply noise by a radial gradient, and 3) Apply terrain and water line. Here is the breakdown:

You can click on any of the images to view an interactive demo, and click again on the demo to generate a new map. The images were all generated randomly, so they do not correspond to a progression of the same maps (while Flash’s Perlin noise generator can be seeded, its random function cannot). Source code is available from Google Code, where you can grab it directly from SVN.

Step 1: Generate Perlin Noise

Generate a Fractal Grayscale Perlin Noise with an x-frequency of half the width, a y-frequency of half the height, and 8 octaves. For more loose islands, or for larger maps, you can drop the frequency to 1/4th of the width and height or lower, to fit your purposes. You can normalize the noise from 0-255 if you like, though normalizing now will become redundant later on. This is what we have so far:

Grayscale Fractal Perlin Noise, normalized for contrast. Click to view demo.Grayscale Fractal Perlin Noise, normalized for contrast. Click to view demo.

If we apply the terrain to the tiles at this point, we’ll end up with something like this (jump ahead for the terrain application method):

Terrain applied to noise. Looks pretty good, but it touches the edges and lacks an overall island look. Click to view demo.Terrain applied to noise. Looks pretty good, but it touches the edges and lacks an overall island look. Click to view demo.

Step 2: Generate Rolling Particle Mask

To get the island to be biased towards the center and avoid touching the edges, a straightforward solution is to multiply its values by a radial gradient mask ranging from 1 near the center, to 0 near the edges. A plain radial gradient might do the trick, since the Perlin noise already provides a healthy amount of randomness. However, I went with a modified version of the Rolling Particle algorithm to get some additional roughness. The basic algorithm goes something like this:

  • Start with a blank map, all 0s.
  • Pick a random starting spot for the particle.
  • Increment the value on the map by 1 where the particle is located.
  • Move the particle to a random adjacent position whose value is less than or equal to the current position (imagine the particle rolling downhill).
  • Repeat the last 2 steps as long as the particle is alive.
  • Repeat for a large number of particles.

A particle life of 50, with 3000 particles works well for this map size (which is 88×32, by the way), experiment to get values that work for you. If we normalize, we get this:

Basic Rolling Particle algorithm, 3000 iterations, particle life 50. Click to view demo.Basic Rolling Particle algorithm, 3000 iterations, particle life 50. Click to view demo.

While the algorithm produces inherently center-biased maps, multiplying this across the noise results in islands that are too boxy. To round out the results more, instead of picking a random starting point for particles, let’s ensure that they land closer to the center:

Rolling Particle algorithm, center-biased, particles start 12 tiles away from the edges. Click to view demo.Rolling Particle algorithm, center-biased, particles start 12 tiles away from the edges. Click to view demo.

To absolutely ensure that the islands will not reach the edges, I’ve also multiplied the outermost tiles by 0.75, and the second outermost tiles by 0.88. These tiles already have some of the lowest values of the map, and softening or “blurring” them this way ensures the final map does not touch the edges.

Step 3: Apply Terrain

Once the base noise map and the rolling particle mask have been generated, multiply the noise values times the (mask/255). Dividing by 255 ensures that the mask values will range from 0 to 1 rather than the normalized 0 to 255. This produces the following result:

Combined maps. Click to view demo.Combined maps. Click to view demo.

We’re done with the heightmap generation. Now onto determining the water line and assigning terrain.

I spent some time fussing with linear regression and other estimators to accurately place a water line, but, at the end, directly sampling the values of the map turned out to be the fastest (to program and execute), and most accurate solution. To determine the water line for the default 60% water used in this world generator, step through the map and throw all of the values into an array. Sort this array numerically. The value indexed at (array.length – 1)*0.6 marks your water line. Everything below it is water, everything above is land.

Now that the waterline is set, I pass that value into each tile’s setTypeByElevation() function, which sets the tile type according to its elevation, as follows:

If below the water line:

  • If above waterline-40: shallow water.
  • Else: deep water.

If above the water line:

  • If below waterline+15, coast/beach.
  • If between waterline+15 and waterline+35: plains.
  • If above 255-25: mountain.
  • If between 255-50 and 255-25: hills.
  • Else: forest.

Producing this:

Final result. Click to view demo.Final result. Click to view demo.

Grab the source code from Google Code, or directly from SVN. Feel free to tweak any of the values and modify the algorithms as long as you adhere to the GNU General Public License v3 and provide attribution and all that. Enjoy!

]]> 15
Crossword Dungeon 1.1 Released! (now for iPad) Wed, 02 Apr 2014 22:36:15 +0000 I am happy to announce the latest and greatest update to Crossword Dungeon, version 1.1, is now available for iPhone and iPad on the App Store! A thorough list of changes can be found here. Reviews and ratings, as always, are greatly appreciated!

This latest version opens the doors for a PC/Mac and Android versions, which will be in the works fairly soon.

It’s also worth mentioning that, even though I’ve raised the price a bit to account for the additional work (and the fact that if you’re worried about an extra $1 you’re unlikely to pay anyways ;)), if you’ve already purchased Crossword Dungeon for iPhone, since it is a Universal app, there should be no need to pay for it again.

]]> 0
Crossword Dungeon 1.1 Submitted Wed, 26 Mar 2014 23:31:44 +0000 Crossword Dungeon update 1.1 has just been submitted to the Apple App Store for review. This version was rewritten entirely in an effort to port the code from from Objective-C with Cocos2d to AS3 with Starling, allowing for multiplatform support as well as easier maintenance.

This version, although unfortunately not supporting older saves, is an Universal app, which means that it supports iPad out of the box!

Here is a more thorough list of the major changes:


  • Added over 100 new words.
  • New monsters: The Boar, the Wraith, and the Ogre Mage.
  • New algorithm for picking words ensures they are repeated less often.

Gameplay Tweaks:

  • Lowered XP from Magic Attacks.
  • Lowered Magic Attacks from Scoundrel’s Cheat skill.
  • Stealth is now removed only if you are hit.


  • Text and sprites are now guaranteed to always be drawn with crisp pixels, never anti-aliased or blurry.
  • Per popular request, the “X” has been better differentiated from the “H”.
  • Beetles are now red to better differentiate them from Boars.
  • New splash screens.
  • New (cosmetic) magic missile for the Ogre Mage’s ranged attack.


  • 10-pixel threshold is now checked on touches to prevent unwanted dragging.
  • Small font is now a little bigger and more readable.
  • Added a Credits screen.

Bug fixes:

  • Save files should now load reliably!
  • Monsters are now loaded at the correct opacity.
  • Medium and Large fonts now support commas and apostrophes.
]]> 0
Crossword Dungeon 1.1 in the Works Mon, 28 Oct 2013 06:06:08 +0000 The long-in-coming 1.1 update to Crossword Dungeon is currently in the works. The main focus of this update is to bring the game to iPad with Universal support, as well as adding 200+ more words, fixing bugs, improving performance, and tweaking the balance.

Universal support

The single most requested feature for Crossword Dungeon upon its release was iPad support. Though the game can be played on iPad, it does not gracefully use the larger screen space, nor fit its dimensions.

Bugfixes and graphical updates

There is one major game-stopping bug (you know the one) that I am committed to tracking down for version 1.1. In addition, working on a slew of new pixel art for my latest project, Adventurers, has led me to revise some details of the characters, logo, icon, etc.: mostly minor, but worth throwing into this update.

Content and credits

Other than bugs and lack of universal support, lack content’s been players’ chief complaint with Crossword Dungeon, so every update I’ve committed to add at least 100 new words. I’ve enlisted a few helpful folks to this end, whom will be thanked in the new “Credits” screen.

Tweaking the balance

The balance tweaks in this version are mostly dealing with managing the player’s power growth relative to the levels’ difficulty scale. In the current version, it is rather common to make it well-past level 25, a point which I had originally intended to be the endgame.

Out with Cocos2d, in with Sparrow

You might have seen me post a number of tweets on this topic with regards to Adventurers. More recently, however, as I’ve picked Crossword Dungeon back up, I’ve also made the call to “port” it to the Sparrow framework, from the rather painful-to-use Cocos2d. The details as to why are lengthy and non-project-specific enough to deserve their own article, also in the works. :)

]]> 0
Crossword Dungeon 1.0.1 Released Sun, 09 Dec 2012 08:36:57 +0000 Crossword Dungeon update 1.0.1 is now live at the App Store. The changes for this version are listed below the update, as well as in the prior post. If you have been waiting to buy the game until after more content was added and the major bugs were resolved, I welcome you to try it now!

I will be putting together a plan for the next update which is sure to include any additional bugfixes and suggestions that make their way to me in the coming weeks. If you are still encountering bugs after updating or have ideas on how the game can be improved, please send them my way! You can bet that I will take every suggestion into consideration either for the upcoming update, future updates, or future versions of the game.

]]> 0
Crossword Dungeon Update 1.0.1 in Flight Wed, 05 Dec 2012 05:53:50 +0000 Developing and releasing Crossword Dungeon has been an amazing learning experience. Mobile, iOS, Objective C, Cocos2d, and a solo commercial release were all personal firsts, and releasing within a fairly tight window (for personal and motivation reasons) meant a good number of items slipped by untested. Update 1.0.1 has been submitted to the App Store for review, and contains the following changes:

Bug fixes

  1. Fixed bug: Continue Game no longer produces empty level/UI.
  2. Fixed bug: Game no longer crashes during late level generation.
  3. Fixed bug: Player can now properly descend after an arrow or Whirlwind attack kills the monster on the exit tile.
  4. Fixed bug: Professional skill now levels up correctly.
  5. Fixed bug: Tapping quickly to move no longer triggers First Strike multiple times.
  6. Fixed bug: Monster info (tap-hold) can no longer be brought up on a tile with a stealthed monster.
  7. Fixed bug: Potion damage bonus (from Scoundrel’s Envenom skill) is now being applied.
  8. Fixed bug: Monster’s Stun effect is no longer being applied on a miss.
  9. Fixed bug: Defense of over 100 is no longer causing player to always be hit.


  1. Added content: 100 new words.
  2. Corrected content: “ridley”, wrong hint.
  3. Corrected content: “constantine”, hint too long.
  4. Corrected content: “scute”, missing hint.
  5. Corrected content: “jovial”, misleading hint.
  6. Corrected content: “monday”, ethnocentric hint.
  7. Corrected content: “liter”, ethnocentric spelling.


  1. Balanced: Bumped up Dexterity attack/defense bonus to 10% per level.
  2. Balanced: Halved Magic attack XP bonus.
  3. Balanced: Made Scoundrel mid-tier skills more useful.
  4. Balanced: Tweaked percentages and max levels on Barbarian Tier 1 and Tier 2 skills.


  1. UI: Added copyright to main menu.
  2. UI: Added version to main menu.

I’ve also addressed a number of memory leaks, which should help with some of the reported random crashes in the late game that I have been unable to replicate.

I am currently working on the plan for the next update as well as the roadmap for the future of Crossword Dungeons, both of which I will be certain to share soon, along with the official update announcement once this version undergoes Apple’s review.

Thanks to everyone for your continued support and feedback. If you have encountered any other issues outside of those listed above (which are by no means all of the outstanding issues ;)), please send them over my way!

]]> 0
Crossword Dungeon is Now Available on iPhone! Tue, 23 Oct 2012 16:14:08 +0000 It is with great honor and pleasure that I announce the launch of Crossword Dungeon, on the iPhone App Store.

Crossword Dungeon is a roguelike-like in which your character traverses a procedurally-generated crossword dungeon, wherein guessing the correct letter results in a critical hit to the monster on the tile, and the incorrect letter in trading blows with the aforementioned baddie.

There are three playable classes with unique skill trees: the Barbarian, with a focus on Gore Attacks and high damage; the Ranger, with a focus on revealing tiles and ranged attacks; and the Scoundrel, with a focus on Stealth attacks as well as a wide variety of opportunistic tricks.

The game is available for the iPhone/iPod Touch (iOS 5 and 6), please share it with your friends, and review it if you enjoy it!


Here are some in-game screenshots:

]]> 11
A Few Updates and a Sneak Peek Sat, 25 Aug 2012 03:43:29 +0000 During the past few weeks, I’ve kicked the development efforts of my latest project— sneak peek below— into overdrive, targeting a completion date of end of August/beginning of September. Here are some updates of note having taken place during this period of relative blog and Twitter silence:

Adventurer’s Guild “Let’s play” videos

YouTubers TheUberHunter and dewaldo have been gracious enough to do video review/walkthroughs of many of this year’s 7DRL challenge games, including yours truly’s The Adventurer’s Guild! Behold:


Legends of Aesthir development halted

I made the call to put an end to the development of Legends of Aesthir earlier in the year as resources— mainly development motivation and time— slowly waned. It was the Freakonomics podcast episode on quitting that saved me from falling into the sunk cost fallacy, and instead spurred me to focus on the opportunity cost of working on that project exclusively.

Name generation breakdown in the works

In addition to feverishly churning out the Objective C machinations to bring my latest creation to life, I’ve been putting together a similarly structured article to the World Generation Breakdown in which I break down the statistical letter name generator in use in Dance of Death and my current project. I’ll likely put the finishing touches on it whist I twiddle my thumbs awaiting the app store review.

Nolithius, LLC.

It’s official! I’ve registered Nolithius as a limited liability company in preparation for the release of my upcoming game, allowing me to attach it to the “brand” rather than my personal name.

iPhone game weeks away from completion

I’ve been fairly tight-lipped about my latest project, but with the completion date (pre-app store review) drawing nearer (targeting the end of August/beginning of September, as I mentioned earlier), I figured I’d trickle out some more details: it’s a roguelike-like iPhone game with a twist, developed in Objective C on top of Cocos2d after being prototyped in Flash. I’ve partnered up with someone for the music and audio, having taken the plunge to do all of the artwork myself. Here’s a sneak peek of character creation:

You like? I’m pretty happy with it. :)

Back to work!

]]> 2
The Adventurer’s Guild Bugfixes Wed, 21 Mar 2012 01:26:07 +0000 Even though reception for The Adventurer’s Guild has been excellent, a few bugs, especially one particularly fatal one, have stopped players from diving as deeply as possible. These bugs are no longer.

I have uploaded an updated version in which I was careful not to fiddle with any game balance issues so as to keep with the spirit of the 7-day roguelike challenge. Here are the details:

Map did not draw/fatal error in levels 11-14

This was a simple array index out of bounds error. Every level one new monster is introduced, up to level 10. Each time a monster is generated, a level between 0 and the current level is chosen to select the monster type. This was being capped incorrectly to the length of the array instead of the length of the array -1, which explains why this issue was occurring intermittently after level 10.

Monsters spawned underneath players

Moving down the stairs used to cost energy and resolve monster turns, as one would expect. This, however, caused monsters to act and move to the same position as the player in an unusual race condition when the level was generated. Rather than fiddle with a special case, moving down the stairs now no longer expends energy nor causes monsters to act.

Heal spell effect did not clear from tiles

Kohn’s [h]eal spell’s animation effect used to remain visible if you cast the spell next to impassable tiles, due to the way I was queuing the “add effect” and “clear effect” animation instructions. I no longer treat impassable terrain any differently (go ahead, heal the walls), and the effect now properly clears from all of the tiles.

Characters got separated after descent

This can still happen for certain dungeon configurations, but has for the most part been fixed. The starting location for levels was not being reset upon descent, causing odd placement of characters if it happened to be in an impassable area, since the radius search to get the nearest empty set of tiles was too broad, as opposed to tightly grouped around an empty area set of tiles.

Characters were spawned on top of each other after descent

Also addressed with the above fix.

Characters get lost around corners

This is, unfortunately, a product of the crude line-of-sight algorithm used by characters to follow the leader. Rather than a bug, I had to make the call to use such a simple pathfinding algorithm in lieu of A* or Dijkstra maps to keep the scope manageable. I will be sure to address this should I flesh out The Adventurer’s Guild into a larger game, but this “feature” will remain in the 7DRL version.

Let me know if you run across any additional bugs!

]]> 2
7DRL Success: The Adventurer’s Guild Sun, 18 Mar 2012 04:01:34 +0000 I am proud to announce my first entry and success into the 7-day roguelike challenge, The Adventurer’s Guild!

Developed in Flash with ActionScript 3 (and playable in the browser, as usual) starting Saturday, March 10th at around 1:00 PM and finishing today, March 17th, at around 6:30 AM.

Taking into account how busy this week has been at work and otherwise, I am particularly happy with how many of the original plans I was able to accomplish. I will be sure to go over my thoughts and describe the process in further detail once the dust settles a bit.

In the meanwhile, I will be keeping an eye out for a few bugs that have been reported. If you are still working on your game for the challenge, get back to work, and best of luck! Otherwise, play The Adventurer’s Guild, and let me know your thoughts.

]]> 7