ruarai / CompilePal

A tool to assist in the compiling of source engine maps
GNU General Public License v3.0
220 stars 25 forks source link

Compile fails when packing files (v27.19) #168

Closed killer89 closed 2 years ago

killer89 commented 2 years ago

Compile fails when content packing is enabled.

debug.log

Exactol commented 2 years ago

Can you translate this? System.IO.EndOfStreamException: Lukutoimintoa ei voi käyttää virran loppukohdan ulkopuolella. kohteessa System.IO.BinaryReader.FillBuffer(Int32 numBytes) kohteessa System.IO.BinaryReader.ReadInt32() kohteessa CompilePalX.Compilers.BSPPack.AssetUtils.FindVtxMaterials(String path) tiedostossa D:\a\CompilePal\CompilePal\CompilePalX\Compilers\BSPPack\AssetUtils.cs:rivillä 270 kohteessa CompilePalX.Compilers.BSPPack.PakFile.AddModel(String internalPath, List 1 skins) tiedostossa D:\a\CompilePal\CompilePal\CompilePalX\Compilers\BSPPack\PakFile.cs:rivillä 283 kohteessa CompilePalX.Compilers.BSPPack.PakFile..ctor(BSP bsp, List 1 sourceDirectories, List 1 includeFiles, List 1 excludedFiles, List 1 excludedDirs, List 1 excludedVpkFiles, String outputFile) tiedostossa D:\a\CompilePal\CompilePal\CompilePalX\Compilers\BSPPack\PakFile.cs:rivillä 151 kohteessa CompilePalX.Compilers.BSPPack.BSPPack.Run(CompileContext context) tiedostossa D:\a\CompilePal\CompilePal\CompilePalX\Compilers\BSPPack\Pack.cs:rivillä 246

killer89 commented 2 years ago

System.IO.EndOfStreamException: The read function cannot be used outside the end of the current. in System.IO.BinaryReader.FillBuffer (Int32 numBytes) in System.IO.BinaryReader.ReadInt32 () in CompilePalX.Compilers.BSPPack.AssetUtils.FindVtxMaterials (String path) in D: \ a \ CompilePal \ CompilePal \ CompilePal \ BSPPack \ AssetUtils.cs: on line 270 in CompilePalX.Compilers.BSPPack.PakFile.AddModel (String internalPath, List 1 skins) in D: \ a \ CompilePal \ CompilePal \ CompilePalX \ Compilers \ BSPPack \ PakFile.cs: on line 283 in Comp .Compilers.BSPPack.PakFile..ctor (BSP bsp, List 1 sourceDirectories, List 1 includeFiles, List 1 excludedFiles, List 1 excludedDirs, List 1 excludedVpkFiles, String outputFile) in D: \ a \ CompilePal \ CompilePal \ CompilePalX \ Compilers \ BSPPack \ PakFile.cs: on line 151 in CompilePalX.Compilers.BSPPack.BSPPack.Run (CompileContext context) in D: \ a \ CompilePal \ CompilePal \ CompilePalX \ Compilers \ BSPPack \ Pack.cs: on line 246

PixelAffection commented 2 years ago

I have the same issue, I found out that this happens every time I have both CSS and CS:GO mounted in Hammer at the same time, I think some of the content is conflicting with each other and the program gets confused which one's content should be packed into the map.

Exactol commented 2 years ago

Compile Pal 027.19.zip I added more logging to help find the issue, can you try this build and upload the debug.log file?

killer89 commented 2 years ago

Compile Pal 027.19.zip I added more logging to help find the issue, can you try this build and upload the debug.log file?

debug.log

Exactol commented 2 years ago

It looks like there might be an issue packing models/props_vehicles/humvee_glass.mdl. Can you send me the model and materials? You can send it over discord if you don't want to upload it publicly.

killer89 commented 2 years ago

humvee_glass.zip

Exactol commented 2 years ago

