World not living when not in game

Marshall_maz
Member
Posts: 249
Joined: Mon Jul 14, 2014 17:13
In-game: Mazal
Location: Cullinan, South-Africa

World not living when not in game

by Marshall_maz » Post

Hi guys , I have a problem that I don't even know what to call in the topic.

I have a 0.4.10 server at home. The server is always on.
I connect to it with my player over the lan.

My problem is , even with the server permanently on , the world only lives when I am connected with my player.
For example , plants I plant will not grow unless I go and stand close to them. Even if I am in the game but far away
from the plants they just come to a standstill and don't grow further.
The same for example with my solar batteries. If I am not standing close to them they do not charge. Even if it is day
they will stay depleted until I go and stand next to them. And so it goes for everything in the game that is "alive".
Nothing happens unless I go and stand close to it , even though it's on a server that is permanently on.
This is very annoying , when I use things that must recharge or harvest plants I always have to stay there for a long time for it to recharge or grow again. It doesn't grow and "live" on it's own like it's suppose to.

I noticed this only recently. Previously the world evolved and lived on it's own on the same server. Maybe the update to 0.4.10 caused this ?

Anybody else have this problem and know how to solve it that the world "lives" on it's own like it's suppose to ?

User avatar
Krock
Developer
Posts: 4650
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: World not living when not in game

by Krock » Post

There are parts of the world, which load and unload when a player comes in it and leaves - it's required to get free memory and less CPU usage at serverside.
There are some configurations to extend the "wait for unload" time.
As example: (in seconds)

Code: Select all

server_unload_unused_data_timeout = 29
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

Marshall_maz
Member
Posts: 249
Joined: Mon Jul 14, 2014 17:13
In-game: Mazal
Location: Cullinan, South-Africa

Re: World not living when not in game

by Marshall_maz » Post

Krock wrote:There are parts of the world, which load and unload when a player comes in it and leaves - it's required to get free memory and less CPU usage at serverside.
There are some configurations to extend the "wait for unload" time.
As example: (in seconds)

Code: Select all

server_unload_unused_data_timeout = 29
That's in minetest.conf yes ?

User avatar
Krock
Developer
Posts: 4650
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: World not living when not in game

by Krock » Post

Marshall_maz wrote:That's in minetest.conf yes ?
Yes. See minetest.conf.example for more settings.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

Marshall_maz
Member
Posts: 249
Joined: Mon Jul 14, 2014 17:13
In-game: Mazal
Location: Cullinan, South-Africa

Re: World not living when not in game

by Marshall_maz » Post

Krock wrote:
Marshall_maz wrote:That's in minetest.conf yes ?
Yes. See minetest.conf.example for more settings.
I don't have a .example file , where do I find that please ?

User avatar
Krock
Developer
Posts: 4650
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: World not living when not in game

by Krock » Post

Marshall_maz wrote:I don't have a .example file , where do I find that please ?
https://github.com/minetest/minetest/bl ... nf.example
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

Marshall_maz
Member
Posts: 249
Joined: Mon Jul 14, 2014 17:13
In-game: Mazal
Location: Cullinan, South-Africa

Re: World not living when not in game

by Marshall_maz » Post

Krock wrote:
Marshall_maz wrote:I don't have a .example file , where do I find that please ?
https://github.com/minetest/minetest/bl ... nf.example
Thank you

User avatar
paramat
Developer
Posts: 3700
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Re: World not living when not in game

by paramat » Post

Yes this is intentional and not a bug, it's not something that started with 0.4.10. The world is only active within a certain range of a player, this is to reduce processing load, for example if ABMs were running on an entire world of nodes the game would be unplayably slow. However that range from a player is changeable in the minetest.conf, so you can increase it as much as you want and balance it against processing load:

Code: Select all

# how large area of blocks are subject to the active block stuff (active = objects are loaded and ABMs run)
#active_block_range = 2
Block = mapblock = 16 nodes.

prestidigitator
Member
Posts: 647
Joined: Thu Feb 21, 2013 23:54

Re: World not living when not in game

by prestidigitator » Post

I wonder. Does the new force-load feature (minetest.forceload_block) keep things updating when there are no players connected, or does it just guarantee nodes can be read when ABMs and timers and stuff DO run?

sfan5
Moderator
Posts: 4095
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5
Location: Germany

Re: World not living when not in game

by sfan5 » Post

prestidigitator wrote:I wonder. Does the new force-load feature (minetest.forceload_block) keep things updating when there are no players connected, or does it just guarantee nodes can be read when ABMs and timers and stuff DO run?
I'm pretty sure forceloaded blocks act like blocks with players in them.
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)

User avatar
aldobr
Member
Posts: 316
Joined: Sun Nov 25, 2012 05:46

Re: World not living when not in game

