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

Add more granularity to overmap vision #75236

Merged
merged 4 commits into from
Jul 28, 2024

Conversation

ehughsbaird
Copy link
Contributor

Summary

Features "Add different levels of vision to the overmap"

Purpose of change

On the overmap, there is either no information about a tile, or full information. This is limited, makes scouting a fairly boring affair of going to high places with binoculars for full map information, and it gives a lot of meta information.

Describe the solution

Replace unseen/seen with five levels of vision granularity: unseen, vague, outlines, details, full.

Unseen and full (seen) work as before, but the three middle levels provide increasing amounts of information about an overmap tile as it becomes more visible.

  • vague is used to represent a quick (seconds at most) and distant scan of an area - trees look like forests, cleared land looks like fields, buildings in a city blend together, etc.
  • outlines provides a little more thorough look, and easily visible details become clear - farm fields versus unused land, type of forests/tree areas - as well as features that would previously blend in (roads, singular geographic features, etc).
  • details serves as a good look (from afar) at an area - easily recognizable areas become fully visible, but buildings in particular are not revealed fully. For time/size reasons I did not implement building types becoming clear, but I think that this is the stage at which that should happen.

To avoid spending the next year adding all these details to every overmap terrain in the game, I added an oter_vision type that specifies the display information for vague/outlines/details, and overmap terrains reference which oter_vision describes them. In this, overmap terrains can specify that at certain vision levels, they blend in with the environment, in which case the overmap terrain displayed at that tile will be replaced with one of the surrounding overmap terrains. This is used to hide roads and other details at the "vague" vision level.

Additionally, some map overlays (e.g. hordes) are hidden unless vision of a tile is details or better.

The adjustments to make the map reveal at different vision levels are pretty rough, and I think that whole thing needs to be rewritten, but I've already been working on this PR for too long. Right now it gives more and more detailed vision than I think it should (without spending a decent bit of time explicitly scouting, I think most of the map should be vague or outlines unless quite close to the player), but it can be generous until the work to improve it is done.

If you're reviewing, you may find it handy to review by commits.
The first commit does the boring work of replacing seen: true/false with an enum everywhere it's referenced. The second commit builds on that by providing the infrastructure to actually display these different vision levels differently. The third commit uses that infrastructure to provide vision levels to all/most of the overmap tiles in the game. The fourth commit just lets you debug reveal the overmap at any vision level.

Describe alternatives you've considered

Continuing to work on this for weeks and never publishing it. There's a bunch of decisions I made here with how to specify this information, what vision levels go with certain overmap terrains, etc. that I could second-guess forever.

Testing

Run around, explore the map, climb things, grab binoculars, etc.

Here's some maps I've got:
image
Gray, the city I started in, where I know all about what's in town.

image
Up north is Monmouth, and I can't tell what the buildings are there.

image
Over to the east and after climbing a radio tower, I can see a large building, some rural buildings, and a map I read has revealed some of a town down south.
Some roads lead off to some features that I can't see yet, because they blend in with the landscape.

