[Orxonox-commit 7360] r11977 - in code/branches/RacingBots_FS18: data/levels data/levels/templates src/modules/gametypes

arismu at orxonox.net arismu at orxonox.net
Thu May 17 16:24:49 CEST 2018


Author: arismu
Date: 2018-05-17 16:24:48 +0200 (Thu, 17 May 2018)
New Revision: 11977

Modified:
   code/branches/RacingBots_FS18/data/levels/newnewnewspacerace.oxw
   code/branches/RacingBots_FS18/data/levels/templates/fastship.oxt
   code/branches/RacingBots_FS18/src/modules/gametypes/SpaceRace.cc
   code/branches/RacingBots_FS18/src/modules/gametypes/SpaceRaceController.cc
   code/branches/RacingBots_FS18/src/modules/gametypes/SpaceRaceController.h
Log:
updated endthe
Game

Modified: code/branches/RacingBots_FS18/data/levels/newnewnewspacerace.oxw
===================================================================
--- code/branches/RacingBots_FS18/data/levels/newnewnewspacerace.oxw	2018-05-17 14:14:35 UTC (rev 11976)
+++ code/branches/RacingBots_FS18/data/levels/newnewnewspacerace.oxw	2018-05-17 14:24:48 UTC (rev 11977)
@@ -213,7 +213,7 @@
       </collisionShapes>
   </StaticEntity>
 
-<StaticEntity position="10000,-70,200" direction="-1,0,0" yaw=90 pitch=0 roll=-30 collisionType="static">
+<StaticEntity position="11000,-60,200" direction="-1,0,0" yaw=90 pitch=0 roll=-30 collisionType="static">
     <attached>
       <Model scale="20" mesh="Board2.mesh" />
     </attached>
@@ -497,31 +497,34 @@
        <Model scale="5" mesh="botpointer4.mesh"/>
       </attached>
       <controller>
-        <ArrowController accuracy = 5000>
+        <ArrowController accuracy = 10000>
           <gpspoints>
             <Model mesh="cube.mesh" scale=0 position="1000,30,0"/>
             <Model mesh="cube.mesh" scale=0 position="3000,200,100"/>
-            <Model mesh="cube.mesh" scale=0 position="5000,100,500"/>
+            <Model mesh="cube.mesh" scale=0 position="5000,80,500"/>
             <Model mesh="cube.mesh" scale=0 position="8000,-150,150"/>
-            <Model mesh="cube.mesh" scale=0 position="10000,-200,200"/>
-            <Model mesh="cube.mesh" scale=0 position="13000,200,400"/>
-            <Model mesh="cube.mesh" scale=0 position="15000,0,0"/>
+            <Model mesh="cube.mesh" scale=0 position="11000,-200,200"/>
+            <Model mesh="cube.mesh" scale=0 position="13000,-70,350"/>
+            <Model mesh="cube.mesh" scale=0 position="15500,0,0"/>
             <Model mesh="cube.mesh" scale=0 position="18000,150,-150"/>
             <Model mesh="cube.mesh" scale=0 position="21000,200,-120"/>
             <Model mesh="cube.mesh" scale=0 position="24000,-150,-80"/>
             <Model mesh="cube.mesh" scale=0 position="27000,-200,0"/>
-            <Model mesh="cube.mesh" scale=0 position="30000,-300,900"/>
-            <Model mesh="cube.mesh" scale=0 position="33000,600,60"/>
-            <Model mesh="cube.mesh" scale=0 position="35000,120,20"/>
-            <Model mesh="cube.mesh" scale=0 position="38000,-200,0"/>
+            <Model mesh="cube.mesh" scale=0 position="30000,-250,670"/>
+            <Model mesh="cube.mesh" scale=0 position="33000,150,600"/>
+            <Model mesh="cube.mesh" scale=0 position="35000,500,300"/>
+            <Model mesh="cube.mesh" scale=0 position="38000,150,150"/>
             <Model mesh="cube.mesh" scale=0 position="41000,30,-50"/>
             <Model mesh="cube.mesh" scale=0 position="44000,90,0"/>
             <Model mesh="cube.mesh" scale=0 position="47000,120,30"/>
             <Model mesh="cube.mesh" scale=0 position="50000,0,100"/>
-            <Model mesh="cube.mesh" scale=0 position="51000,0,0"/>
+            <Model mesh="cube.mesh" scale=0 position="53000,0,0"/>
 
             
 
+
+           
+
                 </gpspoints>
         </ArrowController>
       </controller>

Modified: code/branches/RacingBots_FS18/data/levels/templates/fastship.oxt
===================================================================
--- code/branches/RacingBots_FS18/data/levels/templates/fastship.oxt	2018-05-17 14:14:35 UTC (rev 11976)
+++ code/branches/RacingBots_FS18/data/levels/templates/fastship.oxt	2018-05-17 14:24:48 UTC (rev 11977)
@@ -24,9 +24,9 @@
    stallSpeed = 220
 
 
-   boostPower            = 8  
+   boostPower            = 7.5  
    boostPowerRate        = 3
-   boostRate             = 8  
+   boostRate             = 7.5
    boostCooldownDuration = 6
 
    shakeFrequency = 50

Modified: code/branches/RacingBots_FS18/src/modules/gametypes/SpaceRace.cc
===================================================================
--- code/branches/RacingBots_FS18/src/modules/gametypes/SpaceRace.cc	2018-05-17 14:14:35 UTC (rev 11976)
+++ code/branches/RacingBots_FS18/src/modules/gametypes/SpaceRace.cc	2018-05-17 14:24:48 UTC (rev 11977)
@@ -124,7 +124,7 @@
         for (Engine* engine : ObjectList<Engine>())
         {
             engine->setActive(false);
-            engine->setAccelerationFront(100.0f);
+            engine->addSpeedMultiply(1.7);
         }
 
         //append spawn positions to bots
