SpaxscE / lvs_base

WIP full rework of LFS' framework to be more universal for later projects allowing for more unique vehicle types and hopefully more reliable handling even on low tickrate environments
28 stars 15 forks source link

The decals bug. #40

Closed Patriot687 closed 4 weeks ago

Patriot687 commented 9 months ago

Good afternoon. I'm not sure I should write about it here, but I don't know where else. I came across a very unpleasant bug. Any decal applied to the vehicle stretches out to half of the map and appears in the sky. This is also often accompanied by crashes of the game. This happens on some vehicles, but not all. I tried disabling all addons, except for the LVS database with some transport (I also cleaned the addons and workshop folders), changed graphics settings, etc., but it didn't help. If you know how to solve this, then I really ask for your help. Thank you in advance. I noticed this bug in your works: "[LVS] - Tanks" , "[LVS] - Cars - Pack" and an addon by another author - "[LVS] TOYOTA BXD10" 20231201204755_1 20231201220745_1 20231201220754_1 20231202214724_1 20231202220204_1 20231202220222_1 20231202223421_1 20231202223520_1

Patriot687 commented 9 months ago

Just in case, I'll clarify - the bullet hole is also a decal, so this bug simply does not allow you to shoot at vehicles.

SpaxscE commented 9 months ago

probably model related problem. not sure how to fix without disabling decals completely

Patriot687 commented 9 months ago

Quite strange. Has anyone else had the same problem?

SpaxscE commented 8 months ago

you are not the only one with this problem, but i don't know how to fix it without disabling it completely

Patriot687 commented 8 months ago

you are not the only one with this problem, but i don't know how to fix it without disabling it completely

It probably has something to do with certain parts of the players' PCs (such as a video card or processor, I'm not good at this). Maybe you will create a Tool (as a separate addon or add it directly to the LVS Framework) that will disable decals for the selected object? I was looking for something like this in the workshop, but I didn't find it, and I can't do it myself. This would be a good solution to this problem for the first time. And don't give up. I think you are doing a very cool job - the next generation vehicle base for Garry's mod. LVS may have some problems, but it is quite possible to solve them, especially through the efforts of the entire community, which would not have paid attention to LVS if LFS had not been outdated. People are rarely happy when something changes dramatically in their lives (well, in this case in the game), but time will pass and they will accept LVS as well as LFS once (like me in general).

SpaxscE commented 4 weeks ago

for some reason this happens alot more on the main branch of gmod. It happens alot less on x86-64 which is why i was never affected by it.

I attempt to fix it now by removing decals everytime the vehicle takes damage. This will not fix decal or crash issues when decals are applied using other methods such calling util.decal directly on them. Another method i know to remove decals is to use ENT:SetRenderMode( RENDERMODE_TRANSALPHA ) in ENT:Initialize, however it breaks impact effects aswell. In a ideal world someone would go through all textures and add $nodecal 1 to the .vmt's of all vehicles that have this issue, but this is a monumental task and requires every vehicle developer to actually go through their vehicles.

Another method i can think of is to get all materials in ENT:Initialize on client, call ent:GetMaterials() and rebuild all textures with $nodecals in it and apply them all as custom submaterials. However, if someone changes the texture, the problem might come back with this method? Not sure if this is worth trying