ruarai / CompilePal

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

Error reporting results in CompilePal crashing #108

Open ProfessorFartsalot opened 4 years ago

ProfessorFartsalot commented 4 years ago

Describe the bug After cubemaps are completed and packing starts, the program fails. It is believed through testing in Visual Studio and modifying line 114 of CompileManager.cs that the program, when Pack runs, assembles a list of files and then outputs any errors that may have occured. However, if no errors have occured, the string that reports said errors is defaulted to null.

Steps to reproduce Create a new preset, VBSP VVIS VRAD COPY NAV CUBEMAPS PACK REPACK STATS and let it run.

Expected behavior The map should pack as previous versions (27X) worked.

Debug.log debug.log

Crash logs If applicable, please upload crash logs found in the CrashLog folder.

Additional context Game is Team Fortress 2

Also, using version 27X the pack works fine, so something that changed between 27X and 27.8X appears to have broken the pack command. This bug also seems present in 27.7X To get even more specific, I loaded D:\testmap.vmf and attempted to run the above commands on it in 27.7 and 27.8 as well as the 27.9 version that was uploaded on #107 . None of them would pack, even when ran as admin.

I believe a fix for this would be to either set a default string for the error handler which if no errors happen would result in a message "PACK OK" instead of crashing with a null value, or just comment line 114 out until a fix is implemented.

ProfessorFartsalot commented 4 years ago

Okay, so I downloaded your code and injected it into Visual Studio 2019 and commented out line 114 of CompileManager.cs compileErrors.AddRange(currentCompileProcess.CompileErrors); which I believe is when you added error reporting. It seems as though when the compile finishes with no errors, whatever your compile error string is defaults to being null, which your line 114 tries to load even though it is null. After testing commenting line 114, I can report back that it is a valid solution.

Exactol commented 4 years ago

Thanks for investigating the issue. Can you try this version? Compile Pal 027.9.zip

ProfessorFartsalot commented 4 years ago

Packing is now resolved, however now nav generation does not appear to work in that version even though console says it's sampling. I get stuck on "Parsing game info" until I eventually get tired of waiting and cancel to see that it finished in console and then attempted to reload the map to no avail. Something it didn't do however, was delete any potentially existing nav mesh data, which there is. Also, I was looking into Task Manager to see if TF2 was using any CPU usage and it appears tf2 is just spiking cpu usage (CPU 0 Node 0 it looks to be anyway) awkwardly. image

Also, here is my console output: https://gist.github.com/Dovahkiin-Warrior/1b7bc24f18ed494ddd23da3b5129400d .

ProfessorFartsalot commented 4 years ago

Update: It is speculated that compilepal is not deleting the config file when running the nav generator. I have checked my tf/cfg folder while the nav generator runs and it never removes the map cfg file. This may be what's leading to the endless loading issue I'm having.

Edit: Further testing reveals that quit is missing from line 3 of the generated map config file for generation of nav mesh, therefore when tf2 reloads to initiate the nav mesh, it executes nav_generate again instead of quitting the instance. I added 'quit' to the config manually which resolves the issue for me. Oddly enough, 27.8 does not appear to have this issue of needing quit added to the config file.