Skip to content

[Info] How to Add Python Hinting Support to ViZDoom #621

@Trenza1ore

Description

@Trenza1ore

Problem to solve

Currently ViZDoom (python binding) lacks any form of hinting with modern IDEs like VS Code due to the actual code being in a compiled binary (vizdoom, vizdoom.exe, etc.)
Screenshot 2025-07-24 at 12 36 56 pm
As you can see, IDE doesn't know what is a DoomGame, so it's purely guessing that this is an undocumented function.

How to solve it?

Very simple! I have already merged a generate_vizdoom_stubs.py into the main branch as part of PR #620. Future ViZDoom versions will have typing support but for existing older versions please make use of this tool, an example has also been given in scripts folder. It was way cooler but I had to remove all the Unicode emojis so that Github Action can compile :(

To patch existing installed ViZDoom

python src/lib_python/generate_vizdoom_stubs.py -p

You can also try with -h to see the available functionalities.

Dependencies

  • pybind11-stubgen
  • (Optional) black
  • (Optional) isort
pip install pybind11-stubgen black isort

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions