2018-12-18 14:16 EST


View Issue Details Jump to Notes ] Related Changesets ]
IDProjectCategoryView StatusLast Update
0001496FSSCPFREDpublic2012-12-09 22:35
ReporterRansom Arceihn 
Assigned ToAdmiral MS 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version3.6.9 
Target VersionFixed in Version 
Summary0001496: Ships stopping mid-waypoint
DescriptionSo, there's two fighters in the same wing. One of them's going to a waypoint, the other's guarding the first. Then they both get clear-goals and an order - the first one is told to play-dead (or stay-still) and the second gets a waypoint-once order.

But BOTH ships stop. If you shoot the second fighter, only then will it get moving toward the waypoint.
Additional InformationHappens in every build I've tried in the stable branch up to the 15th of August. I've tried a dozen variations on the situation, but it seems that whenever the first ship stops the second one invariably does the same until it's shot.
TagsNo tags attached.
Attached Files
  • ? file icon waypoints.fs2 (7,352 bytes) 2007-09-08 12:18
  • patch file icon waypointflying.patch (454 bytes) 2012-12-08 11:13 -
    Index: code/ai/aicode.cpp
    ===================================================================
    --- code/ai/aicode.cpp	(revision 9405)
    +++ code/ai/aicode.cpp	(working copy)
    @@ -11464,6 +11464,12 @@
     	}
     	
     	if (aip->mode == AIM_WAYPOINTS) {
    +
    +		// skip if wing leader has no waypoint order
    +		if(laip->mode != AIM_WAYPOINTS){
    +			return 1;
    +		}
    +
     		aip->wp_list = laip->wp_list;
     		aip->wp_index = laip->wp_index;
     		aip->wp_flags = laip->wp_flags;
    
    patch file icon waypointflying.patch (454 bytes) 2012-12-08 11:13 +
  • patch file icon waypointflying_v2.patch (1,503 bytes) 2012-12-08 16:25 -
    Index: code/ai/ai_profiles.cpp
    ===================================================================
    --- code/ai/ai_profiles.cpp	(revision 9408)
    +++ code/ai/ai_profiles.cpp	(working copy)
    @@ -465,6 +465,8 @@
     
     			set_flag(profile, "$no warp camera:", AIPF2_NO_WARP_CAMERA, AIP_FLAG2);
     
    +			set_flag(profile, "$fix ai path order bug:", AIPF2_FIX_AI_PATH_ORDER_BUG, AIP_FLAG2);
    +
     			// ----------
     
     			// compatibility
    Index: code/ai/ai_profiles.h
    ===================================================================
    --- code/ai/ai_profiles.h	(revision 9408)
    +++ code/ai/ai_profiles.h	(working copy)
    @@ -64,6 +64,7 @@
     #define AIPF2_NO_WARP_CAMERA										(1 << 10)
     #define AIPF2_ASPECT_LOCK_COUNTERMEASURE							(1 << 11)
     #define AIPF2_AI_GUARDS_SPECIFIC_SHIP_IN_WING						(1 << 12)
    +#define AIPF2_FIX_AI_PATH_ORDER_BUG									(1 << 13)
     
     // AI Path types
     #define	AI_PATH_MODE_NORMAL 0
    Index: code/ai/aicode.cpp
    ===================================================================
    --- code/ai/aicode.cpp	(revision 9408)
    +++ code/ai/aicode.cpp	(working copy)
    @@ -11464,6 +11464,14 @@
     	}
     	
     	if (aip->mode == AIM_WAYPOINTS) {
    +
    +		if (The_mission.ai_profile->flags2 & AIPF2_FIX_AI_PATH_ORDER_BUG){
    +			// skip if wing leader has no waypoint order or a different waypoint list
    +			if ((laip->mode != AIM_WAYPOINTS) || !(aip->wp_list == laip->wp_list)){
    +				return 1;
    +			}
    +		}
    +
     		aip->wp_list = laip->wp_list;
     		aip->wp_index = laip->wp_index;
     		aip->wp_flags = laip->wp_flags;
    
    patch file icon waypointflying_v2.patch (1,503 bytes) 2012-12-08 16:25 +

-Relationships
+Relationships

-Notes

~0008512

karajorma (administrator)

Happens in retail too. Ships in a wing follow the orders of the first ship in the wing. Always have done. I'd love to see this fixed but I'd imagine it would break a huge number of missions unless it was applied carefully.

~0008513

Ransom Arceihn (reporter)

Oh.

Well, all right then. But it only seems to affect things when the order means stopping - two separate waypoint orders doesn't result in the second fighter going to the first one's waypoint, for instance.

And it seems strange that getting shot fixes it.

~0009000

taylor (administrator)

* BUMP *

So, is this not something that we can fix, or is it really a new bug?

~0009005

karajorma (administrator)

To be honest it's something I'd really like to see fixed as it's pretty silly that just cause a ship is in a wing you can't give it new orders.

The problem is whether it would break missions. In general it shouldn't. If the mission designer wanted a wing to do something they usually would have told them to do it rather than give the lead ship new orders. But if someone made that mistake they wouldn't have spotted it during playtesting.

I'm tempted to say that we should fix it and see what it breaks.

~0009472

taylor (administrator)

Not going to work on this.

~0010641

karajorma (administrator)

I'll wait till 3.6.10 comes out and then see if changing this breaks anything.

~0014346

The_E (administrator)

Changing the status here to make it more visible

~0014357

Admiral MS (developer)

Last edited: 2012-12-08 11:12

View 2 revisions

So I found the reason why this happens and I can fix it but the question is: What's the right behaviour in this case?
I see the following options:
- Ship should follow its own waypoint path unless the wingleader has the same waypoint path and order
- Ship should follow its own waypoint path unless the wingleader has any waypoint order
As usual with ai changes this may or may not break old missions.
Currently in case the formation waypoint flying starts, the target path of all ships in the wing will get overridden with the path of the wing leader.

Additionally there is the option to drop the formation flag in this case to prevent it from running through all the checks in ai_formation() every frame. When shooting at the fighter that flag gets removed and when given a new waypoint order it gets added anyway.

Edit: Uploaded patch that fixes behaviour for the case presented in the test mission (second option)

~0014361

Admiral MS (developer)

As suggested the fix now comes with an ai_profiles.tbl setting named
$fix ai path order bug: YES / NO

Behaviour with YES is:
Ship should follow its own waypoint path unless the wingleader has the same waypoint path and order

Uploaded it as waypointflying_v2.patch

~0014371

Zacam (administrator)

Fix committed to trunk@9412.
+Notes

+Related Changesets

-Issue History
Date Modified Username Field Change
2007-09-08 12:18 Ransom Arceihn New Issue
2007-09-08 12:18 Ransom Arceihn File Added: waypoints.fs2
2007-09-08 16:11 karajorma Note Added: 0008512
2007-09-08 16:32 Ransom Arceihn Note Added: 0008513
2008-03-21 18:48 taylor Note Added: 0009000
2008-03-21 18:55 karajorma Note Added: 0009005
2008-04-04 20:31 taylor Status new => assigned
2008-04-04 20:31 taylor Assigned To => taylor
2008-07-17 12:36 taylor Note Added: 0009472
2008-07-17 12:36 taylor Assigned To taylor =>
2008-07-17 12:36 taylor Status assigned => new
2009-02-02 15:39 karajorma Status new => assigned
2009-02-02 15:39 karajorma Assigned To => karajorma
2009-02-02 15:40 karajorma Note Added: 0010641
2012-10-28 09:47 karajorma Assigned To karajorma =>
2012-12-07 09:53 The_E Note Added: 0014346
2012-12-07 09:53 The_E Status assigned => acknowledged
2012-12-08 10:46 Admiral MS Note Added: 0014357
2012-12-08 11:12 Admiral MS Note Edited: 0014357 View Revisions
2012-12-08 11:13 Admiral MS File Added: waypointflying.patch
2012-12-08 16:24 Admiral MS Note Added: 0014361
2012-12-08 16:25 Admiral MS File Added: waypointflying_v2.patch
2012-12-08 18:57 Zacam Assigned To => Zacam
2012-12-08 18:57 Zacam Status acknowledged => code review
2012-12-08 22:15 Zacam Changeset attached => fs2open trunk r9412
2012-12-08 22:15 Zacam Note Added: 0014371
2012-12-08 22:15 Zacam Status code review => resolved
2012-12-08 22:15 Zacam Resolution open => fixed
2012-12-09 22:35 Goober5000 Assigned To Zacam => Admiral MS
+Issue History