Fedoraware / Fedoraware

Free and open-source training software for Team Fortress 2
Do What The F*ck You Want To Public License
116 stars 103 forks source link

Projectile "Wait for hit" #175

Closed SylveonBottle closed 1 year ago

SylveonBottle commented 2 years ago

Scenario: There's an enemy across the map from you. They've rocketjumped high into the air. You target them, holding Aim Key to activate projectile aimbot. Projectile Aimbot fires at the target. Based off of Prediction Time, the rocket will hit them in 1.1 seconds.

As you hold the aim key, Projectile Aimbot fires a second rocket at the target due to your weapon having a 0.8s attack interval. However, the first rocket hits the target. The target's course is altered. The second rocket misses due to this.

Solution: The Projectile Aimbot should have waited an extra 0.3 seconds before firing the next rocket.

Before: -0.0 - Aimbot is activated -0.0 - Aimbot finds Target 0.0s - Aimbot predicts the target's trajectory, and fires. 0.8s - The rocket can shoot again. 0.8s - Aimbot fires the second rocket at the target's current projected trajectory. 1.1s - The first rocket hits, altering the target's course. 1.6s - The second rocket misses. 2.4s - The rocket can now shoot again. 2.4s - Aimbot fires the third rocket. 3.2s - The aimbot can shoot again. 3.3s - The aimbot fires the fourth rocket. The user must now take 0.92s to reload the next rocket. 3.5s - The third rocket hits. The target is now dead. 4.4s - The fourth rocket misses. Even if the target was alive, it would have missed anyway due to the altered course. It took 3.5s to kill the target, and we wasted 2/4 shots.

After: -0.0 - Aimbot is activated -0.0 - Aimbot finds Target 0.0s - Aimbot predicts the target's trajectory, and fires. 0.8s - The rocket can shoot again. But the aimbot waits. 1.1s - The first rocket hits, altering the target's course. 1.1s - The aimbot predicts the target's trajectory, and fires. 1.9s - The rocket can fire again. But the aimbot waits. 2.2s - The second rocket hits, altering the target's course. 2.2s - The aimbot predicts the target's trajectory, and fires. 3.0s - The rocket can fire again. But the aimbot waits. 3.3s - The second rocket hits. The target is now dead. Despite the aimbot purposely waiting and seemingly wasting 0.6s doing nothing, we killed the target 0.2s faster, and wasted 0/2 shots. We now have 2 more rockets leftover that we can use.

I propose adding a slight delay between Projectile AImbot's Autoshoot to not fire until the first rocket has hit. We do this by adding a small delay between each shot. The delay is equal to the same math used in Prediction Time. If the rocket will not reach the target for 2 seconds, we should wait 2 seconds before firing again. There could be a slider below Prediction Time, called "Maximum Wait Time". If the slider is set to 2, then the aimbot will immediately shoot a second rocket if the projectile prediction says it will take over 2 seconds to hit the target.

Changing targets should reset the time. Manually firing a rocket with aimbot active should still use projectile prediction. If the enemy changes course, you can simply fire manually to override the wait timer. Perhaps we could also reset the time if the target changes course before the rocket hits?

Theoretically, it should look like this:

Before: https://user-images.githubusercontent.com/17802843/162681460-aaa96ca6-6a92-4655-ba4b-c1507c3d8bc0.mp4

After: https://user-images.githubusercontent.com/17802843/162681471-a2c7f774-5b9f-457a-b249-4bb1648740a2.mp4

swamptwink commented 2 years ago

Just don't hold shift mindlessly???

johnathon-walnut commented 2 years ago

Or instead of being reductive we could consider this and actually have an improvement to how well it does. It would even be fairly easy to do, if I'm thinking about this right

johnathon-walnut commented 2 years ago

Obviously fire rate should be taken into account i.e. the blutsauger/syringe gun would not benefit from this as it fires too many shots, but all we need to do really is store the time we did pCmd->buttons & IN_ATTACK and store the time the projectile would take and then compare the current time - time we stored > time projectile took I think?

swamptwink commented 2 years ago

this is the same person who asked for strafe pred because they couldn't deal with a trolldier, if we were to add strafe pred would it not be easier to also change movement sim to account for knockback not only from our projectiles but also from other pills / rockets that we predict will hit them?

johnathon-walnut commented 2 years ago

Strafe prediction would be significantly easier than simulating imaginary projectiles I think (I'm not sure how you'd bring multiple entities into the same prediction)

swamptwink commented 2 years ago

take prediction time of projectile, wait until that time has passed or until the players predicted future positions change, repredict, shoot.

sure it makes sense, good luck adding it if u choose to...

SylveonBottle commented 2 years ago

this is the same person who asked for strafe pred because they couldn't deal with a trolldier, if we were to add strafe pred would it not be easier to also change movement sim to account for knockback not only from our projectiles but also from other pills / rockets that we predict will hit them?

I just linked to strafe prediction because I noticed this cheat didn't have it. Seeing that it didn't have it, I assumed that meant that either the developers were not aware that strafe prediction was a thing, or simply forgot about it. Especially considering many other cheats now have it. I didn't make an issue about it because I know fully well how stupid suggesting strafe prediction is. The fact that it's not implemented in the first place proves just how hard strafe pred is to code anyways. Again, I simply referenced it so that it can be a side-note in the future if anyone gets around to completely rebuilding the projectile aimbot. I did not make an issue on github asking for it to be added now just because I "couldn't deal with a trolldier".

But the reason why I made this issue was because of how simple it is to impliment. Literally all you have to do is disable aimbot for Xms, where X = the time it takes for the rocket to hit the target.

What is "Prediction Time" in the menu? It sounds something like "the maximum time aimbot will consider shooting a rocket." I.e. if Prediction Time is set to 3, Projectile Aimbot will not fire at an enemy if the rocket takes 3.1 seconds. Based on this logic, I assumed Fedoraware already contained code to tell how long it would take for a rocket to hit the target. Was I wrong? I might have been wrong. If that's the case, then yes, this would require creating a whole new system to tell how long it would take to hit a target. But isn't this easy too? All you have to do is Time = Distance/Speed. The speed of a rocket from the stock launcher is around 1100 hammer units per second. If an enemy is 1500hu away, it will take 1.36s to hit the target. The attack interval of said rocket is 0.8s. So just make the aimbot not fire at the same target for 1360ms. This would add a 0.56s 'wasted' delay between shots.. but firing before that time will 100% cause the second rocket to miss if the first rocket hits, altering their course.

Obviously fire rate should be taken into account i.e. the blutsauger/syringe gun would not benefit from this as it fires too many shots

Obviously the only reason I'm suggesting this "wait for hit" is to account for the target's new trajectory when they get bounced upwards by a rocket hitting their feet. Syringe gun would not noticeably effect an enemy's trajectory in any meaningful way to wait for the next shot. With that in mind, I think bodyshots against an enemy on ground will also not effect their trajectory in any meaningful way. So if #174 is implemented in the future, I think "wait for hit" would be worthless if we're body-shotting them with a rocket. The only exception being if they're in the air, since a rocket to the chest will alter their course slightly enough to make a second rocket miss if fired too soon.

take prediction time of projectile, wait until that time has passed or until the players predicted future positions change, repredict, shoot.

It's this, basically. If you're holding the aim key, projectile aimbot constantly repredicts doesn't it? All Wait For Hit has to do is predict how long a rocket will hit, then wait until that time has passed.

The Direct Hit will hit enemies faster. Demoman pills are less accurate (so demoman doesn't benefit from this? If the enemy is knocked into the air, demoman projectile aimbot can hit them more often than not. So don't wait for time if the enemy is on ground?). Syringe guns are useless for this, crossbow doesn't alter friendly team's course (does it alter enemy?).

gayblackirony commented 2 years ago

this whole thread is fucking insane

canedoly commented 2 years ago

this is the same person who asked for strafe pred because they couldn't deal with a trolldier, if we were to add strafe pred would it not be easier to also change movement sim to account for knockback not only from our projectiles but also from other pills / rockets that we predict will hit them?

I just linked to strafe prediction because I noticed this cheat didn't have it. Seeing that it didn't have it, I assumed that meant that either the developers were not aware that strafe prediction was a thing, or simply forgot about it. Especially considering many other cheats now have it. I didn't make an issue about it because I know fully well how stupid suggesting strafe prediction is. The fact that it's not implemented in the first place proves just how hard strafe pred is to code anyways. Again, I simply referenced it so that it can be a side-note in the future if anyone gets around to completely rebuilding the projectile aimbot. I did not make an issue on github asking for it to be added now just because I "couldn't deal with a trolldier".

But the reason why I made this issue was because of how simple it is to impliment. Literally all you have to do is disable aimbot for Xms, where X = the time it takes for the rocket to hit the target.

What is "Prediction Time" in the menu? It sounds something like "the maximum time aimbot will consider shooting a rocket." I.e. if Prediction Time is set to 3, Projectile Aimbot will not fire at an enemy if the rocket takes 3.1 seconds. Based on this logic, I assumed Fedoraware already contained code to tell how long it would take for a rocket to hit the target. Was I wrong? I might have been wrong. If that's the case, then yes, this would require creating a whole new system to tell how long it would take to hit a target. But isn't this easy too? All you have to do is Time = Distance/Speed. The speed of a rocket from the stock launcher is around 1100 hammer units per second. If an enemy is 1500hu away, it will take 1.36s to hit the target. The attack interval of said rocket is 0.8s. So just make the aimbot not fire at the same target for 1360ms. This would add a 0.56s 'wasted' delay between shots.. but firing before that time will 100% cause the second rocket to miss if the first rocket hits, altering their course.

Obviously fire rate should be taken into account i.e. the blutsauger/syringe gun would not benefit from this as it fires too many shots

Obviously the only reason I'm suggesting this "wait for hit" is to account for the target's new trajectory when they get bounced upwards by a rocket hitting their feet. Syringe gun would not noticeably effect an enemy's trajectory in any meaningful way to wait for the next shot. With that in mind, I think bodyshots against an enemy on ground will also not effect their trajectory in any meaningful way. So if #174 is implemented in the future, I think "wait for hit" would be worthless if we're body-shotting them with a rocket. The only exception being if they're in the air, since a rocket to the chest will alter their course slightly enough to make a second rocket miss if fired too soon.

take prediction time of projectile, wait until that time has passed or until the players predicted future positions change, repredict, shoot.

It's this, basically. If you're holding the aim key, projectile aimbot constantly repredicts doesn't it? All Wait For Hit has to do is predict how long a rocket will hit, then wait until that time has passed.

The Direct Hit will hit enemies faster. Demoman pills are less accurate (so demoman doesn't benefit from this? If the enemy is knocked into the air, demoman projectile aimbot can hit them more often than not. So don't wait for time if the enemy is on ground?). Syringe guns are useless for this, crossbow doesn't alter friendly team's course (does it alter enemy?).

or you can just not hold the aimkey and just wait until the projectile hits the target

SylveonBottle commented 2 years ago

or you can just not hold the aimkey and just wait until the projectile hits the target

you could also just not use aimbot and just aim mindfully you could also just not use bunnyhop and just jump normally you could also just not use esp and just use gamesense

The whole point of using a cheat client is to have the cheat do things for you because you're not skilled enough to do it as perfectly as a robot. You're going to miss shots. With aimbot, you don't. You're going to mess up bunnyhopping. With Bunnyhop, you don't. You're going to mess up the timing for delaying between shots. With Wait for hit, you don't.

I've put in as much information as I needed to on the first post in order for someone interested in this to try it out. If you're not interested, just move on. You don't need to tell me this feature is stupid, I know very well how stupid it is. But I still deemed it worthwhile to at least share. Even johnathon seems to share my interest.

johnathon-walnut commented 2 years ago

I agree with you fully

johnathon-walnut commented 2 years ago

In fact, it's not stupid at all - it's a very well thought out suggestion. I don't see why people are opposed to the idea at all especially given how easy it is to add - we do have the projectile speeds and use them in calculations

