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

dictionary entities that actually contain definitions #2151

Open
byorgey opened this issue Sep 21, 2024 · 2 comments
Open

dictionary entities that actually contain definitions #2151

byorgey opened this issue Sep 21, 2024 · 2 comments
Labels
Z-Feature A new feature to be added to the game.

Comments

@byorgey
Copy link
Member

byorgey commented Sep 21, 2024

I am not exactly sure what this should look like, but I'm creating this issue as a place to discuss + think about it.

Currently you need a dictionary device equipped in order to create definitions with let or def. However, dictionary entities otherwise don't do much. In particular:

  1. You do not need a dictionary equipped in order to use definitions which are in scope. This has always felt a bit strange to me. In particular, suppose robot A has a dictionary equipped and makes a bunch of defs, then builds robot B. Robot B will inherit the environment from its parent robot A, and can use any of the definitions created by robot A, even without a dictionary equipped (though it cannot make new definitions of its own). It might be worth considering requiring a dictionary device to be installed on robot B in order for it to be able to use definitions; intuitively, it would be as if robot A has to literally make a copy of its own dictionary and hand it off to the newly built robot, or else robot B will not know how to carry out its instructions.

  2. What if dictionary entities could literally contain an environment of definitions? So if you found a dictionary lying around on the ground and picked it up, you would learn new definitions. Definitely some issues to be worked out around scoping + shadowing (e.g. what if you had defined foo but then picked up a dictionary which, unbeknownst to you, also defined something named foo that shadowed your own foo?), but this could be a fun mechanic.

@byorgey byorgey added the Z-Feature A new feature to be added to the game. label Sep 21, 2024
@xsebek
Copy link
Member

xsebek commented Sep 29, 2024

Good point, I would also like for dictionaries to be more meaningful. 👍

Requiring having an installed dictionary seems reasonable. We could show a list of definitions in its description so the players understand that the dictionary "holds" the definitions.

I worry that having the entity actually store the environment would create same problems as the run command. Only base could use them safely - if it modified the environment of running robot, you would need to use C-style declarations or other hacks.

@byorgey
Copy link
Member Author

byorgey commented Oct 8, 2024

Requiring having an installed dictionary seems reasonable. We could show a list of definitions in its description so the players understand that the dictionary "holds" the definitions.

I like that idea.

I worry that having the entity actually store the environment would create same problems as the run command.

Good point, not to mention that having specific dictionary entities actually contain specific definitions would require implementing #455 first. How about this:

  • Conceptually, an equipped dictionary "stores" all the definitions currently in scope; but any dictionary entities in your inventory are (conceptually) blank.
  • When you build another robot, you copy all the definitions from your dictionary into a blank one, which you then install into the newly built robot.
  • If you place a dictionary on the ground, it will be one of the blank ones. So picking up a dictionary won't cause you to suddenly learn new definitions (as cool as that might be).
  • You can't unequip a dictionary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Z-Feature A new feature to be added to the game.
Projects
None yet
Development

No branches or pull requests

2 participants