I am developing a game in XNA and am trying to create an effective AI for the enemy and friendly spaceships but am having a hard time keeping the game effective without disadvantaging one side or the other (deliberately). My current setup is as follows:
- Ship targets enemy based on proximity.
- Ship changes direction and moves toward target, firing when in range. Ship fires single repeater weapon in the forward direction.
- Ship will not change direction when closer than certain distance from enemy.
- If you are directly following and shooting at a ship, the ship does not attempt to evade fire. (consequence of #3)
- All ships have similar firepower.
I am trying to improve this system and am willing to rewrite if necessary. Most of the ships end up flying around each other, shooting but never hitting. I have thought of several ideas to improve it:
- Once health drops significantly, ship will boost away from firing ship.
- Some ships are randomly chosen to be equipped with torpedoes (maybe add aft firing?).
- Make ships more wary of attacking cruisers (they tend to die quickly when attacking).
Does anyone have any other suggestions as to improve the AI of the ships? Does anyone have a completely different system of doing this?