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

Retractable "3D" sprites for walls etc. #60471

Merged
merged 7 commits into from Sep 1, 2022

Conversation

mlange-42
Copy link
Contributor

Summary

Interface "Retractable '3D' sprites for walls etc."

Purpose of change

Upcoming isometric tilesets offer the opportunity for a more 3-dimensional look. For a consistent perspective across terrain, furniture and monsters, walls need to have a certain height. Orthogonal tilesets could also profit from higher walls for a more consistent perspective.

3D walls, however, will obstruct other terrain, etc.:

grafik
Courtesy tileset: UlticaISO by @vetall812

This PR tries to resolve this conflict and adds the ability to change/toggle wall height using a mapped key (see GIFs below).

Describe the solution

  • In addition to the normal offset per spritesheet, add an optional offset for the retracted state
  • Add an option (cached) to toggle retracted walls, under debug
  • Add an action to make a key bind for the toggle possible
  • Adapt gfx tools Python scripts for the new properties

Things to note:

  • Retract/toggle hight seems to be a good solution, as it works well for most wall-like tiles and requires very few work by artists
  • The retracted offset is optional, and defaults to the normal offset. Existing tilesets should simply do nothing when toggled.
  • Artists can specify retracted offset on a per-sheet basis. This allows for great control over how much sprites retract.
  • Added the toggle as an option to the debug tab. Move it? Remove it from the options?
  • Did not add a default key binding

Describe alternatives you've considered

  • Use a true/false property for tilesheets and switch between normal and zero offset (less flexible)
  • Add the possibility to switch between two tilesets (normal/retracted, a lot of redundency)
  • Add the possibility for individual alternative, lowered sprites (increases tileset size)
  • Use and alpha threshold to mark sprite regions that should disappear (retracted often looks better, as it shows the top)

Testing

  • Tested the toggle ingame, with and without key binding
  • Tested compose.py with UlticaISO (thanks @vetall812)

Additional context

GIFs showing the toggle using a key binding.

retracting_walls

retracting_walls_clip
Courtesy tileset: UlticaISO by @vetall812

@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` [Python] Code made in Python Code: Tooling Tooling that is not part of the main game but is part of the repo. Info / User Interface Game - player communication, menus, etc. astyled astyled PR, label is assigned by github actions labels Aug 26, 2022
@github-actions
Copy link
Contributor

Spell checker encountered unrecognized words in the in-game text added in this pull request. See below for details.

Click to expand
  • Draw walls retracted in ISO tilesets

This alert is automatically generated. You can simply disregard if this is inaccurate, or (optionally) you can also add the new words to tools/spell_checker/dictionary.txt so they will not trigger an alert next time.

@github-actions github-actions bot added json-styled JSON lint passed, label assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Aug 26, 2022
src/cata_tiles.cpp Outdated Show resolved Hide resolved
@mlange-42
Copy link
Contributor Author

Rebased to resolve conflicts after #60283

@dseguin dseguin merged commit 3bb8e1e into CleverRaven:master Sep 1, 2022
@mlange-42 mlange-42 deleted the toggle-iso-height branch September 1, 2022 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` Code: Tooling Tooling that is not part of the main game but is part of the repo. Info / User Interface Game - player communication, menus, etc. json-styled JSON lint passed, label assigned by github actions [Python] Code made in Python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants