Cart on powered rails temporarily frozen when no players in range (physics suspended?) #1165

Open
opened 2021-02-21 17:02:42 +01:00 by Gert-dev · 5 comments

In my MineClone 2 world, we've built a large-ish (I'm guessing about 100 to 200 blocks for every side) rectangular railroad with some powered rails and a couple of carts that drive around by themselves. This works fine if a player is inside one of those carts, but when we "launch" a cart on it, and wait for it to go around and come back, it never does; if we then start moving on the railroad to investigate where it is, it can "suddenly" show up in the distance, apparently still moving as if nothing happened, but it should have went around long before (we timed it).

This approach seems to work in the original Minecraft. Is it possible that physics are suspended for objects that have no players close-by, i.e. to improve performance in MineClone 2 or minetest?

A side-effect we encountered was that we launched three carts with some time in between, and when walking on the railroad, all of them were suddenly clustered together, driving at approximately the same location, which should be impossible. This makes sense, though, if their physics were suspended when they went out of range - they would have gotten suspended at approximately the same position.

In my MineClone 2 world, we've built a large-ish (I'm guessing about 100 to 200 blocks for every side) rectangular railroad with some powered rails and a couple of carts that drive around by themselves. This works fine if a player is inside one of those carts, but when we "launch" a cart on it, and wait for it to go around and come back, it never does; if we then start moving on the railroad to investigate where it is, it can "suddenly" show up in the distance, apparently still moving as if nothing happened, but it should have went around long before (we timed it). This approach seems to work in the original Minecraft. Is it possible that physics are suspended for objects that have no players close-by, i.e. to improve performance in MineClone 2 or minetest? A side-effect we encountered was that we launched three carts with some time in between, and when walking on the railroad, all of them were suddenly clustered together, driving at approximately the same location, which should be impossible. This makes sense, though, if their physics were suspended when they went out of range - they would have gotten suspended at approximately the same position.
LizzyFleckenstein03 added the
bug
non-mob entities
needs research
labels 2021-02-22 10:57:19 +01:00
kay27 was assigned by LizzyFleckenstein03 2021-02-22 11:00:42 +01:00
Contributor

@Gert-dev there are 80x80x80 chunks in Minetest. When there are no active player in some chunk - chunk stops to be 'active' and, moreover, offloads from memory. So my best suggestion for now: build roads within chunk boundaries entirely. Of course I'll take a look but please just imagine the server where endless players build endless railroads and start endless minecarts - it can't work this way, because of limited CPU and RAM resources

@Gert-dev there are 80x80x80 chunks in Minetest. When there are no active player in some chunk - chunk stops to be 'active' and, moreover, offloads from memory. So my best suggestion for now: build roads within chunk boundaries entirely. Of course I'll take a look but please just imagine the server where endless players build endless railroads and start endless minecarts - it can't work this way, because of limited CPU and RAM resources
kay27 added the
performance
label 2021-02-22 11:15:05 +01:00

Correction: Chunks are only used by the mapgen, and the chunk size is configurable afaik (5x5x5 MapBlocks by default). Data is stored as MaoBlocks of 16x16x16 nodes in memory and in the database.

Correction: Chunks are only used by the mapgen, and the chunk size is configurable afaik (5x5x5 MapBlocks by default). Data is stored as MaoBlocks of 16x16x16 nodes in memory and in the database.

You can try to forceload the mapblocks, using e.g. worldedits //forceload. @kay27 I thought this was an actual bug, that's why I assigned you.

You can try to forceload the mapblocks, using e.g. worldedits //forceload. @kay27 I thought this was an actual bug, that's why I assigned you.
kay27 was unassigned by LizzyFleckenstein03 2021-02-22 11:16:51 +01:00
Contributor

@EliasFleckenstein03 it's always okay for me with assignments, please feel free to assign me everywhere you want and let me do the same for you - because what I think: first of all, it can be redefined easily, and next, when the assignment is correct - it might be really helpful.

Please take a look, it's about the chunks which are 5x5x5 of blocks 16x16x16, so in fact they are 80x80x80 nodes and yes, we can try force them to be active, as well as try make carts work in inactive areas, I just not sure if it would be a good idea,

@EliasFleckenstein03 it's always okay for me with assignments, please feel free to assign me everywhere you want and let me do the same for you - because what I think: first of all, it can be redefined easily, and next, when the assignment is correct - it might be really helpful. Please [take a look](https://github.com/minetest/minetest/pull/10430#issuecomment-698893182), it's about the chunks which are 5x5x5 of blocks 16x16x16, so in fact they are 80x80x80 nodes and yes, we can try force them to be active, as well as try make carts work in inactive areas, I just not sure if it would be a good idea,
kay27 self-assigned this 2021-02-22 11:32:01 +01:00
kay27 added
needs discussion
and removed
needs research
labels 2021-02-22 11:33:00 +01:00

About the assignments: I totally agree.

The important part of my post was that chunks are irrelevant for map loading, they are only used in map generation.

About the assignments: I totally agree. The important part of my post was that chunks are irrelevant for map loading, they are only used in map generation.
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: VoxeLibre/VoxeLibre#1165
No description provided.