-
Notifications
You must be signed in to change notification settings - Fork 52
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
robot background passthrough #1672
base: main
Are you sure you want to change the base?
Conversation
9af3d35
to
6402249
Compare
f74bace
to
fcd9a75
Compare
Towards #1662 Prerequisite for #1672 To allow a robot-occupied cell to take on the underlying terrain color as the background color of its cell, the terrain color must be representable strictly as a "background". However, currently, the `dirt`, `stone`, and `grass` terrains are represented by a half-shaded **foreground** glyph upon `black` background. Currently the ["Medium Shade" unicode character](https://www.compart.com/en/unicode/U+2592) (`▒`) is used to "blend" a somewhat bright color with a black background, resulting in a moderately dark color in the terminal for `dirt`, `stone`, and `grass`. However, these same dark colors are not reproducible in the 240-color scheme without this foreground+background blending trick; the closest approximations as a background-only or foreground-only color come out quite a bit lighter. ## Visual comparison Using: scripts/play.sh -i creative --seed 2 --autoplay | Before | After | | --- | --- | | ![Screenshot from 2023-12-03 23-33-15](https://github.com/swarm-game/swarm/assets/261693/edeeaeac-13e0-4641-9822-773fdb20f1d4) | ![Screenshot from 2023-12-03 23-32-36](https://github.com/swarm-game/swarm/assets/261693/ae5a5b5d-aa69-4580-b7e1-85eec21b4aeb) | ## Possible approaches So, we need to decide whether to: 1. Accept the new lighter colors 2. Choose new, alternative terrain colors that may be darker given the 240-color palette 3. Abandon support for 240 colors and assume "full" color terminals 4. Abandon efforts to passthrough terrain color as background of robot cells
fcd9a75
to
673eeb9
Compare
673eeb9
to
44af2f6
Compare
c83db52
to
2bb17a2
Compare
2bb17a2
to
07fcc24
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure why, but with this PR it seems like all robots now look like Ω
. (Edited to add: just kidding, it seems like that is already the case on main
. I guess we did not test some previous PR enough... filed #1693 to track this issue.)
What is the advantage of doing this only for robots (as opposed to for entities as well)? It seems like we needed to add various special cases (displayObscured
, etc.) to get it to work only for robots, rather than just generically changing the way Display
s combine.
YAML syntax in this file was actually fixed in #1672, which is not yet merged. Cherry-pick that fix as well as enhancements to the scenario. Towards #845. Aside from fixing the syntax for #1706 (comment), this provides a good "before" example to showcase the fix in #1672. scripts/run-tests.sh --test-arguments '--pattern "1034-custom-attributes"' and scripts/play.sh -i data/scenarios/Testing/1034-custom-attributes.yaml --autoplay --speed 1 ![Screenshot from 2024-01-04 16-46-53](https://github.com/swarm-game/swarm/assets/261693/5e5a4435-1a36-4f59-bd6f-639c065baf2d)
Closes #1662
Demo
Using:
Also: