Page 1 of 3

Fighter missions

Posted: Thu Jun 12, 2008 7:53 pm
by tzlaine
I've been playing with OpenSteer a bit lately. It's really great. I've got 200 little fighters in squadrons of 5 flying around in a sphere. Half are in a red team half in a blue team. It looks great. Now I want to start prototyping other behaviors on top of the basic behavior I already have. I was writing a bit of code to define the types of missions a fighter might have. It seemed like it would be a fairly straightforward task. There were some bumps along the way, but in about 15 minutes I whipped something up. Feedback welcome! Did I miss anything? Do people disagree with what I included?

I don't want to rewrite it all, so here it is in code form. Remember that there are interceptors and bombers, and they are separate kinds of fighters, though each kind may have many different designs.

Also remember that we will have a queue of orders for units in combat.

Code: Select all

        enum Type {
            /** A fighter that is better at attacking other fighters than at
                attacking ships. */
            INTERCEPTOR,

            /** A fighter that is better at attacking ships than at attacking
                other fighters. */
            BOMBER
        };

        /** The missions available to fighters.  The notion of "weakest" is
            intentionally left fuzzy.  The weakest target is one that is
            likely to die quickly, and also one that is unlikely to kill the
            fighter.  Some relative scaling should be employed to come up with
            a single weakness value. */
        enum Mission {
            /** No mission set.  This mission is treated as
                ATTACK_FIGHTERS_BOMBERS_FIRST by interceptors, and
                ATTACK_SHIPS_WEAKEST_FIRST by bombers. */
            NONE,

            /** Moves to a speficic location.  Enemy presence will be ignored. */
            MOVE_TO,

            /** Attack a specific fighter group or vessel. */
            ATTACK_THIS,

            /** Defend a specific fighter group or vessel, by attacking its
                attackers in order from weakest to strongest. */
            DEFEND_THIS,

            /** Moves to a speficic location.  Movement will be interrupted to
                engage targets as soon as they are found.  Interceptors will
                engage enemy fighters, and bombers will engage enemy ships. */
            PATROL_TO,

            /** Attack fighters without further direction, in order of nearest
                to farthest bombers, then nearest to farthest interceptors. */
            ATTACK_FIGHTERS_BOMBERS_FIRST,

            /** Attack fighters without further direction, in order of nearest
                to farthest interceptors, then nearest to farthest bombers. */
            ATTACK_FIGHTERS_INTERCEPTORS_FIRST,

            /** Attack ships without further direction, in order of weakest
                to strongest. */
            ATTACK_SHIPS_WEAKEST_FIRST,

            /** Attack ships without further direction, in order of nearest
                to farthest. */
            ATTACK_SHIPS_NEAREST_FIRST,

            /** Return to the fighter's base/carrier.  Enemy presence will be
                ignored. */
            RETURN_TO_BASE
        };
The MOVE_TO, ATTACK_THIS, and DEFEND_THIS missions are all specific -- they each refer to a single place or target. When these missions are completed, the user must have another mission waiting, or NONE becomes the new mission (it has a default behavior that I think makes sense). The others are all like "standing orders" -- they indicate how to behave, but are not specific. In all cases, if all targets or defended frendlies are destroyed, the current order will revert to NONE.

I tried to make the orders as specific to this type of game as possible. I don't want the user to be able to do absolutely anything -- that amount of choice is overwhelming. I want the user to be able to quickly and easily pick the smart move at any given time. So, we have orders like ATTACK_SHIPS_WEAKEST_FIRST, which is nearly always what you want. However, another common desire is to attack everything nearby, without losing the ability to switch your fighters to defense. Thus we have ATTACK_SHIPS_NEAREST_FIRST. I can't think of another sensible third tactic, so I stopped there. This is where you come in. If there are other winning tactics I've missed, bring them up now. This group has played enough of these games to know all the good and bad tactics. We won't include the bad ones.

Another thing I tried to do was allow micromanagers to completely control things by queueing up multiple specific missions (the first 3 I mentioned), while still allowing macromanagers to define more of a policy (the other missions). If we pick good policies, this will radically reduce micromanagement by allowing you to just set the right policy and forget it.

We may also want to consider disabling the specific orders in MP games, as a time saver. I for one would rather disinclude them altogether, but I figured that would be a pretty unpopular choice.

I've also considered having an order-all feature where you can command your entire fighter force to do the same thing from somewhere in the UI; you would still be able to give specific orders to specific fighters (or groups of fighters, or whatever the commandable unit size is).

Finally, we may want to have the policy-type orders stick, even combat-to-combat. This would mean that if I give a fighter unit the mission ATTACK_SHIPS_WEAKEST_FIRST, at the beginning of the next combat, if I don't give that unit any other orders, the default order will be ATTACK_SHIPS_WEAKEST_FIRST instead of NONE. As soon as I give another order, this default goes away, of course.

