kriswema / resgen

RESGen. A tool to create .res files for Half-Life.
GNU General Public License v2.0
22 stars 10 forks source link

RESGen

RESGen is a tool to create res (resource) files for Half-Life. If a Half-Life map has a corresponding res file, Half-Life is able to send all resources the resources the map uses to the clients, if they don't have them. This helps a great deal when running a server with custom maps, instead of the defaults. Most players do not have these custom maps and the resources that should go with them. The res file enables them to download the map via Half-Life and start playing right away.

The problem with res files, however, is that it can take hours to create one if the resources used by a map are not known. RESGen can shorten this time to mere seconds. It reads the maps BSP file and searches it for used resources. The results of this search are then used to create the res file.

Master: Build Status

Develop: Build Status

Usage

Example 1:

resgen -ok -r C:\sierra\half-life\tfc -e C:\sierra\half-life\tfc -a shadowlord.rfa

This will make RESGen generate res files for all maps that are in the tfc folder. It will verify it's resources from the tfc folder and the valve folder (C:\sierra\half-life\valve). Any existing res file will be overwritten. The contents of shadowlord.rfa will be added to all res files. When RESGen is finished it will exit immediately, not waiting for a keypress.

Example 2:

resgen -o -d C:\Sierra\half-life\tfc\maps -a customsounds.rfa -b res_tfc.rfa

This will make RESGen generate res files for all maps that are in the maps folder. Any existing res file will be overwritten. The contents of customsounds.rfa will be added to all res files. Resources from res_tfc.rfa (these include valve resource) will not be added to generated res files.

Using resource verification

The -e option, can be quite powerful. It can be used several ways. Here I try to describe a few of the more common ways, although there are many more.

NOTE: There is a subtle difference between Win32 and the Linux when checking if a resource is available or not. On Win32 RESGen does not care about case when comparing the found files to the res entry. On Linux it does care about it and reject resources when the case doesn't match. In 99% of the cases this doesn't matter. However, because of this difference it it's recommended to run RESGen on the target platform whenever possible.

Method 1, the simple way:

This method is most commonly used by server admins that want to add res files to their servers. Run RESGen on the mod folder you want to make res files for. Point the -e option to this folder too. This will generate good res files, which contain all found resources. You should not use the -p option unless you are certain that you have no maps with their own pakfile.

Example: resgen -r half-life\cstrike -e half-life\cstrike

Method 2, the mapper way:

You run resgen on the map, and point the -e option to the folder with the resources (these can be the same). Please note that the resource folder must match the folder layout of a normal folder. Using -p is possible if you aren't using a pakfile for your map. Also, note that resgen will look for the map info txt and overviews relative to the map itself, not the folder specified with -e

Example: resgen -f mymap.bsp -e mapping\resourcetank

Credits

This program was made by Jeroen "ShadowLord" Bogers with serveral improvements and additions by Zero3Cool.

Special thanks to:

http://resgen.hltools.com

License

Copyright (C) 2000-2005 Jeroen Bogers, Zero3Cool

Copyright (c) 2013-2014 [GitHub contributors] (https://github.com/kriswema/resgen/contributors)

RESGen is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

RESGen is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with RESGen; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Changelog

Version 2.0.3

Version 2.0.1

Version 2.0 RC2

Version 2.0 RC1

Version 2.0 BETA 3

Version 2.0 BETA 2

Version 2.0 BETA 1

Changes between v1 and v2

From the outside RESGen 1 and 2 look similar. On the inside a lot of changes have been made. First of all, major parts have been rewritten, and other parts have had a major upgrade. The biggest change is that the RESGen core is fully C++ now, instead of a bit C++ in a C program. Because of this I have DROPPED the scripting return values. It's very easy to use the RESGen source in your own programs now.

The RESGen parser should be a bit faster now. It's speed mainly depends on the speed of your hard disk and your output window. That last limitation can be overcome by using the -v option (minimal output).

The last major change is the -e option. It enables you to have RESGen automatically verify if you server actually has the resources the map claims to need. This especially applies to missing wad files. See chapter 5 for more information on how to use the -e option.

Additionally, RESGen now tries to locate the maps information txt and overview pictures. Please note that RESGen can only find these if they are stored in the same folder layout as they would be on the server (mapname.txt, ../overviews/mapname.txt and ../overviews/mapname.bmp).