SilkScarfMinetest
#1
INSTALLING minetestserver via apt



https://www.youtube.com/watch?v=Xxt-5YXM4HI - How to setup Minetest Server with MineClone2 in 5 minutes




^ the install guide we're using for troubleshooting




If you install minetestserver via apt (on debian-based systems), here are the relevant directories:



You must move mineclone2 (or other games) to:



`/usr/share/games/minetest/games/ `

Worlds are stored in:

`~/.minetest/worlds`

minetest.conf in:

`/etc/minetest`



https://cryptpad.fr/sheet/#/2/sheet/edit/-fOoCZgwi22lnmhBqm0DgIFl/ - troubleshooting log



Compiling minetestserver:


Careful which version you use with mineclone2


Option #2:


https://github.com/minetest/minetest#compiling


https://github.com/minetest/minetest/releases/tag/5.6.0


https://github.com/minetest/irrlicht/releases/tag/1.9.0mt7


https://forum.minetest.net/viewtopic.php?t=16407 - mineclone2 version 0.82.0 (for Minetest 5.5.1 / 5.6.0)
Reply
#2
Tools:
https://wiki.minetest.net/Minetestmapper
Reply
#3
We ran into issues running minetest version 5.6.1 and mineclone version 0.82.0 on Oracle's free cloud ARM server.



Minetest/Mineclone troubleshooting:

Two issues with running Minetest on Oracle ARM servers:

1. ARM architecture doesn't like the Lua JIT in the distro. You need to use the statically linked libraries provided with Minetest

https://forum.minetest.net/viewtopic.php?p=420955#p420955

https://forum.minetest.net/viewtopic.php?f=6&t=29119&p=421003#p421003 ← this thread explains the best

^ https://github.com/minetest/minetest/issues/12864

^^ https://github.com/minetest/minetest/issues/12850#issuecomment-1276255538

2. Curiosity values in the latest mineclone2 release 0.82.0 were bugged, and llamas and wither skeletons spawning would crash the game, because their curiosity values would cause issues with random number generation in Lua.

https://git.minetest.land/MineClone2/MineClone2/issues/3357

https://stackoverflow.com/questions/59493432/bad-argument-to-random

https://git.minetest.land/MineClone2/MineClone2/issues/3357

https://git.minetest.land/MineClone2/MineClone2/issues/3400

This issue should be fixed in the next mineclone2 release - https://git.minetest.land/MineClone2/MineClone2/issues/3400#issuecomment-62216



Fixing the 1st issues led to the second issue. This is because the default luajit (used for AMD64 architecture) rounds up to 1 and regular lua (which we were forced to use for Oracle's ARM architecture)rounds down to 0. Rounding down to 0 on integer division causes issues.





=========================

SOLUTIONS

=========================



1. ARM architecture doesn't like the system's LuaJIT libraries, which Minetest's build file defaults to.

Solution: configure CMake to use the included Lua library instead of the system's LuaJIT library

- Reference documentation here https://github.com/minetest/minetest#compiling. It will inform you that if you don't use the LuaJIT 2.0+ dependency, "Bundled Lua 5.1 is used" instead

- When running the cmake command, run this command instead:

`cmake . -DRUN_IN_PLACE=TRUE -DBUILD_CLIENT=TRUE -DBUILD_SERVER=TRUE -DENABLE_LUAJIT=OFF`

`make -j$(nproc)`

- After the server executable is made, run `./bin/minetestserver` and play the game to pressure test it

- Done



2. Curiosity values in the latest mineclone 2 release were bugged, and llamas and wither skeletons spawning would crash the game

Solution: add a check to make sure the entities' (llama and wither skeleton) curiosity values are > 20, to avoid this issue. NOTE: this will disable head-tracking for llamas and wither skeletons (meaning they won't look at the player anymore) We decided this is an acceptable trade-off to stop the constant crashing.

- In your mineclone2 folder, navigate here: `mineclone2/mods/ENTITIES/mcl_mobs`

- Open `effects.lua`

- Go to `local function who_are_you_looking_at (self)`, or search for "curiosity""

- Examine this line:

```

Code:
if math.random(1, 30) then
--minetest.log("Change look check: ".. self.name)
local look_at_player_chance = math.random(20/self.curiosity)
-- was 5000 but called in loop based on entities. so div by 12 as estimate avg of entities found,
-- then div by 20 as less freq lookup



```

This causes an issue because `math.random(20/self.curiosity)` evaluates to `math.random(0.3333)` when curiosity is 60, and is rounded to `math.random(0)`. From the stack overflow link, `math.random(0)` is equivalent to `math.random(1,0)`, which tries to pick a random number in an interval starting with 1, and ending with 0. But the 1st argument must be smaller than the 2nd argument for math.random to work, so it does not work, and throws a 'there is no interval' error.

Modify the code so that it looks like this:

```


Code:
if math.random(1, 30) then
            --minetest.log("Change look check: ".. self.name)
            local look_at_player_chance = 0
            if self.curiosity < 20 then
local look_at_player_chance = math.random(20/self.curiosity)
            end
-- was 5000 but called in loop based on entities. so div by 12 as estimate avg of entities found,
-- then div by 20 as less freq lookup



```

This defaults `look_at_player_chance = 0`, which means that the mobs don't look at the player by default. And then if curiosity is < 20 (meaning it won't cause an error with `math.random`), then you can calculate the chance of looking at players like usual. This means that all mobs with curiosity > 60 (llama, wither skeleton), will never look at the player.

- Run `./bin/minetestserver` and play the game to pressure test it

- Done
Reply


Forum Jump:


Users browsing this thread: