Archive for November, 2009


Drupal ships with a powerful method of packaging and redistributing your platform configuration called Install Profiles. It is similar to how Linux distro’s work, where you have the same core operating system, but extensive customization results in a different experience (Fedora, Ubuntu, Debian, etc). This allows us to employ rapid application development (RAD) after finalizing a build of a customized Drupal application.

There are some ‘gotchas’ though if you develop custom Drupal modules like we do. During the install process, Drupal only bootstraps the bare minimum to get the job done. I’ve noticed that if a module’s install routine calls functions outside of the .install file, the expected result tends to fail because files other than .install are not included during this loading process. It seems there is a special case for the file to be included, or you have to specify in your install profile to explicitly include the file (which takes a lot of time to do). To be specific, I have seen this happen with Drupal Boost, Drupal Gallery Assist, and our custom module Billboard, which tipped me off to this problem. The issue has since been fixed in Boost (and Billboard).

For us, the issue was creating custom ImageCache presets during a module’s install routine. This worked perfectly if you were going to the Drupal Modules page and enabling Billboard. What happens was the hook_install() function fired, included a definition file, and created presets based on that file. This fails during a Drupal install profile, where you use a script to install and configure Drupal automatically. This same issue occurs in Gallery Assist, and here is how I got around it:

It was pretty apparent that the code needed to come out of the install function. However, I needed to be sure that where I put the code would be compatible to the module loading process, and I’d need to be sure ImageCache was both installed and loaded before running the following code. Otherwise it would error out, and no ImageCache presets would be created.

Drupal has a crucial hook for modules. hook_init() allows you to perform tasks every time the module is loaded. In this case, I wanted to tell it to run a function and check for two default ImageCache presets. If they didn’t exist, create them. This approach solves three issues:

  1. Getting around install profile limitations
  2. Provide default ImageCache presets for Billboard module when it is enabled
  3. Recreate the ImageCache presets if they are accidentally deleted by the user (or developer :) )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
function mymodule_init() {
    mymodule_create_default_imagecache_presets();
}
 
function mymodule_create_default_imagecache_presets() {
 
    $default_size = imagecache_preset_by_name('mymodule-default');
    $thumb_size = imagecache_preset_by_name('mymodule-thumb');
 
    if (count($default_size) == 0 || count($thumb_size) == 0) {
        if (count($default_size) == 0) { 
            $mymodule_default_size = "600";
            $mymodule_thumbnail_size = "80";
 
            $presets = array();
 
            // Default size.
            $presets['default'] = array (
            'presetname' => 'mymodule-default',
            'actions' => array (
 
                  'weight' => '0',
                  'module' => 'mymodule',
                  'action' => 'imagecache_scale',
                  'data' => array (
                    'width' => $mymodule_default_size,
                    'height' => '',
                    'upscale' => 0,
                  ),
 
              ),
            );
 
            imagecache_preset_save($presets['default']);
            $presets['default']['actions']['presetid'] = db_last_insert_id('imagecache_preset', 'presetid');
            imagecache_action_save($presets['default']['actions']);
            imagecache_preset_flush($presets['default']);
            imagecache_presets(TRUE);
 
        }
 
        if (count($default_size) == 0) { 
            $presets['thumb'] = array (
            'presetname' => 'mymodule-thumb',
            'actions' => array (
 
                  'weight' => '0',
                  'module' => 'mymodule',
                  'action' => 'imagecache_resize',
                  'data' => 
                    array (
                      'width' => $mymodule_thumbnail_size,
                      'height' => $mymodule_thumbnail_size,
                      'upscale' => 0,
                  ),
 
              ),
            );
 
            imagecache_preset_save($presets['thumb']);
            $presets['thumb']['actions']['presetid'] = db_last_insert_id('imagecache_preset', 'presetid');
            imagecache_action_save($presets['thumb']['actions']);
            imagecache_preset_flush($presets['thumb']);
            imagecache_presets(TRUE);
 
        }
    }
 
    return;
}
?>

What that says basically is ‘hey, do our default ImageCache presets exist?’ if not, it will create them at runtime.

