thebigsleepjoe / TTT-Bots-2

Player bots for Garry's Mod TTT
Creative Commons Attribution Share Alike 4.0 International
10 stars 2 forks source link

[FEATURE] Bots interaction with smoke grenades #19

Closed Pawel99UK closed 6 months ago

Pawel99UK commented 7 months ago

What is the new feature?

This new feature is to add bot interaction with smoke grenades.

What should happen is that the AI would struggle to see the player in the smoke most likely allowing them to strategically get away with murder in populated areas and get away without losing the majority of their health. I am presuming that coding this little feature would be challenging so instead a workaround idea may be that if the AI is trying to shoot at the player or another bot which is behind smoke their aiming skills would be greatly reduced until the smoke disappears simulating them unable to see.

Purpose/motivation

The purpose is to add more strategy of getting away with murder without using the credit shop and to add more purpose for the use of smoke grenades in the game without it being used on players. My reason for this suggestion is for the players in the game to use less generic weapons like the M16 but to experiment with grenades and also to make the bots more easier to fight with while they are grouped together.

Additional context

image

thebigsleepjoe commented 7 months ago

If there's a hook or something I can latch onto within the smoke grenade then this should be surprisingly easy to implement. Will require further research of course.

Also, I noticed in your screenshot the mod was having an error... could you let me know what that was?

Pawel99UK commented 7 months ago

TTT2 is broken when i was playing with no one being able to search bodies even bots that is why the error was happening

Pawel99UK commented 7 months ago

image

thebigsleepjoe commented 7 months ago

Oh, that is strange. Maybe try to mount CS:S? That's the only thing I can think of. Dunno why that would make so many bot components fail though... I will probably want to make it safer.

Pawel99UK commented 7 months ago

new version of ttt2 base was uploaded and fixed body searching. also if u where wondering this is the current bugs i got in 3 rounds image

thebigsleepjoe commented 7 months ago

Do you have a collection or any further info I can use to replicate? Like the map? Ideally put in a separate issue for this

thebigsleepjoe commented 7 months ago

Regarding the issue at hand, I have done a bit of research and the best option would be to:

  1. Utilize this hook
  2. Check if :GetClass() == "ttt_smokegrenade_proj"
  3. Check how long until detonation, then add it to a global table to track it
  4. Once it goes off, if at all, we add it to a "smokes table"
  5. Reconfigure all bot AttackTarget behaviors to become highly inaccurate if their target is within ~128 units of a smoke's center

I probably won't do this for a while due to its complexity (compared to more pressing issues), but I'm sure it'd be possible with some testing.

thebigsleepjoe commented 6 months ago

I believe this is working in dev branch