Home - codemetropolis/CodeMetropolis GitHub Wiki

Welcome to the CodeMetropolis wiki!

Cumulative flow diagram: https://docs.google.com/spreadsheets/d/12WAAlJYf1H3XvC4GrA3H2rUUWhp40h-Pk7q3AH5ONwg/edit?usp=sharing

Learning

SonarQube

Let's see the whole progress in the following diagram:

Process of generating city from code

Running SourceMeter, we get the graph file, which is required for the Converter Tool. This tool produces an XML file, which defines different elements with wide range of properties. The Mapping Tool will use this XML and generates an output XML file for the Rendering tool, which will creates an other XML from it for the Rendering Tool. Rendering Tool will produce the world, which can be played in MineCraft client. You can find the generated world in the output directory. You have to copy this folder to the “saves” folder in root of Minecraft. You can usually find it at “C:\Users<username>\AppData\Roaming.minecraft" directory.

The mapping file is an XML file, which contains the definition of different metrics:

 <linking>
      <source name="Method" from="McCC" />
      <target name="floor" to="character" />
      <conversions>
           <conversion type="quantization">
                <parameter name="level0" value="glass" />
                <parameter name="level1" value="sand" />
                <parameter name="level2" value="planks" />
                <parameter name="level3" value="stone" />
                <parameter name="level4" value="obsidian" />
           </conversion>
      </conversions>
 </linking>

This is the input of the Mapping Tool. The output is also an XML, which will be the input of the Placing Tool:

<buildable id="8b224e44-26f8-4ab3-94b0-7831238e3d7a" name="void performExp()" type="floor">
    <position x="0" y="0" z="0"/>
    <size x="9" y="17" z="11"/>
    <attributes>
        <attribute name="external_character" value="metal"/>
        <attribute name="character" value="glass"/>
        <attribute name="torches" value="1"/>
    </attributes>
    <children/>
</buildable>

The Placing tool generates an XML file, which will be the input of the Rendering Tool. This picture shows a part of it:

<buildable id="8b224e44-26f8-4ab3-94b0-7831238e3d7a" name="void performExp()" type="floor">
    <position x="26" y="63" z="76"/>
    <size x="9" y="17" z="11"/>
    <attributes>
        <attribute name="external_character" value="metal"/>
        <attribute name="character" value="glass"/>
        <attribute name="torches" value="1"/>
    </attributes>
    <children/>
</buildable>

The output XML of Mapping and Placing Tool are very similar at first sight. The main difference between them is that the mappingToPlacing.xml contains only the structure and the main attributes of the city, while the second one describes the size of inner buildings, like floor and cellar.

⚠️ **GitHub.com Fallback** ⚠️