renpy/doc/build.html

722 lines
43 KiB
HTML
Raw Normal View History

2023-01-18 22:13:55 +00:00
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Building Distributions &#8212; Ren&#39;Py Documentation</title>
<link rel="stylesheet" href="_static/renpydoc.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="_static/bootstrap-3.3.6/css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="_static/bootstrap-3.3.6/css/bootstrap-theme.min.css" />
<link rel="stylesheet" type="text/css" href="_static/bootstrap-sphinx.css" />
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/language_data.js"></script>
<script type="text/javascript" src="_static/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="_static/js/jquery-fix.js"></script>
<script type="text/javascript" src="_static/bootstrap-3.3.6/js/bootstrap.min.js"></script>
<script type="text/javascript" src="_static/bootstrap-sphinx.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Web Updater" href="updater.html" />
<link rel="prev" title="Other Functions and Variables" href="other.html" />
<meta charset='utf-8'>
<meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1'>
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1'>
<meta name="apple-mobile-web-app-capable" content="yes">
</head><body>
<div id="navbar" class="navbar navbar-default navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<!-- .btn-navbar is used as the toggle for collapsed navbar content -->
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">
Ren&#39;Py Documentation</a>
<span class="navbar-text navbar-version pull-left"><b>7.5.3</b></span>
</div>
<div class="collapse navbar-collapse nav-collapse">
<ul class="nav navbar-nav">
<li><a href="https://www.renpy.org">Home Page</a></li>
<li><a href="https://www.renpy.org/doc/html/">Online Documentation</a></li>
<li class="dropdown globaltoc-container">
<a role="button"
id="dLabelGlobalToc"
data-toggle="dropdown"
data-target="#"
href="index.html">Site <b class="caret"></b></a>
<ul class="dropdown-menu globaltoc"
role="menu"
aria-labelledby="dLabelGlobalToc"><ul>
<li class="toctree-l1"><a class="reference internal" href="quickstart.html">Quickstart</a></li>
<li class="toctree-l1"><a class="reference internal" href="gui.html">GUI Customization Guide</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="language_basics.html">Language Basics</a></li>
<li class="toctree-l1"><a class="reference internal" href="label.html">Labels &amp; Control Flow</a></li>
<li class="toctree-l1"><a class="reference internal" href="dialogue.html">Dialogue and Narration</a></li>
<li class="toctree-l1"><a class="reference internal" href="displaying_images.html">Displaying Images</a></li>
<li class="toctree-l1"><a class="reference internal" href="menus.html">In-Game Menus</a></li>
<li class="toctree-l1"><a class="reference internal" href="python.html">Python Statements</a></li>
<li class="toctree-l1"><a class="reference internal" href="conditional.html">Conditional Statements</a></li>
<li class="toctree-l1"><a class="reference internal" href="audio.html">Audio</a></li>
<li class="toctree-l1"><a class="reference internal" href="movie.html">Movie</a></li>
<li class="toctree-l1"><a class="reference internal" href="voice.html">Voice</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="text.html">Text</a></li>
<li class="toctree-l1"><a class="reference internal" href="translation.html">Translation</a></li>
<li class="toctree-l1"><a class="reference internal" href="displayables.html">Displayables</a></li>
<li class="toctree-l1"><a class="reference internal" href="transforms.html">Transforms</a></li>
<li class="toctree-l1"><a class="reference internal" href="transitions.html">Transitions</a></li>
<li class="toctree-l1"><a class="reference internal" href="atl.html">Animation and Transformation Language</a></li>
<li class="toctree-l1"><a class="reference internal" href="matrixcolor.html">Matrixcolor</a></li>
<li class="toctree-l1"><a class="reference internal" href="layeredimage.html">Layered Images</a></li>
<li class="toctree-l1"><a class="reference internal" href="3dstage.html">3D Stage</a></li>
<li class="toctree-l1"><a class="reference internal" href="live2d.html">Live2D Cubism</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="style.html">Styles</a></li>
<li class="toctree-l1"><a class="reference internal" href="style_properties.html">Style Properties</a></li>
<li class="toctree-l1"><a class="reference internal" href="screens.html">Screens and Screen Language</a></li>
<li class="toctree-l1"><a class="reference internal" href="screen_actions.html">Screen Actions, Values, and Functions</a></li>
<li class="toctree-l1"><a class="reference internal" href="screen_special.html">Special Screen Names</a></li>
<li class="toctree-l1"><a class="reference internal" href="screen_optimization.html">Screen Language Optimization</a></li>
<li class="toctree-l1"><a class="reference internal" href="config.html">Configuration Variables</a></li>
<li class="toctree-l1"><a class="reference internal" href="preferences.html">Preference Variables</a></li>
<li class="toctree-l1"><a class="reference internal" href="store_variables.html">Store Variables</a></li>
<li class="toctree-l1"><a class="reference internal" href="mouse.html">Custom Mouse Cursors</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="launcher.html">Launcher</a></li>
<li class="toctree-l1"><a class="reference internal" href="developer_tools.html">Developer Tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="director.html">Interactive Director</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="nvl_mode.html">NVL-Mode Tutorial</a></li>
<li class="toctree-l1"><a class="reference internal" href="input.html">Text Input</a></li>
<li class="toctree-l1"><a class="reference internal" href="side_image.html">Side Images</a></li>
<li class="toctree-l1"><a class="reference internal" href="rooms.html">Image Gallery, Music Room, and Replay Actions</a></li>
<li class="toctree-l1"><a class="reference internal" href="drag_drop.html">Drag and Drop</a></li>
<li class="toctree-l1"><a class="reference internal" href="sprites.html">Sprites</a></li>
<li class="toctree-l1"><a class="reference internal" href="keymap.html">Customizing the Keymap</a></li>
<li class="toctree-l1"><a class="reference internal" href="achievement.html">Achievements</a></li>
<li class="toctree-l1"><a class="reference internal" href="history.html">Dialogue History</a></li>
<li class="toctree-l1"><a class="reference internal" href="multiple.html">Multiple Character Dialogue</a></li>
<li class="toctree-l1"><a class="reference internal" href="splashscreen_presplash.html">Splashscreen and Presplash</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="statement_equivalents.html">Statement Equivalents</a></li>
<li class="toctree-l1"><a class="reference internal" href="save_load_rollback.html">Saving, Loading, and Rollback</a></li>
<li class="toctree-l1"><a class="reference internal" href="persistent.html">Persistent Data</a></li>
<li class="toctree-l1"><a class="reference internal" href="trans_trans_python.html">Transforms and Transitions in Python</a></li>
<li class="toctree-l1"><a class="reference internal" href="gui_advanced.html">Advanced GUI</a></li>
<li class="toctree-l1"><a class="reference internal" href="screen_python.html">Screens and Python</a></li>
<li class="toctree-l1"><a class="reference internal" href="modes.html">Modes</a></li>
<li class="toctree-l1"><a class="reference internal" href="cdd.html">Creator-Defined Displayables</a></li>
<li class="toctree-l1"><a class="reference internal" href="cds.html">Creator-Defined Statements</a></li>
<li class="toctree-l1"><a class="reference internal" href="custom_text_tags.html">Custom Text Tags</a></li>
<li class="toctree-l1"><a class="reference internal" href="character_callbacks.html">Character Callbacks</a></li>
<li class="toctree-l1"><a class="reference internal" href="file_python.html">File Access</a></li>
<li class="toctree-l1"><a class="reference internal" href="color_class.html">Color Class</a></li>
<li class="toctree-l1"><a class="reference internal" href="matrix.html">Matrix</a></li>
<li class="toctree-l1"><a class="reference internal" href="model.html">Model-Based Rendering</a></li>
<li class="toctree-l1"><a class="reference internal" href="other.html">Other Functions and Variables</a></li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="#">Building Distributions</a></li>
<li class="toctree-l1"><a class="reference internal" href="updater.html">Web Updater</a></li>
<li class="toctree-l1"><a class="reference internal" href="android.html">Android</a></li>
<li class="toctree-l1"><a class="reference internal" href="chromeos.html">Chrome OS/Chromebook</a></li>
<li class="toctree-l1"><a class="reference internal" href="ios.html">iOS</a></li>
<li class="toctree-l1"><a class="reference internal" href="iap.html">In-App Purchasing</a></li>
<li class="toctree-l1"><a class="reference internal" href="gesture.html">Gestures</a></li>
<li class="toctree-l1"><a class="reference internal" href="raspi.html">Raspberry Pi</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="security.html">Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="problems.html">Dealing with Problems</a></li>
<li class="toctree-l1"><a class="reference internal" href="environment_variables.html">Environment Variables</a></li>
<li class="toctree-l1"><a class="reference internal" href="self_voicing.html">Self-Voicing</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="editor.html">Text Editor Integration</a></li>
<li class="toctree-l1"><a class="reference internal" href="skins.html">Skins</a></li>
<li class="toctree-l1"><a class="reference internal" href="translating_renpy.html">Translating Ren'Py</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="changelog.html">Changelog (Ren'Py 7.x-)</a></li>
<li class="toctree-l1"><a class="reference internal" href="changelog6.html">Changelog (Ren'Py 6.11 - 6.99)</a></li>
<li class="toctree-l1"><a class="reference internal" href="incompatible.html">Incompatible Changes</a></li>
<li class="toctree-l1"><a class="reference internal" href="distributor.html">Distributor Notes</a></li>
<li class="toctree-l1"><a class="reference internal" href="license.html">License</a></li>
<li class="toctree-l1"><a class="reference internal" href="credits.html">Credits</a></li>
<li class="toctree-l1"><a class="reference internal" href="sponsors.html">Ren'Py Development Sponsors</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="thequestion.html">Script of The Question</a></li>
<li class="toctree-l1"><a class="reference internal" href="thequestion_nvl.html">NVL-mode script for The Question</a></li>
</ul>
</ul>
</li>
</ul>
<form class="navbar-form navbar-right" action="search.html" method="get">
<div class="form-group">
<input type="text" name="q" class="form-control" placeholder="Search" />
</div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-md-3">
<div id="sidebar" class="bs-sidenav" role="complementary"><ul>
<li><a class="reference internal" href="#">Building Distributions</a><ul>
<li><a class="reference internal" href="#basic-configuration">Basic Configuration</a></li>
<li><a class="reference internal" href="#special-files">Special Files</a></li>
<li><a class="reference internal" href="#classifying-and-ignoring-files">Classifying and Ignoring Files</a></li>
<li><a class="reference internal" href="#documentation">Documentation</a></li>
<li><a class="reference internal" href="#packages">Packages</a></li>
<li><a class="reference internal" href="#archives">Archives</a></li>
<li><a class="reference internal" href="#the-old-game-directory">The Old-game Directory</a></li>
<li><a class="reference internal" href="#requirements">Requirements</a></li>
<li><a class="reference internal" href="#build-functions">Build Functions</a></li>
<li><a class="reference internal" href="#advanced-configuration">Advanced Configuration</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div class="col-md-9 content">
<div class="section" id="building-distributions">
<span id="id1"></span><h1>Building Distributions<a class="headerlink" href="#building-distributions" title="Permalink to this headline"> link</a></h1>
<p>Ren'Py includes support for building game distributions. Upon choosing
&quot;Build Distributions&quot; in the launcher, Ren'Py will scan itself and the
project to determine the files to include in the distribution, will
create any archives that are necessary, and will build package and
update files.</p>
<p>With no configuration, Ren'Py is able to build the following kinds of
packages:</p>
<dl class="docutils">
<dt>PC: Windows and Linux</dt>
<dd>A zip file targeting Windows x86_64 and Linux x86_64</dd>
<dt>Linux</dt>
<dd>A tar.bz2 file targeting Linux x86_64. This will also include
the 32-bit and 64-bit ARM version of Ren'Py, if present. (These
are found in the sdkarm Ren'Py package.)</dd>
<dt>Macintosh</dt>
<dd>A zip file containing a Macintosh application targeting Macintosh
OS X on Intel processors. Game data will be included inside the
application, which appears to the user as a single file.</dd>
<dt>Windows</dt>
<dd>A zip file targeting Windows x86_64.</dd>
<dt>Windows, Mac, and Linux for Markets</dt>
<dd>A distribution that contains the information required to run on
software markets like itch.io and Steam. This isn't meant to be
run directly (and probably won't work on the Mac), but should be
fed to the app store upload process.</dd>
</dl>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p>The zip and tar.bz2 files that Ren'Py produces contain permissions
information that must be present for Ren'Py to run on Linux and
Macintosh.</p>
<p class="last">Unpacking and re-packing a zip file on Windows and then running it
on Linux or Macintosh is not supported.</p>
</div>
<div class="section" id="basic-configuration">
<h2>Basic Configuration<a class="headerlink" href="#basic-configuration" title="Permalink to this headline"> link</a></h2>
<p>The build process can be configured by setting variables and calling
function that live in the build namespace. This must be done from
inside an <code class="docutils literal notranslate"><span class="pre">init</span> <span class="pre">python</span></code> block. The default settings for these configurations are
set in <code class="docutils literal notranslate"><span class="pre">options.rpy</span></code>.</p>
<p>There are a few basic variables and functions that many games will
use.</p>
<dl class="var">
<dt id="var-build.name">
<code class="descname">build.name</code> = &quot;...&quot;<a class="headerlink" href="#var-build.name" title="Permalink to this definition"> link</a></dt>
<dd><p>This is used to automatically generate build.directory_name
and build.executable_name, if neither is set. This should not
contain spaces, colons, or semicolons.</p>
</dd></dl>
<dl class="var">
<dt id="var-build.directory_name">
<code class="descname">build.directory_name</code> = &quot;...&quot;<a class="headerlink" href="#var-build.directory_name" title="Permalink to this definition"> link</a></dt>
<dd><p>This is used to create the names of directories in the archive
files. For example, if this is set to &quot;mygame-1.0&quot;, the Linux
version of the project will unpack to &quot;mygame-1.0-linux&quot;.</p>
<p>This is also used to determine the name of the directory in
which the package files are placed. For example, if you set
build.directory_name to mygame-1.0, the archive files will
be placed in mygame-1.0-dists in the directory above the base
directory.</p>
<p>This variable should not contain special characters like spaces,
colons, and semicolons. If not set, it defaults to <a class="reference internal" href="#var-build.name"><code class="xref std std-var docutils literal notranslate"><span class="pre">build.name</span></code></a>
a dash, and <a class="reference internal" href="config.html#var-config.version"><code class="xref std std-var docutils literal notranslate"><span class="pre">config.version</span></code></a>.</p>
</dd></dl>
<dl class="var">
<dt id="var-build.executable_name">
<code class="descname">build.executable_name</code> = &quot;...&quot;<a class="headerlink" href="#var-build.executable_name" title="Permalink to this definition"> link</a></dt>
<dd><p>This variable controls the name of the executables that the user
clicks on to start the game.</p>
<p>This variable should not contain special characters like spaces,
colons, and semicolons. If not set, it defaults to <a class="reference internal" href="#var-build.name"><code class="xref std std-var docutils literal notranslate"><span class="pre">build.name</span></code></a>.</p>
<p>For example, if this is set to &quot;mygame&quot;, the user will be able
to run mygame.exe on Windows, mygame.app on Macintosh, and
mygame.sh on Linux.</p>
</dd></dl>
</div>
<div class="section" id="special-files">
<span id="id2"></span><h2>Special Files<a class="headerlink" href="#special-files" title="Permalink to this headline"> link</a></h2>
<p>There are two files that can be included in your game's base directory
to customize the build.</p>
<dl class="docutils">
<dt>icon.ico</dt>
<dd>The icon that is used on Windows.</dd>
<dt>icon.icns</dt>
<dd>The icon that is used on Macintosh.</dd>
</dl>
<p>These icon files must be in specific formats. You'll need to use a
program or web service (such as <a class="reference external" href="https://anyconv.com/png-to-ico-converter/">https://anyconv.com/png-to-ico-converter/</a> and <a class="reference external" href="https://anyconv.com/png-to-icns-converter/">https://anyconv.com/png-to-icns-converter/</a> ) to convert
them.</p>
</div>
<div class="section" id="classifying-and-ignoring-files">
<h2>Classifying and Ignoring Files<a class="headerlink" href="#classifying-and-ignoring-files" title="Permalink to this headline"> link</a></h2>
<p>The build process works by first classifying files in the Ren'Py
distribution and your game into file lists. These file lists are then
added to package files.</p>
<p>The classification is done by the build.classify function. It takes a
patterns and a space-separated list of filenames. Patterns are matched
from first to last, with the first match taking precedence (even if a
more-specific pattern follows.) Patterns are matched with and without
a leading /. Patterns may include the following special characters:</p>
<dl class="docutils">
<dt>/</dt>
<dd>The directory separator.</dd>
<dt>*</dt>
<dd>Matches all characters except for the directory separator.</dd>
<dt>**</dt>
<dd>Matches all characters.</dd>
</dl>
<p>For example:</p>
<dl class="docutils">
<dt>**.txt</dt>
<dd>Matches all txt files.</dd>
<dt>game/*.txt</dt>
<dd>Matches txt files in the game directory.</dd>
</dl>
<p>There are seven file lists that files can be classified into by
default. (Ren'Py places its own files into the first six of these.)</p>
<dl class="docutils">
<dt>all</dt>
<dd>These files will be included in all packages, and in Android
builds.</dd>
<dt>linux</dt>
<dd>These files will be included in packages targeting Linux.</dd>
<dt>mac</dt>
<dd>These files will be included in packages targeting Macintosh.</dd>
<dt>windows</dt>
<dd>These files will be included in packages targeting Windows.</dd>
<dt>renpy</dt>
<dd>These files will be included in packages that require the Ren'Py
engine files. (Linux, Macintosh, and Windows.)</dd>
<dt>android</dt>
<dd>These files will be included in Android builds.</dd>
</dl>
<p>This set of valid file lists can be expanded by passing
<a class="reference internal" href="#build.classify" title="build.classify"><code class="xref py py-func docutils literal notranslate"><span class="pre">build.classify()</span></code></a> new names as its <code class="docutils literal notranslate"><span class="pre">file_list</span></code> argument.</p>
<p>Files can also be classified in archives. By default, the &quot;archive&quot;
archive is declared:</p>
<dl class="docutils">
<dt>archive</dt>
<dd>These files will be included in the archive.rpa archive.</dd>
</dl>
<p>The set of archives can also be expanded, using the <a class="reference internal" href="#build.archive" title="build.archive"><code class="xref py py-func docutils literal notranslate"><span class="pre">build.archive()</span></code></a>
function.</p>
<p>Files that are not otherwise classified are placed in the &quot;all&quot; file
list.</p>
<p>To exclude files from distribution, classify them as None or the
empty string. In this case, * and ** at the end of the pattern
must match at least one character.</p>
<p>For example:</p>
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span><span class="c1"># Include README.txt</span>
<span class="n">build</span><span class="o">.</span><span class="n">classify</span><span class="p">(</span><span class="s2">&quot;README.txt&quot;</span><span class="p">,</span> <span class="s2">&quot;all&quot;</span><span class="p">)</span>
<span class="c1"># But exclude all other txt files.</span>
<span class="n">build</span><span class="o">.</span><span class="n">classify</span><span class="p">(</span><span class="s2">&quot;**.txt&quot;</span><span class="p">,</span> <span class="kc">None</span><span class="p">)</span>
<span class="c1"># Add png and jpg files in the game directory into an archive.</span>
<span class="n">build</span><span class="o">.</span><span class="n">classify</span><span class="p">(</span><span class="s2">&quot;game/**.png&quot;</span><span class="p">,</span> <span class="s2">&quot;archive&quot;</span><span class="p">)</span>
<span class="n">build</span><span class="o">.</span><span class="n">classify</span><span class="p">(</span><span class="s2">&quot;game/**.jpg&quot;</span><span class="p">,</span> <span class="s2">&quot;archive&quot;</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="section" id="documentation">
<h2>Documentation<a class="headerlink" href="#documentation" title="Permalink to this headline"> link</a></h2>
<p>Calling the build.documentation function with patterns marks files
matching those patterns as documentation. Documentation files are
included twice in a Macintosh application both inside and outside
of the application itself.</p>
<p>For example, to mark all txt and html files in the base directory as
documentation, call:</p>
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span><span class="n">build</span><span class="o">.</span><span class="n">documentation</span><span class="p">(</span><span class="s2">&quot;*.txt&quot;</span><span class="p">)</span>
<span class="n">build</span><span class="o">.</span><span class="n">documentation</span><span class="p">(</span><span class="s2">&quot;*.html&quot;</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="section" id="packages">
<span id="id3"></span><h2>Packages<a class="headerlink" href="#packages" title="Permalink to this headline"> link</a></h2>
<p>It's also possible to add new types of packages to the Ren'Py build
process. This is done by calling the build.package function with a
package name, type, and a string containing the file lists to
include.</p>
<p>Say we wanted to build a normal version of our game, and one
containing bonus material. We could classify the bonus files in to a
&quot;bonus&quot; file list, and then declare an all-premium package with:</p>
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span><span class="c1"># Declare a new archive belonging to a new &quot;bonus&quot; file list.</span>
<span class="n">build</span><span class="o">.</span><span class="n">archive</span><span class="p">(</span><span class="s2">&quot;bonus_archive&quot;</span><span class="p">,</span> <span class="s2">&quot;bonus&quot;</span><span class="p">)</span>
<span class="c1"># Put the bonus files into the new archive.</span>
<span class="n">build</span><span class="o">.</span><span class="n">classify</span><span class="p">(</span><span class="s2">&quot;game/bonus/**&quot;</span><span class="p">,</span> <span class="s2">&quot;bonus_archive&quot;</span><span class="p">)</span>
<span class="c1"># Declare the package.</span>
<span class="n">build</span><span class="o">.</span><span class="n">package</span><span class="p">(</span><span class="s2">&quot;all-premium&quot;</span><span class="p">,</span> <span class="s2">&quot;zip&quot;</span><span class="p">,</span> <span class="s2">&quot;windows mac linux all bonus&quot;</span><span class="p">)</span>
</pre></div>
</div>
<p>Supported package types are &quot;zip&quot; and &quot;tar.bz2&quot; to generate files in
those formats, and &quot;directory&quot; to create a directory filled with
files.</p>
</div>
<div class="section" id="archives">
<h2>Archives<a class="headerlink" href="#archives" title="Permalink to this headline"> link</a></h2>
<p>Ren'Py supports combining files into a simple archive format. While
not very secure, this protects files from casual copying.</p>
<p>By default, all files classified into the &quot;archive&quot; file list will be
placed in an archive.rpa archive, which is included in the all file
list.</p>
<p>By calling build.archive, it's possible to declare a new archives and
the file lists they will be included in. (It's rare to use anything
but the all file list, however.) To use an archive, classify files
into a list with its name.</p>
<p>For example, the following will archive images in images.rpa, and
game scripts into scripts.rpa:</p>
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span><span class="c1"># Declare two archives.</span>
<span class="n">build</span><span class="o">.</span><span class="n">archive</span><span class="p">(</span><span class="s2">&quot;scripts&quot;</span><span class="p">,</span> <span class="s2">&quot;all&quot;</span><span class="p">)</span>
<span class="n">build</span><span class="o">.</span><span class="n">archive</span><span class="p">(</span><span class="s2">&quot;images&quot;</span><span class="p">,</span> <span class="s2">&quot;all&quot;</span><span class="p">)</span>
<span class="c1"># Put script files into the scripts archive.</span>
<span class="n">build</span><span class="o">.</span><span class="n">classify</span><span class="p">(</span><span class="s2">&quot;game/**.rpy&quot;</span><span class="p">,</span> <span class="s2">&quot;scripts&quot;</span><span class="p">)</span>
<span class="n">build</span><span class="o">.</span><span class="n">classify</span><span class="p">(</span><span class="s2">&quot;game/**.rpyc&quot;</span><span class="p">,</span> <span class="s2">&quot;scripts&quot;</span><span class="p">)</span>
<span class="c1"># Put images into the images archive.</span>
<span class="n">build</span><span class="o">.</span><span class="n">classify</span><span class="p">(</span><span class="s2">&quot;game/**.jpg&quot;</span><span class="p">,</span> <span class="s2">&quot;images&quot;</span><span class="p">)</span>
<span class="n">build</span><span class="o">.</span><span class="n">classify</span><span class="p">(</span><span class="s2">&quot;game/**.png&quot;</span><span class="p">,</span> <span class="s2">&quot;images&quot;</span><span class="p">)</span>
</pre></div>
</div>
<p>If an archive file is empty, it will not be built.</p>
<p>Please think twice about archiving your game. Keeping files open will
help others run your game on future platforms platforms that may not
exist until after you're gone.</p>
</div>
<div class="section" id="the-old-game-directory">
<span id="old-game"></span><h2>The Old-game Directory<a class="headerlink" href="#the-old-game-directory" title="Permalink to this headline"> link</a></h2>
<p>When making multiple releases, like when a game is distributed through
early access or platforms like Patreon, it's necessary to keep the
old .rpyc files around. The .rpyc files contain information that is
necessary to ensure that saves can be loaded, and omitting these
files can cause problems.</p>
<p>At the same time, Ren'Py will update the .rpyc files in the game
directory when these files are changed, making the files unsuitable
for inclusion in version control.</p>
<p>To solve this problem, Ren'Py allows you to place the .rpyc files from
a previous distribution into the old-game directory, which is alongside
the game directory. The directory structure of old-game/ should match
the directory structure of game/. For example, game/scripts/day1.rpyc
should be moved to old-game/scripts/day1.rpyc. Files in old-game that are
not .rpyc files are ignored.</p>
<p>The advantage of using old-game is that the old-game .rpyc files can be
checked in, and that Ren'Py will always start from a known source when
generating .rpyc files. While this might not be necessary for a
single-developer game with minor changes, old-game is useful for large
multiple developer games.</p>
<p>More information about how .rpyc files help with loading saves into changed
games can be found at:</p>
<ul class="simple">
<li><a class="reference external" href="https://www.patreon.com/posts/under-hood-rpyc-23035810">Under the hood: .rpyc files</a></li>
<li><a class="reference external" href="https://www.patreon.com/posts/renpy-developer-48146908">Ren'Py developer update: February 2021</a></li>
</ul>
</div>
<div class="section" id="requirements">
<h2>Requirements<a class="headerlink" href="#requirements" title="Permalink to this headline"> link</a></h2>
<p>Some stores ask the requirements for Ren'Py applications to run. While
this varies from game to game, here's a set of minimums for a generic
visual novel.</p>
<p><strong>Windows</strong></p>
<ul class="simple">
<li>Version: Windows 7 or higher.</li>
<li>CPU: 2.0 Ghz 64-bit Intel-compatible</li>
<li>RAM: 2.0 GB</li>
<li>Graphics: OpenGL 3.0 or DirectX 11</li>
</ul>
<p><strong>macOS</strong></p>
<ul class="simple">
<li>Version: 10.10+</li>
<li>CPU: 2.0 Ghz 64-bit Intel-compatible (Apple silicon supported through Rosetta 2)</li>
<li>RAM: 2.0 GB</li>
<li>Graphics: OpenGL 3.0</li>
</ul>
<p><strong>Linux</strong></p>
<ul class="simple">
<li>Version: Ubuntu 16.04+</li>
<li>CPU: 2.0 Ghz 64-bit Intel-compatible</li>
<li>RAM: 2.0 GB</li>
<li>Graphics: OpenGL 3.0</li>
</ul>
<p>The amount of disk space required is entirely determined by the assets in your
game, and the amount of CPU and RAM needed may also vary. Ren'Py will also run
under OpenGL 2 with certain extensions available.</p>
</div>
<div class="section" id="build-functions">
<h2>Build Functions<a class="headerlink" href="#build-functions" title="Permalink to this headline"> link</a></h2>
<dl class="function">
<dt id="build.archive">
<code class="descclassname">build.</code><code class="descname">archive</code><span class="sig-paren">(</span><em>name</em>, <em>file_list=u'all'</em><span class="sig-paren">)</span><a class="headerlink" href="#build.archive" title="Permalink to this definition"> link</a></dt>
<dd><p>Declares the existence of an archive, whose <cite>name</cite> is added to the
list of available archive names, which can be passed to
<a class="reference internal" href="#build.classify" title="build.classify"><code class="xref py py-func docutils literal notranslate"><span class="pre">build.classify()</span></code></a>.</p>
<p>If one or more files are classified with <cite>name</cite>, <cite>name</cite>.rpa is
built as an archive, and then distributed in packages including
the <cite>file_list</cite> given here.</p>
<div class="highlight-renpy notranslate"><div class="highlight"><pre><span></span><span class="n">build</span><span class="o">.</span><span class="n">archive</span><span class="p">(</span><span class="s2">&quot;secret&quot;</span><span class="p">,</span> <span class="s2">&quot;windows&quot;</span><span class="p">)</span>
</pre></div>
</div>
<p>If any file is included in the &quot;secret&quot; archive using the
<a class="reference internal" href="#build.classify" title="build.classify"><code class="xref py py-func docutils literal notranslate"><span class="pre">build.classify()</span></code></a> function, the file will be included inside
the secret.rpa archive in the windows builds.</p>
<p>As with the <a class="reference internal" href="#build.classify" title="build.classify"><code class="xref py py-func docutils literal notranslate"><span class="pre">build.classify()</span></code></a> function, if the name given as
<cite>file_list</cite> doesn't exist as a file list name, it is created and
added to the set of valid file lists.</p>
</dd></dl>
<dl class="function">
<dt id="build.classify">
<code class="descclassname">build.</code><code class="descname">classify</code><span class="sig-paren">(</span><em>pattern</em>, <em>file_list</em><span class="sig-paren">)</span><a class="headerlink" href="#build.classify" title="Permalink to this definition"> link</a></dt>
<dd><p>Classifies files that match <cite>pattern</cite> into <cite>file_list</cite>, which can
also be an archive name.</p>
<p>If the name given as <cite>file_list</cite> doesn't exist as an archive or file
list name, it is created and added to the set of valid file lists.</p>
</dd></dl>
<dl class="function">
<dt id="build.clear">
<code class="descclassname">build.</code><code class="descname">clear</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#build.clear" title="Permalink to this definition"> link</a></dt>
<dd><p>Clears the list of patterns used to classify files.</p>
</dd></dl>
<dl class="function">
<dt id="build.documentation">
<code class="descclassname">build.</code><code class="descname">documentation</code><span class="sig-paren">(</span><em>pattern</em><span class="sig-paren">)</span><a class="headerlink" href="#build.documentation" title="Permalink to this definition"> link</a></dt>
<dd><p>Declares a pattern that matches documentation. In a mac app build,
files matching the documentation pattern are stored twice - once
inside the app package, and again outside of it.</p>
</dd></dl>
<dl class="function">
<dt id="build.executable">
<code class="descclassname">build.</code><code class="descname">executable</code><span class="sig-paren">(</span><em>pattern</em><span class="sig-paren">)</span><a class="headerlink" href="#build.executable" title="Permalink to this definition"> link</a></dt>
<dd><p>Adds a pattern marking files as executable on platforms that support it.
(Linux and Macintosh)</p>
</dd></dl>
<dl class="function">
<dt id="build.package">
<code class="descclassname">build.</code><code class="descname">package</code><span class="sig-paren">(</span><em>name</em>, <em>format</em>, <em>file_lists</em>, <em>description=None</em>, <em>update=True</em>, <em>dlc=False</em>, <em>hidden=False</em><span class="sig-paren">)</span><a class="headerlink" href="#build.package" title="Permalink to this definition"> link</a></dt>
<dd><p>Declares a package that can be built by the packaging
tool.</p>
<dl class="docutils">
<dt><cite>name</cite></dt>
<dd>The name of the package.</dd>
<dt><cite>format</cite></dt>
<dd><p class="first">The format of the package. A string containing a space separated
list of:</p>
<dl class="docutils">
<dt>zip</dt>
<dd>A zip file.</dd>
<dt>tar.bz2</dt>
<dd>A tar.bz2 file.</dd>
<dt>directory</dt>
<dd>A directory containing the files.</dd>
<dt>dmg</dt>
<dd>A Macintosh DMG containing the files.</dd>
<dt>app-zip</dt>
<dd>A zip file containing a macintosh application.</dd>
<dt>app-directory</dt>
<dd>A directory containing the mac app.</dd>
<dt>app-dmg</dt>
<dd>A macintosh drive image containing a dmg. (Mac only.)</dd>
<dt>bare-zip</dt>
<dd>A zip file without <a class="reference internal" href="#var-build.directory_name"><code class="xref std std-var docutils literal notranslate"><span class="pre">build.directory_name</span></code></a>
prepended.</dd>
<dt>bare-tar.bz2</dt>
<dd>A zip file without <a class="reference internal" href="#var-build.directory_name"><code class="xref std std-var docutils literal notranslate"><span class="pre">build.directory_name</span></code></a>
prepended.</dd>
</dl>
<p class="last">The empty string will not build any package formats (this
makes dlc possible).</p>
</dd>
<dt><cite>file_lists</cite></dt>
<dd>A list containing the file lists that will be included
in the package.</dd>
<dt><cite>description</cite></dt>
<dd>An optional description of the package to be built.</dd>
<dt><cite>update</cite></dt>
<dd>If true and updates are being built, an update will be
built for this package.</dd>
<dt><cite>dlc</cite></dt>
<dd>If true, any zip or tar.bz2 file will be built in
standalone DLC mode, without an update directory.</dd>
<dt><cite>hidden</cite></dt>
<dd>If true, this will be hidden from the list of packages in
the launcher.</dd>
</dl>
</dd></dl>
</div>
<div class="section" id="advanced-configuration">
<h2>Advanced Configuration<a class="headerlink" href="#advanced-configuration" title="Permalink to this headline"> link</a></h2>
<p>The following variables provide further control of the build process:</p>
<dl class="var">
<dt id="var-build.allow_integrated_gpu">
<code class="descname">build.allow_integrated_gpu</code> = True<a class="headerlink" href="#var-build.allow_integrated_gpu" title="Permalink to this definition"> link</a></dt>
<dd><p>Allows Ren'Py to run on the integrated GPU on platforms that have both
integrated and discrete GPUs. Right now, this is only supported on Mac
OS X.</p>
</dd></dl>
<dl class="var">
<dt id="var-build.destination">
<code class="descname">build.destination</code> = &quot;{directory_name}-dists&quot;<a class="headerlink" href="#var-build.destination" title="Permalink to this definition"> link</a></dt>
<dd><p>Gives the path to the directory the archive files will be placed in. This
may be an absolute or a relative path. A relative path is considered to
be relative to the projects directory.</p>
<p>The following values are substituted in using Python's <code class="docutils literal notranslate"><span class="pre">str.format</span></code> function.</p>
<dl class="docutils">
<dt><code class="docutils literal notranslate"><span class="pre">{directory_name}</span></code></dt>
<dd>The value of build.directory_name.</dd>
<dt><code class="docutils literal notranslate"><span class="pre">{executable_name}</span></code></dt>
<dd>The value of build.executable_name.</dd>
<dt><code class="docutils literal notranslate"><span class="pre">{version}</span></code></dt>
<dd>The value of build.version.</dd>
</dl>
</dd></dl>
<dl class="var">
<dt id="var-build.change_icon_i686">
<code class="descname">build.change_icon_i686</code> = True<a class="headerlink" href="#var-build.change_icon_i686" title="Permalink to this definition"> link</a></dt>
<dd><p>If True, and icon.ico exists, the icon of the 32-bit Windows executable
will be changed. If False, the icon will not be changed. Setting this
to False may prevent some antivirus programs from producing a false
positive for your game.</p>
</dd></dl>
<dl class="var">
<dt id="var-build.exclude_empty_directories">
<code class="descname">build.exclude_empty_directories</code> = True<a class="headerlink" href="#var-build.exclude_empty_directories" title="Permalink to this definition"> link</a></dt>
<dd><p>If true, empty directories (including directories left empty by
file archiving) will be removed from generated packages. If false,
empty directories will be included.</p>
</dd></dl>
<dl class="var">
<dt id="var-build.include_i686">
<code class="descname">build.include_i686</code> = True<a class="headerlink" href="#var-build.include_i686" title="Permalink to this definition"> link</a></dt>
<dd><p>If true, files necessary to run on 32-bit x86 processors will be included
in the Linux and Mac builds. If False, these files will not be included.</p>
</dd></dl>
<dl class="var">
<dt id="var-build.include_old_themes">
<code class="descname">build.include_old_themes</code> = True<a class="headerlink" href="#var-build.include_old_themes" title="Permalink to this definition"> link</a></dt>
<dd><p>When true, files required to support themes that existed before Ren'Py
6.99.9 will be included in the build. When false, such files are excluded.</p>
<p>This is set to False when <a class="reference internal" href="gui_advanced.html#gui.init" title="gui.init"><code class="xref py py-func docutils literal notranslate"><span class="pre">gui.init()</span></code></a> is called.</p>
</dd></dl>
<dl class="var">
<dt id="var-build.include_update">
<code class="descname">build.include_update</code> = False<a class="headerlink" href="#var-build.include_update" title="Permalink to this definition"> link</a></dt>
<dd><p>When true, Ren'Py will produce the files required for the <a class="reference internal" href="updater.html"><span class="doc">updater</span></a>
to work.</p>
</dd></dl>
<dl class="var">
<dt id="var-build.itch_project">
<code class="descname">build.itch_project</code> = None<a class="headerlink" href="#var-build.itch_project" title="Permalink to this definition"> link</a></dt>
<dd><p>Setting this allows the Ren'Py launcher to upload your project to
itch.io. This should be set to the name of a project registered
with itch. (For example, &quot;renpytom/the-question&quot;).</p>
<p>Once this is set, after the distributions have been built, you can
click &quot;Build distributions&quot;, &quot;Upload to itch.io&quot; to cause an upload
to occur.</p>
</dd></dl>
<dl class="var">
<dt id="var-build.mac_info_plist">
<code class="descname">build.mac_info_plist</code> = { }<a class="headerlink" href="#var-build.mac_info_plist" title="Permalink to this definition"> link</a></dt>
<dd><p>This is a dictionary mapping strings to strings, that can be used to
add or override keys in the mac's Info.plist file.</p>
</dd></dl>
</div>
</div>
</div>
</div>
</div>
<footer class="footer">
<div class="container">
<p class="pull-right">
<a href="#">Back to top</a>
</p>
<p>
&copy; Copyright 2012-2022, Tom Rothamel.<br/>
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.8.6.<br/>
</p>
</div>
</footer>
</body>
</html>