Please, no discussion on the size of a commandable unit or the way units are grouped -- let's save that for another thread.

Re: Fighter missions

Posted: Thu Jun 12, 2008 8:10 pm
by pd
This sounds really interesting. I would love to see this somehow. If it's not too much trouble, could you perhaps create a small video?

Re: Fighter missions

Posted: Thu Jun 12, 2008 8:39 pm
by tzlaine
I'll put up a Windows executable soon. This is not using the Ogre combat engine. It uses the OpenSteer demo framework. The fighters are all little triangles. :)

Re: Fighter missions

Posted: Thu Jun 12, 2008 8:58 pm
by yaromir
Don't want to go crazy and define more types? :)

why Interceptors and not Fighters?

Fighters are a more rounded craft while Interceptors are more specialized.

Interceptors are optimized for speed and their role is elimination of enemy craft in defense of own assets. Their typical target would be Bombers.

Fighters are designed to fight other small craft.

Escort Fighters protect Bombers on bombing runs

Bombers go after assets (capital ships).


IMHO including all 4 is overkill, but separating defense-oriented (Interceptors) and attack-oriented fighters might be a worthwhile idea to consider

Re: Fighter missions

Posted: Thu Jun 12, 2008 9:02 pm
by tzlaine
yaromir wrote:Don't want to go crazy and define more types? :)

why Interceptors and not Fighters?

Fighters are a more rounded craft while Interceptors are more specialized.

Interceptors are optimized for speed and their role is elimination of enemy craft in defense of own assets. Their typical target would be Bombers.

Fighters are designed to fight other small craft.

Escort Fighters protect Bombers on bombing runs

Bombers go after assets (capital ships).


IMHO including all 4 is overkill, but separating defense-oriented (Interceptors) and attack-oriented fighters might be a worthwhile idea to consider
Huh? This thread is about missions for fighters, which come in two flavors: interceptors and bombers. That's not up for debate. It's in the 0.4 Design Pad. Have a look.

Re: Fighter missions

Posted: Thu Jun 12, 2008 9:04 pm
by Tortanick
Well avoiding PD units if possible should be on the list: If there are two groups of ships, a mix of PD/LR and a second group of purely LR it should be possible to attack the LR ships and if necessary circle around the PD ships to avoid being shot.

Another strategy is to wait for something to tie up the ships guns (although I'm not sure what would tie up PD for long, general ship to ship combat wouldn't) then dive in, possibly getting an attack bonus, if no one is shooting at them they can focus on aiming. (possibly that bonus could apply in all cases when they're not being shot at)

But really I think this discussion is a bit premature, we should decide what role fighters/bombers play in combat first so we can design their strategies around their role. For example are they a choice equal to missiles or beam weapons for generally destroying other ships or are they limited to harassing enemy forces?

Re: Fighter missions

Posted: Thu Jun 12, 2008 9:43 pm
by tzlaine
Tortanick wrote:Well avoiding PD units if possible should be on the list: If there are two groups of ships, a mix of PD/LR and a second group of purely LR it should be possible to attack the LR ships and if necessary circle around the PD ships to avoid being shot.

Another strategy is to wait for something to tie up the ships guns (although I'm not sure what would tie up PD for long, general ship to ship combat wouldn't) then dive in, possibly getting an attack bonus, if no one is shooting at them they can focus on aiming. (possibly that bonus could apply in all cases when they're not being shot at)
Avoiding enemy PD is something the fighters should just do automatically. It's not a mission per se.
But really I think this discussion is a bit premature, we should decide what role fighters/bombers play in combat first so we can design their strategies around their role. For example are they a choice equal to missiles or beam weapons for generally destroying other ships or are they limited to harassing enemy forces?
I can tell you right now what role fighters play in combat. They are one of the 4 weapon system types, and one of the 3 weapon system types designed to take out enemy ships (or at least bombers are). Bombers should be roughly equal in power and ability to LR and SR weapon types. Interceptors should be roughly equal in power and ability to PD weapon types. This has already been decided.

Re: Fighter missions

Posted: Thu Jun 12, 2008 11:19 pm
by Josh
O hey neat. I got a suggestion, how about mission_protect? I enjoy having my ships in one piece. XD

Also, I have some art sitting here in front of me for the "Gyisache". It has front views, top views, and side views of small ships, medium ships, large ships, huge ships... No fighters though. Do you need fighters? I don't think you need fighters. Are they too small for that?

Re: Fighter missions

Posted: Thu Jun 12, 2008 11:26 pm
by pd
I think he needs fighters :) It's hard to say how big they'll be compared to the other ships, but having a basic shape worked out is not a bad idea I think, even if it ends up being a 50 polygon model or a sprite.

Re: Fighter missions

Posted: Thu Jun 12, 2008 11:45 pm
by tzlaine
Josh wrote:O hey neat. I got a suggestion, how about mission_protect? I enjoy having my ships in one piece. XD
See the PROTECT_THIS mission.

Re: Fighter missions

Posted: Thu Jun 12, 2008 11:51 pm
by tzlaine
The Windows Fighter Demo is up.

The fighters cruise around in groups of 5. They start out in random positions, so give them a second to find their formation-mates. After a while, you should see the red ones mainly sticking to their own, and the same for the blues. They're on different sides, so reds and blues don't fly together. they just sort of fly around the outside right now, since they have no specific mission. They just fly max speed without running into anything, including the other fighters and the bounding sphere.

There are some different keys that do things. See the documentation page on the OpenSteer website for details.

Re: Fighter missions

Posted: Fri Jun 13, 2008 2:16 am
by eleazar
tzlaine wrote:I've also considered having an order-all feature where you can command your entire fighter force to do the same thing from somewhere in the UI; you would still be able to give specific orders to specific fighters (or groups of fighters, or whatever the commandable unit size is).
Perhaps we should have a key/button that selects all units of the same type/kind as the one you have currently selected... This could be useful for more than just fighters.


The other mission that occurs to me is "Return to carrier" assuming we have carriers for fighters.

Re: Fighter missions

Posted: Fri Jun 13, 2008 3:44 am
by Sandlapper
I generally prefer to attack the strongest enemy vessel, not the weakest, when I'm able to. This was also the combat strategy of MOO1.

In MOO1 auto resolve, the strongest ship design was attacked en mass. As I said, this suits my preference, however, there was a major drawback to this strategy which caused considerable micromanagement during combat. The biggest hassle was the lower tech bombers being ignored, while the higher tech bomber was attacked en mass. You could send in a high tech ship with super strong shields, absorb a little damage for a few turns while the low tech bombers pulverized the planet/fleet unmolested. So one ended up(if defending) manually controlling the combat, turn by turn, to attack the real threat.

I propose an ATTACK_GREATEST_THREAT_TO(self, place, ship, fleet, orbital, or planet). The fighters would attack the greatest cumulative threat to whatever it is assigned. This is similar, but different from the defend command. The fighters would not fall for feint attacks, but apply all resources to the greatest cumulative threat. The biggest key being that the fighters could, & would, disengage from current combat, to attack a new greater threat.

Re: Fighter missions

Posted: Fri Jun 13, 2008 4:05 am
by tzlaine
eleazar wrote:
tzlaine wrote:I've also considered having an order-all feature where you can command your entire fighter force to do the same thing from somewhere in the UI; you would still be able to give specific orders to specific fighters (or groups of fighters, or whatever the commandable unit size is).
Perhaps we should have a key/button that selects all units of the same type/kind as the one you have currently selected... This could be useful for more than just fighters.
Good idea, and one I've thought of as well.
The other mission that occurs to me is "Return to carrier" assuming we have carriers for fighters.
I thought of this, but can't think of what it's good for. MOVE_TO works for actually getting you to the carrier. As for landing on the carrier (and being removed from the fight), that might or might not be a good thing to have in the system. For the first pass, I'd like to leave all combatants, including fighters, in play all the time.

Re: Fighter missions

Posted: Fri Jun 13, 2008 4:14 am
by tzlaine
Sandlapper wrote:I generally prefer to attack the strongest enemy vessel, not the weakest, when I'm able to. This was also the combat strategy of MOO1.
This is almost always a less effective strategy ...
In MOO1 auto resolve, the strongest ship design was attacked en mass. As I said, this suits my preference, however, there was a major drawback to this strategy which caused considerable micromanagement during combat. The biggest hassle was the lower tech bombers being ignored, while the higher tech bomber was attacked en mass. You could send in a high tech ship with super strong shields, absorb a little damage for a few turns while the low tech bombers pulverized the planet/fleet unmolested. So one ended up(if defending) manually controlling the combat, turn by turn, to attack the real threat.
... and this is why.
I propose an ATTACK_GREATEST_THREAT_TO(self, place, ship, fleet, orbital, or planet). The fighters would attack the greatest cumulative threat to whatever it is assigned. This is similar, but different from the defend command. The fighters would not fall for feint attacks, but apply all resources to the greatest cumulative threat. The biggest key being that the fighters could, & would, disengage from current combat, to attack a new greater threat.
Easier said than done. How do you determine the greatest threat? This requires an understanding of all foes, their capabilities, your ability to kill them or nullify their abilities with your own non-fighters (because they're not the greatest threat if some ship is in the process of finishing them off, right?), etc. This is effectively a BE_SMART mission, or a PLAY_LIKE_A_HUMAN mission. We need to keep the missions more modest than that. The idea is to make effective missions with simple rules.

Remember all the lousy AI controllers for everything in Moo3? we want to avoid that like the plague.