{"id":5094,"date":"2019-10-05T03:34:51","date_gmt":"2019-10-04T19:34:51","guid":{"rendered":"https:\/\/unitycoder.com\/blog\/?p=5094"},"modified":"2019-10-05T03:38:22","modified_gmt":"2019-10-04T19:38:22","slug":"reading-minecraft-world-into-unity-using-substrate","status":"publish","type":"post","link":"https:\/\/unitycoder.com\/blog\/2019\/10\/05\/reading-minecraft-world-into-unity-using-substrate\/","title":{"rendered":"Reading Minecraft World into Unity (using Substrate)"},"content":{"rendered":"\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"680\" height=\"368\" data-attachment-id=\"5100\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2019\/10\/05\/reading-minecraft-world-into-unity-using-substrate\/image-5-3\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2019\/10\/image-5.png?fit=680%2C368&amp;ssl=1\" data-orig-size=\"680,368\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image-5\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2019\/10\/image-5.png?fit=680%2C368&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2019\/10\/image-5.png?resize=680%2C368&#038;ssl=1\" alt=\"\" class=\"wp-image-5100\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2019\/10\/image-5.png?w=680&amp;ssl=1 680w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2019\/10\/image-5.png?resize=300%2C162&amp;ssl=1 300w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><figcaption>Minecraft terrain in unity!<\/figcaption><\/figure>\n\n\n\n<p>Quick test for reading Minecraft worlds into unity.<br>Note: example code uses particle for each block, so it gets pretty slow.<\/p>\n\n\n\n<p><strong>Compile Substrate.dll:<\/strong><br>&#8211; download this repository <a href=\"https:\/\/codeload.github.com\/minecraft-dotnet\/Substrate\/zip\/master\">https:\/\/github.com\/minecraft-dotnet\/Substrate <\/a><br>&#8211; unzip, open Substrate-master\\SubstrateCS\\Substrate.sln<br>&#8211; Solution Explorer: Right click over Substrate (NET4), Set As Startup Project<br>&#8211; Select Release (from the configuration dropdown in toolbar, although default &#8220;Debug&#8221; works also)<br>&#8211; Press F5 to compile<br>&#8211; Should see message in output: &#8220;========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========&#8221;<br>&#8211; Go to the output folder (shown in the output window above that previous line)<br>&#8211; Copy &#8220;Substrate.dll&#8221; into your unity project, Assets\/Plugins\/Substrate\/x64\/ folder<br>&#8211; Note: You need to compile 64bit version (which should happen by default)<\/p>\n\n\n\n<p><strong>Minecraft:<\/strong><br>&#8211; Start minecraft with 1.12.2 version (apparently substrate is designed up to that version?)<br>&#8211; Create new world, enter into it once, then can exit minecraft<\/p>\n\n\n\n<p><strong>Unity:<\/strong><br>&#8211; Test with this script: <a href=\"https:\/\/gist.github.com\/unitycoder\/e0bb32b9d6ece0b4bde7be270e2e2a6f\">https:\/\/gist.github.com\/unitycoder\/e0bb32b9d6ece0b4bde7be270e2e2a6f<\/a><br>&#8211; Add ParticleSystem into scene, then assign it to the script (see below for my particle system settings screenshot)<br><\/p>\n\n\n\n<p><strong>References \/ Resources:<\/strong><br>&#8211; Block ID&#8217;s <a href=\"http:\/\/media.dinnerbone.com\/uploads\/2013-09\/files\/28_00-44-23_YfmAkomVI.txt\">http:\/\/media.dinnerbone.com\/uploads\/2013-09\/files\/28_00-44-23_YfmAkomVI.txt<\/a><br><\/p>\n\n\n\n<p><strong>TODO<\/strong><br>&#8211; Use mesh (instead of particles)<br>&#8211; Optimize..<br>&#8211; Load chunks-on-demand<br>&#8211; Add player<br>&#8211; Test with unity raytracing!<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"303\" height=\"208\" data-attachment-id=\"5097\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2019\/10\/05\/reading-minecraft-world-into-unity-using-substrate\/image-2-5\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2019\/10\/image-2.png?fit=303%2C208&amp;ssl=1\" data-orig-size=\"303,208\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image-2\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2019\/10\/image-2.png?fit=303%2C208&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2019\/10\/image-2.png?resize=303%2C208&#038;ssl=1\" alt=\"\" class=\"wp-image-5097\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2019\/10\/image-2.png?w=303&amp;ssl=1 303w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2019\/10\/image-2.png?resize=300%2C206&amp;ssl=1 300w\" sizes=\"auto, (max-width: 303px) 100vw, 303px\" \/><figcaption>Using particles and loading 100 chunks is not the best idea..<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"347\" height=\"385\" data-attachment-id=\"5098\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2019\/10\/05\/reading-minecraft-world-into-unity-using-substrate\/image-3-3\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2019\/10\/image-3.png?fit=347%2C385&amp;ssl=1\" data-orig-size=\"347,385\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image-3\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2019\/10\/image-3.png?fit=347%2C385&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2019\/10\/image-3.png?resize=347%2C385&#038;ssl=1\" alt=\"\" class=\"wp-image-5098\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2019\/10\/image-3.png?w=347&amp;ssl=1 347w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2019\/10\/image-3.png?resize=270%2C300&amp;ssl=1 270w\" sizes=\"auto, (max-width: 347px) 100vw, 347px\" \/><figcaption>Particle system settings (1)<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"344\" height=\"518\" data-attachment-id=\"5099\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2019\/10\/05\/reading-minecraft-world-into-unity-using-substrate\/image-4-3\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2019\/10\/image-4.png?fit=344%2C518&amp;ssl=1\" data-orig-size=\"344,518\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image-4\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2019\/10\/image-4.png?fit=344%2C518&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2019\/10\/image-4.png?resize=344%2C518&#038;ssl=1\" alt=\"\" class=\"wp-image-5099\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2019\/10\/image-4.png?w=344&amp;ssl=1 344w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2019\/10\/image-4.png?resize=199%2C300&amp;ssl=1 199w\" sizes=\"auto, (max-width: 344px) 100vw, 344px\" \/><figcaption>Particle system settings (2)<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"680\" height=\"432\" data-attachment-id=\"5096\" data-permalink=\"https:\/\/unitycoder.com\/blog\/2019\/10\/05\/reading-minecraft-world-into-unity-using-substrate\/image-1-4\/\" data-orig-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2019\/10\/image-1.png?fit=680%2C432&amp;ssl=1\" data-orig-size=\"680,432\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image-1\" data-image-description=\"\" data-image-caption=\"\" data-large-file=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2019\/10\/image-1.png?fit=680%2C432&amp;ssl=1\" src=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2019\/10\/image-1.png?resize=680%2C432&#038;ssl=1\" alt=\"\" class=\"wp-image-5096\" srcset=\"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2019\/10\/image-1.png?w=680&amp;ssl=1 680w, https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2019\/10\/image-1.png?resize=300%2C191&amp;ssl=1 300w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><figcaption>Drawing air blocks (but instead can just skip them)<\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Quick test for reading Minecraft worlds into unity.Note: example code uses particle for each block, so it gets pretty slow. Compile Substrate.dll:&#8211; download this repository https:\/\/github.com\/minecraft-dotnet\/Substrate &#8211; unzip, open Substrate-master\\SubstrateCS\\Substrate.sln&#8211; Solution Explorer: Right click over Substrate (NET4), Set As Startup Project&#8211; Select Release (from the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":5100,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"Reading Minecraft Worlds into Unity (using Substrate)","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[420,1],"tags":[478,175,38,144,1134,168,171],"class_list":["post-5094","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","category-uncategorized","tag-blocks","tag-chunk","tag-import","tag-minecraft","tag-parse","tag-terrain","tag-unity"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/unitycoder.com\/blog\/wp-content\/uploads\/2019\/10\/image-5.png?fit=680%2C368&ssl=1","jetpack_shortlink":"https:\/\/wp.me\/p1KTaT-1ka","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/5094","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/comments?post=5094"}],"version-history":[{"count":4,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/5094\/revisions"}],"predecessor-version":[{"id":5103,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/posts\/5094\/revisions\/5103"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media\/5100"}],"wp:attachment":[{"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/media?parent=5094"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/categories?post=5094"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unitycoder.com\/blog\/wp-json\/wp\/v2\/tags?post=5094"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}