25.xhtml 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!--
  3. h t t :: / / t /
  4. h t t :: // // t //
  5. h ttttt ttttt ppppp sssss // // y y sssss ttttt //
  6. hhhh t t p p s // // y y s t //
  7. h hh t t ppppp sssss // // yyyyy sssss t //
  8. h h t t p s :: / / y .. s t .. /
  9. h h t t p sssss :: / / yyyyy .. sssss t .. /
  10. <https://y.st./>
  11. Copyright © 2015 Alex Yst <mailto:copyright@y.st>
  12. This program is free software: you can redistribute it and/or modify
  13. it under the terms of the GNU General Public License as published by
  14. the Free Software Foundation, either version 3 of the License, or
  15. (at your option) any later version.
  16. This program is distributed in the hope that it will be useful,
  17. but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. GNU General Public License for more details.
  20. You should have received a copy of the GNU General Public License
  21. along with this program. If not, see <https://www.gnu.org./licenses/>.
  22. -->
  23. <!DOCTYPE html>
  24. <html xmlns="http://www.w3.org/1999/xhtml">
  25. <head>
  26. <base href="https://y.st./en/weblog/2015/03-March/25.xhtml" />
  27. <title>Debugging Minetyst &lt;https://y.st./en/weblog/2015/03-March/25.xhtml&gt;</title>
  28. <link rel="icon" type="image/png" href="/link/CC_BY-SA_4.0/y.st./icon.png" />
  29. <link rel="stylesheet" type="text/css" href="/link/basic.css" />
  30. <link rel="stylesheet" type="text/css" href="/link/site-specific.css" />
  31. <script type="text/javascript" src="/script/javascript.js" />
  32. <meta name="viewport" content="width=device-width" />
  33. </head>
  34. <body>
  35. <nav>
  36. <p>
  37. <a href="/en/">Home</a> |
  38. <a href="/en/a/about.xhtml">About</a> |
  39. <a href="/en/a/contact.xhtml">Contact</a> |
  40. <a href="/a/canary.txt">Canary</a> |
  41. <a href="/en/URI_research/"><abbr title="Uniform Resource Identifier">URI</abbr> research</a> |
  42. <a href="/en/opinion/">Opinions</a> |
  43. <a href="/en/coursework/">Coursework</a> |
  44. <a href="/en/law/">Law</a> |
  45. <a href="/en/a/links.xhtml">Links</a> |
  46. <a href="/en/weblog/2015/03-March/25.xhtml.asc">{this page}.asc</a>
  47. </p>
  48. <hr/>
  49. <p>
  50. Weblog index:
  51. <a href="/en/weblog/"><abbr title="American Standard Code for Information Interchange">ASCII</abbr> calendars</a> |
  52. <a href="/en/weblog/index_ol_ascending.xhtml">Ascending list</a> |
  53. <a href="/en/weblog/index_ol_descending.xhtml">Descending list</a>
  54. </p>
  55. <hr/>
  56. <p>
  57. Jump to entry:
  58. <a href="/en/weblog/2015/03-March/07.xhtml">&lt;&lt;First</a>
  59. <a rel="prev" href="/en/weblog/2015/03-March/24.xhtml">&lt;Previous</a>
  60. <a rel="next" href="/en/weblog/2015/03-March/26.xhtml">Next&gt;</a>
  61. <a href="/en/weblog/latest.xhtml">Latest&gt;&gt;</a>
  62. </p>
  63. <hr/>
  64. </nav>
  65. <header>
  66. <h1>Debugging Minetyst</h1>
  67. <p>Day 00018: Wednesday, 2015 March 25</p>
  68. </header>
  69. </p>
  70. I spent a lot of time yesterday and today experimenting with the <code>minetest.register_biome()</code> function.
  71. For the time being, I&apos;m assuming the temperature and humidity ranges to be 0 - 100, though evidence points to this not being the case.
  72. I&apos;ve asked about it in the <a href="https://forum.minetest.net/viewtopic.php?f=47&amp;t=11603&amp;sid=87934c7f4a426d9ab0131c7a303f2195">Minetest forum</a> in hopes that someone, <strong>*anyone*</strong>, knows what they&apos;re doing with this undocumented function.
  73. The minetest comunity in general, and in particular certain active members, is known for being very helpful to people trying to learn the ins and outs of the game.
  74. If someone knows something about this function, it is very likely I will get a response.
  75. </p>
  76. </p>
  77. Some of my first experimentation went oddly due to a mistake in my code.
  78. Mossy cobble was showing up scattered in all the stone in my world! It turns out I had accidentally aliased both <code>mapgen_stone</code> and <code>mapgen_cobble</code> to the <code>basic:stone</code> node.
  79. It seems that the dungeons are built out of cobble first, then all cobble on the map is given a chance to possibly be swapped out for mossy cobble.
  80. As I already know from a previous world where I intentionally mapped <strong>*all*</strong> the map generator alias aliases to the same node, having multiple map generator aliases mapped to the same node causes odd results.
  81. Last time, I ended up with trees growing out of trees endlessly upward.
  82. My guess is that because the leaves at the tops of the trees were the same node as the ground, they were interpreted as the ground and it was assumed that the jungle there had not actually generated yet.
  83. The map generator algorithm called for a jungle at those coordinates, so it built the jungle repeatedly at this ever-upward-rising land.
  84. </p>
  85. </p>
  86. Once I got the mossy cobble issue debugged, I moved on to actually defining some biomes.
  87. My six biomes for the time being are based on the nodes in the <code>default</code> module, both in minetest_game and in minimal.
  88. From the nodes in minetest_game&apos;s default, I have set up the grassland, forest, jungle, alpine, and desert biomes.
  89. Most of these are based on nodes asked for by the v6 map generator, but the alpine biome is thrown in as a way to acquire the pine trees from default.
  90. It doesn&apos;t make a bad place for placing snow, either.
  91. The final biome is the retro biome, a biome dedicated to nodes in minetyst_game&apos;s default module.
  92. Minetyst_game&apos;s default represents the legacy code in the Minetest engine.
  93. Code that translates old maps to work with the current engine, but does so in a hacky way.
  94. Specifically, it causes the engine to ask for nodes in the default module, instead of using aliases as it should.
  95. This makes it a pain to set your game up to handle legacy maps unless you either employ a default module that holds everything the engine needs for legacy maps or you avoid setting up a default module and instead use the names from default as aliases.
  96. The proper way to do this would be to rely on the mapgen_* aliases for this job, or perhaps set up new legacy_* aliases.
  97. In any case, minetyst_game&apos;s default holds all the &quot;default:*&quot; nodes the engine asks for and no other nodes.
  98. </p>
  99. </p>
  100. My initial biome layout yesterday wasn&apos;t working out well.
  101. I had four biomes set in the assumed corner cases, one dead center in the heat/humidity layout, and one slightly off from dead center.
  102. I tried a few different similar layouts, but every time, there was at least one biome that was so rare that it took forever to find an example of it.
  103. Eventually, I decided on a more even layout, where heat for each biome was set to 100/6, 50, or 500/6 and humidity was set to either 100/6 or 500/6.
  104. If the biome generation works as I think it does, which is via a least squares function involving the heat and humidity, this should make every biome appear equally as often (assuming that the heat and humidity ranges are both 0 - 100, which I do not believe to actually be the case).
  105. As predicted, this makes every biome show up fairly often, though some seem to be more likely to appear than others.
  106. </p>
  107. </p>
  108. I still <a href="/a/canary.txt">am able to speak freely</a>.
  109. </p>
  110. <hr/>
  111. <p>
  112. Copyright © 2015 Alex Yst;
  113. You may modify and/or redistribute this document under the terms of the <a rel="license" href="/license/gpl-3.0-standalone.xhtml"><abbr title="GNU&apos;s Not Unix">GNU</abbr> <abbr title="General Public License version Three or later">GPLv3+</abbr></a>.
  114. If for some reason you would prefer to modify and/or distribute this document under other free copyleft terms, please ask me via email.
  115. My address is in the source comments near the top of this document.
  116. This license also applies to embedded content such as images.
  117. For more information on that, see <a href="/en/a/licensing.xhtml">licensing</a>.
  118. </p>
  119. <p>
  120. <abbr title="World Wide Web Consortium">W3C</abbr> standards are important.
  121. This document conforms to the <a href="https://validator.w3.org./nu/?doc=https%3A%2F%2Fy.st.%2Fen%2Fweblog%2F2015%2F03-March%2F25.xhtml"><abbr title="Extensible Hypertext Markup Language">XHTML</abbr> 5.1</a> specification and uses style sheets that conform to the <a href="http://jigsaw.w3.org./css-validator/validator?uri=https%3A%2F%2Fy.st.%2Fen%2Fweblog%2F2015%2F03-March%2F25.xhtml"><abbr title="Cascading Style Sheets">CSS</abbr>3</a> specification.
  122. </p>
  123. </body>
  124. </html>