by aldobr » Post

And the ABMs wont trigger if someone is not looking at them, right ?

User avatar
Kilarin
Member
Posts: 896
Joined: Mon Mar 10, 2014 00:36
GitHub: Kilarin

Re: World not living when not in game

by Kilarin » Post

sfan5 wrote:I'm pretty sure forceloaded blocks act like blocks with players in them.
So, would it be possible to create a node that could be placed that did a periodic forceload for an area around itself and kept it perpetually active?

It would have to be expensive, but would be very valuable to gardeners.

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

Re: World not living when not in game

by rubenwardy » Post

Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

User avatar
Kilarin
Member
Posts: 896
Joined: Mon Mar 10, 2014 00:36
GitHub: Kilarin

Re: World not living when not in game

by Kilarin » Post

rubenwardy wrote:It would be possible.
Cool! I may have to play with that! Unless someone who has more time and skills gets to it first.

prestidigitator
Member
Posts: 647
Joined: Thu Feb 21, 2013 23:54

Re: World not living when not in game

by prestidigitator » Post

Kilarin wrote:
sfan5 wrote:I'm pretty sure forceloaded blocks act like blocks with players in them.
So, would it be possible to create a node that could be placed that did a periodic forceload for an area around itself and kept it perpetually active?
You don't have to call it repeatedly. Once it is in the "forceload" list Iit stays there, even if the server is restarted. You have to explicitly remove it from the list again to get it to unload. See minetest.forceload_free_block. There is a (configurable) maximum number of blocks that can be on the forceload list, but continually adding a block to the list to compete with other things on the server over what ACTUALLY gets kept in memory is probably the wrong way to approach it.

User avatar
Kilarin
Member
Posts: 896
Joined: Mon Mar 10, 2014 00:36
GitHub: Kilarin

Re: World not living when not in game

by Kilarin » Post

prestidigitator wrote:continually adding a block to the list to compete with other things on the server over what ACTUALLY gets kept in memory is probably the wrong way to approach it.
yeah. And while I would LOVE to be able to lock a garden in to place so it keeps growing, I'm afraid a device that did this would cause all kinds of trouble in the long run.

prestidigitator
Member
Posts: 647
Joined: Thu Feb 21, 2013 23:54

Re: World not living when not in game

by prestidigitator » Post

Kilarin wrote:
prestidigitator wrote:continually adding a block to the list to compete with other things on the server over what ACTUALLY gets kept in memory is probably the wrong way to approach it.
yeah. And while I would LOVE to be able to lock a garden in to place so it keeps growing, I'm afraid a device that did this would cause all kinds of trouble in the long run.
I don't think it's that bad of an idea to lock the garden in place. It's just something that should probably be decided from the perspective of server management. If the garden is important enough to devote constant server resources to it, that's fine. But to make that decision you have to consider the big picture, so to speak. Managing authorization would be a little easier with a simple configuration file, although it might not rival block placement for ease of use.

thetoon
Member
Posts: 106
Joined: Tue Dec 11, 2012 12:55

Re: World not living when not in game

by thetoon » Post

I might be stating the obvious here, but I do think part of the solution lies in how the mods are implemented (providing the API allows it, but if not it should be a welcome addition).

Whenever a mod's effects depends on elapsed time, one should really express it as a function of a variable time (dt), rather than a fixed "step". Let's say you have a "pear" node that goes through the following states : blossom, flower, old-flower, green-fruit, ripe-fruit at a rate of one new state every ten minutes. Then, after twenty minutes in the last state, it disappears ("rot"). Keeping the block loaded for every "pear" node to be continuously updated is a waste of CPU cycles. Instead, we could just store the last time the node was "unloaded" in the block (maybe it's already there), compute a timedelta upon re-loading, and act accordingly.

I'm really not sure ABMs allow this, but it would be much more efficient.

sfan5
Moderator
Posts: 4095
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5
Location: Germany

Re: World not living when not in game

by sfan5 » Post

ABMs do not allow that, but this can already be done (using the current mod api).
Seems like nobody is doing that yet
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)

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

Re: World not living when not in game

by rubenwardy » Post

It is just lazy coding.
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

User avatar
Kilarin
Member
Posts: 896
Joined: Mon Mar 10, 2014 00:36
GitHub: Kilarin

Re: World not living when not in game

by Kilarin » Post

TheToon wrote:Whenever a mod's effects depends on elapsed time, one should really express it as a function of a variable time (dt), rather than a fixed "step". Let's say you have a "pear" node that goes through the following states : blossom, flower, old-flower, green-fruit, ripe-fruit at a rate of one new state every ten minutes. Then, after twenty minutes in the last state, it disappears ("rot"). Keeping the block loaded for every "pear" node to be continuously updated is a waste of CPU cycles. Instead, we could just store the last time the node was "unloaded" in the block (maybe it's already there), compute a timedelta upon re-loading, and act accordingly.
I was JUST getting on to suggest, "You know, if we just kept track of the time a node had been unloaded, then when it was loaded again, it could adjust accordingly..."
I don't think it would work as well for plants spreading, but it would certainly work for plants growing.

thetoon
Member
Posts: 106
Joined: Tue Dec 11, 2012 12:55

Re: World not living when not in game

by thetoon » Post

Kilarin wrote:
TheToon wrote:I don't think it would work as well for plants spreading, but it would certainly work for plants growing.
As long as we don't use this for cross-block growind/spreading, it should be fine. Of course, you probably don't want to handle infinitely-growing trees with such a mechanism.

ThatGraemeGuy
Member
Posts: 139
Joined: Thu Jul 31, 2014 11:02
GitHub: thatgraemeguy
IRC: ThatGraemeGuy
In-game: thatgraemeguy
Location: Cape Town, South Africa

Re: World not living when not in game

by ThatGraemeGuy » Post

I came across this post, just thought I'd point out that technic recently added a "world anchor" which allows you to configure a number of blocks that will be forceloaded. These areas then act exactly as if a player where standing there.

I have been using this successfully to run unattended quarry operations and automated processing of the resulting metals, etc.

Its probably not practical to have a lot of these on a very busy server, but on ours where there are just a handful of us and I've set the maximum force-loaded blocks to 1,000, I have seen no significant load or memory usage issues.

https://github.com/minetest-technic/tec ... rld-anchor

Marshall_maz
Member
Posts: 249
Joined: Mon Jul 14, 2014 17:13
In-game: Mazal
Location: Cullinan, South-Africa

Re: World not living when not in game

by Marshall_maz » Post

Graeme I have noticed this last night and tested it. But it doesn't work for me for my electrical systems.
I set an anchor right next door to my electric network room. Added a bunch of stuff in a chest to furnace setup. Left for a while , came back and nothing happened. I tried this about 3 times. The network only works when I am in the room as usually. This anchor is either not compatible with a pipeworks-technic setup , or I didn't set it wide enough. ( I set mine at 8 blocks which should be pretty wide if 1 block is 16*16*16 nodes ) All the farming stuff and plants worked where the anchor is , just not the technic pipeworks network. Do you have pipeworks on the network that works successfully for you with an anchor ?

EDIT: I think I have set it to low at 8. I though 8 meant 8 blocks. But after reading this part of the manual again " The radius can be set as low as 0, meaning that the anchor only tries to keep itself loaded, or as high as 255, meaning that it will operate on a 511×511×511 cube. " I realize that value is not blocks , but radius. So my value of 8 would mean only 16*16*16 if I understand it correctly ? So I think that put the electric network just out of reach. Increased that radius and will see what happens now and give feedback.

ThatGraemeGuy
Member
Posts: 139
Joined: Thu Jul 31, 2014 11:02
GitHub: thatgraemeguy
IRC: ThatGraemeGuy
In-game: thatgraemeguy
Location: Cape Town, South Africa

Re: World not living when not in game

by ThatGraemeGuy » Post

Yes the radius confused me at first as well, it's the number of nodes, not mapblocks. Made all the more confusing by the formspec telling you how many blocks are being loaded.

The anchor doesn't need to be compatible with specific mods, it works by telling the engine to forcefully load a specific list of mapblocks. Being part of technic, which depends on pipeworks, it would be a bit silly if it were somehow not able to work the the items from those mods.

My setup is this:
  • One or more quarries running at around -250
  • Each quarry has a sorting tube that puts cobble into 3 chests right next to it, and teleports everything else to a chest at my home
  • Each quarry has a radius 5 anchor that keeps enough blocks loaded to ensure that the quarry and attached tubes keep working
  • At home, I have an anchor with a pretty large radius that ensures all my stuff keeps processing while I'm gone. This includes the receiving teleport tube, several injector/blinky setups that take various things and move some to a tube sorting system, which in turn moves stuff to storage chests or grinders or furnaces, etc etc.
Just 1 thing to be aware of when using the anchors is that the default maximum number of force-loaded blocks is only 16. You can see that you have exceeded the limit if you have an anchor that says something like "keeping 4/8 blocks loaded". It wants to load 8 but can only manage 4 before the limit stops it loading more. My anchor at home alone is forceloading 64 blocks, so you will definitely want to tweak this. The minetest.conf setting is "max_forceloaded_blocks = N". I have set this to 1,000. My own anchors are forceloading around 200 blocks at any given time, and I've given a few other players anchors too. According to my monitoring the server as a whole is not even using 400MB of memory, so it's not a massive resource hog.

Post Reply

Who is online

Users browsing this forum: No registered users and 43 guests