Facepunch / sbox-issues

176 stars 12 forks source link

Hammer fails to copy compiled map to game directory #4610

Closed jkinz3 closed 9 months ago

jkinz3 commented 9 months ago

Describe the bug

User is unable to use compiled maps due to hammer failing to copy compiled map to game directory. The map compiles and outputs the VPK file but hammer throws an error when it tries to copy it to the game directory.

To Reproduce

Steps to repro (100% repro rate):

  1. Load s&box and create a new project.
  2. Create and save map and open in hammer.
  3. Place a mesh and a player start and try to compile

Expected behavior

The VPK file should be copied to the game directory properly without error so it can be loaded into a scene.

Media/Files

Here is the compile command

G:\Steam\steamapps\common\sbox\bin\win64\resourcecompiler.exe -fshallow -maxtextureres 256 -dxlevel 110 -quiet -html -unbufferedio -noassert -i "i:/s&box/johnbox/maps/map01.vmap"  -world -nosettle -nolightmaps -searchpaths "I:\s&box\JohnBox\;G:\Steam\steamapps\common\sbox\addons\citizen\;G:\Steam\steamapps\common\sbox\addons\base\;G:\Steam\steamapps\common\sbox\core\;G:\Steam\steamapps\common\sbox\.source2\cloud\;G:\Steam\steamapps\common\sbox\.source2\temp\"  -outroot "G:\Steam\steamapps\common\sbox\.source2\mapbuild-output"

And here is the log from the compile

Start build: 2024-01-27T07:57:44
Hammer: Attempting incremental build.
Hammer: Previous build not found. Performing full build.
WARNING: resource 'postprocess/standard.vpost' is an unrecognized resource type!
WARNING: resource 'postprocess/standard.vpost' is an unrecognized resource type!
WARNING: resource 'postprocess/standard.vpost' is an unrecognized resource type!
WARNING: resource 'postprocess/standard.vpost' is an unrecognized resource type!
WARNING: resource 'postprocess/standard.vpost' is an unrecognized resource type!
WARNING: resource 'postprocess/standard.vpost' is an unrecognized resource type!
Unzip map01.vpk (11 files):
Tried to Seek NULL file handle!
FS: Tried to Read NULL file handle!
Tried to Seek NULL file handle!
FS: Tried to Read NULL file handle!
Tried to Seek NULL file handle!
FS: Tried to Read NULL file handle!
Tried to Seek NULL file handle!
FS: Tried to Read NULL file handle!
Tried to Seek NULL file handle!
FS: Tried to Read NULL file handle!
Tried to Seek NULL file handle!
FS: Tried to Read NULL file handle!
Tried to Seek NULL file handle!
FS: Tried to Read NULL file handle!
Tried to Seek NULL file handle!
FS: Tried to Read NULL file handle!
Tried to Seek NULL file handle!
FS: Tried to Read NULL file handle!
Tried to Seek NULL file handle!
FS: Tried to Read NULL file handle!
Tried to Seek NULL file handle!
FS: Tried to Read NULL file handle!
Done (0.0 sec: 0.2ms read, 2.4ms write 0.0mb).
Building map "maps\map01"...

Step 1: world
Loading Map...Done (0.00 seconds) 

Creating World
Fixing T-junction edge cracks...Done 0.0 seconds
Generate Overlay Meshes...[0....1....2....3....4....5....6....7....8....9....] Done (0.00 seconds)
Creating 1 world nodes Building render clusters... 1 meshes, 12 triangles... 1 clusters (0.00 seconds)
Building bounds groups...[0....1....2....3....4....5....6....7....8....9....] Done (0.00 seconds)
Created 1 world nodes
--> Map build finished.
Pack map01.vpk (path0\maps\map01.vpk):
Writing... Done.
-----------------------------------------------------------------
OK: 8 compiled, 0 failed, 0 skipped, 0m:01s
-----------------------------------------------------------------
ID3D11Device has 1 outstanding references indicating leaked D3D11 resources. Hammer: Copying compiled map to game directory.
From: G:\Steam\steamapps\common\sbox\.source2\mapbuild-output\local.johnbox\maps\map01.vpk
To: i:/s&box/johnbox/maps/map01.vpk
Hammer: Unable to copy vpk file to game dir
G:\Steam\steamapps\common\sbox\.source2\mapbuild-output\local.johnbox\maps\map01.vpk
to
i:/s&box/johnbox/maps/map01.vpk
End build: 2024-01-27T07:57:46, elapsed time 0h:00m:02s.007ms

