ValveSoftware / Source-1-Games

Source 1 based games such as TF2 and Counter-Strike: Source
635 stars 74 forks source link

[TF2] `func_nav_blocker` does not function #5269

Open PhoenixWhitefire opened 11 months ago

PhoenixWhitefire commented 11 months ago

The func_nav_blocker is an entity that can mark specific areas on the navigation mesh as "blocked", telling bots that they shouldn't attempt to use them when pathfinding.

However, it appears non-functional:

https://github.com/ValveSoftware/Source-1-Games/assets/86601049/13bcc8d1-b3f4-4b90-8529-e77b21c12abb

The bot is pathfinding correctly, as it moves around the wall a little before passing straight through the func_nav_blocker, it just that the func_nav_blocker doesn't seem to do anything. The VDC Wiki page on it says that it "is a brush entity available in all Source games since Left 4 Dead. and also in \<TF2 icon>."

VMF and map file: https://drive.google.com/drive/folders/1jN1SQJ7OryTV15NH5FWhy4v7JB0Ca7Y7?usp=sharing

Ashetf2 commented 11 months ago

Did you try this? image

PhoenixWhitefire commented 11 months ago

Yes, it sends the BlockNav input whenever the bot is spawned. I also tried doing UnblockNav and then BlockNav in the console manually to no avail.

sylveonsylvia commented 11 months ago

Yes, it sends the BlockNav input whenever the bot is spawned. I also tried doing UnblockNav and then BlockNav in the console manually to no avail.

looking at your vmf you dont have a logic auto in the map

the proper way to get it to work is to use a logic auto to send the blocknav output on map spawn, as the VDC says

PhoenixWhitefire commented 10 months ago

@sylveonsylvia The VDC says "It is best practice", it does not say that I need to do it, just that it's the easiest way to get the behavior intended by the mapper, to have navigation in that specific area be blocked, permanently.

The func_nav_blocker is clearly intended to allow the mapper to dynamically Block(Nav) and Unblock(Nav) parts of the navigation mesh as parts of the map change over the course of a "round". There is no reference anywhere in the VDC page that the entity won't work if I don't use a logic_auto, it merely suggests using it. And why wouldn't it work?

Ok, yes, the Source Engine isn't perfect and maybe this feature just breaks at some point during the map initialization so that it only works with the OnMapSpawn I/O event, maybe it's even specific to TF2, but I tested it and no it does not. It still does not work, even with a logic_auto sending it a BlockNav input on the OnMapSpawn event.

Nesciuse commented 7 months ago

The issue is that Everyone is set in FGD as -1. Though -2 should be for everyone. -1 is not valid and makes it not work.