I started looking into simplifying vehicles with LUA, as in editing node/beam/etc properties or even removing them to create an imitation of simplified traffic except universal and programmatically applied. I then created this mod, which overrides functions nodeBeam.lua and stage2.lua. It mainly does things for non-player vehicles: Simplifies wheels by cutting numRays in half and by disabling most collision triangles (while making sure it's an even number) --this is the most effective on servers where people are actually driving Disables node.collision (a collision parameter which overrides all collision) for all nodes that are not on the outer shell of the vehicle. This is the most effective in the physics benchmark where cars are standing still (Credit to GitHub user Anonymous275, used with permission). It's not very subtle so feel free to disable it in the code if you like crashing. Disables aerodynamics (I hope). Probably helps. Doesn't seem to hurt. Only affects PressureWheels this is an oversight and probably easily fixed. I don't think the other wheels are used much though. For the player vehicle it disable self-collisions (this is the same as an already existing mod, selfCollisionDisabler). With this mod, I went from 430 MBeams/s to 720 MBeams/s in the ingame benchmarking tool. On actual servers it seems that wheel simplifying is the most beneficial. Things I'm thinking could be improved on: Tire generation, maybe remove them completely and use huge hubs (same as simplified vehicles) Further removing stuff that's expensive for performance and "unnecessary" for non-player vehicles (electrical systems, GPS dashboard etc etc) Simplifying the JBeam structure for other things than wheels Contains spaghetti code by me and better code by Anonymous275 and N_S (with permission). *Doesn't seem to work in the benchmark tool when in mod format, only if its directly applied into beamng files. If you want to try this it shouldnt overwrite anything, because the mod consists of extensions and scripts.* A very unscientific benchmark running 20 moving AI cars on the Automation Test Track. I assume the results are very similar without the node collision changes, so again, feel free to disable them unless you're desperate for FPS. *bugs* -Differentating between player and remote vehicle spawns is done with the obj.autoEnterVehicle parameter. This means that if you are spectating someone and his vehicle gets reset, the mod will disable itself -Seems that in BeamMP the node collision part of the mod doesn't always apply itself when it should -Vehicles spawned in SP when in freeview/noclip will get simplified
Hi, I installed your mod in the mods folder, but my benchmark performance has not increased in any way, what could this be due to?
Did you get prints in the benchmark console about the mod activating on cars? It probably didn't, I must have messed something up
You are correct, when in mod format, this doesn't affect the benchmark tool. I ran the benchmark after throwing this directly into beamng files and it works. The mod itself should work in actual gameplay even with it in the mods folder. (also judging from those prints, it seems that wheel simplifying only applied to the first car.. Not sure why. Seems to work fine ingame.) If anybody wants to improve upon this mod you are welcome to do so, as long as you share it for everyone to enjoy. I'm not a very skilled programmer.
I just unzipped the lua folder into the game folder and the changes show up --- Post updated --- this is actually a very interesting topic and I am glad that someone is also interested in optimizing the game
I'm happy to hear, but strictly speaking this is not optimizing, this is destroying things for performance. Its a tradeoff. BeamMP gets quite laggy and I figured you could nerf non-player vehicles quite a bit without it causing desync.
I just went to the public beammp server and noticed that jbeam seems to be really simplifying, this solution is very cool for beammp as aerodynamics and other things are just not needed for other people's cars --- Post updated --- Now with a friend checked on my server, with loading the mod in the mods folder, unfortunately it does not work in this case
Yes, this is an intended for BeamMP. Server needs to have a mod for it to work. Technically you can do as you did and throw it in the game files, but that probably goes against server rules and is prevented by some servers. BeamMP unloads everything in your mods folder.
I uploaded a mod to the server for the client part, I know that it is uploaded to the mods folder, apparently the mod itself does not work when it is in the mods folder.
I have it in compressed format now in the mods folder. I started SP and spawned some non-simplified traffic. Seems to have simplified their tires fine, but the way it differentiates between players and non-players is a bit sketchy and may be buggy. There could also be a bug related to BeamMP, I don't have server to test this on. In SP with traffic it works fine. You can see the car here has 8 spokes instead of 16.
I tweaked your version and it works as a mod, I also made the wheels simplified like the simplified cars do
Nice, wanna share? What did you change? --- Post updated --- I didn't get your issue repeated, I got this added on a server and it loaded and "worked" as in loaded and changed the cars. It has some issues with deciding who's a player or not. For example, when spectating someone in BeamMP, if his car gets reloaded then the parameter used for player-checking (autoentervehicle) is true, because you will still "enter it" as in keep spectating. So the whole logic of who's a player or not needs a major rework. Also whoops accidentally deleted the file from the post. It's back now.
-Changed the mod to hook into beamng vehicle creation, replacing, cloning and deleting functions to determine which vehicle is made by the user and what is remote
A version that no longer touches vehicle on vehicle collisions, simplifies tires so much that there no longer are tires and gives a significant FPS boost. Game should feel pretty much the same when using this. On the beamng benchmark it seems to perform worse than the last version because it can't see the wheel edits and collisions are increased. In actual gameplay I assume performance is better. Changes: -Disables static and selfCollision for all nodes not on the wheels or the outer shell of the vehicle (no longer touches vehicular collision parameters at all) -No longer disables selfCollision for your own vehicle (if you want to do this just add the line) -Wheels: removed tires completely and replaced them with huge, rubbery reinforced hubs -Got rid of global variables (this edit is by popular server host Unshown) With these new edits, truck wheels should also not collapse and towing should work. *edit: fixed mod-breaking bug* Two versions, reduced_col reduces vehicular collisions and gives more FPS the other version only reduces static and self-collision and gives less FPS but better NPC crash accuracy
yes, but i now fixed the issue and edited my last post. Latest version should work now too, hopefully.
I dont think "performanceModSuperV4_reduced_col.zip" works in multiplayer (unless i installed it wrong. idk)
Big update, not properly tested but posting it here anyway: -Changed everything else than powertrain and a specific wheel function to run on graphics step instead of physics step -Made simplified wheels use same parameters for hub properties as they would for tire properties -Fixed mod breaking when changing parts -Mod now breaks after two lua reloads (instructions how to avoid this commented in perfMod.lua -Fixed couplers getting their collision disabled -Turns traffic into slow-motion, this mod is really meant for BeamMP now. If you want to stop this, disable the physics-to-graphics step conversions in the code. Bugs: -wheels break a bit too easily