Jump to content

Klei, the Turf system needs work.


SpoonyBardIV

Recommended Posts

For a while now, I've noticed myself using more and more craftable turfs in my ever expanding base. One thing that bothers me, and likely a lot of other people, is the turf priority system. I've lost count of how many times I've wanted to make a patch of some turf, only to have a good portion of it covered up by other turf because it had a low priority. So here is what I propose. Why not instead of having turfs have a set priority, have the priority become variable, depending on which turf was placed first. For example, if I place a tile of Snake Skin Rug, and then place some Forest Turf beside it, the Forest Turf will take priority due to it being placed "on top" of the Snake Skin Rug. That way, you can have any turf you want to be more visible. Whichever turf is placed more recently will overlap the previous turf, allowing for any turf to overlap any other turf, rather than having high priority turfs always overlap lower ones. I've said my piece.

@Jason

Link to comment
Share on other sites

Funny how there are two turf topics appearing this timely to one another.

I'm assuming here, but from what I think makes sense development-vise; one type of turf will always have one set priority due to design limitations. If it was a variable that changed based on what turf was placed last, it would change that turf's priority across the entire board, whole world.

I suppose it wouldn't be impossible to imagine "turf islands" being coded into the game, connected turfs of one sort that each had their own priorities based on what order these islands were created.

The general questions are; what happens when an island merges with another at different priorities? What would this and several islands do to performance?

Link to comment
Share on other sites

2 minutes ago, Cosheeta said:

[Snip]

You know how turfs with higher priority will overlap ones with  lower priority? What I am essentially saying is that instead of certain turfs always overlapping others, make the turf that is more recently placed overlap the turf adjacent to it. This would make you able to choose which turf you wanted to overlap the others. For example, placing a tile of Dense Turf beside a previously placed tile of Stone Road Turf would cause the Stone Road Turf to be partially overlapped by the Dense Turf, which is impossible with the current turf priority system.

Link to comment
Share on other sites

1 hour ago, SpoonyBardIV said:

You know how turfs with higher priority will overlap ones with  lower priority? What I am essentially saying is that instead of certain turfs always overlapping others, make the turf that is more recently placed overlap the turf adjacent to it. This would make you able to choose which turf you wanted to overlap the others.

Yes though what I'm saying is this is incompatible with how turfs are currently designed and presumably rendered in the game.

image.thumb.png.c256170ef4524befada19c5acd1617be.png

This is how the masking of tiles are sliced in the game, they bleed over the grid in order to prevent touching turfs to not have an empty void between them.

image.png.17dc168dc2eaf8751960c797e43563fd.png

If we take a closer look at the group of tiles at the bottom, what would the game engine have to do in order to place another grass-turf on this grid and render it above the rocks?

image.png.671573e68412f774ed43e9dbdbc56aca.png

It would have to create an separate entity of sorts to render this part of the tile on top of the rock while still keeping the other grass behind the rocks. Would it not? It is also as you can see can cause some potential whimsical clipping going on where a tiny part of the rock still sticks out so the grass doesn't look completely connected.
 
 
 
EDIT:

Giving this some more thought... I am making a lot of assumptions on how the ground is actually coded. This is what I've always imagined it as however;



image.thumb.png.97dc35f66977795ad082ce7c0d2c2fff.png

From my own experience writing shaders with limited knowledge and tools there would be too much performance cost to evaluate every kind of turf into one single shader. Maybe I'm too peanut brain to understand how it would be designed but for every new turf introduced it would seemingly have to basically calculate and render all of them at once even if only one turf is present?

My workaround was to split the shaders for each type of turf, essentially creating an new object for each.

image.thumb.png.d8aeddb9c519931fa3ea4e2164d1be41.png

This is what limits my turfs to have a set layer and never be able to change lanes, because they are all rendered together as a whole with one shader for each type. But who am I to say how Klei renders their tiles or groups their objects at all?

image.thumb.png.18f885c296edf10b1dd4242073c3571e.png

Maybe they have some system were each little square in their grid is separated? Potentially being able to place them at any render order as they please? I kind of doubt it? Point of a tile system to me seems to be that they are a single object with one set material. But if possible without a huge hit on performance, I think the idea of letting turfs layer on-top based on latest placement be a no-brainer.

Link to comment
Share on other sites

On 10/1/2019 at 5:46 PM, Cosheeta said:

It would have to create an separate entity of sorts to render this part of the tile on top of the rock while still keeping the other grass behind the rocks. Would it not?

Would it cost a ton of graphical resources to perform this rendering on the fly while turf is being placed?
I like the idea of variable turf dominance but I know that eventually I will place a single turf down incorrectly and will have to remove and replace all turf in a build in order to get everything properly overlapping.

Link to comment
Share on other sites

58 minutes ago, JazzyGames said:

Would it cost a ton of graphical resources to perform this rendering on the fly while turf is being placed?
I like the idea of variable turf dominance but I know that eventually I will place a single turf down incorrectly and will have to remove and replace all turf in a build in order to get everything properly overlapping.

I really shouldn't indulge when I don't know. Klei would answer this right hahah. However, with the examples I put forward (which again, I don't know if they are comparable to Klei's system) I don't reckon it would do any difference in GPU performance, definitely not for placing and removing anything back and forth. It would presumably be more like a subtle constant performance hit the more intricate your designs get that are on-screen. Like this; the more variations in the sorting-layer you'd want for one kind of turf (having for example Cobblestone both below and above other turfs simultaneously, like you keep stacking them on top next to each other; cobblestone otherTuft cobblestone otherTurf cobblestone otherTurf...) the more instances of that cobblestone turf it would have to instantiate. This is why I used the just now made-up terminology of "islands", they would be separate instances in memory. And the impact would be only on CPU performance I reckon.

image.thumb.png.6d2cda7b998ce3c51ada59df91975f5f.png

And I also have zero clues how much more CPU it would demand without trying, naturally. Maybe not enough to cause issues? Even if you go out of your way to stack Turfs in such a way that every single grid on screen is an unique instance? I'm betting it would though.

Here's some questions I have myself; if we have all the different kinds of turfs that there are available in DST on screen all at once, does performance take a hit? What if we mod in fifty more unique turfs and have them on screen all at once? Is there a limit to how many Turfs DST can have? If it would perform worse, I think that confirms that they are separate instances in each type of turf?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...