🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

About the interface

Started by
1 comment, last by Ilici 20 years, 10 months ago
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*/
Advertisement
You could try reading readme.txt, that''s generally a good idea.

John B
The best thing about the internet is the way people with no experience or qualifications can pretend to be completely superior to other people who have no experience or qualifications.
To see what's in the FOV, use the GetObjectsInSight method... for example:

//In your update functionint nofObjs = g_pCore->GetNumObjectsInSight(); //Gives you how many objects are in sightfor (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 fastg_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]

This topic is closed to new replies.

Advertisement