Page 1 of 1

[kovarex] [1.1.34] Upgrading underground belt twice does not upgrade other side

Posted: Mon Jun 14, 2021 7:40 pm
by AjayGhale
So, i think this is a bug. Actually I play Space Ex+ K2 , but I think its a core mechanism so...
I have an upgrade planner for belt. Everything yellow to red, then every red to blue (splitters, undergrounds too).
All the color upgrades in one planner.
The problem is, if I select a pair of underground yellow belt, to make it red, and before the bots upgrade it, I select only 1 side of the underground belt, to upgrade it again to blue, it will be then marked for upgrade, the bots do it, but only 1 selected side of the pair. After this the pair will be not a pair anymore. If I select the other side to be upgraded too, they make it, and it will connect up again.

Question: Isnt it better to mark both sides to upgrade instead of one? Also if I have belt braiding it can mix up everything.

Re: Underground Belt Upgrade

Posted: Mon Jun 14, 2021 7:46 pm
by Xoriun
I'm really interested what the answer will be here as there is a similar behavior when deleting the upgrade on only one of the sides. One side will be upgraded, the other one stays and they are disconnected.
There were bugreports about that (96480, 95772, 70011) which were flagged as 'works as intended'. But I (and others) really don't see any cases where this would be desired.

Re: Underground Belt Upgrade

Posted: Mon Jun 14, 2021 7:51 pm
by AjayGhale
Yeah, I read that, but this is not cancelled upgrade. This is a double upgrade. Or If u play modded, u have 4-5-6 different belt speeds, so......

Re: [kovarex] [1.1.34] Upgrading underground belt twice does not upgrade other side

Posted: Tue Jun 15, 2021 4:26 pm
by kovarex
Thanks for the report, it is now fixed for the next release.

Re: [kovarex] [1.1.34] Upgrading underground belt twice does not upgrade other side

Posted: Tue Jun 15, 2021 5:38 pm
by Xoriun
Just curious: Was only the additional-upgrade-bug fixed or was the 'cancel-bug/feature/inconsistency/however you want to call it' changed as well?

Re: [kovarex] [1.1.34] Upgrading underground belt twice does not upgrade other side

Posted: Tue Jun 15, 2021 7:36 pm
by AjayGhale
Hell yeah brother, Im the best. I found a bug in this world'sbest game :D:D

ps. I think the cancelling thing is intended, so only the real upgrade will be fixed.

Re: [kovarex] [1.1.34] Upgrading underground belt twice does not upgrade other side

Posted: Tue Jun 15, 2021 9:48 pm
by kovarex
All combination of ghost/non-ghost on left/right upgrade/downgrade side should work, and it always takes the final upgrade into consideration when deciding whether it is connected or not for the sake of this logic.

For those who might be curious, I tend to do these kind of tests when fixing bugs like this.

Code: Select all

  TestScenario scenario(CreatePlayer::Yes);
    setupUpgradePlanner(scenario);
    MapPosition leftPosition(-2.5, 0.5);
    MapPosition rightPosition(2.5, 0.5);
    for (GhostMode leftMode : {GhostMode::False, GhostMode::True})
      for (GhostMode rightMode : {GhostMode::False, GhostMode::True})
        for (bool upgradeLeft : {false, true})
        {
          auto checkBoth = [&](const char* name)
          {
            CHECK_EQUAL(scenario.getEntity(leftPosition)->getUsefulEntity()->getUpgradeTargetIDWithFallback()->name, name);
            CHECK_EQUAL(scenario.getEntity(rightPosition)->getUsefulEntity()->getUpgradeTargetIDWithFallback()->name, name);
          };

          scenario.addEntity("underground-belt", leftPosition, leftMode, Direction::East);
          scenario.addEntity("underground-belt", rightPosition, rightMode, Direction::West);
          scenario.perform(InputAction::Upgrade, ActionData::SelectUpgradeData(BoundingBox(upgradeLeft ? leftPosition : rightPosition, 1)));
          checkBoth("fast-underground-belt");
          scenario.perform(InputAction::Upgrade, ActionData::SelectUpgradeData(BoundingBox(upgradeLeft ? leftPosition : rightPosition, 1)));
          checkBoth("express-underground-belt");
          scenario.perform(InputAction::Upgrade, ActionData::SelectUpgradeData(BoundingBox(upgradeLeft ? leftPosition : rightPosition, 1), UpgradeMode::Downgrade));
          checkBoth("fast-underground-belt");
          scenario.perform(InputAction::Upgrade, ActionData::SelectUpgradeData(BoundingBox(upgradeLeft ? leftPosition : rightPosition, 1), UpgradeMode::Downgrade));
          checkBoth("underground-belt");
          scenario.clearEntities();
        }
Edit: But ... right, I considered upgrade and downgrade, but not cancel upgrade, which is still broken. Omg this game is complicated :)

Re: [kovarex] [1.1.34] Upgrading underground belt twice does not upgrade other side

Posted: Tue Jun 15, 2021 10:47 pm
by Xoriun
@kovarex Just to clarify: is the current cancle upgrade behavior intended or not?
In the above mentioned bugreports it was always marked a 'works as intended' but you just said it was unintended/bug.
I'd be glad to file this as a new bugreport.

Re: [kovarex] [1.1.34] Upgrading underground belt twice does not upgrade other side

Posted: Tue Jun 15, 2021 11:33 pm
by kovarex
Xoriun wrote: Tue Jun 15, 2021 10:47 pm @kovarex Just to clarify: is the current cancle upgrade behavior intended or not?
In the above mentioned bugreports it was always marked a 'works as intended' but you just said it was unintended/bug.
I'd be glad to file this as a new bugreport.
It was marked as working as intended, but I disagree. Since the fix is not really complicated, it just makes sense for the bost ends to "stay together" when possible.
No need to file another bug report, the fix is going to happen.

Re: [kovarex] [1.1.34] Upgrading underground belt twice does not upgrade other side

Posted: Wed Jun 16, 2021 5:24 pm
by Xoriun
I just checked the behavior in 1.1.35:
The reported bug is fixed but the cancel bug is still in the game.
Also, upgrading a pair of ug-belt by only selecting one of them doesn't work at all in editor mode (is this intentional or new report?).

Re: [kovarex] [1.1.34] Upgrading underground belt twice does not upgrade other side

Posted: Mon Jun 21, 2021 6:42 pm
by kovarex
The cancel part is now fixed for 1.1.35

Re: [kovarex] [1.1.34] Upgrading underground belt twice does not upgrade other side

Posted: Mon Jun 21, 2021 8:18 pm
by Xoriun
Awesome, thanks!!