Changeset 10283 in orxonox.OLD for branches/ai/src
- Timestamp:
- Jan 17, 2007, 9:06:56 PM (18 years ago)
- Location:
- branches/ai/src/ai
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ai/src/ai/ai_team.cc
r10275 r10283 57 57 std::cout << "Go Start Position\n"; 58 58 changeSwarmModule(it, new SwarmGoRel); 59 newPosition=Vector(180,0,zNorm*60); 60 speed=80; 61 }else if(position.x > targetPos.x+150){ //go to attack position 59 zNorm=1-(rand()%2)*2; //1 or -1 60 newPosition=Vector(190,0,zNorm*10); 61 speed=60; 62 }else if(position.x > targetPos.x+160){ //go to attack position 62 63 std::cout << "Go Attack Position\n"; 63 64 changeSwarmModule(it, new SwarmGoRel); 64 newPosition=Vector(1 00,0,0);65 speed= 80;66 }else if(position.x > targetPos.x+ 90){ //go to attack mode65 newPosition=Vector(130,0,0); 66 speed=60; 67 }else if(position.x > targetPos.x+120){ //go to attack mode 67 68 std::cout << "Go Attack Mode\n"; 68 69 changeSwarmModule(it, new SwarmAttack); 69 newPosition=Vector( 80,0,0);70 speed= 80;71 maxTime=(rand()%11) ;//0-10Sekunden70 newPosition=Vector(110,0,0); 71 speed=60; 72 maxTime=(rand()%11)+2;//2-12 Sekunden 72 73 }else{ //go to fallback point 73 74 std::cout << "Go Fallback Point\n"; 74 75 changeSwarmModule(it, new SwarmGoRel); 75 newPosition=Vector( 0,0,zNorm*100);76 newPosition=Vector(80,0,zNorm*90); 76 77 speed=80; 77 78 } … … 80 81 } 81 82 82 83 speed=0; 83 84 84 85 if(enemyList->size()>0){ -
branches/ai/src/ai/attack_module.cc
r10279 r10283 144 144 //rotate NPC 145 145 view = target->getAbsCoor()-myPosition; 146 Vector randomView=view.cross(Vector(0,1,0)).getNormalized(); 147 randomView=randomView*((rand()%4)-2); 148 149 view = target->getAbsCoor()+randomView-myPosition; 146 150 view = view.cross( Vector(0,1,0) ).getNormalized(); 147 151 -
branches/ai/src/ai/movement_module.cc
r10275 r10283 33 33 SHELL_COMMAND(setTestValue2, MovementModule, setTestValue2); 34 34 35 float MovementModule::distanceToPlayer= 15;35 float MovementModule::distanceToPlayer=30; 36 36 float MovementModule::distanceToNPC=2; 37 37 float MovementModule::maxAccleration=250.0f; -
branches/ai/src/ai/swarm_gorel.cc
r10275 r10283 28 28 } 29 29 averageRadius=averageRadius/members.size(); 30 aMax= 500/averageRadius;31 vMax= 500/averageRadius;30 aMax=400/averageRadius; 31 vMax=300/averageRadius; 32 32 viewChangeMax=90/averageRadius; 33 33 … … 70 70 Vector newView=movement.getNormalized(); 71 71 72 if((newSpeed<=taskSpeed && speed>=taskSpeed)||(newSpeed>=taskSpeed && speed<=taskSpeed)){72 /*if((newSpeed<=taskSpeed && speed>=taskSpeed)||(newSpeed>=taskSpeed && speed<=taskSpeed)){ 73 73 newSpeed=taskSpeed; 74 74 }else if((newSpeed>speed && speed<taskSpeed) || (newSpeed < speed && speed < taskSpeed)){ 75 75 newSpeed=taskSpeed; 76 } 76 }*/ 77 77 78 78 /*if(angleDeg(view,newView)>viewChangeMax){ 79 79 std::cout << "alarm\n"; 80 80 }*/ 81 if(newSpeed<40)newSpeed=40; 82 if(newSpeed>vMax)newSpeed=vMax; 81 83 82 84 speed=newSpeed;
Note: See TracChangeset
for help on using the changeset viewer.