Luanti kiosk setup

This started from my toot after seeing that local library has a Minecraft theme day.

So I offered to bring two computers to the library during the event so audience could try Luanti. They agreed, so I started to build sort of kiosk setup for playing luanti on two very old NUCs without internet connection. This is far from hardened kiosk setup. Just something that is easy enough for visitors and can be left running for couple of hours. The computers will be reinstalled afterwards anyway.

I started with a simple Debian Bookworm setup, compiled Luanti 5.11 (latest at that time) for Bookworm with the help of debian.tar.xz for the previous version.

Installed packages

Changes to config and scripts

Network

Connected the two NUCs together with ethernet cable and set one to be 10.0.0.1 and other 10.0.0.2 in /etc/network/interfaces
auto eno1
iface eno1 inet static
        address 10.0.0.1
        netmask 255.255.255.0

Autostart luantiserver

I didn't bother to find out how to do this the correct way, so I just

systemctl edit luanti-server

[Service]
Restart=always
User=pelaaja
Group=pelaaja
ExecStart=
ExecStart=/usr/games/luantiserver --logfile /tmp/luanti.log worlds/world
WorkingDirectory=/home/pelaaja/.minetest
Environment=
Environment=HOME=/home/pelaaja
DynamicUser=no

Autostart Luanti

Created user "pelaaja"

Created password file with random password: ~pelaaja/sala

systemctl edit getty@tty2

[Service]
ExecStart=
ExecStart=-/sbin/agetty -a pelaaja -o '-p -- \\u' --noclear - $TERM
~pelaaja/.bash_profile
if test `tty` = /dev/tty2 ; then
        exec startx
fi
~pelaaja/.xsession
icewm &
xset s off
xset -dpms
luanti --address 10.0.0.1 --port 30000 --go --password-file /home/pelaaja/sala --name Pelaaja1

Multiple Luanti games to choose from

I ran Luanti normally, installed games and created a world for each game. Then registered to all games from both computers with the password set in password file and copied the world directory to worldname-orig for easy resetting the game. In most games I unchecked mountains when creating world. It's not good in a demo to get a spawn point between mountain and water.

.icewm/menu

prog "Käynnistä uudelleen" luanti sudo luantiswitch restart
prog "Aloita peli alusta" luanti sudo luantiswitch reset
prog "Vaihda Minecloniaan" luanti sudo luantiswitch Mineclonia
prog "Vaihda Voxelibreen" luanti sudo luantiswitch Voxelibre
prog "Vaihda Nodecoreen" luanti sudo luantiswitch NodeCore
prog "Vaihda Minetestiin" luanti sudo luantiswitch Minetest
prog "Vaihda Extra Ordinanceen" luanti sudo luantiswitch ExtraOrdinance
prog "Vaihda Exileen" luanti sudo luantiswitch Exile
/etc/sudoers.d/luanti
pelaaja ALL=(ALL:ALL) NOPASSWD: /usr/local/sbin/luantiswitch
/usr/local/sbin/luantiswitch
#!/bin/sh

set -e
cd /home/pelaaja/.minetest/worlds
current="$(readlink world)"
if test "$1" = reset ; then
        if test -e "${current}-orig" ; then
                systemctl stop luanti-server
                rm -r "$current"
                cp -a "${current}-orig" "$current"
                systemctl start luanti-server
        else
                echo "Can't reset: no ${current}-orig"
        fi
elif test "$1" = restart ; then
        systemctl restart luanti-server
else
        if test -d "$1" -a -d "${1}-orig" ; then
                rm world
                ln -s "$1" world
                systemctl restart luanti-server
        else
                echo "Can't swtich: no ${1}-orig or no $1"
        fi
fi
User on the server running computer can use the windows key to open icewm menu and switch game or reset the current game.

Turn damage off

For a kiosk mode where visitors would try Luanti quickly and move on, I considered leaving the games on default settings but that didn't look good. If the game was just left running, the characters would be eventually killed and the next players would first see sign saying "You died". I didn't wan that so I just turned damage off in /etc/luanti/default.conf by setting enable_damage = false

Reception during the theme day

This poster advertised the event couple of days in advance. Library personnel were kind enough to include Luanti too.

Here is a photo of the Luanti setup.

Librarian told me that there were players most of the time. I wasn't personally overseeing the machines.

If anyone is setting up a Minecraft theme-something and you happen to have old computers to spare, go ahead and offer them Luanti.