Writing a Pakrat replacement

Terr

Cranky Coder
aa
Jul 31, 2009
1,590
410
I aten't dead. Just had a metric crapton of stuff to do at work the last few weeks.

PackBSP 2's basic wizard GUI is maybe 80% done, the real work will be two parts at two different wizard-steps. First, the status updates as it does it's magical graph crawling and secondly the "customize packing choices" screen.

I may make a basic version of the status-screen and a non-interactive version of customization-control and then make it available as a "testable alpha".
 

Dark

L4: Comfortable Member
Nov 27, 2009
159
137
I have no idea if this is a known bug but this only works for me if i do not over right the bsp then the materials do not pack.
 

Terr

Cranky Coder
aa
Jul 31, 2009
1,590
410
BagOfChips: Oh, this version is wayyy ahead of the old one ;)

Dark: IIRC that's a limitation of Valve's bspzip (which isn't being properly warned-about) and I don't plan to make a workaround... overwriting your old BSP at the same time is a recipe for frustration and recompiling.
 

YM

LVL100 YM
aa
Dec 5, 2007
7,135
6,056
BagOfChips: Oh, this version is wayyy ahead of the old one ;)

Dark: IIRC that's a limitation of Valve's bspzip (which isn't being properly warned-about) and I don't plan to make a workaround... overwriting your old BSP at the same time is a recipe for frustration and recompiling.

Surely if you pak using the BSP in tf/maps and it stuffs up all you have to do is copy the BSP from sdk_content/tf/mapsrc to tf/maps and you've got a clean BSP hot off the compile press?? So if you ever stuff up the most you have to redo is paking and cubemaps?

I certainly hope no one recompiles if their paking messes up!!! :eek:hmy:
 

Terr

Cranky Coder
aa
Jul 31, 2009
1,590
410
Surely if you pak using the BSP in tf/maps and it stuffs up all you have to do is copy the BSP from sdk_content/tf/mapsrc to tf/maps and you've got a clean BSP hot off the compile press??

The case I'm thinking about is where someone packs from/to their sdk_content copy. (It isn't the default place the "Choose BSP" dialog will go to, but you never know.) File destruction makes me nervous.

I could make a workaround, but if so it would really be doing a rename-to-.bak or something, rather than a real in-place overwrite.

Anyway, there'll be plenty of time to tweak that once I get an alpha out the door. I'd like to have something downloadable by next week, but no promises.

Current problem is bspzip... For some reason it accepts the vproject environment variable (telling it what game it is packing for) just fine on the command line but when I invoke it automatically it whines about an invalid launch config...

Edit:


Exit value: -1.
Caused by java.io.IOException:
Cannot run program "bspzip.exe" (in directory "c:\program files\Steam\steamapps\terrsusername\SourceSDK\bin\orangebox\bin"): CreateProcess error=2, The system cannot find the file specified

Wat. No wai, teh file is there...

For extra WTF's, the forum software adds to put a space right in front of "orangebox".
 
Last edited:

Terr

Cranky Coder
aa
Jul 31, 2009
1,590
410
Currently it asks you to pick a BSP and starts in your mapsrc directory, then asks for a target in your tf/maps directory.

I'll change it to ask for a source in tf/mapsrc, and to (by default) do a rename-and-replace against whatever you picked in step 1.

Edit: Damn. I didn't really structure the app to release its write-blocking access to the source BSP, so "in place" changes become difficult.

The easy workaround is that when the user picks the source file, make a copy of that file and read from there. So mappers would need to re-do the "pick source" step in order to see changes in the BSP. Actually, if I make a copy of lightly lock the normal one... Hmmm.

Edit 2: I made a mistake in some code, and fixed it. The weird part is that when I leave the mistake in, core Java libraries explode in ways the documentation says they should never explode. May be a bug-report in that...
 
Last edited:

Terr

Cranky Coder
aa
Jul 31, 2009
1,590
410
Ze time, she is close!

Rewriting the cycle-detection code to be recoverable. By "cycle" I mean a dependency that needs another dependency that... etc. into a circle. Nasty stuff. Came across a simple example from the swamp pack.

This water has a "fallback material" in several places... a material that is, well, itself...?

