Writing a Pakrat replacement

Terr

Cranky Coder
aa
Jul 31, 2009
1,590
410
The remove selected button does not work.
:blink: I'll look into it.

Only packs vmt for sprites and not the vtf.
Ah, it seems there's a particular step where it is no longer checking if the "sprite" value is actually an .spr or a .vmt, so it's treating both cases like it would .spr files, adding them without analyzing them.

Corrupted a custom model once which resulted in the game crashing on the map (something about the models bounds I think I forgot to record the exact error).
This shouldn't really be possible. The actual packing is done by Valve's bspzip... PackBsp itself doesn't do any writing to game files except for renaming/moving things when you try to save over the same map.

Sometimes packed unnecessary files for props (i.e. an unused skin or an unused .phy file). Not a big problem as I was expecting it...
Yeah, in 2.0.3 I realized my strategy for avoiding unused skins only worked on simple models and then failed on complex ones. (Still working on getting that feature back for 2.0.4 or 2.0.5, once I figure out more of the MDL file format.)

My understanding for the .PHY files is that you almost always need them included unless your prop has collisions set to non-solid/bounding-box. Even then, if the prop isn't also static, some run-time code could alter the collision settings back to vphysics (the default setting) which AFAIK requires the data in the PHY file.

but not the locked material
Huh, what entity property was that specified on? 95% of the entity-related dependencies rely on the mod's FGD files.

and a sound called by point_client command
I don't have any plans to support this. There's simply so much that can be done by console commands, and they vary by mod-to-mod. If it becomes a big issue, I might make some sort of configuration file so that people can specify a regular-expression to search client-commands with.
 
Last edited:

A Boojum Snark

Toraipoddodezain Mazahabado
aa
Nov 2, 2007
4,775
7,670
I think I've found an error with your model reader. The material directory in a QC can have a leading slash (e.g. $cdmaterials "\models\props_reactor\") and both the compiler and engine handle it properly. However when it is read by your parser the packing list ends up with a double slash (e.g. models//props_reactor/reactor_top.vmt) and then BSPZIP fails to work. So I guess you'll want to trim any leading slashes off after reading the directory from the model.
 
Last edited:

Draco18s

L9: Fashionable Member
Sep 19, 2009
622
136
You may also want to test your program on the swamp pack props. There are a few (the ferns and the trees) that like to pack without their textures (the trees show up entirely purple checkered, the ferns only have their stems checkered).

I would use Pakrat on my artpass map, except that there's a cyclic error that Pakrat can't handle and is unable to finish packing. Your program catches it pretty gracefully.
 

Terr

Cranky Coder
aa
Jul 31, 2009
1,590
410
Whoah, it's art-pass time already? I'd better hustle some fixes out the door before the 25th!
 

Terr

Cranky Coder
aa
Jul 31, 2009
1,590
410
I'm planning to release bugfix-only 2.0.4 tomorrow or Friday, possibly along with some sort of tutorial (which would include how to test things packed correctly) for art-pass contestants.

The remove selected button does not work. When clicked it seems to delete a random file close to the selected file, so to delete files I had to remove the data source instead.

I was unable to reproduce this problem. Can anyone else get it to happen?

Only packs vmt for sprites and not the vtf.

Fixed in 2.0.4.

Very small problem :rolleyes:, the dependancy scan missed files for custom control point hud materials (packed the unlocked material but not the locked material)

I see the problem, but I might let it slide for now rather than scramble to get it in 2.0.4.

The problem is that TF2 looks at the various HUD icons on team_control_point, and silently/automatically looks for *_locked.vmt versions when you run your map.

Since there is no way for me to know a mod will do this in advance, I will need to create some sort of configurable module that handles these special cases (similar to the map-includes) and that seems like too much to squeeze in right now.

I think I've found an error with your model reader.

Fixed in 2.0.4, thanks.
 
Last edited:

Draco18s

L9: Fashionable Member
Sep 19, 2009
622
136
Oh, just some "feature wishlist" things:

1) Remember where my steam directory is. I shouldn't need to browse to it every time.
2) Add multiple files at once (ctrl-click in the file browser window).
 

Beetle

L9: Fashionable Member
Aug 17, 2008
627
178
Terr, I was also having the "not being able to delete" (or randomly deleting a file that definitely wasn't selected) problem. It would work a few times, but after a few deletes it would either not delete or delete another file I didn't select - I'm not sure which. Maybe you can reproduce it if you delete a bunch of things.

Also, I used a vtf/vmt for a sprite instead of a .spr, and since it was not used anywhere else I had to manually add it since I guess when checking for sprites it doesn't think to look for vtfs also.
 

Terr

Cranky Coder
aa
Jul 31, 2009
1,590
410
/emailed instead

That's very weird. According to the log it couldn't find conf\map_includes.xml... (In the "conf" directory adjacent the packbsp.exe.) It is there, right? Maybe some bizarro "what is my current directory anyway" issue? :eek:hmy:

1) Remember where my steam directory is.
So much for mac-compatibility. Aw, who am I kidding, I don't have one to test on anyway.

There should be some third-party libraries I can pull in that will let me query the windows registry.

Add multiple files at once (ctrl-click in the file browser window).
Noted, but low-priority. I'm working under the principle that if someone needs to add a lot of files, that means I need to make it automatic instead ;)

Terr, I was also having the "not being able to delete" (or randomly deleting a file that definitely wasn't selected) problem.
Hmm. Will keep plugging at it then.

Also, I used a vtf/vmt for a sprite instead of a .spr, and since it was not used anywhere else I had to manually add it since I guess when checking for sprites it doesn't think to look for vtfs also.

This is fixed in 2.0.4.
 

Drexer

L2: Junior Member
Jun 23, 2009
66
42
There should be some third-party libraries I can pull in that will let me query the windows registry.

Do not forget to do this instead of just assuming that the installation is under the C folder. Please.

Apparently nowadays only 10% of developers take the care to do that properly.
 

Draco18s

L9: Fashionable Member
Sep 19, 2009
622
136
So much for mac-compatibility. Aw, who am I kidding, I don't have one to test on anyway.

I don't mind having to tell it once, it could just save the path to a config file. That would work on Mac, PC, and Linux.

Do not forget to do this instead of just assuming that the installation is under the C folder. Please.

Oh god, yes. I wish I could tell Windows "please make the default installation drive drive E."
 

Drexer

L2: Junior Member
Jun 23, 2009
66
42
Oh god, yes. I wish I could tell Windows "please make the default installation drive drive E."
You can do it by easily editing the registry. The problem is that many software developers instead of checking its value just assume it's drive C. Heck, the only program I installed which wasn't open source and that checked my registry install directory was Steam.
 

Draco18s

L9: Fashionable Member
Sep 19, 2009
622
136
You can do it by easily editing the registry. The problem is that many software developers instead of checking its value just assume it's drive C. Heck, the only program I installed which wasn't open source and that checked my registry install directory was Steam.

Also true.
 

Terr

Cranky Coder
aa
Jul 31, 2009
1,590
410
Okiedoke, registry-reading mumbo-jumbo is present in 2.0.4.

While I do want some eventual mac-compatibility, in order to get there I'd need to either learn some more C or rope in someone to build some mac-compatible hllib binaries.
 

Terr

Cranky Coder
aa
Jul 31, 2009
1,590
410
2.0.4 released.

I've posted the changelog as well, and hopefully everyone having trouble will see something on there that addresses their problem.

This release also fixes a minor logic issue where identical swamp-pack materials in the game directory would be unnecessarily packed. In the process I notice valve changed a trophy_head.mdl file, and PackBSP will complain at you if you try to "override" Valve's version of swamp pack items with your own, differing version.
 

Terr

Cranky Coder
aa
Jul 31, 2009
1,590
410
OK, I will have some time to work on 2.0.5 coming up, and I'm trying to figure out what to prioritize among some of the big looming issues:

Ideas (some very large):
  • Ability to manually control the file search paths, so you can have PackBSP "pretend" that certain files from another spot are in the game directory. (Allows certain workflows.)
  • A ways to create mod-specific "plugins" for edge-cases like TF2's control point *_locked.vmt images.
  • New code to read PCF files to find materials/textures/sprites that particles rely on.
  • Deeper MDL parsing to determine what skins are actually "in use" for a skin family setting. (The "simple way" isn't reliable enough.)
  • Support for L4D or Alien Swarm.
  • Rewrite the app to have a graphical interface of the dependencies that you can edit manually and iteratively scan. (Rough idea.)
 
Last edited:

J4CK8

L11: Posh Member
Mar 4, 2009
820
243
untitled.JPG


Nothing downloading or running...

And the debug log, incase it's of any use :)

And...no preference from me :p