Dakota0001 / DakBots

AI for use in gmod combat gamemode
0 stars 0 forks source link

The aimbot on the bots is ridiculous #2

Open Stooberton opened 3 years ago

Stooberton commented 3 years ago

You walk around a corner and die instantly, it just isn't fun.

Pls fix.

Dakota0001 commented 3 years ago

Reaction times were added in a prior commit. Now I am finding an issue opposite of this original issue, they kinda have too long of a reaction time on the upper limit. Bots already have some delay between their find attempts, adding up to 0.8 seconds to that ontop of it for all bots is far too long, resulting in bots mostly just walking around corners blindly then a player having a second to shoot them before they even start to fire back.

Bots could be smarter about this in multiple ways, likely with detection overhauls so that if a player is attacking from an angle that enemies are commonly coming from they will have far lower reaction times as they're ready for someone to pop around a corner and then blast them because there's a fight going on in a given chokepoint, perhaps a system checking if the player is near prior targets, this is also relevant in situations where they might kill their target then swap to a new target but since the target is new they might end up having that delay again before switching targets rather than doing as a player might do and just smoothly transitioning their spray of fire from the dead target to the new target. They should have a hard time detecting an enemy who is not in their field of view, not moving much, further off in the distance, etc but should turn to an area and scan it if shots are fired from that direction as they'd hear shots ring out, then they would fire on target given a detection delay based on the detection difficulty of the target.

Detection difficulty would be based off things noted before such as how far away the target is, perhaps if smoke was popped in that area recently, how large the target is if they're a vehicle (as tankcores have a variable for their volume now), how fast the target is moving, crouch vs upright, if the target has shot recently, and other relevant factors thought up.

Dakota0001 commented 3 years ago

Furthermore, I was looking into the code and we actually need to remove the recent changes where you added the reaction time. Bots already have a response time, but actually woven in better than what was done here. Check the base code for comment "--simulate response time", beside it there will be a coroutine.wait function with a random time between 0.1 and 0.3 seconds as that seemed like average competitive response times rather than senile old man tier response times. It's also positioned properly so that the bots will attempt to actually turn towards the target within this time and react to you a bit but will take their time firing to simulate aiming up on the target or hesitating in some way before firing. This gives the bots a look of coming around the corner, noticing you, aiming at you, and then firing at you. They are limited by both needing to point at you and after pointing at you then run this wait time before firing.

In general the bots with regular weapons didn't seem to be much of a problem to begin with in regards to aimbotting and were pretty fair given they couldn't really oneshot you, have built in inaccuracy, and can be countered heavily via armor options on the player and are pretty helpless against heavy armor bloodlust builds. In comparison the real problem was bazooka bots firing at players with 100% accuracy and low spread, In the dak_gamemode_bot file you can see that the missile type bots have a spread value of 0.25 base spread, which is a quarter of the rifle bot's spread ontop of having a 100% hit chance at all times regardless of crouching, standing, running, etc.

I recommend that spread be increased to at least 1.0, accuracy when running to be reduced to 5% or less in both burst and full auto (which are effectively the same since they have 1 shot before reload), standing hit chances to be 10%, and crouching to be 20%. This will make them very unlikely to hit players with rockets, but the miss amount is still likely small enough for them to hit vehicles reliably, but without extreme precision. Spread and hit rate values can even be adjusted per era to simulate bazookas being much harder to really hit with than a modern RPG. The shoot range value would be relevant here too as that would determine the ranges they try to be at to fire accurately. They still fire beyond their shoot range but are limited to the running hit modifiers of burst and full auto types, it could be setup so that for a bazooka to fire accurately it must get up to relatively close range then it would be able to crouch and fire accurately.

Modifications to the base code could also take into account the "ShootVehicles" flag on bots so that they behave differently if it is set to true, for example not allowing them to fire on the move at all and instead forcing them to crouch then fire even at longer ranges stopping to crouch and take a relatively inaccurate shot then getting back up to continue advancing to target.