I have tested this a handful of times with positive results, and, it works with install profiles since hook_init() is called after Drupal loads. Food for thought for all you Drupal developers out there. If there is a better way to achieve this feel free to leave a comment.

How to beat GaxKang the Unbound

I really thought this was one of the easier bosses in the game, and yes, I have faced off against Kangaxx the Lich in BG2 (one of the hardest bosses in any game I’ve ever played, period). It took me at least 30 solid tries against Kangaxx before winning, but Gaxkang I destroyed on the first attempt at level 19. Nothing to it really.

If you are fairly well prepared, you should have spirit resistance and a mage in your party (see a pattern?). When GaxKang appears, have a mage throw Cone of Cold or Hold Person to hold GaxKang in place, then start laying hexes down on him to lower his resistances. Keep the aggro on your tank, keep the party above 50%. Pretty standard fare as far as boss tactics go, but apparantly people are having a harder time with him than the High Dragon or Archdemon. Personally I don’t think its all that tough, its just the perception of difficulty since you are in a very small room to fight. I think the Sloth Demon was a hell of a lot harder because he had so many forms to defeat. Gaxkang isn’t so bad, you just need to interrupt his attack rhythm. Plus, if you have Zevran or another rogue, coat their weapon in any Magebane poison to disrupt his casting ability.

He drops a Keening Blade, warrior only. It’s kind of lame, versus what you usually would get from a boss like this. Most people like to get loot that their main/custom character can use, and if you are not a warrior you are screwed here. I chose an assassin for the combat difficulty (it didn’t seem to matter) and fun, and there aren’t any rogue-specific gear in the game but a ton of warrior/mage only stuff. Design oversight? I wasn’t too happy with loot drops overall in Dragon Age being a Baldurs Gate veteran myself, but eh, what can you do. I’ll play through it again in a few months.

How to beat the Archdemon

Here we are, final boss, the capo di tutti capi (boss of all bosses), the big bad Archdemon. This fight takes place on top of Fort Drakon, and I have to say the Tolkien influence really shows here. Before you can even reach the fort, you have to fight through the main sections of Denerim through, I shit you not, at least 300 darkspawn including lieutenants and Generals. The Generals are no joke- I believe they are a mix of Champions, Reavers, and Blood Mages; they are pretty tough.

Depending on how you played through the game, you will have 4 groups of CPU controlled allies you can summon at will. I had humans, dwarves, elves, and magi to use. Without these troops, the final battle is pretty impossible to say the least, as there are waves and waves of darkspawn that come out at you as you battle the Archdemon.

The best strategy is to save your allies for the final fight. You may want to call in the dwarves when dealing with the darkspawn Generals, because the adds during the fight are a pain in the ass. You could just as easily though cast AOEs with Morrigan and be alright. The Darkspawn in this final encounter are different. The generic enemies have very little HP (names are white) and go down in one or two hits. There are a good amount of lieutenants here though (yellow names) who take a bit more of a beating. The Generals are full on bosses (Orange names) and there are two of them. They have a ton of HP and lots of status ailment type spells, hexes, and direct damage spells.

Since you cannot leave this area after you enter Denerim, be very careful when and where you choose to use poultices and balms. You won’t be able to get any more. There is one vendor just before the final area (why does this keep happening in RPGs?) who has a few balms and poultices, but not many. You will want to have a lot of spirit balms and greater or better poultices. I had 30 greaters and potents, and used 22 of them in the final battle.

My party is the same as it always is. The Archdemon is different than a regular dragon- it uses spirit based attacks and not flame. So equip your party with the very best gear you have, like large flawless spirit crystal for Shale (40% spirit resistance) and make sure they have a spirit balm active to up the resistances even more. You are going to need it.

When the battle starts, summon in Dwarves or Humans to start chipping away at the Archdemon. They aren’t going to do much, but the point to this is to keep the Archdemon and darkspawn distracted on them while you get to the nearest ballista. A ballista shot will do between 50-100 damage on the Archdemon, and you can get 3-5 shots from a ballista before it ‘breaks’. You can then run to the next one that is in range and use it, or, if you are a rogue, you can repair the broken ballista once or twice for another round of shots.

Once you reduce the Archdemon’s HP to 50%, the fight starts to get a lot harder. It will summon in waves of darkspawn against you. Make sure you get Morrigan or any caster out of harms way, and keep anyone healed who needs it. If they drop to 75%, heal them. Take your main and find the next nearest ballista to hit the Archdemon, at this point it is situated on a platform no one can reach except for ranged attacks like bows, ballistas or spells.

After the first few waves of darkspawn are dispatched, the Archdemon will fly back into the main arena and you can start melee’ing it again. It’s really a test of endurance- just keep your tanks healed, put hexes on it with your mage, and keep using ballistas to do significant damage. If you run out of allies, summon more. You will eventually pull through the fight and win. Sadly, you don’t get any loot from the Archdemon. You do get to see a cut scene and epilogue, and the chance to continue playing the game. I’ve already done all that you can do in the game (including killing Gaxkang the Unbound) so I guess I will have to wait for DLC.

How to beat the High Dragon

Well we’re on quite a roll this week.

I have a fairly big addiction to RPGs – especially when they are good, like Dragon Age. Ramp up the difficulty and away you go. There is one particularly difficult (but optional) boss called the High Dragon. I assume most players will skip him because dragons are a difficult encounter in basically any RPG. But that’s pussy, and this game is expensive. Do it.

I think the hardest thing to realize in this battle is you need to position everyone in a good spot before summoning the High Dragon down to fight. Otherwise when he swoops down, everyone is out in front of him and prone to fire blast, or if you’re rather unlucky, get eaten right away.

I had to try this boss about a dozen times before I found a strategy that works. Cone of Cold and Blizzard don’t really work here. Cone of Cold will freeze the High Dragon for about 3 seconds, which is nothing, but every second counts for DPS.

So my party is Morrigan (duh), Alistair, Shale and myself, a full spec Assassin. First thing I did was position my assassin in the far back, behind where the dragon will initially land. I put Shale to the right, and Alistair to the left of where the High Dragon lands at the start of the battle. You need to back them up enough to where they won’t take initial AOE damage when the High Dragon slams into the ground. I put Morrigan on gong duty so she can summon and prep spells to cast prior to the battle.

If you have any Lesser (Greater is preferable) Warmth Balms, use them on the tanks. This is the key that turned the battle in my favor when I finally won. When the High Dragon lands, take the party off of Hold Position so they move in to attack. Have Morrigan throw any status Hex you have on the High Dragon, follow immediately with Cone of Cold, Winter’s Grasp and Lightning. If you feel you have time, cast Tempest for an AOE- it’s almost like having a 5th party member. Try to keep two party members to the side of the High Dragon while the main tank gets out in front. The dragons in this game have this asinine attack where they tail swoop anytime someone is remotely past their back leg. Kind of makes rogues useless in this sense, but you can still do good damage from the sides. I found that getting in front of the back leg works well.

This isn’t a quick battle but they aren’t designed to be. It’s more a test of skill and endurance. As long as you have enough health poultices and can Heal with Morrigan, you should be alright. Knowing when to use Heal vs Poultice is good too, like if someone is stunned or knocked down, Heal will get their health back up quicker than using a poultice.

After employing this starting tactic and making sure everyone stayed above at least 60% health- I won this battle and no one died.

Can’t say the loot was very good given the difficulty of the battle but eh, what can you do?

I gotta say as far as Dragon Age goes, the Broodmother was kind of an underwhelming encounter. I guess its the boss design I wasn’t very keen on, but anyway. I feel bad for those who come into the Broodmother fight with a party full of tanks, honestly I don’t see a way to beat the Broodmother without a mage. Maybe its me. Maybe its Bioware. Maybe its RPG in general. The mage is always your clutch who can turn any battle around even if it seems basically over.

