Squashing Bug #666 (Partial Fix)

A big bug, and a long time waiting, but let’s talk.

Yep, its about time we get some of the best modders and programmers, both from Gearbox and the Homeworld community, and fix bug #666. Read on.

Targeting Behaviors: All Shapes and Sizes

Now, for quite a while I’ve had a hunch about the targeting behaviors in fighter battles. Rig up any hw2 fighter fleet against another, hit your tab button twice, and send them out to brawl. You will notice the continuous re-targeting of ships with red lines jumping around for what seems to be no reason. Squads will chase one fighter for a time, then swap to another, and the process repeats.

This affects all ships, and can easily be fixed by editing the tuning.lua in the scripts folder, under the CombatInfo = { in the TARGET CHOICE section.

Re-targeting issues aside, I then tried to widen the firing cone angle for the fighters, and found the first major issue. Turns out ships weren’t not firing, they were just not able to hit their targets. Ships in formations will still individually target ships of their choice, despite being slaved in a formation. So, a squad of Hiig interceptors, after their initial kill, could possibly target 5 different ships, that is one per Hiig fighter. Realistically, anywhere from 2-3 targets per formation squad will occur.

For a quick demonstration of the re-targeting issue, look into this video from second marks 14 to 20, thanks to Cloaked from another thread about the 666 bug:


Now imagine all five ships doing that, ‘randomly’ during combat. Take 14 squads together, its a miracle that ships were even hitting each other for the most part.

To see the individual ship targeting first hand (I’m hoping to get a video or at least screen shots of this), take max kushan interceptors and move them anywhere. Take one Hw2 squad and set them to evasive, band select the idle interceptors, and hit tab to see your squad’s target. After the first or second ship goes down, your Hiigaran fighters will begin to have different targets.

Pause the game at a moment when you see at least two red lines in your squad, and change them back to aggressive and offensive tactics. Unpause, and let them attack. Those fighters that had different target lines than the squad leader won’t fire on the squad leader’s target unless they re-target. If you edit the tuning.lua with the following changes, there won’t the ‘random’ re-targeting so your ships will not fire until their targets are in their firing cone, thus NEVER firing on the squad leader target.

-- TARGET CHOICE: <Just for reference>
priorityDistanceBandSize			= 0.0,
distanceBandSize				= 0.0,
attackerBandSize				= 1,

This isn’t just a bug in the fighters, it involves every ship in a formation. Anything bigger than a fighter tends not to appear affected due to their turret firing arcs or missiles, but under very rare instances this will occur. Fighters happen to have a huge density of possible targets when in the heat of combat and are the closest to their target(s), which is why they are affected the most.

In fact, the targeting feature affects the drone’s of the kushan frigate as well, which surprised me.[/details]

In short, there are two issues. One being excessive ships re-targeting, that is the changing of targets mid-flight in combat, and the second being Bug #666, or the individual targeting of ships in formation.

Possible Solution(s)

Here is a proposed four-part solution. If one of these is overlooked, there will still be combat issues in game.

[details=Summary]There needs to be a way, if not already, that forces ships (1) and subsystems (2) to only target what the leader of the squad is targeting, ‘flexibility’ in subsystems based on distance (3), as well as a way to limit/even out the amount of ships targeting when band-selecting (4), but I’ll touch on that in a second.

-Any ships in a formation will be in agreement with leader ship, thus eliminating #666 bug (individual ship targeting).

-Kushan Drone attacking the specified target of the drone frigate

-potential advantage of formations vs non-formation ships

-again, ships in a formation will force target the formation leaders’ target

-Ship subsystems/turrets will fire upon selected target.

-Most beneficial when super capital ships are targeting each other (when a few of the turrets will fire off at nearby collectors, carriers, frigates, etc)

-Target ting ‘flexibility’ for subsystems/turrets will allow a ships’ turret weapon to fire at any enemy until the turret is in range of the selected/desired target

-Cruiser and destroyers will not waste ballistic and ion volleys on nearby collectors when within range of the selected ship
-capital ships will still remain deadly and in the battle without altering their course or giving a disadvantage in the desired battle to come

  1. This will benefit and balance battles with many or max ships at times, as CURRENTLY almost all squads of fighters will initially target just a few fighters, or max ion frigates may target a few Vaygr frigates, etc. With targeting limit/splitting system, firepower waste will be nearly non existent, as a predetermined amount of firepower that will eliminate a target can be implemented. I suggest this be on a class-by-class basis, for example such that fighters won’t try to split up one squad per frigate, corvettes won’t attack frigates in low number, and frigates will group-attack super capital ships

-the first benefit is lack of ‘extreme ship gang attacks’, (lack of all ships attacking in unrealistic/frustrating numbers that demands excessive and difficult micro-managing)

-balance between ion and missile based ships, as missile re-targeting will not overpower the massive waste of ion cannons

-(I will need a screenshot/video of this to explain, as I currently do not know exactly what causes this) Repair ships, specifically corvettes, will not remain idle and try to alternate healing targets when band selecting a large group

-Allow an even split when most effective against targets in lesser number, such that 24 frigates will split three ways against 3 enemy frigates, or 8 frigates per enemy ship in a band select

Things to Consider

I’m adding this section for aspects of the game to consider in the fixing or suggestion process.

  1. Manual Control: Do the edits eliminate the necessity of skill or strategy to the game? If so, is the sacrifice worth the change?

  2. Ship Orientation: Do desired ships face their target in formation, or do they face the direction of flight during combat, and should they?

(More will be added if necessary)

In Conclusion

I don’t exactly know how to implement all of this in modding, but these fixes will, well, fix everything.

Please provide feedback, and also note that these fixes/suggestions will apply primarily to band selecting for perfect self-automated combat to proceed as we have all been trying to get work since this bug. Players with heavily customized tactics and micro-managing will be able to continue unharmed, and players that just want max fighters or fighters to kill targeted max fighters or fighters without game-breaking hiccups will be set to go.

If anyone who knows others that can help here, shout out to them in the forums.

Do pardon the format to this post, not particularly my area of expertise.

IMPORTANT UPDATE: This might be the fix we’ve been waiting for! Check this link for a solution made by @shadowwinterknig!

A minor update to the formatting was done as well.


First, I feel honoured to be called here, because this is not my area of expertise ^^

Very detailed post you’ve done there, it’s great :slight_smile:

The only thing I can say on this matter, is about :

Any ships in a formation will be in agreement with leader ship, thus eliminating #666 bug (individual ship targetting).

If I remember correctly, when BitVenom posted one of his first formation screenshot (Defender wall I think), one of the questions that arises was if the ships in formation would be able to each target their own target. BitVenom, at that time, didn’t really answer directly the question, but hinted that it was the case and that it was more or less visible in the said screenshot.
Again, that’s what my memories of the discussion tell me, so I could be wrong, but I wouldn’t be surprised if the behavior permitting a formation to have several targets at the same time is intended.

1 Like

Which would be fine in certain instances, however fighter squadrons suffer from this effect, hence the bug. That’s why I had suggested #4, to keep this ability but through an adjustable code of some sort. We absolutely should have formations targeting multiple targets!

Thanks for your input!

I’m gonna put a quick edit, as the ‘solutions’ are not meant to be separate, but are parts to one.


I laud your efforts dude, bravo. I will do what I can to help, but I have no experience here.

However, not to be a slash of cold water to the face, but this is one of those bugs that @thisquietreverie stated could not be modded out, implying that there was no easy fix for it short of being looked at officially.

Excellent analysis CryCoh. I hadn’t thought of that before, but it makes perfect sense. #666 is probably caused by wingmen trying to target different ships than their leader. That’s fine for capital ships and turreted ships like defenders, but HORRIBLE for most fighters in squadrons/formations. Most fighters have very narrow firing arcs and must follow their leader. If this is indeed the cause, most fighters just need to be bound to their leader’s target to fix the bug.

I added this info to the 666 Bug thread:

With the cause of the biggest bug in Homeworld Remastered now likely known, let hope this finally gets fixed!
@JoeKGBX @Psychichazard


Didn’t @thisquietreverie address the reasoning behind this bug before they seemingly, and more than likely, abandoned support?

Eh, there is no reasoning that can justify the broken combat system in play right now. That aside, a suggested solution is listed, and a developer needs to take a look and give some honest and realistic feedback.

I’m all up for helping to get this squashed, but the community can only go so far without developer contact. Now, if this were Borderlands or Battleborn, things might be different.

Heck, if they put those fixes in officially, I’ll finish balancing and what-not. I just want players and potential mods to utilize the game in its full potential. If we (now very few) didn’t care, we would leave and not bother. But there remains left a small remnant. My hand is out, and so are a few others, to offer what we can to help.

Devs, gearbox, take a look here. Message me if you need, post here also. But eventually our open arms and partnering gestures will withdraw.


Hmm, been a month already and not much has happened… yet…

I’m still willing to do what needs to be done, to get this game back up to speed via patch or mod. Has anyone out there had any thoughts or breakthroughs to this combat ship behavior overhaul? The more the merrier, so lets get some replies and figure out what to do next.

Don’t be shy, now. Players and devs alike, please chime in. Let’s work this out, or at least talk it out. Heck, we can even battle in out in game if that’s what it takes. Let’s do this!


I’m not good with bugs, so is this what bug #666 is about?

Small ships with a large gimble cone against a large target, no problem.

Medium ships against a medium or small target, and only center units fire at the target.

Not sure this is the actual problem, and if you ask me this is what should happen: formations must be used wisely, otherwise it’s better not to use them at all. The actual problem is that ships that could fire the target you would like them to (the target is in their firing cone) are not firing because they have another target painted. They are slaved to fly along the formation’s leader, but they can have other targets painted. This can be noticed if you have lots of formations fighting each other. Cloaked made a video about this and CryCoh provided some screenshots.

I would change this with based on enemy actually being in firing arc and on type of turret vs target.

I don’t know if “enemy actually being in firing arc” would be difficult to implement, and not even if it should actually be, but if I have a vaygr cruiser with it’s engines destroyed why shouldn’t it be able to fire it’s trinity cannon to whatever is in front of it, even if it’s not its main target? What I mean is: there is a major target on the side I would like my disabled BC to fire at with at least its missiles… If I wanted to fire my trinity cannon too against a bunch of frigates in front of it, I would have to first target my major target, wait untill it fired missiles, then retarget my BC against a frigate to fire the trinity cannon… Either we say that the player who controls the Vaygr BC has to do the micro and target different targets according to which weapon he wants to fire, or we say that the other player should do the mycro and move its frigates out of there. I propoend for this last one.

About “type of turret vs target”, this is tricky. You said

and I agree with this sentence, but what if there are bombers around my Vaygr BC which is simultaneously battling an enemy capship in close range? If I target the enemy capship, I would like my AAA turrets to still targets bombers even if that enemy ship is in their firing arc + firing range (= it’s hitable), but if there are no bombers or laser / heavy / pulsar corvettes (ships which my AAA turrets are good against AND that can cause damage to my BC), then I agree that my AAA should fire against my main target instead of nearby collector.
On the other hand, if I actually say to my BC to focus on a specific bomber squad before engaging a capship, I would like all my AAA turrets to fire against the bombers if they can (firing arc) or to fire to whatever they are good against and is a danger for the ship, while the trinity cannons and missiles are free to fire whatever they want (again prioritizing first the things that are in their firing arc and then prioritizing the ship among them that is the greatest concern for my ship and that my turret is good at dealing with).

The process could go like this:

  1. Is my ship in a formation? If yes: my ship’s target is the leader’s target (and the leader’s target is determined by (4) or by the player or by the targeting AI in this order). If not: my ship target is determined by (4) or by the player or by the targeting AI in this order.
  2. Does my ship have only on type of turrets? If yes: all the turrets are slaved by the ship’s target, unless conditions (3) or (4) are met (drones on a kushan frig shouldn’t all fire against the same strike craft -a drone frig can have only one target, determined by point 1-, but distribute themselves ottimally) -> If conditions (3) or (4) are met, change target in a manner that will be described later. If no: proceed with point 3)
  3. Let’s pick a turret (this is a cicle between all the available turrets). Is the current target a hitable target for the current turret (by hitable I mean: is it possible for the turret to target it -trinity can not target strike crafts-? Is the target within the firing range and firing arc of the turret)? If yes: proceed with point 4). If no: fire at the most dangerous target for the ship that the turret can actually fire at - END.
  4. If the turret is meant to counter that specific target then mantain the current target - END. If the turret is not meant to counter that specific target, and there are hitable targets that are simultaneously countered by said turret AND a menace for the ship, then change target and hit them instead - END

