Skip to content

Feature/entity info#343

Open
ThePyrotechnic wants to merge 5 commits intodevelopfrom
feature/entity-info
Open

Feature/entity info#343
ThePyrotechnic wants to merge 5 commits intodevelopfrom
feature/entity-info

Conversation

@ThePyrotechnic
Copy link
Copy Markdown

@ThePyrotechnic ThePyrotechnic commented Mar 23, 2026

The gist of it:

  • Add a new download_files method to DepotDownloader that can be used to download arbitrary files from the Deadlock depots
  • Add a new parse_map flag (default False)
  • Use that to selectively download the midtown VPK
    • Note that this requires Steam creds (and Deadlock access), same as with the localization stuff
  • Create a new GameMapParser class
    • This relies on another new CLI param, entity_helper_cmd, which points to a DeadlockEntityHelper binary
    • The new parser class feeds the downloaded map into the EntityHelper binary and uses the results to generate crate and statue plots
    • This adds a dependency on matplotlib
  • Integrate the new parser into the parser.py workflow

Ultimately this results in a two outputs:

  • a new json output, called midtown-metadata.json. It's just the breakable counts for now.
  • a new folder in the output, called assets. This is where I place the generated plots

TODO

  • Integrate this into the github workflow
  • Get the resulting json and images onto the wiki

I tried to follow the existing conventions / control flow as best I could, but please do suggest changes.

Parsed data in deadlock-data PR - Reopen deadbot PR or run deploy workflow for this branch here to reparse the data

@hassayag
Copy link
Copy Markdown
Member

Great contribution! Just getting going with trying to run it
Downloaded the latest release of entity helper, and running the command returns this

wsl ../DeadlockEntityHelper extract --verbose ./game-data/game/citadel/maps/dl_midtown.vpk citadel_breakable_prop_wooden_crate initial_spawn_time_override double scales vector3 origin vector3

File does not exist: 'extract'.
Unrecognized command or argument 'citadel_breakable_prop_wooden_crate'.
Unrecognized command or argument 'initial_spawn_time_override'.
Unrecognized command or argument 'double'.
Unrecognized command or argument 'scales'.
Unrecognized command or argument 'vector3'.
Unrecognized command or argument 'origin'.
Unrecognized command or argument 'vector3'.

Description:
  Deadlock Entity Helper

Usage:
  DeadlockEntityHelper <vpk-file> <subclass> [options]

Arguments:
  <vpk-file>  The path to the midtown VPK file
  <subclass>  The entity subclass to filter for

Options:
  -v, --verbose   Enable verbose logging.
  --version       Show version information
  -?, -h, --help  Show help and usage information

Not sure if this is a quirk of windows WSL, but let me know if you can help resolve it

@ThePyrotechnic
Copy link
Copy Markdown
Author

ThePyrotechnic commented Mar 25, 2026

@hassayag
Nice - I uploaded an old binary to the release :D
Fixed: https://github.com/deadlock-wiki/DeadlockEntityHelper/releases/tag/v1.0.1
If you run DeadlockEntityHelper --version it should show 1.0.1+6ed27b9ce7e1cb27d1dd2f44a06b85830f3948ca

@ThePyrotechnic
Copy link
Copy Markdown
Author

ThePyrotechnic commented Mar 25, 2026

NOTE: The commit I just added (29e5c44, above this comment) requires the v2 binary for DeadlockEntityHelper, which I just published:
https://github.com/deadlock-wiki/DeadlockEntityHelper/releases/tag/v2.0.0

> ./DeadlockEntityHelper --version     
2.0.0+e12a4e51023dea6693958fd1c8e284a3c250db1f

Copy link
Copy Markdown
Member

@hassayag hassayag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Managed to get it all working now, you'll see I've committed a change to use the process util and added some supprot for Windows WSL, as myself and other devs do (unfortunately) often use Windows

Other changes needed are any docker and github actions changes. Is that something you're able to handle? Happy to help if not

return json.loads(helper_output)


class _ImageHandler(HandlerBase):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be in its own file

Comment on lines 37 to +45
@@ -39,17 +41,25 @@ def main():
# non-english localizations are imported using depot downloader
if not args.english_only:
logger.info('Downloading non-english localizations...')
DepotDownloader(
output_dir=args.workdir,
deadlock_dir=args.dldir,
depot_downloader_cmd=args.depot_downloader_cmd,
steam_username=args.steam_username,
steam_password=args.steam_password,
force=args.force,
).run(args.manifest_id)
depot_downloader = init_depot_downloader(args)
depot_downloader.run(args.manifest_id)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the generic file downloader. I would suggest we have this be able to take in both the files and file_list_path. Something like this would simplify the logic and handle the entire download in a single process

Suggested change
if args.import_files:
logger.info('Importing game files...')
script_path = os.path.join(os.path.dirname(__file__), 'steam/steam_db_download_deadlock.sh')
run_process(script_path, name='download-deadlock-files')
# non-english localizations are imported using depot downloader
if not args.english_only:
logger.info('Downloading non-english localizations...')
depot_downloader = DepotDownloader(
output_dir=args.workdir,
deadlock_dir=args.dldir,
depot_downloader_cmd=args.depot_downloader_cmd,
steam_username=args.steam_username,
steam_password=args.steam_password,
force=args.force,
)
files=[]
if args.parse_map:
files.append('game/citadel/maps/dl_midtown.vpk')
depot_downloader.download_files(
files=files
file_list_path='files_to_download.txt'
manifest_id=args.manifest_id,
logger_name='download-map',
)

exceptions.txt
dist
game-data
poetry.toml No newline at end of file
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is poetry.toml relevant anywhere? Doesn't exist on my end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants