This is game making (I.E. no need for precision, and it's often better to fake things than to create a foolproof solution). Unless you're making a library for someone else to use, it's usually safe to test it on the range of conditions that you expect.Another thing to think about; suppose you have made a very complex algorithm for doing something. It seems to work in every case, but you're not sure. How would you make sure it works? Has anyone ever had a situation where they actually did a formal proof to show that something worked?
For example, a short time ago, I created a bot aiming system for an FPS (Using finite-speed projectiles, gravity possible on projectile/target/both). I had some options:
- Quartic formula (Foolproof solution)
- Quadratic formula (Works unless projectiles have gravity or the target is falling, but is much cheaper than quartic)
- Iterative solution. Guess where to aim, improve guess based on error in original guess. (There's no guarantee that this will find the best solution, especially since I'll only let it guess 4 times or so)
- Hybrid.
Long story short, I use a quadratic to find the starting point, then an iterative solution to hit falling targets. There's no proof that it'll work all the time, but if it fails, it'll just cause the bot to miss (Which is expected by most players anyway, so no harm done).



This topic is locked








