View Issue Details

IDProjectCategoryView StatusLast Update
0002780FSSCPAIpublic2013-01-27 09:52
ReporterYarn Assigned Tom_m  
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.6.15 
Summary0002780: AI does not ensure clear line of sight when attacking subsystems
DescriptionSince revision 6511, any AI ship ordered to attack a subsystem will do so by getting close enough to the ship and firing in the direction of the subsystem without making any attempt to actually get a clear line of sight of that subsystem.
Steps To ReproduceYou can use the attached mission to see this in action. Delta 1, located 3000 meters behind the Orion, has the order to disable it. If played on retail or a revision before 6511, Delta 1 will fly under the Orion where the engine is located. If played on revision 6511 or later, he will simply fly straight into the engine wash and shoot in the direction of the engine. You can also call in Epsilon 1, who will warp in underneath the Orion and actually shoot the engine.
TagsNo tags attached.

Activities

Yarn

2013-01-25 22:07

developer  

SubsystemTest.fs2 (6,444 bytes)

Goober5000

2013-01-27 08:20

administrator   ~0014660

Argh. Though if you narrowed down the behavior to a single revision, this is a very good bug ticket. Do you mean to say that the behavior was as normal in 6510 but changed in 6511?

m_m

2013-01-27 09:02

developer   ~0014661

Ridiculously simple patch that fixes this is attached.
There might exist balance issues with existing missions which were designed with this bug.

m_m

2013-01-27 09:02

developer  

mantis_2780.patch (629 bytes)   
Index: code/ai/aibig.cpp
===================================================================
--- code/ai/aibig.cpp	(revision 9509)
+++ code/ai/aibig.cpp	(working copy)
@@ -424,7 +424,7 @@
 
 			aip->path_goal_dist = 5;
 			subsys_path_num = aip->targeted_subsys->system_info->path_num;
-			if ( ((aip->path_start) == -1 || (aip->mp_index != subsys_path_num)) && subsys_path_num <= pm->n_paths ) {
+			if ( ((aip->path_start) == -1 || (aip->mp_index != subsys_path_num)) && subsys_path_num <= pm_t->n_paths ) {
 				// maybe create a new path
 				if ( subsys_path_num >= 0 ) {
 					Assert(aip->target_objnum >= 0);
mantis_2780.patch (629 bytes)   

Goober5000

2013-01-27 09:40

administrator   ~0014662

Any such balance issues (I doubt there are any) would be more than outweighed by the breakage to compatibility, not only with retail, but with all missions produced prior to 9/25/2010.

Good catch on the actual cause. I will commit your patch shortly, plus some other fixes that need to be made in that function.

Goober5000

2013-01-27 09:52

administrator   ~0014663

Fix committed to trunk@9512.

Related Changesets

fs2open: trunk r9512

2013-01-27 05:28

Goober5000


Ported: N/A

Details Diff
apply m!m's fix for Mantis 0002780
also correct the off-by-one error in the range check (path_num must < n_paths, not <=)
Affected Issues
0002780
mod - /trunk/fs2_open/code/ai/aibig.cpp Diff File

Issue History

Date Modified Username Field Change
2013-01-25 22:07 Yarn New Issue
2013-01-25 22:07 Yarn File Added: SubsystemTest.fs2
2013-01-27 08:20 Goober5000 Note Added: 0014660
2013-01-27 09:02 m_m Note Added: 0014661
2013-01-27 09:02 m_m File Added: mantis_2780.patch
2013-01-27 09:07 m_m Assigned To => m_m
2013-01-27 09:07 m_m Status new => feedback
2013-01-27 09:40 Goober5000 Note Added: 0014662
2013-01-27 09:52 Goober5000 Changeset attached => fs2open trunk r9512
2013-01-27 09:52 Goober5000 Note Added: 0014663
2013-01-27 09:52 Goober5000 Status feedback => resolved
2013-01-27 09:52 Goober5000 Resolution open => fixed