The Ren'Py Visual Novel Engine
Find a file
2025-04-07 19:59:16 -04:00
.vscode Update .gitignore and .vscode/settings.json when generating pyi files. 2025-01-04 23:33:41 -05:00
experimental/cslots cslots: Maintain experiment while in development 2025-01-04 11:00:32 +00:00
gui Create libs/ and lib/libs.txt. 2025-01-12 15:25:28 -05:00
launcher Backport changes to only include a single version of Python. 2025-02-26 23:29:21 -05:00
module Update copyright for 2025. 2025-01-02 18:48:44 -05:00
renpy Merge pull request from Opolis13/fix-spelling-errors 2025-04-07 19:56:53 -04:00
scripts Add support for regenerating cython. 2025-03-23 21:58:50 -04:00
sdk-fonts Move SourceHanSansLite.ttf to the top level, so it can be classified into projects. 2022-03-22 23:06:30 -04:00
sphinx Add the force mono preference. 2025-04-06 00:11:40 -04:00
src Add the force mono preference. 2025-04-06 00:11:40 -04:00
testcases/game Fix typos 2025-02-06 18:18:43 -04:00
the_question Fix typos 2025-02-06 18:18:43 -04:00
tutorial Add ids so translations keep working. 2025-04-07 19:59:16 -04:00
unittests Implement style property retrieval with inheritance. 2013-12-27 23:19:35 -05:00
.gitignore Update .gitignore and .vscode/settings.json when generating pyi files. 2025-01-04 23:33:41 -05:00
add.py py2: Fixes to add.py. 2024-08-24 23:56:11 -04:00
after_checkout.sh added linking to the nighly build renpy.sh 2020-10-16 10:51:30 -07:00
distribute.py Fix an issue with with sdist, versions, and pygame_sdl2. 2024-09-14 00:19:09 -04:00
main.py Add main.py. 2015-04-02 21:19:39 -04:00
pyproject.toml ml: Get Asset Importer loading the model. 2025-01-27 01:26:36 -05:00
README.rst Remove spurious backslash in README. 2025-02-15 20:05:42 -05:00
renpy.py Update copyright for 2025. 2025-01-02 18:48:44 -05:00
run.sh reorg: Eliminate use of the module directory. 2024-12-15 18:14:26 -05:00
setup.py Add gl2uniform to the build process. 2025-03-23 09:42:28 -04:00
test_dlc.sh py3: Get the updater working with Python 3. 2022-01-10 22:04:01 -05:00
TRANSLATORS.rst Update TRANSLATORS.rst 2024-08-21 21:38:12 +01:00

==============================
The Ren'Py Visual Novel Engine
==============================

https://www.renpy.org


Branches
========

The following branches are the most interesting.

``fix``
    The fix branch is used for fixes to the current version of Ren'Py that do
    not require dangerous changes. The fix branch is also the source of the
    documentation on https://www.renpy.org/. This branch is automatically
    merged into master on a regular basis.

    Pull requests that contain fixes or documentation improvements should be
    made to the fix branch. When a release is made, the master branch is
    copied to the fix branch.

``master``
    The master branch is where the main focus of development is. This branch
    will eventually become the next release of Ren'Py.

    Pull requests that contain new features, that require incompatible changes,
    or major changes to Ren'Py's internals should be targeted at the master
    branch.


Getting Started
===============

Ren'Py depends on a number of Python modules written in Cython and C. For
changes to Ren'Py that only involve Python modules, you can use the modules
found in the latest nightly build. Otherwise, you'll have to compile the
modules yourself.

The development scripts assume a POSIX-like platform. The scripts should run
on Linux or macOS, and can be made to run on Windows using an environment
like MSYS.

Nightly Build
-------------

Nightly builds can be downloaded from:

   https://nightly.renpy.org

Note that the latest nightly build is at the bottom of the list. Once you've
unpacked the nightly, change into this repository, and run::

    ./after_checkout.sh <path-to-nightly>

Once this script completes, you should be able to run Ren'Py using renpy.sh,
renpy.app, or renpy.exe, as appropriate for your platform.

If the current nightly build doesn't work, please wait 24 hours for a new
build to occur. If that build still doesn't work, contact Tom (`pytom at bishoujo.us`,
or @renpytom on Twitter/X) to find out what's wrong.

