One of the most enjoyable aspects of RTS is putting theory into practice. You see your enemy's tactics, their fleet makeup, and think how you could defeat it. You buy the ships and kit them out, assign them roles to make sure they fly appropriately to their kit, and then let your fleet loose on the enemy to see how it works. Tweak, rinse and repeat.
But if there's only one enemy "fleet type," the gameplay can get stale pretty fast. Once you understand the AI tactics and weaknesses, it's easy to pick them apart by exploiting those weaknesses. The more variety you can include in AI fleet tactics, the more interesting the RTS element becomes. Are you fighting against an enemy sniper fleet, a tanky fleet, a high-DPS brawler fleet, a fighter swarm, or something else entirely? That's the kind of variation that would have me playing this game for days on end.
Based on ThymineC's post on assignable fleet roles, here's one way I can envision implementing AI fleet variety at a high level:
- -Any combat NPC can be assigned as a commander. Ship size may influence level of command.
-Each commander has a somewhat random (or faction-based) preference for fleet type.
-Fleet type preference determines what ships the commander will allow in his fleet and what role he assigns to those ships.
Here are some sample fleet types and the roles an NPC commander might use, mostly based on my experience with EVE:
- -Short-range brawler: mostly Interceptor roles using heavy ships
-Long-range sniper: mostly sniper and support roles using nimble ships and low-DPS but instant- or fast-hit weaponry
-Swarm/hive-mind: Sniper role capital ships with tons of interceptor role fighters
-Spider-tank: Nearly 100% support role heavy ships, with an equal mix of guns and repair modules
-Hit-and-run: Coward role bombers and coward/support role dedicated healers, intended to stay outside the battle and heal the bombers as they retreat
-Kitchen sink: The most basic and easiest to deal with, allows any NPC and assigns simple roles based on size and equipment
Instead of hard-coding the fleet doctrines, there are a couple of proposed genetic algorithms to use during region generation that could achieve similar results. Assuming such a genetic algorithm were sufficiently tested and refined, it could produce varied, intelligent NPC fleet compositions given the available resources in the region.
What might this algorithm look like? Well, I'm no programmer, but here's a basic idea.
-The algorithm starts by looking at the factions within a region and their innate or evolved preferences. Those preferences can include ideas like value of life, value of tech, value of wealth, etc.
-Roll commanders for each faction based on the starting values, with each commander having some deviation in how picky they'll be when assembling their fleets.
-Assemble initial fleets for commanders based on faction wealth and commander pickiness / ship type preference. High value of wealth and tech will influence ship and module choice. (Fleet assembly should also depend on resource availability within region - does this region contain plutonium for missiles, unobtainium for advanced shields, etc.)
-Compose tactics for each commander. Somehow, the tactics should try to conform to ship choice, or vice versa. Value of life should strongly influence tactics as well - high value of life means a ship that's likely to die quickly will score very low. Low value of life means ship death is irrelevant and only victory matters.
-Simulate battle using metrics as close to player-influenced combat as possible. Some metrics to consider:
- **Time spent within optimal range and firing arcs
**DPS within optimal range and firing arcs
**Relative speed of priority target/attackers
**Relative optimal range of priority target/attackers
**Heal rate of priority target including remote healers
**Retreat value (if relative speed higher than pursuers; if lower, then retreat value roughly 0?)
An interesting side effect of this "fleet type preference" is that it has great potential to drive the regional economics of the game. Scarce resources that are required for building towards the faction/region's preferred fleet type will be very expensive and lucrative to either produce or transport.
Open to suggestions!