Render entity from unlimited distance

Post Reply
User avatar
ratmix
Member
Posts: 149
Joined: Mon May 01, 2017 19:45
In-game: ratmix
Contact:

Render entity from unlimited distance

by ratmix » Post

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
King of the Hill :: Modern Warfare Server RATMIX.COM:30000 | King of the Hill Community Site

User avatar
sorcerykid
Member
Posts: 1841
Joined: Fri Aug 26, 2016 15:36
GitHub: sorcerykid
In-game: Nemo
Location: Illinois, USA

Re: Render entity from unlimited distance

by sorcerykid » Post

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).

User avatar
texmex
Member
Posts: 1753
Joined: Mon Jul 11, 2016 21:08
GitHub: tacotexmex
In-game: tacotexmex

Re: Render entity from unlimited distance

by texmex » Post

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

User avatar
ratmix
Member
Posts: 149
Joined: Mon May 01, 2017 19:45
In-game: ratmix
Contact:

Re: Render entity from unlimited distance

by ratmix » Post

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.
King of the Hill :: Modern Warfare Server RATMIX.COM:30000 | King of the Hill Community Site

User avatar
sorcerykid
Member
Posts: 1841
Joined: Fri Aug 26, 2016 15:36
GitHub: sorcerykid
In-game: Nemo
Location: Illinois, USA

Re: Render entity from unlimited distance

by sorcerykid » Post

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.

User avatar
ratmix
Member
Posts: 149
Joined: Mon May 01, 2017 19:45
In-game: ratmix
Contact:

Re: Render entity from unlimited distance

by ratmix » Post

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.
King of the Hill :: Modern Warfare Server RATMIX.COM:30000 | King of the Hill Community Site

User avatar
sorcerykid
Member
Posts: 1841
Joined: Fri Aug 26, 2016 15:36
GitHub: sorcerykid
In-game: Nemo
Location: Illinois, USA

Re: Render entity from unlimited distance

by sorcerykid » Post

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).

Skulls
Member
Posts: 108
Joined: Thu Dec 21, 2017 17:41
In-game: Skulls

Re: Render entity from unlimited distance

by Skulls » Post

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.

User avatar
ratmix
Member
Posts: 149
Joined: Mon May 01, 2017 19:45
In-game: ratmix
Contact:

Re: Render entity from unlimited distance

by ratmix » Post

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.
King of the Hill :: Modern Warfare Server RATMIX.COM:30000 | King of the Hill Community Site

Just_Visiting
New member
Posts: 6
Joined: Mon Oct 29, 2018 04:13
GitHub: ExeVirus
In-game: Just_Visiting ExeVirus

Re: Render entity from unlimited distance

by Just_Visiting » Post

Ratmix, It is possible to do what you are thinking with just meshes I think. What you would do is define an .obj file with your wall really far from it's local 0,0,0. Then the wall object would hopefully be in the line of sight of a given player but render really far away. Now, that has limits obviously based on mapblock size.

Another option is to implement a grid of such wall objects such that they are spaced out throughout your play area. I.e. every 2 mapblocks you have a mesh node with your wall with a different offset matching your current mapblock coords. This would be quite involved, but would work for larger map sizes.
9lXCftzoaojO8VNNRYxYtg1sqCEdv3dH

User avatar
sorcerykid
Member
Posts: 1841
Joined: Fri Aug 26, 2016 15:36
GitHub: sorcerykid
In-game: Nemo
Location: Illinois, USA

Re: Render entity from unlimited distance

by sorcerykid » Post

Actually, an .obj file isn't necessary. I think it would be much easier to just specify a nodebox in the node definition, rather than exporting a mesh and keeping track of an additional asset file.

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests