Freighter collision due to docking with the same target

Issue #59 resolved
Justagai created an issue

Steps to reproduce:

  • Fly Y-wing Historical mission 1
  • Do not destroy any containers
  • Wait for FRT Birkby and FRT Deddite to jump in
  • They will eventually collide with each other

Original X-wing behavior has a queue. If two ships want to dock with the same target, the last one in will wait until the first is finished.

EDIT: Just wanted to add that there are two or more containers in the flight group these freighters want to dock with. I rechecked the original xwing mission and they each go for a different container. Otherwise there would be a queue if there was just one container in the flight group.

Comments (5)

  1. David Esparza Guerrero
    • changed status to open

    The queue is already implemented and working as can be seen in YWHM2 where all fighters take turns to board the freighter. If these freighters are attempting to board the same container at the same time, it's a bug in the queue code. The boarding strategy needs to be figured out if it is true that, as you said, a boarding ship will be happy boarding someone else in the same flight group if the first one is already taken. The implemented boarding code is like this:

    1. If boarding group has several ships, each ship books the matching ship number in target group. If target group has fewer ships than the boarding group, they book the first one to board.

    2. If booked ship isn't free, wait for it to be free.

    3. If booked ship is free, board it.

    4. Ships with smaller number in the boarding group have priority over ships with bigger number. For example, Boarder 1 will always go before Boarder 2.

    5. Boarding flight groups listed earlier in the mission file will have priority over flight groups listed later. For example, in YWHM2, the TIE bomber group will board the freighter before the TIE fighters.

  2. David Esparza Guerrero

    Okay, it seems it was nothing like that. Both freighters are targeting two containers that are stacked one on top of the other. The freighter that was trying to dock with the container below approached too "high" and was in collision course with the container on top, so it tried maneuvering around it (instead of below it), what makes it collide with the other approaching freighter. I have altered the AI approaching routine so that they approach the containers from shorter vertical distance so that it doesn't collide with the container above and the problem seems to be solved now.

  3. Justagai reporter

    Ah sorry about that, since I'm not able to check their docking targets in XWVM I just assumed they were going after the same container. Glad to hear its fixed.

  4. Log in to comment