Changes between Version 22 and Version 23 of Playing0AD


Ignore:
Timestamp:
Sep 6, 2012, 8:09:24 PM (12 years ago)
Author:
Erik Johansson
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Playing0AD

    v22 v23  
    1 [[TOC]]
    2 '''This page is very outdated and slated for removal. Please refer to the [http://trac.wildfiregames.com/wiki/0adManual Gameplay Manual] and [http://trac.wildfiregames.com/wiki/Atlas_User%2527s_Guide Atlas (Scenario Editor) User's Guide] for more up-to-date information.'''
    3 
    4 
    5 
    6 
    7 
    8 
    9 
    10 
    11 
    12 
    13 This tutorial will introduce you to 0 A.D. in its current state, including how to play the game, how to use the tools, and how to use various cool developer features. It is written for both programmers and artists.
    14 
    15 This is written for the Windows version of the game. On Linux and OS X, everything should work basically the same with a few tweaks (e.g. the executables don't end with `.exe`).
    16 
    17 == Starting the Game ==
    18 So, you've gotten the game by downloading a release version or checking out the game from SVN. The next step is to try it out :D. If using a pre-compiled release version you should have a shortcut in your start menu (or Linux equivalent), just click it and the game will start. If you've compiled it yourself after checking out the game from SVN or using the source files in the latest release you'll have to start the game manually. To do this, go to the folder `binaries\system` in the folder where you checked out the game, and double-click `pyrogenesis.exe`. The game will take several minutes to start up the first few times, because it is building compressed data files so it can start faster in the future. Eventually, the startup time will go down to ~5 seconds. If you're having trouble with for example sound you can double-click 'Quickstart.bat' in the 'binaries\system folder which will start the game without some things enabled, like sound for example. If you're on another operating system, or prefer to do things another way - like adding a shortcut to the binary from the Desktop - the same can be achieved by using the argument `-quickstart` when you run the game. (If you have commit access another command line switch that can be good to know is `-publicFilesOnly` which will make it possible to test how things work using only the public files, which is everything except some of the Art which is kept internal until later, an example would be to test if a public map contains files in the internal mod) For other command line options see the `Readme.txt` file in `binaries\system`.
    19 
    20 === Exiting ===
    21 This is also a good place to mention how to quit the game. You can exit 0 A.D. at any time by pressing '''Esc''', pressing it once will bring up a confirmation box and when you've clicked ok on that you're taken to the main screen, press '''Esc''' again and 0 A.D. is shut down completely after you click ok on that confirmation. You can also quit using the GUI buttons, when playing a game press the '''Menu''' button followed by the '''Quit''' button. From the main button you can press the '''Quit''' GUI button as well as using the '''Alt'''+'''F4''' keys on your keyboard, you'll get a confirmation box when using the GUI button, but not when using the '''Alt'''+'''F4''' keyboard shortcut.
    22 
    23 === Graphics Settings ===
    24 To switch between Windowed and Fullscreen mode press '''Alt'''+'''Enter'''. Various graphic settings are in the file `binaries\data\config\default.cfg`. To change a setting, create a ''new'' file, on Windows, create: `%appdata%/0ad/config/local.cfg`, on Linux/OS X, create: `~/.config/0ad/config/local.cfg`. Open both these files in Notepad, and copy any lines you want to change from `default.cfg` into the new `local.cfg`. Here are the main ones you might be interested in changing:''''''''''
    25 
    26  * Render path: If you have any problems with graphics due to an older graphics card, add the line `renderpath=fixed` to make sure 0 A.D. uses no shaders. If this fixes the problems, please report it as a bug to us.
    27  * Fancy water: Again, if you have an older graphics card, or just don't want all the fancy effects, you can disable pixel-shaded water by adding `fancywater=false`. Note that it's also possible to toggle fancy water while the game is running however, if you only want to check how things look temporarily or just want to use it occasionally. You do that by clicking on '''Menu''', then '''Settings''', and there check/uncheck the '''Enable Water Reflections''' checkbox.
    28 
    29 == Playing a Match ==
    30 You now have the choice of either playing single-player or multi-player, at the moment the AI isn't implemented, so unless you just want to test something out it's recommended that you play against a human player. To do so click on Multiplayer in the game menu and choose either Join Game (if someone else is already hosting) or Host Game (if you are going to host the game).
    31 
    32 === Hosting a game ===
    33 In the first screen you can choose a player name and a name for your server (unless you really want to change them just accept the defaults). Then click '''Continue'''. For other players to be able to connect to your game you need to tell them your IP number, if you don't know how to find out what your IP is you can go to[http://whatismyip.org/ http://whatismyip.org/] (currently seems to be offline, you can use [http://www.whatismyip.com/ http://www.whatismyip.com/] instead)and just copy the number there. In the next dialog choose what map you want to play on by clicking on it's name in the list, and select which slot you want each player to be in (currently you have to know which player is which civilization and where on the map each player starts). You can chat with other players who have connected to your game, as well as see who's connected. When you've chosen which map to play etc click the '''Start game! ''' button and the map loads.
    34 
    35 === Joining a game ===
    36 You may enter a name you want to be displayed to other players here, as well as the IP from the host (see above), then click '''Continue'''. You can see a list of available maps etc, but it's only the host who can change what map you will play on. You can however chat and there suggest a map if you have a favorite. When the host clicks the '''Start game! ''' button the game will start.
    37 
    38 === Singleplayer ===
    39 You start a singleplayer sandbox game by choosing Single Player in the main menu, in the next dialog choose which map you want to play on as well as which position you want to start in (Player 1 to Player 8). Then click '''Start game! '''The rest is the same for both Singleplayer and Multiplayer games (apart from the fact that the enemy won't do anything in a singleplayer game, not yet, when the AI is implemented the enemy will attack you though. And individual units will attack you already, so if there are enemies on the map, don't be surprised if you may lose a few units).
    40 
    41 === Moving the Camera ===
    42 The camera controls in 0 A.D. are similar to other RTS games. Here is an overview of what you can do:
    43 
    44  * '''Scrolling:''' Move the mouse to a side of the screen, use the '''W''', '''A''', '''S''', '''D''' keys or use the arrow keys.
    45  * '''Rotating:''' Use '''Ctrl''' + '''left''' and '''right arrow''' keys, use the '''scroll wheel''' on your mouse together with the '''Shift''' key, use the '''Q ''' or '''E '''keys or use '''Ctrl''' + '''A''' and '''D''' keys.
    46  * '''Pitching:''' Use '''Ctrl''' + '''up''' and '''down arrow''' keys.
    47  * '''Zooming:''' Use the '''mouse wheel''' or the "+" and "'''-'''" keys.
    48  * '''Reset camera view: '''Press the '''H''' key (resets both rotation and zoom).
    49  * '''Other controls:''' Drag the '''middle''' mouse button to scroll the view.
    50 
    51 There is also a minimap in the lower left of the screen. You can click on it to immediately change view to any place in the world.
    52 
    53 Try moving around the map a little bit and then returning to your original view.
    54 
    55 === Tasking Units ===
    56 Click one of your soldiers to select him. Right-click on the ground to task him. You can also select multiple units by dragging a box with the left mouse button.
    57 
    58 == '''NB! '''Below is not yet (2nd October 2010) updated for the latest version, so the information may be inaccurate! ==
    59 Try this now with your cavalry swordsman (Hippikon). Explore West to find water, or East to find cliffs and forests.
    60 
    61 Note that each unit has a green bar above it. This shows its health. Part of it becomes red when the unit is damaged. Health can slowly regenerate when the unit is not in combat.
    62 
    63 You can also make your units ''run'' by double-rightclicking instead of rightclicking. This depletes the unit's "stamina", represented by the blue bar above its head. Stamina slowly regenerates when the unit is idle. For military units, the first attack after running at an enemy is considered a charge attack and does more damage.
    64 
    65 === Gathering Resources ===
    66 There are four types of resources in 0 A.D: Food, wood, metal and stone. Your current amount of each resource is listed at the top of the screen. In addition, there is a fifth "resource": housing space. This is provided by civic buildings such as houses and Civil Centres. The last counter at the top of the screen shows your current population over your current housing capacity. Note that some units, such as cavalry, take two population slots.
    67 
    68 Unlike most real-time strategy games, 0 A.D. follows the concept of ''citizen soldiers'', meaning that your military units double as economic units. Therefore, your infantry are your main workers. Cavalry can also perform some tasks, such as hunting. You also have one unit that is only economic: the Female Citizen. She can gather food and wood at decent rates, but another advantage is that she has an ''aura'' (represented by a circle) around her that causes male citizens within it to work faster. This aura does not stack if you put multiple females together.
    69 
    70 To task a unit to gather, click him and rightclick a resource object, such as a tree, stone mine, metal mine or berry bush. You should have all of these within range of you Civil Centre.
    71 
    72 Finally, you can only gather resources if they are in range of a ''dropsite building''. This includes a Civil Centre or a Mill. In a real game, you will want to find a spot with several types of resources beside it and build a Mill there as you expand your civilization. The current GUI does not tell you about this fact - you just won't be able to click resources if there is no dropsite beside them.
    73 
    74 Note also that units will automatically go to nearby resource objects of the same type when they finish chopping down a tree, etc.
    75 
    76 === Building Structures ===
    77 Your infantry and female citizens can build new buildings. To do this, select a unit, and hover the mouse over the leftmost tab above the unit portrait at the left of the screen. This will open up a tab of available buildings. You can leftclick on one to select it, and leftclick somewhere on the map to place the new building. To cancel the building placement cursor, rightclick. Note, however, that the GUI currently won't give you an error message you when a building cannot be built due to insufficient resources (except in the Console - see below). In that case, the mouse pointer simply won't switch to the new building, so you won't be able to place it. If you want to try building something now, try either a House or a Mill. You can also gather more wood and stone to make other buildings.
    78 
    79 Structures can only built within your Territories. More on this below. If you try building one outside, it will not be possible to place it.
    80 
    81 One special type of structure is a Civil Centre. Civil Centres are used for claiming Territories, and they must be placed on the Settlement object in the centre of each Territory. More on this later.
    82 
    83 Note that multiple units can help build a building, which makes it happen faster. Simply task more of them to the unbuilt foundation by rightclicking it.
    84 
    85 Also, if you place multiple buildings, units that are finished building one of them will automatically look for work nearby and help build the others. Furthermore, if you build a Mill, the units who built it will automatically begin gathering resources nearby.
    86 
    87 Units can also repair damaged buildings. This is done by rightclicking as well.
    88 
    89 === Training Units ===
    90 Some of your buildings can train new units. For example, click your Civil Centre, and hover the mouse over the leftmost tab above the building's portrait, with a helmet on it. This will open up a list of things you can train. Click one to begin producing it. It will finish in several seconds and appear beside the Civil Center. You may also click multiple units or click the same unit multiple times to queue them. Note that if you don't have enough resources or population space for the unit, the GUI won't tell you (it will just ignore your command), but you can see a message about this in the console.
    91 
    92 The other structures that can train units are the Barracks and Fortress. The Dock will also eventually train ships.
    93 
    94 === Researching Technologies ===
    95 Some buildings also have a second tab with a wheel on it, that lets them research technologies. Like with units, hover over the tab and then click a button to start researching the technology. Technologies go into the same queue as unit production and will finish in a few seconds.
    96 
    97 Technologies are set up in a pair-based hierarchy. For example, when you are given the option of techs 1A and 1B and you choose 1A to research, 1B is no longer available. Some of the techs that are higher up on the tech ladder will require that tech 1A is done, while others will require tech 1B. This adds a level of strategy and 'randomness' to picking your techs, as availability of higher level techs will depend on your choices earlier in the game. Tech pairs are also phase specific - when your civilization's settlement is in the village phase you will have different techs available to you then when you are at the town or city phase. And lastly, ''most'' tech pairs are self-balancing. If a tech is self-balancing it will not only have it's own effect but will incorporate it's pair tech in a negative way. E.g., tech 2A raises mêlée unit hitpoints and 2B lowers mêlée unit food creation cost. When you research tech 2A, it will raise your hitpoints but also raise your mêlée food creation cost.
    98 
    99 (Todo: Write about an example technology here.)
    100 
    101 === Claiming Territories ===
    102 The key to expanding your civilization in 0 A.D. is conquering territories. Each map is divided into a number of territories (usually 3x the number of players). Each territory is centered around an object called a ''Settlement'', which looks like a little well with a fence around it. It is shaped like a polygon around this Settlement (it contains all the points that are nearer to this Settlement than to any other). These polygons are showed on both the minimap and the game world. On the minimap, the lines are gray and the territory is shaded depending on its owner. In the game world, each territory boundary is drawn as two lines, each of which is coloured based on who owns that territory.
    103 
    104 Players claim a territory by building a Civil Centre on this Settlement. If another player's Civil Centre is there, you can of course destroy it to place your own ;). Note that when someone's Civil Centre dies, that territory still remains there until a new Civil Centre is built.
    105 
    106 Owning a territory gives you several benefits:
    107 
    108  * You can only build structures within your own territories.
    109  * Consequently, you can only gather resources near your own territories, since you need a dropsite.
    110  * Eventually, there will be a limit on the number of buildings of some types in each Territory.
    111  * There will also be a limit on total houses you can build, so the extra population space from additional Civil Centres will be necessary if you want to field a large army.
    112 
    113 On latium_generated, you can find a Settlement by walking directly South from your Civil Centre. Make sure you bring an infantry unit there to actually be able to build on it (cavalry can't build).
    114 
    115 === Fighting Enemies ===
    116 Finally, the reason for all this buildup: To slay some enemies :D! Combat in 0 A.D. works similarly to other real-time strategy games. You make your soldiers attack by rightclicking on a target. If you want to try this out on latium_generated, walk either North or East until you find an enemy town. Feel free to pillage at will :).
    117 
    118 There are a few special combat system features that should be noted:
    119 
    120 ==== Running and Charging ====
    121 As described earlier, double-rightclick to make a unit run, which makes them move faster but requires stamina.
    122 
    123 A melee unit that attacks off a run (when you double-rightclick an enemy) will begin with a Charge attack, which generally does 2x damage.
    124 
    125 In addition, some cavalry units can ''trample'' enemies while running. The area in which the trample damage happens is shown in red around the cavalry unit. Simply run the cavalry around to trample enemies, or double-rightclick an enemy to charge and trample. (When the cavalry stops running in order to attack, the trample effect will continue for about 5 seconds, so this can be more efficient than just running around.)
    126 
    127 ==== Ranged Units ====
    128 Archers and javelinists in 0 A.D. have a minimum range. They will automatically back up out of this range when they are trying to attack something too close to them.
    129 
    130 Projectiles in 0 A.D. do area damage and hurt friendly units as well.
    131 
    132 ==== Unit Stances ====
    133 Each unit can be in one of four stances that controls its AI. These can be set from the Stance List tab, which normally has three daggers drawn on it. They include:
    134 
    135  * Aggress: The default. Causes the unit to automatically attack and pursue any enemies it sees.
    136  * Defend: The unit will attack and pursue enemies, but it will not pursue them beyond its line-of-sight away from the position where it was stationed.
    137  * Stand: The unit will stand at its position but still attack units that come in range (if it is a ranged unit).
    138  * Hold: The unit will stand still and hold all fire (unless manually told to attack).
    139 
    140 There is also an Avoid stance that is not currently implemented.
    141 
    142 ==== Regeneration ====
    143 Units regenerate health slowly when they have not been in combat for a certain amount of time. They also regenerates stamina when idle.
    144 
    145 ==== Damage Types ====
    146 Damage in 0 A.D. comes in three types: hack, pierce and crush. Units have different armour for each type. In addition, unit attacks may be of multiple types simultaneously (e.g. a Hoplite does both pierce and hack damage). Therefore, you may see some units do different amounts of damage to different enemies.
    147 
    148 ==== Capturing ====
    149 Certain enemy objects can be captured. The main one is Female Citizens - if they are outside the range of their own soldiers but inside the range of your soldiers for a sufficiently long time, they will change ownership to you. Later, damaged buildings are planned to be capturable as well. One final capturable object is herd animals such as sheep, which are a movable food source.
    150 
    151 ==== Unit Ranks ====
    152 As soldiers in 0 A.D. gain experience by killing enemies, they advance in rank. All units begin at Basic rank, and they can upgrade to Advanced and then Elite. Higher ranks give a unit more attack, armour and health, but reduce its economic effectiveness.
    153 
    154 === Other Game Features ===
    155 ==== Pausing the Game ====
    156 You can pause the game by pressing the '''Pause''' key on your keyboard (at the top right). Unpause it using the same key. The game will also be paused if you switch to another window.
    157 
    158 ==== Quitting a Match ====
    159 You can quit a match and return to the main menu at any time by pressing '''Alt-X''' (For fast quiting), or pressing ESCAPE key. This will ask you for confirmation, if you click yes you will return to the main menu.
    160 
    161 == Developer Features ==
    162 === The Console ===
    163 ==== Introduction ====
    164 The in-game console displays various messages and lets you execute commands using JavaScript, with access to the same set of functions as the scripts.
    165 
    166 To open or close the console, press F9 or '''~''' (the tilde key at the top left of the keyboard).
    167 
    168 To run a JavaScript command, type `:[code]` in the console and press Enter.
    169 
    170 To evaluate a JavaScript expression, type `?[code]` in the console and press Enter.
    171 
    172 You can also see the value of some javascript objects, properties or variables by typing `?[variable]`
    173 
    174 The console also has history functionality. You can press the up and down arrow keys to navigate through the past hundred lines you have typed. You can also begin typing a command, and press the up arrow key after a few characters to navigate through commands that started with the same thing. For example, typing `:se` and pressing <up> will give you the last command you typed that started with `se`.
    175 
    176 The rest of this section will show you specific commands you can give with the console that should be useful for any kind of testing. It is targeted at both programmers and artists. The last section, Further Reference, lists more resources for programmers.
    177 
    178 ==== Placing Objects ====
    179 You can place objects through the `startPlacing` command if you know their template name (the name of their XML file in `binaries/data/mods/public/entities/`. For example, the following places a Hoplite:
    180 
    181 {{{
    182 :startPlacing("hele_infantry_spearman_b")
    183 }}}
    184 Note that when you place buildings (such as "hele_house"), only the foundation will be placed.
    185 
    186 ==== Killing Units ====
    187 To kill the currently selected unit, use:
    188 
    189 {{{
    190 :selection[0].kill()
    191 }}}
    192 You can also press the SUPR or DEL key to kill a selected unit.
    193 
    194 ==== Modifying Units ====
    195 You can modify a variety of traits on the selected units. For example, to give the currently selected unit 100 melee damage, use:
    196 
    197 {{{
    198 :selection[0].actions.attack.melee.damage = 100
    199 }}}
    200 You can also modify entity templates for each player, which affects all units of the given type owned by that player. For example, to give 100 attack to all Hoplites owned by player 1, use
    201 
    202 {{{
    203 :getEntityTemplate("hele_infantry_spearman_b", 1).actions.attack.melee.damage = 100
    204 }}}
    205 ==== Giving Yourself Resources ====
    206 You can access your own resource values through `players[1].resources`. For example, to add 1000 food to your stockpile, use:
    207 
    208 {{{
    209 :players[1].resources.food += 1000
    210 }}}
    211 The other resources are called `wood`, `metal`, `stone` and `housing`.
    212 
    213 ==== Setting Graphics Options ====
    214 Various graphics options can be enabled or disabled through the `renderer` object. For example:
    215 
    216 {{{
    217 :renderer.fancyWater = true
    218 }}}
    219 ==== Using the Console from your code ====
    220 You can print anything to the console by using the `console.write()` method. This can be useful for debuging your scripts. If you are printing an entire object and not a variable be sure that the object can be printed and contains the toString() method.
    221 
    222 ==== Further Reference ====
    223 You can find many of the functions exposed to JavaScript in the source file ScriptGlue.cpp. In addition, classes are scriptable, such as CEntity, CTechnology and CRenderer, have a ScriptingInit function where they list their methods.
    224 
    225 Some useful global objects and functions include: * `selection`: An array containing the currently selected objects. * `players`: An array containing the players. * `renderer`: The renderer object. * `getGuiGlobal()`: The GUI globals object (which contains a bunch of GUI-related functions). * `getEntityTemplate(unitName, playerNum)`: Get the entity template for a given unit, which instances of each type of unit inherit from. (Affects properties of all units at once.)
    226 
    227 === The Profiler ===
    228 0 A.D. includes a built-in low-overhead profiler which can help you figure out bottlenecks. You can access it by pressing '''F11'''. The first view shows render stats. If you press '''F11''' again, you will be taken to a second view, which shows time per frame (in milliseconds) and breaks it down into different areas. Each area has a number in front of it (1, 2, 3, etc) that you can press to go deeper into it to explore how its time is divided up. You can also press 0 to go up one level in this "tree" of time usage. Finally, press '''F11''' a third time to close the profiler overlay.
    229 
    230 For information on how to use the profiler in your own code, take a look at Profile.h. It's pretty straight-forward (mostly involves calling macros to start/stop a new subsection of the tree).
    231 
    232 === Debugging Functions ===
    233 (Todo. Please see debug.h for now. The main thing to watch out for is that you must use debug_printf, not printf or cout, to print output so that it can be seen in the Visual C++ output window.)
    234 
    235 == Tools ==
    236 === Atlas - The Map Editor ===
    237 Run Atlas using the file `binaries/system/Atlas.bat`, or on non-Windows platforms use `./pyrogenesis_dbg -editor` in `binaries/system/`.
    238 
    239 See the [wiki:Atlas_User%27s_Guide Atlas User's Guide] for more info on how to use Atlas.
    240 
    241 === Actor Viewer ===
    242 Run the Actor Viewer through `binaries/system/ActorViewer.bat`.
    243 
    244 (Todo: Explain.)
    245 
    246 === Actor Editor ===
    247 Run the Actor Editor through `binaries/system/ActorEditor.exe`.
    248 
    249 (Todo: Explain.)
     1'''This page is very outdated. Please refer to the [http://trac.wildfiregames.com/wiki/0adManual Gameplay Manual] and [http://trac.wildfiregames.com/wiki/Atlas_User%2527s_Guide Atlas (Scenario Editor) User's Guide] for more up-to-date information.'''