Prediction mechanic and what to focus on?

Godot Version

v4.6.1

Question

I’m making an artillery game similar to Pocket Tanks, Angry Birds and such. However, my game has a twist. The player can’t ‘eyeball’ the distance, angle and power. There’s a recon mechanic where player scouts for enemy position and gives rough values (that can vary, there will be accuracy info on gathered intel from recon) back to the artillery operators, then they enter that information (or tweak it a little) and execute the shot. But all that happens in a 2D side scroller universe, so I need to have a code that tries a bunch of different values of angle, power and distance (maybe move back/forth a little) and then finds the ones that would match with the target getting hit and giving me an optimal solution (for example we don’t want too little or too much power because both reduce accuracy in the real world but we also don’t want too big of an arc or we don’t want to have to reposition a lot etc).

Now, my 2nd problem is about the targets for testing. I’m at the crossroads whether or not I should focus on premade targets and optimize the code on them or first go for a tutorial/sandbox level where the target location and distance is completely random?

Not sure what exactly is your question but you might find useful the fact that you can exactly calculate a projectile trajectory (including its max height and range) from the initial parameters; initial velocity and launch angle.

I’m also not entirely sure what you’re asking, but - as to your recon info reporting, you could simply calculate the exact trajectory needed, and thus the exact values, and put that in a random span. For instance, let’s say the velocity for this shot needs to be 97 (ignoring angle and direction) - that could be reported within whole tens (90-100), and the player would have to judge if that should be in the high 90’s or low. That gives a little predictability and some amount of random spread.

As for testing, I would suggest developing a playable section of the game and going from there. That’ll help you assess the fun, which is arguably what any game strives to achieve.

I had the thought that if you’re going for realistic calculations, you could introduce moving targets - that would mean a higher arc needs to compensate more for movement speed, since a higher shot will take longer to reach its target. It’s even possible to fire at different trajectories over time, and yet have all the shells hit the same target simultaneously - that might be fun to try and achieve for the player :slight_smile: