| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317 |
- <!DOCTYPE html>
- <html class="writer-html4" lang="en" >
- <head>
- <meta charset="utf-8" />
-
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-
- <title>Basic concepts — Crown Manual 0.44.0 documentation</title>
-
-
- <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
- <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
-
-
-
-
-
- <!--[if lt IE 9]>
- <script src="_static/js/html5shiv.min.js"></script>
- <![endif]-->
-
-
- <script type="text/javascript">
- var DOCUMENTATION_OPTIONS = {
- URL_ROOT:'./',
- VERSION:'0.44.0',
- LANGUAGE:'None',
- COLLAPSE_INDEX:false,
- FILE_SUFFIX:'.html',
- HAS_SOURCE: true,
- SOURCELINK_SUFFIX: ''
- };
- </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/js/theme.js"></script>
-
- <link rel="copyright" title="Copyright" href="copyright.html" />
- <link rel="next" title="Lua API reference" href="lua_api.html" />
- <link rel="prev" title="Introduction" href="introduction.html" />
- </head>
- <body class="wy-body-for-nav">
-
- <div class="wy-grid-for-nav">
-
- <nav data-toggle="wy-nav-shift" class="wy-nav-side">
- <div class="wy-side-scroll">
- <div class="wy-side-nav-search" >
-
-
- <a href="index.html">
-
-
-
- <img src="_static/crown-logo-white.svg" class="logo" alt="Logo"/>
-
- </a>
-
-
-
- <div class="version">
- 0.44.0
- </div>
-
-
-
- <div role="search">
- <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
- <input type="text" name="q" placeholder="Search docs" />
- <input type="hidden" name="check_keywords" value="yes" />
- <input type="hidden" name="area" value="default" />
- </form>
- </div>
-
- </div>
-
- <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
-
-
-
-
-
-
- <ul class="current">
- <li class="toctree-l1"><a class="reference internal" href="changelog.html">Changelog</a></li>
- <li class="toctree-l1"><a class="reference internal" href="introduction.html">Introduction</a></li>
- <li class="toctree-l1 current"><a class="current reference internal" href="">Basic concepts</a><ul>
- <li class="toctree-l2"><a class="reference internal" href="#the-source-directory">The source directory</a></li>
- <li class="toctree-l2"><a class="reference internal" href="#the-boot-directory-and-the-boot-config-file">The boot directory and the boot.config file</a></li>
- <li class="toctree-l2"><a class="reference internal" href="#the-data-directory">The data directory</a></li>
- <li class="toctree-l2"><a class="reference internal" href="#the-dataignore-file">The .dataignore file</a></li>
- <li class="toctree-l2"><a class="reference internal" href="#units-of-measurement">Units of measurement</a></li>
- </ul>
- </li>
- <li class="toctree-l1"><a class="reference internal" href="lua_api.html">Lua API reference</a></li>
- <li class="toctree-l1"><a class="reference internal" href="boot_config.html">boot.config reference</a></li>
- <li class="toctree-l1"><a class="reference internal" href="command_line.html">Command line reference</a></li>
- <li class="toctree-l1"><a class="reference internal" href="glossary.html">Glossary</a></li>
- <li class="toctree-l1"><a class="reference internal" href="copyright.html">License</a></li>
- </ul>
- <ul>
- <li class="toctree-l1"><a class="reference internal" href="hackers/index.html">Hackers</a></li>
- </ul>
-
-
- </div>
-
- </div>
- </nav>
- <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
-
- <nav class="wy-nav-top" aria-label="top navigation">
-
- <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
- <a href="index.html">Crown Manual</a>
-
- </nav>
- <div class="wy-nav-content">
-
- <div class="rst-content">
-
-
- <div role="navigation" aria-label="breadcrumbs navigation">
- <ul class="wy-breadcrumbs">
-
- <li><a href="index.html" class="icon icon-home"></a> »</li>
-
- <li>Basic concepts</li>
-
-
- <li class="wy-breadcrumbs-aside">
-
-
- <a href="_sources/basics.txt" rel="nofollow"> View page source</a>
-
-
- </li>
-
- </ul>
-
- <hr/>
- </div>
- <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
- <div itemprop="articleBody">
-
- <div class="section" id="basic-concepts">
- <h1>Basic concepts<a class="headerlink" href="#basic-concepts" title="Permalink to this headline">¶</a></h1>
- <div class="section" id="the-source-directory">
- <h2>The source directory<a class="headerlink" href="#the-source-directory" title="Permalink to this headline">¶</a></h2>
- <p>The source directory contains all the files that make up an application.</p>
- <p>There is no fixed structure for the files and folders in the source directory, you can organize
- your content as you see fit. You can for example decide to put all the textures and sounds in the
- “textures” and “sounds” folders, or maybe sort the content on a per-object basis by putting all the
- assets for an enemy in the “units/enemy” folder.</p>
- <p>There is, however, a small number of required files which are needed for the engine to start-up
- correctly:</p>
- <div class="code highlight-python"><div class="highlight"><pre>.
- ├── boot.config <- First file loaded by the engine
- ├── boot.package <- Package to load on boot
- ├── boot.lua <- Lua script to launch on boot
- └── global.physics_config <- Global physics-related configurations
- </pre></div>
- </div>
- </div>
- <div class="section" id="the-boot-directory-and-the-boot-config-file">
- <h2>The boot directory and the boot.config file<a class="headerlink" href="#the-boot-directory-and-the-boot-config-file" title="Permalink to this headline">¶</a></h2>
- <p>Any directory within <a class="reference internal" href="#the-source-directory">the source directory</a> containing the file named <code class="docutils literal"><span class="pre">boot.config</span></code> is a boot
- directory.</p>
- <p>The <code class="docutils literal"><span class="pre">boot.config</span></code> is the first file read by Crown; it specifies the package to load and the lua
- script to execute on boot and various other boot-time settings.
- See boot.config reference for details.</p>
- <p>Normally there is a single <code class="docutils literal"><span class="pre">boot.config</span></code> file, placed at the top of the source directory. This is
- the file which Crown looks at by default.</p>
- <p>In some circumstances is desirable to have multiple <code class="docutils literal"><span class="pre">boot.config</span></code> files.
- You can set which boot directory Crown should use with the switch <code class="docutils literal"><span class="pre">--boot-dir</span></code>.</p>
- <p>In the example below, a minimal <code class="docutils literal"><span class="pre">boot.config</span></code> file tells the engine to load the package <code class="docutils literal"><span class="pre">boot</span></code>
- and run the Lua script <code class="docutils literal"><span class="pre">lua/game</span></code>.</p>
- <div class="code highlight-python"><div class="highlight"><pre>cat boot.config
- boot_package = "boot" // Package to load on boot
- boot_script = "lua/game" // Lua script to execute on boot
- </pre></div>
- </div>
- </div>
- <div class="section" id="the-data-directory">
- <h2>The data directory<a class="headerlink" href="#the-data-directory" title="Permalink to this headline">¶</a></h2>
- <p>Crown reads source data from <a class="reference internal" href="#the-source-directory">the source directory</a> and compiles it into efficient binary
- representation. The result of the compilation process is stored in the data directory.</p>
- <div class="code highlight-python"><div class="highlight"><pre>.
- ├── data <- Contains compiled data files
- | ├── a14e8dfa2cd... <- Compiled file
- | ├── 72e3cc03787... <- Another compiled file
- | └── ...
- ├── data_index.sjson <- Used to convert resource IDs to human-readable names
- ├── last.log <- Text log from the last engine execution
- └── temp <- Temporary files from data compilers
- </pre></div>
- </div>
- </div>
- <div class="section" id="the-dataignore-file">
- <h2>The .dataignore file<a class="headerlink" href="#the-dataignore-file" title="Permalink to this headline">¶</a></h2>
- <p>The <code class="docutils literal"><span class="pre">.dataignore</span></code> file specifies files that Crown should ignore when compiling data.</p>
- <p>When Crown bumps into unknown files in the source directory, it reports an error and quits the
- compilation.
- This is often desired behavior, since you do not want non-essential data in your source directory.</p>
- <p>In all other cases, you should create a <code class="docutils literal"><span class="pre">.dataignore</span></code> in the source directory.</p>
- <p>Example:</p>
- <div class="code highlight-python"><div class="highlight"><pre>cat .dataignore
- # This is a comment.
- # Blank lines are ignored.
- # Everything else is simple glob pattern (*, ?).
- *.txt
- </pre></div>
- </div>
- </div>
- <div class="section" id="units-of-measurement">
- <h2>Units of measurement<a class="headerlink" href="#units-of-measurement" title="Permalink to this headline">¶</a></h2>
- <p>Crown uses MKS (meters, kilograms and seconds) units and radians for angles.</p>
- </div>
- </div>
- </div>
-
- </div>
- <footer>
-
- <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
-
- <a href="lua_api.html" class="btn btn-neutral float-right" title="Lua API reference" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
-
-
- <a href="introduction.html" class="btn btn-neutral float-left" title="Introduction" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
-
- </div>
-
- <hr/>
- <div role="contentinfo">
- <p>
- © <a href="copyright.html">Copyright</a> Except where otherwise noted, content on this page is licensed under a CC-BY-SA 4.0 Int. License.
- </p>
- </div>
-
-
-
- Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
-
- <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
-
- provided by <a href="https://readthedocs.org">Read the Docs</a>.
- </footer>
- </div>
- </div>
- </section>
- </div>
-
- <script type="text/javascript">
- jQuery(function () {
- SphinxRtdTheme.Navigation.enable(true);
- });
- </script>
-
-
-
-
- </body>
- </html>
|