file structure question for map packing

Discussion in 'Mapping Questions & Discussion' started by Kill_the_Bug, Nov 16, 2018.

  1. Kill_the_Bug

    aa Kill_the_Bug

    Positive Ratings:
    Hello peeps!

    I'm thinking of doing another mpl map for the pl contest but to do that I will need to make some custom files of the existing ones that control operate hud/payliad outlines.

    I don't want to overwrite a player's existing files so could I make up a path/file folder structure inside the custom folder inside the to folder and put my files there? Then would the map when run take the information from that folder instead of the existing files that it normally references when playing a payload map?

    Thanks from a psychological bugger, lol
  2. Kill_the_Bug

    aa Kill_the_Bug

    Positive Ratings:
    Ok, have been digging through the files etc in GCFScape and my local - found this one in my local:

    Custom/readme.txt file:

    When the game boots, this folder is automatically scanned for VPK files or
    subfolders. Each subfolder or VPK is added as a search path, so the files
    inside those VPK's or subfolders will override the default game files.

    See gameinfo.txt for more details.

    For example, you might have the following file structure:

    tf/custom/my_custom_stuff/ <<< This subfolder will be added as a search path
    tf/custom/some_mod.vpk <<< This VPK will be added as a search path
    tf/custom/another_mod.vpk <<< This VPK will be added as a search path

    Mounting a VPK to the filesystem is more efficient than adding a subfolder,
    as each time the engine needs to open a file, it will need to make a call to the
    operating system to search the folder. VPKs can therefore be searched by the engine
    much more efficiently. Each subfolder is a new search path that must be checked each
    time the engine tries to open a file. So, for optimal load times, always use VPK files
    and don't make any subfolders in this folder!

    Note that the following directory structure is NOT correct:


    That will add the directory "tf/custom/models" as a search path, in which case the
    file my_model.mdl actually exists at the root of the game's virtual filesystem.
    Instead, you would use something like:


    Not entirely sure what it means and I have never made a vpk file. If I have understood it correctly, if I use a vpk (and were to pak in in along with my map and all the other files needed for my custom game/map type?) then the vpk would then override the the default files and run mine and then once the map changes, the next map should return to the default values - is this correct?

    Also, if the current file structures is:


    would I set up my custom file structure as:


    If I used any other custom stuff, would I also place it into the custom folder or just leave it in the regular folders, i.e. models, materials, etc.

    Thanks again as always as I go once again into unchartered and experimental tf game design :)
  3. henke37

    aa henke37

    Positive Ratings:
    You have the correct folder structure there. A vpk would take the place of the MPL_folder. It does the exact same job, but more efficiently at runtime.

    So, no a vpk is not used when you have map specific content. For that you use the pakfile lump of the bsp file itself. Or rather, a tool such as bspzip that handles the lump for you.
    • Thanks Thanks x 1
  4. Kill_the_Bug

    aa Kill_the_Bug

    Positive Ratings:
    Ok, I tried the new file structure with the files and then tried packing my map with vide but the payload hud didn't change. Not sure if I packed it right.

    Go add file > navigate to folder > select file > add then save file?

    Will the engine read / use it in this fashion above?