Kenshi
FrostMonster Aug 14, 2023 @ 4:38pm
The terrain goes through the walls to the inside of the buildings
I've been looking for a solution to this problem for over a week, but I haven't even found a mention of it anywhere. Maybe I wasn't looking hard enough. The point is that terrain is showing up inside buildings, which is incredibly annoying. I've attached screenshots of what it looks like. The screenshots were taken on a clean installation of the current version of the game without any mods, mods do not change the situation.
Maybe the problem is not in the game at all, as I play on linux through proton and the problem may be related to the proton itself or linux video card drivers, but if anyone knows the solution to the problem I would be very grateful.

Screenshots:
1[imgur.com]
2[imgur.com]
3[imgur.com]
4[imgur.com]
5[imgur.com]
< >
Showing 1-6 of 6 comments
moved to general as we do not provide support for Proton/Linux
Cattrina Aug 14, 2023 @ 9:28pm 
Sadly I do not think we have any Linux wizard among us. The terrain is hidden with the mask collision in the buildings. That is a xml script. I do not know if Linux has some plugin you can download to read xmls correctly.

Is this a new thing, have you been able to play before without this issue?
Last edited by Cattrina; Aug 14, 2023 @ 9:30pm
FrostMonster Aug 15, 2023 @ 1:10pm 
Originally posted by Cattrina:
Sadly I do not think we have any Linux wizard among us. The terrain is hidden with the mask collision in the buildings. That is a xml script. I do not know if Linux has some plugin you can download to read xmls correctly.

Is this a new thing, have you been able to play before without this issue?

I actually ran Kenshi on Linux for the first time and am generally happy with the way it works with Proton. The only problems I have are with terrain inside buildings and not running through dxvk on my nvidia graphics card (but that's not a problem with the game at all -- it's just that my nvidia graphics card on my laptop is a piece of ancient dinosaur ♥♥♥♥ that doesn't support Vulkan). If the xml processing problem is linux related, then maybe I can just install newer or more stable tools and libraries for it, or run steam in runtime mode.
I'll try to find out and post in the thread, maybe someone will find it useful.

Honestly, I wasn't even thinking in that direction, although it's very obvious. Thanks a lot
FrostMonster Aug 21, 2023 @ 3:06pm 
I FOUND THE SOLUTION!!!
The problem was not in the meshes or .xml files, but in the shadersI didn't understand why this problem is so rare (I found only one mention on some old forum where the solution wasn't even asked, but it was also related to running the game on linux under wine/proton), but the problem is related to the building interior clipping section in terrainfp4.hlsl in main_fs and mapfeature_fs
Original code:
// Building interior clipping float2 interior = interiorClip.Sample(Nearest, fragCoord.xy * viewport.zw); if(fragCoord.w < interior.y) clip(interior.x - fragCoord.w);
As I understood from the HLSL and wined3d documentation, coordinates are handled differently in OpenGL rendering than in DirectX and translation does not always work correctly, so I swapped interior.x and fragCoord.w in the clip function and clipping worked as it should.
Modified code:
// Building interior clipping WINE float2 interior = interiorClip.Sample(Nearest, fragCoord.xy * viewport.zw); if(fragCoord.w < interior.y) clip(fragCoord.w - interior.x);
I will make and post a mod soon, hopefully it will be useful for someone.
Last edited by FrostMonster; Aug 21, 2023 @ 3:08pm
FrostMonster Aug 22, 2023 @ 5:19pm 
Last edited by FrostMonster; Aug 22, 2023 @ 5:19pm
This mod is no longer needed for recent versions of Wine/Proton/DXVK, the mod does the same as Windows now (the opposite of the problem it was to supposed to fix).
< >
Showing 1-6 of 6 comments
Per page: 1530 50

Date Posted: Aug 14, 2023 @ 4:38pm
Posts: 6