Skip to content
This repository has been archived by the owner on Apr 17, 2022. It is now read-only.

Safety transporter has a mixed unit order when loading a save #3009

Closed
wzdev-ci opened this issue Dec 21, 2011 · 21 comments
Closed

Safety transporter has a mixed unit order when loading a save #3009

wzdev-ci opened this issue Dec 21, 2011 · 21 comments

Comments

@wzdev-ci
Copy link
Contributor

resolution_fixed type_bug | by Emdek


I thought that there was such as report but couldn't find it...

I've ended starting g01 mission with nine howitzers and commander however there was no such transport!

First transport contained 3 trucks and few assault units (gun and cannon), second 4 howitzers, commander and few other units, next one 6 howitzers and 4 tank killers and last one one tank killer, second commander and few other assault units.


Issue migrated from trac:3009 at 2022-04-16 08:44:02 -0700

@wzdev-ci
Copy link
Contributor Author

Emdek uploaded file wz-wrong-transport.jpg (113.0 KiB)

wz-wrong-transport.jpg

@wzdev-ci
Copy link
Contributor Author

Berserk Cyborg changed priority from normal to major

@wzdev-ci
Copy link
Contributor Author

Berserk Cyborg changed title from Wrong units in first transport in Gamma 1 mission to Safety transporter order mixed or lost

@wzdev-ci
Copy link
Contributor Author

Berserk Cyborg commented


Below is my current understanding of the bug(s).

The last Beta mission uses a "safety" transporter to bring multiple transporter loads of droids to the next mission while on the home map (bDroidsToSafety = true). For whatever reason, the transporter may not spawn on the next map.

This is kind of two problems:

  1. Should a transporter on the home map of Beta-end not exit the map when the mission ends, the source does not try to bring in any transporter with the droids that were flew to "safety". This leads the cam3-a script to believe the mission started from the main menu and will use a subpar assortment of droids.

  2. Sometimes the order of the transport loads are mixed. Other times a complete loss of a transport load.

Although not quite a blocker, I set this to major because it would be disheartening to lose droids a player has had potentially from the beginning of a campaign.

@wzdev-ci
Copy link
Contributor Author

Per commented


For the first issue, just check in rules.js before ending a mission that no transporter is on the way out of the map? So we stagger the mission end until it has flown out.

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Jan 27, 2018

Berserk Cyborg commented


Replying to Warzone2100/old-trac-import#3009 (comment:2):

For the first issue, just check in rules.js before ending a mission that no transporter is on the way out of the map? So we stagger the mission end until it has flown out.
What if the player decides to not launch the transporter just before mission end?

If I remember correctly, missions with the safety transporter spam eventTransporterExit when no player droids are left on map and causes the transporter to fail exiting.

Anyway, have a save before this mission begins. One on the offworld mission called "cam2-8" where you can simply enter debug mode and type "let me win" and one before on the home map.

Victory conditions:

  1. Launch the transporter at least three times.
  2. Survive until the timer runs out.

@wzdev-ci
Copy link
Contributor Author

Berserk Cyborg uploaded file Beta10.zip (179.6 KiB)

@wzdev-ci
Copy link
Contributor Author

Berserk Cyborg changed status from new to closed

@wzdev-ci
Copy link
Contributor Author

Berserk Cyborg changed owner from `` to Berserk Cyborg

@wzdev-ci
Copy link
Contributor Author

Berserk Cyborg changed resolution from `` to fixed

@wzdev-ci
Copy link
Contributor Author

Berserk Cyborg commented


In Warzone2100/warzone2100@e9045fb:

#CommitTicketReference repository="" revision="e9045fb6af7e8394feb9dd3de1c71b88dcf1f6b2"
Safety transporter missions no longer try to end early.

Missions that use the safety transporter would spam eventTransporterExit and try to end the mission early
when no player droids were on map. This has never worked well and caused problems where the player would lose
their droids on Beta to Gamma transition.

Cam2-end: Fail mission if transporter has not left the map by mission timeout.

Fixes #3009.

@wzdev-ci
Copy link
Contributor Author

alfred007 commented


I updated to master e9045fb and you still get mixed units after reloading a saved game from a moment after the first transport left the map. But the order is no longer lost.
You can find saved games here: http://forums.wz2100.net/viewtopic.php?f=1&t=12714&p=140091#p140091

@wzdev-ci
Copy link
Contributor Author

alfred007 changed status from closed to reopened

@wzdev-ci
Copy link
Contributor Author

alfred007 changed resolution from fixed to ``

@wzdev-ci
Copy link
Contributor Author

Berserk Cyborg commented


Loading a save on the last Beta mission after the first transporter exits causes some of the droids on the first transporter on Gamma 1 to be randomized from the list of droids the player flew to safety.

@wzdev-ci
Copy link
Contributor Author

Berserk Cyborg changed title from Safety transporter order mixed or lost to Safety transporter has a mixed unit order when loading a save

@wzdev-ci
Copy link
Contributor Author

Berserk Cyborg commented


Warning: A bunch of rambling.

I setup a test to more easily understand what is happening. This test involves groups of similar units.

Group 1 - 9 rockets, 1 truck
Group 2 - 10 cannons
Group 3 - 10 AA
Group 4 - 10 artillery

I saved after each time the transporter reached the edge of the map.

Observations:

Loading a save after depositing group 1 had no effect on first group composition.
Loading a save after depositing group 2 made group 2 appear first
Loading a save after depositing group 3 made group 3 appear first
Loading a save after depositing group 4 made group 4 appear first

save file structure of mdroid.json:

  1. transporter-[truck-lancers]
  2. transporter-[cannons]-[truck-lancers]
  3. transporter-[Hurricanes]-[cannons]-[truck-lancers]
  4. transporter-[mortars]-[hurricanes]-[cannons]-[truck-lancers]

Eventually, ending the mission calls saveCampaignData(). If we are a safety mission:

  1. Move transporter and its contents to mission.apsDroidList (should only apply if it didn't make it to the map edge and the timer ran out).
  2. Reverse mission droid list and fill the next mission transporter with the first ten units in the now reversed list.

By hacking around I found that completing the mission without reloading a save requires the droid list to be
reversed. But, loading a save does NOT require the list to be reversed. So, somehow all the droid lists
don't retain the same "order" they had while in game.

loadSaveDroid() also sorts transporters and commanders to be the first droids to be loaded (they need to be setup before any of their group members they command/hold). This always makes commanders budge into the first group on Gamma 1, which complicates things. Leaving the potential for a player to see 10 commanders as the first group on the next mission!

So, I guess, its just because stuff gets sorted when loading the droid lists?

Save I used uploaded. Use "biffer baker" cheat, send the transporter off, use "let me win", and then you can do some tests.

@wzdev-ci
Copy link
Contributor Author

Berserk Cyborg uploaded file save.zip (60.2 KiB)

Use with master

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Sep 5, 2019

Berserk Cyborg changed status from reopened to closed

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Sep 5, 2019

Berserk Cyborg changed resolution from `` to fixed

@wzdev-ci
Copy link
Contributor Author

wzdev-ci commented Sep 5, 2019

Berserk Cyborg commented


Fixed with 58ac40f0a00c521eed5bad7cc55ba01a212ce4dd

@wzdev-ci wzdev-ci closed this as completed Sep 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant