Curious - how do fighters pick their targets?

Distant Worlds is a vast, pausable real-time, 4X space strategy game which models a "living galaxy" with incredible options for replayability and customizability. Experience the full depth and detail of large turn-based strategy games, but with the simplicity and ease of real-time, and on the scale of a massively-multiplayer online game. Now greatly enhanced with the new Universe release, which includes all four previous releases as well as the new Universe expansion!

Moderators: Icemania, elliotg

Post Reply
User avatar
scotten_usa
Posts: 271
Joined: Fri Dec 09, 2005 4:52 pm

Curious - how do fighters pick their targets?

Post by scotten_usa »

When I order a fleet to attack a specific target, I notice the fighters and bombers often do not attack that same ship. Any idea why, or is there any way to control their targeting?

That said, I have noticed that fighters generally are very smart about who they attack. Example: I arrive at enemy homework that has a starbase and a defensive base. I order the fleet to attach the defensive base, and the mass of fighters attack the starbase. Normally my fleets are strong enough to destroy a defensive base quickly, and the fighters "soften up" the starbase.
rogerbacon51
Posts: 79
Joined: Thu Oct 29, 2009 4:08 pm

RE: Curious - how do fighters pick their targets?

Post by rogerbacon51 »

Fighters are supposed to pick their targets from the list of targets the parent ship has. I've had some problems with fighters. If they launch and there is no target within range they are supposed to patrol next to their parent ship but sometimes they fly off in a random direction. When that happens I manually recall them and then, if a target is within the parent ship's range, they will acquire that ship as a target after launch. There is no way to manually pick tgheir target.
User avatar
jpwrunyan
Posts: 558
Joined: Fri Dec 02, 2011 10:04 pm
Location: Uranus
Contact:

RE: Curious - how do fighters pick their targets?

Post by jpwrunyan »

Kudos for starting an interesting thread. Unfortunately I have no idea how fighters work. Recently I have been using point defense weapons instead. I would guess however that fighters use the same or similar logic as other ships in your fleet for choosing targets of opportunity. If you tell a ship to attack another ship currently out of range, it will fire at other enemy ships currently in range as it moves closer to its primary target. Might fighters do the same?
Modest
Posts: 172
Joined: Sat Nov 26, 2011 2:20 pm
Location: Warsaw, Poland

RE: Curious - how do fighters pick their targets?

Post by Modest »

If you tell a ship to attack another ship currently out of range, it will fire at other enemy ships currently in range as it moves closer to its primary target. Might fighters do the same?

In a way - yes. But not alweys, and not all. I often see that some fighters and bombers in such situations are sticking to target of oportunity insted of preforming a bombing run and going to the designated target. Also I have feeling that fighters are far more ofthen doing that than bombers, which I think have better tendency to go straight to the aim (it that is the case indeed, I would call it logical and good behavior). But most of fighters and bombers are attacking what I ask them to.
User avatar
jpwrunyan
Posts: 558
Joined: Fri Dec 02, 2011 10:04 pm
Location: Uranus
Contact:

RE: Curious - how do fighters pick their targets?

Post by jpwrunyan »

Well, two things:
Fighters may abort attacking the carriers primary target if the carrier is still out of the fighter bay range (whatever that is). But anyway for ports and bases I notice that there is a certain engagement range that enemies must be within for fighters to launch at all.
Second, interceptors are supposed to attack bombers and other fighters. Maybe the presence of enemy fighters is affecting your fighters' behavior.
This is still all just speculation on my part.

I have an idea! Lets check the galactopedia!
Oh...
Modest
Posts: 172
Joined: Sat Nov 26, 2011 2:20 pm
Location: Warsaw, Poland

RE: Curious - how do fighters pick their targets?

Post by Modest »

That is true - if I move my carrer a bit from it's target it is still ok. If I move it more than bit (actually this "bit" is a quite long range, as fighters have longer range of operation than any other weapon) they mass disengage and are returning to it's carrier (or are engaging other targets, that are in their's operational range).
As for interceptors that is done exellent in my opinion, because every time when I see enemy fighters and bombers coming in, my own fighters simply disengage from theirs' targets (selected by me, or simply targets of oportunity) and are engaging enemy fighters and bombers. My description was about situation when enemy does not have any fighters at all. I just forgot to mention that - I am sorry ;)

Galactopedia will surely help! :D Great idea!
Wait a minute... Where it was... Hmmm... Strange... ;)
rogerbacon51
Posts: 79
Joined: Thu Oct 29, 2009 4:08 pm

RE: Curious - how do fighters pick their targets?

Post by rogerbacon51 »

ORIGINAL: Modest

That is true - if I move my carrer a bit from it's target it is still ok. If I move it more than bit (actually this "bit" is a quite long range, as fighters have longer range of operation than any other weapon) they mass disengage and are returning to it's carrier (or are engaging other targets, that are in their's operational range).

Let me define a 'bit' for you. Fighters break off attacking when the range from their parent ship to the target exceeds 1500. I thought this was too short so for my sublight emphesis mod I changed it to 15,000. This way carriers work more like WW2 carriers and never see each other. Just my preference.

Code: Select all

    private void CheckReturnToCarrier(Galaxy galaxy)
     {
         if ((!this.OnboardCarrier && (this.MissionType != FighterMissionType.ReturnToCarrier)) && (base.ParentBuiltObject != null))
         {
             if (base.ParentBuiltObject.CheckHyperjumpPending())
             {
                 this.ReturnToCarrier();
             }
             else if ((this.MissionType == FighterMissionType.Attack) && (base.CurrentTarget != null))
             {
                 if (galaxy.CalculateDistance(base.CurrentTarget.Xpos, base.CurrentTarget.Ypos, base.ParentBuiltObject.Xpos, base.ParentBuiltObject.Ypos) > 1500.0)
                 {
                     this.AbandonAttackTarget();
                     this.EvaluateThreats(galaxy);
                 }
             }
             else if (galaxy.CalculateDistance(base.Xpos, base.Ypos, base.ParentBuiltObject.Xpos, base.ParentBuiltObject.Ypos) > 1500.0)
             {
                 this.ReturnToCarrier();
             }
         }
     }
User avatar
ASHBERY76
Posts: 2079
Joined: Wed Oct 10, 2001 8:00 am
Location: England

RE: Curious - how do fighters pick their targets?

Post by ASHBERY76 »

Hacked the source?
Modest
Posts: 172
Joined: Sat Nov 26, 2011 2:20 pm
Location: Warsaw, Poland

RE: Curious - how do fighters pick their targets?

Post by Modest »

Oh! Thanks Rogerbacon50 :) Now I know exacly how long is their range... And as a matter of fact I must say that Your modification sounds very interesting :)
User avatar
jpwrunyan
Posts: 558
Joined: Fri Dec 02, 2011 10:04 pm
Location: Uranus
Contact:

RE: Curious - how do fighters pick their targets?

Post by jpwrunyan »

How did you get the source code?
I mean how specifically. I know ways to do it in theory. What did you use?
Post Reply

Return to “Distant Worlds 1 Series”