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 multiple layers support for map memory #36381

Closed

Conversation

ZhilkinSerg
Copy link
Contributor

@ZhilkinSerg ZhilkinSerg commented Dec 23, 2019

Summary

SUMMARY: Infrastructure "Add multiple layers support for map memory"

Purpose of change

Allow fixing outstanding bugs with map memory. Combine Curses and Tiles code.

Describe the solution

Refactored map memory to store multiple layers.

Testing

  • move around buildings and vehicles to make sure that terrain, furniture, traps and vehicle parts are memorized properly;
  • test saving and loading of map memory files;
  • test migration/loading of legacy map memory files (when ready).

Additional context

TODO:
  • - Make necessary changes for Curses build;
  • - Update tests;
  • - Add handling for legacy .mm files;
  • - Finalize format for new .mm file;
  • - Make sure debug map preview is working correctly with the new map memory code.

@ZhilkinSerg ZhilkinSerg added [C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style Mechanics: Map Memory Performance issues, weird behavior, improvements to map memory feature 0.E Feature Freeze labels Dec 23, 2019
@ZhilkinSerg ZhilkinSerg force-pushed the refactor-map-memory branch 5 times, most recently from 0522560 to ee44d41 Compare December 23, 2019 21:26
@@ -174,7 +175,7 @@ struct level_cache {
float seen_cache[MAPSIZE_X][MAPSIZE_Y];
float camera_cache[MAPSIZE_X][MAPSIZE_Y];
lit_level visibility_cache[MAPSIZE_X][MAPSIZE_Y];
std::bitset<MAPSIZE_X *MAPSIZE_Y> map_memory_seen_cache;
std::map<map_memory_layer, std::bitset<MAPSIZE_X *MAPSIZE_Y>> map_memory_seen_cache;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #36392
I don't think we need multiple caches here, fundamentally both render modes render one tile at a time, so I think we can get away with just the one bit per tile.

@kevingranade
Copy link
Member

In an ideal world, what I'd really like to happen is the player memorizes the actual map entities instead of symbols/tiles, but THAT requires pretty much starting from scratch wiring the feature up.

@Qrox
Copy link
Contributor

Qrox commented Dec 25, 2019

Please also test if debug map preview is working correctly with the new map memory code.

@ZhilkinSerg ZhilkinSerg added the stale Closed for lack of activity, but still valid. label Mar 16, 2020
@ZhilkinSerg
Copy link
Contributor Author

Will reopen after 0.E.

@ZhilkinSerg ZhilkinSerg reopened this Apr 11, 2020
@stale stale bot removed the stale Closed for lack of activity, but still valid. label Apr 11, 2020
@ZhilkinSerg ZhilkinSerg added the stale Closed for lack of activity, but still valid. label Apr 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style Mechanics: Map Memory Performance issues, weird behavior, improvements to map memory feature stale Closed for lack of activity, but still valid.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants