-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Describe the bug
I'm fairly sure that the memory cache is caching tiles/chunks that contain the default solid background color when a tile/chunk cannot be loaded before the maxwait timeout expires. This isn't a huge issue when someone has maxwait set to a reasonable value and isn't getting a lot of missing chunks. But even if only a few get into the cache, it isn't a good use of cache memory.
I do intend to look into this more myself at some point, but I am not super-familiar with the memory cache code. So if someone else can quickly confirm or fix, that would be great.
To Reproduce
Steps to reproduce the behavior:
- Delete all AO cache files
- Start AO and set the maxwait to the smallest possible value
- If you have the missing color PR, use that to set the color to red or something that stands out. Otherwise, be prepared to look for the default gray color.
- Start XP anywhere on the ground. Use the Free Camera (c) to look around and note that there are a lot of missing tiles, which is expected.
- Quit XP, but leave AO running (IMPORTANT)
- Start XP again in the same place and look around in the same way as step 4. Note that the same tiles are missing.
- Stop XP
- Stop AO
- Start AO
- Start XP and do the same thing as in steps 4 and 6. Note that there are far fewer or no missing tiles.
Expected behavior
There should be no missing tiles in step 6. Steps 6 and 10 should look the same.
(please complete the following information):
- OS: n/a
- XPlane Version: 12.2.1
- AutoOrtho Version 1.2.6 + PR Add control to change the missing tile color #75
- Filesystem type n/a
Additional context
Upon reaching step 6. AO should have downloaded nearly all the cache files needed for the scene. All the downloads were started and completed in step 4, but the low setting for maxwait prevented many of them from being used, resulting in a lot of tiles being filled with the missing color and cached in the memory cache as such. So a lot of the tiles are present in the FILE cache, but stored in the MEMORY cache with the solid missing color.
Leaving AO running in step 5 retains the MEMORY cache state, thus holding a lot of tiles filled with the missing color.
Restarting AO in steps 7 and 8 clears this MEMORY cache state and allows the correct tiles to be read from the FILE cache, resulting in fewer missing tiles in step 10.
If all of these observations and explanations are correct, the fix would be to simply not add a tile/chunk to the memory cache if it ended up getting filled with the missing color.