Monday, January 26, 2009

Java: CharSi Update #17

Up to this point I have been ignoring any bonuses by having multiple pieces of a set equipped. Now that all equipment mods are stored and displayed correctly it is time to take these bonuses into account. I couldn't decide where to put the variables and methods needed to calculate what bonuses apply. So I created a whole new class file to hold these methods. The methods never get called inside this class file, only in the Stats and Character class files.

Each set evaluated in its own method, even though they are all called at the same time. The first thing to do is to determine how many set pieces are currently on the virtual character. Then the bonuses are applied depending on how many pieces are equipped and which ones they are.

static public void BerserkersCheck() {

for(int i = 0; i <>
berserkersArsenal[i] = 0;
berserkers = 0;

if(helm.compareTo(BERSERKERSHEAD) == 0) //detemrine which items are equipped
berserkersArsenal[0] = 1;
if(armor.compareTo(BERSERKERSHAU) == 0)
berserkersArsenal[1] = 1;
if(weaponOne.compareTo(BERSERKERSHAT) == 0)
berserkersArsenal[2] = 1;

berserkers = berserkersArsenal[0] + berserkersArsenal[1] + berserkersArsenal[2];

if(berserkers == 3){ //full set
charLevelMods[6] = charLevelMods[6] + 8;
charLevelDefOn[1] = charLevelDefOn[1] + 3;
eDmgOn = eDmgOn + 50;
stats[4] = stats[4] + 100;
specialMods[6] = specialMods[6] + 75;
modsOfNote[8] = modsOfNote[8] + 75;
poisonDamage[0] = poisonDamage[0] + 5;
poisonDamage[1] = poisonDamage[1] + 9;
itemStats[31] = itemStats[31] + 3;
}
if(berserkers == 2){
if(berserkersArsenal[0] == 1) //helm equipped
charLevelMods[6] = charLevelMods[6] + 8;
if(berserkersArsenal[1] == 1) //armor equipped
charLevelDefOn[1] = charLevelDefOn[1] + 3;
if(berserkersArsenal[2] == 1) //weapon equipped
eDmgOn = eDmgOn + 50;
stats[4] = stats[4] + 50;
}
}//end

First it is determined how many set pieces are equipped. Once that is determined each specific item is checked, if it is present the bonuses are added, if it isn't the item is skipped and the next item is checked. The arrays that contain the bonus information are then added along with the equipment arrays when everything is summed in the Stats class. This method is repeated for each of the other 31 sets. Most are a bit more complex, especially those that have more than three pieces to the set.

This ends the coding portion up to this point. Characters can be created, skills assigned, equipment worn and all of the bonuses and stats displayed appropriately. Now I need to run some checks to ensure everything really is displaying and no mods were left out. I checked everything as I added it to the program, but I'm sure some bugs slipped through. Case in point when putting this in I found out that the Barbarian mastery skill bonuses weren't being added to the displayed damage and attack rating values. So my next step is to create several text characters and see if their stats match up with what I am expecting.

Tuesday, January 20, 2009

Java: CharSi Update #16

Quite a lot of information has been gathered up to this point, from the equipment used to the mods the skills provide. However much of this information isn't displayed accurately, or at all, in the Stats panel. Now that is no longer the case. Every mod is now summed and displayed as accurately as I can in the Stats panel, from IAS provided by Fanaticism to the Attack Rating bonus from the Blessed Aim aura. Along with that the Skills panel now displays the elemental damage done while taking into account any bonuses provided by the equipment to increase this type of damage. This means if the virtual character is wearing Trang's gloves, then the poison damage done by the character's skills are increased accordingly.

However that is not all that was accomplished with this update. Quite a few minor points and details were addressed as well, including:
  • Add per level mods to Stats panel displayed values
  • Add elemental damage from equipment to Stats panel displayed values
  • Add skill bonuses to Stats panel displayed values
  • Correct poison damage calculation
  • Add ability to select active aura in Stats panel and add bonuses accordingly
  • Add ability to select attack type in Stats panel and add bonuses accordingly
  • Add hidden bonuses from Fade, Blessed Aim and Resist element auras
  • Set resistance values in Stats panel to no longer display a value higher than what is possible
  • Correct Enchant damage to take into account ranged weapons
  • Add display field for off weapon Increased Attack Speed

I think I caught all of the bugs I could find, but more testing will be needed to ensure that is the case. Now with these updates a character can be fully equipped with Set/Unique/White items, assigned skill points and see them accurately displayed in the Stats panel.


Most of the GUI changes were made in the damage sub-panel. Specifically I removed the assassin kick and paladin smite damage fields and instead Incorporated them into the primary weapon display field. I needed the space as I then had to include a few more JComboBoxes for prebuff skills as well as possible aura selections. Each of these JComboBoxes will be populated with options as those skills are assigned points in the Skills panel.

I believe I have the damage calculation correct. There are exceptions for several of the skills, such as Vengeance, Enchant, Smite, assassin kick skills, Berserk and so forth. As a result that particular method is quite confusing and unless someone points a bug out to me I'll have a devil of a time correcting any problems.

However to avoid some possible problems I did decide that only the physical attacks will be displayed in the Stats panel. If an elemental attack such as Firewall needs to be seen then the user can simply go to the Skills panel an view the values there. It would be a duplication of effort to have them displayed in the Skills panel, besides which would also require quite a few more exceptions as many sources of damage wouldn't be counted then. The only exception to this is Blessed Hammer. Seeing as Hammerdins are a very popular build and Blessed Hammer is given a bonus by Concentration the only way to display the values correctly was in the Stats panel, even though this is a caster skill.

Overall I think it is coming along quite nicely. I'm sure a minor bug or two will pop up and need fixing, although I think I caught most of them already. The GUI itself should be set, so this leaves me with only needing to take into account Set item bonuses to be done with the current panels.

Friday, January 16, 2009

Diablo II: MFO #3

The Magic Find Olympics (MFO) is a contest run twice a year on the Single Player Diablo II forum. The basic premise is that each contestant picks something to run: Baal, Mephisto, Level 85 areas or Super Uniques. Then everyone has nine days to run those areas as much as possible, the person with the best items found wins their respective section and can then take a few items from the losers.

Last time I ran Pindleskin (SU category) and had a dismal showing for the time invested. Granted I didn't go all out but only ran as much as I felt like without making it a burden, so those with more dedication blew me away. The returns from Pindleskin are based purely on luck, and with him as a target luck has been hard to come by for me. So this time around I'm going back to Mephisto. I had originally thought about participating in the Level 85 area category but my Fishymancer simply can't compete with the other players running the Ancient Tunnels and Pits at extreme speed. I'd like to have some sort of chance, no matter how small, of placing in the top three. Therefore Mephisto it is.

Again Malice my main magic finder is my runner of choice. She's level 93 now (barely) and only gets used for magic finding purposes, therefore only in tournaments like this. I had to rearrange her inventory and equipment a bit as her last target was Pindleskin and the Harmony bow she had on switch wasn't going to be useful. That and I didn't need quite so many resistance charms since fire damage wasn't something I needed to worry about. This freed up a 4x6 area in her inventory to pick up items, meaning she wouldn't have to stop off at Cain every run to identify her loot.

Sign-up Thread
Progress Thread
Results Thread

Malice's runs followed a nice progression, slightly different from before based on some tips I've picked up. She starts in Act IV and uses Telekinesis on the WP to activate it. She does have to take a step to the side first as otherwise the spell fails. From there she teleports to Mephisto and uses Static Field to reduce his life to one half. She then steps backwards a bit to let the mercenary tank while she fires meteors and fireballs at him. Four meteors and about 12-15 fireballs later Mephisto is dead and I can review the dropped prizes. Then she teleports to the portal and uses it to enter Act IV again.

On average the mercenary requires 2-4 health potions per run to stay alive and Malice has to teleport him away on a regular basis in the vain attempt to keep him vertical. Even with all that he does have to be resurrected once every twenty runs or so. This is because he is wearing the wrong equipment, which I found out after the MFO was over. He has an Insight Cryptic Axe, Shaftstop and a Tal's helm. Instead he should be wearing the Shaftstop, a Rockstopper and Keplie Snare and then wouldn't require any health potions at all. Malice does lose the Meditation aura from the Insight so she'll have to drink a mana potion each run, but it does make things much easier with the alternative setup.

Malice made a total of 4534 Mephisto runs over the nine day tournament. In all this took 49 hours, 13 minutes and 19 seconds and netted her 421 total qualifiers. This came out to 10.8 runs per qualifier, which is right in line for the average I received last time running Mephisto. The 39 seconds per run however is much lower than that from last time, and I doubt I could get much lower without switching to a pure Blizzard sorceress instead of Malice. The number of runs however is over double what I performed last time, and it showed. I ended up coming in second place overall, even though I was last with only two days to go. Found four of the top five items on the very last day, which I spend all day running Mephisto with breaks here and there for sanity's sake.

Qualifiers:
Immortal Kings Stone Crusher - 33
Dagoons Teaching - 15
Laying of Hands - 20
Dark Adherent - 19
Ariocs Needle - 11
Wizardspike - 12
Bonehew - 8
Ethereal Edge - 14
Windhammer - 13
Gimmershred - 11
Demon Limb - 11
Jade Talon - 11
Djinn Slayer - 7
Bloodmoon - 8
Natalyas Shadow - 11
Credendum - 10
Nords Tenderizer - 7
Razors Edge - 10
Ormus Robes - 6
Sandstorm Trek - 12
Baranars Star - 6
Rune Master - 7
Demons Arch - 11
Flamebellow - 5
The Reapers Toll - 8
Harlequin Crest - 9
Shadow Killer - 10
Thunderstroke - 3
Eschutas Temper - 4
Hellslayer - 6
Lightsabre - 7
Viperfork - 3
Hellrack - 3
Arachnid Mesh - 5
Blackoak Shield - 5
Draculs Grasp - 4
The Gladiators Bane - 5
Marrowwalk - 3
Stormshield - 2
Stoneraven - 8
Najs Puzzler - 6
Blood Ravens Charge - 3
Nosferatus Coil - 3
Spike Thorn - 2
Steel Shade - 4
Soul Drainer - 10
Wolfhowl - 2
Andariels Visage - 2
Verdungos Hearty Cord - 3
Heavens Light - 2
The Redeemer - 3
Cerebus Bite - 1
Alma Negra - 5
Ondals Wisdom - 1
Demonhorns Edge - 5
Sazabis Ghost Liberator - 1
Azurewrath - 1
Doombringer - 1
Arkaines Valor - 1
Head Hunters Glory - 1

The prize of my loot is the Azurewrath, an item I've been searching a long time for. It is one of those items I keep seeing everyone else finding and yet I'm simply not able to. It's also the reason I ran Mephisto really, as he can drop it but Pindleskin can't. Just behind the Azurewrath was my next prized possession, a Tal's amulet. That completes the set for me as I found the armors last MFO running Pindleskin. Of course now I have to figure a build to make, but I have time for that. Beyond that I found enough class specific items (HoZ, Titans, Bactucs, Jalal's Mane) to keep any characters outfitted for a very long time.

Overall I am very pleased with this MFO. I didn't lose any items since I came in second and the top finisher plays Hardcore and therefore can't use my Softcore items. I also didn't take any items from people below me as I am self-found and intend to stay that way. The next MFO isn't for another six months so no idea which category I'd run that time around, assuming I have time to participate at all. Time will tell.

Monday, January 12, 2009

Diablo II: The Twelve Days of Christmas

In the Twelve Days of Christmas tournament by Maxicek contestants are given a set of tasks and must complete each one. It is different from other tournaments in that the tasks are completed with already completed characters, you don't need to create one from scratch to compete. The tasks ranged from find a specific number of a type of item to locating a monster with a certain combination of mods to gathering a specific number of one type of monster on the screen at once. Points are awarded depending on what difficulty it was completed in as well as the type of monsters involved (unique, champion, normal).

Personally I joined knowing I wouldn't be winning this one. My goal was to complete all of the tasks, to which I was almost successful. The one task I failed in was finding a Blood Hawk bosspack, which no one else completed either so I don't feel too bad about that part. Overall it was a lot of fun, and since I didn't lose items (as in the MF tournaments) it was a successful tournament. I was able to complete a lot of the tasks simply by leveling two different characters through the entire game. The rest was completed with a few runs of bosses or different areas. Not sure if I'll do it again next year, it will completely depend on what else is going on at the time.

Wednesday, January 7, 2009

Java: CharSi Update #15

Not done by any stretch of the imagination, but enough was completed to warrant an update. First thing on the agenda was to alter the GUI component so that it could better display the needed information. First off I removed the damage/AR to demons and undead components. While I still intend to provide that information, I think I'll do it as a ToolTip rather than in the GUI component itself, since that information is a tad less important.

In its place I've included damage and attack rating fields for the off-hand weapon, assassin kicking, paladin smiting and throwing of the primary weapon. So now that they are present, I have to determine how to populate data into each of these components. First step was to create a int array to hold the attack rating information. Then I needed the equation that determines what the true attack rating should be. This I found on the Amazon Basin when I was browsing it as the DIII forums were down for "maintenance". I created a method that would combine all of the mods associated with attack rating into one equation and then populate the attack rating int array appropriately. Adding the necessary JTextField.setText calls for the attack rating fields in the overall SetAll method means whenever anything is changed, these values will be updated.

Doing the same for the damage fields fell along the same lines, but there were quite a few more pieces to work together. First off the necessary equations were found in the Strategy Compendium. All of the needed mods were already summed up under other methods in the Stats class, so I simply plugged them into the equation inside of a new method and called this method when the SetAll method is run. Granted there were a few pieces that needed extra attention before this could be considered a success.

