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 support for Minetest #45

Closed
acs opened this issue Apr 25, 2020 · 15 comments
Closed

Add support for Minetest #45

acs opened this issue Apr 25, 2020 · 15 comments

Comments

@acs
Copy link
Contributor

acs commented Apr 25, 2020

Analyze and implement what is needed in McThings so it works with Minetest: https://www.minetest.net/

Minetest has support also for the Python API: https://github.com/arpruss/raspberryjammod-minetest

So it should work out of the box mainly.

@acs acs added this to To do in McThings v0.20.0 Apr 27, 2020
@acs acs moved this from To do to High Priority in McThings v0.20.0 May 2, 2020
@acs
Copy link
Contributor Author

acs commented May 3, 2020

Ok, time to start testing it! The plan is to

  • Start using minetest server and client
  • Install the plugin for the server and test that it works

@acs
Copy link
Contributor Author

acs commented May 3, 2020

[~]$ sudo dnf install minetest

Running transaction
  Preparing        :                                                                                                                                                                                                                      1/1 
  Running scriptlet: minetest-server-5.1.0-3.fc32.x86_64                                                                                                                                                                                  1/4 
  Installing       : minetest-server-5.1.0-3.fc32.x86_64                                                                                                                                                                                  1/4 
  Running scriptlet: minetest-server-5.1.0-3.fc32.x86_64                                                                                                                                                                                  1/4 
  Installing       : libaesgm-20090429-22.fc32.x86_64                                                                                                                                                                                     2/4 
  Installing       : irrlicht-1.8.4-11.fc32.x86_64                                                                                                                                                                                        3/4 
  Installing       : minetest-5.1.0-3.fc32.x86_64                                                                                                                                                                                         4/4 
  Running scriptlet: minetest-5.1.0-3.fc32.x86_64                                                                                                                                                                                         4/4 
  Verifying        : irrlicht-1.8.4-11.fc32.x86_64                                                                                                                                                                                        1/4 
  Verifying        : libaesgm-20090429-22.fc32.x86_64                                                                                                                                                                                     2/4 
  Verifying        : minetest-5.1.0-3.fc32.x86_64                                                                                                                                                                                         3/4 
  Verifying        : minetest-server-5.1.0-3.fc32.x86_6

@acs
Copy link
Contributor Author

acs commented May 3, 2020

