Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

forceload_block ... doesn't #13823

Closed
MisterE123 opened this issue Sep 18, 2023 · 13 comments
Closed

forceload_block ... doesn't #13823

MisterE123 opened this issue Sep 18, 2023 · 13 comments
Labels
@ Documentation @ Script API Unconfirmed bug Bug report that has not been confirmed to exist/be reproducible

Comments

@MisterE123
Copy link
Contributor

MisterE123 commented Sep 18, 2023

Minetest version

Minetest 5.7.0

Operating system and version

Windows 11

This:

minetest.forceload_block(pos, true,-1)

Doesn't actually load the block in a reasonable time ... until a player looks up at the block that is to be forceloaded.

For context, the block to be forceloaded is a single position about 100 nodes above the player's head, filled with air. A very large entity needs to spawn there, and cannot until forceloaded.

Steps to reproduce

Using the minimal_test mod included here,

join the game...

Wait

look up...

this should spawn, but only after waiting quite a while and/or looking up: (its a very large transparent cylinder ring entity with its position 100 nodes above the player's head)
image

Here's the minimal_test mod for this bug:
minimal_test.zip

IMPORTANT EDIT:

To experience the bug, you must be in Host Server mode

@MisterE123 MisterE123 added the Unconfirmed bug Bug report that has not been confirmed to exist/be reproducible label Sep 18, 2023
@MisterE123
Copy link
Contributor Author

I'm not really sure what the extent of this bug is. Is it just bad documentation (in which case, the minetest.forceload_block is not supposed to act quickly at all - taking more than a minute or two)

If so, why does looking at the block to load always trigger it to load, even 100 nodes away? It seems odd to be dependent on whether a player is looking at it or not

@NathanSalapat
Copy link
Contributor

Unable to reproduce on Linux with Mientest 5.7.0 or 5.8.0-dev-e36b2226b
Entity seems to load instantly.

@jeremyshannon
Copy link
Contributor

jeremyshannon commented Sep 20, 2023

Yeah, it's nearly instantaneous for me on 5.7.0 on Linux, I get like one frame of blue sky when the world loads before it pops in.
Maybe it's a problem with the Windows version of Minetest specifically? Can any Windows guys test this?

@hlqkj
Copy link

hlqkj commented Sep 20, 2023

Can any Windows guys test this?

I did: I can see it instantly, as soon as I join.

Tried both in singleplayer and dedicated server, minetest version is 5.7.0 (official, not compiled by me).

@MisterE123
Copy link
Contributor Author

Could you guys re-test with "host server" enabled?

I also just tried in singleplayer, and yes, in singleplayer it loads immediately. But in Host Server mode, as the Host Client, the bug exists. That might have been an important detail, sorry :P

@hlqkj
Copy link

hlqkj commented Sep 20, 2023

I'm afraid I still can't reproduce it when launching the game with 'Host Server' checked from the GUI. Neither in the hosting instance, nor in a second instance I used as a second client.

@NathanSalapat
Copy link
Contributor

The entity shows for me instantly when hosting a server as well. On stable and dev, tried lowering my view_range to 110 but it still worked.

@MisterE123
Copy link
Contributor Author

Strange. I confirmed that the latest windows zip download from minetest.net has this behavior...

@debagos
Copy link

debagos commented Sep 23, 2023

Not sure if this is related, but when I use minetest.load_area and then player:send_mapblock to force-load a big area, there are blank areas for some reason:
screenshot_20230923_054323
screenshot_20230923_054336
It's always the same spots that are left out, so my question to you @MisterE123 is, does it happen everywhere or only in specific spots?

@Zughy
Copy link
Member

Zughy commented Oct 3, 2023

@MisterE123

@Zughy Zughy added the Action / change needed Code still needs changes (PR) / more information requested (Issues) label Oct 3, 2023
@MisterE123
Copy link
Contributor Author

I did not notice a difference based on location. Like I said, this is repeatable for me, on a new world, in "host server" mode

@Desour
Copy link
Member

Desour commented Oct 3, 2023

Forceloading is not supposed to force sending blocks to clients. AFAIK, it's only for keeping blocks active on the server.
And afaik, send_mapblock does not guarantee that the client keeps all the sent blocks in memory. It only makes the server send the mapblock.

It looks like this is just a documentation issue, at best.

@Zughy Zughy added @ Documentation and removed Action / change needed Code still needs changes (PR) / more information requested (Issues) labels Oct 3, 2023
@MisterE123
Copy link
Contributor Author

Since others cannot reproduce, and since I have found a workaround, I can see closing this issue.

@Zughy Zughy closed this as completed Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@ Documentation @ Script API Unconfirmed bug Bug report that has not been confirmed to exist/be reproducible
Projects
None yet
Development

No branches or pull requests

8 participants