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

Sensing position of met robots #1535

Closed
kostmo opened this issue Sep 17, 2023 · 4 comments · Fixed by #1541
Closed

Sensing position of met robots #1535

kostmo opened this issue Sep 17, 2023 · 4 comments · Fixed by #1541
Assignees
Labels
L-Commands Built-in commands (e.g. move, try, if, ...) in the Swarm language. Z-Feature A new feature to be added to the game.

Comments

@kostmo
Copy link
Member

kostmo commented Sep 17, 2023

There are now a lot of entity sensing commands (related: #1171), but a dearth of robot-sensing commands.

Define a new command named ping for obtaining relative coordinates to an already met robot (i.e., you have obtained a "reference" to that robot). This command would be enabled by a transponder device (perhaps, required by both robots).

The physical justification/rationale could be that initially meeting "face-to-face" allows exchange of "transponder codes" between friendly robots.

This may call for a new Robot attribute that distinguishes between robots that are "friendly" or not. Perhaps we should not be allowed to give items to an unfriendly robot.

Avoiding "instantaneous communication" loophole

This functionality should have a limited range so that information can not be leaked over great distances.

@kostmo kostmo added Z-Feature A new feature to be added to the game. L-Commands Built-in commands (e.g. move, try, if, ...) in the Swarm language. labels Sep 17, 2023
@xsebek
Copy link
Member

xsebek commented Sep 17, 2023

Maybe the robots that share the same ancestors are friendly?

For other robots, we could have a handshake system where the robots have to mutually meet (within some timeout). A game state map of initiated handshakes in the last tick(s) could be checked when meeting robots and if the handshake is completed we would update those robots friendly set.

@byorgey
Copy link
Member

byorgey commented Sep 17, 2023

Why does it require keeping track of "friendly" robots? Simply requiring an actor value as argument to the ping command sounds great.

As for keeping track of friendly robots, see #462 and #506.

@kostmo
Copy link
Member Author

kostmo commented Sep 18, 2023

Why does it require keeping track of "friendly" robots?

In the adversarial case, I might not want the base to continuously know the position of the "bad guy" just due to having "met" him once in passing.

Though, perhaps there is a case for an alternate command, track, that might allow such a thing despite being an adversary, as if an AirTag were stealthily slipped into their pocket...

@byorgey
Copy link
Member

byorgey commented Sep 18, 2023

Re: limited range, see RobotRange and the comments on the focusedRange function: https://github.com/swarm-game/swarm/blob/main/src/Swarm/Game/State.hs#L868-L901.

In the adversarial case, I might not want the base to continuously know the position of the "bad guy" just due to having "met" him once in passing.

I guess that makes sense, I'm just trying to prevent unnecessary complexity.

@kostmo kostmo self-assigned this Sep 19, 2023
@kostmo kostmo mentioned this issue Sep 20, 2023
@mergify mergify bot closed this as completed in #1541 Sep 24, 2023
mergify bot pushed a commit that referenced this issue Sep 24, 2023
Closes #1535
# Demo

    scripts/play.sh -i scenarios/Testing/1535-ping/1535-in-range.yaml --autoplay
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
L-Commands Built-in commands (e.g. move, try, if, ...) in the Swarm language. Z-Feature A new feature to be added to the game.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants