Source Resource Packing tool to make shareable resource packs viable.
ReSource Packer aims to provide a streamlined, easy to follow process for asset swapping in Source games by providing automatic conversions and providing convenient, clean file structures to work with. Currently only works with Unpacked variants of Source games, like Source Unpack for portal, but will support other games in the future.
.zip
archive from releases.Portal.bat
and the portal
folder are located. Unpack it alongside those files.If you were to install this into Source Unpack for portal, it would look like this:
When you first start the application, it will extract all the default resources from the game’s assets. This is important to understand because these will be the same resources you might reference when creating a resource pack, so this is best done on a clean install, or at least an install with clean assets. It will still work if you have modified assets, but those will become what RSP understands as the “default” ones. Mind you, this can take quite a while if you have a slow hard drive, but this only happens the first time you start RSP.
When you first install RSP, you’ll be greeted with this screen. By default, you won’t have a lot going on, however after the first time setup has completed running, you’ll have a few new folders in your game directory: resourcepacks
and srp/resources
. The resourcepacks
folder is where you’ll place folders or zip files of resource packs to be packed into the assets using RSP. As you can see, I’ve provided you a couple to start with: Inverted Cube Pack
and Void Pack
. You don’t have to use these, they’re just for demonstration purposes of both how to apply resource packs and the file structure that resource packs follow.
The order that your resource packs are in matters. It will apply them from top to bottom, where default resources are always first. This is important because if you have two resource packs that change the same files, the resource pack that comes second will inherently have “priority” and overwrite that file. Try not to have resource packs with conflict, but if it happens, this is how you try your best to mitigate it. Use the up and down arrow to the right of the resource pack entry to modify it’s position in the list. Remember; they’re applied TOP to BOTTOM.
You can click the checkbox to the left of the resource pack name to toggle it. If the box is unchecked, it’s content won’t be packed when you hit apply, and the default resources will be used instead.
By hitting the apply button, you’re verifying that the order and toggled state of your resource packs is ready to be packed into the games assets. This will open a progress window that looks like this:
This may take a couple of minutes to possibly tens of minutes, it all depends on the read and write speed of your storage. On my NVMe SSD, this only takes a minute or so. But you might find yourself staring at the pretty blue progress bar for a little while otherwise. Once the default assets are done packing, it will then begin packing your resource packs in the order you specified, and each packs application will look like this:
Unless the resource pack has 4k images or giant models or something, this shouldn’t really take very long for each pack. And, finally, once it’s all done and packed, you’ll see this:
The refresh button is relatively straight forward, but any time you add or remove a resource from the actual resourcepacks
directory, you’ll want to hit that refresh button so RSP see’s the change. It will try its best to maintain order and toggled resource packs as well, and just add the new ones as additional resource packs to your list.
Probably the most interesting part of this software is the ability to easily create a resource pack. A resource pack works by going through all the files in its folder, converting if necessary (png -> vtf, for example), and moving the file to the reflected location in the games actual assets.
If you wanted to replace the portal gun texture which is located in:portal/materials/models/v_models/v_portalgun/v_portalgun.vtf
You would create that same folder structure in your resource pack folder, so:pack/portal/materials/models/v_models/v_portalgun/v_portalgun.png
Yes, you can use a PNG instead of a VTF. It will automatically be converted to VTF for you when packing. For more examples of how you might structure a resource pack, look at the ones provided when you downloaded.
Note: do not modify anything in the asset cache unless you 100% know what you’re doing and why. It’s never necessary, unless you broke it somehow in the first place. No touchy. Copy it from here and move it to your resource pack, but do not ever modify the files in srp/resources
directly.
If you don’t want to deal with converting VTFs to PNGs and PNGs to VTFs, you can use the asset cache to find the PNG files that make up the VTFs. Just navigate to srp/resources
and navigate to the asset you want. There is a backup VTF as well as PNG in there that you can use, but you should only need the PNG.
The PNG might look like it’s completely transparent, for instance, the portal/materials/models/props/metal_box.png
. This is totally normal, open it in your texture editor and disable the “alpha” color channel, you’ll see the texture more clearly.
I plan to add support for more than just PNG -> VTF and VTF -> PNG. Eventually, I’d like this to support model conversion, and an easier to understand particle format.
Current PNG -> VTF conversion does not support alpha, unfortunately, it only outputs to DXT1. DXT5 will be added very soon.