![]() |
|||||||||||||||||||||||||||||
![]() |
Home | ![]() |
Register | ![]() |
Arcade | ![]() |
Gallery | ![]() |
Chatroom | ![]() |
Members | ![]() |
Today's Posts | ![]() |
Search | ![]() |
Log In | ![]() |
|
Notices |
![]() |
|
Thread Tools |
![]() |
#1 |
Royal Gramma
Join Date: Nov 2001
Location: Israel
Posts: 146
|
AI for the tank
I wanted to understand how the AI (Artificial Intelligence) for the tank works so this is a question for Jim. My guess would be that the fish have a large net of courses. When a fish reaches a division in the course it selects a random way to go through. Am I right?
I am trying to understand how these things work since I really love programming (I learned Pascal in school, started learning C on my own and plan to learn Direct3D soon) and I am considering a career in computer gaming (Which means I will have to move to the U.S. or to England ![]() I already understand how 3D engines\rendering images work and I understand the basic ideas for creating Collision Data. I would like to know as much as possible about these subjects, including building AI, especially for shooters (which may get very complex). So, anyone who knows of sites dealing with the subject of AI algorythms (basic ideas for shooters\strategy games), please post a link. If you know anything about the subject feel free to e-mail me at 'jlahav@netvision.net.il'. Thanks in advance. |
![]() |
![]() |
![]() |
#2 |
Developer
Join Date: Dec 2000
Location: Southern Oregon
Posts: 9,816
|
Re: AI for the tank
The AI is hard to describe in a few words. It consists mostly of setting several timers to random numbers, then changing a parameter when it's timer counts down.
For an extremely simplified example, the program might: Set the TURN timer for fish 1 to a random number (say, 5.2 seconds). When the timer goes off, flip a coin to determine whether to bend right or left, and pick a random target amount to bend. Bend the fish mesh about 1/10 (or a random number which determines the quickness of the bend) of the target amount per frame, and turn the whole fish accordingly. If the fish is now pointing directly towards or away from the camera, see if it would be possible for the fish to pass from the front of the tank to the back at that position (or vice-versa). If so, flip a coin to see if it should actually do it. Check to see if anything in these movements will cause the fish to come too close to another fish or the top, bottom, or sides of the tank. Adjust movement accordingly. Repeat all this for up/down movement and speed for fish 1, then all the other fish.
Jim Sachs
Creator of SereneScreen Aquarium |
![]() |
![]() |
![]() |
|
|
|