Targeting Woes: Blair's First Dev Diary

Fighters, bombers, and flak oh my!

Targeting Woes: Blair’s First Dev Diary

I’ve decided to write my first diary as an exploration of the reasons behind one of the most insidious and annoying bugs we’ve had throughout this nearly year long beta process. It’s the bug that seems to creep its way into every release in some form or another: fighter, bomber and flak frigate targeting badness.

In Sins we really want to help players execute their battles as efficiently as possible. This isn’t to say we want to eliminate the advantages of handlings things yourself, but more that the artificial intelligence (AI) should really take care of a lot of the really basic stuff leaving you to deal with more creative solutions and higher level decisions or to just allow you to sit back and enjoy the cinematic battles. One of the key ways we accomplish this is to make sure that the default targeting AI for units will choose targets that that unit is most effective against. This is a very difficult problem and there are a lot of constraints and heuristics involved in arriving at a solution so there is a lot of potential for things to go wrong. And when it came to fighter, bombers and flak frigates lots did go wrong.

Let’s start way back in beta 1. The first report was that fighters and bombers (collectively referred to as strikecraft) weren’t attacking at all after engaging their initial target (i.e. they just sat around like lawn gnomes on a sunny day while a huge battle raged all about them). The problem here was that the individual strikecraft are collected under an abstract unit called a ‘squadron’. When the squadron’s previous target became invalid (most likely because it died) it reacquired a new target but failed to propagate this information to the individual units in the squadron. Thus, they didn’t feel they had a target so they sat around. At the same time flak frigates were failing to attack because while strikecraft were considered threats (they did damage) the abstract unit of ‘squadron’ did not. The flak frigate would then dismiss the squadron as a valid target and cull it before being able to determine if any of the specific units in the squadron were actual threats.

In beta 2 we had the problem where bombers would prioritize fighters over other more important targets. We fixed this simply by changing the bomber’s weapon data to say he couldn’t attack fighters. We failed to look further into the cause and it would come back to bite us in beta 3.

In beta 3 we had yet more reports of bad fighter, bomber and flak frigate targeting behavior. However, we couldn’t recreate the issues so I asked for save games showing the badness. The underlying problem was related to why the bombers were choosing to attack fighters in beta 2 and we had just masked it by making it so bombers couldn’t even shoot at fighters. To understand the real problem I’ll have to describe a bit about how some of the Sins targeting works. At a certain level, potential targets are sorted into special lists based on the attacker’s weapon attack type for a given weapon and it’s effectiveness against a specific armor type. Once, targets are organized in this fashion, the attacker processes those targets to make a final selection based on a bunch of other criteria. The problem is that during this list creation problem, strikecraft often ended up in the same list as non-strikecraft units. All other factors being equal, it was therefore just as likely the unit would choose to attack a fighter as it would to choose say a gauss defense gun. That is why you would often see bombers chasing fighters or inversely, flak frigates attacking non-strikecraft. Therefore, the AI for certain ships needed another special list to organize strikecraft and this new list had to take priority over various other criteria like attack type and armor type. Because we felt this was the ultimate underlying cause to the final targeting issues, I issued a statement in the beta 3 patch list that I was a monkey’s uncle if it wasn’t fixed this time…unfortunately for me I learned shortly after that I am indeed a monkey’s uncle.

So welcome to pre beta 4. The final known issue with the fighter, bomber and flak frigate targeting is again, something we needed the beta testers to find for us and send us save games because our trusty beta testing team is much more efficient at uncovering the special situations that expose these kinds of bugs. At the beginning of the game I talked about how Sins has a lot of features like smart targeting that are supposed to help make running an empire in real-time manageable. One of the other systems is the auto-planet-defense AI which kicks in when you aren’t around to manage the defense of the planet yourself. Part of this code instructs certain units and defenses to heavily weight enemy units that can bomb the planet. However, due to a flaw in the recruitment logic, fighters and flak frigates were being told to target the enemy siege vessels even though they were next to completely useless against them. In beta 4, you can expect the auto-planet-defense AI to behave more appropriately.

Perhaps it was a bit technical, I don’t know, but I hope you enjoyed my first dev diary and learned a bit about what goes on behind the scenes of Sins. I also hope you find the unit AI to be more useful and fun in our upcoming releases. We are still working on improving it and we are also including more tactical options to help out as well.

Blair reporting out.

71,636 views 16 replies
Reply #1 Top
Reply #2 Top
I issued a statement in the beta 3 patch list that I was a monkey’s uncle if it wasn’t fixed this time…unfortunately for me I learned shortly after that I am indeed a monkey’s uncle.




Its been alot of "un"fun to find those bugs