How is it?

EDIT: actually I forgot to mentions stances. If in aggressive stance, then even AAA turrets on my BC should fire at an enemy BC (IF this is the current target of my BC), but in evasive or normal stances they should disregard the enemy BC if there are bombers / heavy corvettes hitable by said AAA turret (if there are no bombers or heavy corvette AND the AAA turret is not able to hit the enemy BC because it is off its firing arc, then better firing at frigates if possible or even collectors than not to fire at all, wheter my BC is in aggressive or evasive stance).

1 Like

This thread is kinda wordy, but those screenshots you posted aren’t the bug. Just watch this 40 second video to see it, only the leader is firing…

Also here’s the main thread which explains it in brief:

1 Like

Mm… mmm mm mmm, I like it.

The only I’d add is the ship behavior when more than one type of ship is in formation, such as assault frigates with missile frigates. Ship target priorities should remain, such that when band selecting the anti-fighters hunt fighters, anti-corvettes hunt corvettes, etc. For ships that rely on turreted systems, what you suggest wouldn’t be much of an issue. Let’s take a step further, perhaps. Maybe something like:

Any and all weapon systems have priority targets.

This would make ship priority lists unneeded, perhaps. Basically, when a ship is in combat or set to attack, the weapon systems will determine the primary target, or the target the red line is directed at. The biggest issue that comes to mind with this is: which weapon determines the primary target? A solution to this would be to mark some weapons as an Alpha rank or rating… BUT I’d rather have weapons and ships react to what we the players select, and not be defined solely by the built-in system of combat.

