How do I change the default "worlds" folder path?

LoseTheGame
Member
 
Posts: 33
Joined: Fri Oct 10, 2014 13:06

How do I change the default "worlds" folder path?

by LoseTheGame » Sat Sep 19, 2015 07:34

Hi guys,

I'm using Minetest in a school and the IT guys have installed it to the C: drive on a room full of computers. Students log in and have their own personal space on the N: drive. The problem is that game progress is automatically saved in the "worlds" folder which is local to the computer and not to the user. The school does not want every student to have a copy of Minetest in their personal space so this is not a solution unfortunately (that's what I did last year). So is there a way that I can modify the C: drive version of Minetest to use a "worlds" folder on the N: drive? Or is their some other solution that I haven't thought of?

Thanks for all the help :)

Jonty
 

User avatar
Ben
Member
 
Posts: 157
Joined: Tue Mar 31, 2015 20:09

Re: How do I change the default "worlds" folder path?

by Ben » Sat Sep 19, 2015 08:53

Not a direct answer, but have you kept in mind that Minetest is a client-server architecture? Depending on how you are using Minetest, you could set up the world(s) on a separate, central server (which need not be Windows).

Other than that: I'm not a Windows user; Minetest on Linux has both a local install and a global install mode, which would solve your problem, but I don't know if the Windows builds have that too.
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

Re: How do I change the default "worlds" folder path?

by Krock » Sat Sep 19, 2015 09:44

You would need a specal build with a changed path_user variable.
https://github.com/minetest/minetest/bl ... g.cpp#L481

Adding a new setting in minetest.conf for this might be helpful for situations like this one.
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

twoelk
Member
 
Posts: 1092
Joined: Fri Apr 19, 2013 16:19

Re: How do I change the default "worlds" folder path?

by twoelk » Sat Sep 19, 2015 11:35

Ha! another usecase for making more paths configurable

I once started this old subject about "request for Minetest for PortableApps on Windows"
Please do not stumble over the word "portable", I know the run-in-place version is portable. That thread is about a portable automatic install, update and backup system integrated into a portable menu system.

The importand point is that they split the user data from the program files within their portable file structure so that they can easily update the program without destroying user configurations or data while not leaving data on the host system.

Napiophelios made a solution and I have described it's usage here.

His approach was to clone the bin folder into the data section at each startup. This may not be the best sollution but it sort of worked and the idea might be modified for a network solution.

But - nevertheless I do believe this could be easier if all the appdata paths could be configurable.
This might be the most interesting for the paths of:

  • chache/media
    - beeing able to share a media folder between installations might be very useful and even more on a local network if setup cleverely. This might need more options though like "look here first, then here, try here if not found elsewhere and use this to override what you found before". But a school environment might be too much of a special case here.
  • client\serverlist
    - with more options to make the favoriteservers.txt more useful like having a fixed static section or merging lists from shared locations.
  • games\(minetest_game)
    - a fall back path to a default game
  • games
    - a central games folder that can be shared between different mt installations
  • mods
    - additionaly to locally installed mods a central mods folder that can be shared between different minetest installations
  • sounds and textures
    - go figure
  • worlds
    - it should be possible to have several places for worlds such as a central games folder that can be shared between different mt installations and additionaly worlds folders that might be stored locally or even privately on another storing device appart from the location of server, client or the normal world folder.

    of course there would also be usecases for:
  • doc
  • fonts
  • locale

as far as I know only the screenshots path can be configered freely as of v0.1.13
 

est31
Member
 
Posts: 172
Joined: Mon Dec 29, 2014 01:49

Re: How do I change the default "worlds" folder path?

by est31 » Sat Sep 19, 2015 16:44

I don't think a setting is needed for the user path, just look here:
https://github.com/minetest/minetest/bl ... #L356-L360
So in theory, it will store data into the folder specified by the appdata env var, which in theory should be the roaming user data:
http://windows.microsoft.com/en-us/wind ... ata-folder
https://msdn.microsoft.com/en-us/librar ... 85%29.aspx
 

est31
Member
 
Posts: 172
Joined: Mon Dec 29, 2014 01:49

Re: How do I change the default "worlds" folder path?

by est31 » Sat Sep 19, 2015 16:47

So the only thing you'd need to do is to set up sharing of these roaming directories. This is specific to how the computers are set up, but if they are set up properly, it should work.

Here some doc, quoting what the APPDATA env var does:

https://technet.microsoft.com/en-us/lib ... 10%29.aspx

The file-system directory that serves as a common repository for application-specific data. A typical path is C:\Documents and Settings\username\Application Data or C:\Users\username\AppData\Roaming.
 

LoseTheGame
Member
 
Posts: 33
Joined: Fri Oct 10, 2014 13:06

Re: How do I change the default "worlds" folder path?

by LoseTheGame » Sat Sep 19, 2015 18:01

Hi everyone,

Thank you for all the suggestions. Please bear in mind that as a teacher I have no control over the way the computers or servers are set-up. Also the IT guys are probably a little bored of me giving them lots of jobs which as far as they can see is to let the students play games. This is certainly not true as I have programmed maths educational resources within Minetest which the kids really enjoy and learn a lot from. But anyway, is there anything that I can personally change within the Minetest files themselves to solve this problem?

Krock wrote:You would need a specal build with a changed path_user variable.
https://github.com/minetest/minetest/bl ... g.cpp#L481
Adding a new setting in minetest.conf for this might be helpful for situations like this one.


Krock, your answer sounds the most feasible, but I have no idea how to do that I'm afraid...?
 

LoseTheGame
Member
 
Posts: 33
Joined: Fri Oct 10, 2014 13:06

Re: How do I change the default "worlds" folder path?

by LoseTheGame » Fri Sep 25, 2015 18:45

Sorry, Krock, would you be able to point me in the right direction for making a special build with a changed path_user variable?
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

Re: How do I change the default "worlds" folder path?

by Krock » Sat Sep 26, 2015 07:11

My thoughts were about adding a new Minetest settings, that defaults to a dynamical value.
https://github.com/SmallJoker/minetest/commit/12227e

It may result in problems when an invalid path is set.
Sure, using %APPDATA% is also possible with a RUN_IN_PLACE=0 build but other applications also use this variable, so it's not useful to change that one to have it on a network drive.

Could you please test this build?
Special Win32 build, based on this branch

Add the following setting to your minetest.conf
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
worlds_path = N:/worlds/
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

LoseTheGame
Member
 
Posts: 33
Joined: Fri Oct 10, 2014 13:06

Re: How do I change the default "worlds" folder path?

by LoseTheGame » Tue Sep 29, 2015 18:01

Hi Krock,

Thanks so much for your help with this, I have a few hundred students that will be very happy if we get this working!
When I run your build I get:

ERROR[Main]: Subgame specified in default_game [minetest] is invalid.

This is regardless of whether I add the worlds_path line to mintest.conf or not.
Sorry if I'm doing something stupid.
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

Re: How do I change the default "worlds" folder path?

by Krock » Tue Sep 29, 2015 20:26

LoseTheGame wrote:ERROR[Main]: Subgame specified in default_game [minetest] is invalid.

I tested it now with my two hard drives, without any error:
My setup: Minetest on device E: with setting "worlds_path = C:\build\"
Successfully created, joined and left a world; the map got saved.

Check if the directory [path_to_minetest]\games\minetest_game exists.
If you want to move the subgames path to the remove drive aswell, define the environment variable %MINETEST_SUBGAME_PATH% to the desired path.
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

LoseTheGame
Member
 
Posts: 33
Joined: Fri Oct 10, 2014 13:06

Re: How do I change the default "worlds" folder path?

by LoseTheGame » Fri Oct 02, 2015 07:52

Thanks Krock! I've never used a minimal build before so I didn't realise that I needed to add the game file. It's working on my computer, I'll test it on the school computers today. Is this good to go or do I need a non-minimal version of this for them to play properly? Also, how hard would it be for me to get the same thing working for the mods folder too? I.e. setting up a definable "mods_path"? Cheers, Jonty.
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

Re: How do I change the default "worlds" folder path?

by Krock » Fri Oct 02, 2015 08:33

LoseTheGame wrote:Is this good to go or do I need a non-minimal version of this for them to play properly?
Also, how hard would it be for me to get the same thing working for the mods folder too?
I.e. setting up a definable "mods_path"?

That Minetest archive contains the same functions as a stable build. I mainly provide those for people who want to update the Minetest core quickly without downloading the subgames again -> can be done with fetching the git commits.
I doupt a "mods_path" setting will be added because mods don't take much disk space, also (IMO) it would be better to add an other environment variable, as I suggested here with the worlds path.
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

User avatar
Ferk
Member
 
Posts: 330
Joined: Tue Aug 18, 2015 17:18
GitHub: Ferk

Re: How do I change the default "worlds" folder path?

by Ferk » Fri Oct 02, 2015 08:34

You could also create a Windows symlink: http://www.howtogeek.com/howto/16226/co ... -or-linux/

Make your default worlds directory be a symlink to the specific place you want. Or you can also symlink particular worlds in particular places, that way you don't even need to move the whole worlds directory if you don't want to.
{ ☠ Dungeontest ☠ , ᗧ••myarcade•• }
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

Re: How do I change the default "worlds" folder path?

by Krock » Fri Oct 02, 2015 12:17

Ferk wrote:You could also create a Windows symlink

That's a good idea and a solution in this case. But it's not possible to add multiple search locations for Minetest worlds.
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 


Return to Minetest General

Who is online

Users browsing this forum: No registered users and 17 guests

cron