It looks like the humvee_glass.vtx file is corrupted (I don't think it's even used https://developer.valvesoftware.com/wiki/VTX#:~:text=It%20is%20currently,Portal%202.). VTX files are binary, but this looks like its a badly formatted VMT text file.

killer89 commented 2 years ago

Recompiled the model, and now the packing fails without an error.

debug.log

And if i try to pack with only the pack-setting toggled on, the following error appears:

System.OutOfMemoryException: Tyypin System.OutOfMemoryException poikkeus. kohteessa CompilePalX.Compilers.BSPPack.BSP.buildModelList() tiedostossa C:\Users\10zil\Documents\Projects\C Sharp\CompilePal\CompilePalX\Compilers\BSPPack\BSP.cs:rivillä 314 kohteessa CompilePalX.Compilers.BSPPack.BSP..ctor(FileInfo file) tiedostossa C:\Users\10zil\Documents\Projects\C Sharp\CompilePal\CompilePalX\Compilers\BSPPack\BSP.cs:rivillä 99 kohteessa CompilePalX.Compilers.BSPPack.BSPPack.Run(CompileContext context) tiedostossa C:\Users\10zil\Documents\Projects\C Sharp\CompilePal\CompilePalX\Compilers\BSPPack\Pack.cs:rivillä 230

Exactol commented 2 years ago

Are there any crash logs in the Compile Pal folder?

killer89 commented 2 years ago

Are there any crash logs in the Compile Pal folder?

No

Exactol commented 2 years ago

Can you send the unpacked bsp and the recompiled model?

killer89 commented 2 years ago

Unpacked complex.zip

Packed packed.zip

Exactol commented 2 years ago

What game is this for? The packed BSP seems corrupted, it crashes VIDE when I try to open it and GCFScape shows that it has no lumps. The unpacked one worked fine for me.

killer89 commented 2 years ago

Half-Life 2: Episode Two. The packing turns out like that when packed using compilepal, however packing with VIDE works without issues

Exactol commented 2 years ago

Compile Pal 027.20.zip Can you try packing with this version?

killer89 commented 2 years ago

Compile Pal 027.20.zip Can you try packing with this version?

Still same.

Exactol commented 2 years ago

Can you send me the debug.log?

killer89 commented 2 years ago

debug.log

Exactol commented 2 years ago

The log looks like it ran normally. Can you try verifying your game files and then retry packing it?

killer89 commented 2 years ago

Verified and tried again. No luck.

Also as a side note, i'm using Slammin' Source Map Tools (tried also with vanilla tools). For some reason trying to pack stuff with compilepal seems to corrupt the map, but VIDE however can pack the exact same content without issues.

Exactol commented 2 years ago

Compile pal doesn't directly modify the map, it just calls bspzip. Can you send me the files.txt file in the Compile Pal BSPZipFiles folder?

killer89 commented 2 years ago

files.txt

Exactol commented 2 years ago

Can you run the pack step with the verbose parameter and send the log? It should show the output from BSPZip

killer89 commented 2 years ago

2022-07-09T22-05-48.txt

Exactol commented 2 years ago

It looks like there was a bug that prevented the full output from being logged, can you send the log from this new version? Compile Pal 027.20.zip

killer89 commented 2 years ago

Now compiling jams (idles at 80%, when packing is supposed to start) at image

Exactol commented 2 years ago

Compile Pal 027.20.zip Try this build

killer89 commented 2 years ago

New error: BSPZIP exited with code: -1073741819

debug.log

Exactol commented 2 years ago

It looks like this might be an issue with BSPZIP, do you have any large files that you are trying to pack into the map? Sound files are usually pretty large so it might be a good place to check.

killer89 commented 2 years ago

I may have found out the issue. It seems that HL2EP2's bspzip.exe has a stability issue related to handling of large amount of custom assets, which however is fixed in TF2's version of the tool.

"Improved bspzip tool stability when packing maps with large amounts of custom assets"

https://www.reddit.com/r/tf2/comments/43wnv5/tf2_update_for_2216/

I replaced HL2EP2's bspzip.exe with TF2's, and the packing succeeded after the compiling. The level also loaded normally. However this still doesn't explain why bspzip worked normally in VIDE, while corrupting the map when used to pack content through compilepal.

Exactol commented 2 years ago

Compile Pal uses BSPZIP, but I'm pretty sure VIDE does not, which would explain why it was able to successfully pack it

killer89 commented 2 years ago

Seeing that it's an issue in Valve's tool, it would probably be a good idea to create an explanation for that bspzip error, in case someone else gets it.