Now, to the cruiser situation you brought up, there is somewhat of a system in play that deals with this, as some weapons will not fire on certain targets due to certain, and intentional, accuracy or penetration values to some armor classes. That is why the Vaygr anti-fighter and corvette munitions on the cruiser tend not to fire at cruisers, or why the trinity blast doesn’t fire at fighters (if I remember correctly…).

One thing about your edit is to remember passive stance. That stance I find serves as more of a “Do not shoot anything for any reason!” stance, but for the others I agree that firing at something is better than not firing at all… so long as my ships don’t fly out of formation or walk to the other side of the match.

Taking a step back, what you suggested is great and worth keeping in mind for those who make the combat logic!

This bit is for everyone. Homeworld is a strategy game, and if at any point the game becomes too self automated, it loses its foundation and becomes something different. Let’s say we implement all these targeting, turret, and combat changes changes work very well, which everyone wants. However, if I take my force and band select to where micro management of some targets is a thing of the past, now the strategy and skill is removed. There has to be a balance of what the game does and what the player does, with respect to reason without frustration.

That’s not specifically the bug mentioned, but that’s worth looking into. What you see there are ships that do not look at their target, but are stuck in their formation orientation or what-not. Makes massive formations useless for non-turreted ships, and it needs to be addressed in the next patch.

Now that I think about it, if the ships would face their own targets 100% of the time, the #666 bug would have been found instantly upon patch release. Ship orientation needs to be fixed too, so I’m adding it up top as an edit.

Do note that part of the reason those ships did not fire, especially in the outer lines of a formation, may be because of targeting behaviors along with ship orientation.

Can someone confirm this for all ships not facing their targets when in medium to large formations? I don’t remember if I did custom fixes to address this specifically not. I’ll do some tests over the next few days and post what I find probably in this thread.

Based on what’s been said here so far, it might be interesting to reproduce the test in the video, but with every fighter having a 360 degree coverage constant no damage beam. That way we can see for certain what targets they’re trying to shoot.


Hey, that’s a good idea! I’ll try that out with the other scenarios. Thanks!


CryCoh, did you make any more tests about this bug?

I was thinking, since bitvenom as little time to spare with HWR, let alone re-write the targeting behaviour, that a simpler solution could be more likely to be delivered rather than a complex one.

If this logic could be added:
Is my ship in a strikegroup? Yes. Is my ship good at dealing with the strike group leader’s target? If yes, my ship shall attack what my leader is into and stick with the leader as per my ship stance (aggressive: maintain formation and leader’s target, evasive: break formation but maintain the leader’s target); if no, pick whatever target my ship is good at dealing with among the band-boxed ones, if any, and stay in formation of break and engage as per my ship stance.
Do you think this alone can get the job done in less time?

About facing: is the strikegroup I’m in currently going slow enough that it allows my ship to strife / glide / use side thrusters to maintain my slot in the formation while facing my target? If yes, do so; otherwise don’t.

Shpere is meant to protect the center ship from all sides… What else purpose should it have then? Even shpere-attacking an enemy cap-ship result in friendly ships facing their target if said target is moving slowly enough. Formations are there because we bugged the devs to have them. But nobody uses them, not even to escort BCs with anti-fighter frigates. So let’s make them useful.

I’ve done some minor tests, but I need to take some photos or videos. Most of the problem is listed up top here. I did take a break for a little over a week, as it didn’t seem to be going anywhere.

I’m picking back up this weekend, starting with EatThePath’s suggestion with 360 degree weapons.

We do know that when ships are given an attack order, the initial target is agreed upon. After elimination of that target, each ship can target a new ship. Perhaps there is a way in which after the initial target is destroyed, all ships instantly are given an order to stop or cancel, then immediately are given the order to attack the next target from the initial box-band select. However, this would require the game to number or remember the targets selected such that each one could be given a queue in which to be destroyer.

For example, if twenty target drones are in a position and are selected to be attack by a a squad of interceptors, each one of those drones would be ranked 1-20 or queued in that way. It would be nice if there were a way to have a number appear by those ships to denote which one is being attack, and which one is next to be attacked.

Ultimately, this is not the final solution, but it could be a start just to see if we can get every ship to agree on a target.

echo7, thanks for the reply and suggestions!

Is it possible to disable formations feature in a mod?

It’s easier not to give the new formations than to give them.

For example you need:

  1. The supply in the ship file for the formation (to tell HWRM how much space this ship occupies in a formation)

setSupplyValue(NewShipType, “Frigate”, 1.0)
setSupplyValue(NewShipType, “LayoutFrigate”, 1.0)

  1. The SGF pass tags in the race’s *scripts{race}.lua file (to say which strike group formations the race has access to)

SG_Pass_Tags = “sgf_common,sgf_tai”

  1. The SGF pass tags in your ConfigFilters.lua file (to say which strike group formations the mod has access to)


Miss out the last one and you get untraceable errors, miss out the 2nd one and you get nothing happening, miss out the first one and the ships look like they have the formations but they don’t do anything when you hit the button…

If you don’t want formations, just make sure to leave out the second two, I am not sure if the first is used elsewhere

I don’t understand your post.