Raised This Month: $51 Target: $400
 12% 

CS 1.6 - Find out which WAD (textures) files are in effective use by a BSP (map) file


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
eduardolucioac
Member
Join Date: Jan 2016
Old 10-06-2022 , 22:58   CS 1.6 - Find out which WAD (textures) files are in effective use by a BSP (map) file
Reply With Quote #1

With the following command...

Code:
HLExtract.exe -p "fy_office.bsp" -e "root\fy_office.ent"
... is possible to find out which WAD files (textures) are listed as in use by a BSP (map) file as this output example ("fy_office.ent" file content extracted in the above command)...

Code:
{
"wad" "\programme\valve\valve\thwc_hl.wad;\programme\valve\cstrike\sourcebuero.wad;\programme\valve\cstrike\villaggio.wad;"
"mapversion" "220"
"MaxRange" "4096"
"skyname" "tornsky"
"classname" "worldspawn"
"classname" "worldspawn"
}
[...]
Notice that in the item "wad" several WAD files (textures) are listed. It turns out that none of these WAD files are needed even though they are listed. This happens with many BSP (map) files.

I've already tried several utilities and haven't found any that allow me to set this information correctly. I needed a utility that can be used via command line, as I need this output in text.

Is there any utility or strategy (via the command line) that I can use to correctly define this information, ie which WAD files (textures) are actually in use by a BSP (map) file?

Thanks!
eduardolucioac is offline
eduardolucioac
Member
Join Date: Jan 2016
Old 10-07-2022 , 21:07   Re: CS 1.6 - Find out which WAD (textures) files are in effective use by a BSP (map)
Reply With Quote #2

This is an old question and the answer is simple, NO.

WHY? Because the BSP file does not have this information.

In reality, BSP files only have the list of WAD files it uses and the names of the textures, but it does not have information to which WAD file a particular texture belongs. The names of these textures are unique within a BSP.

---------------------------------------------------------------------------

The way GoldSrc (CS 1.6) works gives the false impression that it "knows" which WAD files are needed. But not quite...

To understand how GoldSrc (CS 1.6) works, let's imagine the following scenario: You have loaded a BSP file, but you have not made any of the referenced WAD files available...

Code:
[...]
"wad" "\programme\valve\valve\thwc_hl.wad;\programme\valve\cstrike\sourcebuero.wad;\programme\valve\cstrike\villaggio.wad;"
[...]
... in the "cstrike" or "valve" folders.

So, still within this scenario, let's imagine some more situations to demonstrate how GoldSrc (CS 1.6) would act when trying to load each of the textures pointed at in the BSP file:
  • Attempts to load all referenced WAD files that are in the "cstrike" or "valve" folders. Cannot load any;
  • Tries to load each of the referenced textures. Can't find the first one;
  • Search the list of WAD files and notice that the first one is not loaded. Then it warns that this file is missing (message box);
  • The user makes this WAD file available in the "cstrike" folder and tries to load the BSP again;
  • Loads all the referenced textures that are in the available WAD file, but realizes that there are still unavailable textures;
  • Asks for the next WAD file in the list;
  • And so on...

---------------------------------------------------------------------------

PLUS: POSSIBLE SOLUTION (A LINUX APPROACH)

The only possible solution to programmatically determine (via BASH script, for example) which WAD files are needed is to export the list of textures from a WAD file with a utility like "HLExtract.exe"...

EXAMPLE

Code:
WINEDEBUG=-all wine "<PATH>/HLExtract.exe" -p "<PATH>\SOME_WAD.wad" -l | grep -i ".bmp" | cut -d\\ -f2 | cut -d. -f1 > "SOME_WAD_TEXTURES_LIST.txt"
... and based on the obtained list check each of the textures inside the BSP using a utility like "strings"...

EXAMPLE

Code:
strings "<PATH>/SOME_BSP.bsp" | grep -iw -- "SOME_TEXTURE_NAME" >> "SOME_BSP_TEXTURES_IN_USE.txt" 2>&1
... so that if located, then this WAD file is in use by the BSP file.

NOTES:
  • The first command lists all textures in the "SOME_WAD.wad" file and outputs to the "SOME_WAD_TEXTURES_LIST.txt" file. The second command checks if the texture name is in the file "SOME_BSP.bsp" and outputs to the file "SOME_BSP_TEXTURES_IN_USE.txt" making an append if it already exists - useful for executing the same command in sequence;
  • A BSP file can have its textures embedded in it so that it will not need the referenced WAD files;
  • A WAD file can have textures that have the same name as textures in another WAD file. The precedence of loaded textures is always by the last loaded WAD - the order followed is the same as the "wad" attribute which has the list of referenced WAD files. This can give the false impression that a WAD is not needed if a previous one already has textures with the same name, however this can result in the wrong textures being loaded.

Thanks! 🤗
eduardolucioac is offline
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 10-09-2022 , 21:29   Re: CS 1.6 - Find out which WAD (textures) files are in effective use by a BSP (map)
Reply With Quote #3

I think the post would be more helpful on Gamebanana since a lot of mapper are there
__________________
My plugin:
Celena Luna is offline
eduardolucioac
Member
Join Date: Jan 2016
Old 10-11-2022 , 18:44   Re: CS 1.6 - Find out which WAD (textures) files are in effective use by a BSP (map)
Reply With Quote #4

Quote:
Originally Posted by Celena Luna View Post
I think the post would be more helpful on Gamebanana since a lot of mapper are there
Take a look here Find out which WADs are in effective use by a BSP
eduardolucioac is offline
eduardolucioac
Member
Join Date: Jan 2016
Old 10-11-2022 , 18:48   Re: CS 1.6 - Find out which WAD (textures) files are in effective use by a BSP (map)
Reply With Quote #5

PLUS: A possible strategy to address the problem programmatically in C#....

https://forum.17buddies.rocks/index....&#entry1088043
eduardolucioac is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:43.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode