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

only meet interactive robots #2262

Merged
merged 1 commit into from
Jan 5, 2025
Merged

only meet interactive robots #2262

merged 1 commit into from
Jan 5, 2025

Conversation

kostmo
Copy link
Member

@kostmo kostmo commented Jan 4, 2025

As I was trying to solve #2249, I was rather confused after trying to meet a built robot and give them an item, but the item was not delivered. It turns out that I had been meet-ing the judge robot instead.

We should distinguish between robots that are intended to be interactive or not, and only allow meet-ing an interactive robot.

@@ -276,6 +277,9 @@ inventoryHash = to (\r -> 17 `hashWithSalt` (r ^. (robotEntity . entityHash)) `h
robotKnows :: Robot -> Entity -> Bool
robotKnows r e = contains0plus e (r ^. robotInventory) || contains0plus e (r ^. equippedDevices)

isInteractive :: Robot -> Bool
isInteractive r = not $ r ^. robotDisplay . invisible && r ^. systemRobot
Copy link
Member Author

Choose a reason for hiding this comment

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

We may want to improve this heuristic, or make it an explicit "interactive" property.

For example, I don't think we ever want to meet a "growing" flower.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, I agree, growing trees, flowers, etc. are going to be a problem here. We use robots internally to simulate growth --- but from the perspective of a player that is just an implementation detail, they should not be returned by meet. This heuristic is better than nothing, but we will definitely want to improve it. I am fine with either merging this as is and making an issue to improve it later, or coming up with a better heuristic in this PR.

An explicit boolean interactive property probably makes sense, and I think it makes sense for interactive = true to be the default, but invisible system robots can still be non-interactive by default.

@kostmo kostmo marked this pull request as ready for review January 4, 2025 21:04
@kostmo kostmo requested a review from byorgey January 4, 2025 21:04
@kostmo kostmo mentioned this pull request Jan 4, 2025
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.

Good call, I think I also ran into this while developing the scenario, but I thought it was because I had creative mode turned on. I didn't realize meet made no distinctions!

@@ -276,6 +277,9 @@ inventoryHash = to (\r -> 17 `hashWithSalt` (r ^. (robotEntity . entityHash)) `h
robotKnows :: Robot -> Entity -> Bool
robotKnows r e = contains0plus e (r ^. robotInventory) || contains0plus e (r ^. equippedDevices)

isInteractive :: Robot -> Bool
isInteractive r = not $ r ^. robotDisplay . invisible && r ^. systemRobot
Copy link
Member

Choose a reason for hiding this comment

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

Yes, I agree, growing trees, flowers, etc. are going to be a problem here. We use robots internally to simulate growth --- but from the perspective of a player that is just an implementation detail, they should not be returned by meet. This heuristic is better than nothing, but we will definitely want to improve it. I am fine with either merging this as is and making an issue to improve it later, or coming up with a better heuristic in this PR.

An explicit boolean interactive property probably makes sense, and I think it makes sense for interactive = true to be the default, but invisible system robots can still be non-interactive by default.

@kostmo kostmo added the merge me Trigger the merge process of the Pull request. label Jan 5, 2025
@mergify mergify bot merged commit f5c0700 into main Jan 5, 2025
12 checks passed
@mergify mergify bot deleted the feature/meet-interactive branch January 5, 2025 02:51
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.

2 participants