SylveonBottle commented 2 years ago

I don't see why people are opposed to the idea at all

I swear people are just opposed to the idea because they don't want to code it themselves, so they try to give reasons as to why they shouldn't have to be bothered coding it. It's the mindset of open-sourced corders. They're not getting paid, so why should they add something they never thought of in the first place? The only incentive to work on something is your own interest in the idea. Instead of showing dis-interest to a possible feature (that already has someone interested in it), it would've been great to have a few more brains thinking of ways to improve the feature. I'm not expecting anyone to work on this suggestion, I'm just putting the idea down incase someone who is interested in it might take a shot at it.

I'm pretty sure most information on how this could be done is already posted anyways. We even got some edge-cases like demoman, medic's crossbow, etc in here if you wanted to make it 'smarter' for specific scenarios

canedoly commented 2 years ago

it would've been great to have a few more brains thinking of ways to improve the feature. I'm not expecting anyone to work on this suggestion, I'm just putting the idea down incase someone who is interested in it might take a shot at it.

ok so if you want suggestions to potentially improve this here you go

Let's say the projectile takes 2s to hit target's predicted trajectory but he dodges, making you wait 1.2s without firing until the aimbot shoots again, him having less rockets to dodge could get him more time to get on ground and have a higher chance of living overall, and let's say he would be in air 4s so we would only fire 2 out of 4 rockets. But if we constantly fired these rockets at the target, there's a higher chance we could actually hit him. So maybe by checking if the target is constantly changing trajectory, we should just fire instantly instead of waiting which could potentially increase the chance of us hitting the target, but wait for hit if the predicted trajectory doesn't change.

SylveonBottle commented 2 years ago

it would've been great to have a few more brains thinking of ways to improve the feature. I'm not expecting anyone to work on this suggestion, I'm just putting the idea down incase someone who is interested in it might take a shot at it.

ok so if you want suggestions to potentially improve this here you go

Let's say the projectile takes 2s to hit target's predicted trajectory but he dodges, making you wait 1.2s without firing until the aimbot shoots again, him having less rockets to dodge could get him more time to get on ground and have a higher chance of living overall, and let's say he would be in air 4s so we would only fire 2 out of 4 rockets. But if we constantly fired these rockets at the target, there's a higher chance we could actually hit him. So maybe by checking if the target is constantly changing trajectory, we should just fire instantly instead of waiting which could potentially increase the chance of us hitting the target, but wait for hit if the predicted trajectory doesn't change.

Is it possible to cast projectile prediction from the rocket's distance?

If it's possible to simulate projectile prediction from the rocket's prediction, all we have to do is simulate firing a rocket at the target.. from the rocket's position. If the angle the simulated rocket fires is massively different from the current rocket's angle, it's going to miss.

If the target doesn't move, this next prediction should be the same as the first prediction.

We shoot our first rocket image

When it is time to fire our second rocket, do a quick check from the rocket's location to see if it will hit:

image

When checking from rocket's location, if the enemy's path has changed it should be very obvious. image

This is all assuming it's possible to do projectile prediction from the rocket's position.

Basically we're just checking if the path the rocket is going to take lines up with projectile prediction, but ignoring the distance between us and the rocket. An alternative to this would be: -Fire rocket at target -Wait 0.8s -Simulate firing a rocket at target but with increased speed (so they should both hit the target at the same time) -See if simulated rocket's FOV lines up with the first rocket If the simulated rocket is aligned with the first rocket, it should totally hit. The major problem with this is that it requires you to be standing in the exact same spot at when you fired the first rocket, otherwise they won't align at all..

canedoly commented 2 years ago

wow you really thought about this

SylveonBottle commented 2 years ago

Instead of checking FOV/angle alignment, can we check "where the rocket should hit"? Let's say the target is 2200hu away. A rocket travels 1100hu/s. The rocket should hit in 2 seconds. The explosion should happen at "estimated target's position". After 0.8s the first rocket is at 880hu and will hit in 1.2s. We simulate firing a second rocket at the target at 5500hu/s. This second rocket will hit the target in 1.2s (exactly the same time as the first rocket). Both the main rocket and the simulated rocket should explode at the same time, at the same place. If the second rocket fires in a completely different direction and explodes at at completely different time, then the target has strafed and we should fire a real rocket at the target's next predicted destination.

Basically, we're just doing a quick check to make sure that the projectile prediction is still saying that the enemy is still going to be in the same place as the first rocket's prediction.

If the "simulated" second rocket will hit the target way off course from the first rocket's destination, then it's assumed that the target has altered course.

Basically: -Fire rocket at the target -After 0.8s, simulate firing a second, much faster rocket at the target -If the simulated rocket and the real rocket are expected to explode in the same position, the first rocket will 100% hit -If the simulated rocket and the real rocket hit the target far apart, the first rocket will miss. The simulated faster rocket will have a more up-to-date progress on the target's position. So if the simulated rocket says that it will hit the target somewhere else other than where the first rocket was launched, then the first rocket is going to 100% miss, and we should go ahead and fire our second (real) rocket.

gayblackirony commented 2 years ago

Instead of checking FOV/angle alignment, can we check "where the rocket should hit"? Let's say the target is 2200hu away. A rocket travels 1100hu/s. The rocket should hit in 2 seconds. The explosion should happen at "estimated target's position". After 0.8s the first rocket is at 880hu and will hit in 1.2s. We simulate firing a second rocket at the target at 5500hu/s. This second rocket will hit the target in 1.2s (exactly the same time as the first rocket). Both the main rocket and the simulated rocket should explode at the same time, at the same place. If the second rocket fires in a completely different direction and explodes at at completely different time, then the target has strafed and we should fire a real rocket at the target's next predicted destination.

Basically, we're just doing a quick check to make sure that the projectile prediction is still saying that the enemy is still going to be in the same place as the first rocket's prediction.

If the "simulated" second rocket will hit the target way off course from the first rocket's destination, then it's assumed that the target has altered course.

Basically: -Fire rocket at the target -After 0.8s, simulate firing a second, much faster rocket at the target -If the simulated rocket and the real rocket are expected to explode in the same position, the first rocket will 100% hit -If the simulated rocket and the real rocket hit the target far apart, the first rocket will miss. The simulated faster rocket will have a more up-to-date progress on the target's position. So if the simulated rocket says that it will hit the target somewhere else other than where the first rocket was launched, then the first rocket is going to 100% miss, and we should go ahead and fire our second (real) rocket.

won't that rip fps alot? extremely cool concept tho

johnathon-walnut commented 2 years ago

i am now confused

SylveonBottle commented 2 years ago

i am now confused

Untitled

SylveonBottle commented 2 years ago

We want to add a small delay between firing our second rocket, because if we fire too soon it'll miss (see videos on first post). However, if the target alters course, the first rocket is going to miss anyways and we want to fire as soon as possible in that case.

How do we tell if the first rocket will miss? That's basically what we're trying to figure out. Like, what's the easiest way to tell if an enemy strafes off-course and we need to fire a second rocket early / disable "wait for hit"

johnathon-walnut commented 2 years ago

i am now confused

Untitled

ok this one seems hard to implement and i frankly can not even get the original idea to work so im not sure how i would fair with this - i like the gif tho

SylveonBottle commented 2 years ago

ok this one seems hard to implement

To be honest, it would probably just be easier to manually fire. If the target strafes, and you know for a fact the rocket will miss, just hold mouse1 and manually fire the proj aimbot lmao..

i frankly can not even get the original idea to work

Is it hard to see how long it'll take for a rocket to hit the target? Divide the aim location by the projectile's speed, disable aimbot for Xms.

swamptwink commented 2 years ago

save projectile travel time from whenever we fire, we already know the time it takes is (step * (MAX_TIME / 128)) (smthn like that) by the time it fires

ProjectileAimbotError404 commented 1 year ago

what are your settings for the projectile aimbot,mine doesnt hit from that far

johnathon-walnut commented 1 year ago

i'm closing this for now as it's pretty obvious nobody is ever gonna go into a full implementation of this

Eniac763 commented 1 year ago

un3-2