|Version 3 (modified by feneur, 4 years ago) (diff)|
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.
Starting the Game
So, 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 (For other command line options see the Readme.txt file in binaries\system).
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 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:
- Windowed mode: To enable windowed mode, change the line windowed=false to windowed=true. Also, remove the semicolons before xres=1024 and yres=768 to make the window smaller than your desktop resolution.
- Render path: If you have any problems with graphics due to an older graphics card, change the line renderpath=default to renderpath=fixed to make sure 0 A.D. uses no shaders.
- Fancy water: If, on the other hand, you have a really high-end graphics card, enable pixel-shaded water by changing fancywater=false to fancywater=true. Note that it's also possible to toggle fancy water while the game is running however, if you only want to use it occasionally.
If you modify system.cfg, make sure you do *not* commit it to SVN, so that new members check out the old version of the file.
Playing a Match
On 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:
- Map name dropdown: Lists all the maps you have.
- Screenshot Mode: Check this box when you just want to open a map to take screenshots instead of playing. This will disable line of sight and fog of war, as well as put all the units in Passive stance, so they do not attack each other.
For 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.
Moving the Camera
The camera controls in 0 A.D. are similar to other RTS games. Here is an overview of what you can do:
- Scrolling: Move the mouse to a side of the screen, or use the arrow keys.
- Rotating: Use Ctrl + left and right arrow keys.
- Pitching: Use Ctrl + up and down arrow keys.
- Zooming: Use the mouse wheel or the "+" and "-" keys.
- Other controls: Alt + middle mouse button + drag scrolls the view. Ctrl + middle mouse button + drag rotates the camera about its location.
There is also a minimap in the lower right of the screen. You can click on it to immediately change view to any place in the world.
Try moving around the map a little bit and then returning to your original view.
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.
Try this now with your cavalry swordsman (Hippikon). Explore West to find water, or East to find cliffs and forests.
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.
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.
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.
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.
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.
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.
Note also that units will automatically go to nearby resource objects of the same type when they finish chopping down a tree, etc.
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.
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.
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.
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.
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.
Units can also repair damaged buildings. This is done by rightclicking as well.
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.
The other structures that can train units are the Barracks and Fortress. The Dock will also eventually train ships.
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.
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.
(Todo: Write about an example technology here.)
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.
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.
Owning a territory gives you several benefits:
- You can only build structures within your own territories.
- Consequently, you can only gather resources near your own territories, since you need a dropsite.
- Eventually, there will be a limit on the number of buildings of some types in each Territory.
- 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.
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).
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 :).
There are a few special combat system features that should be noted:
Running and Charging
As described earlier, double-rightclick to make a unit run, which makes them move faster but requires stamina.
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.
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.)
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.
Projectiles in 0 A.D. do area damage and hurt friendly units as well.
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:
- Aggress: The default. Causes the unit to automatically attack and pursue any enemies it sees.
- 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.
- Stand: The unit will stand at its position but still attack units that come in range (if it is a ranged unit).
- Hold: The unit will stand still and hold all fire (unless manually told to attack).
There is also an Avoid stance that is not currently implemented.
Units regenerate health slowly when they have not been in combat for a certain amount of time. They also regenerates stamina when idle.
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.
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.
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.
Other Game Features
Pausing the Game
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.
Quitting a Match
You can quit a match and return to the main menu at any time by pressing Alt-X. (Really, there should be a GUI button for this...).
To open or close the console, press ~ (the tilde key at the top left of the keyboard).
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.
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.
You 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:
Note that when you place buildings (such as "hele_house"), only the foundation will be placed.
To kill the currently selected unit, use:
You can modify a variety of traits on the selected units. For example, to give the currently selected unit 100 melee damage, use:
:selection.actions.attack.melee.damage = 100
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
:getEntityTemplate("hele_infantry_spearman_b", 1).actions.attack.melee.damage = 100
Giving Yourself Resources
You can access your own resource values through players.resources. For example, to add 1000 food to your stockpile, use:
:players.resources.food += 1000
The other resources are called wood, metal, stone and housing.
Setting Graphics Options
Various graphics options can be enabled or disabled through the renderer object. For example:
:renderer.fancyWater = true
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.)
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.
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).
(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.)
Atlas - The Map Editor
Run Atlas using the file binaries/system/Atlas.bat.
See the Atlas User's Guide for more info on how to use Atlas.
Run the Actor Viewer through binaries/system/ActorViewer.bat.
Run the Actor Editor through binaries/system/ActorEditor.exe.