Designing Trudy’s AI 


Posted by Radek on February 13th, 2011.

Categories: design, trudy's mechanicals.

When I initially sat down to design Trudy’s combat, I wanted each unit to have a unique feel. Different attributes and abilities were a good start, but to truly achieve this, all entities had to behave in a distinct fashion.

To begin, I brainstormed a variety of scenarios I wanted to see in-game. These ranged from the somewhat common (an area-effect unit preferring to target foes clumped together) to the more original (a Steampunk robot trying to activate random machinery and only attacking when provoked).

Once I had a list of these, I came up with some character types that would facilitate each case.

Below are three examples of our finalized units, along with a short description and their AI routines. The AI is a bit simplified from the code, but shows a sorted priority of possible behaviours.

The Corsair

Corsair Designing Trudys AI
The Corsair is quick and agile, preferring to take out enemies from afar. Due to his mercenary nature, he has a tendency of sidetracking to grab extra treasure and retreat from a fight if it gets too dangerous.

  1. If badly wounded, randomly alternate between the following actions:
    • Retreat to closest exit.
    • Head for a healing station, if available.
    • Take pot-shots at closest enemy in range.
  2. If defending, take pot-shots at first enemy that approaches.
  3. Grab any nearby treasures.
  4. Man any nearby turrets.
  5. Use saw-blade if upgraded and surrounded by 2 or more enemies.
  6. Attack closest enemy that’s weak to the flintlock rifle.
  7. Attack closest enemy that’s low on health.
  8. Pursue closest enemy until in flintlock range.

The Bruiser

Bruiser Designing Trudys AI

The big and burly Bruiser is slow to act, but capable of travelling great distances once he’s rolled up into a ball. As the muscle of the Underworld, the Bruisers pride themselves on their reputation and never run away from a fight.

  1. If badly wounded, randomly alternate between the following actions:
    • Put up defenses and wait.
    • Retreat to closest alarm station to call for backup.
  2. Don’t move if current position blocks projectile attackers from hitting team members.
  3. Roll into closest enemy by a wall in order to push them back and cause extra damage.
  4. Roll into any nearby enemy.
  5. If upgraded, follow up a rolling attack with a ground slam for extra damage.
  6. Activate closest alarm station if requiring backup.
  7. Retreat from flying units that can’t be targeted with the roll attack.
  8. Pursue non-flying enemies out of range until adjacent to them.

The Sewer Slug

SewerSlug Designing Trudys AI

The Sewer Slugs mutated in the slop cocktails of the Underworld, slowly filling with acid and becoming living batteries. Although they’re naturally docile, they’re considered a dangerous nuisance as they don’t avoid human habitats.

  1. If dying, explode in an acidic burst that showers the surrounding enemies in corrosive fluids.
  2. If badly wounded, randomly alternate between the following actions:
    • Retreat to closest nest if flying-charge is ready.
    • Use self-healing ability.
  3. If not attacked, simply move between closest nest and hatchery.
  4. Fire electric goo on closest enemy to damage and stun them for one turn.
  5. If flying-charge is ready, move toward closest enemy.
  6. If flying-charge is not ready, pass to regain it.

This highly autonomous behaviour means that there’s no “field general” controlling the entirety of the opposing force. Instead, the combat takes on a gang-skirmish feel where each unit follows its own whims.

For quick, small scale battles where the units are all predefined, we found this to be a generally more fun approach.

Planning a Tactics Game 


Posted by Radek on October 5th, 2010.

Categories: design, trudy's mechanicals.

Tactical games are something of a sub-genre that’s a bit difficult to nail down.  Plenty of Tactics games have been released over the years — on both PCs and consoles — with many similarities and differences.

Despite a loose definition, a common thread among them is a focus on turn-based battles between individual units. These conflicts usually take place on wholly isolated maps and center on moment-to-moment maneuvers rather than the long-term goals of strategy games.

Our whole team has always enjoyed these titles, but none of us have worked on them in the past. As a result, we had to do some research before diving into production on Trudy’s Mechanicals.

Tactics Ogre Remake Planning a Tactics Game

A Tactics Ogre remake was recently announced for the PSP; the original still stands as a pioneer among console Tactics games.

We played a bunch of the most notable entries that fall under the Tactics banner, and took some high-level notes on “the good” and “the bad” of each title. Here are the highlights of those lists:

The Good

  • Units possess unique abilities and physical attributes that provide various combat options.
  • Maps are varied aesthetically and can grant passive modifiers, e.g., it’s harder to move through mountainous areas, troops can hide from long-range attacks behind buildings, etc.
  • Units tend to grow stronger as the game progresses, creating a steady stream of rewards while modifying how the battles play out.
  • Bonuses for side/back attacks and elevation are intuitive and fun to exploit.
  • Where available, fog of war creates a strong need to explore the map while facilitating ambushes and other tactics.
  • Outsmarting the AI by utilizing all of the above factors is extremely satisfying and a key component of the genre’s appeal.

The Bad

  • Controls rarely accommodate for the most common use case, e.g., it often takes as many actions to use an antidote (rare) as it does to launch an attack (common).
  • Terrain is usually static and non-interactive, e.g., it’s not possible to blow up bridges or set forests on fire.
  • Movement and attack ranges can only be checked for one unit at a time, creating a lot of busy work where the player needs to cycle through all the enemies in order to pick the optimal location for his own unit.
  • Attack animations — especially when presented via separate screen cinematics — are quite lengthy and devoid of any interaction.
  • Unit types and abilities are often duplicated from game to game. For example, in a fantasy-themed title it’s common to have a melee warrior, a long-range archer, a spearman with an extended reach, a mage that casts destructive spells, and a generic healer. This approach makes many of the games feel too derivative while missing the chance to introduce possible new tactics.
  • Conflicting variables make it hard to predict battle results, e.g., rock-paper-scissors unit weaknesses are combined with terrain modifiers, facing directions, weather, time of day, zodiac sign, faction allegiance, etc. As a result, some games feature an attack preview that informs the user of the likely outcome. This works well enough, but presents another manual check and input-step that interrupts the overall flow.
