Please or Register to create posts and topics.

Custom Sounds and Scenes

PreviousPage 3 of 3

Thanks for posting this, it's good research. I'm working on a packing tool and I'm currently planning a system a bit like:

  1. Given various inputs, determine what files the map(s) need
  2. User picks which files should be per-BSP.
  3. (If >1 map) Remainder go into VPK

Hopefully that will cover this kind of problem in a generally-useful way without too much special-case coding.

PrejudicedNanobot wrote:
Where is this soundcache folder? Is it inside the Colours BSP? I haven't tried anything relating to Pakrat or embedding resources in BSPs yet, so I don't know how to open these "special" BSPs (assuming it's possible to do so).

You can view BSPs and a variety of Source formats with GCFScape. Every BSP has a predefined "zone" in it for placing packed data (the "Pakfile Lump") which basically stores a bunch of files with information on their name and subdirectory.

I actually tried using GCFScape to open one of the Colours maps originally (after Kasc confirmed that he was indeed looking inside the BSP), but it generated an error. Pakrat didn't seem to have a problem opening it, but there was no soundcache folder shown in the directory structure. However, I haven't actually run the map, so perhaps the soundcache is generated and stored in the BSP when the map is first run (or Pakrat doesn't recognize soundcache folders and Map Analyst does).

With regards to making a packing tool, it seems like Pakrat and the other bspzip derivatives are pretty much sufficient at this stage. Their limitations (no soundscripts or VCDs, at least based on the testing I've done) are shared by VPKs (VCDs require scenes.image to be rebuilt with the new scenes in the root scenes directory and soundscripts don't seem to load unless added to game_sounds_manifest.txt). Although it would be more efficient to include sounds once in a VPK when they're shared by several maps (which could make a packing tool that does this automatically quite a time-saver), it appears that doing so requires the user to update their sound cache, which isn't ideal, particularly if the user isn't familiar with the console.

On the whole, these seem like limitations in the way Portal 2 handles custom content that can't be overcome without an update to the engine, e.g., to include a console command to build a selective audio cache and to load soundscripts based on a <mapname>_level_sounds.txt file (if the VDC wiki is to be believed, L4D2 already does both these things). At this stage, despite what the Releasing A Portal 2 Map article says, it simply seems that VPKs aren't of much use for Portal 2 map distribution. However, hopefully I've missed something and someone more VPK-savvy than myself will figure out how to get these various things working in the future!

PrejudicedNanobot wrote:
With regards to making a packing tool, it seems like Pakrat and the other bspzip derivatives are pretty much sufficient at this stage.

Well, not to get too much into a self-promoting mood, but AFAIK both Pakrat and MAN have been "dead" projects for going-on five whole years, and are also closed-source so nobody can pick up the pieces. Meanwhile, Valve and third-party modders are always adding new shader parameters and map-name based items.

PrejudicedNanobot wrote:
On the whole, these seem like limitations in the way Portal 2 handles custom content that can't be overcome without an update to the engine, e.g., to include a console command to build a selective audio cache and to load soundscripts based on a <mapname>_level_sounds.txt file (if the VDC wiki is to be believed, L4D2 already does both these things). At this stage, despite what the Releasing A Portal 2 Map article says, it simply seems that VPKs aren't of much use for Portal 2 map distribution. However, hopefully I've missed something and someone more VPK-savvy than myself will figure out how to get these various things working in the future!

I think you pretty much nailed that. However I found a way to make the transitions instance read a custom transitions nut file and even if I would want to i could create a new elevator motif file and change the elevator instances ' tracktrain volume to read from it. However I didnt find yet if the same would apply to sp_mightboard_icons.txt or if that is maybe hardcoded.

The lack of satelite soundcaches are the most annoying to me though because I can't release my campaign like this.

PreviousPage 3 of 3