Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8923 for code


Ignore:
Timestamp:
Nov 4, 2011, 10:44:56 AM (13 years ago)
Author:
jo
Message:

Tutorial level enhancements (quest work, better texts are still needed), reverted old rocket hack, reworked configurable botlevel for the ai.

Location:
code/branches/gamecontent
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • code/branches/gamecontent/data/levels/missionOne.oxw

    r8922 r8923  
    164164
    165165<!--helper trigger to end the getHelp quest -->
    166     <DistanceTrigger name="getHelpEnd" position="-48900,0,0" distance=2000 target="SpaceShip" stayActive="false" delay=0.1>
     166    <DistanceTrigger name="getHelpEnd" position="-47000,-1000,1300" distance=1400 target="SpaceShip" stayActive="false" delay=0.1>
    167167              <EventTrigger>
    168168                <events>
     
    232232    <LocalQuest id="missionOne.basicFlying">
    233233        <QuestDescription title="Flying" description="Can you see the blinking light straight ahead? Your goal is to fly through it.
    234 Use 'W' to accelerate and steer with your mouse.
     234Use (W) to accelerate and steer with your mouse.
    235235
    236236Further flying moves:
    237 S          : break
    238 Q and E : roll
    239 Space    : boost
    240 
    241 P.S: Whenever a new quest is added you can view it by pressing F3. Quit via Esc." failmessage="" completeMessage="" />
     237break (S)
     238roll     (Q) and (E)
     239boost (Space)
     240
     241Whenever a new quest is added you can view it by pressing (F3). Quit this menu via (Esc)." failmessage="" completeMessage="" />
    242242        <complete-effects>
    243243            <AddQuest questId="missionOne.navigation" />
     
    255255
    256256            <LocalQuest id ="missionOne.weaponsystemI">
    257                 <QuestDescription title="Destroy the Boxes" description="Test your four different weapons on the four boxes. The four weapons are laser (left click), plasma (right click), self targeting rockets (middle click) and manual rockets (press 'T'). Attention if you use manual rockets: Press 'T' only once to start the rocket. If you miss your target you can get out of the rocket, by clicking or pressing 'T' once more." failmessage="" completeMessage="" />
     257                <QuestDescription title="Destroy the Boxes" description="Test your four different weapons on the four boxes:
     2581. laser (left click)
     2592. plasma (right click)
     2603. target seeking rockets (middle click)
     2614. manual rockets (T)
     262
     263Attention if you use manual rockets: Press (T) only once to start the rocket. If you miss your target you can get out of the rocket, by clicking or pressing (T) once more." failmessage="" completeMessage="" />
    258264                    <hints>
    259265                        <QuestHint id="missionOne.weaponsystem.laser">
     
    276282
    277283            <LocalQuest id="missionOne.weaponsystemII">
    278                 <QuestDescription title="Kill the pirates" description="Get rid of the patrolling pirates." failmessage="" completeMessage="" />
     284                <QuestDescription title="Kill the pirates" description="Get rid of the patrolling pirates.
     285Find out which weapon is best to tackle moving targets. Get close enough." failmessage="" completeMessage="" />
    279286                <complete-effects>
    280287                    <AddQuest questId="missionOne.DuballStation" />
     
    291298    <LocalQuest id="missionOne.getHelp">
    292299        <QuestDescription title="Get Help" description="There are several enemies approaching. You can't handle it on your own. Fortunately there's a shortcut to the next friendly unit. Use the portal (grey dot) to get near the Hydrogen Farmer.
    293         There you might get help - as far as we know there should be a stronger spaceship docked to the Hydrogen Farmer. In order to be able to use that stronger spaceship, you have to dock to the Hydrogen Farmer.
    294         Simply fly to the center of the Hydrogen Farmer, which is between its three legs." failmessage="" completeMessage="" />
     300The Hydrogen Farmer is a large spaceship with three legs.
     301There you might get help - as far as we know there should be a strong spaceruiser docked to the Hydrogen Farmer. In order to be able to use that stronger spaceship, you have to dock to the Hydrogen Farmer.
     302Simply fly to the center of the Hydrogen Farmer, which is between its three legs.
     303
     304How to dock: Accept the dialogue, take your hands off the keyboard and watch." failmessage="" completeMessage="" />
    295305        <complete-effects>
    296306            <AddQuest questId="missionOne.getHome" />
     
    300310    <LocalQuest id="missionOne.getHome">
    301311        <QuestDescription title="Return ASAP" description="So you managed to get the spacecruiser. Use the portal to return to the DuBall Space Station.
    302         Hurry! Your help is desperately needed." failmessage="" completeMessage="" />
     312Hurry! Your help is desperately needed." failmessage="" completeMessage="" />
    303313        <complete-effects>
    304314            <AddQuest questId="missionOne.defence" />
     
    307317
    308318    <LocalQuest id="missionOne.defence">
    309         <QuestDescription title="Defence" description="Seven enemies were detected that seem to launch a coordinated attack. Do not hesitate to attack or you will be the target.
    310         Always take care of the enemy that is the closest to you." failmessage="" completeMessage="Yeah! You did it." />
     319        <QuestDescription title="Defence" description="Seven enemies were detected that seem to launch a coordinated attack.
     320Do not hesitate to fight or you will be the target.
     321
     322Always take care of the enemy that is the closest to you." failmessage="" completeMessage="Yeah! You did it." />
    311323    </LocalQuest>
    312 
    313 
    314 <!-- TUTORIAL-TODO: -->
    315 <!-- 1. Flying & manoeuvring (basic flying, using pickups, forcefields, docks & portals) --> <!-- "W","S","SPACE"-->
    316 <!-- 2. Aiming & Weapons (static targets, moving targets, dangerous targets)--> <!-- 3 Mouse buttons + "T"-->
    317 <!-- 3. Game handling (quests, knowing when a game is over :-), pausing, chat, ... ) --> <!--"F3", "F2", "ESC" -->
    318 <!-- 4. Extras (other things to discover) --> <!-- "Q","E","A","D","C", "CTRL", "", ... -->
     324<!-- --------------------- END OF QUESTS -------------------------- -->
     325
    319326
    320327    <DistanceTrigger name="spawndelaytrigger0" position="800,700,600" target="Pawn" distance=10 stayActive="true" delay=2/>
    321     <SimpleNotification message="Press 'F3' to see your mission briefing.">
     328    <SimpleNotification message="Press (F3) to see your mission briefing.">
    322329        <events>
    323330            <trigger>
     
    327334    </SimpleNotification>
    328335
     336<!-- Blinking Billboard should be replaced with WAYPOINT -->
    329337<BlinkingBillboard position="-900,640,600" frequency=0.4 amplitude=2 material="Flares/lensflare" colour="1,1,0">
    330338          <events>
     
    366374
    367375    <DistanceTrigger name="flying2" position="800,700,600" target="Pawn" distance=10 stayActive="true" delay=10/>
    368     <SimpleNotification message="Use 'W' to accelerate and the mouse to steer.">
     376    <SimpleNotification message="Use (W) to accelerate and the mouse to steer.">
    369377        <events>
    370378            <trigger>
     
    529537    </SimpleNotification>
    530538
    531 
    532   <SimpleNotification message="Aim at the last target and press 'T'." broadcast="true">
     539  <SimpleNotification message="Aim at the last target and press (T)." broadcast="true">
    533540        <events>
    534541            <trigger>
     
    894901    </SpaceShip>
    895902
    896     <Billboard position="-48900,0,0" material="Examples/Flare" colour="0.6,0,0" scale=3/>
    897903    <Dock position="-48900,0,0" roll=90 yaw=180 >
    898904        <animations>
     
    914920    </Dock>
    915921
     922<!--@Objects: SpaceCruiser as docking target -->
    916923    <SpaceShip template="spaceshipspacecruiser" position="-48900,800,0" orientation="-0.14, 0.68, 0.68, 0.223" health="300" maxhealth="400" initialhealth="300" name="cruiser" >
    917924      <attached>
     
    920927    </SpaceShip>
    921928
    922 <!-- TESTBOX-->
    923 
    924 <!-- TESTBOX-->
    925929
    926930          <Trigger name="cruiserKilled" mode="and" stayActive="true">
     
    986990    </SimpleNotification>
    987991
    988     <SimpleNotification message="Press 'Esc' and restart the mission." broadcast="true">
     992    <SimpleNotification message="Press (Esc) and restart the mission." broadcast="true">
    989993        <events>
    990994            <trigger>
     
    993997        </events>
    994998    </SimpleNotification>
    995 
    996999
    9971000<!-- hydrogen farmer & docking END -->
     
    10661069    </DistanceTrigger>
    10671070
    1068     <SimpleNotification message="Return before it's too late. Boost with 'Space'." broadcast="true">
     1071    <SimpleNotification message="Return before it's too late. Boost with (Space)." broadcast="true">
    10691072        <events>
    10701073            <trigger>
     
    13381341    </EventTrigger>
    13391342
    1340     <SimpleNotification message="Either quit by pressing 'Esc' or ..." broadcast="true">
     1343    <SimpleNotification message="Either quit by pressing (Esc) or ..." broadcast="true">
    13411344      <events>
    13421345        <trigger>
     
    14081411
    14091412
    1410     <SimpleNotification message="Rotate your ship. Press 'Q' or 'E'. "  broadcast="true">
     1413    <SimpleNotification message="Rotate your ship. Press (Q) or (E). "  broadcast="true">
    14111414        <events>
    14121415            <trigger>
     
    14161419    </SimpleNotification>
    14171420
    1418     <SimpleNotification message="Switch the camera's position. Press 'C'. "  broadcast="true">
     1421    <SimpleNotification message="Switch the camera's position. Press (C). "  broadcast="true">
    14191422        <events>
    14201423            <trigger>
     
    14241427    </SimpleNotification>
    14251428
    1426     <SimpleNotification message="360° view: press 'Ctrl' + use the mouse "  broadcast="true">
     1429    <SimpleNotification message="360° view: press (Ctrl) + use the mouse "  broadcast="true">
    14271430        <events>
    14281431            <trigger>
     
    14561459    </SimpleNotification>
    14571460
    1458     <SimpleNotification message="Press 'Esc' and return to the main menu."  broadcast="true">
     1461    <SimpleNotification message="Press (Esc) and return to the main menu."  broadcast="true">
    14591462        <events>
    14601463            <trigger>
     
    14841487</Level>
    14851488<!-- TODO:
    1486 ! Quest Interface
     1489- Story & more precise Questmessages; more quest hints;
     1490- Colouring: Show who is friend or foe via the colour
     1491- Waypoints: show the player the way
    14871492- Foolproof text messages (e.g. verspätete Nachrichten unterdrücken)
    1488 - Radar visibility & Hud Markers (done)
    14891493- End Tutorial, if either the Hydrogen Farmer or the SpaceCruiser gets destroyed. (~done)
    1490 
    14911494 -->
  • code/branches/gamecontent/src/modules/weapons/projectiles/Rocket.cc

    r8891 r8923  
    6666        this->localAngularVelocity_ = 0;
    6767        this->lifetime_ = 100.0f;
    68         this->bIsRocket_= true;
    6968
    7069        if (GameMode::isMaster())
     
    135134        if(this->isInitialized())
    136135        {
    137             this->bIsRocket_= false;
    138136            if (GameMode::isMaster())
    139137            {
  • code/branches/gamecontent/src/orxonox/controllers/AIController.cc

    r8891 r8923  
    7474            }
    7575
    76             // search enemy
    77             random = rnd(maxrand);
    78             if (random < (15 + botlevel_* 20) && (!this->target_))
    79                 this->searchNewTarget();
    80 
    81             // forget enemy
    82             random = rnd(maxrand);
    83             if (random < ((1-botlevel_)*6) && (this->target_))
    84                 this->forgetTarget();
    85 
    86             // next enemy
    87             random = rnd(maxrand);
    88             if (random < (botlevel_*20) && (this->target_))
    89                 this->searchNewTarget();
    90 
    91             // fly somewhere
    92             random = rnd(maxrand);
    93             if (random < 50 && (!this->bHasTargetPosition_ && !this->target_))
    94                 this->searchRandomTargetPosition();
    95 
    96             // stop flying
    97             random = rnd(maxrand);
    98             if (random < 10 && (this->bHasTargetPosition_ && !this->target_))
    99                 this->bHasTargetPosition_ = false;
    100 
    101             // fly somewhere else
    102             random = rnd(maxrand);
    103             if (random < 30 && (this->bHasTargetPosition_ && !this->target_))
    104                 this->searchRandomTargetPosition();
    105 
    106             // shoot
    107             random = rnd(maxrand);
    108             if (!(this->passive_) && random < (75 + botlevel_*25) && (this->target_ && !this->bShooting_))
    109                 this->bShooting_ = true;
    110 
    111             // stop shooting
    112             random = rnd(maxrand);
    113             if (random < ((1 - botlevel_)*25) && (this->bShooting_))
    114                 this->bShooting_ = false;
    115 
    116             // boost
    117             random = rnd(maxrand);
    118             if (random < botlevel_*100 )
    119                 this->boostControl();
    120 
    121             // update Checkpoints
    122             /*random = rnd(maxrand);
    123             if (this->defaultWaypoint_ && random > (maxrand-10))
    124                 this->manageWaypoints();
    125             else //if(random > maxrand-10) //CHECK USABILITY!!*/
    126             if (this->waypoints_.size() == 0 )
    127                 this->manageWaypoints();
    128 
     76            this->defaultBehaviour(maxrand);
    12977        }
    13078
     
    13684        if (this->state_ == MASTER)
    13785        {
    138 
    139 
    14086            this->commandSlaves();
    14187
     
    170116                    this->searchNewMaster();
    171117
    172                 // search enemy
    173                 random = rnd(maxrand);
    174                 if (random < (botlevel_)*25 && (!this->target_))
    175                     this->searchNewTarget();
    176 
    177                 // forget enemy
    178                 random = rnd(maxrand);
    179                 if (random < (1-botlevel_)*6 && (this->target_))
    180                     this->forgetTarget();
    181 
    182                 // next enemy
    183                 random = rnd(maxrand);
    184                 if (random < 10 && (this->target_))
    185                     this->searchNewTarget();
    186 
    187                 // fly somewhere
    188                 random = rnd(maxrand);
    189                 if (random < 50 && (!this->bHasTargetPosition_ && !this->target_))
    190                     this->searchRandomTargetPosition();
    191 
    192 
    193                 // fly somewhere else
    194                 random = rnd(maxrand);
    195                 if (random < 30 && (this->bHasTargetPosition_ && !this->target_))
    196                     this->searchRandomTargetPosition();
    197 
    198                 // shoot
    199                 random = rnd(maxrand);
    200                 if (!(this->passive_) && random < 25*(botlevel_)+1 && (this->target_ && !this->bShooting_))
    201                 {
    202                     this->bShooting_ = true;
    203                     this->forceFreeSlaves();
    204                 }
    205 
    206                 // stop shooting
    207                 random = rnd(maxrand);
    208                 if (random < ( (1- botlevel_)*25 ) && (this->bShooting_))
    209                     this->bShooting_ = false;
    210 
    211                 // boost
    212                 random = rnd(maxrand);
    213                 if (random < botlevel_*100 )
    214                     this->boostControl();
    215 
    216                 // update Checkpoints
    217                 /*random = rnd(maxrand);
    218                 if (this->defaultWaypoint_ && random > (maxrand-10))
    219                     this->manageWaypoints();
    220                 else //if(random > maxrand-10) //CHECK USABILITY!!*/
    221                 if (this->waypoints_.size() == 0 )
    222                     this->manageWaypoints();
     118                this->defaultBehaviour(maxrand);
    223119            }
    224120        }
    225 
    226121    }
    227122
     
    321216        {   //Vector-implementation: mode_.back() == ROCKET;
    322217            if(controllable)
    323             {
    324                 if(controllable->getRocket())//Check wether the bot is controlling the rocket and if the timeout is over.
     218            {//Check wether the bot is controlling the rocket and if the timeout is over.
     219                if(controllable->getIdentifier() == ClassByString("Rocket"))
     220
    325221                {
    326222                    this->follow();
     
    342238    }
    343239
     240    void AIController::defaultBehaviour(float maxrand)
     241    {       float random;
     242            // search enemy
     243            random = rnd(maxrand);
     244            if (random < (botlevel_* 100) && (!this->target_))
     245                this->searchNewTarget();
     246
     247            // forget enemy
     248            random = rnd(maxrand);
     249            if (random < ((1-botlevel_)*20) && (this->target_))
     250                this->forgetTarget();
     251
     252            // next enemy
     253            random = rnd(maxrand);
     254            if (random < (botlevel_*30) && (this->target_))
     255                this->searchNewTarget();
     256
     257            // fly somewhere
     258            random = rnd(maxrand);
     259            if (random < 50 && (!this->bHasTargetPosition_ && !this->target_))
     260                this->searchRandomTargetPosition();
     261
     262            // stop flying
     263            random = rnd(maxrand);
     264            if (random < 10 && (this->bHasTargetPosition_ && !this->target_))
     265                this->bHasTargetPosition_ = false;
     266
     267            // fly somewhere else
     268            random = rnd(maxrand);
     269            if (random < 30 && (this->bHasTargetPosition_ && !this->target_))
     270                this->searchRandomTargetPosition();
     271
     272            if (this->state_ == MASTER) // master: shoot
     273            {
     274                random = rnd(maxrand);
     275                if (!(this->passive_) && random < (100*botlevel_) && (this->target_ && !this->bShooting_))
     276                {
     277                    this->bShooting_ = true;
     278                    this->forceFreeSlaves();
     279                }
     280            }
     281            else
     282            {
     283                // shoot
     284                random = rnd(maxrand);
     285                if (!(this->passive_) && random < (botlevel_*100) && (this->target_ && !this->bShooting_))
     286                    this->bShooting_ = true;
     287            }
     288
     289            // stop shooting
     290            random = rnd(maxrand);
     291            if (random < ((1 - botlevel_)*50) && (this->bShooting_))
     292                this->bShooting_ = false;
     293
     294            // boost
     295            random = rnd(maxrand);
     296            if (random < botlevel_*50 )
     297                this->boostControl();
     298
     299            // update Checkpoints
     300            /*random = rnd(maxrand);
     301            if (this->defaultWaypoint_ && random > (maxrand-10))
     302                this->manageWaypoints();
     303            else //if(random > maxrand-10) //CHECK USABILITY!!*/
     304            if (this->waypoints_.size() == 0 )
     305                this->manageWaypoints();
     306    }
     307
    344308}
  • code/branches/gamecontent/src/orxonox/controllers/AIController.h

    r8729 r8923  
    4444            virtual ~AIController();
    4545
    46             virtual void tick(float dt);
     46            virtual void tick(float dt); //<! Carrying out the targets set in action().
    4747
    4848        protected:
    49             virtual void action();
     49            virtual void action(); //<! action() is called in regular intervals managing the bot's behaviour ~ setting targets.
     50            void defaultBehaviour(float maxrand); //<! Helper function for code reusage. Some concrete commands for a bot.
    5051
    5152        private:
    5253            static const float ACTION_INTERVAL;
    5354
    54             Timer actionTimer_;
     55            Timer actionTimer_; //<! Regularly calls action().
    5556    };
    5657}
  • code/branches/gamecontent/src/orxonox/controllers/ArtificialController.cc

    r8909 r8923  
    9292        this->target_.setCallback(createFunctor(&ArtificialController::targetDied, this));
    9393        this->bSetupWorked = false;
    94         this->botlevel_ = 0.2f;
     94        this->botlevel_ = 0.5f;
    9595        this->mode_ = DEFAULT;////Vector-implementation: mode_.push_back(DEFAULT);
    9696        this->timeout_ = 0;
  • code/branches/gamecontent/src/orxonox/gametypes/Mission.cc

    r8904 r8923  
    2828
    2929#include "Mission.h"
    30 //#inclued "TeamGametype.h"
     30//#include "TeamGametype.h"
     31#include "items/Engine.h"
    3132
    3233#include "core/CoreIncludes.h"
     
    7071        Gametype::start();
    7172
    72 
     73        /*for (ObjectList<Engine>::iterator it = ObjectList<Engine>::begin(); it != ObjectList<Engine>::end(); ++it)
     74            it->setActive(false); // works -> @sr :*/
    7375        this->gtinfo_->sendAnnounceMessage("Your mission has started!");
    7476    }
  • code/branches/gamecontent/src/orxonox/gametypes/Mission.h

    r8904 r8923  
    4949            inline void setLives(unsigned int amount)
    5050                {this->lives_ = amount;}
    51             inline unsigned int getLives()
     51            inline unsigned int getLives()
    5252                {return this->lives_;}
    5353
  • code/branches/gamecontent/src/orxonox/gametypes/TeamGametype.cc

    r8904 r8923  
    4444
    4545        this->teams_ = 2;
     46        this->allowFriendlyFire_ = false;
    4647
    4748        this->setConfigValues();
     
    104105
    105106    bool TeamGametype::allowPawnHit(Pawn* victim, Pawn* originator)
    106     {
    107         return (!this->pawnsAreInTheSameTeam(victim, originator) || !originator);
     107    {// hit allowed: if victim & originator are foes or if originator doesnot exist or if friendlyfire is allowed
     108        return (!this->pawnsAreInTheSameTeam(victim, originator) || !originator || this->allowFriendlyFire_);
    108109    }
    109110
    110111    bool TeamGametype::allowPawnDamage(Pawn* victim, Pawn* originator)
    111112    {
    112         return (!this->pawnsAreInTheSameTeam(victim, originator) || !originator);
     113        return (!this->pawnsAreInTheSameTeam(victim, originator) || !originator || this->allowFriendlyFire_);
    113114    }
    114115
    115116    bool TeamGametype::allowPawnDeath(Pawn* victim, Pawn* originator)
    116117    {
    117         return (!this->pawnsAreInTheSameTeam(victim, originator) || !originator);
     118        return (!this->pawnsAreInTheSameTeam(victim, originator) || !originator || this->allowFriendlyFire_);
    118119    }
    119120
  • code/branches/gamecontent/src/orxonox/gametypes/TeamGametype.h

    r8904 r8923  
    6565            bool pawnsAreInTheSameTeam(Pawn* pawn1, Pawn* pawn2);
    6666
     67            bool allowFriendlyFire_; //<! friendlyfire is per default switched off: friendlyFire_ = false;
    6768            std::map<PlayerInfo*, int> teamnumbers_;
    6869            std::vector<ColourValue> teamcolours_;
  • code/branches/gamecontent/src/orxonox/worldentities/ControllableEntity.cc

    r8891 r8923  
    7474        this->bMouseLook_ = false;
    7575        this->mouseLookSpeed_ = 200;
    76         this->bIsRocket_ = false;
    7776
    7877        this->server_position_         = Vector3::ZERO;
  • code/branches/gamecontent/src/orxonox/worldentities/ControllableEntity.h

    r8891 r8923  
    163163                { return this->target_.get(); }
    164164            void setTargetInternal( uint32_t targetID );
    165             inline bool getRocket() const
    166                 { return this-> bIsRocket_; }
    167165
    168166        protected:
     
    183181
    184182            Ogre::SceneNode* cameraPositionRootNode_;
    185             bool bIsRocket_; //Workaround to see, if the controllable entity is a Rocket.
    186183
    187184        private:
Note: See TracChangeset for help on using the changeset viewer.