Page 1 of 1

Render entity from unlimited distance

PostPosted: Sun Mar 10, 2019 19:04
by ratmix
I have a problem with max draw distance for entities set by active_block_range and active_object_send_range_blocks.

I need a large entity (a wall) to be visible from up to 2000 blocks away. I would need to set active_block_range to 125 (125x16 = 2000 blocks) to ensure players would see the entity. This would likely kill the server (and client). What I'm looking for is a way to send a specific entity to the client which is located at an unlimited distance from their player. Is this at all possible?

Image for context (Thanks to Sires for the idea)...
Image

Re: Render entity from unlimited distance

PostPosted: Mon Mar 11, 2019 17:28
by sorcerykid
To my knowledge, this is currently impossible because activation and deactivation of SAOs are managed entirely on the CPP side. Is there a reason this entity has to be visible from so far away? Even if there was a workaround (like hacking the ServerEnvironment::deactivateFarObjects() function), there are likely to be unanticipated side effects since SAOs are supposed to be removed when active blocks are deactivated.

Edit: It just occurred to me that perhaps you mean that you want the wall to be visible from any lateral distance, not from 2000 meters in front of the player. If that's the case then why not just create 16x16 entities and tile them along the XY or ZY plane? That would still provide the illusion of what you want, and probably better rendering performance.

On a sidenote, I believe somebody mentioned on #minetest-hub a few weeks ago about "pre-rendering" scenes via custom skyboxes. That might be another way to accomplish what you want (altho I don't know if it was just a proposal, or if the method is already supported).

Re: Render entity from unlimited distance

PostPosted: Mon Mar 11, 2019 18:42
by texmex
IIRC correctly then player entities have no limit of how far away they will render. Thus the ugly hack would be to somehow render a boxy player wher the wall should be xD

Re: Render entity from unlimited distance

PostPosted: Mon Mar 11, 2019 19:46
by ratmix
sorcerykid wrote:perhaps you mean that you want the wall to be visible from any lateral distance, not from 2000 meters in front of the player


Thanks for the reply. That's correct, I just need the player to see the wall if they are within about 150 blocks adjacent to and within 2000 blocks laterally of the wall entity position. Tiling will create overlaps thereby reducing opacity (which I need)...
Image
In addition, I need to move 6 walls every second so tiling would create a lot of demand on the server. Just trying to keep lag to a bare minimum.

texmex wrote:IIRC correctly then player entities have no limit of how far away they will render. Thus the ugly hack would be to somehow render a boxy player where the wall should be xD


You might be on to something.

Re: Render entity from unlimited distance

PostPosted: Mon Mar 11, 2019 20:17
by sorcerykid
Out of curiosity, why are translucent nodes out of the question? It seems that you are trying to adapt an entity to behave in every respect like a wall of nodes, but I'm not sure why.

Re: Render entity from unlimited distance

PostPosted: Mon Mar 11, 2019 22:00
by ratmix
A wall of nodes means I need to remove and add up to 48 million nodes every second (4000x4000x6walls). Plus, with nodes you will not have a moving animation. I have tried using a node with a really large mesh, but the max render distance is still low, plus the player look direction effects the node's visibility.

Re: Render entity from unlimited distance

PostPosted: Tue Mar 12, 2019 00:39
by sorcerykid
Ah, I didn't realize you needed animations too. In that case it sounds like what you trying to accomplish is well beyond the scope of what Minetest is designed to do. All the potential workarounds seem to have been exhausted. Realistically, this is something that would probably necessitate a fairly sophisticated engine change (both client and server).

Re: Render entity from unlimited distance

PostPosted: Tue Mar 12, 2019 03:28
by Skulls
If this is only for single player you may try attaching a huge (but low poly) object to the player so the "wall" follows the player around like a gloomy storm cloud.

Re: Render entity from unlimited distance

PostPosted: Tue Mar 12, 2019 04:01
by ratmix
sorcerykid wrote:what you trying to accomplish is well beyond the scope of what Minetest is designed to do

I know, but I can't give up. Any idea how I might implement texmex's suggestion about spoofing a player entity to achieve this? When you press 'z' to zoom, the player appears first, before the map blocks load. This is likely because the client already has the player loaded, so I think he has a viable idea.

Skulls wrote:you may try attaching a huge (but low poly) object to the player so the "wall" follows the player

Thanks for the idea, but the wall position must remain relative to the world.