Page 1 of 1

-

Posted: Fri Jun 14, 2019 8:34 pm
by Lorash
-

Re: [0.17.49] Trees popping into view

Posted: Fri Jun 14, 2019 8:51 pm
by Rseding91
Can you please post a video showing what you're seeing?

Re: [0.17.49] Trees popping into view

Posted: Mon Jun 24, 2019 10:11 pm
by Verhofin
Game is modded but I think he means this:

(bottom left of screen)
https://streamable.com/2ngsz

Re: [0.17.49] Trees popping into view

Posted: Tue Jun 25, 2019 5:43 am
by orzelek
I think you might need to install Alien Biomes to see this one.
I did not verify with vanilla but with Alien Biomes installed this issue happens constantly. Maybe a base game issue or something that mod is doing with trees that causes this.

Re: [0.17.49] Trees popping into view

Posted: Tue Jun 25, 2019 10:59 am
by Reika
orzelek wrote: Tue Jun 25, 2019 5:43 am I think you might need to install Alien Biomes to see this one.
I did not verify with vanilla but with Alien Biomes installed this issue happens constantly. Maybe a base game issue or something that mod is doing with trees that causes this.
I have had this with AB snow trees since last year as well; I do not know if it is unique to them, though.

Re: [0.17.49] Trees popping into view

Posted: Tue Jun 25, 2019 12:06 pm
by Rseding91
Ok, looking at the Alien Biomes mod I see now why it causes pop-in. The mod has extreme tall trees and makes the bounding box a few pixels big.

It has to change one or both of those if it wants to address this problem. The rendering system assumes no entity renders things more than:
  • 6 tiles from the right edge of the bounding box
  • 3 tiles from the left edge of the bounding box
  • 3 tiles from the bottom edge of the bounding box
  • 4 tiles from the top edge of the bounding box
The alien biomes trees in question are both too tall and the shadows too wide for what the game is setup to render. You can see in this image the red squares are the tree bounding boxes, the blue the selection boxes and the pink the render boxes. If the screen area collides with the pink area the tree gets rendered. You can see the problem with the alien biomes tree (it's too big).
tree render areas.PNG
tree render areas.PNG (743.92 KiB) Viewed 3904 times

Re: [0.17.49] Trees popping into view

Posted: Tue Jun 25, 2019 5:40 pm
by Reika
Rseding91 wrote: Tue Jun 25, 2019 12:06 pm Ok, looking at the Alien Biomes mod I see now why it causes pop-in. The mod has extreme tall trees and makes the bounding box a few pixels big.

It has to change one or both of those if it wants to address this problem. The rendering system assumes no entity renders things more than:
  • 6 tiles from the right edge of the bounding box
  • 3 tiles from the left edge of the bounding box
  • 3 tiles from the bottom edge of the bounding box
  • 4 tiles from the top edge of the bounding box
The alien biomes trees in question are both too tall and the shadows too wide for what the game is setup to render. You can see in this image the red squares are the tree bounding boxes, the blue the selection boxes and the pink the render boxes. If the screen area collides with the pink area the tree gets rendered. You can see the problem with the alien biomes tree (it's too big).

tree render areas.PNG
Making their bounding boxes much larger also means making their collision boxes much larger, right? I do not see that as being anywhere near acceptable to most players, as they would literally form a solid wall in a forest. How about a new "render bounding box" property, akin to the recently-added "map generation bounding box" one?

Re: [0.17.49] Trees popping into view

Posted: Tue Jun 25, 2019 6:33 pm
by Rseding91
Reika wrote: Tue Jun 25, 2019 5:40 pm Making their bounding boxes much larger also means making their collision boxes much larger, right? I do not see that as being anywhere near acceptable to most players, as they would literally form a solid wall in a forest. How about a new "render bounding box" property, akin to the recently-added "map generation bounding box" one?
A different render bounding box would not work for how rendering works. The game does an entity search over the world based off the area the screen is viewing + the mentioned extra area. If your entity does not collide with that entity search it isn't drawn.

Re: [0.17.49] Trees popping into view

Posted: Wed Jun 26, 2019 4:15 pm
by Reika
Rseding91 wrote: Tue Jun 25, 2019 6:33 pm
Reika wrote: Tue Jun 25, 2019 5:40 pm Making their bounding boxes much larger also means making their collision boxes much larger, right? I do not see that as being anywhere near acceptable to most players, as they would literally form a solid wall in a forest. How about a new "render bounding box" property, akin to the recently-added "map generation bounding box" one?
A different render bounding box would not work for how rendering works. The game does an entity search over the world based off the area the screen is viewing + the mentioned extra area. If your entity does not collide with that entity search it isn't drawn.
My suggestion is changing the logic to search for that render bounding box, as opposed to the current hardcoded "collision box plus some padding".

Re: [0.17.49] Trees popping into view

Posted: Wed Jun 26, 2019 4:59 pm
by Rseding91
Reika wrote: Wed Jun 26, 2019 4:15 pm My suggestion is changing the logic to search for that render bounding box, as opposed to the current hardcoded "collision box plus some padding".
What i'm saying is: entity searches only work on bounding box since that's what the entity uses to register itself onto the grid system that entity search uses.

Entity is put into the world -> it uses its bounding box to register that "I am on these parts of the grid system"
Entity search runs -> it iterates the grid system parts that overlap with the area you are searching

It doesn't work to do any other search.

Re: [0.17.49] Trees popping into view

Posted: Wed Jun 26, 2019 5:31 pm
by eradicator
Rseding91 wrote: Tue Jun 25, 2019 12:06 pm The rendering system assumes no entity renders things more than:
  • 6 tiles from the right edge of the bounding box
  • 3 tiles from the left edge of the bounding box
  • 3 tiles from the bottom edge of the bounding box
  • 4 tiles from the top edge of the bounding box
So basically the current settings are incompatible with any "extremely tall" entity, like chimneys, silos, etc? Could those values be made available as utility constants? As far as i understand the alien biomes trees would work if top/right were incresed by 3 each (which would be a ~10% increase of the scan area on a 1080p screen at zoom=1).

Re: [0.17.49] Trees popping into view

Posted: Thu Jun 27, 2019 5:22 pm
by Rseding91
Ok, I added the values into utility-constants.lua for the next version of 0.17. They're limited to a minimum of what they are now and a maximum of 15.