Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add optional conversion to MineClone2, along with a few related fixes. #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MysticTempest
Copy link
Contributor

Alright, per the earlier discussion here's a pr that adds the option to choose between games, and closes #20

I also removed the random rotation of pumpkins/melons; and re-added the old door code. Both are unnecessary for MTG, but needed for MCL2.
Though I did add some extra conversions for the "new" door wood-types, and mapped them to wooden doors in MTG.

And finally, I added a few extra notes on how coordinates are roughly converted, and which minecraft world versions are currently compatible with mcimport.


Example of converted coordinates:
Minecraft: 704, 4, -318
Minetest: 720, -60, 334
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we maybe include a (lua) example function that converts the old coordinates?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly? I'm not sure how that'd work. I just know that converted maps don't keep the player's save location; so spawning into an imported map requires flying/teleportation to the converted area. And, it's quickest if users know the coordinates beforehand so they have a rough idea of where to look.

@@ -270,9 +270,6 @@ def isdoor(b):
# rotate lily pads randomly
elif blocks[i] == 111:
param2[i] = random.randint(0,3)
# melon/pumpkin blocks
elif blocks[i] == 86 or blocks[i] == 103:
param2[i] = random.randint(0,23)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe I missed it, but, what was the reason this can be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Melons don't need to be randomly rotated since they don't have any face. Pumpkins do have a face in mcl2/minecraft, so the code interferes with conversion of facedirs.

content_mcl2.py Outdated
blocks = [[(0, 0)]*16 for i in range(blocks_len)]
for (id, data), value in bd.items():
blocks[id][data] = value
return name_id_mapping, blocks
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how much of this is different? any chance we can keep the same file instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I'm not much of a coder, so a lot of the python stuff is duplicated. This one just opens the "mcl2_map_content.txt" file. But, I can take another look.

976 12 doors:door_wood_a 0
976 13 doors:door_wood_a 1
976 14 doors:door_wood_a 2
976 15 doors:door_wood_a 3
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming the in-game ABM still converts this all ok? Did you test that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like the currently converted wood/steel doors. I mapped only the bottom halves(from Minecraft) to the full MTG doors. Yes, I tested; they convert fine.

mcimport_mcl2.py Outdated

print("Conversion finished!\n")
print("Please enjoy your new MineClone2 world!")

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same deal, most of this is just duplicated code, which will make it more difficult to maintain. Can we deduplicate?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, I can try and take another run at it; see if I can work something out.

//202 4 mcl_end:purpur_pillar 12 //East,West pointing vectors with a MC state for X
//202 8 mcl_end:purpur_pillar 6 //North,South pointing vectors with a MC state for Z

//=====================================================================================
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all this should go into a documentation file, and then both content files can reference this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, I'll move both sections into a separate documentation file.

3 2 mcl_core:podzol
4 mcl_core:cobble

#ifdef MORETREES
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for MCL this doesn't make sense, let's just drop MORETREES from this entirely

43 3 mcl_core:cobble
43 4 mcl_core:brick_block
43 5 mcl_core:stonebrick
#ifdef NETHER
Copy link
Member

@sofar sofar Feb 7, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if mcl2 has nether by default, and quartz, let's not make these ifdef statements here, at all.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I'll clear out all these ifdef statements, including the moretrees stuff you mentioned above.

@sofar
Copy link
Member

sofar commented Feb 7, 2019

in large this is ok, but I'd like to see some dedup work so we're not just blowing up our code base.

@MysticTempest
Copy link
Contributor Author

Alrighty, did some research and figured out enough python to fix the dedup issues you requested. Then went ahead and moved the documentation to its own file. And lastly, cleared out the ifdef related stuff from the mcl2_map_content file as requested.

I retested importing maps to both games, and everything appears to still work fine.

@MysticTempest
Copy link
Contributor Author

MysticTempest commented Feb 17, 2019

So, I was testing in Minetest v5.0, and I noticed a large amount of warning message spam in "debug.txt".

Example error:
WARNING[Emerge-0]: VoxelManip:set_lighting called for a non-mapgen VoxelManip object

It seems to be due to this commit in Minetest that added warnings: minetest/minetest@741e3ef
And, is related to the lighting update code here in "mcimport.py" which creates the "/worldmods/mcimport/init.lua" file for every converted world.

I tested commenting out the 'set_lighting' line in a new branch:
-- vm:set_lighting({day = 15, night = 0}, minp, maxp)

And, it clears the error spam, while lighting seems to still be okay.
So, I went ahead, and fixed that while updating the PR.

…fix for 'vm:set_lighting' errors in Minetest v5.x.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Possibility of including conversion option for MineClone2 in addition to Minetest Game?
2 participants