First I had to decide how to handle the StatsBonus variable. Each of the item descriptions contains the base item as its second line, all except the white items that is. So once I added this descriptor to all the white item text files I was able to save this information into its own variable. This variable was then compared to an array of Strings to determine if the chosen item falls into any of the special categories.

String[] hammers = {WARHAM, MAUL, GREATMAUL, BATHAM, WARCLUB, MARTEL, LEGMALL, OGREMAUL, THUMAUL};

for(int i = 0; i <>
if(hammers[i].compareTo(base) == 0){
hammer = true;
break;
}
}

If there is a match then a boolean variable is set to true, for use later.

if(hammer)
statBonus = (float)(1.10*(baseStats[0] + stats[0] + userStats[0]))/100;

With that variable determined I now only have the Modifier variable to deal with. This one is modified depending on what type of skill is being used. As a result I'm leaving this one until later as I have quite a few other pieces that need to be connected between the Skills class and Stats class that I'd like to handle all at once. However the damage panel does display a Normal attack without difficulties now.

Last but not least I did create the necessary methods to sum the +skill mods from the equipment worn by the virtual character. This information is then transferred over to the appropriate Skills sub class so that now the Skill Calculator can display values greater than level 20. It now accurately shows what level the character's skills will be at for the equipment worn.

However I'm not done yet. There is quite a bit of information that still needs to be attached between the Skills, Stats and Equipment classes. For example the auras used by the Paladin aren't considered for defense, attack speed, resistance or anything similar in the Stats panel. Correspondingly the mods given by equipment for +elemental damage aren't considered in the Skills panel information. So the next step is to finish attaching all of the different pieces behind the scenes until I have accounted for everything possible in all three JPanels.