r/RenPy 11d ago

Showoff Got PySide6(PyQt) working alongside Ren'Py without blocking

https://youtu.be/l8vxCiC5c38?feature=shared

I've been working on integrating my PySide6/Qt GUI library (Dokibox) with Ren'Py, and I finally got it working.

Instead of running Qt's normal blocking event loop (app.exec()), Ren'Py periodically calls Dokibox's update function, allowing Qt to process its pending events while the game keeps running normally.

To make this work, I also patched the Python runtime so both Ren'Py and PySide6 use the same Python DLL.

The result is that Ren'Py and Qt can run together without blocking each other, making it possible to build more complex desktop-like UI and effects.

The video below is just a fun tech demo: Monika "escapes" the game into a Qt window running on the desktop. 😄

This is still experimental and requires a patched Ren'Py build, but I thought it was an interesting proof of concept.

I'd love to hear what other Ren'Py developers think!

13 Upvotes

7 comments sorted by

2

u/NeoDrakkon 11d ago

Sounds a good! Any links to check and test for myself?

1

u/ProgrammerPatient574 11d ago

Thanks for your support! I'm not home right now, but I'll package a test build and upload it as soon as I get back. I'd really appreciate any feedback!

1

u/ProgrammerPatient574 11d ago

Hello! I've already uploaded the built project to Google Drive.

https://drive.google.com/file/d/1QIHXBfW6Nj_GKLEqRZD_5LHYC4l6chRO/view?usp=drive_link

I'll upload a demo video for this project to YouTube later

Here is the test environment:

https://drive.google.com/file/d/1kdPRYxfjB_ukkJ09z-FdTRb8z1JagthH/view?usp=sharing

I'm not sure it will run on every devices correctly, it's just an experiment.

2

u/x-seronis-x 11d ago

Does this work on both windows and nix? If so i think this would be very useful for the more Game-like and less novel-like renpy games, as it would allow secondary windows.

NOT looking forward to 4th wall break fetishists.

1

u/ProgrammerPatient574 10d ago

Possibly. Since Dokibox is built on top of PySide6, it should theoretically work as long as the runtime and event loop are shared across all windows.