Tank wars sorta game

Started by
1 comment, last by XXChester 12 years, 5 months ago
Hello everyone, I am finally throwing in the towel and asking for some direction on how to write the AI for my tank wars /scorthed earth sorta clone. I know I need to simulate how the computer sees the map to determine the best angle / power to fire with but I cannot seem to figure out the best way to do this. I was thinking of drawing a sort of porabola for the computer and checking if it collides with the terrain and than adding fuzzy logic but this seems like it would be extremely slow.

Can someone point me in the direction of not an implementation but maybe a further explanation of how this has been done.

Here is a screen shot of my game;
screenshotgll.th.png

I have the AI determining which target is the closest and facing that way, its just the step of figuring out the power / angle without colliding with terrain that I need some direction.
Thanks.

Remember to mark someones post as helpful if you found it so.

Journal:

http://www.gamedev.net/blog/908-xxchesters-blog/

Portfolio:

http://www.BrandonMcCulligh.ca

Company:

www.gwnp.ca

Advertisement
You have to look at projectile physics. Pick an angle first. If you know or can guess how long it will be in the air, then you can figure out something like:

tank_x + airTime*(x) = tank_x_2;

Find x. Then you can find your power needed to make it come out with that speed along the x direction.

Or just guess. Take a fixed angle such as 45 degrees. Guess that the power should be something based on the distance to the other tank. Power = distance*(constant)
Shoot it,see if it lands in front of or behind the other tank. Adjust power +/- from there.

NBA2K, Madden, Maneater, Killing Floor, Sims http://www.pawlowskipinball.com/pinballeternal

Thanks for the reply.....I like your first reply...it was along the lines I was thinking but I was thinking of it too visually where as your description is more of mock approach and should be much faster than actually drawing a texture and checking pixel collision.


Thank you I will try that out.

Remember to mark someones post as helpful if you found it so.

Journal:

http://www.gamedev.net/blog/908-xxchesters-blog/

Portfolio:

http://www.BrandonMcCulligh.ca

Company:

www.gwnp.ca

This topic is closed to new replies.

Advertisement