MY FIRST UNIT
Specialization and Customization
CUSTOMIZING UNITS
The Basics
In Astraeus your team can have as many unit types as you would like, and each unit is defined in its own class.
Units are really defined by a few attributes:
Frame - Each unit is either LIGHT, MEDIUM, HEAVY, or ASSAULT.
Model - Each unit can choose one of several models to emphasize a role.
Style - Each unit can choose one of several images to set its appearance.
Weapons - Each unit can have up to two weapons that can be used
Upgrades - Each unit has passive upgrades that improve defenses or provide bonuses
Behavior - Each unit has unique code in its action method and can behave in its own way
EXAMPLE: THE TANK CLASS
Getting Started
Find your Fighter Unit and make a copy of it in the Unit folder. Let's call this unit TANK.
Make sure you modify your team's code rather than copying the code below!
Customizing the Tank
The tank is going to get up close to enemies rather than running away
It is using more of its slots on defenses than the Fighter class.
Use the Fighter class as a base and change some lines
public class Tank extends MyTeamUnit
{
public Tank (MyTeam p)
{
super(p);
}
public void design()
{
setFrame(Frame.HEAVY);
setModel(Model.BASTION);
setStyle(Style.WEDGE);
addWeapon(new Autocannon(this));
addUpgrade(new Plating(this));
addUpgrade(new Plating(this));
addUpgrade(new Plating(this));
}
}
Player Class - Building the Tank
We decide which units to build in the player's strategy method
Add the tank as an option to build. You can certainly change the ratios!
public void strategy()
{
if(getFleetValuePercentage(Gatherer.class) < .2f)
{
buildUnit(new Gatherer(this));
}
else if(getFleetValuePercentage(Miner.class) < .2f)
{
buildUnit(new Miner(this));
}
else if(getFleetValuePercentage(Tank.class) < .3f)
{
buildUnit(new Tank(this));
}
else
{
buildUnit(new Fighter(this));
}
}
Run your code. How does this unit work with the other fighters?
SPECIALIZING UNITS
Some Unit Ideas
Snipers / Artillery have a long range weapons but do not have any defenses. They try to keep their distance and stay behind the tanks.
Skirmishers are very quick and try to strike weak opponents like Gatherers or Snipers.
Support units might only have weapons that assist allies or disable opponents, such as the Repair Beam or Anti Missile System. They have very different behavior from other combat units.
MOVEMENT SPEEDS
You may find that as you customize units, they move at very different speeds. Let's consider a few strategies:
Adjusting Speeds
Early on, the easiest option is to keep unit speeds to be similar. Play with variables, such as:
Keep It Together
You can write code to keep your units in a formation
Ex: Identify the furthest ahead tank, and your artillery's movement should always be behind them relative to the enemy ship.
Early on you can do this with fixed values, but keep in mind for the tournament your team will need to work on both sides of the map.
Different Roles, Different Placement
Your very fast units may want to break off from the main fleet!
Ex: Light moving striker ships will move to the bottom of the screen then flank an opponent, trying to attack gatherers while the main fleet defends in the middle.