[Game] MineClone 2 [0.65.2]

User avatar
LMD
Member
Posts: 861
Joined: Sat Apr 08, 2017 08:16
GitHub: appgurueu
IRC: appguru[eu]
In-game: LMD
Location: Germany
Contact:

Re: [Game] MineClone 2 [0.65.2]

by LMD » Post

Nebbie: Lua's boolean operators (and, or etc) all take advantage of lazy evaluation.
This means that there is absolutely no difference between:

Code: Select all

if a_complex_check() then
    if another_complex_check() then
        do_something()
    end
end
And the better, and shorter:

Code: Select all

if a_complex_check() and another_complex_check() then
    do_something()
end
My stuff: Projects - Mods - Website

User avatar
sorcerykid
Member
Posts: 1282
Joined: Fri Aug 26, 2016 15:36
GitHub: sorcerykid
In-game: Nemo
Location: Illinois, USA

Re: [Game] MineClone 2 [0.65.2]

by sorcerykid » Post

When optimizing conditionals, it's a good idea to eliminate the most unlikely candidates early on and proceed down the chain. In other words, you want the first check to be the most likely to fail. That way there are fewer checks performed during each iteration.

For example, if you wanted find all doors with certain metadata between a given range of coordinates it would make the most sense to first check that the node is even a door before checking the metadata or the coordinates, since latter two checks would rarely fail for many nodes.

User avatar
LMD
Member
Posts: 861
Joined: Sat Apr 08, 2017 08:16
GitHub: appgurueu
IRC: appguru[eu]
In-game: LMD
Location: Germany
Contact:

Re: [Game] MineClone 2 [0.65.2]

by LMD » Post

Optimization is not an easy matter.

I'd add to sorcerykid's excellent explanation that this has to be weighted by the performance of the checks. Checking the type of node is a rather quick check compared to metadata access.
My stuff: Projects - Mods - Website

User avatar
Wuzzy
Member
Posts: 3923
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Re: [Game] MineClone 2 [0.65.2]

by Wuzzy » Post

LMD nailed it!
My creations. I gladly accept bitcoins: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH

User avatar
leo_rockway
Member
Posts: 210
Joined: Tue Jul 31, 2012 20:37

Re: [Game] MineClone 2 [0.65.2]

by leo_rockway » Post

Nebbie wrote:
Sun May 10, 2020 17:23
So what about the liquid stuff? I must reiterate that was the biggest issue.
Old, old bug in the engine.
Try Skyblock for MineClone 2
Listen to this sound and music pack!

Nebbie
Member
Posts: 12
Joined: Sat May 09, 2020 23:52

Re: [Game] MineClone 2 [0.65.2]

by Nebbie » Post

LMD wrote:
Mon May 11, 2020 18:37
Nebbie: Lua's boolean operators (and, or etc) all take advantage of lazy evaluation.
This means that there is absolutely no difference between:

Code: Select all

if a_complex_check() then
    if another_complex_check() then
        do_something()
    end
end
And the better, and shorter:

Code: Select all

if a_complex_check() and another_complex_check() then
    do_something()
end
This is true for a lone if, but there's an elseif chain going on. Consider the following two bits of code:
+ Spoiler
In the case where complex_check_1() is true, but other_complex_check_1() and complex_check_2() are false, the first bit of code will do 3 checks, but the second bit of code will do only 2 because complex_check_2() doesn't happen. This is because in the first bit of code, other_complex_check_1() being false means the elseif has to be gone into.
Note the difference in the instructions generated by luac -l -p on the two (line 8 has a different jump that goes to return instead of further checks):
+ Spoiler
The existing code makes sense (aside of the other thing with checking whether a mob takes damage from the given type twice) if it is significantly more performant to check a mob's vulnerabilities (which aren't mutually exclusive and thus can't be used as an outer shell of if-elseif chaining) than the node group.

WarHawk
Member
Posts: 22
Joined: Thu May 30, 2019 10:45

Re: [Game] MineClone 2 [0.65.2]

by WarHawk » Post

so are iron golems supposed to take dmg from falling or not?

User avatar
leo_rockway
Member
Posts: 210
Joined: Tue Jul 31, 2012 20:37

Re: [Game] MineClone 2 [0.65.2]

by leo_rockway » Post

Is riding supposed to be working? I put a saddle on a pig, but couldn't ride it. I can't saddle horses / donkeys; I believe they are supposed to be tamed first, but I couldn't tame them either.

This is in survival mode.
Try Skyblock for MineClone 2
Listen to this sound and music pack!

Nebbie
Member
Posts: 12
Joined: Sat May 09, 2020 23:52

Re: [Game] MineClone 2 [0.65.2]

by Nebbie » Post

WarHawk wrote:
Fri May 15, 2020 09:28
so are iron golems supposed to take dmg from falling or not?
Supposed to not (that's the Minecraft behavior).

WarHawk
Member
Posts: 22
Joined: Thu May 30, 2019 10:45

Re: [Game] MineClone 2 [0.65.2]

by WarHawk » Post

ok.. so is there no way to create an automatic farm for them?
using a spawner.

User avatar
leo_rockway
Member
Posts: 210
Joined: Tue Jul 31, 2012 20:37

Re: [Game] MineClone 2 [0.65.2]

by leo_rockway » Post

I was actually looking at an iron golem farm video from Minecraft yesterday. The ones I saw rely on pushing the golems with water and since Minetest doesn't have water flow pushing entities yet, that would complicate things. I don't know if a piston would push the golem; I've barely played with redstone.

The farm I saw used 1 block of lava to kill the golems, by the way. The lava cube was held in place by signs, so the lava wouldn't flow. It had a hopper and a chest underneath it.
Try Skyblock for MineClone 2
Listen to this sound and music pack!

User avatar
leo_rockway
Member
Posts: 210
Joined: Tue Jul 31, 2012 20:37

Re: [Game] MineClone 2 [0.65.2]

by leo_rockway » Post

leo_rockway wrote:
Tue May 12, 2020 01:18
Nebbie wrote:
Sun May 10, 2020 17:23
So what about the liquid stuff? I must reiterate that was the biggest issue.
Old, old bug in the engine.
Sorry for the double post. I was in the #minetest IRC channel and after asking about this issue it seems that the problem was identified by sfan5 and he submitted a PR. Hopefully this bug can finally be closed.

https://github.com/minetest/minetest/pull/9874
Try Skyblock for MineClone 2
Listen to this sound and music pack!

WarHawk
Member
Posts: 22
Joined: Thu May 30, 2019 10:45

Re: [Game] MineClone 2 [0.65.2]

by WarHawk » Post

leo_rockway wrote:
Fri May 15, 2020 23:49
I was actually looking at an iron golem farm video from Minecraft yesterday. The ones I saw rely on pushing the golems with water and since Minetest doesn't have water flow pushing entities yet, that would complicate things. I don't know if a piston would push the golem; I've barely played with redstone.

The farm I saw used 1 block of lava to kill the golems, by the way. The lava cube was held in place by signs, so the lava wouldn't flow. It had a hopper and a chest underneath it.
yeah water doesnt push them and lava only kills them if they are standing in it. if there is a block of space below the lava they seem to walk around fine. also with the signs they catch on fire from the lava. gates work tho

Nebbie
Member
Posts: 12
Joined: Sat May 09, 2020 23:52

Re: [Game] MineClone 2 [0.65.2]

by Nebbie » Post

leo_rockway wrote:
Fri May 15, 2020 23:59
leo_rockway wrote:
Tue May 12, 2020 01:18
Nebbie wrote:
Sun May 10, 2020 17:23
So what about the liquid stuff? I must reiterate that was the biggest issue.
Old, old bug in the engine.
Sorry for the double post. I was in the #minetest IRC channel and after asking about this issue it seems that the problem was identified by sfan5 and he submitted a PR. Hopefully this bug can finally be closed.

https://github.com/minetest/minetest/pull/9874
Nice to see bugs fixed, but I don't think this would solve all of the issues here.
Here is the sequence of (ideal, not quite what I did, but what I should have done) actions that should result in easy casting of a Nether Portal, as they go in Minecraft (glow on held item is from a purely visual mod):
+ Spoiler
And here's how they go (wrong) in MineClone 2:
+ Spoiler
Separately, there is a problem where you can place and mine blocks thru flowing liquids, but not use a bucket thru them. This is pretty annoying because it means when it comes time to place lava around the water, the lava will replace water that's looked thru!
WarHawk wrote:
Sat May 16, 2020 01:06
leo_rockway wrote:
Fri May 15, 2020 23:49
I was actually looking at an iron golem farm video from Minecraft yesterday. The ones I saw rely on pushing the golems with water and since Minetest doesn't have water flow pushing entities yet, that would complicate things. I don't know if a piston would push the golem; I've barely played with redstone.

The farm I saw used 1 block of lava to kill the golems, by the way. The lava cube was held in place by signs, so the lava wouldn't flow. It had a hopper and a chest underneath it.
yeah water doesnt push them and lava only kills them if they are standing in it. if there is a block of space below the lava they seem to walk around fine. also with the signs they catch on fire from the lava. gates work tho
Proper Minecraft behavior would have actual collision checks between mobs/players and potentially damaging blocks. From what I saw looking at MineClone 2's code, it just looks at a single node that's considered to be where the mob's feet are at. In Minecraft for instance, you can take lava damage from standing too close to a lava lake's edge on Soul Sand (which has a slightly lower top than normal blocks).

User avatar
Lone_Wolf
Member
Posts: 2326
Joined: Sun Apr 09, 2017 05:50
GitHub: LoneWolfHT
IRC: Lone_Wolf or LoneWolfHT
In-game: Lone_Wolf
Location: Not there, THERE!

Re: [Game] MineClone 2 [0.65.2]

by Lone_Wolf » Post

Not sure if this has been reported already but it looks like stone is spawning in the place of netherrack in the nether.
I'm using Minetest 5.3.0-dev-6a5c91b55, I could test on 5.2 if wanted. I downloaded the game from CDB earlier today

User avatar
Wuzzy
Member
Posts: 3923
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Re: [Game] MineClone 2 [0.65.2]

by Wuzzy » Post

Play in Minetest 5.2.0. -dev versions are not supported and never have been.
My creations. I gladly accept bitcoins: 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH

User avatar
Lone_Wolf
Member
Posts: 2326
Joined: Sun Apr 09, 2017 05:50
GitHub: LoneWolfHT
IRC: Lone_Wolf or LoneWolfHT
In-game: Lone_Wolf
Location: Not there, THERE!

Re: [Game] MineClone 2 [0.65.2]

by Lone_Wolf » Post

Alrighty. Tested and can't reproduce in 5.2

I get this error when registering a tool that has a non-fleshy damage group:

Code: Select all

ModError: Runtime error from mod 'tt' in callback on_mods_loaded(): ...in/../games/mineclone2/mods/HELP/tt/snippets_builtin.lua:128: attempt to concatenate local 'msg' (a nil value)
stack traceback:
	...in/../games/mineclone2/mods/HELP/tt/snippets_builtin.lua:128: in function <...in/../games/mineclone2/mods/HELP/tt/snippets_builtin.lua:38>
	...f/minetest/bin/../games/mineclone2/mods/HELP/tt/init.lua:30: in function <...f/minetest/bin/../games/mineclone2/mods/HELP/tt/init.lua:22>
	/home/lone_wolf/minetest/bin/../builtin/game/register.lua:429: in function </home/lone_wolf/minetest/bin/../builtin/game/register.lua:413>
Check debug.txt for details.

bzt
Member
Posts: 70
Joined: Tue Sep 24, 2019 14:26

Re: [Game] MineClone 2 [0.65.2]

by bzt » Post

Hi Wuzzy!

Last time I offered structures to MC2, you said no good because they were converted from the Minecraft wiki pages (I agree it's better to avoid copyright lawsuits). So this time I'm offering structures that were made by my boys, entirely from scratch. Any similarity with the original MC game is just a coincidence :-) There are 3 crop fields, 7 houses (small, large, a library), and a target practice field. If you like them, I can offer more, because my boys turns out to be very creative :-D They like your subgame very very much, they play that all day long. They have tried MTG with many different mods, the LotT, Farlands and a few others, but they always return to MC2. I'd like to say thank you in their names with this little contribution!

Cheers,
bzt
Attachments
vilagemts.zip
(5.54 KiB) Downloaded 9 times

User avatar
LMD
Member
Posts: 861
Joined: Sat Apr 08, 2017 08:16
GitHub: appgurueu
IRC: appguru[eu]
In-game: LMD
Location: Germany
Contact:

Re: [Game] MineClone 2 [0.65.2]

by LMD » Post

That's very kind of you and your boys. You still need to choose a license, else you are considered the copyright holder and Wuzzy might not be allowed to use it :/
My stuff: Projects - Mods - Website

Nebbie
Member
Posts: 12
Joined: Sat May 09, 2020 23:52

Re: [Game] MineClone 2 [0.65.2]

by Nebbie » Post

Speaking of structures, I suppose everything with random expanding generation needs hardcoding, since there's nothing akin to Minecraft 1.14's jigsaw block? I had some ideas on Minecraft-alike Nether Fortresses, but they might be quite a pain to draft without being able to use schematics.

bzt
Member
Posts: 70
Joined: Tue Sep 24, 2019 14:26

Re: [Game] MineClone 2 [0.65.2]

by bzt » Post

I hereby grant Wuzzy the right to use these structures with Mineclone2 under any license that permits that. If otherwise not mentioned, that's MIT.

Cheers,
bzt

bzt
Member
Posts: 70
Joined: Tue Sep 24, 2019 14:26

Re: [Game] MineClone 2 [0.65.2]

by bzt » Post

Nebbie wrote:
Fri May 22, 2020 20:46
pain to draft without being able to use schematics.
You can use schematics! There's the in game Schematic Editor mod to build structures, Handle Schematics that can import some Minecraft schems too. Just browse through contents. A standalone application is MTSEdit (available for Windows, Linux, MacOSX), which can import virtually all voxel formats out there (Minecraft schematics, Sponge schematics, Magicavoxel, Goxel, Qubicle, Model3D, Tiled TMX etc. etc. etc.) and save MTS files with a certain Minetest node palette (Mineclone2 being its main focus). It is WIP, but already quite usable. Has a minimal MTSEdit mod, that (just like the other previously mentioned mods) can import schematics into the world.

Cheers,
bzt

Nebbie
Member
Posts: 12
Joined: Sat May 09, 2020 23:52

Re: [Game] MineClone 2 [0.65.2]

by Nebbie » Post

bzt wrote:
Sat May 23, 2020 11:07
Nebbie wrote:
Fri May 22, 2020 20:46
pain to draft without being able to use schematics.
You can use schematics! ...
In a way that allows for random generation of pathways from a starting structure, so that every time it is created, it is different?

bzt
Member
Posts: 70
Joined: Tue Sep 24, 2019 14:26

Re: [Game] MineClone 2 [0.65.2]

by bzt » Post

Nebbie wrote:
Sun May 24, 2020 01:49
In a way that allows for random generation of pathways from a starting structure, so that every time it is created, it is different?
Well, using structures for pathways is quite an unorthodox thing to do, but yes. You can assign probability values to nodes in schematics. Here's a 1 node tall structure from above:

Code: Select all

grass grass path(100%) grass
grass path(50%) path(50%) grass
grass path(50%) path(50%) grass
grass path(50%) path(50%) grass
grass path(100%) grass grass
You can also create a few smaller path parts and put them together randomly, one after another to create a larger random pathway. But as I suggested, don't use schematics for pathways, write a small lua script instead. More efficient and better looking, and you can guarantee the continuity of the path easily.

Cheers,
bzt

Nebbie
Member
Posts: 12
Joined: Sat May 09, 2020 23:52

Re: [Game] MineClone 2 [0.65.2]

by Nebbie » Post

bzt wrote:
Sun May 24, 2020 11:17
Nebbie wrote:
Sun May 24, 2020 01:49
In a way that allows for random generation of pathways from a starting structure, so that every time it is created, it is different?
Well, using structures for pathways is quite an unorthodox thing to do, but yes. You can assign probability values to nodes in schematics. Here's a 1 node tall structure from above:

Code: Select all

grass grass path(100%) grass
grass path(50%) path(50%) grass
grass path(50%) path(50%) grass
grass path(50%) path(50%) grass
grass path(100%) grass grass
You can also create a few smaller path parts and put them together randomly, one after another to create a larger random pathway. But as I suggested, don't use schematics for pathways, write a small lua script instead. More efficient and better looking, and you can guarantee the continuity of the path easily.

Cheers,
bzt
What I mean is that a Nether Fortress is composed of many different possible large segments, each of which could be a full schematic of their own, and it is random which are included where to form a very large contiguous structure going hundreds of blocks in multiple directions.
I don't think schematics can do that. You would need a node to spawn another schematic which can then spawn another schematic on and on. This is what Minecraft 1.14 and above do for certain structures.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest