Page 1 of 2

[Game] Inside The Box [insidethebox]

Posted: Sun Oct 28, 2018 06:32
by sofar
It's been a long time coming, but, as of now, Inside The Box is Open Source!

All documentation is kept in the github project. This thread is a place to discuss the game code, not to discuss the server. For that purpose, please visit The ITB Server Thread instead.

For credits, please visit the official server. Many, many, many thanks to Nore for making this. I've taken too long to finish open sourcing this.

Image

Want more screenshots? Visit: https://minetest.foo-projects.org/gallery.html

Description: puzzle game. Create and share puzzle boxes (mazes) with other players.
Authors: sofar, Nore.
License: LGPLv2.1+ for code, CC-BY-SA-4.0 for media, other derivative media present with CC0/CC-BY/CC-BY-SA licensed items.

Download
... Browse the code

Requirements

- minetest 0.4.16. 0.4.17 and 0.4.17.1 are untested atm
- lsqlite3

Network and disk space requirements of this game are minimal. The Official ITB server uses a map that is ~300MB and total disk space usage is under 1gb.

You may need to additionally deploy modules to maintain and operate the server. These are not maintained as part of the ITB tree and are maintained elsewhere.

Re: [Game]Inside The Box[insidethebox]

Posted: Sun Oct 28, 2018 09:37
by texmex
That is great! Personally, I’ll have a lot of fun learning from this code.

Sorry that I'm the one that ruins it, but …

Posted: Sun Oct 28, 2018 13:56
by Wuzzy
Aaaaand it crashed:

Code: Select all

2018-10-28 14:45:36: ERROR[Main]: ModError: Failed to load and run script from ~/.minetest/games/Inside The Box/mods/db/init.lua:
2018-10-28 14:45:36: ERROR[Main]: ~/.minetest/games/Inside The Box/mods/db/init.lua:59: attempt to index local 'insecure_env' (a nil value)
2018-10-28 14:45:36: ERROR[Main]: stack traceback:
2018-10-28 14:45:36: ERROR[Main]: 	~/.minetest/games/Inside The Box/mods/db/init.lua:59: in main chunk
It crashes right on start.
Both in 0.4.17.1 and 0.5.0-dev (b6adb7f09e4375f145c3ddb592527c1dd0b026a2).
It does not matter if I start as singleplayer or as server. It does not matter if I delete and re-create the world.

lsqlite version: lua-lsqlite3 0.9.4
ITB version: af3f8c1b

PS: Your thread should comply to the guidelines like everyone else does. Thanks. :P

Re: Sorry that I'm the one that ruins it, but …

Posted: Sun Oct 28, 2018 17:52
by rubenwardy
Wuzzy wrote:Aaaaand it crashed:

Code: Select all

2018-10-28 14:45:36: ERROR[Main]: ModError: Failed to load and run script from ~/.minetest/games/Inside The Box/mods/db/init.lua:
2018-10-28 14:45:36: ERROR[Main]: ~/.minetest/games/Inside The Box/mods/db/init.lua:59: attempt to index local 'insecure_env' (a nil value)
2018-10-28 14:45:36: ERROR[Main]: stack traceback:
2018-10-28 14:45:36: ERROR[Main]: 	~/.minetest/games/Inside The Box/mods/db/init.lua:59: in main chunk
It crashes right on start.
Both in 0.4.17.1 and 0.5.0-dev (b6adb7f09e4375f145c3ddb592527c1dd0b026a2).
It does not matter if I start as singleplayer or as server. It does not matter if I delete and re-create the world.
you need to add `db` to secure.trusted_mods

Re: Sorry that I'm the one that ruins it, but …

Posted: Sun Oct 28, 2018 18:34
by sofar
Wuzzy wrote: Your thread should comply to the guidelines like everyone else does. Thanks. :P
I'll fix this up later today, thanks

Re: Sorry that I'm the one that ruins it, but …

Posted: Sun Oct 28, 2018 18:41
by sofar
rubenwardy wrote:you need to add `db` to secure.trusted_mods
I've added some assert()s to hopefully better explain this here, instead of a cryptic lua stack trace.

Re: [Game] Inside The Box [insidethebox]

Posted: Sun Oct 28, 2018 21:59
by Peppy
This is a huge amount of work, thanks a lot for making it OSS !
I really hope that people will contribute and make this game even better.

(btw : hopefully, i'll finish my curent box on ITB server, a promise is a promise)

Re: [Game] Inside The Box [insidethebox]

Posted: Mon Oct 29, 2018 00:14
by Wuzzy
Do I need a special version of lsqlite3?

Because that alone doesn't work:
2018-10-29 01:12:28: ERROR[Main]: ModError: Failed to load and run script from ~/.minetest/games/Inside The Box/mods/db/init.lua:
2018-10-29 01:12:28: ERROR[Main]: ~/.minetest/games/Inside The Box/mods/db/init.lua:60: module 'lsqlite3' not found:
2018-10-29 01:12:28: ERROR[Main]: no field package.preload['lsqlite3']
2018-10-29 01:12:28: ERROR[Main]: no file './lsqlite3.lua'
2018-10-29 01:12:28: ERROR[Main]: no file '/usr/share/luajit-2.0.5/lsqlite3.lua'
2018-10-29 01:12:28: ERROR[Main]: no file '/usr/local/share/lua/5.1/lsqlite3.lua'
2018-10-29 01:12:28: ERROR[Main]: no file '/usr/local/share/lua/5.1/lsqlite3/init.lua'
2018-10-29 01:12:28: ERROR[Main]: no file '/usr/share/lua/5.1/lsqlite3.lua'
2018-10-29 01:12:28: ERROR[Main]: no file '/usr/share/lua/5.1/lsqlite3/init.lua'
2018-10-29 01:12:28: ERROR[Main]: no file './lsqlite3.so'
2018-10-29 01:12:28: ERROR[Main]: no file '/usr/local/lib/lua/5.1/lsqlite3.so'
2018-10-29 01:12:28: ERROR[Main]: no file '/usr/lib/lua/5.1/lsqlite3.so'
2018-10-29 01:12:28: ERROR[Main]: no file '/usr/local/lib/lua/5.1/loadall.so'
2018-10-29 01:12:28: ERROR[Main]: stack traceback:
2018-10-29 01:12:28: ERROR[Main]: [C]: in function 'require'
2018-10-29 01:12:28: ERROR[Main]: ~/.minetest/games/Inside The Box/mods/db/init.lua:60: in main chunk

Re: [Game] Inside The Box [insidethebox]

Posted: Mon Oct 29, 2018 02:12
by sofar
Wuzzy wrote:Do I need a special version of lsqlite3?
Check that your `lsqlite3.so` file (I'm assuming you use linux) is in the listed paths above. If it isn't, minetest will likely not find it. From the error message above, it looks like it simply can't be found.

Re: [Game] Inside The Box [insidethebox]

Posted: Mon Oct 29, 2018 10:18
by Christian_Soldier
I can't wait to try this! I have a few ideas I want to try out. :)

Re: [Game] Inside The Box [insidethebox]

Posted: Mon Oct 29, 2018 11:47
by Wuzzy
I just copied lsqlite3.so to the working directory of Minetest, but that didn't help either:
2018-10-29 12:42:15: ERROR[Main]: ModError: Failed to load and run script from ~/.minetest/games/Inside The Box/mods/db/init.lua:
2018-10-29 12:42:15: ERROR[Main]: error loading module 'lsqlite3' from file './lsqlite3.so':
2018-10-29 12:42:15: ERROR[Main]: ./lsqlite3.so: undefined symbol: luaL_setfuncs
2018-10-29 12:42:15: ERROR[Main]: stack traceback:
2018-10-29 12:42:15: ERROR[Main]: [C]: at 0x7fb9f38b28b0
2018-10-29 12:42:15: ERROR[Main]: [C]: in function 'require'
2018-10-29 12:42:15: ERROR[Main]: ~/.minetest/games/Inside The Box/mods/db/init.lua:60: in main chunk
I use lua-lsqlite3 0.9.4-2 from Arch Linux. What is your version?

Re: [Game] Inside The Box [insidethebox]

Posted: Mon Oct 29, 2018 17:29
by sofar
Wuzzy wrote:I use lua-lsqlite3 0.9.4-2 from Arch Linux. What is your version?
I used luarocks to build/install mine. Note that if you're building minetest with luajit, or the non luajit version, you probably want to manually build it, because MT embeds lua and it may not know anything about how or where arch builds lua, since that's separate. From your error message, it may just be that you've got a version built for lua 5.3, but MT uses 5.1, and they are not compatible.

maybe make a separate thread for this problem? Others will appreciate that most likely, there are quite a few mods that depend on lslqite3.

Re: [Game] Inside The Box [insidethebox]

Posted: Tue Oct 30, 2018 16:00
by TumeniNodes
lsqlite3 is installed ( I used luarocks)
I get the same on 5.0, what am I missing?

Code: Select all

2018-10-30 11:58:32: ERROR[Main]: mod "boxes" has unsatisfied dependencies:  "music"
2018-10-30 11:58:32: ERROR[Main]: mod "creative" has unsatisfied dependencies:  "boxes"
2018-10-30 11:58:32: ERROR[Main]: mod "doors" has unsatisfied dependencies:  "mech"
2018-10-30 11:58:32: ERROR[Main]: mod "inspector" has unsatisfied dependencies:  "boxes"
2018-10-30 11:58:32: ERROR[Main]: mod "irc_whereis" has unsatisfied dependencies:  "boxes"
2018-10-30 11:58:32: ERROR[Main]: mod "mech" has unsatisfied dependencies:  "boxes"
2018-10-30 11:58:32: ERROR[Main]: mod "menu" has unsatisfied dependencies:  "boxes" "music"
2018-10-30 11:58:32: ERROR[Main]: mod "music" has unsatisfied dependencies:  "localmusic"
2018-10-30 11:58:32: ERROR[Main]: mod "nodes" has unsatisfied dependencies:  "mech"
2018-10-30 11:58:32: ERROR[Main]: mod "player" has unsatisfied dependencies:  "menu"
2018-10-30 11:58:32: ERROR[Main]: mod "signs" has unsatisfied dependencies:  "boxes"
2018-10-30 11:58:32: ERROR[Main]: mod "terminal" has unsatisfied dependencies:  "mech"
2018-10-30 11:58:32: ERROR[Main]: mod "tools" has unsatisfied dependencies:  "nodes"
2018-10-30 11:58:32: ERROR[Main]: mod "xpanes" has unsatisfied dependencies:  "nodes"
2018-10-30 11:58:32: WARNING[Main]: NodeDefManager: Ignoring CONTENT_IGNORE redefinition
2018-10-30 11:58:32: ACTION[Main]:          _|_|_|                      _|        _|
2018-10-30 11:58:32: ACTION[Main]:            _|    _|_|_|      _|_|_|        _|_|_|    _|_|
2018-10-30 11:58:32: ACTION[Main]:            _|    _|    _|  _|_|      _|  _|    _|  _|_|_|_|
2018-10-30 11:58:32: ACTION[Main]:            _|    _|    _|      _|_|  _|  _|    _|  _|
2018-10-30 11:58:32: ACTION[Main]:          _|_|_|  _|    _|  _|_|_|    _|    _|_|_|    _|_|_|
2018-10-30 11:58:32: ACTION[Main]: 
2018-10-30 11:58:32: ACTION[Main]:    _|      _|                          _|
2018-10-30 11:58:32: ACTION[Main]:  _|_|_|_|  _|_|_|      _|_|            _|_|_|      _|_|    _|    _|
2018-10-30 11:58:32: ACTION[Main]:    _|      _|    _|  _|_|_|_|          _|    _|  _|    _|    _|_|
2018-10-30 11:58:32: ACTION[Main]:    _|      _|    _|  _|                _|    _|  _|    _|  _|    _|
2018-10-30 11:58:32: ACTION[Main]:      _|_|  _|    _|    _|_|_|          _|_|_|      _|_|    _|    _|
2018-10-30 11:58:33: ERROR[Main]: NodeResolver: failed to resolve node name 'mapgen_stone'.
2018-10-30 11:58:33: ERROR[Main]: NodeResolver: failed to resolve node name 'mapgen_stone'.
2018-10-30 11:58:33: ERROR[Main]: NodeResolver: failed to resolve node name 'mapgen_stone'.
2018-10-30 11:58:33: ERROR[Main]: NodeResolver: failed to resolve node name 'mapgen_water_source'.
2018-10-30 11:58:33: ERROR[Main]: NodeResolver: failed to resolve node name 'mapgen_water_source'.
2018-10-30 11:58:33: ERROR[Main]: NodeResolver: failed to resolve node name 'mapgen_river_water_source'.
2018-10-30 11:58:33: ERROR[Main]: NodeResolver: failed to resolve node name 'mapgen_stone'.
2018-10-30 11:58:33: ACTION[Main]:         .__               __                   __   
2018-10-30 11:58:33: ACTION[Main]:   _____ |__| ____   _____/  |_  ____   _______/  |_ 
2018-10-30 11:58:33: ACTION[Main]:  /     \|  |/    \_/ __ \   __\/ __ \ /  ___/\   __\
2018-10-30 11:58:33: ACTION[Main]: |  Y Y  \  |   |  \  ___/|  | \  ___/ \___ \  |  |  
2018-10-30 11:58:33: ACTION[Main]: |__|_|  /__|___|  /\___  >__|  \___  >____  > |__|  
2018-10-30 11:58:33: ACTION[Main]:       \/        \/     \/          \/     \/        
2018-10-30 11:58:33: ACTION[Main]: World at [/home/paul/Minetest 04.16/recipe/bin/../worlds/first ITB world 30 10 2018]
2018-10-30 11:58:33: ACTION[Main]: Server for gameid="insidethebox" listening on 0.0.0.0:52056.
2018-10-30 11:58:35: ERROR[Main]: generateImage(): Could not load image "itb_blank.png" while building texture; Creating a dummy image
2018-10-30 11:58:35: ACTION[Server]: singleplayer [127.0.0.1] joins game. 
2018-10-30 11:58:35: ACTION[Server]: singleplayer joins game. List of players: singleplayer
2018-10-30 11:58:35: ERROR[Main]: generateImage(): Could not load image "crack_anylength.png" while building texture; Creating a dummy image
2018-10-30 11:58:35: ERROR[Main]: ServerError: AsyncErr: environment_Step: Runtime error from mod 'sfinv' in callback environment_Step(): ...4.16/recipe/bin/../games/insidethebox/mods/sfinv/api.lua:129: [sfinv] Invalid homepage
2018-10-30 11:58:35: ERROR[Main]: stack traceback:
2018-10-30 11:58:35: ERROR[Main]: 	[C]: in function 'assert'
2018-10-30 11:58:35: ERROR[Main]: 	...4.16/recipe/bin/../games/insidethebox/mods/sfinv/api.lua:129: in function 'get_formspec'
2018-10-30 11:58:35: ERROR[Main]: 	...4.16/recipe/bin/../games/insidethebox/mods/sfinv/api.lua:152: in function 'set_player_inventory_formspec'
2018-10-30 11:58:35: ERROR[Main]: 	...4.16/recipe/bin/../games/insidethebox/mods/sfinv/api.lua:174: in function 'func'
2018-10-30 11:58:35: ERROR[Main]: 	...ul/Minetest 04.16/recipe/bin/../builtin/common/after.lua:18: in function <...ul/Minetest 04.16/recipe/bin/../builtin/common/after.lua:4>
2018-10-30 11:58:35: ERROR[Main]: 	...l/Minetest 04.16/recipe/bin/../builtin/game/register.lua:412: in function <...l/Minetest 04.16/recipe/bin/../builtin/game/register.lua:392>
2018-10-30 11:58:35: ERROR[Main]: stack traceback:
2018-10-30 11:58:35: ACTION[Server]: singleplayer leaves game. List of players: 

Re: [Game] Inside The Box [insidethebox]

Posted: Tue Oct 30, 2018 19:33
by Peppy
I had the same issue with mods not loading.

I had to copy the localmusic folder from the music mod to a worldmods folder in the world directory.

This fixed the issue in 0.4.17.1 :)

Re: [Game] Inside The Box [insidethebox]

Posted: Tue Oct 30, 2018 20:23
by sofar
Peppy wrote:I had the same issue with mods not loading.

I had to copy the localmusic folder from the music mod to a worldmods folder in the world directory.

This fixed the issue in 0.4.17.1 :)
I'll add an `assert` for that as well. Yes, this is required. It helps to keep music tracks out of git and allows the server operator to have custom per-server music.

Re: [Game] Inside The Box [insidethebox]

Posted: Tue Oct 30, 2018 20:27
by sofar
sofar wrote:I'll add an `assert` for that as well. Yes, this is required. It helps to keep music tracks out of git and allows the server operator to have custom per-server music.
euh, the assert is already in place and should show a clear message.

Maybe Tumeninodes cut off the most important error message from his logs? :P

Re: [Game] Inside The Box [insidethebox]

Posted: Tue Oct 30, 2018 20:44
by TumeniNodes
I cut off the what, at the what what?
Peppy wrote:I had the same issue with mods not loading.

I had to copy the localmusic folder from the music mod to a worldmods folder in the world directory.

This fixed the issue in 0.4.17.1 :)

I did manage to overlook this...
All is well now
Fixes for 5.0 as well... I'm going in

Re: [Game] Inside The Box [insidethebox]

Posted: Tue Oct 30, 2018 22:02
by Fixer
Thank you!

Re: [Game] Inside The Box [insidethebox]

Posted: Wed Aug 28, 2019 19:50
by Kurtzmusch
i think its worth pointing out in the instructions that lsqlite3 needs sqlite3, and for those that install it from the repos, they will need to install the devel version that comes with the header file. for me it was libsqlite3-dev. only then i was able to luarocks install lsqlite3

Re: [Game] Inside The Box [insidethebox]

Posted: Wed Aug 28, 2019 21:16
by sofar
Kurtzmusch wrote:i think its worth pointing out in the instructions that lsqlite3 needs sqlite3, and for those that install it from the repos, they will need to install the devel version that comes with the header file. for me it was libsqlite3-dev. only then i was able to luarocks install lsqlite3
Maybe. In general in OSS projects you post direct dependencies, and not the indirect ones. Otherwise you'd be busy a while with some projects :).

Re: [Game] Inside The Box [insidethebox]

Posted: Thu Sep 26, 2019 20:42
by micheal65536
sofar wrote:
Kurtzmusch wrote:i think its worth pointing out in the instructions that lsqlite3 needs sqlite3, and for those that install it from the repos, they will need to install the devel version that comes with the header file. for me it was libsqlite3-dev. only then i was able to luarocks install lsqlite3
Maybe. In general in OSS projects you post direct dependencies, and not the indirect ones. Otherwise you'd be busy a while with some projects :).
Also indirect dependencies can change, or differ between different distributions (the package names of direct dependencies can differ as well but usually they're similar enough that someone can figure out the correct packages).

Re: [Game] Inside The Box [insidethebox]

Posted: Mon Nov 04, 2019 04:13
by sofar
I've opened the *ranking* code. It can be found here:

https://gitlab.com/sofar/itb-ranking/

Re: [Game] Inside The Box [insidethebox]

Posted: Wed Sep 30, 2020 23:17
by Jackknife
I keep getting a lot of errors, the game won't load

Re: [Game] Inside The Box [insidethebox]

Posted: Thu Oct 01, 2020 00:05
by Emerald
Jackknife wrote:
Wed Sep 30, 2020 23:17
I keep getting a lot of errors, the game won't load
Hi Jackknife,

Inside the Box is designed to be a community project. The boxes that are available to play on the multiplayer server are not bundled with the game itself. Now with that out of the way...

Have you done what Gael-de-Sailly suggested in the other thread regarding adding 'db' to secure.trusted_mods? If you're still getting errors after that, please list the errors here and explain what steps you took to install the game. As he stated, the instructions are in the readme (which he linked) and it's not trivial to set up.

Re: [Game] Inside The Box [insidethebox]

Posted: Thu Oct 01, 2020 03:06
by Jackknife
Thanks but I took one look at all the complicated stuff to do to get it running and its beyond me.
I’m not a programmer, I’v been able to figure out stuff to make a small mod but I had to start with code that was already made up.
This is too confusing for me.