It it easy (just to drop the mod inside the folder

/home/adelcastillo/.minetest/mods/raspberryjammod

and when you are creating a new world, go to configure and enable the mod:

Screenshot from 2020-05-03 17-11-17

but there are issues with it:

Screenshot from 2020-05-03 17-11-23

something that it is normal because it seems the mod was developed under windows, and it has no changes for the last 4 years.

@acs
Copy link
Contributor Author

acs commented May 3, 2020

It is time to start debugging a bit because probably it needs some change in Linux. In the code I can see:

local status,err = pcall(function() socket = ie.require("socket.core") end)
if not status then
   socket = ie.require("socket.cx64")
end

so it seems it can not find the socket.core.

I have already installed:

Package lua-socket-3.0-0.22.rc1.fc32.x86_64 is already installed.

so the problem should be other. So we need to start learning a bit more about Lua!

@acs
Copy link
Contributor Author

acs commented May 3, 2020

The complete log is:

Loaded texture: /usr/share/minetest/games/minetest_game/menu/header.png
2020-05-03 17:11:20: ERROR[Main]: ModError: Failed to load and run script from /home/adelcastillo/.minetest/mods/raspberryjammod/init.lua:
2020-05-03 17:11:20: ERROR[Main]: ...e/adelcastillo/.minetest/mods/raspberryjammod/socket.lua:21: module 'socket.cx64' not found:
2020-05-03 17:11:20: ERROR[Main]: 	no field package.preload['socket.cx64']
2020-05-03 17:11:20: ERROR[Main]: 	no file './socket/cx64.lua'
2020-05-03 17:11:20: ERROR[Main]: 	no file '/usr/share/luajit-2.1.0-beta3/socket/cx64.lua'
2020-05-03 17:11:20: ERROR[Main]: 	no file '/usr/local/share/lua/5.1/socket/cx64.lua'
2020-05-03 17:11:20: ERROR[Main]: 	no file '/usr/local/share/lua/5.1/socket/cx64/init.lua'
2020-05-03 17:11:20: ERROR[Main]: 	no file '/usr/share/lua/5.1/socket/cx64.lua'
2020-05-03 17:11:20: ERROR[Main]: 	no file '/usr/share/lua/5.1/socket/cx64/init.lua'
2020-05-03 17:11:20: ERROR[Main]: 	no file '/home/adelcastillo/.minetest/mods/raspberryjammod/socket/cx64.lua'
2020-05-03 17:11:20: ERROR[Main]: 	no file './socket/cx64.so'
2020-05-03 17:11:20: ERROR[Main]: 	no file '/usr/local/lib/lua/5.1/socket/cx64.so'
2020-05-03 17:11:20: ERROR[Main]: 	no file '/usr/lib64/lua/5.1/socket/cx64.so'
2020-05-03 17:11:20: ERROR[Main]: 	no file '/usr/local/lib/lua/5.1/loadall.so'
2020-05-03 17:11:20: ERROR[Main]: 	no file '/home/adelcastillo/.minetest/mods/raspberryjammod/socket/cx64.so'
2020-05-03 17:11:20: ERROR[Main]: 	no file './socket.so'
2020-05-03 17:11:20: ERROR[Main]: 	no file '/usr/local/lib/lua/5.1/socket.so'
2020-05-03 17:11:20: ERROR[Main]: 	no file '/usr/lib64/lua/5.1/socket.so'
2020-05-03 17:11:20: ERROR[Main]: 	no file '/usr/local/lib/lua/5.1/loadall.so'
2020-05-03 17:11:20: ERROR[Main]: 	no file '/home/adelcastillo/.minetest/mods/raspberryjammod/socket.so'
2020-05-03 17:11:20: ERROR[Main]: stack traceback:
2020-05-03 17:11:20: ERROR[Main]: 	[C]: in function 'require'
2020-05-03 17:11:20: ERROR[Main]: 	...e/adelcastillo/.minetest/mods/raspberryjammod/socket.lua:21: in main chunk
2020-05-03 17:11:20: ERROR[Main]: 	[C]: in function 'require'
2020-05-03 17:11:20: ERROR[Main]: 	/home/adelcastillo/.minetest/mods/raspberryjammod/init.lua:34: in main chunk
2020-05-03 17:11:20: ERROR[Main]: Check debug.txt for details.

so it first try to load socket/core.so module and after it socket/cx64.so. And the poblem is:

[raspberryjammod]$ ls -l /usr/lib64/lua/5.3/socket/core.so 
-rwxr-xr-x. 1 root root 64720 Jan 29 14:08 /usr/lib64/lua/5.3/socket/core.so

so we need to configure 5.3 version and no 5.1.

lua-socket-compat.x86_64 : Network support for the Lua language 5.1

and now it has worked!

@acs
Copy link
Contributor Author

acs commented May 3, 2020

Last step is to check that all is working.

[raspberryjammod]$ telnet localhost 4711
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.

Cool! Let's try to draw things!

@acs
Copy link
Contributor Author

acs commented May 3, 2020

Wonderful. It it working for sending messages:
Screenshot from 2020-05-03 17-30-55

@acs
Copy link
Contributor Author

acs commented May 3, 2020

So now, it is time to test the full API to check it is compatible!

@acs
Copy link
Contributor Author

acs commented May 3, 2020

The two block test has worked! I just need to change:

BUILDER_NAME = "singleplayer" # for minetest

Screenshot from 2020-05-03 17-33-41

@acs
Copy link
Contributor Author

acs commented May 3, 2020

All the tests have worked!

Screenshot from 2020-05-03 17-42-05

@acs
Copy link
Contributor Author

acs commented May 3, 2020

I am so happy ... a true free software platform in which to develop with Python! So cool!

Now we can decide if go with the pretty and polished Minecraft, used by millions of persons, or with Minetest, totally Open Source, not so pretty but ... free software

@acs
Copy link
Contributor Author

acs commented May 3, 2020

I have tried to build the Abadia and it works. The experience flying around it is worse than with Minecraft. But maybe I need to adjust things. Let's see,

@acs
Copy link
Contributor Author

acs commented May 3, 2020

Ok, I will play a bit more with everything, I will record a video and then, we can close this issue.

@acs
Copy link
Contributor Author

acs commented May 4, 2020

Video recorded and uploaded:

https://www.youtube.com/watch?v=5qwQ1lD_E24&t=3s

Closing this issue!

@acs acs closed this as completed May 4, 2020
McThings v0.20.0 automation moved this from High Priority to Done May 4, 2020
@acs
Copy link
Contributor Author

acs commented May 5, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

No branches or pull requests

1 participant