HammerAddons icon indicating copy to clipboard operation
HammerAddons copied to clipboard

automated packing doesnt appear to work fully

Open Fennecai opened this issue 4 years ago • 27 comments

When I compile a map with this; it packs some materials but completely misses most other custom content. To verify this; I usually do the following things after compiling a portal 2 map with this:

  1. open the lump viewer in VIDE- sure enough, almost none of my custom content was packed automatically.

  2. open the compiled map in my mod where the search paths don't point to a place where the content is located - indeed, the maps have missing assets everywhere.

Unless I am misunderstanding how the system works... I know that comp_pack entities can be used to force certain files to be packed; however, due to the huge amount of custom assets I'm using, this is prohibitively tedious to use for every single asset.

If indeed this works "as intended"; and I need to place those pack entities for every single asset, I would like to suggest the addition of automated packing to this, which will find all the assets automatically.

I have previously been using compile pal; but recently ran into some problems with this and compile pal crashes. I'll probably create a separate issue regarding that.

Fennecai avatar Mar 09 '20 18:03 Fennecai

I do have automated packing packing support for all of these cases:

  • Brush materials, static props
  • FGD-based analysis of entities to retrieve any resources set in their keyvalues
  • A partially complete database of the resources each entity class uses in code (so pellets pack their resources for example)
  • Parsing models to retrieve the materials used, included models, and sounds played
  • Parsing materials to resolve Patch shaders and then textures used
  • Parsing soundscripts to match the name to the script file and sounds used

So it should find almost all resources. At the start of the log, there should be a dump of all the search paths it's using - check those to see if any locations are missing? I should make it also dump the full list of resources it attempts to pack, and which search paths have been blacklisted/whitelisted for packing.

TeamSpen210 avatar Mar 09 '20 20:03 TeamSpen210

yeah; that'd be a good idea. but your right too; cause apparently it decided to work now- i think. gotta do further tests but the packing seems like its working now. i'll comment further if it doesnt

Fennecai avatar Mar 09 '20 20:03 Fennecai

...and i loaded my mod and everything is missing. so indeed it doesn't work after all. after looking at the map's lump via VIDE and stuff; i can conclude that it seems to be only packing brush materials and nothing else.

Fennecai avatar Mar 09 '20 22:03 Fennecai

I think this is fixed?

vrad-exe avatar Apr 30 '21 22:04 vrad-exe

Seems like it.

TeamSpen210 avatar Apr 30 '21 22:04 TeamSpen210

it seems that its still broken for Garry's mod though

Fennecai avatar May 11 '21 01:05 Fennecai

In what way? I don't currently do anything for GMod, so it won't be able to automatically identify resources mounted by the mount.kv file. Is there a change in the BSP format then?

TeamSpen210 avatar May 11 '21 02:05 TeamSpen210

its broken in the way that it literally doesn't seem to pack any custom content at all; even when it is explicitly defined in comp_pack entities

On Mon, May 10, 2021 at 8:33 PM Spencer Brown @.***> wrote:

In what way? I don't currently do anything for GMod, so it won't be able to automatically identify resources mounted by the mount.kv file. Is there a change in the BSP format then?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/TeamSpen210/HammerAddons/issues/51#issuecomment-837670220, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACTCP7JV7LSG2PK6PGUBBH3TNCJQXANCNFSM4LEPEM4Q .

Fennecai avatar May 11 '21 02:05 Fennecai

Can you attach the log file, after compiling?

TeamSpen210 avatar May 11 '21 02:05 TeamSpen210

there isn't such thing as the "mounts.kv" file in gmod (maybe there was a super long time ago but idr), gmod uses a file called cfg/mount.cfg instead. (the game ignores gameinfo.txt's search paths too, its all completely controlled by this file)

also it appears the problem is that the postcompiler doesn't even run properly due to an error. the relevant compile log info:


** Executing...
** Command: E:\Antonios stuff\program files\Steam\SteamApps\common\GarrysMod\postcompiler\postcompiler.exe
** Parameters: "e:\antonios stuff\program files\steam\steamapps\common\garrysmod\sdk_content\maps/gm_fennecai_construct"

[I] postcompiler.main(): Srctools postcompiler hook started at 2021-05-11T10:59:40.026040!
[I] postcompiler.main(): Map path is e:\antonios stuff\program files\steam\steamapps\common\garrysmod\sdk_content\maps\gm_fennecai_construct.bsp
[I] config.parse(): Config path: "e:\antonios stuff\program files\steam\steamapps\common\garrysmod\srctools.vdf"
[E] (unknown file).(unknown function)(): Uncaught Exception:
Traceback (most recent call last):
  File "srctools\scripts\postcompiler.py", line 219, in <module>
  File "srctools\scripts\postcompiler.py", line 81, in main
  File "srctools\scripts\config.py", line 106, in parse
  File "pathlib.py", line 1204, in resolve
  File "pathlib.py", line 205, in resolve
OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: 'E:\\Antonios stuff\\program files\\Steam\\SteamApps\\common\\GarrysMod\\garrysmod\\addons\\*'
[18716] Failed to execute script postcompiler

EDIT: I just realized apon closer inspection of the error that the cause might be due to my use of wildcards in my mounts cfg.

Fennecai avatar May 11 '21 17:05 Fennecai

This seems to be the same problem as #26, but that's been fixed, so no idea why this would be different...

vrad-exe avatar May 11 '21 18:05 vrad-exe

now after further testing im just stumped because even after removing the wildcarded paths (don't need em after all) there's content that goes missing even when I explicitly tell the packer to pack it via comp_pack entities

Fennecai avatar May 11 '21 19:05 Fennecai

Still broken for portal 2

movercell avatar Mar 17 '23 15:03 movercell

It worked for me just yesterday

vrad-exe avatar Mar 18 '23 02:03 vrad-exe

Still broken for portal 2

Same, not even comp_pack can resolve the issue for me. Sent the map to a friend and half the textures are still missing.

electrovoyage avatar May 09 '23 09:05 electrovoyage

When i placed comp_packs into my map, all that changed is that i got a new error per comp_pack - Attempted to create unknown entity comp_pack Can't init comp_pack. I have no idea what to do. HA also doesn't autopack those textures.

electrovoyage avatar May 09 '23 09:05 electrovoyage

That suggests you're not actually running the postcompiler, it should have found and deleted those entities.

TeamSpen210 avatar May 10 '23 01:05 TeamSpen210

That suggests you're not actually running the postcompiler, it should have found and deleted those entities.

Just to confirm: the postcompiler is a separate application from Hammer's map build thing?

electrovoyage avatar May 10 '23 04:05 electrovoyage

Because i thought the default map compile thing was somehow modified by HA to autorun the postcompiler.

electrovoyage avatar May 10 '23 04:05 electrovoyage

The postcompiler is an application which needs to be added to the map compile view. There is an installer that does that for you, but you probably will need to do it manually.

TeamSpen210 avatar May 10 '23 04:05 TeamSpen210

I did use the autoinstaller, however (please excuse my lack of proficiency in Hammer) i don't know what map compile view is referring to. Can you please explain?

electrovoyage avatar May 10 '23 05:05 electrovoyage

I meant the "expert" compile window.

TeamSpen210 avatar May 10 '23 05:05 TeamSpen210

Oh, alright. I will try when i get back home.

electrovoyage avatar May 10 '23 06:05 electrovoyage

I meant the "expert" compile window.

So i opened the expert mode compile window, there is a d:/steam\steamapps/common\portal 2\bin/postcompiler/postcompiler.exe command, is it right? It's the only thing i found that actually has something to do with the postcompiler.

electrovoyage avatar May 10 '23 13:05 electrovoyage

That would be it yes. Those mismatched slashes might be breaking things.

TeamSpen210 avatar May 10 '23 13:05 TeamSpen210

I am running the '-both -final [slow!]' expertmode configuration, the postcompiler ran perfectly fine, so i don't think they are causing any trouble here.

electrovoyage avatar May 10 '23 13:05 electrovoyage

That would be it yes. Those mismatched slashes might be breaking things.

Thank you, i am very new to hammeraddons so i did need some help here.

electrovoyage avatar May 10 '23 13:05 electrovoyage