Skip to content

Conversation

@nullsystem
Copy link
Collaborator

@nullsystem nullsystem commented Aug 18, 2025

Description

  • Bots should now be able to shoot through glass if not using a shotgun
  • If using a shotgun, try to change to a weapon that can utilize the glass if possible
  • Change back to a shotgun if not behind glass?
  • Tested/check if it doesn't straight up shoot through any penetrable like wallhack ability, non-glass penetrable only shoot through if it's recently seen enemy
  • Enemy player that can shoot towards the ghoster behind penetrable should be able to try shooting at it
  • Test/check for non-penetrable glass (tarmac non-penetrable vs oilstain penetrable)
  • Slight scale between weapon penetration on when the bots will attempt to do penetration, so like SRS will do longer distance than SRM.
  • Limited wallbang at ghoster ability to hard + expert bots

Toolchain

  • Linux GCC Distro Native Gentoo/GCC 14

Linked Issues

@nullsystem nullsystem marked this pull request as draft August 18, 2025 16:20
@nullsystem nullsystem force-pushed the GH-1282_BotsShootThroughGlass branch 5 times, most recently from 811dcaa to e3e65ff Compare August 28, 2025 21:05
@nullsystem nullsystem marked this pull request as ready for review August 28, 2025 21:06
@nullsystem nullsystem changed the title [WIP] Bots - Shoot through glass + penetrateables Bots - Shoot through glass + penetrateables Aug 28, 2025
@nullsystem nullsystem force-pushed the GH-1282_BotsShootThroughGlass branch from e3e65ff to e541da0 Compare August 28, 2025 21:07
@nullsystem nullsystem requested a review from a team August 28, 2025 21:08
sunzenshen
sunzenshen previously approved these changes Sep 3, 2025
Copy link
Contributor

@sunzenshen sunzenshen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, bots now can shoot through glass when they couldn't do so before.

bot_penetratables_oilstain_glass.mp4
bot_penetratables_ballistrade_glass.mp4

@sunzenshen sunzenshen requested a review from a team September 3, 2025 05:24
@Rainyan Rainyan requested review from Rainyan and removed request for a team September 4, 2025 10:17
Rainyan
Rainyan previously approved these changes Sep 4, 2025
Copy link
Collaborator

@Rainyan Rainyan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO (LATER): Test/check for non-penetrable glass?

Tested against the tarmac non-penetrable glass, and indeed it seems the bots will fruitlessly empty their magazine against the bulletproof windows.

To repro:

neo_bot_quota 2;
map ntre_tarmac_ctg;

// Spawn to the garage side, so the bot spawns on the tarmac side.

// Then, teleport near the bulletproof window.
setang 7.062000 13.297527 0.000000;
setpos 477.418365 -252.499146 -210.468750;

But we can leave it for some future PR if you don't feel like it belongs here.

@nullsystem nullsystem dismissed stale reviews from Rainyan and sunzenshen via d68f0d7 September 4, 2025 22:25
@nullsystem nullsystem force-pushed the GH-1282_BotsShootThroughGlass branch from e541da0 to d68f0d7 Compare September 4, 2025 22:25
@nullsystem
Copy link
Collaborator Author

nullsystem commented Sep 4, 2025

@Rainyan I've added in glass penetration vs non-penetration check, just does an extra trace then penetration check without distance limitation.

@sunzenshen I've added in distance restriction scaling by weapon's penetration, so for example: a bot using an SRS will attempt a further distance than MX which will attempt further than SRM. It is still short distance and does become shorter distance for weapons weaker than MX but it's intended to be kept limited.

@sunzenshen
Copy link
Contributor

sunzenshen commented Sep 5, 2025

Bots no longer try to shoot through the impenetrable glass on Tarmac:

bot_penetratables_tarmac_bulletproof_fix.mp4

Bots appear to open fire on a player that is holding the ghost behind a paper wall near the house spawn on Isolation:

bot_penetratables_ghost_behind_cover_attack.mp4

@Rainyan
Copy link
Collaborator

Rainyan commented Sep 5, 2025

Bots appear to open fire on a player that is holding the ghost behind a paper wall near the house spawn on Isolation

Maybe you meant this already as a positive, but this is probably the desired behaviour, since good players should absolutely wallbang the ghoster when they have the chance.

It'd be really cool if we had some kind of "confidence level" that the bots had on the enemy location, and if they felt confident enough (seen player recently in area, sound cues, etc), they could outright start wallbanging thin surfaces to do preemptive damage, like a real high-level human player would. But that's out of scope for this PR surely.

The classic situation is hearing someone cloak just around the corner/make steps, and preemptively start shooting at them before they appear visually. Although this should probably only happen for expert bots.

Copy link
Collaborator

@Rainyan Rainyan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the tarmac bulletproof glass case mentioned before, it seems that if you are holding the ghost, the bots will still attempt to wallbang.

If it's not too much work, could you make it such that even if the bots have vision of the ghoster (possibly through a bullet-proof window), if they know their bullets cannot penetrate (the wall thickness check), they won't waste bullets trying to shoot through the impenetrable areas, but instead consider it as impossible and choose whatever is their alternative action to shooting instantly.

Steps to reproduce:

neo_bot_quota 2;
map ntre_tarmac_ctg;

// Spawn to the garage side, so the bot spawns on the tarmac side.

// Then, drop your gun and noclip to go grab the ghost

// Then, teleport near the bulletproof window.

setang 7.062000 13.297527 0.000000;
setpos 477.418365 -252.499146 -210.468750;

What happens:

  • The bots attempt to spam the ghost carrier through the bullet-proof glass

What should happen:

  • The bots recognize they cannot penetrate, and choose something else

* Bots should now be able to shoot through glass
* Bots should also shoot through penetratable if it's going up
  against a ghoster at a short distance
* Penetrable vs non-penetrable glass check, weapon pen try scaling
  * Added extra checks for glass to differentiate penetrable vs
    non-penetrable and if glass do that extra pentration check
  * Also use using regarding overload declarations
  * Added try penetrate depending on weapon penetration value
    so weapon like SRS try at longer distance while weaker
    weapons like milso/SRM try at minimum distance
* fixes NeotokyoRebuild#1282
* Just not preventing penetration check flag from using the if glass
  fixes the shooting on ghoster behind non-pen glass issue
* Defined CHAR_TEX_BLOCKBULLETS 'J'
* Limit ghoster wallbang to hard + expert bots
* fixes NeotokyoRebuild#1282
@nullsystem nullsystem force-pushed the GH-1282_BotsShootThroughGlass branch from d68f0d7 to 4caf215 Compare September 5, 2025 19:40
@nullsystem
Copy link
Collaborator Author

@Rainyan I've dropped the extra statement preventing penetration test flag from utilizing glass-only check if and that looks to have fixed the firing at ghoster behind non-penetrated glass issue. Also limited the ability to wallbang ghoster at hard + expert bots.

@sunzenshen Added CHAR_TEX_BLOCKBULLETS define and used Clamp function instead.

@nullsystem nullsystem added the New Changes for Reviewers New changes has been made. This label is mostly to notify reviewers. label Sep 5, 2025
@sunzenshen
Copy link
Contributor

Ghost behind ballistic glass now works as expected:

bot_penetratables_tarmac_bulletproof_ghost_fix.mp4

Copy link
Collaborator

@Rainyan Rainyan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@nullsystem nullsystem merged commit 5826282 into NeotokyoRebuild:master Sep 6, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

New Changes for Reviewers New changes has been made. This label is mostly to notify reviewers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bots - Shoot through glass (when not using shotguns)

4 participants