The author details their complex and manual process of scraping League of Legends match data, driven by a desire to analyze their own gameplay. Lacking a readily available API for detailed match timelines, they resorted to intercepting and decoding network traffic between the game client and Riot's servers. This involved using a proxy server to capture the WebSocket data, meticulously identifying the relevant JSON messages containing game events, and writing custom parsing scripts in Python. The process was complicated by Riot's obfuscation techniques and frequent changes to the game, requiring ongoing adaptation and reverse-engineering. Ultimately, the author succeeded in extracting the data, but acknowledges the fragility and unsustainability of this method.
The blog post explores using linear programming to optimize League of Legends character builds. It frames the problem of selecting items to maximize specific stats (like attack damage or ability power) as a linear program, where item choices are variables and stat targets are constraints. The author details the process of gathering item data, formulating the linear program, and solving it using Python libraries. They showcase examples demonstrating how this approach can find optimal builds based on desired stats, including handling gold constraints and complex item interactions like Ornn upgrades. While acknowledging limitations like the exclusion of active item effects and dynamic gameplay factors, the author suggests the technique offers a powerful starting point for theorycrafting and understanding item efficiency in League of Legends.
HN users generally praised the approach of using linear programming for League of Legends item optimization, finding it clever and interesting. Some expressed skepticism about its practical application, citing the dynamic nature of the game and the difficulty of accurately modeling all variables, like player skill and enemy team composition. A few pointed out existing tools that already offer similar functionality, like Championify and Probuilds, though the author clarified their focus on exploring the optimization technique itself rather than creating a fully realized tool. The most compelling comments revolved around the limitations of translating theoretical optimization into in-game success, highlighting the gap between mathematical models and the complex reality of gameplay. Discussion also touched upon the potential for incorporating more dynamic factors into the model, like build paths and counter-building, and the ethical considerations of using such tools.
Summary of Comments ( 26 )
https://news.ycombinator.com/item?id=43024173
HN commenters generally praised the author's dedication and ingenuity in scraping League of Legends data despite the challenges. Several pointed out the inherent difficulty of scraping data from games, especially live service ones like LoL, due to frequent updates and anti-scraping measures. Some suggested alternative approaches like using the official Riot Games API, though the author explained their limitations for his specific needs. Others shared their own experiences and struggles with similar projects, highlighting the common pain points of maintaining scrapers. A few commenters expressed interest in the data itself and potential applications for analysis and research. The overall sentiment was one of appreciation for the author's persistence and the technical details shared.
The Hacker News post "League of Legends data scraping the hard and tedious way for fun" has generated a modest discussion with a few interesting comments. The comments mostly revolve around alternative approaches to data scraping, specifically for League of Legends, and the challenges faced when relying on unofficial APIs.
One commenter points out that the Riot API, while official, can be quite limiting and slow. They suggest exploring community-driven projects like the "Champion.gg for Desktop" project, which uses undocumented APIs and has faced its share of challenges with Riot's changes. This commenter highlights the trade-off between using official, albeit limited APIs and venturing into unofficial ones that offer richer data but risk breaking with game updates.
Another commenter mentions their personal experience with scraping League of Legends data. They specifically mention difficulties encountered when dealing with the dynamic loading of elements on the League of Legends client, making traditional scraping methods tricky. They underscore the complexity involved in keeping up with the constantly evolving structure of the client.
A third comment provides a direct link to the "Champion.gg for Desktop" GitHub repository mentioned earlier in the discussion. This allows other users to readily explore the project and potentially contribute or learn from its implementation.
The discussion also briefly touches on the broader topic of web scraping ethics and legality, with one user cautiously mentioning potential terms of service violations. However, this aspect isn't explored in great detail.
Overall, the comments on the Hacker News post provide valuable insights into the challenges and considerations involved in scraping data from online games like League of Legends. They showcase the trade-offs between utilizing official APIs and resorting to unofficial methods, emphasizing the complexities that arise from dynamic content loading and constant updates from game developers. While not a lengthy or highly active discussion, the existing comments provide practical perspectives and relevant resources for anyone interested in similar data scraping endeavors.