-
Notifications
You must be signed in to change notification settings - Fork 13
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
Darkness objections leak out to where they don't make sense #104
Comments
So what happens is that there is no "south" in the current location. So the action is reported as failing because "It's too dark to see." In some sense, this isn't wrong. It is too dark to see in "The Middle" and maybe there is a "south" there (there is, though it doesn't matter, you have the same problem with "go west" or "take spam" or whatever) but it is too dark to see it. But what it isn't is "simplest" or "least surprising". Yes, there's a dark room nearby where we can't see if there's a "south" or not. However there's also a light room that we're currently in and we can't see any "south" there. This nearer failure is the one that is more relevant. It would be cool if we could use path length associated with an objection to select the one to report but:
I can perhaps imagine some transformation to the interface so that results and objections are associated with each other. That might be even more than we need though. If we just want to use the shortest path's objection, it would be enough to keep objections in order then do a breadth first traversal of the graph. The first objection should be associated with the shortest path (or at least tied for shortest). This doesn't deal with the problem that there is no path for "south" though. I can also imagine adding another linker which gives you things like "north", "south", etc. Notionally, these things do always exist. There may be no exit to the "south" but "south" exists regardless. Then you could have a path there but either:
I don't have a clear sense of whether either of these really makes sense, or which would be preferred though. |
If you are near enough a dark place and an action you take fails because obtain doesn't find anything then you'll get a reason that relates to darkness that doesn't make sense. If you modify example_game so that "The Middle" is dark then you can produce this:
The text was updated successfully, but these errors were encountered: