L133 SuggestProjectileVelocity() - Persistent bug

Hi all,

the lesson deals with how to do bug reports, and suggests a solution to the “aim solution not found” log error caused by a bug in the SuggestProjectileVelocity() UE function. I’m still getting the same error after applying the fix as suggested by @ben in the lesson - I’ve even copied the code from Ben’s commit on github to make sure it’s not a spelling error I’ve missed, I’ve deleted/rebuilt project files, all in all running out of ideas.My current implementation is such:

bool bHaveAimSolution = UGameplayStatics::SuggestProjectileVelocity
(
    this,
    OutLaunchVelocity,
    StartLocation,
    HitLocation,
    LaunchSpeed,
    false,
    0,
    0,
    ESuggestProjVelocityTraceOption::DoNotTrace // Paramater must be present to prevent bug
                                                // TODO report bug
);

…and log output is:

LogTemp:Warning: 0.008334: Aim solution found
LogTemp:Warning: 0.008334: NO aim solution found
LogTemp:Warning: 0.008334: NO aim solution found
LogTemp:Warning: 0.008334: NO aim solution found
LogTemp:Warning: 0.008334: Aim solution found
LogTemp:Warning: 0.260461: Aim solution found
LogTemp:Warning: 0.260461: NO aim solution found
LogTemp:Warning: 0.260461: NO aim solution found
LogTemp:Warning: 0.260461: NO aim solution found
LogTemp:Warning: 0.260461: Aim solution found
LogTemp:Warning: 0.270839: Aim solution found
LogTemp:Warning: 0.270839: NO aim solution found
LogTemp:Warning: 0.270839: NO aim solution found
LogTemp:Warning: 0.270839: Aim solution found
LogTemp:Warning: 0.270839: NO aim solution found
LogTemp:Warning: 0.279174: Aim solution found

…etc. Running on Engine 4.12.5. Any sort of solution welcome.

The LaunchSpeed variable on the Tank BP was still at 4000 from whichever lesson that was. I increased the value back to the initially suggested default of 10000 and now I keep getting an aim solution even when aiming at the sky (which is better, at least now I know it’s working).

1 Like

Hey, I’m not sure there’s an actual bug in that method. I found out that the “No aim solution found” logs disappear when you remove the AI tanks from the map, which means that you are actually getting 4 log messages every frame: one ‘good’ message from the Player tank, and 3 ‘bad’ messages from the AI tanks.

Therefore, there was not any problem with the Player tank at all, and they were the AI tanks the ones that did not like the Enum setting that was changed in this video. If you still have the problem after changing the Enum, that means your AI tanks are too far from the Player tank, so it’s probably OK that they didn’t find an aim solution. That’s why changing the LaunchSpeed solved the issue, since that increases the range of all tanks… :wink:

2 Likes

Thanks @TheGlecter! I must admit I feel a little dumb, as what you are pointing out should be obvious, and I didn’t even consider that the AI tanks also write that log. I did suspect my map size (which is a fair bit larger than Ben’s) might have something to do with it, but I never pursued that chain of thought any further - I expect it would have led me to discover the same solution :slight_smile:

1 Like

I had a problem but the other way around, I get the correct “Aim solution found” message when pointing to the ground, but when I point to the sky I get a few “No aim solution found” and a majority of “Aim solution found”. I’m going to log the tank name to make sure, thanks very much, @TheGlecter.

I realize I’m a little late to the game, but wanted to throw in my findings up to this point. I ended up grabbing the name of the tank using Barrel->GetOwner()->GetName(); so I can find out exactly who was finding the aim solution and who wasn’t. Turns out, if you take away those “optional” fields, what should be a tank name ends up being Battleground. When I add the optional fields back in, I see each tank name with an aim solution.

I’m at a loss now but I’m assuming this gets addressed in a later video considering how late I am to getting here.

Privacy & Terms