Slice view: Apply it to buildings and trees too! (Still relevant with new build tools.)


#1

While this has been discussed in some variations before, I fear it may wrongly be considered obsolete due to the new build tools, so I bring it up again.

For a start, having the slice-tool affect user-built structures and trees in addition to the soil would be more consistent.

What works currently

  • While designing multi-floor buildings, the new build tools allow hiding upper floors.
  • When mining, and using the slice view, buildings whose floor is far above slicing level are hidden.

What doesn’t work

  • The “hide floors” tool affects only what was placed by the “Rooms” tool, which however is too limited for more complex layouts (rectangles only!), where manually placed blocks and walls may be used heavily (e.g. in order to have the floor of an upper story fit with the color of the walls; see e.g. attachment [3] for an example why this is needed).
  • There is currently no way to hide floors of a finished building while outside of the builder tool. Rearranging furniture, or replacing furniture by higher-quality versions, is therefore not really possible on lower floors.
  • Buildings are only hidden, if their floor level is at least 2 slices above the current slice setting (see Slice view: Bad compatibility with buildings?).
  • If a building is high, it will still be in the way of mining, if the ground level of the building is below the current slicing level. See attachment [1].
  • Likewise, trees are not affected by the slice-tool, making the use of trees as city-decoration hard (see [1], [2]).

Attachments

[1] High buildings in the way of mining dispite slice view.

Also, trees.

[2] Trees getting in the way of building, because they are unaffected by slice view.

[3] How it might be implemented.


#2

I haven’t looked at the code for the slice tool (and the real code for it might be in C++, not sure), but I imagine it works by just looking at the grid location y-value of entities to be rendered. Since a tree (or a person) is just a single entity, it will get rendered as long as its base is within the y render range.

Since buildings are also entities whose location is probably their lowest x/z point at their lowest y point (or perhaps a corner of the first room/block placed in their blueprint), as long as that location is within bounds, that building is passed along to the building renderer, which then draws walls/roofs (or doesn’t, based on your settings). So I’m guessing the actual code that needs to be changed is in the building renderer, not the slice tool, and it would just reference the slice tool to check for a clipping point.

I’ll take a look around to see if building render code is actually available to us modders in that way, but otherwise this may be something that only the devs can do.

Edit: So the good news is, it’s all here in Lua, so it’s moddable! A bunch of checks and changes will probably need to be made to services.client.subterranean_view_service and services.client.building_vision_service, but this seems within the scope of ACE so I’ll add it to our list.


#3

Just realized another aspect:

Slice view partially applies to buildings in normal interaction.

In “Build” mode however, all buildings are shown, which strikes me as a possible bug in the current implementation, as it is a hindrance with no obvious benefit. (Hence a little hope, that there will be an official fix in the core game :slight_smile:).