Terrarium: Cheap Shots!

Cheap shots are attacks made by a Herbivore or Carnivore that can't be returned. They are a shortened melee that allows the attacking party to take advantage of game rules in order to gain an attacking advantage. Unfortunately we allowed a startling number of cheap shot routines to be taken advantage of. Let's check out the easiest game rule to take advantage of first.

Happy Herbivores only Attack Attackers
Herbivores that aren't considered aggressive by their amount of energy are only able to attack another creature in the immediately following round after being attacked. There are two really easy ways to take advantage of this situation. First and foremost the attacker can create a situation where they are able to attack and then be out of range by the next tick. The CanAttack method will do some checking and will allow the Herbivore to attack, but when it comes time to do the actual attack, the creature will be out of range.

public bool CanAttack(AnimalState target) { 
    if ( target == null ) { throw; } // Can't attack a non-existent creature
    return IsCarnivore || AttackedBy(target) || EnergyState <= EnergyState.Hungry;
}

Even worse, a Herbivore that is running away, may do all of the work for the Carnivore. By running away, they may move themselves out of range and be unable to attack. In this manner the Carnivore doesn't even have to worry that they might get hit by the fleeing Herbivore as long as they obey the rules of the grid (I think I've hit the rules of the grid before, so I won't go into it now).

Slippery Snakes Attack and Run
A more thorough extension of the get the hell out of the way approach can be observed by creatures, Herbivores and Carnivores alike, that take advantage of the grid system of the Terrarium in order to perform attacks that can't be reciprocated. This requires intricate knowledge of how attacking and movement work and can be thwarted by the educated defender. Everything starts with BeginAttack where attack validity is determined, but distance checking is not yet used. The attacker needs to chain together an attack and a movement. The attack will hit as long as the creature is within range which can be checked easily enough using available methods. After the attack, when the movement phase begins, the creature will move away from the defender in hopes of dodging an attack presented in the next round.

The defender does have a number of options. If they are able to attack, then they'll get their chance as well. Remember all attacks are run before movements are run. Much of the code written by authors is reactive instead of proactive, so often the defender will not attack. If the defender is a Herbivore sitting around a plant they won't be able to attack. The defender can also try to predict the movement of the attacker and also make a movement in the same direction or a similar direction. How does this work? Well, movements are processed linearly, so one of two things is going to happen. Either the attacker moves, unblocking the defender, and then the defender moves. Or the attacker gets away with his movement, but the defender goes first and winds up getting blocked. At least 50% of the time the defender is able to outwit the attacker and prepare for the next round.

Depending on the angle of attack, the defender can also make a complementary move in some cases when the attacker and defender are at a diagonal. A smart defender can then improve the 50% odds of being in good position the next round by another 10-15% on the average.

Since attack and run tactics are normally the sign of a lesser opponent, no matter how well you code your creature to hit and run, you may still lose the battle against a larger, more substantial opponent. This isn't a bad thing. The Terrarium is truly optimized for very specific types of creatures to succeed. These creatures are almost always smaller, so you don't have to worry about the larger creatures becoming dominant and ruining your tactics!

Published Saturday, September 04, 2004 9:17 PM by Justin Rogers

Comments

Wednesday, March 05, 2008 8:28 PM by ovidiu

# re: Terrarium: Cheap Shots!

hi there, we are a group of enthusiasts that want to revive this game, .net 3.5, xna eventually. we need to know if the sources are for public domain (a "do whatever with them" kind of license) or not. we'd like to use the ms sources as a starting point.

please let us know if you have any info on this matter.

thank you!

O.

Friday, June 20, 2008 1:09 AM by cheap terrariums

# cheap terrariums

Pingback from  cheap terrariums

Leave a Comment

(required) 
(required) 
(optional)
(required)