Skip to content

Add available recipes help #441

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

Merged
merged 15 commits into from
Jun 22, 2022
Merged

Add available recipes help #441

merged 15 commits into from
Jun 22, 2022

Conversation

TristanCacqueray
Copy link
Collaborator

This change adds a new help panel with the list of recently acquired recipes.

Fixes #436

@TristanCacqueray TristanCacqueray marked this pull request as draft June 19, 2022 23:27
@TristanCacqueray TristanCacqueray marked this pull request as ready for review June 20, 2022 01:05
@TristanCacqueray
Copy link
Collaborator Author

I'd be happy to implement this differently, but that seems to work as expected.

Copy link
Member

@byorgey byorgey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks really cool so far! A few general comments:

  • At the start of the game, when there are no recipes available, pressing F2 seems to open a tiny empty dialog box in the middle of the screen.
  • I think recipes should become available as soon as we know about an entity, not just as soon as we actually have one. When I started a new classic game and sent a robot to scan a tree, no recipes showed up. But when I sent a robot to actually fetch a tree, then the recipe showed up.
  • The recipes don't seem to be updated when I obtain an entity via the create command. (See, this is exactly what I meant about forgetting to call updateAvailableRecipes in all the right places.)
  • I think the recipe dialog should put a blank line between recipes to make it easier to tell them apart.
  • Recipes seem to be stretched across the entire available horizontal space which makes them difficult to read.
  • What will happen when the available recipes dialog gets bigger than the screen?
  • I'd like some way in the available recipes dialog to tell which recipes are new/unread. Maybe a horizontal red line separating the new ones from the old ones?

@TristanCacqueray
Copy link
Collaborator Author

Thank you for the detailed review @byorgey , really appreciate it!

* At the start of the game, when there are no recipes available, pressing F2 seems to open a tiny empty dialog box in the middle of the screen.

The dialog is disabled when no recipes are available: 368f2c3.

* I think recipes should become available as soon as we _know_ about an entity, not just as soon as we actually have one.  When I started a new classic game and sent a robot to scan a tree, no recipes showed up.  But when I sent a robot to actually fetch a tree, then the recipe showed up.

The list is updated on scan too, but I wonder if that is desirable: scan may be used in bulk, and I think it would be better to wait for an actual entity acquisition. 66574c4

* The recipes don't seem to be updated when I obtain an entity via the `create` command. (See, this is exactly what I meant about forgetting to call `updateAvailableRecipes` in all the right places.)

That's odd, it should have worked... Perhaps you were missing an installed devices?

* I think the recipe dialog should put a blank line between recipes to make it easier to tell them apart.

Done in e919ef0

* Recipes seem to be stretched across the entire available horizontal space which makes them difficult to read.

Fixed in 44576ac

* What will happen when the available recipes dialog gets bigger than the screen?

143d8e0 adds a viewport to enable scrolling.

* I'd like some way in the available recipes dialog to tell which recipes are new/unread.  Maybe a horizontal red line separating the new ones from the old ones?

Done in e919ef0, though I wasn't able to change the line color.

@byorgey
Copy link
Member

byorgey commented Jun 20, 2022

wonder if that is desirable: scan may be used in bulk, and I think it would be better to wait for an actual entity acquisition

Hmm, I think I disagree. It's a bit difficult to scan all that many things at once in the beginning of the game, and knowing there are things I can make or do with the entities I just learned about is great incentive to go get some.

@TristanCacqueray
Copy link
Collaborator Author

Alright, that works for me. Then I think the PR is now ready for review again, I believe it's working as expected.

@byorgey
Copy link
Member

byorgey commented Jun 21, 2022

Thanks for addressing all those things, this is coming along nicely.

Unfortunately it still doesn't seem to be working quite right for me. I got a tree and it told me about a recipe to make branch + log; I made branches and it told me about the recipe to make a branch predictor. So far so good.... except that since I also obtained a log from that make "branch", I would have expected it to also tell me about new available recipes to make a logger or boards out of a log. I guess it is only looking at the explicit argument to make, instead of all the products of the recipe? I later did create "log" and then the log recipes showed up.

I then switched into creative mode and did create "furnace", which I expected to make several more recipes available (at that point I had LaTeX and sand, so it should have enabled recipes for glass and rubber), but I didn't get any.

I still find the recipes are hard to read because they are very wide. Can we add some blank space on either side of the recipes (i.e. with padLeftRight 8 or something like that)?

@TristanCacqueray
Copy link
Collaborator Author

I see, the update only considered the given Make entity, not the recipe by-products. This should now be fixed with 155c64d (along with the padding).

For the recipes enabled by install-able entities such as the furnace, they only appears after the device is installed. I don't mind changing the logic, and it would be simpler (e.g. we could consider every discovered entities to be already installed), but perhaps it would be better to wait for the player to actually installed the device, presumably after reading its description.

@byorgey
Copy link
Member

byorgey commented Jun 21, 2022

I see, the update only considered the given Make entity, not the recipe by-products. This should now be fixed with 155c64d (along with the padding).

Works great now! And looks much better with the padding. I personally would also prefer a blank line between the top of the dialog box and the first recipe, but now we're definitely just getting into the territory of personal preferences and I'm happy to merge it either way. 😄

For the recipes enabled by install-able entities such as the furnace, they only appears after the device is installed.

Ah, I see the confusion. Furnaces don't actually need to be installed, nor do any entities listed as a required "catalyst" (i.e. centered at the top of a recipe), at least not as far as the recipe is concerned. You certainly can install a furnace, and it works either way, but it's not necessary to make those recipes. Things that need to be installed are things that provide one or more capabilities and enable commands. Perhaps this is part of the confusion: we abuse the recipe system a little bit in the case of, say, drills. The reason they need to be installed is that they provide the "drill" capability, which enables you to execute the drill command. But the drill command also interprets recipes in a special way, and the drill is listed as a catalyst both to help the player understand what the drill will do and also to conveniently record the results of using different types of drills.

@byorgey
Copy link
Member

byorgey commented Jun 21, 2022

One other thing: I think it would be nice if there was a slightly more prominent way to alert the player that they have new recipes available. A single asterisk showing up is pretty easy to miss if your eyes are looking somewhere else. I like the idea (I think @xsebek mentioned this?) of highlighting [F2] Recipes in a different color.

@TristanCacqueray
Copy link
Collaborator Author

That makes sense, today I learned furnaces do not have to be installed :-) In the last change I've also updated the styling as you suggested, though only the [F2] button is now highlighted. I don't mind extending to the whole [F2] Recipes if you prefer, but I find it less intrusive that way. Moreover, If the menu gets too crowded, we might want to remove the name altogether.

Thank you for helping me figure all that out!

Copy link
Member

@byorgey byorgey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All looks great! I like highlighting just the [F2], that seems noticeable without being too in-your-face. Thanks for your work on this great feature, I think it represents a huge jump in the playability/discoverability of the game.

As for the menu getting too crowded, I think @xsebek suggested moving all the [Fn] key shortcuts to the top left of the world, which is something we might consider. But that can wait for another PR!

@byorgey
Copy link
Member

byorgey commented Jun 22, 2022

@TristanCacqueray feel free to merge this unless there are any last-minute tweaks you want to make!

@TristanCacqueray TristanCacqueray added the merge me Trigger the merge process of the Pull request. label Jun 22, 2022
@mergify mergify bot merged commit 92c1d86 into main Jun 22, 2022
@mergify mergify bot deleted the available-recipes branch June 22, 2022 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge me Trigger the merge process of the Pull request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Available recipes and capabilities view
2 participants