War Machine (Java)

Overview

Turret defense variant. Player controls a large tank, upon which can be built as many weapon turrets as can fit. There are several hard points that provide free upgrades and bonuses to weapons. Player directs the tank and fights off endless waves of creeps of infinite shapes, sizes and capabilities, plus the occasional boss creep.

All graphics are rendered procedurally, including explosions, missiles, turrets, the tank, etc. There are no sprites in the game. Custom physics engine. Enemy craft are comprised of multiple components that determine visual appearance as well as game stats for the craft. There are over 9 billion combinations of enemy craft. Written in Java, no libraries.

Creeps

The creeps are built by the simulation engine prior to each wave. Creeps are composed of a hull, engine, AI, armor, and at least one weapon. Creeps are generated in four general sizes, which determines the mean sizes (and quantity) of the components. These values are deviated randomly for each wave (but held constant for all creeps in that wave).

There are several weapons creeps can be equipped with. They have lasers beam (creep-to-target, continuous beam, destructive power increases with proximity), laser pulses (energy bullets), laser blocks (large heavy version of the pulse), rockets (unguided, short range, heavy damage), missiles (guided, longer range, higher volley-size), mines (stationary, heavy damage, detonation is continuous probability based on speed of player), energy rings (long range, medium damage, indirect flight path, fired in high quantities).

As the player progresses, creeps are increasingly fitted with shields. These manifest as a golden sphere around the creep. Creeps always enter battle with their shield on (if they have one). The creep is indestructible until the shield power expires.

Some creeps have anti-missile flare systems. When incoming homing missiles approach, the creep will deploy a handful of flares, which can confuse the missile. Flares appear to be little white glowing spheres.

Once the prototype creep for the wave is created, the wave-type is determined. Waves can be standard, light, or heavy. This will adjust the creep's stats, as well as the wave size. At this point, all the creeps for the wave are cloned from the prototype.

Creep color is randomized on a per-wave basis, and each creep has a minor variation of that color on its major components.

Creeps have personalities and choose their behaviors according to how their personality (aggressive, cautious, etc) combines with the environment. All creeps use the same behaviors, but the probability of each behavior is determined by their personality. Behaviors are Attack, Flee and Harass. Each behavior makes use of the 4 basic actions: keep the player in front, keep the player to the rear, keep the player to the left (or right), shoot at the player. The parameters of the behaviors, including the severity of the angles, urgency of turning, weapon accuracy, fire rate, etc, are determined by the creep's personality.

Creeps don't like to be hurt and are reluctant to die. They will turn to flee if damaged. If an explosion occurs near a creep, the creep will turn away from it. Most creeps rarely survive long enough for these actions to manifest.

Some creeps are inclined to make suicide attacks when they get close. The likelihood of this inclination is personality based. Whether or not this possibility exists is determined on a per-wave basis.

Waves

Waves are spawn using several patterns. One pattern spawns everything at once, in the same general area, and every creep has the player as its target. Another pattern breaks the entire wave into equal size groups and spawns them randomly around the player. The creeps are spawned and assigned to follow-the-leader to engage the player. When a leader is destroyed there is a chance the creep will become a leader, or it may adopt the next creep ahead of it as its leader. Another pattern is a single follow-the-leader chain for the entire wave. Another pattern is every creep spawned randomly around the player.

Bosses

There are several types of bosses. A large featureless sphere (except for a single sensor), a cubic amalgamation, a snake held together by electricity, and a ring-like vehicle. Power and difficulty scale with player progress. Several bosses are capable of repairing and re-arming damaged and depleted creeps (although few live long enough to fly back to a boss for resupply).

Bosses also have personality. They tend to be smarter, although the personality is largely based on the type of boss, with some bosses more likely to hang back and harass the player from long range, and others are willing to close range for point-blank attacks. Bosses never make suicide attacks.

Tank

Player controls an artificially intelligent super combat machine.

Radar

The large green ring surrounding the tank is the radar system. Yellow dots indicate the direction to a creep. Dots turn red when the creep enters the screen.

Movement

Click to turn the tank. Speed is controlled by hotkey, or on screen.

Systems

Reactor provides power. Power is used to build things via conversion of energy to matter. Reactor level also influences the strength and duration of the tank's special attacks.

Hull determines the amount of damage the tank can withstand until destruction. Weapons can be damaged as well, and their strength is also determined by the hull.

Tracks determine the top speed of the tank. This also determines how many turrets can be built. Build too many and the tank becomes overloaded and slowly comes to a stop. Tracks can be damaged by creeps which can result in an immobile tank.

Armor protects the tank against physical attacks such as bullets, rockets, missiles, mines, and suicide attacks. Armor also protects weapon systems.

Shield protects the tank against energy attacks such as laser beams, laser pulses, heavy pulses, and energy rings. Shield also protects weapon systems.

Repair is the tank's nano-bot repair system. This determines how fast the tank restores damage.

Artificial Intelligence. This control weapon accuracy and the level of intelligence behind target selection. It also determines the maximum level that all other systems can be upgraded.

Weapons

Machinegun and laser beams are simple weapons. They point, shoot, do damage.

Rockets are unguided and fire at the target's current location. If the creep is moving it is likely not there when the rockets hit, unless they are moving directly towards the tank, because the rockets will also explode when they hit a creep. Good for large crowds. Fired in clusters of three.

Missiles fire slowly. They are long range weapons. Their range fan actually indicates the minimum range within which they will not select a target. Missile systems always select the most distant creep to fire upon. This makes them good for fighting bosses, which tend to hang back. Missiles are homing weapons and have a lot of fuel. There is a tiny red light on the nose of each missile that pulses faster as it gets closer to the target.

Lightning weapon fires electricity. It can arc to nearby creeps. Good for crowds.

EMP wave fires a curved arc that sweeps outward and washes over targets. Targets take a small amount of damage, but there is a high probability that their drive and/or weapons may be disabled.

EMP beam fires a single beam with an expanding sine-wave secondary beam. Targets hit by this beam take moderate damage and are almost guaranteed to become disabled. Good for de-fanging bosses.

Anti-missile system is a small rapid fire laser system that shoots down rockets, missiles and mines.

Special Attacks

Rapid repair temporarily creates a massive excess of repair nano-bots. Tank repair rate receives a massive, but temporary, increase.

A hard-light shield is created around the tank for a few seconds. During this time the tank is indestructible, but may continue to engage targets normally.

A rocket barrage can be fired from the tank. Rockets are fired in all directions and blanket the map. Reactor level improves the quantity of rockets fired.

A massive electromagnetic pulse is emitted from the tank in the form of a bright white-blue ring that expands outward. Creeps are either destroyed or disabled by the pulse.

The tank detonates a massive explosive, delivering incredible damage to every creep in the game (not just on screen). The power of the detonation is so great that it inflicts a temporary white-out on the tanks sensors, which fades after a few moments.

Title Screen

The custom UI system. The text has a "3d" drop shadow and can be made clickable. The look I was aiming for was "steel and metal" so everything is grey-silver-ish. There is a periodic "light glint" that flashes across all the text, similar to the highlight on the background "metal."

As part of the "attract function" (an idea I like from classic 80's arcade cabinets and pinball games), there are a couple of randomly generated enemy craft flying around. Generally 3 or 4 craft flying follow-the-leader similar to the game "Centipede."

[WarMachine]
[Loading...]

Occasionally there is an odd enemy, which the other creeps attempt to destroy.

[WarMachine]
[Loading...]

[WarMachine]
[Loading...]

Settings

There are a handful of adjustable settings available to the player. It's a mish-mash of game-play options and performance settings.

[WarMachine]
[Loading...]

There are a ton of settings for development. Most of these are for game tuning or to assist in development. The intent was that these would be used to determine the best performance / game-play, and then those values would be set as defaults and this menu would be locked for distribution.

[WarMachine]
[Loading...]

Weapons

Machinegun

Tank equipped with only machineguns on the hard points. When tracks are destroyed, they loose upgrade levels and flash red. During the time the tank is immobile.
[WarMachine]
[Loading...]

Lasers

Great general purpose weapons.
[WarMachine]
[Loading...]

Lightning

Good for crowds
[WarMachine]
[Loading...]

Rockets

Tank equipped with only rocket launchers.
[WarMachine]
[Loading...]

Anti-Missile

The tiny turrets on the back and sides of the tank are anti-missile weapons. They fire red lasers and target creep non-energy projectiles, i.e., rockets, missiles, and mines. On the bottom left of the screen, a group of creeps flies in and fires a mess of rockets, which the anti-missile systems destroy. Notice the tiny explosions from the neutralized rockets.
[WarMachine]
[Loading...]

Special Attacks

Shield

Hard-light shield provide temporary invulernability.
[WarMachine]
[Loading...]

Rocket Barrage

Higher reactor level creates more rockets. This can clear a map at high levels.
[WarMachine]
[Loading...]

Shield & Rocket Barrage

Combining abilities.
[WarMachine]
[Loading...]

EMP

EMP
[WarMachine]
[Loading...]

Nuke

Massive blast causes temporary sensor white-out to the tank and permanent destruction to all creeps
[WarMachine]
[Loading...]

Tools

Creep Designer

I built this tool to facilitate generating the data that describes the creep geometry. At the bottom can be seen the data format. All parts are automatically mirrored across their central axis, so data for only one side needs to be created. The tool shows a small thumbnail displaying what the final part will look like.
[Creep Designer]
[Loading...]

Creep Analyzer

This tool allows the generation of creeps using the game's internal "construction" engine. This allowed me to see the sorts of values being generated for creeps and bosses when provided with different power levels for input. Currently displayed are the "nonsense" values that act as placeholders until a creep is generated.
[Creep Analyzer]
[Loading...]