[Orxonox-commit 5992] r10651 - code/branches/AI_HS15/src/orxonox/controllers
gania at orxonox.net
gania at orxonox.net
Tue Oct 13 18:11:02 CEST 2015
Author: gania
Date: 2015-10-13 18:11:01 +0200 (Tue, 13 Oct 2015)
New Revision: 10651
Modified:
code/branches/AI_HS15/src/orxonox/controllers/AIController.cc
code/branches/AI_HS15/src/orxonox/controllers/ArtificialController.h
Log:
Old AIController default behaviour is commented out
Modified: code/branches/AI_HS15/src/orxonox/controllers/AIController.cc
===================================================================
--- code/branches/AI_HS15/src/orxonox/controllers/AIController.cc 2015-10-12 20:57:00 UTC (rev 10650)
+++ code/branches/AI_HS15/src/orxonox/controllers/AIController.cc 2015-10-13 16:11:01 UTC (rev 10651)
@@ -43,7 +43,6 @@
AIController::AIController(Context* context) : ArtificialController(context)
{
RegisterObject(AIController);
-
this->actionTimer_.setTimer(ACTION_INTERVAL, true, createExecutor(createFunctor(&AIController::action, this)));
}
@@ -146,6 +145,7 @@
void AIController::tick(float dt)
{
+
if (!this->isActive())
return;
@@ -255,7 +255,13 @@
}
//**********************************************NEW
void AIController::defaultBehaviour(float maxrand)
- { float random;
+ {
+ if (!this->target_)
+ this->searchNewTarget();
+ if (!(this->passive_) && (this->target_ && !this->bShooting_))
+ this->bShooting_ = true;
+ /*
+ float random;
// search enemy
random = rnd(maxrand);
if (random < (botlevel_* 100) && (!this->target_))
@@ -312,7 +318,9 @@
random = rnd(maxrand);
if (random < botlevel_*50 )
this->boostControl();
+ */
+
// update Checkpoints
/*random = rnd(maxrand);
if (this->defaultWaypoint_ && random > (maxrand-10))
@@ -320,6 +328,8 @@
else //if(random > maxrand-10) //CHECK USABILITY!!*/
if (this->waypoints_.size() == 0 )
this->manageWaypoints();
+
+
}
}
Modified: code/branches/AI_HS15/src/orxonox/controllers/ArtificialController.h
===================================================================
--- code/branches/AI_HS15/src/orxonox/controllers/ArtificialController.h 2015-10-12 20:57:00 UTC (rev 10650)
+++ code/branches/AI_HS15/src/orxonox/controllers/ArtificialController.h 2015-10-13 16:11:01 UTC (rev 10651)
@@ -73,6 +73,7 @@
bool isLookingAtTarget(float angle) const;
float botlevel_; //<! Makes the level of a bot configurable.
+ //botLevel_ is never used in XML (so far), is it redundant?
enum Mode {DEFAULT, ROCKET, DEFENCE, MOVING};//TODO; implement DEFENCE, MOVING modes
Mode mode_; //TODO: replace single value with stack-like implementation: std::vector<Mode> mode_;
void setPreviousMode();
More information about the Orxonox-commit
mailing list