Changes between Version 7 and Version 8 of Playing0AD


Ignore:
Timestamp:
Jun 25, 2009, 4:21:01 PM (15 years ago)
Author:
Philip Taylor
Comment:

adding TOC

Legend:

Unmodified
Added
Removed
Modified
  • Playing0AD

    v7 v8  
     1[[TOC]]
     2
    13This 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.
    24
    3 = Starting the Game =
     5== Starting the Game ==
    46
    57So, you've checked out the game from SVN. The next step is to try it out :D. 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. 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`).
    68
    7 == Exiting ==
     9=== Exiting ===
    810
    911This 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.
    1012
    11 == Graphics Settings ==
     13=== Graphics Settings ===
    1214
    1315You can change various graphics settings in the file `binaries\data\config\system.cfg`. Open this file in Notepad to be able to edit it. You need not do this now, but they might be useful in the future. Here are the main ones you might be interested in changing:
     
    1820If you modify `system.cfg`, make sure you do *not* commit it to SVN, so that new members check out the default version of the file.
    1921
    20 = Playing a Match =
     22== Playing a Match ==
    2123
    2224On the main menu, press Single Player to begin your first match. This brings up a game setup screen. Some of the controls on this screen do not work yet, but there are two very useful ones that you should be aware of:
     
    2729For now, leave the settings as default. That is, play on the map '''Latium''', with screenshot mode off. '''Latium''' is our "typical" map, created from a random map script, and complete with resources, territories, etc.
    2830
    29 == Moving the Camera ==
     31=== Moving the Camera ===
    3032
    3133The camera controls in 0 A.D. are similar to other RTS games. Here is an overview of what you can do:
     
    4042Try moving around the map a little bit and then returning to your original view.
    4143
    42 == Tasking Units ==
     44=== Tasking Units ===
    4345
    4446Click 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.
     
    5052You 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.
    5153
    52 == Gathering Resources ==
     54=== Gathering Resources ===
    5355
    5456There 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.
     
    6264Note also that units will automatically go to nearby resource objects of the same type when they finish chopping down a tree, etc.
    6365
    64 == Building Structures ==
     66=== Building Structures ===
    6567
    6668Your 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.
     
    7678Units can also repair damaged buildings. This is done by rightclicking as well.
    7779
    78 == Training Units ==
     80=== Training Units ===
    7981
    8082Some 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.
     
    8284The other structures that can train units are the Barracks and Fortress. The Dock will also eventually train ships.
    8385
    84 == Researching Technologies ==
     86=== Researching Technologies ===
    8587
    8688Some 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.
     
    9092(Todo: Write about an example technology here.)
    9193
    92 == Claiming Territories ==
     94=== Claiming Territories ===
    9395
    9496The 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.
     
    104106On 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).
    105107
    106 == Fighting Enemies ==
     108=== Fighting Enemies ===
    107109
    108110Finally, 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 :).
     
    110112There are a few special combat system features that should be noted:
    111113
    112 === Running and Charging ===
     114==== Running and Charging ====
    113115
    114116As described earlier, double-rightclick to make a unit run, which makes them move faster but requires stamina.
     
    118120In 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.)
    119121
    120 === Ranged Units ===
     122==== Ranged Units ====
    121123
    122124Archers 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.
     
    124126Projectiles in 0 A.D. do area damage and hurt friendly units as well.
    125127
    126 === Unit Stances ===
     128==== Unit Stances ====
    127129
    128130Each 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:
     
    133135There is also an Avoid stance that is not currently implemented.
    134136
    135 === Regeneration ===
     137==== Regeneration ====
    136138
    137139Units regenerate health slowly when they have not been in combat for a certain amount of time. They also regenerates stamina when idle.
    138140
    139 === Damage Types ===
     141==== Damage Types ====
    140142
    141143Damage 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.
    142144
    143 === Capturing ===
     145==== Capturing ====
    144146
    145147Certain 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.
    146148
    147 === Unit Ranks ===
     149==== Unit Ranks ====
    148150
    149151As 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.
    150152
    151 == Other Game Features ==
    152 
    153 === Pausing the Game ===
     153=== Other Game Features ===
     154
     155==== Pausing the Game ====
    154156
    155157You 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.
    156158
    157 === Quitting a Match ===
     159==== Quitting a Match ====
    158160
    159161You 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.
    160162
    161 = Developer Features =
    162 
    163 == The Console ==
    164 
    165 === Introduction ===
     163== Developer Features ==
     164
     165=== The Console ===
     166
     167==== Introduction ====
    166168
    167169The in-game console displays various messages and lets you execute commands using JavaScript, with access to the same set of functions as the scripts.
     
    179181The 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.
    180182
    181 === Placing Units ===
     183==== Placing Units ====
    182184
    183185You can place units through the `startPlacing` command if you know their template name (the name of their XML file in `binaries/data/mods/official/entities`. For example, the following places a Hoplite:
     
    189191Note that when you place buildings (such as "hele_house"), only the foundation will be placed.
    190192
    191 === Killing Units ===
     193==== Killing Units ====
    192194
    193195To kill the currently selected unit, use:
     
    199201You can also press the SUPR or DEL key to kill a selected unit.
    200202
    201 === Modifying Units ===``
     203==== Modifying Units ====``
    202204
    203205You can modify a variety of traits on the selected units. For example, to give the currently selected unit 100 melee damage, use:
     
    213215}}}
    214216
    215 === Giving Yourself Resources ===
     217==== Giving Yourself Resources ====
    216218
    217219You can access your own resource values through `players[1].resources`. For example, to add 1000 food to your stockpile, use:
     
    223225The other resources are called `wood`, `metal`, `stone` and `housing`.
    224226
    225 === Setting Graphics Options ===
     227==== Setting Graphics Options ====
    226228
    227229Various graphics options can be enabled or disabled through the `renderer` object. For example:
     
    231233}}}
    232234
    233 === Using the Console from your code ===
     235==== Using the Console from your code ====
    234236
    235237You can print anything to the console by using the {{{console.write()}}} method. This can be useful for debuging your scripts.
    236238If you are printing an entire object and not a variable be sure that the object can be printed and contains the toString() method.
    237239
    238 === Further Reference ===
     240==== Further Reference ====
    239241
    240242You 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.
     
    247249* `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.)
    248250
    249 == The Profiler ==
     251=== The Profiler ===
    250252
    2512530 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.
     
    253255For 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).
    254256
    255 == Debugging Functions ==
     257=== Debugging Functions ===
    256258
    257259(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.)
    258260
    259 = Tools =
    260 
    261 == Atlas - The Map Editor ==
     261== Tools ==
     262
     263=== Atlas - The Map Editor ===
    262264
    263265Run Atlas using the file `binaries/system/Atlas.bat`.
     
    265267See the [wiki:Atlas_User%27s_Guide Atlas User's Guide] for more info on how to use Atlas.
    266268
    267 == Actor Viewer ==
     269=== Actor Viewer ===
    268270
    269271Run the Actor Viewer through `binaries/system/ActorViewer.bat`.
     
    271273(Todo: Explain.)
    272274
    273 == Actor Editor ==
     275=== Actor Editor ===
    274276
    275277Run the Actor Editor through `binaries/system/ActorEditor.exe`.
    276278
    277 See
     279(Todo: Explain.)