Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 23, 2017, 2:56:00 PM (7 years ago)
Author:
patricwi
Message:

reset back in time

Location:
code/branches/HUD_HS16
Files:
1 deleted
15 edited
4 copied

Legend:

Unmodified
Added
Removed
  • code/branches/HUD_HS16

  • code/branches/HUD_HS16/src/modules/CMakeLists.txt

    r11497 r11499  
    2626################ Sub Directories ################
    2727
    28 ADD_SUBDIRECTORY(dialogue)
    2928ADD_SUBDIRECTORY(designtools)
    30 ADD_SUBDIRECTORY(dialogue)
    3129ADD_SUBDIRECTORY(gametypes)
    3230ADD_SUBDIRECTORY(notifications)
     
    4644ADD_SUBDIRECTORY(dodgerace)
    4745ADD_SUBDIRECTORY(hover)
    48 ADD_SUBDIRECTORY(superorxobros)
  • code/branches/HUD_HS16/src/modules/dialogue/CMakeLists.txt

    r11395 r11499  
    11SET_SOURCE_FILES(DIALOGUE_SRC_FILES
    22  DialogueManager.cc
     3  NextQuestion.cc
    34 
    45)
     
    78  MODULE
    89  FIND_HEADER_FILES
     10   TOLUA_FILES
     11    DialogueManager.h
    912  LINK_LIBRARIES
    1013    orxonox
    1114  SOURCE_FILES ${DIALOGUE_SRC_FILES}
    1215)
     16
  • code/branches/HUD_HS16/src/modules/dodgerace/DodgeRace.cc

    r11497 r11499  
    3636#include "DodgeRaceCube.h"
    3737#include "core/CoreIncludes.h"
    38 #include "Highscore.h"
    3938
    4039namespace orxonox
     
    225224        // It will misteriously crash the game!
    226225        // Instead startMainMenu, this won't crash.
    227         if (Highscore::exists()){
    228                     int score = this->getPoints();
    229                     if(score > Highscore::getInstance().getHighestScoreOfGame("Dodge Race"))
    230                         Highscore::getInstance().storeHighscore("Dodge Race",score);
    231 
    232           }
    233226        GSLevel::startMainMenu();
    234227    }
  • code/branches/HUD_HS16/src/modules/gametypes/CMakeLists.txt

    r11497 r11499  
    33  RaceCheckPoint.cc
    44  SpaceRaceManager.cc
    5 
     5  OldSpaceRace.cc
     6  OldRaceCheckPoint.cc
    67  SpaceRaceBot.cc
    78  SpaceRaceController.cc
  • code/branches/HUD_HS16/src/modules/gametypes/SpaceRace.cc

    r11497 r11499  
    2323 *     Mauro Salomon
    2424 *   Co-authors:
    25  *      Celine Egger*/
    26        
    27 
    28 
    29 
    30 /*
    31 Edited, Renewed and Revised by
    32         Berkay Berabi
    33         Louis Meile
    34  
    35  
    36 To-do- list by Louis Meile and Berkay Berabi for future projects :
    37 - improve AI (SpaceRaceController):
    38 i) so far bots arent able to evade obstacles. fix that!
    39 ii) bots should be able to use pickups
    40 - game crashes when bot wins the game(this is a huge problem you should work with the log file to find out what the errors are )
    41 - bots rotate while waiting for the countdown to end. make it stop!
    42 - add elements to level file to make it even more fun to play. be creative!
    43 */
    44 
     25 *      Celine Egger
     26 *
     27 */
    4528
    4629#include "SpaceRace.h"
    4730
    48 #include "core/CoreIncludes.h"
    49 #include "chat/ChatManager.h"
    50 #include "util/Convert.h"
    51 #include "util/Math.h"
    52 #include "infos/Bot.h"
    53 #include "items/Engine.h"
    54 #include "controllers/HumanController.h"
    55 
    56 #include "core/CoreIncludes.h"
    57 #include "chat/ChatManager.h"
    58 #include "infos/PlayerInfo.h"
    59 #include "worldentities/pawns/Pawn.h"
    60 #include "core/config/ConfigValueIncludes.h"
    61 #include "infos/Bot.h"
    62 #include "SpaceRaceBot.h"
    6331#include "items/Engine.h"
    6432
     
    6937#include "SpaceRaceBot.h"
    7038#include "items/Engine.h"
    71 #include <vector>
    72 
    7339
    7440namespace orxonox
     
    8046        RegisterObject(SpaceRace);
    8147
    82         this->botclass_ = Class(SpaceRaceBot); //ClassByString("")
     48        this->botclass_ = Class(SpaceRaceBot);//ClassByString("")
    8349        this->cantMove_ = false;
    8450        this->bTimeIsUp_ = false;
    85         this->setConfigValues();
    86 
    87         this->numberOfBots_ = 5; // quick fix: don't allow default-bots to enter the race
    88         //we fixed the number of bots in order to have the same starting position all the time !
     51        this->numberOfBots_ = 0; // quick fix: don't allow default-bots to enter the race
     52                                 // remove this line, if a raceBot has been created.
    8953    }
    90 
    91   void SpaceRace::setConfigValues()
    92     {
    93        
    94    
    95     }
    96 
    97     void SpaceRace::start()
    98     {
    99     // define spawn positions of the 5 bots
    100 
    101         int startpos[15];
    102        
    103         startpos[0] =100;
    104         startpos[1] =-40;
    105         startpos[2] =0;
    106        
    107         startpos[3] =100;
    108         startpos[4] =-40;
    109         startpos[5] =100;
    110        
    111         startpos[6] =100;
    112         startpos[7] =-40;
    113         startpos[8] =-100;
    114        
    115         startpos[9] =0;
    116         startpos[10] =-40;
    117         startpos[11] =-80;
    118        
    119         startpos[12] =0;
    120         startpos[13] =-40;
    121         startpos[14] =80;
    122        
    123 
    124 
    125 
    126         Gametype::start();
    127    if (true)
    128         {
    129             this->spawnPlayersIfRequested();
    130             this->cantMove_ = true;
    131             //players are unable to move while countdown is running
    132             for (Engine* engine : ObjectList<Engine>()){
    133                 engine->setActive(false);
    134                
    135 
    136             }
    137            //append spawn positions to bots
    138            int a,b,c;
    139             a=0;
    140             b=1;
    141             c=2;
    142               for (SpaceRaceBot* bot : ObjectList<SpaceRaceBot>()){
    143                 bot->getControllableEntity()->setPosition(startpos[a],startpos[b],startpos[c]);
    144                a= a+3;
    145                b = b+3;
    146                c+= 3;
    147             }
    148 
    149 
    150         }
    151 
    152                                                
    153 
    154         std::string message("Use headphones to hear the countdown!");
    155         this->getGametypeInfo()->sendAnnounceMessage(message);
    156         ChatManager::message(message);
    157 
    158 //after 11 seconds , countdownFinished function is called to activate bots` engines
    159 Timer* countdownTimer = new Timer();
    160         countdownTimer->setTimer(11, false, createExecutor(createFunctor(&SpaceRace::countdownFinished, this)));
    161     }
    162 
    163 
    164 
    16554
    16655    void SpaceRace::end()
     
    17463        {
    17564            message = multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms) + " seconds !!\n"
    176                         + "You lose!";
     65                        + "You didn't reach the check point  before the time limit. You lose!";
    17766        }
    17867        else
    17968        {
    180             message = "You win!! Final check point reached after "+ multi_cast<std::string>(s)
     69            message = "You win!! You have reached the last check point after "+ multi_cast<std::string>(s)
    18170                        + "." + multi_cast<std::string>(ms) + " seconds.";
    18271        }
     
    18978    }
    19079
    191 
    192 void SpaceRace::tick(float dt)
     80    void SpaceRace::tick(float dt)
    19381    {
    19482        SUPER(SpaceRace,tick,dt);
    195 }
     83
     84        // spawn the players already when the countdown starts, but deactivate their engines
     85        if (this->isStartCountdownRunning() && !this->cantMove_)
     86        {
     87            this->spawnPlayersIfRequested();
     88            this->cantMove_ = true;
     89
     90            for (Engine* engine : ObjectList<Engine>())
     91                engine->setActive(false);
     92        }
     93
     94        // activate the engines again if the countdown ends
     95        if (!this->isStartCountdownRunning() && this->cantMove_)
     96        {
     97            for (Engine* engine : ObjectList<Engine>())
     98                engine->setActive(true);
     99
     100            this->cantMove_= false;
     101
     102            std::string message = "The match has started! Reach the check points as quickly as possible!";
     103            this->getGametypeInfo()->sendAnnounceMessage(message);
     104            ChatManager::message(message);
     105        }
     106    }
    196107
    197108    void SpaceRace::newCheckpointReached(RaceCheckPoint* checkpoint, PlayerInfo* player)
     
    203114        int ms = this->clock_.getMilliseconds() % 1000;
    204115
    205        
    206    
    207         const std::string& message = player->getName() + " reached the checkpoint " + multi_cast<std::string>(checkpoint->getCheckpointIndex() + 1)
    208         + "after " + multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms) + " seconds.";
    209  this->getGametypeInfo()->sendAnnounceMessage(message);
    210         ChatManager::message(message);
    211 
    212     }
    213 
    214  void SpaceRace::countdownFinished()//activates the engines of all players
    215     {
    216 
    217         std::string message("RACE STARTED ");
     116        const std::string& message = "Checkpoint " + multi_cast<std::string>(checkpoint->getCheckpointIndex() + 1)
     117            + " reached after " + multi_cast<std::string>(s) + "." + multi_cast<std::string>(ms) + " seconds.";
    218118        this->getGametypeInfo()->sendAnnounceMessage(message);
    219         ChatManager::message(message);
    220 
    221 
    222     for (Engine* engine : ObjectList<Engine>())
    223                 engine->setActive(true);
    224 
    225 
    226    
    227 }
    228 
    229  void SpaceRace::playerEntered(PlayerInfo* player)
    230     {
    231         Gametype::playerEntered(player);
    232 
    233         const std::string& message = player->getName() + " entered the game";
    234119        ChatManager::message(message);
    235120    }
    236121
    237 
    238  void SpaceRace::addBots(unsigned int amount) //function that add the bots to the game
    239     {
    240         for (unsigned int i = 1; i <= amount; ++i){
    241             this->botclass_.fabricate(this->getContext());
    242         }
    243     }
    244 
    245 
    246 //set bot configurations
    247122    bool SpaceRace::allowPawnHit(Pawn* victim, Pawn* originator)
    248123    {
    249         return true;
     124        return false;
    250125    }
    251126
    252127    bool SpaceRace::allowPawnDamage(Pawn* victim, Pawn* originator)
    253128    {
    254         return true;
     129        return false;
    255130    }
    256131
    257     bool SpaceRace::allowPawnDeath(Pawn* victim, Pawn* originator)// false because the bots can not recognize the objects and die to early
    258                                                                     //if they can
     132    bool SpaceRace::allowPawnDeath(Pawn* victim, Pawn* originator)
    259133    {
    260134        return false;
  • code/branches/HUD_HS16/src/modules/gametypes/SpaceRace.h

    r11497 r11499  
    5757            virtual ~SpaceRace() {}
    5858
    59              void setConfigValues();
     59            virtual void tick(float dt) override;
    6060
    61             virtual void tick(float dt) override;
    62             virtual void start() override;
    6361            virtual void end() override;
    64  virtual void countdownFinished();
    65              virtual void addBots(unsigned int amount) override; //<! overwrite function in order to bypass the addbots command.
    66 
    67 
    68 
    69              virtual void playerEntered(PlayerInfo* player) override;
    70 
    71             //virtual void newCheckpointReached();
    7262
    7363            void newCheckpointReached(RaceCheckPoint* checkpoint, PlayerInfo* player);
    74            
    75 
    76 
    7764            inline RaceCheckPoint* getCheckpointReached(PlayerInfo* player)
    7865                { return this->checkpointReached_[player]; }
  • code/branches/HUD_HS16/src/modules/gametypes/SpaceRaceBot.cc

    r11497 r11499  
    2323 *      Author: purgham
    2424 */
    25 #include <vector>
    2625
    2726#include "SpaceRaceBot.h"
    28 #include "core/GameMode.h"
    2927#include "core/CoreIncludes.h"
    30 #include "core/config/ConfigValueIncludes.h"
    31 #include "gametypes/Gametype.h"
    32 #include "controllers/AIController.h"
    33 #include "gametypes/SpaceRaceController.h"
    34 
    35 
    36 
    3728
    3829namespace orxonox
     
    4435        this->defaultController_ = Class(SpaceRaceController);// ClassByString("")
    4536        this->createController();
    46 
    47     }
    48 
    49 SpaceRaceBot::~SpaceRaceBot(){
    50 
    51 }
    52 
    53 void SpaceRaceBot::setConfigValues()
    54     {
    55         static const std::string names[] =
    56         {
    57             "Dr. Julius No",
    58             "Berkay Berabi",
    59             "Louis Meile"         
    60             "Yo mama"
    61         };
    62         static std::vector<std::string> defaultnames(names, names + sizeof(names) / sizeof(std::string));
    63 
    64         SetConfigValue(names_, defaultnames);
    6537    }
    6638}
  • code/branches/HUD_HS16/src/modules/gametypes/SpaceRaceBot.h

    r11497 r11499  
    3030#include "gametypes/GametypesPrereqs.h"
    3131#include "gametypes/SpaceRaceController.h"
    32 #include <vector>
    3332
    3433
     
    3635{
    3736
     37    /**
     38
     39    */
    3840    class _GametypesExport SpaceRaceBot: public Bot
    3941    {
    4042        public:
    41                 SpaceRaceBot(Context* context);
    42             virtual ~SpaceRaceBot();
    43    
    44             void setConfigValues();
    45 
    46 
    47 
    48  virtual inline bool isInitialized() const override
    49                 { return true; }
    50             virtual inline float getPing() const override
    51                 { return 0; }
    52             virtual inline float getPacketLossRatio() const override
    53                 { return 0; }
    54 
    55 
    56   private:
    57             std::vector<std::string> names_;
    58 
    59 
     43        SpaceRaceBot(Context* context);
     44            virtual ~SpaceRaceBot() {}
    6045    };
    6146}
  • code/branches/HUD_HS16/src/modules/gametypes/SpaceRaceController.cc

    r11497 r11499  
    1616 *   GNU General Public License for more details.
    1717 *
    18  *   You should have     a copy of the GNU General Public License
     18 *   You should have received a copy of the GNU General Public License
    1919 *   along with this program; if not, write to the Free Software
    2020 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
     
    5858        OrxAssert(!checkpoints.empty(), "No Checkpoints in Level");
    5959        checkpoints_ = checkpoints;
     60        /*orxout()<<"es gibt: "<<checkpoints_.size()<<"checkpoints"<<endl;
     61        for(std::vector<RaceCheckPoint*>::iterator it=checkpoints_.begin(); it!=checkpoints_.end(); it++)
     62        {
     63            orxout()<<"Checkpoint "<<(*it)->getCheckpointIndex()<<"; NExtReal: ";
     64            std::set<int> temp =(*it)->getNextCheckpoints();
     65            for (std::set<int>::iterator ii =temp.begin(); ii!=temp.end(); ii++)
     66            {
     67                orxout()<<(*ii)<<", ";
     68            }
     69
     70            orxout()<<" NextVirtual: ";
     71            temp=(*it)->getVirtualNextCheckpoints();
     72            for (std::set<int>::iterator ii =temp.begin(); ii!=temp.end(); ii++)
     73            {
     74                orxout()<<(*ii)<<", ";
     75            }
     76            orxout()<<endl<<endl;
     77
     78        }//ausgabe*/
     79        /*
     80        for (std::vector<RaceCheckPoint*>::iterator it = checkpoints.begin(); it != checkpoints.end(); ++it)
     81        {
     82            std::set<int> nextCheckPoints = ((*it)->getNextCheckpoints());
     83            if(!nextCheckPoints.empty())
     84            {
     85                for (std::set<int>::iterator numb = nextCheckPoints.begin(); numb!=nextCheckPoints.end(); numb++)
     86                {
     87                    RaceCheckPoint* point2 = findCheckpoint((*numb));
     88
     89                    //if(point2 != nullptr)
     90                    //placeVirtualCheckpoints((*it), point2);
     91                }
     92            }
     93        }
     94        */
     95        /*
     96        for(std::vector<RaceCheckPoint*>::iterator it=checkpoints_.begin(); it!=checkpoints_.end(); it++)
     97        {
     98            orxout()<<"Checkpoint "<<(*it)->getCheckpointIndex()<<"; NExtReal: ";
     99            std::set<int> temp =(*it)->getNextCheckpoints();
     100            for (std::set<int>::iterator ii =temp.begin(); ii!=temp.end(); ii++)
     101            {
     102                orxout()<<(*ii)<<", ";
     103            }
     104
     105            orxout()<<" NextVirtual: ";
     106            temp=(*it)->getVirtualNextCheckpoints();
     107            for (std::set<int>::iterator ii =temp.begin(); ii!=temp.end(); ii++)
     108            {
     109                orxout()<<(*ii)<<", ";
     110            }
     111            orxout()<<endl;
     112
     113        }//ausgabe
     114        orxout()<<"es gibt: "<<checkpoints_.size()<<"checkpoints"<<endl;*/
    60115        staticRacePoints_ = findStaticCheckpoints(nextRaceCheckpoint_, checkpoints);
    61116        // initialisation of currentRaceCheckpoint_
     
    67122            continue;
    68123        }
     124        //orxout()<<"Die ANzahl der virtuellen CP betraegt: "<< (-i)-2<<endl;
    69125
    70126    }
     
    169225                minNextRaceCheckPoint = nextRaceCheckPoint;
    170226            }
    171 
    172227        }
    173228
     
    308363            //orxout()<< "CP "<< currentRaceCheckpoint_->getCheckpointIndex()<<" chanched to: "<< nextRaceCheckpoint_->getCheckpointIndex()<<endl;
    309364        }
    310 
    311365        else if ((lastPositionSpaceship-this->getControllableEntity()->getPosition()).length()/dt > ADJUSTDISTANCE)
    312366        {
     
    326380        //orxout(user_status) << "dt= " << dt << ";  distance= " << (lastPositionSpaceship-this->getControllableEntity()->getPosition()).length() <<std::endl;
    327381        lastPositionSpaceship = this->getControllableEntity()->getPosition();
    328        
    329 this->boostControl();
    330382        this->moveToPosition(nextRaceCheckpoint_->getPosition());
    331         this->boostControl();
    332383    }
    333384
  • code/branches/HUD_HS16/src/modules/invader/Invader.cc

    r11497 r11499  
    3333
    3434#include "Invader.h"
    35 #include "Highscore.h"
     35
    3636#include "core/CoreIncludes.h"
    3737#include "core/EventIncludes.h"
     
    189189        // It will misteriously crash the game!
    190190        // Instead startMainMenu, this won't crash.
    191         if (Highscore::exists()){
    192                     int score = this->getPoints();
    193                     if(score > Highscore::getInstance().getHighestScoreOfGame("Orxonox Arcade"))
    194                         Highscore::getInstance().storeHighscore("Orxonox Arcade",score);
    195 
    196           }
    197191        GSLevel::startMainMenu();
    198192    }
  • code/branches/HUD_HS16/src/modules/jump/Jump.cc

    r11497 r11499  
    3434#include "Jump.h"
    3535#include "core/CoreIncludes.h"
    36 #include "Highscore.h"
    3736
    3837#include "JumpCenterpoint.h"
     
    312311        cleanup();
    313312        GSLevel::startMainMenu();
    314         if (Highscore::exists()){
    315                     int score = this->getScore(this->getPlayer());
    316                     if(score > Highscore::getInstance().getHighestScoreOfGame("Jump"))
    317                         Highscore::getInstance().storeHighscore("Jump",score);
    318 
    319           }
     313
    320314        Deathmatch::end();
    321315    }
  • code/branches/HUD_HS16/src/modules/pickup/DDDialogue.cc

    r11395 r11499  
    99    RegisterClass(DDDialogue);
    1010
    11 
    1211    /**
    1312    @brief
     
    1918    }
    2019
    21     //getResponses
    2220
    2321    bool DDDialogue::execute(bool bTriggered, BaseObject* trigger)
    2422    { 
    2523        if(!bTriggered) return false;
    26 
    27        
    2824
    2925        orxout() << "bTriggered is " << bTriggered;
     
    4945        XMLPortEventSink(DDDialogue, BaseObject, "execute", execute, xmlelement, mode);
    5046    }
    51 
    52 
    5347}
  • code/branches/HUD_HS16/src/modules/tetris/Tetris.cc

    r11497 r11499  
    3939
    4040#include "Tetris.h"
    41 #include "Highscore.h"
    4241
    4342#include "core/CoreIncludes.h"
     
    328327            this->player_->stopControl();
    329328        }
    330          if (Highscore::exists()){
    331                     int score = this->getScore(this->getPlayer());
    332                     if(score > Highscore::getInstance().getHighestScoreOfGame("Tetris"))
    333                         Highscore::getInstance().storeHighscore("Tetris",score);
    334 
    335           }
     329
    336330        this->cleanup();
    337331
  • code/branches/HUD_HS16/src/modules/towerdefense/TowerDefense.cc

    r11497 r11499  
    8181#include "chat/ChatManager.h"
    8282#include "core/CoreIncludes.h"
    83 #include "Highscore.h"
    8483
    8584namespace orxonox
     
    198197    void TowerDefense::end()
    199198    {
    200         if (Highscore::exists()){
    201                     int score = this->getWaveNumber();
    202                     if(score > Highscore::getInstance().getHighestScoreOfGame("Tower Defense"))
    203                         Highscore::getInstance().storeHighscore("Tower Defense",score);
    204 
    205           }
     199
    206200        TeamDeathmatch::end();
    207201        ChatManager::message("Match is over! Gameover!");
Note: See TracChangeset for help on using the changeset viewer.