<p>Evennia recommends using <aclass="reference internal"href="../Components/Tags.html"><spanclass="doc std std-doc">Tags</span></a> to create zones and other groupings.</p>
<p>Say you create a room named <em>Meadow</em> in your nice big forest MUD. That’s all nice and dandy, but
what if you, in the other end of that forest want another <em>Meadow</em>? As a game creator, this can
cause all sorts of confusion. For example, teleporting to <em>Meadow</em> will now give you a warning that
there are two <em>Meadow</em> s and you have to select which one. It’s no problem to do that, you just
choose for example to go to <codeclass="docutils literal notranslate"><spanclass="pre">2-meadow</span></code>, but unless you examine them you couldn’t be sure which of
the two sat in the magical part of the forest and which didn’t.</p>
<p>Another issue is if you want to group rooms in geographic regions. Let’s say the “normal” part of
the forest should have separate weather patterns from the magical part. Or maybe a magical
disturbance echoes through all magical-forest rooms. It would then be convenient to be able to
simply find all rooms that are “magical” so you could send messages to them.</p>
<sectionid="zones-in-evennia">
<h2>Zones in Evennia<aclass="headerlink"href="#zones-in-evennia"title="Permalink to this headline">¶</a></h2>
<p><em>Zones</em> try to separate rooms by global location. In our example we would separate the forest into two parts - the magical and the non-magical part. Each have a <em>Meadow</em> and rooms belonging to each part should be easy to retrieve.</p>
<p>All objects in Evennia can hold any number of <aclass="reference internal"href="../Components/Tags.html"><spanclass="doc std std-doc">Tags</span></a>. Tags are short labels that you attach to objects. They make it very easy to retrieve groups of objects. An object can have any number of different tags. So let’s attach the relevant tag to our forest:</p>
<codeclass="docutils literal notranslate"><spanclass="pre">dig</span></code> command for this, most likely). You can also use the default <codeclass="docutils literal notranslate"><spanclass="pre">tag</span></code> command during building:</p>
<divclass="highlight-none notranslate"><divclass="highlight"><pre><span></span> tag forestobj = magicalforest : zone
<h2>Using typeclasses and inheritance for zoning<aclass="headerlink"href="#using-typeclasses-and-inheritance-for-zoning"title="Permalink to this headline">¶</a></h2>
<p>The tagging or aliasing systems above don’t instill any sort of functional difference between a magical forest room and a normal one - they are just arbitrary ways to mark objects for quick retrieval later. Any functional differences must be expressed using <aclass="reference internal"href="../Components/Typeclasses.html"><spanclass="doc std std-doc">Typeclasses</span></a>.</p>
<p>Of course, an alternative way to implement zones themselves is to have all rooms/objects in a zone inherit from a given typeclass parent - and then limit your searches to objects inheriting from that given parent. The effect would be similar but you’d need to expand the search functionality to