The ``doc`` symlink will dangle until documentation is built, as described
below.

Compiling the Modules
----------------------

Building the modules requires you have the many dependencies installed on
your system. On Ubuntu and Debian, these dependencies can be installed with
the command::

    sudo apt install virtualenvwrapper python3-dev libassimp-dev libavcodec-dev libavformat-dev \
        libswresample-dev libswscale-dev libharfbuzz-dev libfreetype6-dev libfribidi-dev libsdl2-dev \
        libsdl2-image-dev libsdl2-gfx-dev libsdl2-mixer-dev libsdl2-ttf-dev libjpeg-dev pkg-config

Ren'Py requires SDL_image 2.6 or greater. If your distribution doesn't include
that version, you'll need to download it from:

    https://github.com/libsdl-org/SDL_image/tree/SDL2

We strongly suggest installing the Ren'Py modules into a Python
virtualenv. To create a new virtualenv, open a new terminal and run::

    . /usr/share/virtualenvwrapper/virtualenvwrapper.sh
    mkvirtualenv renpy

To return to this virtualenv later, run::

    . /usr/share/virtualenvwrapper/virtualenvwrapper.sh
    workon renpy

After activating the virtualenv, install additional dependencies::

    pip install -U setuptools cython future six typing pefile requests ecdsa

Then, install pygame_sdl2 by running the following commands::

    git clone https://www.github.com/renpy/pygame_sdl2
    pushd pygame_sdl2
    python setup.py install
    popd

Finally, use setup.py to compile extension modules that support Ren'Py::

    python setup.py install

Ren'Py will be installed into the activated virtualenv. It can then be run
using the command::

    python renpy.py


Other Platforms
---------------

Where supported, Ren'Py will attempt to find include directories and library paths
using pkg-config. If pkg-config is not present, include and library paths can be
specified using CFLAGS and LDFLAGS.

If RENPY_CFLAGS is present in the environment and CFLAGS is not, setup.py
will set CFLAGS to RENPY_CFLAGS. The same is true for RENPY_LDFLAGS,
RENPY_CC, RENPY_CXX, and RENPY_LD.

Setup.py does not support cross-compiling. See https://github.com/renpy/renpy-build
for software that cross-compiles Ren'Py for many platforms.


Documentation
=============

Building
--------

Building the documentation requires Ren'Py to work. You'll either need to
link in a nightly build, or compile the modules as described above. You'll
also need the `Sphinx <https://www.sphinx-doc.org>`_ documentation generator.
If you have pip working, install Sphinx using::

    pip install -U sphinx sphinx_rtd_theme sphinx_rtd_dark_mode

Once Sphinx is installed, change into the ``sphinx`` directory inside the
Ren'Py checkout and run::

    ./build.sh

Format
------

Ren'Py's documentation consists of reStructuredText files found in sphinx/source, and
generated documentation found in function docstrings scattered throughout the code. Do
not edit the files in sphinx/source/inc directly, as they will be overwritten.

Docstrings may include tags on the first few lines:

\:doc: `section` `kind`
    Indicates that this function should be documented. `section` gives
    the name of the include file the function will be documented in, while
    `kind` indicates the kind of object to be documented (one of ``function``,
    ``method`` or ``class``. If omitted, `kind` will be auto-detected.
\:name: `name`
    The name of the function to be documented. Function names are usually
    detected, so this is only necessary when a function has multiple aliases.
\:args: `args`
    This overrides the detected argument list. It can be used if some arguments
    to the function are deprecated.

For example::

    def warp_speed(factor, transwarp=False):
        """
        :doc: warp
        :name: renpy.warp_speed
        :args: (factor)

        Exceeds the speed of light.
        """

        renpy.engine.warp_drive.engage(factor)


Translating
===========

For best practices when it comes to translating the launcher and template
game, please read:

https://lemmasoft.renai.us/forums/viewtopic.php?p=321603#p321603


Contributing
============

For bug fixes, documentation improvements, and simple changes, just
make a pull request. For more complex changes, it might make sense
to file an issue first so we can discuss the design.

License
=======

For the complete licensing terms, please read:

https://www.renpy.org/doc/html/license.html