Friday, May 25, 2012

First Flash Roguelike step

After all the trouble I had with getting my Java 7DRL applet to run in the browser, I've decided to check out Flash for my next rogulike. I've used flash before so I figured it would be easy enough and after getting the AsciiPanel.as repo on github, I was able to play around a bit. Here's version 0.1 of my next roguelike project which will be the successor to I rule, you rule, we all rule old-school Hyrule.


Some things to note:

  • The overworld is completely connected - you won't start in a place that's blocked since every tile is connected to every other tile.
  • There's underworld dungeons. They're only one room right now but it's a start.
  • I have some ideas on how to improve on the original game while still keeping the spirit the same.
  • The current working title is much shorter.
  • Once I clean up the worldgen code a bit more, I'll put the source on Github and add it to the RogueBasin.

5 comments:

  1. Ryland Taylor-AlmanzaMay 25, 2012 at 10:04 PM

    Awesome! I really liked iryrwarosh, and I'm looking forward to what you come up with!

    ReplyDelete
  2. Where's the link?

    Also, if you'd like, I've got AS3 source code for fairly fast drawing of colorized bitmap tiles over at: http://www.nolithius.com/game-development/world-generation-breakdown

    Cheers!

    Ebyan "Nolithius" Alvarez-Buylla
    http://www.nolithius.com

    ReplyDelete
    Replies
    1. Wow! Nolithius himself!

      I just noticed that the flash isn't appearing in firefox. It works in IE and Safari though; I'll see what I can do about that. You can also try running it directly from https://sites.google.com/site/trystansprojects/Roguelike.swf but that's not going to be the correct size so it will look really bad. I'll link to the code once I clean it up a bit more.

      I'll take a look at the fast drawing stuff. What I have sometimes seems sluggish - probably from drawing since nothing else is going on yet.

      Delete
    2. Loaded it on Chrome, looking good!

      Snooping through your sourcecode, it looks like you're using threshold() and copyPixels() to colorize/copy onto buffer. copyPixels() is fast, but threshold() is not. Take a look at:

      http://code.google.com/p/dance-of-death-worldgen/source/browse/trunk/src/com/nolithius/dodworldgen/screen/Screen.as#90

      I do a getVector() then manually step through each pixel and change the color if needed. Then setVector() onto the destination BitmapData.

      I remember testing this system with getPixels()/setPixels(), which were in themselves faster, but accessing/writing to the ByteArray to colorize the pixels was much slower.

      Also, I recommend using a pure white/black PNG as your source, that way you can test for == 0x000000 or == 0xffffff.

      This is all ultimately splitting hairs, you're unlikely to notice a difference on a modern machine, but if you run some benchmarks you'll see you're squeezing out more pixels in a bit less time with get/setVector().

      Best of luck with the project! I'm around if you need any help or source code.

      Ebyan "Nolithius" Alvarez-Buylla
      http://www.nolithius.com

      Delete
    3. Thanks for the advice! I finally got around to using getVector and setVector. Is there an Actionscript profiler out there or do you just do it by hand?

      Delete