Future way of packing nav files into bsp and getting them to work properly with workshop + elsewhere

Discussion in 'Tutorials & Resources' started by ics, Nov 8, 2016.

  1. ics

    aa ics http://ics-base.net

    Messages:
    723
    Positive Ratings:
    438
    I reported a bug to Valve about workshop maps not getting their nav files loaded, when the map file is used directly on a gameserver by loading it through workshop or when a player loads the map up with "map workshop/mapworkshopIDhere".

    So that the players should not need to copy it from the workshop location manually to their tf/maps directory, to test out with bots and so that the files work on a gameserver too through workshop - there is a better way.

    I received a reply on the bug. It's not a bug, it's a new feature. Valve has somewhat recently added a thing within the engine, which allows nav files to be loaded by any method available. Instead of packing your maps navigation file (nav) as mapname.nav, you should name it as embed.nav.
    This makes them map-name agnostic and doesn't matter if the map is loaded by any means, from server, from console, from workshop, it will always work regardless.

    Doesn't this cause issues with multiple map navs named the same you ask? No, if you do it correctly. You do not need to manually to rename your maps nav as embed.nav. Just keep it as mapname.nav (for example pl_millstone_ugc_5.nav) along with your map.bsp (example pl_millstone_ugc_5.bsp).

    How to pack your nav file easily:

    Create file called nav.bat into your maps directory. This can be with any name so name it as you like so you can always find it when you need it. Put this content inside of it:




    To make this more clear, here's a working example:

    So edit the file to your needs whenever you need it. You can simply change the ending of the .bat file to .txt to edit it, add your proper map name in, save the file and rename back to .bat. If you dont see file endings, you need to change your windows folder settings to display those.


    To pack nav in with the bat, just doubleclick that file to pack in your nav file as embed nav. The bat file will open your bsp, pack in the nav as embed.nav into maps directory and save the file. Just hit enter after a while and you are done.

    How to pack your map files as harder way:



    All community compilers should be updated to use this method so if you know a developer, hint them about this. If i speculate a bit, i think this embed.nav was not made without future use so better to start use it sooner or later.

    Otherwise if you do not use this method and upload map to the workshop with packing it the old way and some servers run it directly from workshop, nav fails to work and bots wont move. This is an issue for any map but bigger issue for halloween maps where bosses require nav files to work.

    I have this fix live and tested on the example map, pl_millstone_ugc_5 on workshop.

    Thanks to both Eric & Jill for this information. I thought i'd share this here too.


     
    • Thanks Thanks x 9
    • Like Like x 2
  2. fubarFX

    aa fubarFX The "raw" in "nodraw"

    Messages:
    1,632
    Positive Ratings:
    1,723
    Already implemented in the next version of compilepal, just a matter of releasing the next version
     
    • Like Like x 2
    • Thanks Thanks x 1
  3. The Jill

    aa The Jill

    Messages:
    13
    Positive Ratings:
    123
    The approach here is to allow all map-named files (pop files, nav, soundscape, particles...) to have a nameless variant that works when embedded in the map. Also functional now are popfiles -- you can embed mvm_foo_normal1.pop as just normal1.pop (you can also now have multiple pop files per map and voting/switching between them will work). We will have more juicy patch notes as more subsystems hooked up.
     
    • Thanks Thanks x 7
    • Like Like x 6
  4. Mikroscopic

    aa Mikroscopic

    Messages:
    607
    Positive Ratings:
    617
    Apparently soundscapes don't work with this anymore? And do soundscripts work?
     
  5. Pikachu on LSD

    Pikachu on LSD L1: Registered

    Messages:
    2
    Positive Ratings:
    1
    Soundscapes are usable without being dependent on map name by packing them as scripts/soundscapes.txt, though attempting to play custom sounds from a Workshop-downloaded map still throws a "Cannot figure out which search path $sound came from" error.
     
    • Thanks Thanks x 1
  6. Crash

    aa Crash func_nerd

    Messages:
    3,190
    Positive Ratings:
    4,918
    @The Jill any ideas? Is there a way to get custom sounds in soundscapes working on the workshop?
     
    • Agree Agree x 1
  7. EArkham

    aa EArkham Necromancer

    Messages:
    1,581
    Positive Ratings:
    2,203
    Just to be clear, if the soundscape is named to match the map, it won't work in the workshop, but if it's named generically, it WILL work?

    So "scripts/soundscapes_cp_antiquity_b15.txt" will not work, while "scripts/soundscapes.txt" will, if packed in?

    I've had reports that the soundscapes aren't working for antiquity, so I just want to be sure it'll work fine next iteration. I'm not using custom sounds fwiw, just the usual TF2 stuff.
     
  8. YM

    aa YM LVL100 YM

    Messages:
    7,099
    Positive Ratings:
    5,745
    I don't ever remember soundscapes working from workshop maps, would love some confirmation that they do?

    Same with tf/maps/<mapname>_level_sounds.txt as I make frequent use of that one
     
  9. Void

    aa Void Local Man Unable To Map, Sources Say

    Messages:
    1,826
    Positive Ratings:
    2,745
    Jill et al have a way of looking at maps that doesn't break custom soundscapes, level sounds, etc. I don't know how exactly, but there aren't any issues with soundscapes and such on Valve's end - but it's a known issue for anyone subscribing to maps on the workshop, as said by Jill in an email a few weeks back.
     
  10. fubarFX

    aa fubarFX The "raw" in "nodraw"

    Messages:
    1,632
    Positive Ratings:
    1,723
    I assume that, internally, they have the technology to rename files and remove filthy workshop extensions. (yes that's all there is to it)
     
  11. YM

    aa YM LVL100 YM

    Messages:
    7,099
    Positive Ratings:
    5,745
    Ok sooooo:

    scripts/soundscapes.txt

    maps/level_sounds.txt
    maps/<mapname>_level_sounds.txt

    particles/particles_manifest.txt

    This means Sacrifice's jungle soundscapes and idol particles work, but the announcer voicelines don't :(
     
  12. Mikroscopic

    aa Mikroscopic

    Messages:
    607
    Positive Ratings:
    617
    What about custom sounds and soundscripts?
     
  13. YM

    aa YM LVL100 YM

    Messages:
    7,099
    Positive Ratings:
    5,745
    Soundscripts are <mapname>_level_sounds.txt

    You can add announcer lines just using ambient generic, but you can't gag the normal announcer without a soundscript for that level
     
  14. ics

    aa ics http://ics-base.net

    Messages:
    723
    Positive Ratings:
    438
    I assume there is some work being done for the implementing of sounds just as the nav stuff in the past, since i asked about this and received no reply for 2 months now. Soundscapes from workshop maps are broken, if they are loaded from the workshop file (like with a console command map workshop/idhere). This means on your own pc or if a gameserver uses them directly from the workshop, soundscapes do not load.

    They will work if you copy the map (the bsp, not the folder) from the workshop location such as STEAM\SteamApps\workshop\content\440\workshopmapidhere to maps directory, for example STEAM\SteamApps\common\Team Fortress 2\tf\maps.

    Then load the map through console with map mapname or on a server with just like any other regular map, they work ok, provided that the soundscape file has been originally packed into the file itself.

    I assume they will announce later another way to implement soudscapes into the bsp files. I bet Valve just takes the maps out from their workshop location and run them from an internal server, so that the sounds work properly.
     
  15. YM

    aa YM LVL100 YM

    Messages:
    7,099
    Positive Ratings:
    5,745
  16. Pikachu on LSD

    Pikachu on LSD L1: Registered

    Messages:
    2
    Positive Ratings:
    1
    Turns out this is kind of a dirty hack.

    I completely overlooked the fact that scripts/soundscapes.txt is actually an existing file in the game files (containing only "tf2.respawn_room" and "tf2.general_ambient"), so the engine's just loading the ones packed into the map instead of Valve's copy, and this isn't actually a true nameless variant like I originally thought. My mistake.

    For what it's worth, the soundscape entries get reloaded after level init (citing the SDK), so I believe the custom soundscapes will be unloaded after the map is.
     
  17. YM

    aa YM LVL100 YM

    Messages:
    7,099
    Positive Ratings:
    5,745
    Then perhaps "scripts/game_sounds_manifest.txt" will work as a replacement to "maps/<mapname>_level_sounds.txt"

    Will test shortly
     
  18. YM

    aa YM LVL100 YM

    Messages:
    7,099
    Positive Ratings:
    5,745
    Can confirm:
    scripts/game_sounds_vo.txt does not work
    scripts/game_sounds_manifest.txt and scripts/game_sounds_<blah>.txt does not work

    I don't think there's any way for us to get soundscripts working from the workshop :(
     
  19. MOCOLONI

    MOCOLONI L5: Dapper Member

    Messages:
    243
    Positive Ratings:
    60
    Sorry for bumping the thread, but did they really not let anyone know about the new nav feature before ics contacted them?

    This thread should be pinned to the "Tutorials & Resources" subforum as it took me 'a while' to find this out (before). Thanks for letting us know!
     
    • Agree Agree x 2
  20. BIO BENNY

    BIO BENNY L1: Registered

    Messages:
    13
    Positive Ratings:
    1
    This helped me quite a bit, just learning how to do .nav files and just built some both using automatic generation with tweaking, and manual for my multi-layered halloween map. Very tedious, but worth it. Easiest time I'd had getting something to work, thank you! Also excuse the bump, sorry!