By this point, I have Morrigan maxed out in favor towards me, which gives her the benefit of Massive Magic influence (I think its like 40-50 extra Spellpower? Have not confirmed) on top of gear that adds more spellpower and cold damage, with a maxed out branch of Cold magic. If you’re looking for the best way to do crowd control, pass over Shale and Alistair (my 2 tanks) and fall back on Morrigan. If you have them both trained up to Threat or War Cry, they’ll draw aggro easily enough in any encounter, leaving Morrigan open to wreck adds with Blizzard with Tempest stacked on top. Two AOEs going with one freezing most types of enemies clears riffraff faster than you can imagine.

Anyway, I got wiped the first time I got to Broodmother because I had no idea what to expect. If she grabs a player during battle its basically over for them, she crushes them to death (as I found out). This is a random attack, but you can attempt to juggle between players and time your spells and indefinitely incapacitate the Broodmother.

The second attempt I wisened up a little bit and let Morrigan start things off with Blizzard and Tempest so there would be constant damage going. This will quickly remove the tentacles from the first wave of the battle. Then I sent everyone up to melee, and Morrigan cast Cone of Cold to freeze Broodmother in place. If you have Shale, when she unfreezes, hit her with Slam to draw aggro and stun her for a second or two. By this point, Blizzard, Cone of Cold or Tempest should be recharged for use to stun/freeze her again. Drop the AOEs when the Darkspawn start to add, or you will lose control quickly. Some simple juggling of health potions and Heal from Morrigan should keep things relatively organized. If you have the chance, drop Vulnerability Hex on the Broodmother too (or higher equivalent)- with Shale using Large Flawless (crystal type) and any Rune enhanced weaponry, your damage output will be great.

Her loot sucks though.

I don’t know how close I am to the end, I feel like I have made no progress at all (indication of a great game, since I have clocked over 36 hours into the game). I hope the game lasts another 20 hours. I can see another playthrough happening.

How to Beat Uldred in Dragon Age

Alright, very rarely do I do this but since I was stuck on this part for an hour or so I felt I should pass this along.

In Dragon Age, I’m commanding a fairly chaotic good party. I border on the good so I can retain Alistair in the party as the main tank (Sten is too much maintenace). Being that, I have to turn against blood mage support characters in order to keep this character positive and stay with me. I had to kill Wynne in order to proceed into Uldreds chamber at the top of the Circle Tower.

Without a mage, this battle is basically impossible.

However, you can (and I’ll admit, this is a flaw of game mechanic) change party members basically anytime you want. Uldred seems to be very weak to cold based attacks, so before you go in switch out Wynne and bring in Morrigan. Fortunately for me, I had her specced in cold magic and her equipment totals 20% additional cold damage. The cone of cold spell makes this battle a LOT easier. While you keep Morrigan on him assaulting with cold spells and cone of cold when its ready, use your main character to block Uldreds spells with the Litany of Adrella. Also put hexes on him to lower Uldred’s resistances. If any Abominations join the fight, try to stun them with Mind Blast, Horror or anything better than that. Once you get a good rhythm, all Uldred can do is melee on your tank and you should get through the battle without much trouble.

I realize this is over basically everyones head and only 3 people are going to know what the hell I am even talking about. But I can say this, D&D based games consume my soul I know that much. If only I knew how to do other things as well as I know how to dominate RPGs.

Dragon Age is a very solid offering from Bioware. I wouldn’t say its as great as Baldurs Gate 1 and 2 (probably my favorite PC games ever, favorite RPG ever) and the graphics feel dated a few years, but the action, feel and gameworld are definitely there and top notch. I think they borrowed the engine from Mass Effect (another terrific Bioware game) because a lot of the close up dialogue scenes look very similar.

Powered by WordPress. Theme: Motion by 85ideas.
Kevin Quillen is a web developer on the east coast specializing in web design, web hosting, custom website design, website design, web applications, Coldfusion development, database design, MySQL / MSSQL database & consultation, PHP development, Wordpress themes, iPhone application development, Drupal hosting, Drupal development, logo branding, business logic, custom application programming, Linux and Windows Server management and more. All views and opinions posted in this blog are original. Do not copy without permission, but feel free to share an article.