mirror of
https://github.com/evennia/evennia.git
synced 2026-03-25 01:06:32 +01:00
Updated HTML docs.
This commit is contained in:
parent
2c44fb26f8
commit
b902667df5
144 changed files with 16138 additions and 4920 deletions
|
|
@ -111,31 +111,26 @@
|
|||
|
||||
<section class="tex2jax_ignore mathjax_ignore" id="soft-code">
|
||||
<h1>Soft Code<a class="headerlink" href="#soft-code" title="Permalink to this headline">¶</a></h1>
|
||||
<p>Softcode is a very simple programming language that was created for in-game development on TinyMUD derivatives such as MUX, PennMUSH, TinyMUSH, and RhostMUSH. The idea is that by providing a stripped down, minimalistic language for in-game use, you can allow quick and easy building and game development to happen without having to learn C/C++. There is an added benefit of not having to have to hand out shell access to all developers, and permissions can be used to alleviate many security problems.</p>
|
||||
<p>Writing and installing softcode is done through a MUD client. Thus it is not a formatted language.
|
||||
Each softcode function is a single line of varying size. Some functions can be a half of a page long
|
||||
or more which is obviously not very readable nor (easily) maintainable over time.</p>
|
||||
<p>Softcode is a simple programming language that was created for in-game development on TinyMUD derivatives such as MUX, PennMUSH, TinyMUSH, and RhostMUSH. The idea was that by providing a stripped down, minimalistic language for in-game use, you could allow quick and easy building and game development to happen without builders having to learn the ‘hardcode’ language for those servers (C/C++). There is an added benefit of not having to have to hand out shell access to all developers. Permissions in softcode can be used to alleviate many security problems.</p>
|
||||
<p>Writing and installing softcode is done through a MUD client. Thus it is not a formatted language. Each softcode function is a single line of varying size. Some functions can be a half of a page long or more which is obviously not very readable nor (easily) maintainable over time.</p>
|
||||
<section id="examples-of-softcode">
|
||||
<h2>Examples of Softcode<a class="headerlink" href="#examples-of-softcode" title="Permalink to this headline">¶</a></h2>
|
||||
<p>Here is a simple ‘Hello World!’ command:</p>
|
||||
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="w"> </span>@set<span class="w"> </span><span class="nv">me</span><span class="o">=</span>HELLO_WORLD.C:<span class="nv">$hello</span>:@pemit<span class="w"> </span>%#<span class="o">=</span>Hello<span class="w"> </span>World!
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>Pasting this into a MUX/MUSH and typing ‘hello’ will theoretically yield ‘Hello World!’, assuming
|
||||
certain flags are not set on your account object.</p>
|
||||
<p>Setting attributes is done via <code class="docutils literal notranslate"><span class="pre">@set</span></code>. Softcode also allows the use of the ampersand (<code class="docutils literal notranslate"><span class="pre">&</span></code>) symbol.
|
||||
This shorter version looks like this:</p>
|
||||
<p>Pasting this into a MUD client, sending it to a MUX/MUSH server and typing ‘hello’ will theoretically yield ‘Hello World!’, assuming certain flags are not set on your account object.</p>
|
||||
<p>Setting attributes in Softcode is done via <code class="docutils literal notranslate"><span class="pre">@set</span></code>. Softcode also allows the use of the ampersand (<code class="docutils literal notranslate"><span class="pre">&</span></code>) symbol. This shorter version looks like this:</p>
|
||||
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="w"> </span><span class="p">&</span>HELLO_WORLD.C<span class="w"> </span><span class="nv">me</span><span class="o">=</span><span class="nv">$hello</span>:@pemit<span class="w"> </span>%#<span class="o">=</span>Hello<span class="w"> </span>World!
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>Perhaps I want to break the Hello World into an attribute which is retrieved when emitting:</p>
|
||||
<p>We could also read the text from an attribute which is retrieved when emitting:</p>
|
||||
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="w"> </span><span class="p">&</span>HELLO_VALUE.D<span class="w"> </span><span class="nv">me</span><span class="o">=</span>Hello<span class="w"> </span>World
|
||||
<span class="w"> </span><span class="p">&</span>HELLO_WORLD.C<span class="w"> </span><span class="nv">me</span><span class="o">=</span><span class="nv">$hello</span>:@pemit<span class="w"> </span>%#<span class="o">=[</span>v<span class="o">(</span>HELLO_VALUE.D<span class="o">)]</span>
|
||||
</pre></div>
|
||||
</div>
|
||||
<p>The <code class="docutils literal notranslate"><span class="pre">v()</span></code> function returns the <code class="docutils literal notranslate"><span class="pre">HELLO_VALUE.D</span></code> attribute on the object that the command resides
|
||||
(<code class="docutils literal notranslate"><span class="pre">me</span></code>, which is yourself in this case). This should yield the same output as the first example.</p>
|
||||
<p>If you are still curious about how Softcode works, take a look at some external resources:</p>
|
||||
<p>The <code class="docutils literal notranslate"><span class="pre">v()</span></code> function returns the <code class="docutils literal notranslate"><span class="pre">HELLO_VALUE.D</span></code> attribute on the object that the command resides (<code class="docutils literal notranslate"><span class="pre">me</span></code>, which is yourself in this case). This should yield the same output as the first example.</p>
|
||||
<p>If you are curious about how MUSH/MUX Softcode works, take a look at some external resources:</p>
|
||||
<ul class="simple">
|
||||
<li><p><a class="reference external" href="https://wiki.tinymux.org/index.php/Softcode">https://wiki.tinymux.org/index.php/Softcode</a></p></li>
|
||||
<li><p><a class="reference external" href="https://www.duh.com/discordia/mushman/man2x1">https://www.duh.com/discordia/mushman/man2x1</a></p></li>
|
||||
|
|
@ -144,25 +139,24 @@ This shorter version looks like this:</p>
|
|||
<section id="problems-with-softcode">
|
||||
<h2>Problems with Softcode<a class="headerlink" href="#problems-with-softcode" title="Permalink to this headline">¶</a></h2>
|
||||
<p>Softcode is excellent at what it was intended for: <em>simple things</em>. It is a great tool for making an interactive object, a room with ambiance, simple global commands, simple economies and coded systems. However, once you start to try to write something like a complex combat system or a higher end economy, you’re likely to find yourself buried under a mountain of functions that span multiple objects across your entire code.</p>
|
||||
<p>Not to mention, softcode is not an inherently fast language. It is not compiled, it is parsed with each calling of a function. While MUX and MUSH parsers have jumped light years ahead of where they once were they can still stutter under the weight of more complex systems if not designed properly.</p>
|
||||
<p>Not to mention, softcode is not an inherently fast language. It is not compiled, it is parsed with each calling of a function. While MUX and MUSH parsers have jumped light years ahead of where they once were, they can still stutter under the weight of more complex systems if those are not designed properly.</p>
|
||||
<p>Also, Softcode is not a standardized language. Different servers each have their own slight variations. Code tools and resources are also limited to the documentation from those servers.</p>
|
||||
</section>
|
||||
<section id="changing-times">
|
||||
<h2>Changing Times<a class="headerlink" href="#changing-times" title="Permalink to this headline">¶</a></h2>
|
||||
<p>Now that starting text-based games is easy and an option for even the most technically inarticulate, new projects are a dime a dozen. People are starting new MUDs every day with varying levels of commitment and ability. Because of this shift from fewer, larger, well-staffed games to a bunch of small, one or two developer games, some of the benefit of softcode fades.</p>
|
||||
<p>Softcode is great in that it allows a mid to large sized staff all work on the same game without stepping on one another’s toes. As mentioned before, shell access is not necessary to develop a MUX or a MUSH. However, now that we are seeing a lot more small, one or two-man shops, the issue of shell access and stepping on each other’s toes is a lot less.</p>
|
||||
<p>Now that starting text-based games is easy and an option for even the most technically inarticulate, new projects are a dime a dozen. People are starting new MUDs every day with varying levels of commitment and ability. Because of this shift from fewer, larger, well-staffed games to a bunch of small, one or two developer games, the benefit of softcode fades.</p>
|
||||
<p>Softcode is great in that it allows a mid to large sized staff all work on the same game without stepping on one another’s toes without shell access. However, the rise of modern code collaboration tools (such as private github/gitlab repos) has made it trivial to collaborate on code.</p>
|
||||
</section>
|
||||
<section id="our-solution">
|
||||
<h2>Our Solution<a class="headerlink" href="#our-solution" title="Permalink to this headline">¶</a></h2>
|
||||
<p>Evennia shuns in-game softcode for on-disk Python modules. Python is a popular, mature and
|
||||
professional programming language. You code it using the conveniences of modern text editors.
|
||||
Evennia developers have access to the entire library of Python modules out there in the wild - not
|
||||
to mention the vast online help resources available. Python code is not bound to one-line functions
|
||||
on objects but complex systems may be organized neatly into real source code modules, sub-modules, or even broken out into entire Python packages as desired.</p>
|
||||
<p>So what is <em>not</em> included in Evennia is a MUX/MOO-like online player-coding system. Advanced coding in Evennia is primarily intended to be done outside the game, in full-fledged Python modules. Advanced building is best handled by extending Evennia’s command system with your own sophisticated building commands. We feel that with a small development team you are better off using a professional source-control system (svn, git, bazaar, mercurial etc) anyway.</p>
|
||||
<p>Evennia shuns in-game softcode for on-disk Python modules. Python is a popular, mature and professional programming language. Evennia developers have access to the entire library of Python modules out there in the wild - not to mention the vast online help resources available. Python code is not bound to one-line functions on objects; complex systems may be organized neatly into real source code modules, sub-modules, or even broken out into entire Python packages as desired.</p>
|
||||
<p>So what is <em>not</em> included in Evennia is a MUX/MOO-like online player-coding system (aka Softcode). Advanced coding in Evennia is primarily intended to be done outside the game, in full-fledged Python modules (what MUSH would call ‘hardcode’). Advanced building is best handled by extending Evennia’s command system with your own sophisticated building commands.</p>
|
||||
<p>In Evennia you develop your MU like you would any piece of modern software - using your favorite code editor/IDE and online code sharing tools.</p>
|
||||
</section>
|
||||
<section id="your-solution">
|
||||
<h2>Your Solution<a class="headerlink" href="#your-solution" title="Permalink to this headline">¶</a></h2>
|
||||
<p>Adding advanced and flexible building commands to your game is easy and will probably be enough to satisfy most creative builders. However, if you really, <em>really</em> want to offer online coding, there is of course nothing stopping you from adding that to Evennia, no matter our recommendations. You could even re-implement MUX’ softcode in Python should you be very ambitious. The <a class="reference internal" href="../Contribs/Contrib-Ingame-Python.html"><span class="doc std std-doc">in-game-python</span></a> is an optional pseudo-softcode plugin aimed at developers wanting to script their game from inside it.</p>
|
||||
<p>Adding advanced and flexible building commands to your game is easy and will probably be enough to satisfy most creative builders. However, if you really, <em>really</em> want to offer online coding, there is of course nothing stopping you from adding that to Evennia, no matter our recommendations. You could even re-implement MUX’ softcode in Python should you be very ambitious.</p>
|
||||
<p>In default Evennia, the <span class="xref myst">Funcparser</span> system allows for simple remapping of text on-demand without becomeing a full softcode language. The <span class="xref myst">contribs</span> has several tools and utililities to start from when adding more complex in-game building.</p>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue