We just released a Feb. 5 '89 prototype of DuckTales for the NES!
If you'd like to support our preservation efforts (and this wasn't cheap), please consider donating or supporting us on Patreon. Thank you!

User:MissMokushiroku

From The Cutting Room Floor
Jump to navigation Jump to search

I like weird indie games, visual novels, and weird indie visual novels.


Blank.png
Sandbox
Digital box of sand

Notes on Ren'Py games

Maybe this will be useful to other people, I dunno. I just want this stuff all in one place.

Ren'Py is a free, open-source game engine for making visual novels. Roughly 95% of non-Japanese VNs are made in Ren'Py. (I just pulled that statistic out of my ass, but I've been in the VN scene long enough to be fairly confident it's pretty close. Japanese VNs are usually made in Japanese engines like Kirikiri or NScripter, but sometimes get ported to Ren'Py when they're localized--both MangaGamer and Sekai Project have done Ren'Py ports of Japanese VNs.) Lately, there's been a few games made in commercial engines TyranoBuilder (shit) and Visual Novel Maker (okay), and an uptick in VNs made in Unity, but for the most part, the bulk of English VN development happens in Ren'Py.

Thankfully for this wiki, most Ren'Py games are really easy to poke around in for unused files.

RPAs and You

In the vast majority of cases, the graphic and sound assets will be packed into .rpa archives (usually in a single file named archive.rpa, but some games might put the images and audio in different archives) in the "game" folder. You need a specialized tool to extract them. I use RPA Extract (Windows-only for now): just drag the .rpa file on the .exe and you'll get all the stuff, ezpz. (I would recommend making a new folder, copying the rpaExtract .exe and .rpa to it, then extracting the assets, because the assets will all be in the same folder as the archive.) For people who prefer command-line stuff or need more functionality, rpatool is also an option.

Scripts

The scripts are where the magic happens. Most games will only have three: options.rpy (defines the GUI and other settings), screens.rpy (defines anything that can be clicked on, like menus and choice screens, as well as what ADV and NVL modes look like), and script.rpy (the actual script of the game). All .rpy scripts will have .rpyc counterparts; these are compiled Python scripts automatically generated by Ren'Py and won't have anything that's not in the .rpy files, so if the .rpy file is available, there's no need to bother with the .rpyc files. (The .rpy scripts determine what's in the .rpyc files, and the .rpyc files are what are used to run the game. If you alter a .rpy file, its .rpyc counterpart will be automatically altered to reflect the changes the next time you run the game.) Games with other gameplay elements may have many more .rpy and .rpyc files.

.rpy files are just text files and can be opened in any standard text editor, even Notepad if you really want to (don't open them in Notepad, you'll hate yourself). I personally use the Atom installation provided with Ren'Py; it contains a built-in package that will highlight Ren'Py syntax in .rpy files. If you don't want to bother with the Ren'Py client, you can also install Atom directly and add this package to it, although the colors used are different.

This script will allow you to easily determine whether or not an image or audio file is actually used in the game as well as find commented-out strings and code.

IMPORTANT NOTE: At the beginning of the script are declarations, which define which labels call which assets. Just because an asset is declared does not mean it's used in the game! You have to check whether the asset is used anywhere else in the script. If it's only named in the declaration, but that label/asset is never used otherwise, it's unused.

In Ren'Py syntax, commented-out strings and lines are preceded by at least one #. If you took my suggestion and installed Atom with the Ren'Py client, it'll highlight comments in red, which makes it extremely easy to just skim the script for comments. If you installed standalone Atom and the language-renpy package, comments will be greyed out. If you're using another text editor, figure it out yourself.

If the game only has .rpyc files and not .rpy files, things get a bit more tricky. You'll need to use unrpyc to decompile the scripts before you can do anything with them. (You must have Python 2.7 installed to use unrpyc.) This will give you .rpy files--although any comments made by the developer will not be retained, so it won't be identical to the original .rpy.

To convert .rpyc to .rpy using unrpyc (Windows):

  • Create a new folder wherever
  • Copy the .rpyc file(s) you want to convert and the unrpyc installation to that folder
  • Type "cmd" in the program bar
  • Enter "unrpyc.py *.rpyc" in the command line

Congrats, you've got some .rpy files that you can actually look at.

log.txt

No unused stuff here, but there's a couple pieces of information that can be useful.

The first time you start a Ren'Py game, a file named log.txt will be created in the install directory. (Using Highway Blossoms as an example just because I like that VN. It's a kinetic novel (no choices), so not really appropriate for including on TCRF otherwise.)

The first three lines will look like this (but they will be different depending on the game).

Wed May 01 14:10:14 2019
Windows-8-6.2.9200
Ren'Py 7.2.0.424
  • Line 1 = The date and time you started the game
  • Line 2 = Your OS
  • Line 3 = The version of Ren'Py the build was made in

Later in the file are graphics settings. Most of them aren't that interesting, with the exception of the line that looks like this:

Screen sizes: virtual=(1920, 1080) physical=(1739, 978) drawable=(1739, 978)

The "virtual" screen size is the game's native resolution (i.e., the resolution all the assets are made for). "Physical" and "drawable" will depend on your own resolution and whether or not you're playing in fullscreen (in this case, my resolution is 1920x1080 and I opened the game in windowed mode).

Pages I've Made