-
Notifications
You must be signed in to change notification settings - Fork 20
Block bot line of sight with smoke #1247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Block bot line of sight with smoke #1247
Conversation
untitled.mp4Something's wrong |
|
Wonder if this will make jeff blind in smoke since CNEO_NPCTargetSystem tests for MASK_BLOCKLOS? |
df71957 to
e51958f
Compare
|
Diagnosed the issue as hitbox tracelines colliding with the LOS Blocker entity, which prevented damage. Added a ShouldCollide that filters UTIL_TraceLines with CONTENTS_HITBOX, that skips the LOS Blocker and evaluates as normal. bot_smoke_hitbox_fix_1.mp4bot_smoke_hitbox_fix_2.mp4 |
Not with the current commits right now after some more testing, but I could take a look if that's something players are interested in. |
|
With the current approach, you'll need to add NPC and CONTENTS_DEBRIS masks to your NPC Tank code. Let me know how we feel about this approach in general. bot_smoke_detection_jeff_2.mp4 |
3770971 to
4bac8df
Compare
|
I'm not too fond of adding CONTENTS_DEBRIS to neo_npc_targetsystem and nextbotvisioninterface. I would personally revert the changes to those files, and do this in neo_smokelineofsightblocker.h instead Not sure if this is the correct way to do it, but it seems to me to be at least slightly better than what you have now |
Removes debris collision property in favor of a custom entity type with manually defined collision and hit handling. Credit: @AdamTadeusz NeotokyoRebuild#1247 (comment) Also reverts changes related to debris-based collision properties.
Those changes work well on my setup, though one thing to point out is that this also blocks the NPC tank vision on nt_rogue_ctg. As discussed on Discord, there's arguments for not blocking smoke LOS for that situation. Do we want to address that edge case in this PR or a different PR? |
The = is probably a typo, which was affecting collisions with physics objects. Tweaked this line to avoid overwriting fContentsMask. smoke_phys_collision.mp4 |
|
@sunzenshen I've updated the code snippet above to include a static bool m_bNextEntitySeesThroughSmoke. Assuming the vision checks are NOT done in parallel, this can then be set to true before the tracelines are done to ignore smokes. In the case of nextbots, I add the following to IsLineOfSightClearToEntity before the trace lines (and an import for neo_player.h and neo_smokelineofsightblocker.h) For jeff, before the loop through all clients in CNEO_NPCTargetSystem::Think (and also the import neo_smokelineofsightblocker.h) As long as every entity that checks for smokes updates the value before the traceline, it shouldn't be necessary to update the value again after the traceline, but maybe you want to set it to false afterwards just in case anyway |
Removes debris collision property in favor of a custom entity type with manually defined collision and hit handling. Credit: @AdamTadeusz NeotokyoRebuild#1247 (comment) Also reverts changes related to debris-based collision properties.
c33416e to
ee57001
Compare
|
@sunzenshen Is this ready for review? |
Yup, I'm ready for review. |
Rainyan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Removes debris collision property in favor of a custom entity type with manually defined collision and hit handling. Credit: @AdamTadeusz NeotokyoRebuild#1247 (comment) Also reverts changes related to debris-based collision properties.
Typo with extra = mask logic cleared physics masks
Assumes NextBot is single-threaded
ee57001 to
7488d29
Compare
Removes debris collision property in favor of a custom entity type with manually defined collision and hit handling. Credit: @AdamTadeusz #1247 (comment) Also reverts changes related to debris-based collision properties.
Description
Minimum viable bot detection for smoke.
Toolchain
Linked Issues