Shining Force Forest Planning a Tactics Game

Running around in Shining Force as Zylo the Werewolf without any terrain penalties was great fun.

As an iPad game, we’re aiming to make Trudy’s Mechanicals as quick and accessible as possible. Using this goal as a filter, we paired down the above points to what we considered appropriate for our own title:

Our Takeaway

  • The most common actions should only take one touch/swipe to execute. For example, tapping a valid enemy should make the current unit approach it as close as necessary in order to attack (preferably from the side or back if possible).
  • Visual indicators should be provided for range (which enemies are in the current unit’s range, and which enemies can also attack that unit), health, “elemental” weaknesses, and any other metrics necessary to plan the optimal course of action.
  • Fog of war might be an interesting concept, but it’s not very intuitive and should be avoided alongside any other potentially confusing mechanics such as terrain modifiers that contradict facing/elevation bonuses.
  • Usable and destructible map objects should be sprinkled throughout the levels in order to add extra combat options and make the world feel less static.
  • Unit levels and inventories should not be implemented in order to avoid extra micromanagement and potential multiplayer issues. To compensate for the removal of the leveling-up reward stream, each successful mission should provide the player with a permanent upgrade such as a new recruitable unit or the ability to use more in-level objects.
  • Attacks should take place on the same screen and appear quick and vicious in execution. In order to achieve this, the attack’s kinetic impact and visual effects should by styled after action games instead of abstract strategy titles.
Laser Squad Nemesis Planning a Tactics Game

Laser Squad Nemesis was one of the first games to feature a deep planning segment that culminated in all units executing their commands simultaneously.

Of course there were also numerous other considerations: Should the maps be 2D or 3D? Should movement be grid-based or more organic? Should randomization elements be added to extend replay value?

Eventually a lot of these questions answered themselves, but a solid mission statement really helped to lay down the groundwork and guide future design decisions.

Trudy and her Mechanicals 


Posted by Radek on August 16th, 2010.

Categories: concepts, design, trudy's mechanicals.

The setting for Trudy’s Mechanicals borrows heavily from various Steampunk tropes, but focuses on two aspects that are not widely used in the genre: the effects of “Steampunk-tech” pollution, and mechanization as a punishment rather than an empowerment.

The first point was born of pragmatism. When we were initially kicking around ideas for a new project, we wanted to limit its scope to make sure we could actually execute on it. The preference was to set the game in a single city, preferably a floating one to clearly define its borders while creating a cool aesthetic. Since I’ve always loved world-creation, I quickly butted-in and ran with the concept.

Steampunk seemed like a natural fit as its works are filled with giant, floating airships, but I wanted a concrete reason as to why our dirigible was stuck in the skies. The answer came fairly naturally: the plethora of side-effects that come with coal-burning technology.

eartly trudy Trudy and her Mechanicals

Early variations on our ramshackle floating city, Trudy.

Lots of early steam-powered inventions were fueled by coal, so I imagined a world where the practice became common place for the entire populace. Not only did electricity come from coal-burning power plants, but every horseless carriage and household servebot relied on coal as well. Over time, the practice led to a critical mass of pollution, and any attempts to reverse the process only make it worse. The few who were quick enough to spot the irrevocable hazards of the acrid fog and rain embarked on a skybound exodus, settling on a immense airship nicknamed Trudy.

As we settled on the Steampunk setting, our thoughts were filled with images of flintlock rifles and chimnied mechs. This was where our second point of focus materialized.

I had a bit of an aversion to typical empowerment associated with any type of “mech fiction,” including Steampunk. I mulled over how we could change this formula without sacrificing the iconic imagery, and one fateful night I hit on a suitable solution.

mechanic sketches Trudy and her Mechanicals

Concept sketches for the Mechanic unit. The caterpillar-tracks were a prevalent feature in all his designs.

I was leaving work rather late, and seeing a streetcar pulling into its stop, I made a mad dash for it. As I ran up to its doors, the driver looked at me and closed them. He definitely saw me, but slowly pulled away from the platform as I was ready to get on. There was no reason not to let me board, and missing the streetcar meant I’d have to wait another 30 minutes or so before the next one came (hopefully before the subways stopped running).

As I seethed in my rage, I fancied that the perfect punishment for the driver’s smug power-trip would be to make him perform this menial job for the rest of his life. I pictured him fused to his chair, forever pulling the rusty vehicle while envying its passengers that could get off at any time.

And so the Mechanicals were born; industrial workers sutured with heavy machinery rather than soldiers or adventurers so prevalent in the genre.

mechanic final Trudy and her Mechanicals

The finalized version of the Mechanic.

These Steampunk cyborgs are still physically imposing, but their abilities can be neutralized by the armaments of “normal” law enforcers. What’s worse, they represent the proletariat, the poor working-class, and are stigmatized for their decision to sell and mutilate their own bodies. The Mechanicals are indigent and kept segregated in their own underground district, but their plight is also a large driving force behind the game’s storyline.

I guess if that streetcar driver ever got assimilated by his vehicle, I’d have some sympathy for him after all.