-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Unlimited map memory #47253
Unlimited map memory #47253
Conversation
Obsoletes #47079. Thanks so much! |
Not totally obsoleted, this doesn't actually touch the traits that try to manipulate map memory capacity, but it does remove the code that makes them do anything. |
True. I'll just pull those changes into a separate PR. |
e7616f6
to
50f1746
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.
Are you planning to merge this before release? It seems like a pretty big feature.
half_open_rectangle<point> r1( point( 0, 0 ), point( 2, | ||
2 ) ); // NOLINT(cata-use-named-point-constants) | ||
half_open_rectangle<point> r2( point( 2, 2 ), point( 3, 3 ) ); | ||
half_open_rectangle<point> r3( point( 0, 0 ), point( 2, | ||
1 ) ); // NOLINT(cata-use-named-point-constants) |
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 feel like these are cases where you could happily use point_zero
. But if you really don't want to, then I think these NOLINT
comments won't work when on the next line like this (maybe they do; looks like the error hasn't occurred yet).
This pull request introduces 1 alert when merging 50f1746 into b4ab3df - view on LGTM.com new alerts:
|
Yea as sad as it is not to put this in right away, it needs to wait for release. |
50f1746
to
5c936e6
Compare
This pull request introduces 1 alert when merging 5c936e6 into 0c1ca59 - view on LGTM.com new alerts:
|
Note: this naive implementation significantly lowers FPS
5c936e6
to
2bf8f19
Compare
Move memorized submaps that would be affected during drawing into a 2d array.
2bf8f19
to
d08b44d
Compare
Collect map::draw code in one place, simplify indexing/bound checks. Remove the "batch drawing" optimization: it doesn't help with drawing, but harms code clarity. Instead, convert all relevant draw methods to use 'wputch' and rely on caller to position the cursor properly.
d08b44d
to
89a1240
Compare
Rebased and hypothetically ready to go! |
So, in the spirit of cavalierly merging things I don't understand and that could possibly entirely break the game, since we're just a few days into a new experimental, let's see if this weird "Calvin Grenade" character actually does test things. |
This reverts commit 789c7a4.
This reverts commit 789c7a4.
* Encapsulate map::drawsq() arguments and clarify their meaning * Split map memory into submap-sized chunks Note: this naive implementation significantly lowers FPS * Optimize map memory access Move memorized submaps that would be affected during drawing into a 2d array. * Save/load memorized submaps; migrate old mm file * Remove leftovers from map memory limit * Some map memory cleanup * Don't save empty mm submaps * Deallocate far-away mm submaps on save; report save failure * Rework tests for map memory * Don't re-allocate region if old region contains required submaps * Remove map_memory.h from avatar.h * Rename memorized_submap -> mm_submap * Rename mm_submap::clean -> mm_submap::empty, add comments. * Improve drawsq_params interface * Remove map_memory.h from lru_cache.cpp * Add function for rectangle overlapping * Save mm_submaps in regions * Fix save/load not using avatar's global pos, improve docs. * When saving, compress mm_submaps using RLE * Simplify map rendering in ascii mode Collect map::draw code in one place, simplify indexing/bound checks. Remove the "batch drawing" optimization: it doesn't help with drawing, but harms code clarity. Instead, convert all relevant draw methods to use 'wputch' and rely on caller to position the cursor properly. * Memorize off-screen tiles in ascii mode * Fix copypasted code * Fix tile memory saving code, minor cleanup. * Add debug logging for tile memory operations * Fix broken saving for tile memory submaps with z != 0 * Lazy allocation for tile memory submaps Co-authored-by: olanti-p <olanti-p@yandex.ru>
* Encapsulate map::drawsq() arguments and clarify their meaning * Split map memory into submap-sized chunks Note: this naive implementation significantly lowers FPS * Optimize map memory access Move memorized submaps that would be affected during drawing into a 2d array. * Save/load memorized submaps; migrate old mm file * Remove leftovers from map memory limit * Some map memory cleanup * Don't save empty mm submaps * Deallocate far-away mm submaps on save; report save failure * Rework tests for map memory * Don't re-allocate region if old region contains required submaps * Remove map_memory.h from avatar.h * Rename memorized_submap -> mm_submap * Rename mm_submap::clean -> mm_submap::empty, add comments. * Improve drawsq_params interface * Remove map_memory.h from lru_cache.cpp * Add function for rectangle overlapping * Save mm_submaps in regions * Fix save/load not using avatar's global pos, improve docs. * When saving, compress mm_submaps using RLE * Simplify map rendering in ascii mode Collect map::draw code in one place, simplify indexing/bound checks. Remove the "batch drawing" optimization: it doesn't help with drawing, but harms code clarity. Instead, convert all relevant draw methods to use 'wputch' and rely on caller to position the cursor properly. * Memorize off-screen tiles in ascii mode * Fix copypasted code * Fix tile memory saving code, minor cleanup. * Add debug logging for tile memory operations * Fix broken saving for tile memory submaps with z != 0 * Lazy allocation for tile memory submaps Co-authored-by: olanti-p <olanti-p@yandex.ru>
Summary
Features "Make map memory unlimited"
Purpose of change
The current map memory feature utilizes a lru cache to globally store the most recently seen X tiles or symbols of map data. While helpful, this is considered by many to be very limiting.
Closes #49696
Describe the solution
Changes backported from BrightNights PRs cataclysmbnteam/Cataclysm-BN#247 cataclysmbnteam/Cataclysm-BN#252 and cataclysmbnteam/Cataclysm-BN#310
Perform streaming serialization/deserialization of map memory to disk just like with map data so that the amount of memorised map is essentially unlimited.
Testing
Navigate around world, visually checking consistency of map memory.