Everytime tire marks are being put down, I get INTENSE lag.... Anyone have any ideas? I've looked and looked to no avail... Any help is greatly appreciated. This map has 0 mesh roads for driving... EDIT:: Whoops! Link to mod: https://www.beamng.com/resources/thunder-valley.2522/
I mean when the car skids and leaves tire marks. That is when the lag happens. When I turn it off, no lag for me, but still a little bit for others. --- Post updated ---
Did you use simplified collision and not visual collision. If you have multiple face close to each other it can duplicate the number of tire mark. I will test on monday if i have time
Iv seen this on a few maps before. This is what i found that has worked for a few maps, ifyou tried this already then il try to find another solution. 1: Press F11 2: Find the "Decals Editor" button in the top left 3: Press tireTrackDecal 4: Put "Size" to 0
No reason to no be polite Was not able to get any lag on my machine, but I do see something. Are you using a 4096^2 heightmap? That may be your problem. Your heightmap is very big, and your terrain is scaled down by 0.15. The result is that your terrain has a quite high density of tris. Try increasing the 'ScreenError' value to something higher, like 64 or 128 (you will start seeing some artifacts on the edges, it's kind-of unavoidable) It will make the terrain less 'high-poly' at distance (still, considering your heightmap/scale ratio, that's still quite highpoly), and help the performance with decals. Or another solution is using a smaller resolution heightmap (something like 2048^2, or 1024^2, so that the resulting terrain has less density of polies)
In addition, let me explain in depth with some images: (Monkey head is approx. 5x3x3 meters) This is your 4096^2 terrain, with squaresize of 1 (means each heightmap pixel is 1 meter) This is your 4096^2 terrain, with squaresize of 0.5 You can see that scaling it down makes the grid closer, more dense This is your 4096^2 terrain with square size of 0.15 Now the terrain is very dense. That kind of density could cause performance issues, as tiremarks (and decals in general) needs to check that grid to apply the decals. If it's too dense, the calculations will take longer on weaker machines, causing lag. Do you know which part of the map makes the game lag when skidding? (Since I cannot get it to lag here)
It lags anywhere on asphalt whenever the tires slide. I have also tried this map with smaller base terrains at a higher square size to no avail
Can you try removing the 'managedDecalData.cs' from your 'art/decals' folder? (Well, backup it somewhere). Not sure if placebo, but seems to run smoother. If that file contained some wrong/modified values for the skidmarks, it could have caused the lag. Also, the mesh you use for the outer ring: The engine generally prefers square-ish faces against very long ones. I advice to add 2-3 horizontal cuts, it should help performance.
Just tried it with that file deleted and it still occurs. I've removed all objects and decals and roads and it still does it. And that is on the 1024x1024 base terrain at .6 square size!!
Just to test: Could you try to take your heightmap on a completely empty map (Take for example 'Pure Grid') and see if the same problem persists? (Try with various resolutions) It's either something wrong on the map itself, or the heightmap is doing strange things. Perhaps send me the original heightmap image, so that we can test here too.
Can't get around the tire mark lag. I just completely rebuilt the level on a 512x512 heightmap. Without any objects or roads, tire marks would still cause the extreme frame drop(160fps down to 90) The original heightmap is attached. This is frustrating. Did the developers decide to use Torque 3D because it was free? Or is there some other excuse?
What squareSize value are you using still? (Also, random-not-so-random question: your hardware specifications?) I've made various tests, by importing your heightmap on Pure Grid. The 4096^2 heightmap would lag if using too low 'squareSize' values (below 0.75 and so on). The 1024^2 heightmap would not lag, unless you go for very low values like 0.1-0.2). The 512^2 heightmap gave no problem. When you import a 4096^2 heightmap, the game creates a 'Terrain' with a quite high resolution, to fit a such large heightmap. Scaling it down to 0.15 (squareSize), means you now have a 614^2 terrain, with the same heightmap/terrain density of a 4096^2 terrain. That's overkill for the engine. Here's some image to visualize it better: 512^2 heightmap, on a terrain with 'squareSize' of 1: 1024^2 heightmap, on a terrain with 'squareSize' of 0.5: 4096^2 heightmap, on a terrain with 'squareSize' of 0.25: You can see how using a higher resolution heightmap, increases the terrain resolution. But if the terrain is scaled down to more or less 512^2, that density will become a problem. Since your terrain is being scaled down by 0.15, which means you get a resultant terrain of approximately 614^2, I advice to use a 1024^2 heightmap ( You'd need to apply a squareSize of 1,6 to return, approx. to the same size you had before. The end result would be the same terrain, but less dense. That should greatly improve performance.
Square size on a 512x512 is 1.2. Still causes lag and its not as smooth. Pc specs. GTX 1060SSC AMD FX-6350@4.5ghz Windows 10
The FX CPUs are already known to not be much great when it comes to BeamNG, due their weird architecture. If that happens, that means you should have the same lagging problems on pretty much any map? Or, still again, you only get lag on your map? Are you still testing the heightmaps on your level? Or have you tried to use the heightmap on Pure Grid? If you haven't, please do. It could be some specific configuration on your level doing that. Testing on another one (such as Pure Grid) would be a double check to either confirm or not that. Just load Pure Grid, remove the groundplane, then go to File > Import and try importing your heightmap (in various resolutions, like I did) and see if the lag happens on them or not.
Yes it does still lag on another level. And my computer runs every other map just fine. My other map "ATE Paradise" has a square size of .4 with 0 tire mark lag. --- Post updated --- P.S. If tire marks are already laid down and I am in the vicinity of them, the lag still occurs. As in just rendering them visible is causing the lag, not just the calculation of where to put them.
Really strange. Makes me think it's a problem with the heightmap itself. The fact it lags when you are close to the tiremarks makes me still think it's related to the density, since the map will reach the highest level of quality near the camera (hence become higher-poly and so on) We will have a closer look on Monday and see what's going on. PS- Could you see if you have the same lagging problem on this?
P.S. If tire marks are already laid down and I am in the vicinity of them, the lag still occurs. As in jus I'll give it a go --- Post updated --- Still does it on that terrain you sent me. And it showed up flat..