Plenty of new stuff#51
Open
edelkas wants to merge 1149 commits into
Open
Conversation
Added a special command which computes several interesting lists of levels based on their object counts, generates a screenshot of them all, and overlays the object counts with ImageMagick. I've also readded the object names to Map::OBJECTS since they're useful here.
Long ago I had coded my own histogram function and used it for the stats function, but I never updated the userlevel stats which was still using it. Now I'm able to remove the dependency.
Added searchable keywords so that navigating the utils source file is simpler, specifically jumping from one section to another, or back to the table of contents.
Classified gems in groups and sorted alphabetically for better organization
Added new dependency, and used it to fetch the video library sheet and parse it. Eventually the plan is to add video queries to outte, and perhaps incorporate them to the db.
After so many years I'm finally readding these. Videos are associated with highscoreables, players, and challenges. The video library will eventually be fetched and parsed regularly.
Use Roo gem to parse the video library, by reading the author list as well as all challenge sheets, and mapping to our internal classes (Player, Challenge, Video).
Since players from the video library do not necessarily/easily map to N++ players automatically, this new class will represent people who create N++ content, primarily via Youtube or Twitch. We may optionally associate them with their corresponding Player.
Fetching Google sheets via the regular export link is innefficient and also the conversion isn't perfect and misses data, so now we're doing it correctly via the official API, filtering the data appropriately to ignore metadata crap we don't care about. This returns a JSON file instead. Additionally, since this method requires identification via e.g. API keys in order to measure quotas and such, I've added a system to parse such keys from ENV.
Adapted the Video.update method that parses the Video Library to new JSON format that comes from the Google API, seems to be working.
Added a daily task to keep the videos up to date. Also finished polishing the updating method (detect duplicates, logging, ...)
Added a function to browse the library by specifying the highscoreable, and then navigating through the challenges, and for each challenges, through its videos. This all uses the new component system, showing sections with buttons as accessories, for which I've had to implement this functionality. Also made challenge parsing more flexible in the process.
Polished the aspect and now videos are embedded instead of opening the browser. Also the behaviour for DMs and regular channels is different: DMs will always edit the message, but regular channels will post each video separately, since multiple people might use it simultaneously.
If there are more than 10 videos it'll use a select menu (up to 25 max) instead of sections, and if there are 0 it'll display a warning and don't actually allow to click the button. Added a button in the challenges method to go browse the videos. Also added icons (YouTube, Twitch, etc).
Forgot to remove the very old (2019-ish) original system to import videos from the library, which was manual and no longer necessary now that we fetch and parse the spreadsheet automatically
Minor changes to level names (for normalization) and data
Added a couple of fields to the mappack levels table to store the corresponding userlevel ID and whether it should be forwarded or not. This is intended for mappacks that contain already-published userlevels so they can be redirected to Metanet instead of storing a separate copy of the leaderboards locally. Added a method to automatically find the corresponding userlevel (by name), and also a way to compute distances between levels so that we can keep the best match found in case of a tie, as well as find non-exact matches to inspect them manually.
For mappack levels that are connected with a userlevel, I'm now forwarding new submitted scores to Metanet, as well as leaderboard requests. Replays get forwarded automatically already because their replay IDs aren't recognized. This has involved several subtleties that stem from the fact the game generates corrupt scores when submitting IL scores from within episode runs, which I've had to patch to ensure corrupt scores don't get pushed to Metanet boards. Also, this functionality requires to patch the requests before forwarding to Metanet, as well as patching the response before sending it back to the game (mainly to swap the level ID, but also perhaps the score, as mentioned). To aid in this, I've modified the Request class so that it's more easily editable, and now it no longer stores the original Rack env, which isn't really designed to be mutated.
Made some things a bit less strict. For instance, sheet names are now parsed via regex, and a few more errors are detected in advance. Also, exceptions are reported to Discord so I am alerted.
Arbitrary text can now be overlayed on the PNG screenshots. This requires ImageMagick since ChunkyPNG doesn't support text rendering, but it's costly to convert between both formats so we probably shouldn't do that for day-to-day screenshots. Used it for optionally showing bad matches in userlevels connected to mappack levels, so they can be compared with the naked eye, as an application.
The random function now returns a screenshot showcase of all selected samples, with their IDs overlayed.
Added a new table to store permanent score corrections that need to be applied to levels that were changed after release, specifically when gold was added or removed. This is also useful for mappack levels that differ from their userlevel counterparts only in unavoidable gold, so their scores can also be forwarded to Metanet after adjusting the scores suitably.
New slash command to browse the video library. In the process I noticed I was parsing challenge codes incorrectly, so I fixed it and made it more flexible in the process. Additionally, added a helper to find exact / partial / approximate matches in ActiveRecord classes, and another one to check if the event has been triggered by the botmaster.
When the userlevel report doesn't fit in a single message, it gets split in two pieces: one for the 0th rankings and another for the point rankings. Turns out when it gets splits I was ouputting the point rankings twice, but it had never happened until today.
On the occasion of the 2nd worldwide D-Day (Dalton Day), I've improved the command to gather the resulting mapping statistics, including adding a wrapper for graph creation, cleaning some of the graphs, fixing the bar plot, sending all attachments together, and being able to choose the year.
Assuming a mappack level with a corresponding userlevel version has only been changed by adding or removing gold, and assuming all added gold is forced and all removed gold was impossible, we can automatically calculate the score correction required to forward the scores to Metanet. The first condition can easily be checked, and we do so. The second one can't, so ONLY run this function when it's certain. In particular, filtering by date will help. Also added the ability to filter by inner ID, something necessary to prevent D-Day 2025 and D-Day 2026 level names from interferring with each other in the seeding process.
New version of D-Day UE mappack fixing two impossible gold levels. Added a function to disable forwarding manually, just for this case.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This is mainly a stylistic commit, but there's also a couple of minor functionalities added.
Main change
Added padding to name formatting and score formatting, so that most functions are aligned in columns, with two modes:
Smaller changes
Style
inne++ functions
Dev