Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changes between Version 1 and Version 2 of code/GametypeCreation


Ignore:
Timestamp:
Apr 13, 2010, 11:31:23 PM (15 years ago)
Author:
jo
Comment:

learning wikisyntax :-) should look more beautiful now

Legend:

Unmodified
Added
Removed
Modified
  • code/GametypeCreation

    v1 v2  
    1 =How to create a new gametype=
     1= How to create a new gametype =
    22
    33I just want to share my experiences from creating Dynamicmatch as a c++ and orxonox newbie. Creating a new gametype is not very difficult - although you produce valuable content for Orxonox.
    44
    5 ==Where are the concerning source files?==
    6 ../src/orxonox/gametypes[[BR]]
     5== Where are the concerning source files? ==
     6__../src/orxonox/gametypes__[[BR]]
    77All gametypes are stored in this folder. The most important source files are Gametype.<cc/h> All gametypes inherit the Gametype class. So most of your coding work is just to rewrite some functions.
    88
    9 ==Strategy==
    10 Don't reinvent the wheel - try to copy and modify as much code from other gametypes as possible.
    11 #Know what kind of gametype you want to create.
    12 #Play existing gametypes and check which parts you want to adopt.
    13 #Search in the concerning source files for code you can adopt.
    14 #Start with the basic concept and add features later. (A Todo-List for the features would be nice.)
     9== Strategy ==
     10Don't reinvent the wheel - try to copy and modify as much code from other gametypes as possible.[[BR]]
     111. Know what kind of gametype you want to create.[[BR]]
     122. Play existing gametypes and check which parts you want to adopt.[[BR]]
     133. Search in the concerning source files for code you can adopt.[[BR]]
     144. Start with the basic concept and add features later. (A Todo-List for the features would be nice.)[[BR]]
    1515
    16 ==Gametype-Level==
    17 *Level are stored in "../data/levels". You need a level to test your gametype.
    18 *For testing purposes just copy an existing Level and rename it.
    19 *Don't forget to set "gametype = YourGameType" in the <level> tag.
    20 *Put "create a level for my new gametype" on your todo list :-) Later you should try to create a level that is optimized for your new gametype.
     16== Gametype-Level ==
     17 * Level are stored in __../data/levels__. You need a level to test your gametype.
     18 * For testing purposes just copy an existing level and rename it.
     19 * Don't forget to set __gametype = YourGameType__ in the __<level>__ tag.
     20 * Put "create a level for my new gametype" on your todo list :-) Later you should try to create a level that is optimized for your new gametype.
    2121
    22 ==Change the AI-behaviour==
    23 *The concerning file is in "../src/orxonox/controllers", called "ArtificialController.cc".
    24 *You can make the bots stop shooting at certain targets by adding some lines of code in the "bool ArtificialController::sameTeam"-function as displayed above. The function should return true, if a bot shouldn't attack a certain target. (Since the AI-player is in the same "team".)
     22== Change the AI-behaviour ==
     23 * The concerning file is in __../src/orxonox/controllers__, called "ArtificialController.cc".
     24 * You can make the bots stop shooting at certain targets by adding some lines of code in the "bool ArtificialController::sameTeam"-function as displayed above. The function should return true, if a bot shouldn't attack a certain target. (Since the AI-player is in the same "team".)
    2525
    26 ==Miscellaneous==
    27 *Don't forget to add your gametype to the CMakeLists.txt or it won't compile.
    28 *Compiling with the terminal. Go to the folder of your orxonox branch. The command for compiling is
    29 {{{
    30 cmake -j3}
    31 }}.
    32 *Don't forget to backup your code via svn. Open a terminal, go to your orxonox branch-folder and type
    33 {{{
    34 svn ci -m "reason for commitment or summary of latest changes"
    35 }}} .
    36 *Gamecommands: to add 2 new bots enter "addbots 2", to remove one of them enter "killbots 1". To display the scoreboard hit "F2".
     26== Miscellaneous tips - Useful at the beginning ==
     27 * Don't forget to add your gametype to the CMakeLists.txt or it won't compile.
     28 * Compiling with the terminal. Go to the folder of your orxonox branch. The command for compiling is __cmake -j3__.
     29 * Don't forget to backup your code via svn. Open a terminal, go to your orxonox branch-folder and type __ svn ci -m "reason for commitment or summary of latest changes__ .
     30 * Gamecommands: to add 2 new bots enter __addbots 2__, to remove one of them enter __killbots 1__. To display the scoreboard hit __F2__.
    3731
    3832== Important functions inherited from Gametype ==
     
    4539||setConfigValues||interface for menue - to set the config values; ConfigValues are stored in a log file||
    4640||tick||this function is called whenever a new frame is rendered; dt is the value how much time has passed since the last frame||
     41
     42== Timer ==
     43 * A timer is a object of the Timer class that call a function after a certain time.
     44 * You can find a short tutorial in __/src/libraries/tools/Timer.h__
     45 * If the second argument is true, you create a timer-loop: The function is called periodically. Else the timer is only called once.
     46