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

Use an enum to specify overmap tile see cost instead of a number #75432

Merged
merged 2 commits into from
Aug 6, 2024

Conversation

ehughsbaird
Copy link
Contributor

@ehughsbaird ehughsbaird commented Aug 3, 2024

Summary

Infrastructure "Specify see_cost for overmap terrain with an enum instead of an integer"

Purpose of change

5e1c99a fixes an accident made in e44c61f

Following #75236, overmap vision needs adjustment. Using an enum makes it easier to tweak and tune the system, as the categories correspond to physical characteristics of the overmap terrains and what numeric values they correspond to can be swiftly tweaked.

Describe the solution

Replace all instances of see_cost": [0-9] with an enum. Add the enum and handling for it, and update documentation.

name role
"all_clear" This tile has no or minimal horizontal obstacles and can be seen down through
"none" This tile has no or minimal horizontal obstacles - most flat terrain
"low" This tile has low horizontal obstacles or few higher obstacles
"medium" This tile has medium horizontal obstacles
"spaced_high" This tile has high obstacles, but they are spaced and have several gaps - a forest
"high" This tile has high obstacles, but still allows some sight around it - most buildings
"full_high" This tile has high obstacles, and effectively cannot be seen through - multi-tile buildings
"opaque" This tile cannot be seen through under any circumstance

Describe alternatives you've considered

More or different enum values could be used.

Testing

The game loads with all mods enabled, and overmap vision works as expected.

@github-actions github-actions bot added <Documentation> Design documents, internal info, guides and help. [JSON] Changes (can be) made in JSON Map / Mapgen Overmap, Mapgen, Map extras, Map display Code: Tests Measurement, self-control, statistics, balancing. [C++] Changes (can be) made in C++. Previously named `Code` Monsters Monsters both friendly and unfriendly. Fields / Furniture / Terrain / Traps Objects that are part of the map or its features. [Markdown] Markdown issues and PRs Mods: Magiclysm Anything to do with the Magiclysm mod Mods: Aftershock Anything to do with the Aftershock mod Mods: Dinomod Anything to do with the Dinoclysm mod (DinoMod) Mods: No Hope Relating to the mod No Hope Mods: Defense Mode Anything to do with the Defense Mode mod Mods: Innawood 🌲 Anything to do with Innawood mod Mods: TropiCataclysm 🌴 Having to do with the tropical region mod for DDA. Mods: Desert Region Anything relating to the Desert Region mod Mods: Xedra Evolved Anything to do with Xedra Evolved Mods: Mind Over Matter Mods: Sky Island Anything about the Sky Island mod Mods: Backrooms Mods: Isolation Protocol ☣ The total conversion mod Isolation Protocol Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels Aug 3, 2024
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Aug 5, 2024
Using an enum makes it easier to tweak and tune the system, as the
categories correspond to physical characteristics of the overmap
terrains and what numeric values they correspond to can be swiftly
tweaked.
@ehughsbaird
Copy link
Contributor Author

The new push rebases the PR and adds a see_cost to the terrain from #75381 so the game won't stop loading when this PR is merged.

@Maleclypse Maleclypse merged commit fd4d1a9 into CleverRaven:master Aug 6, 2024
21 of 27 checks passed
@ehughsbaird ehughsbaird deleted the see-cost-enum branch August 6, 2024 05:41
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: Infrastructure / Style / Static Analysis Code internal infrastructure and style Code: Tests Measurement, self-control, statistics, balancing. <Documentation> Design documents, internal info, guides and help. Fields / Furniture / Terrain / Traps Objects that are part of the map or its features. [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions Map / Mapgen Overmap, Mapgen, Map extras, Map display [Markdown] Markdown issues and PRs Mods: Aftershock Anything to do with the Aftershock mod Mods: Backrooms Mods: Defense Mode Anything to do with the Defense Mode mod Mods: Desert Region Anything relating to the Desert Region mod Mods: Dinomod Anything to do with the Dinoclysm mod (DinoMod) Mods: Innawood 🌲 Anything to do with Innawood mod Mods: Isolation Protocol ☣ The total conversion mod Isolation Protocol Mods: Magiclysm Anything to do with the Magiclysm mod Mods: Mind Over Matter Mods: No Hope Relating to the mod No Hope Mods: Sky Island Anything about the Sky Island mod Mods: TropiCataclysm 🌴 Having to do with the tropical region mod for DDA. Mods: Xedra Evolved Anything to do with Xedra Evolved Monsters Monsters both friendly and unfriendly.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants