[Game] Inside The Box [insidethebox]

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

[Game] Inside The Box [insidethebox]

by sofar » Post

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.

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: [Game]Inside The Box[insidethebox]

by texmex » Post

That is great! Personally, I’ll have a lot of fun learning from this code.

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

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

by Wuzzy » Post

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

User avatar
rubenwardy
Moderator
Posts: 6972
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

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

by rubenwardy » Post

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
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

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

by sofar » Post

Wuzzy wrote: Your thread should comply to the guidelines like everyone else does. Thanks. :P
I'll fix this up later today, thanks

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

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

by sofar » Post

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.

User avatar
Peppy
Member
Posts: 34
Joined: Sun Nov 06, 2016 07:34
IRC: Peppy
In-game: Peppy
Location: France

Re: [Game] Inside The Box [insidethebox]

by Peppy » Post

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)

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

Re: [Game] Inside The Box [insidethebox]

by Wuzzy » Post

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

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: [Game] Inside The Box [insidethebox]

by sofar » Post

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.

Christian_Soldier
Member
Posts: 162
Joined: Thu Feb 08, 2018 17:36
In-game: Christian_Soldier

Re: [Game] Inside The Box [insidethebox]

by Christian_Soldier » Post

I can't wait to try this! I have a few ideas I want to try out. :)
plz see my map from The Stanley Parable. viewtopic.php?f=12&t=19944&p=0&e=0

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

Re: [Game] Inside The Box [insidethebox]

by Wuzzy » Post

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?

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: [Game] Inside The Box [insidethebox]

by sofar » Post

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.

User avatar
TumeniNodes
Member
Posts: 2941
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes
Location: in the dark recesses of the mind
Contact:

Re: [Game] Inside The Box [insidethebox]

by TumeniNodes » Post

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: 
A Wonderful World

User avatar
Peppy
Member
Posts: 34
Joined: Sun Nov 06, 2016 07:34
IRC: Peppy
In-game: Peppy
Location: France

Re: [Game] Inside The Box [insidethebox]

by Peppy » Post

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 :)

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: [Game] Inside The Box [insidethebox]

by sofar » Post

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.

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: [Game] Inside The Box [insidethebox]

by sofar » Post

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

User avatar
TumeniNodes
Member
Posts: 2941
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes
IRC: tumeninodes
In-game: TumeniNodes
Location: in the dark recesses of the mind
Contact:

Re: [Game] Inside The Box [insidethebox]

by TumeniNodes » Post

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
A Wonderful World

User avatar
Fixer
Member
Posts: 904
Joined: Sun Jul 31, 2011 11:23
IRC: Fixer
In-game: Fixer
Location: Ukraine

Re: [Game] Inside The Box [insidethebox]

by Fixer » Post

Thank you!

Kurtzmusch
Member
Posts: 41
Joined: Sat Oct 21, 2017 18:12
In-game: Kurtzmusch

Re: [Game] Inside The Box [insidethebox]

by Kurtzmusch » Post

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
Like Puzzles? Escape The Dungeon

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: [Game] Inside The Box [insidethebox]

by sofar » Post

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 :).

micheal65536
Member
Posts: 167
Joined: Mon May 22, 2017 20:27

Re: [Game] Inside The Box [insidethebox]

by micheal65536 » Post

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).

sofar
Developer
Posts: 2146
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: [Game] Inside The Box [insidethebox]

by sofar » Post

I've opened the *ranking* code. It can be found here:

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

Jackknife
Member
Posts: 189
Joined: Fri Sep 25, 2020 20:07

Re: [Game] Inside The Box [insidethebox]

by Jackknife » Post

I keep getting a lot of errors, the game won't load

Emerald
Member
Posts: 30
Joined: Sat Feb 02, 2019 02:41
IRC: Emerald2
In-game: Emerald2

Re: [Game] Inside The Box [insidethebox]

by Emerald » Post

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.

Jackknife
Member
Posts: 189
Joined: Fri Sep 25, 2020 20:07

Re: [Game] Inside The Box [insidethebox]

by Jackknife » Post

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 8 guests