2019-10-16 11:45 EDT


View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0001520FSSCPgameplaypublic2010-07-07 12:03
ReporterARSPR 
Assigned Totaylor 
PrioritynormalSeveritymajorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformDELL Dimension 9200OSWindows VistaOS VersionUltimate 32-bit
Product Version 
Target VersionFixed in Version3.6.10 
Summary0001520: Autopilot leads you to a random place if you are not Alpha 1
DescriptionAutopilot doesn't lead you to selected NAV but to a completely random direction.

This happens if you are not Alpha 1, even if you are Alpha wing leader.

With cinematic autopilot this bug doesn't happen. It just happens with old autopilot code.
Steps To Reproduce+ Download the attached mission (Offset Autopilot.fs2). It just contains you (Alpha 2) and another Ulysses (Alpha 1) and an autopilot nav point.

+ Alt-N > Alt-A. Look how funny it is your jump.
Additional InformationFRED2 doesn't complain about mission errors.

If you enable Use Autopilot Cinematics, the bug is gone.

If you swap the fighters, so you fly Alpha 1 instead of Alpha 2, the bug is gone.

The funniest thing. I've used this build, (grab it here: http://www.hard-light.net/forums/index.php/topic,50258.0.html), with WCSaga demo instead its original wcsaga.exe. Through all this mod, you are Alpha 2 and you aren't the wing leader. And through all this mod your autopilot jumps are fine. WTH??????
TagsNo tags attached.
Attached Files

-Relationships
related to 0001888resolvediss_mneur autopilot cinematics broken in recent 3.6.10 builds, renders certain missions unplayable 
+Relationships

-Notes

~0008636

Tolwyn (reporter)

Usually it is related to wing leader/order of ships in a wing. To avoid this, simply open our old autopilot template in notepad, rename alpha 2 to alpha 5, alpha 1 to alpha 2 and alpha 5 to alpha 1. Done! :)

~0008637

ARSPR (reporter)

Hey what a funny and stupid bug... :D

As Tolwyn said:
+ I've just opened the mission in notepad.
+ I've moved Alpha 2 definition lines before Alpha 1 ones.
+ Then, it works.

(I upload the "fixed" mission: "Offset Autopilot Notepad.fs2")

Clearly, this shouldn't happen at all...

~0008638

taylor (administrator)

The waypoint navigation code just blindly assumes that the player is the leader of any formation. The spacing calculations it then uses can be based on the incorrect ship, which leads to the wing leader (if non-player) having trouble figuring out where to go.

This can be fixed quite easily by just detecting if a ship is part of a wing, not running the spacing calculation on the wing leader (regardless of player or not), and basing the spacing math on the wing leader.

That works fine in theory at least, and in a quick test, but I'll have to play with it a bit more to make sure nothing else gets broken. This is all autopilot specific though, so that greatly narrows down what needs to be tested. :)

~0008640

ARSPR (reporter)

Last edited: 2007-11-15 06:43

Well, it's more or less fixed.

I mean with the new build (1114) and the conflictive mission, Alpha 1, but not you, (Alpha 2), leads the run till the nav point. Remember that, in this mission, Alpha wing leader is you, Alpha 2, not Alpha 1.

At least, the jump isn't random any more.

So it seems that the autopilot run is lead by the very first ship which is declared in the fs2 file. It doesn't matter if that ship is a wing leader or not.

The "Notepad-fixed" mission works like always.

~0008641

taylor (administrator)

Wait, Alpha 2 is the wing leader? I must have misunderstood then. It's an easy correction, I set it to just consider the first ship in the wing as the leader (rather stupidly I might add ;)).

Unfortunately that will just recreate the original problem, so I'll have to dig a little deeper to figure out what's going on.

~0008642

taylor (administrator)

Ok, think I got it now. I need to tweak a few things first, but I believe it will work fine after that.

~0008650

ARSPR (reporter)

