Treasure map update, stats database migration and performance tweaks #789
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I don't truly know if this is ready to merge. In any case, the /server/database needs processing with the python script before restarting the server after merging this, and taking a full backup of both this and the servervault (for the sake of the maps changes) on the offchance that something blows up would be sensible. It seems to work okay on my end, though testing the map data transference is a little hard.
(I am happy to run the script and do this, it'd just be nice to have more eyes on the sqlite madness before merging!)
The DB caching with multiple PCs logged in is untested, because I can't really test it. It looks to work fine for one player though.
... and as usual, update notes:
Treasure map changes:
Treasure maps are now made up of two parameters. The CR (which governs loot level) and difficulty (which governs zoomed-in level). Before now, maps had only a CR, and both loot level AND zoomed-in level were tied together.
Existing maps are migrated to this new system based on their CR values and assigned a difficulty reflective of their zoomed-in-ness. Most maps will likely change their zoomed-in level slightly, but the displayed location should not have changed.
Both of these things affect loot quality. Looting a map is guaranteed to give you loot like you killed a boss in the area where you got the map, and then a bit more lesser loot. High difficulty maps are more likely to give you more boss-level rolls (which have much better odds of giving you better items).
Maps obtained from common loot (specifically this excludes Andriel and maps that generate inside map rewards containers) are now quite likely to have a solution somewhere in the areas around where you obtained them. This is not a guarantee, and there is still a reasonable chance that they might send you a long way away.
Andriel's maps always pick locations completely at random, and are now biased very heavily towards high difficulty (zoomed-in), whereas the regular drops are not. The intent is that Andriel is for those who enjoy the maps and are prepared to spend gold to get more of them - and this audience is probably better able to deal with the more difficult maps.
CR for treasure map loot is no longer increased by 50%.
Reduced the item to pure gold conversion rate from 100% to 80%.
Increased the value (and Andriel cost) of treasure maps.
Added a new flat chance to add another treasure map to the loot from existing treasure maps.
Player stats:
Optimised the player stats database writes. While the live server seemed to be fast enough to handle this okay, my local computer is not :(
Fixed the issue that caused the player stats for "Attacks of Opportunity Missed" and "Attacks of Opportunity Missed By" to merge into a single count.