Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
4shockblast

DSDA command line application I made

Recommended Posts

I'm working on creating a Discord bot to get info from DSDA for the Doom speedrun Discord server linked in the pinned threads, so I made a Python class that extracts a lot of info from DSDA automatically. Since it wasn't much effort to do so, I also created a command line version of it for anyone not in the Discord server to use. Supported functionality by this application:
- Getting records from DSDA
- Returning some stats on players and wads (so some of the work from this thread is performed automatically :))
- Returning random wad and player pages
- Retrieving the last update date

The record getting functionality uses simple guesses I made for compatibility of each wad by parsing all wad pages and assuming the most used compatibility is the intended compatibility (unless it's mostly demos recorded with generic PrBoom or something with no complevels). The player stats functionality also does a somewhat smarter search, so it will find players by substrings. I also manually a compiled a list of player aliases I consider notable, so it will search for those too (meaning you could find Adam Hegyi's stats with "AdamH" or something). The stats that the application can return also extend beyond just total time and demo count.

You can use "help" after launching it to find the commands and, you'll need to run "sync" at first in order to get some info from DSDA cached for the commands to work. Here's some sample output for playerstats for my page:

Total demo count: 1477
Total demo time: 39:46:57
Longest demo: 02:13:26
Average demo time: 00:01:36
Total TAS demo count: 48
Average demos recorded per wad: 6
Number of distinct wads recorded for: 214
Maximum recorded wad: perdgate, 285 demos
Maximum recorded category: Pacifist, 322 demos
Here's a link to the source code, and a tentative link to a package containing an exe that should run in Windows for anyone who doesn't have Python. Suggestions for extra features/other improvements are welcome. :)

Edit: Updated links to new version with minor bugfix, thanks ClumsyDoomer.

Share this post


Link to post

Sounds good, I just hope it's not too much of a strain on the server and that Andy is okay with it. Sounds like you're accessing a lot of pages in a short time.

Share this post


Link to post
Memfis said:

Sounds good, I just hope it's not too much of a strain on the server and that Andy is okay with it. Sounds like you're accessing a lot of pages in a short time.


Yeah, I've been worrying about that too, but I think it should be fine? Except for a full sync, the rest of the commands shouldn't access too many pages. The only one that access a very large amount of pages is the full wad compatibility sync, and assuming the cache file generated by it is not deleted, all subsequent syncs should only access newly added DSDA wads.

Share this post


Link to post

Updated with new version that addresses some requests people had and some minor issues. Changelog:

Spoiler

0.1:
- Initial version
0.1.1:
- Fix crash on retrieving record for non-existent wad
0.2:
- Add prefix to input queries
- Add short versions of commands
- Handle keyboard interrupt and EOFError
- Try sanitizing wad names to remove .pk3 and .wad from end if they are added.
- Update logic for error messages to return message to CLI instead of printing it
- Will be needed for future Discord bot to properly print error output
- Update possible player list to print only if there are few possible players and sort/remove dupes
- Add changelog
- Fix LICENSE
- Update playerstats to try removing spaces and checking for the player with no spaces
- Update playerstats to print alias that was seen in case user query matches to multiple players
and there were matches to aliases

I tested most of the functionality and it should work hopefully (too lazy for automatic tests). Download Source code

Share this post


Link to post

off topic:

people are worrying about Andy's server bills? Why does he even has bills? Why dont we donate for him and his server? Imo he should not have any costs for his awesome service additionally to the time he puts into it. I would donate right away, is there a way to donate for him?

on topic:

features what I always missed on doomedsda is that you cannot see the submission or creation date of the demos. you have to painstakingly download and unzip each submission to find out which run came first. Not sure if anyone else is interested in this, but listing demos chronologically in a list not with the lmp name, but an actual readable name like doom2.wad map01 playerXY submission date.
edit: if this feature would mean the program has to download each submission to check the date, then this would cause too much traffic I guess

Share this post


Link to post
termrork said:

on topic:

features what I always missed on doomedsda is that you cannot see the submission or creation date of the demos. you have to painstakingly download and unzip each submission to find out which run came first. Not sure if anyone else is interested in this, but listing demos chronologically in a list not with the lmp name, but an actual readable name like doom2.wad map01 playerXY submission date.
edit: if this feature would mean the program has to download each submission to check the date, then this would cause too much traffic I guess


These kind of things are going to natively be a part of dsda-r; if you have more requests feel free to toss them over here: https://www.doomworld.com/vb/post/1657372

Share this post


Link to post

Yeah, doing something that requires going to too many pages on DSDA or downloading demos is not in the scope of this project. I think DSDA would need to be revamped with things like an official API and natively implement much of what this bot does before that can be done.

I made a few more improvements and minor fixes to the client to version 0.3. v0.3 changelog below:

Spoiler

- Update random wad and player URLs to return player and wad names as well
- Round average demo counts instead of integer cast (floor)
- Perform substring search for wads
- Case insensitive search for player aliases
- Skip FDAs in top category/wad results for players
- Return player name and wad name for stats searches
- Update instance variables in client to match private variable convention
- Update year in LICENSE
- Update version in CLI
- Add new alias to player aliases
- Style fixes

Full changelog in source code and exe zip files. Also, the Discord bot I mentioned in the OP is now running with this, so if you go to the Discord channel linked in the stickied threads, you can use this bot without having to run it in command line. :)

Download links:
Exe
Source code

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×