Code:
"Water"
{

	<dx90
	{
		 	"$fallbackmaterial" "swamp/water/water_murky"
	}

	"%keywords" "tf"
	//	$forcecheap 1
	
	"%tooltexture" "dev/tfwater_normal"
	"%compilewater" 1
	"$abovewater" 1
//	"$nofresnel" "1"

	$underwateroverlay "effects/water_warp"
	"$envmap" "env_cubemap"	
	"$refracttexture" "_rt_WaterRefraction"
	"$refractamount" ".12"
//	"$refracttint" "{88 192 44}"
	"$refractblur" "1"



	"$scale" "[1 1]"

	"$basetexture" "swamp/water/water_murky"
//	"$bumpmap" "water/water_dudv"
	"$normalmap" "water/tfwater001_normal"

	"$surfaceprop" "water"
	"$bottommaterial" "swamp/water/water_murky_beneath.vmt"
	"$bumpframe" "0"

	"$fogenable" 1
	"$fogcolor" "{35 32 20}"
	"$fogstart" "0"
	"$fogend" "170"

	 "$temp" "[0 0]"
	 "$curr" 0.0
	 "$curr2" 0.0

	"Water_DX60"
	{
		"$fallbackmaterial" "swamp/water/water_murky"
	}

	"Proxies"
	{
		"AnimatedTexture"
		{
			"animatedtexturevar" "$normalmap"
			"animatedtextureframenumvar" "$bumpframe"
			"animatedtextureframerate" 30.00
		}


		"TextureScroll"
		{
			"texturescrollvar" "$bumptransform"
			"texturescrollrate" .01
			"texturescrollangle" 10.00
		}
		"WaterLOD"
		{
			// fixme!  This has to be here, or material loading barfs.
			"dummy" 0
		}

	}
}
 

Terr

Cranky Coder
aa
Jul 31, 2009
1,590
410
2.0.1. While overlays were fine, this update fixes an issue with not automatically detecting decals. (infodecal, info_projecteddecal)
 

Terr

Cranky Coder
aa
Jul 31, 2009
1,590
410
2.0.2 Released. Need help polishing the map-includes feature.
  • New user-editable config file defines what map-name-based files (like AI navigation or overviews) are pulled in for different games or engines. Please report any issues with this, since it is somewhat rough around the edges.
  • Bug: Fixed issue with not finding uncompressed HDR skybox materials
  • Bug: Fixed not including custom map overviews and radars using new config system
 
Jan 20, 2010
1,317
902
I keep on getting this error:

PackBSPError.png


The only way to fix it seems to be restarting steam.
 

Khuntza

L4: Comfortable Member
Dec 29, 2009
155
102
I cant seem to get packbsp to run at all. It loads the splash loading screen then just sits there forcing me to end javaw.exe via task manager.

Tried with both steam running and not with no change.

I'm running java 6 update 21 version 1.6.0_21-b06 on Win7 x64.

Any ideas?
 

Terr

Cranky Coder
aa
Jul 31, 2009
1,590
410
The only way to fix it seems to be restarting steam.
I'm tempted to chalk that one up to "something weird which is Valve's fault", since that text is from the bspzip.exe command-line program that comes with the SDK. I can't think of anything PackBsp might be doing unless it's trying to write to clientreqistry.blob at the same time... I'll look into that possibility.

I cant seem to get packbsp to run at all. It loads the splash loading screen then just sits there

If the loading screen never goes away, then it is probably some sort of issue with the JVM or the EXE launcher: All the "real" code I wrote doesn't get started until the loading screen disappears.

This is from memory and might be wrong, but try creating a file called "launch.bat" in the same directory as packbsp.exe, containing:
Code:
java -jar app/packbsp.jar

And see if that does anything.
 
Last edited:

Terr

Cranky Coder
aa
Jul 31, 2009
1,590
410
Damn. When looking at more-complex models (like the spy model) my handling for skins breaks down. That is, there are technically 22 skins in there, but they map to 22 materials, some of which are things like eyeballs that need to be present 99% of the time.

This is in contrast to "simple" props like most gameplay ones sitting around.

I may need to ditch the "only pack actualy used skins for models" feature for now, since it probably isn't working properly...
 

Khuntza

L4: Comfortable Member
Dec 29, 2009
155
102
This is from memory and might be wrong, but try creating a file called "launch.bat" in the same directory as packbsp.exe, containing:
Code:
java -jar app/packbsp.jar

And see if that does anything.

No good.. The batch file didn't seem to launch anything. Running the jar file directly has the same effect as running the exe.

No need to worry too much about it though. I wanted to try packbsp cause I was having an issue including some files with pakrat, but I've since sorted that out..
 

megawac

L4: Comfortable Member
Oct 2, 2009
180
29
Been playing around with PackBSP past few days again before I released a map. Encountered several unexpected problems, several with the maps scan and some with the program itself. Apologies for the ones you already know. Im using latest version (Aug 13th) and will order them most annoying to least.
  • 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.
  • Only packs vmt for sprites and not the vtf.
  • 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).
  • 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...
  • Very small problem :rolleyes:, the dependancy scan missed files for custom control point hud materials (packed the unlocked material but not the locked material) and a sound called by point_client command.

Overall impression, much better program than pakrat, encountered only one packing error (the model one listed above).