1. Welcome to the Starbound support forums. Please check the support FAQs before posting: http://playstarbound.com/support

Hunting Season is on! Let's find the Duplication Bug

Discussion in 'Starbound Support' started by QuantumProjects, Sep 14, 2016.

  1. QuantumProjects

    QuantumProjects Star Wrangler

    Hello everyone,

    I think we could all help Chucklefish find the infamous crew duplication bug everyone keeps talking about by organizing a community bug hunting operation. I think Operation Hunting Season is a fine name for it.

    I've seen one debug-level log of someone who has experienced the crew duplication bug and I think I may have a hint on what's causing it. But to confirm it, we need to cross check several detailed logs before we can jump to any conclusions.

    So, this is what I propose:

    1. Everyone having this bug is highly encouraged to enlist to this operation.

    2. If you want to help, back up your current universe and player data. We do not want any permanent damage done to our game experience, and I personally do not know what are its long term consequences to your savegame data, so extra caution won't hurt.

    3. Raise the log level. To do so:

    a) if you are using Steam, right click the Starbound entry in your Library, select "Properties", and on the general tab, click on "Set Launch Options", then write "-loglevel debug" (without the quotes) and press ok.

    b) If you are not using Steam, I presume you just have to append "-loglevel debug" (again, without the quotes) to the Target field of your shortcut (select it, right click, select "Properties", then go to the "Shortcut" tab.

    4. After that, launch the game and try to get the crew duplication bug to happen again. I have never experienced it, but it seems that it happens when you try to teleport to a planet while some of your crew (or none) is following you.

    5. As soon as the bug happens, write down a detailed description of what you were doing, how many crewmembers you had with you, how many crewmembers you have recruited, the type of the planet you were trying to teleport to and any other information you think might be even remotely relevant. We cannot know in advance which piece of information is relevant, so in doubt, be wordy.

    6. As soon as you've experienced the bug, quit the game (normally, don't need to force quit). That way, we can know that your last log entries are related to the bug somehow.

    7. Copy the entire log content to Pastebin and paste your report with the link in this thread. You can also attach your log file to your reply, as Iris has pointed out.

    So what do I suspect it is causing the bug? Exception handling.

    From what I've seen from another user's log, there were some exceptions randomly thrown as he tried to teleport to a planet. Although they were related to a missing asset used by the quest generator lua script and they were all catched, I believe that there may be a problem with the exception handling code and that is what might be causing the crew duplicate bug.

    After all:

    1. The exceptions were thrown at random in the same situation (planet loading), so that may explain why the bug does not happen every time and cannot be consistently reproduced.

    2. Exceptions in code cause a break on the original code flow and sometimes it is difficult to know how the game data has ended up after recovering from the bug. It is usually a source of difficult-to-find bugs, specially because exception handling code cannot throw further exceptions and, therefore, cannot report problems it has itself suffered.

    My hypothesis is that the exception handling code is trying to recover from a missing asset exception and is bypassing some steps required to guarantee that the game state is in (or ends in) a valid state to do so.

    To test this hypothesis, though, I need to see other detailed logs from those suffering this bug, so that I can find a pattern.

    So, if you want to help, please enlist to this operation. Bug hunting is difficult and tedious, so if we can help, we can get the fix sooner.
     
    Last edited: Sep 14, 2016
    Ankali, Liavain_Axon and SirOee like this.
  2. Iris Blanche

    Iris Blanche Pudding Paradox Forum Moderator

    Nice idea with the loglevel. I wasn't aware that this flag can be set.
    You should mention that this error:
    Code:
    iCCP: known incorrect sRGB profile
    can be ignored.

    Fyi pasting the log contents to pastebin shouldn't be necessary. The forums allow the .log extension being attached to the post.

    ~ Iris ~
     
  3. QuantumProjects

    QuantumProjects Star Wrangler

    Iris, I wasn't aware either. But I've seen one player recommend it to another and the generated logs were quite different, so I presume it works.
     
  4. Iris Blanche

    Iris Blanche Pudding Paradox Forum Moderator

    The flag works indeed pretty well :eek:
    It makes it much much much more easier to track down some issues.

    ~ Iris ~
     
    Ankali and Liavain_Axon like this.
  5. ErebusAmauro

    ErebusAmauro Astral Cartographer

    I recently had this bug, so I go to do this, and if it happen again, I will post the .log
    What I gonna do as a temporary measure is to dismiss the 2 duplicated crew members. I hope it will work.
     
  6. QuantumProjects

    QuantumProjects Star Wrangler

    @ErebusAmauro, please remember to set up the -debug flag as instructed above. Without it, catched exceptions (our suspect of the hour) won't show up in the log, and we won't see anything.

    By the way, thanks for participating! Hope we catch that nasty bug soon.
     
  7. ErebusAmauro

    ErebusAmauro Astral Cartographer

    Ok, this has take a curious twist. First, I have to say that my bug was a little peculiar in the way that it happened while I was in single player (most of the reports of this bug are from people playing in multiplayer)
    I dismissed the duplicated crew, thinking that it would dismiss the clones as well as the original crew members too. So, when I dismiss them, the copies remained. No problem. Teleport to Outpost and came back to the ship. The supposed copies are still there. What a strange thing, doesn't that? I went to the AI console just to see if it recognise the crew members and yes, it recognise them, so the dismissed ones were the copies and now everything is in order.
    I will still let the -debug flag, just in case it would happend again.
    Hope this strange story could help anyone.
     
  8. lornlynx

    lornlynx Cosmic Narwhal

  9. LordBaconator

    LordBaconator Scruffy Nerf-Herder

    What you guys are looking for is almost certainly an exception thrown when a crew member loads planet side and then crashes and is killed by the world.
    ___
    I don't have a solution to this but I've worked enough with NPCs to give some context on how the system is supposed to work. My word is not definitive and I am just providing information. I could be slightly wrong on some areas.

    In general I am just providing this so that you guys know what not to look for.
    ___
    Crew members are attached to ship storage data. When you reload the ship the game reloads the crew members stored in the ship storage.

    When crew members fail to find you on a planet or cannot follow you for whatever reason their default behavior is to teleport back to the ship. When the crew member returns to the ship after such a failure it thinks everything is perfectly normal and try to delete itself from the ship storage or change its entity id information or anything. This is why when you dismiss a newly generated clone crew member the old one will return and re-occupy the space it used to have. The NPC still thinks it correctly belongs to the ship and you actually have two identical NPCs that think the exact same thing about how they're supposed to exist in relation to the ship.

    Crew members also die and respawn repeatedly in their life time. Every time a crew member teleports they are technically "killed" and preserved by the game so that they can be respawned as soon as the world is ready.

    I think the reason the NPCs get duplicated is because they teleport back to the ship in a way that causes the ship data to not match up correctly with the entities that are actually present. The duplication happens because it actually still thinks the crew member that returned to the ship is still alive on the planet and needs to follow the player back to their ship. Then it respawns a new copy of the entity from the ship storage.

    Alternatively it could be a failing in the ship storage code to correctly handle entities that temporarily do not exist because they have crashed on the planet. When entities crash the game attempts to kill them and they typically vanish in a puff of smoke. If the game kills the entity within the context of the loaded world it could easily confuse the ship storage.
     
    QuantumProjects likes this.
  10. QuantumProjects

    QuantumProjects Star Wrangler

    @LordBaconator , I've noticed from one of the debug-level logs that the game is saving its data state while an exception is being processed. That could also be the cause of the bug.
     
  11. QuantumProjects

    QuantumProjects Star Wrangler

Share This Page