View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000945 | FSSCP | docking | public | 2006-06-11 19:15 | 2012-07-01 05:59 |
Reporter | The Trivial Psychic | Assigned To | Goober5000 | ||
Priority | urgent | Severity | major | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Platform | AMD-2600+ 1GB DDR400 ATI9600XT | OS | WinXP in OGL | OS Version | SP2 |
Target Version | 3.6.14 | Fixed in Version | 3.6.14 | ||
Summary | 0000945: Non-Leader Docked Craft Attempt Maneuvers | ||||
Description | If you dock one or more fighter craft to a larger ship, regardless of the fact that the larger ship is the dock leader, the smaller craft will still attempt to loiter, or engage nearby hostiles, causing the larger craft to spin about. If there are more than one small fighter docked to the large craft, it will also cause a degree of jerkiness to the spinning, since there are multiple fighters trying to maneuver the ship. The only way to avoid this is to give every ship except the dock leader, orders to play dead. If a wing is docked in this manner, the individual fighters in the wing must be given such an order, rather than the wing as a whole. Unfortunately, this behaviour has been somewhat present since Retail, and I'm certain that one or more campaigns have taken advantage of it for comedic effect. Therefore, the best way I can see to preserve backwards compatibility would be to add a checkbox either in the docking controls or in the ship flags, that causes the ship to be inactive while docked, which includes engines and weapons primarily, though perhaps not turrets. Not sure if this should be engaged by default for any new missions created with a such-enabled FRED, so that when a designer docks 2 or more objects together, any object not deemed as the dock leader, automatically has this checkbox enabled. Missions previously created and loaded either in FRED or in FS, will default to the previous behaviour. | ||||
Steps To Reproduce | Take a ship with multiple dockpoints, dock several fighters to it, make all hostile, then play in mission and watch the core ship spin around. Then, change the intial orders of the fighters to "play dead, 89", then replay the mission and watch how it behaves as it should. | ||||
Additional Information | This was split from bug 0000530. | ||||
Tags | No tags attached. | ||||
parent of | 0002557 | closed | Goober5000 | Jettison-cargo-delay doesn't work |
has duplicate | 0001723 | closed | Goober5000 | Fighters/bombers with no orders will keep trying to fly around when docked to another ship |
|
Is this still current? |
|
I believe so. |
|
I second that believe so and know that the speed issue still happens as well. Probably should a relation to that one. Guess I never filed that report in SCP Mantis because this one was here. It's still open in Diaspora Mantis so the problem still exists in some form. |
|
Okay, here's how I propose to fix this: If a ship is docked to something, and does not have any active goals or orders, then it should not perform evasive maneuvers. Note, the decision should not be whether the ship is the "dock leader" or not, because the dock leader only matters as far as warping into the mission. It's not necessarily the ship that has control of the stack at a particular time. |
|
I should also look through the code to see if I made that incorrect assumption anywhere else the dock leader is referenced. |
|
I don't understand the relationship to 2548. 2548 is for non-docked cargo containers, nav buoys, and sentry guns. In the patch I attached, all I had to do was give non-flyable 'ships' the same exclusion from shockwave-dodging that big ships have (which is handled separately from normal weapon dodging as far as I can tell). I guess the shockwave-dodging behavior might be feeding into the docking issues, I dunno. |
|
Oh. I assumed 2548 was for docked cargo containers. Reopening then. |
|
Would a kind soul be able to FRED up a test mission for this bug? |
|
|
|
Test mission uploaded for no mods. |
|
Thanks MjnMixael! |
|
Okay, the case demonstrated in the test mission is now fixed. You should also draw up a test case for a fighter that isn't initially docked. (Initially docked ships have a particularly clean AI state that later-docked ships may not have.) |
|
|
|
New mission uploaded, is that what you mean? Also, the Argo's maneuverability in retail is impressive.. |
|
Hmm. As I feared, the Argo flips out in the second test mission. More detective work is needed. |
|
I have patched most of the gaps, but the fighters still pulse their engines if shot at. I'll defer this for now, but revisit it later. |
|
patch2_for_945.patch (3,402 bytes)
Index: code/ai/aicode.cpp =================================================================== --- code/ai/aicode.cpp (revision 8915) +++ code/ai/aicode.cpp (working copy) @@ -10589,9 +10589,8 @@ case AIS_DOCK_4A: { if (aigp == NULL) { // Can happen for initially docked ships. - // Goober5000 - if we just "sit and wait for further orders", then we're not doing any behavior, grrr... - // (commenting out a retail bug) - //ai_do_default_behavior( &Objects[Ships[aip->shipnum].objnum] ); // do the default behavior + // this now "just sits here" for docked ships + ai_do_default_behavior( &Objects[Ships[aip->shipnum].objnum] ); // do the default behavior } else { mission_log_add_entry(LOG_SHIP_DOCKED, shipp->ship_name, goal_shipp->ship_name); @@ -13585,6 +13584,12 @@ Assert((aip->mode != AIM_WAYPOINTS) || (aip->active_goal != AI_ACTIVE_GOAL_DYNAMIC)); + if (!stricmp(shipp->ship_name, "GTF Ulysses 2")) { + mprintf(("ship 2\n")); + } else if (!stricmp(shipp->ship_name, "GTF Ulysses 3")) { + mprintf(("ship 3\n")); + } + // Set globals defining the current object and its enemy object. Pl_objp = &Objects[objnum]; @@ -14188,42 +14193,42 @@ void ai_do_default_behavior(object *obj) { - ai_info *aip; - int ship_flags; - Assert(obj != NULL); Assert(obj->instance != -1); Assert(Ships[obj->instance].ai_index != -1); - aip = &Ai_info[Ships[obj->instance].ai_index]; + ai_info *aip = &Ai_info[Ships[obj->instance].ai_index]; + int ship_flags = Ship_info[Ships[obj->instance].ship_info_index].flags; - ship_flags = Ship_info[Ships[obj->instance].ship_info_index].flags; - if (!is_instructor(obj) && (ship_flags & (SIF_FIGHTER | SIF_BOMBER))) + // default behavior in most cases (especially if we're docked) is to just stay put + aip->mode = AIM_NONE; + aip->submode_start_time = Missiontime; + aip->active_goal = AI_GOAL_NONE; + + // if we're not docked, we may modify the behavior a bit + if (!object_is_docked(obj)) { - int enemy_objnum = find_enemy(OBJ_INDEX(obj), 1000.0f, The_mission.ai_profile->max_attackers[Game_skill_level]); - set_target_objnum(aip, enemy_objnum); - aip->mode = AIM_CHASE; - aip->submode = SM_ATTACK; - aip->submode_start_time = Missiontime; + // fighters automatically chase things + if (!is_instructor(obj) && (ship_flags & (SIF_FIGHTER | SIF_BOMBER))) + { + int enemy_objnum = find_enemy(OBJ_INDEX(obj), 1000.0f, The_mission.ai_profile->max_attackers[Game_skill_level]); + set_target_objnum(aip, enemy_objnum); + aip->mode = AIM_CHASE; + aip->submode = SM_ATTACK; + } + // support ships automatically keep a safe distance + else if (ship_flags & SIF_SUPPORT) + { + aip->mode = AIM_SAFETY; + aip->submode = AISS_1; + aip->ai_flags &= ~(AIF_REPAIRING); + } + // sentry guns... do their thing + else if (ship_flags & SIF_SENTRYGUN) + { + aip->mode = AIM_SENTRYGUN; + } } - else if (ship_flags & (SIF_SUPPORT)) - { - aip->mode = AIM_SAFETY; - aip->submode = AISS_1; - aip->submode_start_time = Missiontime; - aip->ai_flags &= ~(AIF_REPAIRING); - } - else if ( ship_flags & SIF_SENTRYGUN ) - { - aip->mode = AIM_SENTRYGUN; - } - else - { - aip->mode = AIM_NONE; - } - - aip->submode_start_time = Missiontime; - aip->active_goal = AI_GOAL_NONE; } #define FRIENDLY_DAMAGE_THRESHOLD 50.0f // Display a message at this threshold. Note, this gets scaled by Skill_level |
|
I've uploaded my current patch. |
|
|
|
This new version of MultiDockTest assigns one of the ships to stay-still (the other is still play-dead) and changes the mission name. |
|
patch3_for_945.patch (1,427 bytes)
Index: fs2_open/code/ai/aicode.cpp =================================================================== --- fs2_open/code/ai/aicode.cpp (revision 8915) +++ fs2_open/code/ai/aicode.cpp (working copy) @@ -11999,6 +11999,11 @@ void ai_maybe_evade_locked_missile(object *objp, ai_info *aip) return; } + // don't evade missiles if you're docked + if (object_is_docked(objp)) { + return; + } + if (aip->ai_flags & (AIF_NO_DYNAMIC | AIF_KAMIKAZE)) { // If not allowed to pursue dynamic objectives, don't evade. Dumb? Maybe change. -- MK, 3/15/98 return; } @@ -12097,6 +12102,11 @@ void maybe_evade_dumbfire_weapon(ai_info *aip) return; } + // don't evade dumbfires if you're docked + if (object_is_docked(Pl_objp)) { + return; + } + // Make sure in a mode in which we evade dumbfire weapons. switch (aip->mode) { case AIM_CHASE: @@ -14635,7 +14645,7 @@ void ai_ship_hit(object *objp_ship, object *hit_objp, vec3d *hitpos, int shield_ // Hit by a protected ship, don't attack it. if (objp_hitter->flags & OF_PROTECTED) { - if ((Ship_info[shipp->ship_info_index].flags & (SIF_FIGHTER | SIF_BOMBER)) && (aip->target_objnum == -1)) { + if (((Ship_info[shipp->ship_info_index].flags & (SIF_FIGHTER | SIF_BOMBER)) && (aip->target_objnum == -1)) || !object_is_docked(objp_ship)) { if (aip->mode == AIM_CHASE) { if (aip->submode != SM_EVADE_WEAPON) { aip->mode = AIM_CHASE; |
|
I had a go at stopping the fighters from maneuvering by preventing them from entering AIM_EVADE_WEAPON mode (see patch3) - in testing with the 1st mission this has stopped most of the movement, but not all. There are a few "twitches" which don't appear to be being caused by changes in the AI mode, i.e. the fighters are staying in AIM_NONE the entire time. So I'm not sure what's causing this... |
|
Well done niffiwan. Two out of three of those are solid fixes. The third I'm not sure about; will have to double-check. |
|
All fixed! |
fs2open: trunk r8914 2012-06-25 05:39 Ported: N/A Details Diff |
fix the old Volition bug where a docked ship would execute its default behavior even when the preceding comment explicitly said that it should "just sit here" :-/ also guard against a few edge cases related to this (all of this is in regards to Mantis 0000945) |
Affected Issues 0000945 |
|
mod - /trunk/fs2_open/code/ai/aicode.cpp | Diff File | ||
mod - /trunk/fs2_open/code/ship/ship.cpp | Diff File | ||
fs2open: trunk r8918 2012-06-30 23:24 Ported: N/A Details Diff |
this should fix all of the issues with docked fighters and bombers (Mantis 0000945) |
Affected Issues 0000945 |
|
mod - /trunk/fs2_open/code/ai/aicode.cpp | Diff File | ||
mod - /trunk/fs2_open/code/ship/shiphit.cpp | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2006-06-11 19:15 | The Trivial Psychic | New Issue | |
2006-07-20 01:27 | Goober5000 | Additional Information Updated | |
2006-11-24 23:04 | Goober5000 | Relationship added | child of 0000530 |
2007-10-22 05:41 | Goober5000 | Relationship deleted | child of 0000530 |
2010-10-22 13:00 | The_E | Note Added: 0012422 | |
2010-10-23 20:33 | Goober5000 | Note Added: 0012433 | |
2010-10-23 23:41 | FUBAR-BDHR | Note Added: 0012434 | |
2010-10-23 23:45 | FUBAR-BDHR | Note Edited: 0012434 | |
2012-01-03 08:05 | Goober5000 | Relationship added | related to 0002557 |
2012-01-03 08:08 | Goober5000 | Relationship added | parent of 0002548 |
2012-01-03 08:09 | Goober5000 | Relationship replaced | has duplicate 0002557 |
2012-01-03 08:09 | Goober5000 | Relationship replaced | parent of 0002557 |
2012-01-03 08:10 | Goober5000 | Priority | normal => urgent |
2012-01-03 08:10 | Goober5000 | Severity | minor => major |
2012-01-03 08:10 | Goober5000 | Target Version | => 3.6.14 |
2012-01-03 08:15 | Goober5000 | Note Added: 0013020 | |
2012-01-03 08:17 | Goober5000 | Note Added: 0013021 | |
2012-01-03 08:51 | Alan Bolte | Note Added: 0013022 | |
2012-01-03 08:57 | Goober5000 | Note Added: 0013023 | |
2012-01-03 08:58 | Goober5000 | Relationship deleted | parent of 0002548 |
2012-06-20 01:08 | niffiwan | Note Added: 0013680 | |
2012-06-21 20:26 | MjnMixael | File Added: MultiDockTest.fs2 | |
2012-06-21 20:26 | MjnMixael | Note Added: 0013695 | |
2012-06-22 09:23 | niffiwan | Note Added: 0013700 | |
2012-06-25 10:33 | Goober5000 | Changeset attached | => fs2open trunk r8914 |
2012-06-25 10:35 | Goober5000 | Note Added: 0013721 | |
2012-06-25 13:54 | MjnMixael | File Added: MultiDockTest2.fs2 | |
2012-06-25 13:54 | MjnMixael | Note Added: 0013722 | |
2012-06-25 22:52 | Goober5000 | Note Added: 0013723 | |
2012-06-25 23:27 | Goober5000 | Note Added: 0013724 | |
2012-06-25 23:29 | Goober5000 | File Added: patch2_for_945.patch | |
2012-06-25 23:29 | Goober5000 | Note Added: 0013725 | |
2012-06-25 23:32 | Goober5000 | File Added: 0MultiDockTest2.fs2 | |
2012-06-25 23:33 | Goober5000 | Note Added: 0013726 | |
2012-06-26 10:08 | niffiwan | File Added: patch3_for_945.patch | |
2012-06-26 10:13 | niffiwan | Note Added: 0013727 | |
2012-06-27 05:32 | Goober5000 | Note Added: 0013729 | |
2012-07-01 03:24 | Goober5000 | Changeset attached | => fs2open trunk r8918 |
2012-07-01 03:25 | Goober5000 | Note Added: 0013740 | |
2012-07-01 03:25 | Goober5000 | Status | assigned => resolved |
2012-07-01 03:25 | Goober5000 | Resolution | open => fixed |
2012-07-01 03:25 | Goober5000 | Fixed in Version | => 3.6.14 |
2012-07-01 03:25 | Goober5000 | Description Updated | |
2012-07-01 05:59 | Goober5000 | Relationship added | has duplicate 0001723 |