this is awesome to see. i've been dipping my toes in some python programming and was thinking of using this task to expand my skills.
Hello! I just deployed a rather big update. The tool has now a better user interface which is not as ugly as the old one. And tataa: a first experimental feature for copying assets from one map to another. Here is the whole description: 1. Map Shrinker You can load a zipped map and let the tool search for orphaned files and assets which are not needed in the map. This can save a lot of space. All files and configurations will be checked against your scene tree with all of its dependencies and a proposal for file deletion is shown. Please check the list. It is always possible that the tool deletes too much. So always use a copy of your project! This tool is made for deleting things The good thing: You still have all your crap in the project and can use it for further ideas while having a lean deployment file. 2. Rename Map You can load a zipped map and then change the name in the file system. This is important if you want to see this map beside the original one. If you customized the industrial level for example and want to have your own customized level beside industrial, you could rename it with industrial_larry You can change the shown name in the map overview, too. After renaming you can build a new zipfile with the tool and you are ready to go. 3. Copy Assets (Experimental) You can load a zipped map you want to copy assets from and a zipped map you want to have the assets. At the moment the tool allows to copy decalroads, decals and collada assets (dae files). You get a list of all the assets and can select the ones you want to copy. No need anymore for copying the whole folders from the desired maps. The tool copies only the needed materials and places them in a dedicated folder per assettype starting with a "MT_" for Mapping-tools. This functionality is not well tested yet. Therefore the experimantal state. Very old maps with a lot of cs files are likely not working with this functionality. This tool doesn't like corrupted json files or files with duplicate keys (and the funny json comments) which you can even find in the vanilla maps. The tool throws an error with a detailed errormessage and if your assets aren't copied because of that you have to correct the errors and start again. Before you start It's a good idea to copy the maps you want to work with to a dedicated folder. The tool does a lot of unzipping, zipping and logfiles. You don't want to have that in your vanilla maps folder Have fun! Alex
Truly incredible. You are a hero among us mere mortals. Seriously, this is the sort of thing that will get me back in the saddle of map making. Thanks.
I just posted a small update with some UI improvements and more simplicity in working with folders and zip files. https://github.com/alexkleinwaechter/BeamNG_LevelCleanUp/releases/tag/0.9.1 Beta Release 0.9.1 Copy assets: Choose vanilla levels from the game install directory with a dropdown. The file will be copied to the a working directory before processing Copy assets: the tool tries to find assets which are linked to another vanilla level in the vanilla zip file and copies it when found. Copy assets: better preview of materials and dae files. It would be great if someone could test the automatic resolver for the steam game directory on the copy asset form. On my side it works but it is a bit hacky. Copy assets: Asset preview:
I just did a small update so that polish roads can be shrinked without visible errors. I added a check if material name is not set and use internal name instead.
The 9.1 version downloaded from your website does not run. I tried a few different folders, but it does not work for me. System.IO.FileNotFoundException: The system cannot find the file specified. (0x80070002) Plus, if the update box pops up, you can't click the exception/crash box even though the crash box obscures the update window. Pressing continue gives a blank screen. Running as administrator does not improve things any.
I saw that too. There was a problem with the UI components I'm using. It is fixed now. Thanks for the info! --- Post updated --- I'm really sorry, Bob! I don't know why you have the problem. It's important to keep all the files and folders in the unzipped app folder. Perhaps you make a new download from github and delete the old version. Normally there shouldn't be an update notice anymore if you download it from scratch. --- Post updated --- I just did a small tutorial video for the copy assets feature.
Hi Alex, hope it's fine to post here: I encountered the same problem as bob.blunderton. I downloaded various versions from https://github.com/alexkleinwaechter/BeamNG_LevelCleanUp/releases/ extracted to diferent folders but it didn't run. It shows an error message from .Net with the code (0x900700002) (File not found / System.IO.FileNotFoundException). Ignoring it causes the main window to be empty. I attache the details of the error message as a text file here. Please could you help, cause I think your tool is a must have for my project.
Hello Alex, I absolutely love the look of this application but I have been running into issues when trying to use it and it gives me this error: What might I be doing wrong that is causing this? (I followed the posted tutorial but I very well could have missed something) Thanks, all the best, and I hope your vacation was good
Open the info.json and take a look at line 7. there might be a wrong ending which is described in the error message. Just fix it and save. My tool doesn’t like corrupted json files. To narrow this down, could you try installing https://developer.microsoft.com/en-us/microsoft-edge/webview2/ on the target machine and let me know if that fixes it? I have to make a new installer for my tool but don’t have the time at the moment.
You are a legend. Worked like a charm. Took my map from 3.8GB to under 400MB. Best mod ever I think lmao
This utility is a great idea, but why does the map I want to copy the assets to have to be hand-placed in the default BeamNgMT folder when the program already unpacks it to transfer the files (and obviously has the capability to move the files as evidenced by the copying of vanilla maps), and why doesn't it automatically clean up this folder by deleting everything in there except the resulting deployment zip file when the copying is done? It would be even more convenient if it could copy a destination map from a custom location and clean its folder automatically, and these seem like easy functions to implement.
Found the solution to your problem: The tool needs the Microsoft WebView2 Runtime to run properly. Its already installed on Windows 11 and newer versions of Windows 10. You can Download and install the Runtime from this Website: https://developer.microsoft.com/en-us/microsoft-edge/webview2/ Direct link to the installer: https://go.microsoft.com/fwlink/p/?LinkId=2124703
There are a lot of things to improve in this tool but I do it just for for fun helping me in developing maps and my time is limited. In the beginning I had the possibility to open up even an unpacked folder for running the different features. I stripped it out because I am afraid that people falsely use it on their project (perhaps without backups) and destroy it with my tool. But you are right, I could do an automatic copy. Will think about it. I don't do a cleanup for personal purposes. The tool writes some log files in the project folder and I want to check the results. Deleting a folder in Windows Explorer should be possible for the user. Best! Alex
There is a duplicate entry in your info.json. Open the info.json in the root of your map, find the duplicate entry and delete the row (including the last comma if its not the last entry). Then save the info.json. then try again. Example in the image: In your case it is the previews property: BeamNg somehow ignores this error and takes the first or the last one. I don't know. But it is no valid json, because the keys have to be unique normally. My tool can't handle this error. So you have to fix it manually.