Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Ilici

About the interface

This topic is 5452 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m new to the Arena competition, and i want to find out more about some stuff which confuses me: How does the bot interact with the program? In the source i found the functions i have to write for the bot, but how does the bot get info about the world (what is in the FOV: the bullets that are flying, what is in front of me etc) ? Death to the gaming industry! Long live games. /*ilici*/

Share this post


Link to post
Share on other sites
Advertisement
To see what's in the FOV, use the GetObjectsInSight method... for example:


//In your update function

int nofObjs = g_pCore->GetNumObjectsInSight(); //Gives you how many objects are in sight

for (int i=0;i<nofObjs;i++) //Goes through each object

{
float distance,direction,objDirection; //Will hold information about each object

int type; //Corresponds to the type listed in ICore.h

g_pCore->GetObjectsInSight(i,type,direction,distance,objDirection); //Fills with data about the current object



//Here you could either store the data and deal with it later, or deal with it immediately, for example:

if (type == OBJ_ENEMY)
g_pCore->Fire(); //If one of the objects in view is an enemy, the bot will fire


}
g_pCore->SetSpeed(SET_HIGH_SPEED); //Moves forward fast

g_pCore->TurnLeft(TURN_FAST); //Turns left fast




So that's a very basic bot, which runs in circles and will fire at the enemy if seen.

Hope it helps you understand how this works.

[Note: as of the current build, the bots can't actually see the bullets. To tell if you're being hit, call the GetMyHealth() method every cycle and see if your health has changed. If it has, you know someone is shooting at you...]



[edited by - HappyDude on August 17, 2003 1:01:22 PM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!