Thursday, July 30, 2015

Unleashed Pixel Dungeon - Auto-Aiming

One of the most important things I find important when I design programs is the User Interface.  I am a firm believer that things should just work the way you think they should.

When I was looking to put my own stamp on Unleashed Pixel Dungeon the first thing I noticed was that pressing on the Quick-Slot item brought up a targeting dialogue, but did not auto-select any of the available enemies.  I wanted to make it so that if a previous (still living mob) has not been targetted it will randomly select a visible mob from those available to use as a default.  Pressing the Quick-Slot item again (double tap) will auto-target that mob.  You could always select a different mob if you prefer, this is just for convenience.

I started playing with the, visible enemies are stored in the Dungeon.Hero structure, so in the useTarget() function (which is called when we click the Quick Slot Button with something that uses targetting) we first check to see if we already have a target selected and it is one of the available targets, otherwise we iterate through the list of visible targets and randomly select one of them...

I guess we could select the closest, or the weakest, or the toughest, or the one that is awake... for right now I am just selecting a random target.  The only thing left to do is save off that target so that we can continue attacking it the next turn.  I am also saving the lastTarget off in the Hero structure so we can potentially link Melee attacks against the same target in the future.

It was a fairly painless mod to implement and a nice introduction (for me) into the code.  The full fix is available on GitHub.


Unleashed Pixel Dungeon version 1

I have been meaning to learn Java better for quite some time now, which has led me to my latest project over the last month and a half: Unleashed Pixel Dungeon.

I am very excited about contributing to this Open-Source project.  Basically, this is a Roguelike game where you control a single adventurer and explore a randomly generated dungeon, with a lot of the content randomly generated (scroll names, potion colors, etc...) in order to keep the game fresh and exciting.  Food is generally scarce, and you will probably die a lot.  But, if you are smart you can discover strategies to survive; each obstacle is a puzzle to be solved.

Unleashed is based on the wonderful Pixel Dungeon and Shattered Pixel Dungeon variants.  I am hoping to spend a few posts talking about the specifics, but here is my current change log for the first version:

DSM-0000   Moved code into the Android Studio directory structure
DSM-0001   Fixes needed to get code to compile
DSM-0002   Place Unleashed stamp on the game

DSM-0010   Increase dungeon level size to 40x38
DSM-0011   Reduce Hunger impact
DSM-0012   Item drops in High-Grass
DSM-0013   Improved drops in Crypts and Treasuries
DSM-0014   Adjust drop tables

DSM-0020   Add five new dungeon levels
DSM-0021   New Mobs - Slimes/Assassins
DSM-0022   Level-up Buffs
DSM-0023   Max Hero Level is now 35 - effects mobs max levels
DSM-0024   Exp to Level tweaks to hit level 30 by depth 30
DSM-0025   Level to Power tweaks to make mobs more balanced
DSM-0026   new BURNT level type

DSM-0030   Save/Load Screens
DSM-0031   Allow saves only at Level Entrance Signs

DSM-0040   Item Level Caps
DSM-0041   Chance of Upgrade Failure
DSM-0042   Artifact Weapons
DSM-0043   Glowing Weapons
DSM-0044   Allow enchanted weapons to be upgraded
DSM-0045   Armor Glyph descriptions
DSM-0046   Auto Aim with Staff/Thrown Weapons
DSM-0047   Better MageStaff imbuing

DSM-0050   Altar Dungeon Feature
DSM-0051   Altar Room
DSM-0052   Altar Donations on drop
DSM-0053   Archway Dungeon Feature
DSM-0054   Prison Room - locked with bones
DSM-0055   Make the "SECRETS" level feeling less common

talk to you soon,
David Mitchell

Back from Hiatus

Well, it's been a long time since I've posted on here.  I had changed my email account, and then wiped my personal laptop so that I could work on Android Development.

Long story short; I am very grateful for the Blogger password recovery options.

I am very excited about some new projects I've been working on including my first Android - Google Play release "Unleashed Pixel Dungeon"!

More on that shortly,