<h1>Directory Overview<aclass="headerlink"href="#directory-overview"title="Permalink to this headline">¶</a></h1>
<p>This is an overview of the directories relevant to Evennia coding.</p>
<divclass="section"id="the-game-directory">
<h2>The Game directory<aclass="headerlink"href="#the-game-directory"title="Permalink to this headline">¶</a></h2>
<p>The game directory is created with <codeclass="docutils literal notranslate"><spanclass="pre">evennia</span><spanclass="pre">--init</span><spanclass="pre"><name></span></code>. In the Evennia documentation we always assume it’s called <codeclass="docutils literal notranslate"><spanclass="pre">mygame</span></code>. Apart from the <codeclass="docutils literal notranslate"><spanclass="pre">server/</span></code> subfolder within, you could reorganize this folder if you preferred a different code structure for your game.</p>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">commands/</span></code> - Overload default <aclass="reference internal"href="Commands.html"><spanclass="doc">Commands</span></a> or add your own Commands/<aclass="reference internal"href="Command-Sets.html"><spanclass="doc">Command sets</span></a> here.</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">server</span></code>/ - The structure of this folder should not change since Evennia expects it.</p>
<ul>
<li><p><aclass="reference external"href="https://github.com/evennia/evennia/tree/master/evennia/game_template/server"><codeclass="docutils literal notranslate"><spanclass="pre">conf/</span></code></a> - All server configuration files sits here. The most important file is <codeclass="docutils literal notranslate"><spanclass="pre">settings.py</span></code>.</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">logs/</span></code> - Portal log files are stored here (Server is logging to the terminal by default)</p></li>
</ul>
</li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">typeclasses/</span></code> - this folder contains empty templates for overloading default game entities of Evennia. Evennia will automatically use the changes in those templates for the game entities it creates.</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">web/</span></code> - This holds the <aclass="reference internal"href="Web-Features.html"><spanclass="doc">Web features</span></a> of your game.</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">world/</span></code> - this is a “miscellaneous” folder holding everything related to the world you are building, such as build scripts and rules modules that don’t fit with one of the other folders.</p></li>
</ul>
</div>
<divclass="section"id="evennia-library-layout">
<h2>Evennia library layout:<aclass="headerlink"href="#evennia-library-layout"title="Permalink to this headline">¶</a></h2>
<p>If you cloned the GIT repo following the instructions, you will have a folder named <codeclass="docutils literal notranslate"><spanclass="pre">evennia</span></code>. The top level of it contains Python package specific stuff such as a readme file, <codeclass="docutils literal notranslate"><spanclass="pre">setup.py</span></code> etc. It also has two subfolders<codeclass="docutils literal notranslate"><spanclass="pre">bin/</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">evennia/</span></code> (again).</p>
<p>The <codeclass="docutils literal notranslate"><spanclass="pre">bin/</span></code> directory holds OS-specific binaries that will be used when installing Evennia with <codeclass="docutils literal notranslate"><spanclass="pre">pip</span></code> as per the <aclass="reference internal"href="Getting-Started.html"><spanclass="doc">Getting started</span></a> instructions. The library itself is in the <codeclass="docutils literal notranslate"><spanclass="pre">evennia</span></code> subfolder. From your code you will access this subfolder simply by <codeclass="docutils literal notranslate"><spanclass="pre">import</span><spanclass="pre">evennia</span></code>.</p>
<ulclass="simple">
<li><p>evennia</p>
<ul>
<li><p><aclass="reference internal"href="Evennia-API.html"><spanclass="doc">__init__.py</span></a> - The “flat API” of Evennia resides here.</p></li>
<li><p><aclass="reference internal"href="Commands.html"><spanclass="doc">commands/</span></a> - The command parser and handler.</p>
<ul>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">default/</span></code> - The <aclass="reference internal"href="Default-Command-Help.html"><spanclass="doc">default commands</span></a> and cmdsets.</p></li>
</ul>
</li>
<li><p><aclass="reference internal"href="Communications.html"><spanclass="doc">comms/</span></a> - Systems for communicating in-game.</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">contrib/</span></code> - Optional plugins too game-specific for core Evennia.</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">game_template/</span></code> - Copied to become the “game directory” when using <codeclass="docutils literal notranslate"><spanclass="pre">evennia</span><spanclass="pre">--init</span></code>.</p></li>
<li><p><aclass="reference internal"href="Help-System.html"><spanclass="doc">help/</span></a> - Handles the storage and creation of help entries.</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">locale/</span></code> - Language files (<aclass="reference internal"href="Internationalization.html"><spanclass="doc">i18n</span></a>).</p></li>
<li><p><aclass="reference internal"href="Locks.html"><spanclass="doc">locks/</span></a> - Lock system for restricting access to in-game entities.</p></li>
<li><p><aclass="reference internal"href="Objects.html"><spanclass="doc">objects/</span></a> - In-game entities (all types of items and Characters).</p></li>
<li><p><aclass="reference internal"href="Spawner-and-Prototypes.html"><spanclass="doc">prototypes/</span></a> - Object Prototype/spawning system and OLC menu</p></li>
<li><p><aclass="reference internal"href="Scripts.html"><spanclass="doc">scripts/</span></a> - Out-of-game entities equivalence to Objects, also with timer support.</p></li>
<li><p><aclass="reference internal"href="Portal-And-Server.html"><spanclass="doc">server/</span></a> - Core server code and Session handling.</p>
<ul>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">portal/</span></code> - Portal proxy and connection protocols.</p></li>
</ul>
</li>
<li><p><aclass="reference external"href="Server-Conf#Settings-file"><codeclass="docutils literal notranslate"><spanclass="pre">settings_default.py</span></code></a> - Root settings of Evennia. Copy settings from here to <codeclass="docutils literal notranslate"><spanclass="pre">mygame/server/settings.py</span></code> file.</p></li>
<li><p><aclass="reference internal"href="Typeclasses.html"><spanclass="doc">typeclasses/</span></a> - Abstract classes for the typeclass storage and database system.</p></li>
<li><p><aclass="reference internal"href="Coding-Utils.html"><spanclass="doc">utils/</span></a> - Various miscellaneous useful coding resources.</p></li>
<li><p><aclass="reference internal"href="Web-Features.html"><spanclass="doc">web/</span></a> - Web resources and webserver. Partly copied into game directory on initialization.</p></li>
</ul>
</li>
</ul>
<p>All directories contain files ending in <codeclass="docutils literal notranslate"><spanclass="pre">.py</span></code>. These are Python <em>modules</em> and are the basic units of Python code. The roots of directories also have (usually empty) files named <codeclass="docutils literal notranslate"><spanclass="pre">__init__.py</span></code>. These are required by Python so as to be able to find and import modules in other directories. When you have run Evennia at least once you will find that there will also be <codeclass="docutils literal notranslate"><spanclass="pre">.pyc</span></code> files appearing, these are pre-compiled binary versions of the <codeclass="docutils literal notranslate"><spanclass="pre">.py</span></code> files to speed up execution.</p>
<p>The root of the <codeclass="docutils literal notranslate"><spanclass="pre">evennia</span></code> folder has an <codeclass="docutils literal notranslate"><spanclass="pre">__init__.py</span></code> file containing the “<aclass="reference internal"href="Evennia-API.html"><spanclass="doc">flat API</span></a>”. This holds shortcuts to various subfolders in the evennia library. It is provided to make it easier to find things; it allows you to just import <codeclass="docutils literal notranslate"><spanclass="pre">evennia</span></code> and access things from that rather than having to import from their actual locations inside the source tree.</p>