There's a tool called renpy-graphviz (
You must be registered to see the links
) that could probably be used or forked to find unused labels (and thus any scenes underneath, unused).
This tool is purely useless outside of really basic visual novels. It don't detect the branching coming from a screen, nor the ones built in real time by expressions, even when they are basic.
This said, basically speaking, what you need is to know what images are effectively used.
As long as you stay on the basis, a simple text parser to get the
scene .*
and
show [^screen] .*
would already give you a list to diff with the file names.
Images used in screens would still be missing, and more difficult to catch.
For
add
it would be easy. But it would starts to be tricky with
imagebutton
that can use either some of the state attributes or
auto
. But while the last one is a built expression, you can build it from the parsed.
But it starts to be more complicate since image can also be defined through the styles, whatever inline in the screen, or through the style definition.
And of course, all this would just catch basic use. Once you starts using expressions (
scene expression "images/girls/{}/iddle_{}.jpg".format( actualGirls.name, actualGirls.clothes )
) it become really tricky and you need to manually provide the possible values to the diff script for it to not flag as not used images that are in fact used.
Even relying on Ren'Py itself wouldn't be enough.
You must be registered to see the links
, or more precisely on the set it use internally, can tell you what image have been seen. But for it to be reliable, you need to have play the whole game and followed all the possible path.
In the end, the only solution is still to plan correctly your game and to be consistent in your development. You write the draft code for the scene, and move the images from their temporary location only when it's done. You'll know exactly which ones are used, and are to move. Then when you'll polish the scene, you import/remove each image in parallel to your changes.
Couple this with consistent folder names and image names, to find everything easily, and you shouldn't have more than a dozen unused image at the end of your project.