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

Suggest required entities #342

Closed
xsebek opened this issue May 28, 2022 · 1 comment · Fixed by #373
Closed

Suggest required entities #342

xsebek opened this issue May 28, 2022 · 1 comment · Fixed by #373
Labels
C-Low Hanging Fruit Ideal issue for new contributors. L-Capability checking Capability checking determines which capabilities are required by a given piece of code. S-Nice to have The bug fix or feature would be nice but doesn't currently have much negative impact. Z-User Experience This issue seeks to make the game more enjoyable to play.

Comments

@xsebek
Copy link
Member

xsebek commented May 28, 2022

Currently, the exception thrown when the robot is missing some capability looks like this:

│ ───────────────────Log────────────────── │
│                                          │
│ missing device(s) needed to execute      │
│   command 'blocked'                      │
└──────────────────────────────────────────┘

Some commands are obvious, like drill requiring drill, others like blocked requiring scanner should be probably mentioned in the exception message.

In my mind there are three cases:

  1. The player knows the necessary entity but the base/robot does not have it.
  2. The player does not know the required entity.
  3. There is no entity that the player could obtain to gain the capability (e.g. the CGod capability).

Giving a nice message to each of those cases could be slightly harder, but would IMO help beginners a lot.

@xsebek xsebek added Z-User Experience This issue seeks to make the game more enjoyable to play. C-Low Hanging Fruit Ideal issue for new contributors. S-Nice to have The bug fix or feature would be nice but doesn't currently have much negative impact. L-Capability checking Capability checking determines which capabilities are required by a given piece of code. labels May 28, 2022
@byorgey
Copy link
Member

byorgey commented Jun 1, 2022

Yes, I have thought about this before, thanks for opening a ticket. In theory it shouldn't be too hard to write some code to do reverse lookup of the device(s) that could provide a given capability. And I like your categorization of the different cases that could cause this.

@xsebek xsebek mentioned this issue Jun 10, 2022
xsebek added a commit to xsebek/swarm that referenced this issue Jun 12, 2022
@mergify mergify bot closed this as completed in #373 Jun 14, 2022
mergify bot pushed a commit that referenced this issue Jun 14, 2022
- add iron ore, iron mine and iron vein (closes #93)
  - split gear into iron/wooden gear
  - add metal drill
  - add faster recipes with the metal drill
- add compass (closes #341)
- handle multiple entities providing the same capability
  - try to find if the robot has at least one entity providing the capability
  - when no entity could provide the capability rejects it too
- list required devices in the `Incapable` error (closes #342)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Low Hanging Fruit Ideal issue for new contributors. L-Capability checking Capability checking determines which capabilities are required by a given piece of code. S-Nice to have The bug fix or feature would be nice but doesn't currently have much negative impact. Z-User Experience This issue seeks to make the game more enjoyable to play.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants