evennia/docs/0.x/Directory-Overview.html
2023-12-20 19:10:09 +01:00

197 lines
No EOL
15 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
<title>Directory Overview &#8212; Evennia 0.9.5 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/language_data.js"></script>
<script async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"processClass": "tex2jax_process|mathjax_process|math|output_area"}})</script>
<link rel="shortcut icon" href="_static/favicon.ico"/>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">Evennia 0.9.5</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Directory Overview</a></li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<section class="tex2jax_ignore mathjax_ignore" id="directory-overview">
<h1>Directory Overview<a class="headerlink" href="#directory-overview" title="Permalink to this headline"></a></h1>
<p>This is an overview of the directories relevant to Evennia coding.</p>
<section id="the-game-directory">
<h2>The Game directory<a class="headerlink" href="#the-game-directory" title="Permalink to this headline"></a></h2>
<p>The game directory is created with <code class="docutils literal notranslate"><span class="pre">evennia</span> <span class="pre">--init</span> <span class="pre">&lt;name&gt;</span></code>. In the Evennia documentation we always
assume its called <code class="docutils literal notranslate"><span class="pre">mygame</span></code>. Apart from the <code class="docutils literal notranslate"><span class="pre">server/</span></code> subfolder within, you could reorganize this
folder if you preferred a different code structure for your game.</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">mygame/</span></code></p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">commands/</span></code> - Overload default <a class="reference internal" href="Commands.html"><span class="doc std std-doc">Commands</span></a> or add your own Commands/<a class="reference internal" href="Command-Sets.html"><span class="doc std std-doc">Command
sets</span></a> here.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">server</span></code>/ - The structure of this folder should not change since Evennia expects it.</p>
<ul>
<li><p><a class="reference external" href="https://github.com/evennia/evennia/tree/master/evennia/game_template/server"><code class="docutils literal notranslate"><span class="pre">conf/</span></code></a> - All
server configuration files sits here. The most important file is <code class="docutils literal notranslate"><span class="pre">settings.py</span></code>.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">logs/</span></code> - Portal log files are stored here (Server is logging to the terminal by default)</p></li>
</ul>
</li>
<li><p><code class="docutils literal notranslate"><span class="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><code class="docutils literal notranslate"><span class="pre">web/</span></code> - This holds the <a class="reference internal" href="Web-Features.html"><span class="doc std std-doc">Web features</span></a> of your game.</p></li>
<li><p><code class="docutils literal notranslate"><span class="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 dont fit with one of the other folders.</p></li>
</ul>
</section>
<section id="evennia-library-layout">
<h2>Evennia library layout:<a class="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 <code class="docutils literal notranslate"><span class="pre">evennia</span></code>. The
top level of it contains Python package specific stuff such as a readme file, <code class="docutils literal notranslate"><span class="pre">setup.py</span></code> etc. It
also has two subfolders<code class="docutils literal notranslate"><span class="pre">bin/</span></code> and <code class="docutils literal notranslate"><span class="pre">evennia/</span></code> (again).</p>
<p>The <code class="docutils literal notranslate"><span class="pre">bin/</span></code> directory holds OS-specific binaries that will be used when installing Evennia with <code class="docutils literal notranslate"><span class="pre">pip</span></code>
as per the <a class="reference internal" href="Getting-Started.html"><span class="doc std std-doc">Getting started</span></a> instructions. The library itself is in the <code class="docutils literal notranslate"><span class="pre">evennia</span></code>
subfolder. From your code you will access this subfolder simply by <code class="docutils literal notranslate"><span class="pre">import</span> <span class="pre">evennia</span></code>.</p>
<ul class="simple">
<li><p>evennia</p>
<ul>
<li><p><a class="reference internal" href="Evennia-API.html"><span class="doc std std-doc"><code class="docutils literal notranslate"><span class="pre">__init__.py</span></code></span></a> - The “flat API” of Evennia resides here.</p></li>
<li><p><a class="reference internal" href="Commands.html"><span class="doc std std-doc"><code class="docutils literal notranslate"><span class="pre">commands/</span></code></span></a> - The command parser and handler.</p>
<ul>
<li><p><code class="docutils literal notranslate"><span class="pre">default/</span></code> - The <a class="reference internal" href="Default-Commands.html"><span class="doc std std-doc">default commands</span></a> and cmdsets.</p></li>
</ul>
</li>
<li><p><a class="reference internal" href="Communications.html"><span class="doc std std-doc"><code class="docutils literal notranslate"><span class="pre">comms/</span></code></span></a> - Systems for communicating in-game.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">contrib/</span></code> - Optional plugins too game-specific for core Evennia.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">game_template/</span></code> - Copied to become the “game directory” when using <code class="docutils literal notranslate"><span class="pre">evennia</span> <span class="pre">--init</span></code>.</p></li>
<li><p><a class="reference internal" href="Help-System.html"><span class="doc std std-doc"><code class="docutils literal notranslate"><span class="pre">help/</span></code></span></a> - Handles the storage and creation of help entries.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">locale/</span></code> - Language files (<a class="reference internal" href="Internationalization.html"><span class="doc std std-doc">i18n</span></a>).</p></li>
<li><p><a class="reference internal" href="Locks.html"><span class="doc std std-doc"><code class="docutils literal notranslate"><span class="pre">locks/</span></code></span></a> - Lock system for restricting access to in-game entities.</p></li>
<li><p><a class="reference internal" href="Objects.html"><span class="doc std std-doc"><code class="docutils literal notranslate"><span class="pre">objects/</span></code></span></a> - In-game entities (all types of items and Characters).</p></li>
<li><p><a class="reference internal" href="Spawner-and-Prototypes.html"><span class="doc std std-doc"><code class="docutils literal notranslate"><span class="pre">prototypes/</span></code></span></a> - Object Prototype/spawning system and OLC menu</p></li>
<li><p><a class="reference internal" href="Accounts.html"><span class="doc std std-doc"><code class="docutils literal notranslate"><span class="pre">accounts/</span></code></span></a> - Out-of-game Session-controlled entities (accounts, bots etc)</p></li>
<li><p><a class="reference internal" href="Scripts.html"><span class="doc std std-doc"><code class="docutils literal notranslate"><span class="pre">scripts/</span></code></span></a> - Out-of-game entities equivalence to Objects, also with timer support.</p></li>
<li><p><a class="reference internal" href="Portal-And-Server.html"><span class="doc std std-doc"><code class="docutils literal notranslate"><span class="pre">server/</span></code></span></a> - Core server code and Session handling.</p>
<ul>
<li><p><code class="docutils literal notranslate"><span class="pre">portal/</span></code> - Portal proxy and connection protocols.</p></li>
</ul>
</li>
<li><p><a class="reference internal" href="Server-Conf.html#settings-file"><span class="std std-doc"><code class="docutils literal notranslate"><span class="pre">settings_default.py</span></code></span></a> - Root settings of Evennia. Copy settings
from here to <code class="docutils literal notranslate"><span class="pre">mygame/server/settings.py</span></code> file.</p></li>
<li><p><a class="reference internal" href="Typeclasses.html"><span class="doc std std-doc"><code class="docutils literal notranslate"><span class="pre">typeclasses/</span></code></span></a> - Abstract classes for the typeclass storage and database system.</p></li>
<li><p><a class="reference internal" href="Coding-Utils.html"><span class="doc std std-doc"><code class="docutils literal notranslate"><span class="pre">utils/</span></code></span></a> - Various miscellaneous useful coding resources.</p></li>
<li><p><a class="reference internal" href="Web-Features.html"><span class="doc std std-doc"><code class="docutils literal notranslate"><span class="pre">web/</span></code></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 <code class="docutils literal notranslate"><span class="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 <code class="docutils literal notranslate"><span class="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 <code class="docutils literal notranslate"><span class="pre">.pyc</span></code> files appearing, these are
pre-compiled binary versions of the <code class="docutils literal notranslate"><span class="pre">.py</span></code> files to speed up execution.</p>
<p>The root of the <code class="docutils literal notranslate"><span class="pre">evennia</span></code> folder has an <code class="docutils literal notranslate"><span class="pre">__init__.py</span></code> file containing the “<a class="reference internal" href="Evennia-API.html"><span class="doc std std-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 <code class="docutils literal notranslate"><span class="pre">evennia</span></code> and access things from that rather than
having to import from their actual locations inside the source tree.</p>
</section>
</section>
<div class="clearer"></div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<p class="logo"><a href="index.html">
<img class="logo" src="_static/evennia_logo.png" alt="Logo"/>
</a></p>
<div id="searchbox" style="display: none" role="search">
<h3 id="searchlabel">Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="search.html" method="get">
<input type="text" name="q" aria-labelledby="searchlabel" />
<input type="submit" value="Go" />
</form>
</div>
</div>
<script>$('#searchbox').show(0);</script>
<p><h3><a href="index.html">Table of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Directory Overview</a><ul>
<li><a class="reference internal" href="#the-game-directory">The Game directory</a></li>
<li><a class="reference internal" href="#evennia-library-layout">Evennia library layout:</a></li>
</ul>
</li>
</ul>
<div role="note" aria-label="source link">
<!--h3>This Page</h3-->
<ul class="this-page-menu">
<li><a href="_sources/Directory-Overview.md.txt"
rel="nofollow">Show Page Source</a></li>
</ul>
</div><h3>Links</h3>
<ul>
<li><a href="https://www.evennia.com">Home page</a> </li>
<li><a href="https://github.com/evennia/evennia">Evennia Github</a> </li>
<li><a href="http://games.evennia.com">Game Index</a> </li>
<li><a href="http://webchat.freenode.net/?channels=evennia&uio=MT1mYWxzZSY5PXRydWUmMTE9MTk1JjEyPXRydWUbb">IRC</a> -
<a href="https://discord.gg/NecFePw">Discord</a> -
<a href="https://groups.google.com/forum/#%21forum/evennia">Forums</a>
</li>
<li><a href="http://evennia.blogspot.com/">Evennia Dev blog</a> </li>
</ul>
<h3>Versions</h3>
<ul>
<li><a href="../1.0-dev/index.html">1.0-dev (develop branch)</a></li>
<li><a href="Directory-Overview.html">0.9.5 (v0.9.5 branch)</a></li>
</ul>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="nav-item nav-item-0"><a href="index.html">Evennia 0.9.5</a> &#187;</li>
<li class="nav-item nav-item-this"><a href="">Directory Overview</a></li>
</ul>
</div>
<div class="footer" role="contentinfo">
&#169; Copyright 2020, The Evennia developer community.
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 3.2.1.
</div>
</body>
</html>