Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Robots not moved from Factory when no Robot Command Center space available even if Warehouse space is available #1264

Open
ldicker83 opened this issue Aug 21, 2022 · 6 comments
Labels
intermediate A task that doesn't require a deep understanding of the code base
Milestone

Comments

@ldicker83
Copy link
Collaborator

Title states it all.

During the update loop, if a robot that is not a truck is finished but there's no RCC space available for it, the Factory will go idle and simply won't continue until another RCC is built regardless of how much warehouse space there is.

This should instead allow robots to be moved into a warehouse which will become available to use as either 1) another RCC is built or 2) RCC command slots become available (via research or death/destruction of another robot)

@ldicker83 ldicker83 added the intermediate A task that doesn't require a deep understanding of the code base label Aug 21, 2022
@ldicker83 ldicker83 added this to the v0.9.0 milestone Aug 21, 2022
@belgianguy belgianguy changed the title Robots not moved from Factory when no RCC space available even if Warehouse space is available Robots not moved from Factory when no Robot Command Center space available even if Warehouse space is available Sep 5, 2022
@belgianguy
Copy link
Contributor

belgianguy commented Sep 5, 2022

The moving of non-truck robots happens here:

image

Indeed it can be seen that if there is no RCC space, it won't attempt to move it to a Warehouse, but just go idle:

image

Do note that the method getAvailableRobotCommand() already checks for capacity too:

image

While other Truck and non-robot Products that are finished are sent to the Warehouse:

image

So that seems to indicate that:

  • For non-truck robots, if there is no RCC space, it should just be moved to a Warehouse instead, if there is no warehouse space the factory will become idle because of no Warehouse space.
  • It is not clear when a factory then still can become idle because of RCC capacity if it's fallback is putting it in a warehouse
  • Warehouse stored robots are not available to the pool
  • If research completes that adds RCC capacity, the warehouse can be pulled (in what order? one of each round robin? First all dozers, then diggers, then miners?)
  • If a dozer/miner/digger dies, it can be replaced in the RCC pool by a warehoused robot if available (same as above, random selected, specific sequence?)
  • Can a player warehouse robots from the RCC into a Warehouse? Say he wants to store the diggers and wants to use only dozers? (or to prevent the game from pulling a robot from warehouse that is not useful at the time)?
  • A notification should be sent to the player alerting him of the lack of RCC capacity and what the fallback options are.

@belgianguy
Copy link
Contributor

belgianguy commented Sep 5, 2022

https://github.com/OutpostUniverse/OPHD/tree/storeRobotsInWarehouse first attempt at adding fallback and notification, moved warehouse store logic into its own function.

@belgianguy
Copy link
Contributor

@ldicker83 How did you envision the loading of warehoused robots into new/extra RCC capacity?

@ldicker83
Copy link
Collaborator Author

I haven't... which is why I made an issue for this.

First thought (with a foggy mind and not looking at the code) is to add a check during turn updates to handle moving robots from warehouses into command slots each turn. Seems a simple enough method.

@ldicker83
Copy link
Collaborator Author

ldicker83 commented Sep 15, 2022

  • For non-truck robots, if there is no RCC space, it should just be moved to a Warehouse instead, if there is no warehouse space the factory will become idle because of no Warehouse space.

Correct

  • It is not clear when a factory then still can become idle because of RCC capacity if it's fallback is putting it in a warehouse

Would go idle if both 1) no RCC slots available and 2) no warehouse space available

  • Warehouse stored robots are not available to the pool

Correct

  • If research completes that adds RCC capacity, the warehouse can be pulled (in what order? one of each round robin? First all dozers, then diggers, then miners?)
  • If a dozer/miner/digger dies, it can be replaced in the RCC pool by a warehoused robot if available (same as above, random selected, specific sequence?)

These are good questions. My first thought it round robin. Perhaps better is to let the player decide (e.g., a GUI window showing available command slots, available stored robots and buttons to increase/decrease pulled robots from storage).

  • Can a player warehouse robots from the RCC into a Warehouse? Say he wants to store the diggers and wants to use only dozers? (or to prevent the game from pulling a robot from warehouse that is not useful at the time)?

I hadn't thought of this but that's not a bad idea.

  • A notification should be sent to the player alerting him of the lack of RCC capacity and what the fallback options are.

Agreed.

@belgianguy
Copy link
Contributor

belgianguy commented Oct 5, 2022

I suppose this would also require a certain 'loadRobotsFromStorage' phase then when processing a new turn, in which logic replenishes the available RCC spaces with Dozers or Diggers or Miners.

  • Can the logic currently load Robots from Warehouse storage when a new RCC is completed?

The RobotPool gets increased when a new RCC becomes operational:

image

  • Two events "completing a new RCC" and "more storage available at existing RCC" should be managed by the game
  • When a robot managed by RCC dies, perhaps it's an idea to prefer replenishing by the same type into the pool if possible, and if not possible, round robin on the rest? Would require keeping state of robot(s) that died in the previous turn.
  • Manual store in/pull from storage would require a lot of additional logic including UI, perhaps that can go in a separate ticket?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
intermediate A task that doesn't require a deep understanding of the code base
Projects
None yet
Development

No branches or pull requests

2 participants