@@ -185,10 +185,12 @@
 
     void SpaceRace::end()
     {
+        
         this->clock_.capture();
         int s = this->clock_.getSeconds();
         int ms = static_cast<int>(this->clock_.getMilliseconds() - 1000*s);
         std::string message;
+        message = multi_cast<std::string>(s)+"You could not reach the last checkpoint before your opponents. YOU LOOSE!";
 
         if (this->bTimeIsUp_)
         {
@@ -195,13 +197,13 @@
             message = multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms) + " seconds !!\n"
                         + "You loose!";
         }
-        else if(this->bLost)
-            message = multi_cast<std::string>(s)+"You could not reach the last checkpoint before your opponents. YOU LOOSE!";
+       
         else
         {
             message = "You win!! Final check point reached after "+ multi_cast<std::string>(s)
                         + "." + multi_cast<std::string>(ms) + " seconds.";
         }
+        
         if (!this->hasEnded())
         {
             this->getGametypeInfo()->sendAnnounceMessage(message);

Modified: code/branches/RacingBots_FS18/src/modules/gametypes/SpaceRaceController.cc
===================================================================
--- code/branches/RacingBots_FS18/src/modules/gametypes/SpaceRaceController.cc	2018-05-17 14:14:35 UTC (rev 11976)
+++ code/branches/RacingBots_FS18/src/modules/gametypes/SpaceRaceController.cc	2018-05-17 14:24:48 UTC (rev 11977)
@@ -106,7 +106,14 @@
         }
         return returnVec;
     }
+    void SpaceRaceController::endtheGame() const {
+        SpaceRace* gametype = orxonox_cast<SpaceRace*>(this->getGametype());
+        assert(gametype);
+        if (!gametype)
+        return;
+        gametype->end();
 
+    }
     /*
      * called from 'findStaticCheckpoints'
      * return how many ways go from the given Checkpoint to the last Checkpoint (of the Game)
@@ -178,7 +185,7 @@
             }
 
         }
-        if(minNextRaceCheckPoint == nullptr) orxout()<<"nullptr found @181 SpaceRaceController" << endl;
+        if(minNextRaceCheckPoint == nullptr) {endtheGame(); orxout()<<"nullptr found @181 SpaceRaceController" << endl;}
         return minNextRaceCheckPoint;
     }
 
@@ -232,19 +239,31 @@
         return nextPointFind(currentRaceCheckpoint_);
     }
 
+
+
+
+    
+
     RaceCheckPoint* SpaceRaceController::findCheckpoint(int index) const
     {
+        RaceCheckPoint* res = nullptr;
         for (RaceCheckPoint* checkpoint : this->checkpoints_){
             //conclusion: index=20 is not 
             if (checkpoint->getCheckpointIndex() == index){
-                if(checkpoint == nullptr) orxout()<<"returned nullptr @line 234 SpaceRaceController"<<endl;
-                return checkpoint;
+                //if(checkpoint == nullptr) orxout()<<"returned nullptr @line 234 SpaceRaceController"<<endl;
+                orxout()<< "index of the checkpoint "<< index <<endl;
+                res = checkpoint;
+                return res;
             }
         }
+     if(index>2 )   
+        this->endtheGame();
 
-        return nullptr;
+        return res;
     }
+    
 
+
     /*RaceCheckPoint* SpaceRaceController::addVirtualCheckPoint( RaceCheckPoint* previousCheckpoint, int indexFollowingCheckPoint , const Vector3& virtualCheckPointPosition )
     {
         orxout()<<"add VCP at"<<virtualCheckPointPosition.x<<", "<<virtualCheckPointPosition.y<<", "<<virtualCheckPointPosition.z<<endl;
@@ -298,6 +317,8 @@
 
     void SpaceRaceController::tick(float dt)
     {
+        
+
         if (this->getControllableEntity() == nullptr || this->getControllableEntity()->getPlayer() == nullptr )
         {
             //orxout()<< this->getControllableEntity() << " in tick"<<endl;
@@ -360,6 +381,7 @@
         //     orxout()<<"nullptr @351 Line"<<endl;
         // }
 
+        
         this->moveToPosition(nextRaceCheckpoint_->getPosition());
 
         this->boostControl();

Modified: code/branches/RacingBots_FS18/src/modules/gametypes/SpaceRaceController.h
===================================================================
--- code/branches/RacingBots_FS18/src/modules/gametypes/SpaceRaceController.h	2018-05-17 14:14:35 UTC (rev 11976)
+++ code/branches/RacingBots_FS18/src/modules/gametypes/SpaceRaceController.h	2018-05-17 14:24:48 UTC (rev 11977)
@@ -57,6 +57,8 @@
             float distanceSpaceshipToCheckPoint(RaceCheckPoint*);
             RaceCheckPoint* nextPointFind(RaceCheckPoint*);
             RaceCheckPoint* adjustNextPoint();
+            void endtheGame() const;
+
             std::vector<RaceCheckPoint*> findStaticCheckpoints(RaceCheckPoint*, const std::vector<RaceCheckPoint*>&);
             std::vector<RaceCheckPoint*> staticCheckpoints();
             int rekSimulationCheckpointsReached(RaceCheckPoint*, std::map<RaceCheckPoint*, int>&);



More information about the Orxonox-commit mailing list