Last edited: 2007-11-16 06:27

Ooops, just tested with Xt1115 and it's still more or less fixed ;) ...

+ "Offset Autopilot.fs2" works fine.

+ "Offset Autopilot Notepad.fs2" works like "Offset Autopilot.fs2" before. I mean in this edited mission Alpha 1 leads the run and you follow it.

Remember that the only difference between both files is the ship definition order. I've manually moved all Alpha 2 ship definition lines before Alpha 1.

So autopilot behaviour still depends on fs2 line order rather than in its definitions.

~0008652

taylor (administrator)

No, actually that's because of your changes to that mission. I changed both the autopilot handling and the wing formation AI to work properly with a wing leader that isn't the first ship in the wing. So now it will properly deal with which ever ship you specify as the leader.

In "Offset Autopilot" you have Alpha 2 as the second ship in the wing, and specify it as the wing leader. In "Offset Autopilot Notepad" you have Alpha 2 as the first ship in the wing, but specify Alpha 1 as the wing leader. So, the code is doing exactly what it's supposed to do. In other words, you can't outsmart it any longer. :)

~0008653

ARSPR (reporter)

Last edited: 2007-11-16 15:11

???? As I'm a bit foolish lately, I've re-downloaded "Notepad" mission, I've retested it in game and I've also opened it in FRED.

And there's something wrong here.

Take a look at the screenshot from FRED ("Alpha2 is wing leader.jpg"). FRED says that Alpha wing leader is still Alpha 2, not Alpha 1 as you say. But, as I've said before, Alpha 1 leads the autopilot run.

~0008654

taylor (administrator)

Last edited: 2007-11-16 16:25

Yeah, I'm stupid. I actually managed to screw up twice, only one being a code bug. The code should be fixed now though. :hangsheadinshame:


EDIT: Just the clarify the problem, since it might be an issue for others in the future...

The order of ships listed in a wing needs to match the order of the objects specified in the mission. The wing says that you have Alpha 1, then Alpha 2, with Alpha 2 (the second of the two ships) being the leader. But the object order says that you have Alpha 2, then Alpha 1, with Alpha 1 (the second of the two ships) being the leader. When the mission is parsed it is using the ships listed in the wing list, but not the /order/ in which they are listed. The "special ship" on the other hand, uses the object order, but FRED shows it in wing order. In other words, it's all completely crazy, partially because no one bothered to properly fix the wing leader handling in the first place.

The fix I'm doing is just to sanitize the order of ships in a wing, so that both FRED and people who hand-edit missions know what is what. This will be an automatic change through mission parse. FRED will be better at this however, as those who hand-edit and don't really realize what they are doing could get unexpected, but not incorrect, results.

~0008989

taylor (administrator)

Fixered.

~0009148

ARSPR (reporter)

I've just tested with SVN trunk 2008-04-01 from Taylor's testing builds and I'm not sure if this is fixed. "Offset Autopilot.fs2" and "Offset Autopilot Notepad.fs2" still behave completely different and I think they shouldn't:

+ Remember that player is flying in Alpha 2 which also is the wing leader.