But keep up the indeed great work IC we can see its getting better from patch to patch, from beta to beta
Reply #3 Top
The problem is that during this list creation problem, strikecraft often ended up in the same list as non-strikecraft units. All other factors being equal, it was therefore just as likely the unit would choose to attack a fighter as it would to choose say a gauss defense gun


Silly question: didn't you say that the list was supposed to be sorted by weapons / armor type, so that units would judge their weapons to the target before deciding priority? (That'd make more sense to me than simply segregating the two lists, so maybe I misunderstood something?)
Reply #4 Top
[quote] Perhaps it was a bit technical, [\quote]

Hey, lots of us are a bunch of nerds. The more technical the better

btw, which niece/nephew turned out to be the monkey?
Reply #5 Top
I enjoyed the 'dev diary'. It would be great to read more about the interesting issues you've had to deal with to get to this point.
Reply #6 Top
Blair,
I like the insight into how the bugs are worked out.

Cheers.
Reply #7 Top
Good read. "sat around like lawn gnomes" lol
Reply #8 Top
speaking of targeting bugs, i love how my LRMs will fly into the range of gauss so they can attack hangars
Reply #9 Top

speaking of targeting bugs, i love how my LRMs will fly into the range of gauss so they can attack hangars


Maybe if you treated your LRMs better they wouldn't think that suiciding would be a better fate than serving under you

Thanks for the dev journal, interesting read
Reply #10 Top

speaking of targeting bugs, i love how my LRMs will fly into the range of gauss so they can attack hangars


thats why u generaly leave LRM's at hold position stance... still fascinating to get this insite on just how useful this beta testing is. great work so far IC.
Reply #11 Top
Therefore, the AI for certain ships needed another special list to organize strikecraft and this new list had to take priority over various other criteria like attack type and armor type.

Is this logic special cased to flak frigates only? If so, that may explain why I'm having such trouble with bad targeting when I add anti-fighter weaponry to other ships (such as capital ships).

The dual-list system should really apply to all unit weapons, and those that can't shoot at strikecraft would just fall off the end of the strikecraft list and move on to the full-sized targets list.
Reply #12 Top
Therefore, the AI for certain ships needed another special list to organize strikecraft and this new list had to take priority over various other criteria like attack type and armor type.


Ok, having had that line specifically brought to my attention... isn't that another cover-up there? Isn't the real problem that units aren't judging properly whether their weapons are "good" for anti-fighter or not before assigning target priority?

Looking back at:

At a certain level, potential targets are sorted into special lists based on the attacker’s weapon attack type for a given weapon and it’s effectiveness against a specific armor type. Once, targets are organized in this fashion, the attacker processes those targets to make a final selection based on a bunch of other criteria. The problem is that during this list creation problem, strikecraft often ended up in the same list as non-strikecraft units. All other factors being equal, it was therefore just as likely the unit would choose to attack a fighter as it would to choose say a gauss defense gun.


Units are supposed to judge their weapon time Vs. the enemies Armor type -- shouldn't they notice, through that judgment, that a given weapon is useless against strike craft, and conversely when its useful only against strike craft?
Reply #13 Top
speaking of targeting bugs, i love how my LRMs will fly into the range of gauss so they can attack hangars thats why u generaly leave LRM's at hold position stance... still fascinating to get this insite on just how useful this beta testing is. great work so far IC.


Agreed. Local Area and Hold Position are priceless. Use them or lose your ships. Put defending flaks on local area and LRMs on hold position. Put support cruisers specifically made to guard carriers on hold position. Put carriers on hold position.
Reply #14 Top
Nice I love the dairy. Maybe an easy fix or I would like it. I make on average 15 to 20 carriers. I would like to be able to group the fighters/bombers in a controllable fleets of there own. In any given battle I dictate targets anyway. Mainly on the bombers. As the fighters usually target fighters or frigs. Which is good. Ten or more bombers with little fighter cover and all kinds of things start to disappear.
Reply #15 Top
I in no way shape or form can code like you folks :) knowhere near but It figures the kind of targetting you are aiming for would be a complete knightmare! Getting a game out with reviews like it has recieved with what is maybe arguably quite a small publisher is no small feat. Im sure you folks will get it :) as I imagine to get a game to the current standard is an astronomical task in itself! So many combinations of situations which targetting must encompass , man that sounds one ugly coding job!

Reply #16 Top
I haven't posted in a while since I couldn't remember my password (damn upper case, and the website wasn't sending me a forgotten password thing) ... but I just have to say ... shouldn't targeting be just done using a rock scissors paper type thing? so even if your rocks numerically have no chance (think not upgraded rocks) against an awesome scissors they should still attack because they're best suited for the job ... this is how I thought it worked but I guess not, I didn't know there were things like armor ratings being considered when deciding who to target next.

Also quick note on targeting ... there should be an easy way to tell your units to destroy everything in a sector ... like extractors etc ...