legacy_site/cave-update-ore-analysis/index.html

96 lines
3.5 KiB
HTML
Raw Permalink Normal View History

2023-10-30 02:22:03 +08:00
<a
class="link"
style="left: 1%; top: 1%; position: absolute"
href="https://peter-tanner.github.io"
>🔗 Back to home page</a
><br /><br /><br />
2021-02-20 22:39:37 +08:00
2023-10-30 02:22:03 +08:00
These graphs are interactive - scroll controls the zoom (alternatively, hover
over the bottom-left corner and use the magnifying glass to select an area). Use
the home icon to reset the view.
2021-02-20 22:39:37 +08:00
2023-10-30 02:22:03 +08:00
<div style="text-align: center">
<h1>Absolute frequency</h1>
<iframe
id="inlineFrameExample"
title="Absolute frequency"
src="abs_freq.html"
onload="this.style.height=this.contentWindow.document.body.scrollHeight;this.style.width=this.contentWindow.document.body.scrollWidth;"
>
</iframe
><br />
*Note that unfortunately the ore per chunk layer doesn't appear on the right
y-axis. You can add the right axis by using the formula: y/(2*512/16)**2<br /><br />
<hr />
<h1>Relative frequency</h1>
<iframe
id="inlineFrameExample"
title="Relative frequency"
src="rel_freq.html"
onload="this.style.height=this.contentWindow.document.body.scrollHeight;this.style.width=this.contentWindow.document.body.scrollWidth;"
>
</iframe>
</div>
<br />
<hr />
<br />
This text was copy-pasted from the github repo at
https://github.com/peter-tanner/minecraft-ore-analysis
<h1>Minecraft ore analysis</h1>
2023-10-30 02:22:03 +08:00
<h2>
Let&#39;s see how the new cave update ore generation compares to the old!
</h2>
<h2>
Go to
<a href="https://peter-tanner.github.io/legacy_site/cave-update-ore-analysis"
>https://peter-tanner.github.io/cave-update-ore-analysis</a
>
for interactive graphs!
</h2>
<h3>
Both tests performed with seed 0 and single biome mode enabled (Extreme hills
biome only, to include emerald ore statistics). Size of 1024*1024 scanned.
</h3>
<h3>
Original world files used for research are located at
<a
href="https://drive.google.com/drive/folders/1RsmfDp4nl5KaFWfCpL5sanK6cGUp45TO?usp=sharing"
>https://drive.google.com/drive/folders/1RsmfDp4nl5KaFWfCpL5sanK6cGUp45TO?usp=sharing</a
>
</h3>
2021-02-20 22:39:37 +08:00
<p>#</p>
2023-10-30 02:22:03 +08:00
<p>
The scripts I&#39;ve created take advantage of a slightly modified
<a href="https://github.com/DonoA/PyAnvilEditor">PyAnvilEditor</a> to parse
the region files.
</p>
<p>
I&#39;ve replaced the code in the <code>276</code> (and everything else under
<code>def close(self):</code>) of the <code>world</code> class of
PyAnvilEditor with <code>true</code> - this is because I&#39;m not writing to
the world file, I only intend to read from it. This saves a large amount of
time spent writing that would go to waste.
</p>
<p>
To generate the graphs I&#39;ve used Matplotlib and I use mpld3 to convert
these graphs into interactive html files for use on my website.
</p>
<p>
We load a large section of the world into memory - ideally, you want to set
the block size to the maximum as this is quicker than loading small sections
of the world repeatedly. Then we iterate through each coordinate in the block
- this takes about 90 seconds with a block radius of <code>128</code>. At each
coordinate we iterate each count for a tile in a particular layer. Once a
whole block has been processed, we add it to the total.
</p>
<p>
The &#39;sum&#39; represents the total amount of a particular ore block within
the whole sample (A 1024*1024 square meter area). The relative frequency
represents the proportion of the total amount of a particular ore that occurs
at a particular y-level.
</p>
<p>
This sample size can be improved on but it would obviously take longer given
that my RAM is limited.
</p>