+ "Offset Autopilot.fs2":
- Alpha 1 is before Alpha 2 in the fs2 file.
- Alpha 1 leads the autopilot run. (I mean Alpha 1 actually travels towards the selected NAV, and you fly in formation with it. So you don't exactly aim towards the NAV point).
- At the autopilot run start, your ship seems to move crazy but it stabilizes and follows Alpha 1.

+ "Offset Autopilot Notepad.fs2":
- I just moved Alpha 2 definition lines before Alpha 1 using Notepad. Both missions look identical within FRED.
- Then you, (Alpha 2) lead the autopilot run, you exactly aim the NAV point. Alpha 1 follows you.

~0009152

taylor (administrator)

What got committed to SVN is different from what you tested in the Xt builds previously. The code in the Xt build always made the special ship be considered the wing leader so when using autopilot and stuff that should would always be leader. Goober said that was actually wrong though, since the special ship is only supposed to indicate the player, not the leader of a wing.

So, I changed the code to fix the other bugs, but not handle the wing leader any differently. That means the behavior your are seeing is what it's coded to do. The wing leader will be the first object specified for that wing, which means that in the first case (with Alpha 1 listed first) Alpha 1 would be the leader, but in the second case (with Alpha 2 listed first) Alpha 2 would be the leader.

While still a bug, it's a different bug and not directly related to this one. It just goes back to the object order vs. wing order. I have a fix for that in the works though, just needs a bit more testing. I'm going to release a new build tonight with that change so you can go ahead and check it out then. If it doesn't work then file a new bug about it, like "Object order overrides order specified by wing list", or something of that sort.

~0009161

taylor (administrator)

Code to sort the wing/object list properly has now hit SVN.

~0010706

ARSPR (reporter)

This issue seems not being fully fixed.

Check 0001888.

~0012198

iss_mneur (developer)

The cause of 1888 is unrelated to this bug, except for they both occur in the autopilot code.

Setting this bug back to resolved/fixed.
+Notes

-Issue History
Date Modified Username Field Change
2007-11-14 13:56 ARSPR New Issue
2007-11-14 13:56 ARSPR File Added: Offset Autopilot.fs2
2007-11-14 14:46 Tolwyn Note Added: 0008636
2007-11-14 16:14 ARSPR File Added: Offset Autopilot Notepad.fs2
2007-11-14 16:18 ARSPR Note Added: 0008637
2007-11-14 18:04 taylor Note Added: 0008638
2007-11-14 21:53 taylor Status new => assigned
2007-11-14 21:53 taylor Assigned To => taylor
2007-11-15 06:42 ARSPR Note Added: 0008640
2007-11-15 06:43 ARSPR Note Edited: 0008640
2007-11-15 07:26 taylor Note Added: 0008641
2007-11-15 07:52 taylor Note Added: 0008642
2007-11-16 06:27 ARSPR Note Added: 0008650
2007-11-16 06:27 ARSPR Note Edited: 0008650
2007-11-16 13:58 taylor Note Added: 0008652
2007-11-16 15:05 ARSPR File Added: Alpha2 is wing leader.jpg
2007-11-16 15:10 ARSPR Note Added: 0008653
2007-11-16 15:11 ARSPR Note Edited: 0008653
2007-11-16 16:02 taylor Note Added: 0008654
2007-11-16 16:25 taylor Note Edited: 0008654
2008-03-20 18:42 taylor Status assigned => resolved
2008-03-20 18:42 taylor Fixed in Version => 3.6.10
2008-03-20 18:42 taylor Resolution open => fixed
2008-03-20 18:42 taylor Note Added: 0008989
2008-04-02 17:12 ARSPR Status resolved => feedback
2008-04-02 17:12 ARSPR Resolution fixed => reopened
2008-04-02 17:12 ARSPR Note Added: 0009148
2008-04-02 19:41 taylor Note Added: 0009152
2008-04-03 03:43 taylor Note Added: 0009161
2008-04-03 03:43 taylor Status feedback => resolved
2008-04-03 03:43 taylor Resolution reopened => fixed
2009-03-03 05:00 ARSPR Status resolved => feedback
2009-03-03 05:00 ARSPR Resolution fixed => reopened
2009-03-03 05:00 ARSPR Note Added: 0010706
2009-03-05 11:16 taylor Assigned To taylor =>
2009-03-06 15:07 chief1983 Relationship added related to 0001888
2010-07-07 12:03 iss_mneur Note Added: 0012198
2010-07-07 12:03 iss_mneur Assigned To => taylor
2010-07-07 12:03 iss_mneur Status feedback => resolved
2010-07-07 12:03 iss_mneur Resolution reopened => fixed
+Issue History