Additional context

I looked at the location where hammer is looking for the VPK file and there is no VPK file there. Instead, I found that hammer spits the VPK file to another path. In the compile that produced the log above, it spit the file into sbox\core\path0\maps It appears that some part of the compile process thinks i'm working on core, however I don't want to try to guess the solution too much.

handsomematt commented 9 months ago

4597 - should be fixed now, if not leave a comment there

jkinz3 commented 9 months ago

@handsomematt How much time does it take for a fix to propagate through steam?

handsomematt commented 9 months ago

https://steamdb.info/depot/590831/history/

It's live, sometimes you have to restart Steam for it to see the update

osmanlodzero commented 9 months ago

Not working for me, it's back to not compiling at all it seems.

Getting the following:

Hammer: Attempting incremental build.
Hammer: Previous build not found. Performing full build.
WARNING: resource 'postprocess/standard.vpost' is an unrecognized resource type!
WARNING: resource 'postprocess/standard.vpost' is an unrecognized resource type!
WARNING: resource 'postprocess/standard.vpost' is an unrecognized resource type!
WARNING: resource 'postprocess/standard.vpost' is an unrecognized resource type!
WARNING: resource 'postprocess/standard.vpost' is an unrecognized resource type!
WARNING: resource 'postprocess/standard.vpost' is an unrecognized resource type!
"SplitFullPath" failed on d:\work\lodzero\p&zerball\maps\devmap.vmap.
-----------------------------------------------------------------
OK: 0 compiled, 0 failed, 1 skipped, 0m:00s
-----------------------------------------------------------------
ID3D11Device has 1 outstanding references indicating leaked D3D11 resources. Hammer: Copying compiled map to game directory.
From: D:\SteamLibrary\steamapps\common\sbox\.source2\mapbuild-output\lodzero.physicstest\maps\devmap.vpk
To: d:/work/lodzero/p&zerball/maps/devmap.vpk
Hammer: Unable to copy vpk file to game dir
D:\SteamLibrary\steamapps\common\sbox\.source2\mapbuild-output\lodzero.physicstest\maps\devmap.vpk
to
d:/work/lodzero/p&zerball/maps/devmap.vpk
End build: 2024-01-28T00:37:10, elapsed time 0h:00m:01s.005ms
handsomematt commented 9 months ago

image

What does this bit say for you

osmanlodzero commented 9 months ago

D:\SteamLibrary\steamapps\common\sbox\bin\win64\resourcecompiler.exe -fshallow -maxtextureres 256 -dxlevel 110 -quiet -html -unbufferedio -noassert -i "d:/work/lodzero/p&zerball/maps/devmap.vmap" -world -bakelighting -lightmapMaxResolution 512 -vrad3 -lightmapDoWeld -lightmapVRadQuality 1 -lightmapCompressionDisabled 0 -phys -vis -nav -outroot "D:\SteamLibrary\steamapps\common\sbox\.source2\mapbuild-output" -searchpaths "lodzero.panzerball|D:\Work\LODZERO\P&zerBall\"

handsomematt commented 9 months ago

thanks that pinned it down, there will be a new build in 10 mins that should work now

osmanlodzero commented 9 months ago

Yep that works, it compiles now and also copies correctly. My map instance component does not show it until I play the game, but perhaps that's a separate issue from this.

Thanks!