image
I go over to investigate them, finding trailheads and a shooting range, and revealing more of the town (there's some large buildings near the edge)

@github-actions github-actions bot added <Enhancement / Feature> New features, or enhancements on existing <Documentation> Design documents, internal info, guides and help. NPC / Factions NPCs, AI, Speech, Factions, Ownership Info / User Interface Game - player communication, menus, etc. [JSON] Changes (can be) made in JSON Missions Quests and missions Map / Mapgen Overmap, Mapgen, Map extras, Map display Mutations / Traits / Professions/ Hobbies Mutations / Traits / Professions/ Hobbies 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 Player Faction Base / Camp All about the player faction base/camp/site labels Jul 25, 2024
@RanikOrtega
Copy link
Contributor

Quite an interesting and logical addition.

@ashGlaw
Copy link
Contributor

ashGlaw commented Jul 25, 2024

Very exciting!

@github-actions github-actions bot added astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions labels Jul 25, 2024
@ehughsbaird ehughsbaird force-pushed the going-to-california branch 2 times, most recently from 2c5e636 to d309d36 Compare July 25, 2024 21:40
@kevingranade
Copy link
Member

This looks AMAZING! Thank you so much for putting all this hard work in.

@github-actions github-actions bot added Translation I18n [Python] Code made in Python BasicBuildPassed This PR builds correctly, label assigned by github actions labels Jul 25, 2024
@Maleclypse
Copy link
Member

It looks like clang is having some warnings from this. Unless I'm misreading it?

@ehughsbaird
Copy link
Contributor Author

ehughsbaird commented Jul 27, 2024

I believe the errors (flake8, clang-tidy, the enum thing) should be fixed now. Thanks for the fix (e6381a0) to the enum issue, but I've changed it to act the same as the map display, and only count cities that have the center known at details or better. If just seen at any level is enough, I can change it back.

@github-actions github-actions bot removed the BasicBuildPassed This PR builds correctly, label assigned by github actions label Jul 27, 2024
On the overmap, there is either no information about a tile, or full
information. This is limited, and makes scouting a fairly boring affair
of going to high places with binoculars for full map information, and it
gives a lot of meta information.

Replace that with five levels of vision:
unseen, vague, outlines, details, full.

This just does the grunt work of adding the levels, and working them
through all the various places they're needed.
Now that there's different levels of overmap vision, change the
displayed map information based on it.

To reduce the load of specifying this data for all of the overmap
terrains, this is specified in a separate oter_vision type that overmap
terrains reference. For a given vision level, the name, symbol, and
color level of the terrain will be replaced with those specified in the
oter_vision it references. If the oter_vision doesn't have an entry for
that vision level, the information from the overmap terrain will be
shown. If the oter_vision specifies that it should blend with adjacent
tiles at that vision level, a suitable adjacent tile will be chosen
instead, and the information for that tile (depending on vision level)
will be shown.

The prefixing used for tileset ids is messy, but it's constrained and
the tiles overmap works.

Adjust the code that reveals tiles to reveal at these various different
levels. It's nothing exciting, and there are a lot of improvements to be
made, but it works well enough to showcase the feature.
Clean up some terrains with copy-from, and add vision levels to most of
them.

There are lots of options to add more and change these around. Here's
just a start.
Ease debugging by allowing revealing overmaps at any vision level.
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Jul 28, 2024
@Maleclypse Maleclypse merged commit d10b9fa into CleverRaven:master Jul 28, 2024
28 of 29 checks passed
@ehughsbaird ehughsbaird deleted the going-to-california branch July 28, 2024 23:56
@vetall812
Copy link
Contributor

vetall812 commented Jul 29, 2024

As a tileset creator, how can I find out what is the current tile i see? So i can draw an appropriate sprite for this (create a proper JSON file etc)
Current sidebar cant show me this:
image

Also current implementation ignoring overmap objects and use only first sprite of the object set.

@jeffplata
Copy link

jeffplata commented Aug 2, 2024

Very exciting indeed. But, can we at least make out the tallest buildings in the city? For sure, a six-storey building would stand out from the among the surrounding one or two storey houses.

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: Tests Measurement, self-control, statistics, balancing. <Documentation> Design documents, internal info, guides and help. <Enhancement / Feature> New features, or enhancements on existing Fields / Furniture / Terrain / Traps Objects that are part of the map or its features. Info / User Interface Game - player communication, menus, etc. [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 Missions Quests and missions Monsters Monsters both friendly and unfriendly. Mutations / Traits / Professions/ Hobbies Mutations / Traits / Professions/ Hobbies NPC / Factions NPCs, AI, Speech, Factions, Ownership Player Faction Base / Camp All about the player faction base/camp/site [Python] Code made in Python Translation I18n
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants