<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.wesnoth.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Boucman</id>
	<title>The Battle for Wesnoth Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.wesnoth.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Boucman"/>
	<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/Special:Contributions/Boucman"/>
	<updated>2026-04-06T22:09:30Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.16</generator>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=User_talk:Shadowm/PatchSubmissionGuidelines&amp;diff=48249</id>
		<title>User talk:Shadowm/PatchSubmissionGuidelines</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=User_talk:Shadowm/PatchSubmissionGuidelines&amp;diff=48249"/>
		<updated>2012-12-28T09:14:23Z</updated>

		<summary type="html">&lt;p&gt;Boucman: Created page with '1.2: you could also mention RELEASE_NOTES as &amp;quot;if needed, you may also add something in the RELEASE_NOTES&amp;quot;  1.3: copyright notices ? 2.1: FIXME: in that case come and bug us on IR…'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;1.2: you could also mention RELEASE_NOTES as &amp;quot;if needed, you may also add something in the RELEASE_NOTES&amp;quot; &lt;br /&gt;
1.3: copyright notices ?&lt;br /&gt;
2.1: FIXME: in that case come and bug us on IRC&lt;br /&gt;
2  : we may ask to rewrite the patch entirely if the generic idea is good, but we don't like how it's done and/or it can be generalized/designed in a better way in the grand scheme of things&lt;br /&gt;
&lt;br /&gt;
--[[User:Boucman|Boucman]] 09:14, 28 December 2012 (UTC)&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SoC_Ideas_Particle_Engine_2012&amp;diff=45560</id>
		<title>SoC Ideas Particle Engine 2012</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SoC_Ideas_Particle_Engine_2012&amp;diff=45560"/>
		<updated>2012-03-09T07:54:21Z</updated>

		<summary type="html">&lt;p&gt;Boucman: Created page with '{{Template:SoC2012Idea}} = Description = &amp;lt;h2&amp;gt;Implement a particle engine in the animation engine&amp;lt;/h2&amp;gt; Page for the idea: SoC Ideas Particle Engine  {{#dpl:  |resultsheader=''…'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:SoC2012Idea}}&lt;br /&gt;
= Description =&lt;br /&gt;
&amp;lt;h2&amp;gt;Implement a particle engine in the animation engine&amp;lt;/h2&amp;gt;&lt;br /&gt;
Page for the idea: [[SoC Ideas Particle Engine]]&lt;br /&gt;
&lt;br /&gt;
{{#dpl:&lt;br /&gt;
 |resultsheader=''There are %PAGES% submitted student proposals for this idea''&lt;br /&gt;
 |oneresultheader=''There is 1 student proposal for this idea''&lt;br /&gt;
 |suppresserrors=true&lt;br /&gt;
 |noresultsheader=''There are no student proposals for this idea''&lt;br /&gt;
 |category=Summer of Code 2012 Student Page&amp;amp;SoC Ideas ¨Particle Engine&lt;br /&gt;
 |notcategory=SoC 2012 Not Submitted To Google&lt;br /&gt;
 |include=#Description&lt;br /&gt;
 |nottitlematch=SoC2012_Template_of_Student_page&lt;br /&gt;
 |mode=userformat&lt;br /&gt;
 |format=,,&amp;lt;br/&amp;gt;See [[%PAGE%|%TITLE%]] for more information.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;,&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=Additional Information=&lt;br /&gt;
&lt;br /&gt;
A particle engine allows to draw pixel per pixel where each pixel's position is given by a piece of code or a mathematical fomula. This is used to display interesting physical phenomenoms like water flow, explosions or fire&lt;br /&gt;
&lt;br /&gt;
The aim of the project is to add such an engine within the animation engine and, if time permits, within the terrain engine.&lt;br /&gt;
&lt;br /&gt;
A good understanding of the animation engine will be needed, but the particle engine will fit quite nicely in the existing structure&lt;br /&gt;
&lt;br /&gt;
for performance reasons the formulas will probaly have to be given in LUA, but other approches could be interesting&lt;br /&gt;
&lt;br /&gt;
there will probably be some needs to go into the wesnoth-SDL infrastructure for the display part&lt;br /&gt;
&lt;br /&gt;
googling for &amp;quot;particle engine&amp;quot; and &amp;quot;particle engine SDL&amp;quot; should provide lots of groundwork for writing proposals&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Whom to ask about this=&lt;br /&gt;
boucman on irc.&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=Fosdem2012&amp;diff=44414</id>
		<title>Fosdem2012</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=Fosdem2012&amp;diff=44414"/>
		<updated>2011-12-15T15:14:55Z</updated>

		<summary type="html">&lt;p&gt;Boucman: /* Schedule/Plans */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== General information ==&lt;br /&gt;
This page is meant to somehow coordinate the small Wesconf taking place at FOSDEM 2012. That is everyone attending should please list him/herself in the list of arrivals and stuff like this. FOSDEM 2012 will take place at the first weekend in Febuary 2012, on Saturday 4th and Sunday 5th.&lt;br /&gt;
&lt;br /&gt;
* Fosdem - http://fosdem.org/2012/&lt;br /&gt;
&lt;br /&gt;
== Schedule/Plans ==&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! (nick)name(s)&lt;br /&gt;
! Arrival&lt;br /&gt;
! Departure&lt;br /&gt;
! Accomodation&lt;br /&gt;
|-&lt;br /&gt;
| Ivanovic&lt;br /&gt;
| Fri, 3rd, &amp;quot;afternoon&amp;quot; (~15:00 at &amp;quot;chokopolis&amp;quot;; not 100% sure yet)&lt;br /&gt;
| Sun, 5th, leaving right from ULB campus&lt;br /&gt;
| 2go4?&lt;br /&gt;
|-&lt;br /&gt;
| AI&lt;br /&gt;
| Friday?&lt;br /&gt;
| Sunday?&lt;br /&gt;
| 2go4?&lt;br /&gt;
|-&lt;br /&gt;
| Crab&lt;br /&gt;
| Fri, 3rd, &amp;quot;afternoon&amp;quot;&lt;br /&gt;
| Sun, 5th&lt;br /&gt;
| 2go4?&lt;br /&gt;
|-&lt;br /&gt;
| Boucman&lt;br /&gt;
| Fri, 3rd&lt;br /&gt;
| Sun, 5th&lt;br /&gt;
| not sure, to be confirmed&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For accommodations please keep in mind that parking in the center of Brussels is really problematic. It might make sense to drive to the University where FOSDEM takes place, park there and take the bus into the town center (where some of the hotels/hostels are).&lt;br /&gt;
&lt;br /&gt;
Possible hostels that we at least contacted over the last years (some of them might already be booked out by now!):&lt;br /&gt;
* [http://www.chab.be/ CHAB]&lt;br /&gt;
* [http://www.2go4.be/ 2go4] Note: groups bigger 6 are not allowed, so we can (officially) not form a complete Wesnoth group at this hostel, got to meet somewhere in town/at the university...&lt;br /&gt;
* [http://www.jeugdherbergen.be/brusselE.htm Bruegel YH]&lt;br /&gt;
&lt;br /&gt;
On the official FOSDEM page [http://www.fosdem.org/2012/practical/accommodation some more possible hotels/hostels] are listed.&lt;br /&gt;
&lt;br /&gt;
== Maps ==&lt;br /&gt;
* [http://tinyurl.com/3a65gr Bruegel YH]&lt;br /&gt;
* [http://tinyurl.com/35br9c Brussels Central (Train Station) → Bruegel YH]&lt;br /&gt;
* [http://tinyurl.com/37d9v4 Bruegel YH → Brussels Central (Train Station) → Novotel Grand Place]&lt;br /&gt;
* [http://tinyurl.com/2mzns6 Novotel Grand Place]&lt;br /&gt;
* [http://tinyurl.com/3dggg3 CrownePlaza (Europa)]&lt;br /&gt;
* [http://tinyurl.com/36epxj FOSDEM]&lt;br /&gt;
* [http://tinyurl.com/2w4bms Novotel Grand Place -&amp;gt; FOSDEM]&lt;br /&gt;
&lt;br /&gt;
== Transportation ==&lt;br /&gt;
Information about how to reach the FOSDEM is listed at the [http://www.fosdem.org/2012/transportation official transportation subpage].&lt;br /&gt;
&lt;br /&gt;
Short version of how to get there for those that reside in Bruegel YH and Novotel Grand Place (basically town center):&lt;br /&gt;
&lt;br /&gt;
* Enter Bus 71 (Debrouckere - Central Station (&amp;quot;Gare Centrale&amp;quot;) - Delta) somewhere at 'Central Station'&lt;br /&gt;
* Leave the bus at &amp;quot;ULB&amp;quot; (crossroads Ave. Adolphe Buyl - Sq. Deveze)&lt;br /&gt;
* Walk down Ave. Paul Heger on your right hand.&lt;br /&gt;
&lt;br /&gt;
== Wesnoth Hacking Room ==&lt;br /&gt;
&lt;br /&gt;
Wesnoth will not have a room of its own (though there will be the open source game dev devroom on Sunday where hopefully many Wesnoth devs will participate). Instead we will use one of the &amp;quot;general hacking rooms&amp;quot;. So far it is not sure which room it will be, if we do it like the last three years, it will be room number 115 in the building AW1. Last year this was the smaller of the two hacking rooms and we had no real problem with conquering (and holding) the first row in this room. There were not too many power outlets, so this year at least Ivanovic will bring one multi-outlet power strip plus some extension cable (5m or something like this). Mordante will (hopefully) also bring a multi-outlet power strip and a 20m extension cable. There is no wired network, everything wireless (and sometimes rather/very unstable!). Beside this you should bring laptops since there are no computers available for hacking.&lt;br /&gt;
&lt;br /&gt;
Short version:&lt;br /&gt;
 AW1 - Room 115 (at least on Saturday)&lt;br /&gt;
&lt;br /&gt;
== Discussions and Results ==&lt;br /&gt;
We usually discuss all sorts of things at FOSDEM, this section is basically a (really short) summary of things that were discussed including their results. First are the discussions that were done &amp;quot;in plenum&amp;quot; with basically all attendees around. At the bottom is an area meant for discussions that were held in sub groups that not all devs might be aware of that were around.&lt;br /&gt;
&lt;br /&gt;
Please make sure to list any topics you want to talk about below. The GameDev Room topic might serve as sample...&lt;br /&gt;
&lt;br /&gt;
===Wesnoth presence in the GameDev Room===&lt;br /&gt;
Since Ivanovic is responsible for organizing the Open Source Game Development Devroom which takes place on Sunday 5th, there will at least be one Wesnoth Dev busy with this room. Though several other will hopefully support Ivanovic in this effort and be around to listen to many interesting talks and presentations.&lt;br /&gt;
&lt;br /&gt;
== Group Picture ==&lt;br /&gt;
Has to be taken first.&lt;br /&gt;
&lt;br /&gt;
== Previous Years ==&lt;br /&gt;
* [http://www.wesnoth.org/wiki/Fosdem2011 FOSDEM 2011 wiki page]&lt;br /&gt;
* [http://www.wesnoth.org/wiki/Fosdem2010 FOSDEM 2010 wiki page]&lt;br /&gt;
* [http://www.wesnoth.org/wiki/Fosdem2009 FOSDEM 2009 wiki page]&lt;br /&gt;
* [http://www.wesnoth.org/wiki/Fosdem2008 2008 wiki page], [http://www.wesnoth.org/forum/viewtopic.php?p=283649#p283649 Forum topic (with group photo)], [https://mail.gna.org/public/wesnoth-dev/2008-02/msg00078.html Summary of FOSDEM 2008 results]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Wesconf]]&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=AnimationWML&amp;diff=42996</id>
		<title>AnimationWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=AnimationWML&amp;diff=42996"/>
		<updated>2011-06-12T16:52:31Z</updated>

		<summary type="html">&lt;p&gt;Boucman: /* Optimization */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WML Tags}}&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This page covers unit animations. At any point in game, units are playing an animation. Even when the unit is standing, it is actually playing a single frame animation.&lt;br /&gt;
&lt;br /&gt;
This page will deal with the two problems of animations&lt;br /&gt;
* How are animations chosen&lt;br /&gt;
* What exactly is drawn&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How animations are drawn ==&lt;br /&gt;
=== Animations ===&lt;br /&gt;
Any unit has a huge set of animations to choose from. Animations are WML blocks in the unit type, enclosed in either the generic type '''[animation]''' or some more specific tags such as '''[attack_anim]''' '''[idle_anim]''' and the like. An animation is what a unit displays when a given event is triggered, and a certain set of conditions are met such as&lt;br /&gt;
* unit is attacking&lt;br /&gt;
* unit is idling&lt;br /&gt;
* unit is attacking (event) and uses a melee weapon (condition)&lt;br /&gt;
* unit is attacking (event) and uses a melee weapon (condition) and opponent can't retaliate (condition)&lt;br /&gt;
&lt;br /&gt;
events and conditions are described entirely in the [animation] block, and will be discussed in the animation choice section.&lt;br /&gt;
&lt;br /&gt;
=== Frames ===&lt;br /&gt;
    &lt;br /&gt;
An animation is cut in frames. Frames are WML blocks that are contained either in '''[frame]''' WML blocks or in generic '''[xxx_frame]''' block. (the xxx part can be any string not starting with an underscore) the xxx part in the frame name is called the frame prefix. frames of the type '''[frame]''' are said to have an empty prefix&lt;br /&gt;
&lt;br /&gt;
A frame typically describes an image, where an how to render it. It can contain such things as&lt;br /&gt;
* the image to display&lt;br /&gt;
* how transparent should that image be&lt;br /&gt;
* where to draw that image.&lt;br /&gt;
&lt;br /&gt;
At any given time, an animation will display one frame for each frame prefix it can find. I.e if your animation has both '''[frame]''' and '''[missile_frame]''' blocks, both will be displayed at the same time&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The frame with the empty prefix is special in many way. It is assumed to contain the image representing the unit itself, and as such the engine will heavily temper with it in multiple ways, such as providing a default image if none is available, or forcing the image to be green when the unit is poisoned&lt;br /&gt;
&lt;br /&gt;
=== Timing, Clock, Multiple animations ===&lt;br /&gt;
When an animation is played it has an internal clock that is run. The step of this clock is the milisecond, and each frame is played for a given duration. Each animation also has a starting time which tells the animation engine at what value the animation clock should start&lt;br /&gt;
&lt;br /&gt;
This starting time is very important when multiple animations from different units are played synchronously  Typically a fight involves a unit playing its defense animation while the opponent plays it's attack animation (and a third might play its leading animation, too). In that case all animations have a common clock, and are played concurrently.&lt;br /&gt;
&lt;br /&gt;
The convention is that the &amp;quot;important time&amp;quot; (usually the time of the hit) is at time 0. everything before should be at negative time, everything after at positive time. This is a WML convention that is not enforced by the engine&lt;br /&gt;
&lt;br /&gt;
In that case, it is very important that these animations (which can have different lengths) be synchronized. Fight animations are synchronized around the point of impact, so they all reach time 0 when the attack lands (or misses). This is accomplished through the use of the '''start_time''' key of the '''[animation]''' tag.&lt;br /&gt;
&lt;br /&gt;
Just like the '''[frame]''' tag can have a prefix, so can the '''start_time''' key. A '''start_time''' key without prefix will affect a '''[frame]''' tag without prefix, while a '''start_time''' key with a prefix will affect a '''[frame]''' tag with the same prefix.&lt;br /&gt;
&lt;br /&gt;
==== Example Syntax ====&lt;br /&gt;
    [attack_anim]&lt;br /&gt;
        [filter_attack]&lt;br /&gt;
            name=bow&lt;br /&gt;
        [/filter_attack]&lt;br /&gt;
        '''start_time'''=-350&lt;br /&gt;
        '''missile_start_time'''=-150&lt;br /&gt;
        [missile_frame]&lt;br /&gt;
            duration=150&lt;br /&gt;
            image=&amp;quot;projectiles/missile-n.png&amp;quot;&lt;br /&gt;
            image_diagonal=&amp;quot;projectiles/missile-ne.png&amp;quot;&lt;br /&gt;
        [/missile_frame]&lt;br /&gt;
        [if]&lt;br /&gt;
            hits=yes&lt;br /&gt;
            [frame]&lt;br /&gt;
                duration=350&lt;br /&gt;
                sound=bow.ogg&lt;br /&gt;
            [/frame]&lt;br /&gt;
        [/if]&lt;br /&gt;
        [else]&lt;br /&gt;
            hits=no&lt;br /&gt;
            [frame]&lt;br /&gt;
                duration=350&lt;br /&gt;
                sound=bow-miss.ogg&lt;br /&gt;
            [/frame]&lt;br /&gt;
        [/else]&lt;br /&gt;
    [/attack_anim]&lt;br /&gt;
&lt;br /&gt;
=== The content of a frame ===&lt;br /&gt;
==== Syntax summary ====&lt;br /&gt;
 [frame]&lt;br /&gt;
    duration=&amp;lt;integer&amp;gt;&lt;br /&gt;
    begin=&amp;lt;deprecated,integer&amp;gt;&lt;br /&gt;
    end=&amp;lt;deprecated,integer&amp;gt;&lt;br /&gt;
    image=&amp;lt;string&amp;gt;&lt;br /&gt;
    image_diagonal=&amp;lt;string&amp;gt;&lt;br /&gt;
    image_mod=&amp;lt;string&amp;gt;&lt;br /&gt;
    sound=&amp;lt;string&amp;gt;&lt;br /&gt;
    halo=&amp;lt;progressive string&amp;gt;&lt;br /&gt;
    halo_x=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
    halo_y=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
    halo_mod=&amp;lt;string&amp;gt;&lt;br /&gt;
    alpha=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
    offset=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
    blend_color=&amp;lt; red, green, blue &amp;gt;&lt;br /&gt;
    blend_ratio=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
    text=&amp;lt;string&amp;gt;&lt;br /&gt;
    text_color=&amp;lt; red, green, blue &amp;gt;&lt;br /&gt;
    submerge=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
    x=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
    y=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
    directional_x=&amp;lt;dev feature 1.9,progressive int&amp;gt;&lt;br /&gt;
    directional_y=&amp;lt;dev feature 1.9,progressive int&amp;gt;&lt;br /&gt;
    layer=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
    auto_hflip=&amp;lt;dev feature 1.9, boolean&amp;gt;&lt;br /&gt;
    auto_vflip=&amp;lt;dev feature 1.9, boolean&amp;gt;&lt;br /&gt;
    primary=&amp;lt;dev feature 1.9, boolean&amp;gt;&lt;br /&gt;
 [/frame]&lt;br /&gt;
&lt;br /&gt;
==== Progressive parameters ====&lt;br /&gt;
&lt;br /&gt;
Some parameters above are marked as ''progressive'' This means that you can specify that during the time the frame is displayed, the parameter should smoothly slide from one value to an other.&lt;br /&gt;
&lt;br /&gt;
A typical example would be a unit progressively fading out, becoming transparent&lt;br /&gt;
&lt;br /&gt;
To do that, you could use:&lt;br /&gt;
&lt;br /&gt;
 alpha=1~0&lt;br /&gt;
&lt;br /&gt;
To make a frame, which is 900ms long, slide to transparent for 300ms, stay transparent for another 300ms and finally fade back to normal for 300ms, use:&lt;br /&gt;
&lt;br /&gt;
 alpha=1~0:300,0:300,0~1:300&lt;br /&gt;
&lt;br /&gt;
you could also specify it like that&lt;br /&gt;
&lt;br /&gt;
 alpha=1~0,0,0~1&lt;br /&gt;
&lt;br /&gt;
when a timing is missing, the engine will do its best to fill in in a fair way. &lt;br /&gt;
&lt;br /&gt;
a progressive string has a similar syntax&lt;br /&gt;
&lt;br /&gt;
 halo=halo1.png:300,halo2.png:300,halo2.png:300&lt;br /&gt;
&lt;br /&gt;
==== Field Description ====&lt;br /&gt;
&lt;br /&gt;
** '''begin''': (deprecated) will be replaced by '''duration= &amp;lt;end - begin &amp;gt;'''&lt;br /&gt;
** '''end''': (deprecated) see '''begin''' and also [[AnimationWML#Timing.2C_Clock.2C_Multiple_animations|Timing, Clock, Multiple animations]] section for coverage of '''start_time''' which combines with '''duration''' to replace '''begin=''' '''end='''.&lt;br /&gt;
** '''duration''': how long the frame should be displayed. Use instead of '''begin=''' and '''end='''.&lt;br /&gt;
** '''image''': the image to display during the frame.&lt;br /&gt;
** '''image_diagonal''': the image to display when the attack occurs diagonally (directions ne,se,sw,nw).&lt;br /&gt;
** '''image_mod''': a string modifications (see [[ImagePathFunctionWML]] ) that will be applied to all images&lt;br /&gt;
** '''sound''': the sound to play when the frame begins. Can be a comma-separated list of sounds, in which case one of them is chosen randomly every time.&lt;br /&gt;
** '''halo''': the halo to display at the time.&lt;br /&gt;
** '''halo_x''': the position the halo is displayed in pixel relative to the unit's center.&lt;br /&gt;
** '''halo_y''': the position the halo is displayed in pixel relative to the unit's center.&lt;br /&gt;
** '''halo_mod''': a string modifications (see [[ImagePathFunctionWML]] ) that will be applied to all haloes&lt;br /&gt;
** '''alpha''': transparency level to apply to the frame. This is a floating point progressive parameter ranging from 0.0 to 1.0.&lt;br /&gt;
** '''offset''': the position of the image relative to the hex the unit is facing, 0.0 will display the unit in the center of the hex, 1.0 in the center of the faced hex, -1.0 at the center of the hex behind you. This is a progressive parameter.&lt;br /&gt;
** '''blend_color''': a comma separated list of numbers representing a color in RGB (0-255) this color will be mixed to the frame to give it a tint.&lt;br /&gt;
** '''blend_ratio''': this is a progressive parameter ranging from 0 to 1: 0 means no tint, 1 means target color only.&lt;br /&gt;
** '''text''': if specified, floats a label with the given text above the unit (identical to the floating damage and healing numbers).&lt;br /&gt;
** '''text_color''': the color of the above floating label.&lt;br /&gt;
** '''submerge''': the part of the unit that should drawn with 50% opacity (for units in water)&lt;br /&gt;
** '''x''': x offset applied to the frame&lt;br /&gt;
** '''y''': y offset applied to the frame&lt;br /&gt;
** '''directional_x''': x offset applied to the frame in the direction the unit is facing&lt;br /&gt;
** '''directional_y''': y offset applied to the frame in the direction the unit is facing&lt;br /&gt;
** '''layer''': layer used to draw the frame, see discussion bellow&lt;br /&gt;
** '''auto_hflip''': should the image flip horizontally depending on sprite orientation&lt;br /&gt;
** '''auto_vflip''': should the image flip vertically depending on sprite orientation&lt;br /&gt;
** '''primary''': should the engine consider that frame as a primary frame (affected by visual effects like stone and poison)&lt;br /&gt;
&lt;br /&gt;
=== Drawing related animation content ===&lt;br /&gt;
==== Syntax summary ====&lt;br /&gt;
 [animation]&lt;br /&gt;
   &amp;lt;animation choice related content&amp;gt;&lt;br /&gt;
   [frame]&lt;br /&gt;
     &amp;lt;frame content&amp;gt;&lt;br /&gt;
   [/frame]&lt;br /&gt;
   [frame]&lt;br /&gt;
     &amp;lt;frame content&amp;gt;&lt;br /&gt;
   [/frame]&lt;br /&gt;
   start_time=&amp;lt;integer&amp;gt;&lt;br /&gt;
   offset=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
   image_mod=&amp;lt;string&amp;gt;&lt;br /&gt;
   blend_with=&amp;lt;r,g,b&amp;gt;&lt;br /&gt;
   blend_ratio=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
   halo=&amp;lt;progressive_string&amp;gt;&lt;br /&gt;
   halo_x=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   halo_y=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   halo_mod=&amp;lt;string&amp;gt;&lt;br /&gt;
   submerge=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
   x=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   y=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   directional_x=&amp;lt;dev1.9,progressive int&amp;gt;&lt;br /&gt;
   directional_y=&amp;lt;dev1.9,progressive int&amp;gt;&lt;br /&gt;
   layer=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   [xxx_frame]&lt;br /&gt;
     &amp;lt;frame content&amp;gt;&lt;br /&gt;
   [/xxx_frame]&lt;br /&gt;
   xxx_start_time=&amp;lt;integer&amp;gt;&lt;br /&gt;
   xxx_image_mod=&amp;lt;string&amp;gt;&lt;br /&gt;
   xxx_offset=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
   xxx_blend_with=&amp;lt;r,g,b&amp;gt;&lt;br /&gt;
   xxx_blend_ratio=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
   xxx_halo=&amp;lt;progressive_string&amp;gt;&lt;br /&gt;
   xxx_halo_x=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   xxx_halo_y=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   xxx_halo_mod=&amp;lt;string&amp;gt;&lt;br /&gt;
   xxx_submerge=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
   xxx_x=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   xxx_y=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   xxx_directional_x=&amp;lt;dev1.9,progressive int&amp;gt;&lt;br /&gt;
   xxx_directional_y=&amp;lt;dev1.9,progressive int&amp;gt;&lt;br /&gt;
   xxx_layer=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 [/animation]&lt;br /&gt;
&lt;br /&gt;
==== Parameter handling ====&lt;br /&gt;
All drawing related parameters in '''[animation]''' can be matched with a corresponding parameter in  a '''[frame]''' block (or a '''[xxx_frame]''' block) The value provided in the animation will be used if no value is provided in the frame. &lt;br /&gt;
&lt;br /&gt;
The point of these two level of parameters is to easily be able to specify a parameter at the animation level and override it for a special case of frame.&lt;br /&gt;
&lt;br /&gt;
== How animations are chosen ==&lt;br /&gt;
Within a unit decription block there are multiple animations. Each animation is meant to be played in a very special set of circumstances. We will discuss here how to tell the animation engine when a given animation should be played. &lt;br /&gt;
&lt;br /&gt;
Let's take an example. Suppose we have a unit which has the skirmisher ability. We have the folowing movement animations :&lt;br /&gt;
* a normal walking animation&lt;br /&gt;
* a swimming animation when the unit is in water&lt;br /&gt;
* a tiptioeing animation when moving next to an ennemy unit&lt;br /&gt;
&lt;br /&gt;
Ok. most of the time it's easy to guess what animation should be. However if you are both in water and next to an ennemy unit, the animation to play is not obvious.&lt;br /&gt;
&lt;br /&gt;
To solve that question, each animation has a number of filtering criterias. The engine follow the following rules to select an animation&lt;br /&gt;
* Start with all animations&lt;br /&gt;
* Drop all animations with a criteria that fails on the current situation&lt;br /&gt;
* Take the animations that have the most maching criterias&lt;br /&gt;
* If there are more than one animation remaining, take an animation randomly&lt;br /&gt;
* If all animations have been droped, the engine will provide a smart default.&lt;br /&gt;
    &lt;br /&gt;
here is a pseudo-code explaination of this algorithm:&lt;br /&gt;
&lt;br /&gt;
 foreach animation&lt;br /&gt;
    animation_score = 0&lt;br /&gt;
    foreach filter-criteria&lt;br /&gt;
      if &amp;lt;criteria-fails&amp;gt; &lt;br /&gt;
          animation_score = -1;&lt;br /&gt;
          break;&lt;br /&gt;
      elsif &amp;lt;criteria-matches&amp;gt; &lt;br /&gt;
          animation_score++&lt;br /&gt;
    endfor&lt;br /&gt;
    if animation_score &amp;gt; max_score&lt;br /&gt;
        &amp;lt;empty animation list&amp;gt;&lt;br /&gt;
        max_score = animation_score;&lt;br /&gt;
        push(animation,animation_list);&lt;br /&gt;
    elsif animation_score = max_score&lt;br /&gt;
        push(animation,animation_list);&lt;br /&gt;
 endfor&lt;br /&gt;
 &amp;lt;choose an animation randomly from animation_list&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
Note that all animations don't have all the filters...&lt;br /&gt;
&lt;br /&gt;
so, if we have a unit with&lt;br /&gt;
# an animation for water terrain&lt;br /&gt;
# an animation for SE on grassland&lt;br /&gt;
# an animation with no criteria&lt;br /&gt;
# an animation for N,NE,NW,S,SW,SE&lt;br /&gt;
# an animation for NW&lt;br /&gt;
&lt;br /&gt;
* 3. will never be taken, because 4. will always trump it&lt;br /&gt;
* on water going NW, it can be 1. 4. 5.&lt;br /&gt;
* on water, any direction but NW, it will be 1. or 4.&lt;br /&gt;
* on SE grassland it will be 2.&lt;br /&gt;
* on other grasslands, it will be 4. (4. or 5. if NW)&lt;br /&gt;
&lt;br /&gt;
=== Generic animation filters available for all animations ===&lt;br /&gt;
* '''apply_to''': a list of comma separated keywords describing what event should trigger the animation (movement, attack...) the complete list is given below&lt;br /&gt;
* '''value''': a list of comma separated integer, the meaning depends on the triggering event. the meaning is given with the list of event&lt;br /&gt;
* '''value_second''': a list of comma separated integer, the meaning depends on the triggering event. the meaning is given with the list of event&lt;br /&gt;
* '''terrain''': a list of comma separated terrain letters, the animation will only be used on these terrains.  See [[FilterWML#Filtering Terrains|Filtering Terrains]].  this has been replaced by '''terrain_type'''&lt;br /&gt;
* '''terrain_type''': a list of comma separated terrain codes, the animation will only be used on matching terrains.  See [[FilterWML#Filtering Terrains|Filtering Terrains]].&lt;br /&gt;
* '''[filter]''': this will filter using a [[StandardUnitFilter|standard unit filter]] on the animated unit. Note that matching all criterias in the filter will only earn you one point for animation selection, but that you can have multiple '''[filter]''' blocks in an animation.&lt;br /&gt;
* '''[filter_second]''': this will filter using a [[StandardUnitFilter|standard unit filter]] on the unit in the hex faced. Note that matching all criteria in the filter will only earn you one point for animation selection, but that you can have multiple '''[filter_second]''' blocks in an animation. Also note that if the faced hex is empty, the whole filter will fail.&lt;br /&gt;
* '''direction''': a list of directions (n,ne,se,s,sw,nw), the animation will only be used when acting or moving in this direction (the attack direction for attack animations, moving direction for movement animations, direction of lead unit for leading animations, and so on).&lt;br /&gt;
* '''frequency''': this integer value allows to easily tweak the matching frequency of animations. The filter will fail n-1 times out of n, randomly. Note that unlike every other filter, matching this filter won't give an extra point.&lt;br /&gt;
* '''[filter_attack]''': a standard attack filter to match on the attacker's attack. See  [[FilterWML#Filtering Weapons|Filtering Weapons]]. &lt;br /&gt;
* '''[filter_second_attack]''': a standard attack filter to match on the defender's attack. See [[FilterWML#Filtering Weapons|Filtering Weapons]]. Also note that if the defender doesn't have any weapon to retaliate with, this filter will always fail. &lt;br /&gt;
* '''hits''': filters attack animations based on whether the attack hits, misses or kills. Accepts a list of the following:&lt;br /&gt;
** '''hit''': the attack hits, defender survives.&lt;br /&gt;
** '''no''' or '''miss''': the attack misses.&lt;br /&gt;
** '''kill''': the attack hits, defender dies.&lt;br /&gt;
** '''yes''': is an alias of '''hit,kill'''.&lt;br /&gt;
* '''swing''': a list of numbers representing the swing numbers this animation should match (numbered from 1). this has been replaced by value_second&lt;br /&gt;
* '''base_score''': {{DevFeature1.9}} : a number that will always be added to the score. Use with caution&lt;br /&gt;
&lt;br /&gt;
=== Events triggering animations and default animations ===&lt;br /&gt;
==== standing ====&lt;br /&gt;
This animation is triggered whenever any other animation is finished, and is played in loop until another animation is triggered&lt;br /&gt;
&lt;br /&gt;
this is the default &amp;quot;standing image&amp;quot; for the unit&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no standing animation is set a single frame animation based on the enclosing unit's '''image=''' field is used&lt;br /&gt;
==== selected ====&lt;br /&gt;
This animation is triggered whenever the unit is selected&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''blend_with=&amp;quot;0.0~0.3:100,0.3~0.0:200&amp;quot; blend_color=255,255,255''&lt;br /&gt;
==== recruited ====&lt;br /&gt;
This animation is triggered whenever the unit is recruited or recalled&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''highlight=0~1:600''&lt;br /&gt;
&lt;br /&gt;
==== recruiting ====&lt;br /&gt;
&lt;br /&gt;
This animation is triggered for the leader when a unit is recruited or recalled&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
no default animation is needed&lt;br /&gt;
&lt;br /&gt;
note that is not triggered for WML triggered animations&lt;br /&gt;
&lt;br /&gt;
==== levelin ====&lt;br /&gt;
This animation is triggered whenever the unit levels, before the unit is replaced by the new unit&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''blend_with=&amp;quot;1~0:600&amp;quot; blend_color=255,255,255''&lt;br /&gt;
==== levelout ====&lt;br /&gt;
This animation is triggered whenever the unit levels, after the unit is replaced by the new unit&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''blend_with=&amp;quot;0~1:600&amp;quot; blend_color=255,255,255''&lt;br /&gt;
==== movement ====&lt;br /&gt;
This animation is used whenever a unit moves. There are multiple things to consider when dealing with movement animation&lt;br /&gt;
* unit stay ''exactly'' 150ms in each hex. so you typically want to have an offset of ''0~1:150,0~1:150,0~1:150,0~1:150,0~1:150'' or something similar&lt;br /&gt;
* when a unit enters a hex, the current anim is tested again.&lt;br /&gt;
** if the current animation is still valid (i.e it passes all its filter) it is kept, whatever the final score is&lt;br /&gt;
** if it fails, a new movement anim is searched&lt;br /&gt;
&lt;br /&gt;
''value='' contains the number of steps already taken&lt;br /&gt;
&lt;br /&gt;
''value_second='' contains the number of steps left&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''offset=&amp;quot;0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
==== pre_movement ====&lt;br /&gt;
This animation is used before any unit movement&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0 &lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0 &lt;br /&gt;
&lt;br /&gt;
==== post_movement ====&lt;br /&gt;
This animation is used after any unit movement&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0 &lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
==== pre_teleport ====&lt;br /&gt;
This animation is triggered whenever the unit teleports, but before it has moved to the target hex&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''blend_with=&amp;quot;1~0:150&amp;quot; blend_color=255,255,255''&lt;br /&gt;
==== post_teleport ====&lt;br /&gt;
This animation is triggered whenever the unit teleports, but after it has moved to the target hex&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''blend_with=&amp;quot;0~1:150&amp;quot; blend_color=255,255,255''&lt;br /&gt;
==== healing ====&lt;br /&gt;
This animation is triggered when the unit has healing powers and uses them&lt;br /&gt;
&lt;br /&gt;
''value='' is the number of points healed&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
==== healed ====&lt;br /&gt;
This animation is triggered whenever the unit is healed for any reason&lt;br /&gt;
&lt;br /&gt;
''value='' is the number of points healed&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''blend_with=&amp;quot;0:30,0.5:30,0:30,0.5:30,0:30,0.5:30,0:30,0.5:30,0:30&amp;quot; blend_color=255,255,255''&lt;br /&gt;
and plays the sound ''heal.wav''&lt;br /&gt;
==== poisoned ====&lt;br /&gt;
This animation is triggered whenever the unit suffers poison dammage&lt;br /&gt;
&lt;br /&gt;
''value='' is the number of points lost&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''blend_with=&amp;quot;0:30,0.5:30,0:30,0.5:30,0:30,0.5:30,0:30,0.5:30,0:30&amp;quot; blend_color=0,255,0''&lt;br /&gt;
and plays the sound 'poison.ogg''&lt;br /&gt;
==== defend ====&lt;br /&gt;
This animation is triggered during a strike, of the unit receiving the blow&lt;br /&gt;
&lt;br /&gt;
''value='' is the number of point lost, if any&lt;br /&gt;
&lt;br /&gt;
''value_second='' is the number of the swing, starting from 1&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
==== attack ====&lt;br /&gt;
This animation is triggered during a strike, of the unit giving the blow&lt;br /&gt;
&lt;br /&gt;
''value='' is the number of damage dealt, if any&lt;br /&gt;
&lt;br /&gt;
''value_second='' is the number of the swing, starting from 1&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''offset=&amp;quot;0~0.6:150,0.6~0:150&amp;quot;'' for melee attacks&lt;br /&gt;
No default is provided for range attacks&lt;br /&gt;
==== leading ====&lt;br /&gt;
This animation is triggered for units with the leading special ability, when the unit they are leading is attacking&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is the number of the swing, starting from 1&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== resistance ====&lt;br /&gt;
This animation is triggered for units with the resistance special ability affecting neighbouring fights, when the unit they are helping is defending&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is the number of the swing, starting from 1&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
&lt;br /&gt;
==== death ====&lt;br /&gt;
This animation is triggered when a unit die.&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''highlight=1~0:600'' and plays the sound in ''die_sound='' of the enclosing unit&lt;br /&gt;
==== victory ====&lt;br /&gt;
This animation is triggered when a unit finishes a fight by killing the other unit&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
==== idling ====&lt;br /&gt;
This animation is called when the unit has been using its standing animation for a random duration.&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
&lt;br /&gt;
==== draw_weapon ====&lt;br /&gt;
This animation is played before a fight&lt;br /&gt;
&lt;br /&gt;
''hit='' is set to HIT for the attacker and MISS for the defender&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
&lt;br /&gt;
==== sheath_weapon ====&lt;br /&gt;
This animation is played after a fight simultaneously for all surviving units&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
&lt;br /&gt;
==== default ====&lt;br /&gt;
&lt;br /&gt;
This animation is never triggered, but is used as a base to create new animations&lt;br /&gt;
&lt;br /&gt;
''value='' is used depending of the type of animation it replaces&lt;br /&gt;
&lt;br /&gt;
''value_second='' is used depending of the type of animation it replaces&lt;br /&gt;
&lt;br /&gt;
A single animation made of the base frame is provided by the engine if no default animation is available&lt;br /&gt;
&lt;br /&gt;
==== extra animations ====&lt;br /&gt;
Other values are never called by the engine. However they can be triggered by WML events allowing custom animations.&lt;br /&gt;
&lt;br /&gt;
Note that WML events can also trigger standard animations.&lt;br /&gt;
''value='' is set from the WML event&lt;br /&gt;
&lt;br /&gt;
''value_second='' is set from the WML event&lt;br /&gt;
&lt;br /&gt;
== Shortcuts, tricks and quirks ==&lt;br /&gt;
&lt;br /&gt;
=== ''[if]'' and ''[else]'' ===&lt;br /&gt;
&lt;br /&gt;
Often, you need to do very slight variations in an animation (like a different sound depending on whether the unit hits or misses its attack), the '''[if]''' and '''[else]''' tags are meant to help you do that.  ('''Attention:''' These do not have the same syntax as the action tag [if] and its subtag [else] in [[ConditionalActionsWML]].)&lt;br /&gt;
    &lt;br /&gt;
Using these in an animation is equivalent to having multiple animations, one with the '''[if]''' block and one with each of the ''[else]'' blocks. Any filtering flags in these blocks will replace the toplevel filters. You can have multiple '''[if]''' blocks in an animation, but you can't nest an '''[if]''' inside another. These should be written directly inside the '''[animation]''' block. The following example would make the '''[frame]''' inside the '''[if]''' be played when the attack misses, and the '''[frame]''' inside the '''[else]''' be played when the attack hits (producing a different sound):&lt;br /&gt;
&lt;br /&gt;
    [if]&lt;br /&gt;
        hits=no&lt;br /&gt;
        [frame]&lt;br /&gt;
            begin=-100&lt;br /&gt;
            end=100&lt;br /&gt;
            image=&amp;quot;units/dwarves/lord-attack.png&amp;quot;&lt;br /&gt;
            sound={SOUND_LIST:MISS}&lt;br /&gt;
        [/frame]&lt;br /&gt;
    [/if]&lt;br /&gt;
    [else]&lt;br /&gt;
        hits=yes&lt;br /&gt;
        [frame]&lt;br /&gt;
            begin=-100&lt;br /&gt;
            end=100&lt;br /&gt;
            image=&amp;quot;units/dwarves/lord-attack.png&amp;quot;&lt;br /&gt;
            sound=axe.ogg&lt;br /&gt;
        [/frame]&lt;br /&gt;
    [/else]&lt;br /&gt;
&lt;br /&gt;
note that this is very close to preprocessing and should be considered as such, especially with regard to scoring and animation selection&lt;br /&gt;
&lt;br /&gt;
=== Simplified animation blocks ===&lt;br /&gt;
To simplify the most common animation cases, you can use different blocks instead of the generic '''[animation]''' block. These are also here for backward compatibility, but are not deprecated and fully supported&lt;br /&gt;
&lt;br /&gt;
some of these use extra tags which are translated in the normal ''value='' tag&lt;br /&gt;
&lt;br /&gt;
some of these define '''[xxx_frame]''' blocks where the frame prefix starts with an underscore. This is not allowed in normal WML (prefix starting with underscore is reserved for the engine internal use). It is here for clarity purpose&lt;br /&gt;
&lt;br /&gt;
* '''[leading_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=leading&lt;br /&gt;
* '''[recruit_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=recruited&lt;br /&gt;
* '''[recruiting_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=recruiting&lt;br /&gt;
* '''[standing_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=standing,default&lt;br /&gt;
note for 1.4 :''default'' doesn't exist in 1.4, but the semantic is the same.&lt;br /&gt;
&lt;br /&gt;
i.e: the animation will be used to build default animations&lt;br /&gt;
* '''[idle_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=idling&lt;br /&gt;
* '''[levelin_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=levelin&lt;br /&gt;
* '''[levelout_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=levelout&lt;br /&gt;
* '''[healing_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=healing&lt;br /&gt;
 value=&amp;lt;damage= value&amp;gt;&lt;br /&gt;
* '''[healed_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=healed&lt;br /&gt;
 value=&amp;lt;healing= value&amp;gt;&lt;br /&gt;
 [_healed_sound_frame]&lt;br /&gt;
    sound=heal.wav&lt;br /&gt;
 [/_healed_sound_frame]&lt;br /&gt;
* '''[poison_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=poisoned&lt;br /&gt;
 value=&amp;lt;damage= value&amp;gt;&lt;br /&gt;
 [_poison_sound_frame]&lt;br /&gt;
    sound=poison.ogg&lt;br /&gt;
 [/_poison_sound_frame]&lt;br /&gt;
* '''[movement_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=movement&lt;br /&gt;
 offset=&amp;quot;0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150&amp;quot;&lt;br /&gt;
* '''[pre_movement_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=pre_movement&lt;br /&gt;
* '''[post_movement_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=post_movement&lt;br /&gt;
* '''[draw_weapon_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=draw_weapon&lt;br /&gt;
* '''[sheath_weapon_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=sheath_weapon_movement&lt;br /&gt;
* '''[defend]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=defend&lt;br /&gt;
 value=&amp;lt;damage= value&amp;gt;&lt;br /&gt;
 &amp;lt;WML content&amp;gt;&lt;br /&gt;
 [frame]&lt;br /&gt;
    blend_with=255,0,0&lt;br /&gt;
    blend_ratio=&amp;quot;0.5:50,0.0:50&amp;quot;&lt;br /&gt;
 [/frame]&lt;br /&gt;
&lt;br /&gt;
there are some subtil change compared to what is described above to avoid the red flash when value=0, but it should work as expected as far as WML author are concerned&lt;br /&gt;
 &lt;br /&gt;
* '''[attack_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
if the animation contains a missile frame&lt;br /&gt;
&lt;br /&gt;
 apply_to=attack&lt;br /&gt;
 missile_offset=&amp;quot;0~0.8&amp;quot;&lt;br /&gt;
&lt;br /&gt;
else&lt;br /&gt;
&lt;br /&gt;
 apply_to=attack&lt;br /&gt;
 offset=&amp;quot;0~0.6,0.6~0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* '''[death]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=death&lt;br /&gt;
 [_death_sound_frame]&lt;br /&gt;
    sound=&amp;lt;die_sound= of the enclosing [unit] tag&amp;gt;&lt;br /&gt;
 [/_death_sound_frame]&lt;br /&gt;
* '''[victory_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=victory&lt;br /&gt;
* '''[extra_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=&amp;lt;flag= value of the anim&amp;gt;&lt;br /&gt;
* '''[teleport_anim]''' will be cut into two at the clock-time 0&lt;br /&gt;
everything before zero becomes an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=pre_teleport&lt;br /&gt;
everything after zero becomes an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=post_teleport&lt;br /&gt;
&lt;br /&gt;
== Layering ==&lt;br /&gt;
The ''layer'' progressive parameter allows the animation writer to choose in what order the animation should be drawn.&lt;br /&gt;
&lt;br /&gt;
this value must be between 0 and 100&lt;br /&gt;
&lt;br /&gt;
* the back of haloes is drawn with a value of 10&lt;br /&gt;
* when unspecified, a animation is drawn with a value of 40&lt;br /&gt;
* terrain elements that are supposed to go in front of units (castles) are drawn with a value of 50&lt;br /&gt;
* orbs and status bars are drawn on layer 80&lt;br /&gt;
* when unspecified missile frames are drawn on layer 90&lt;br /&gt;
&lt;br /&gt;
by changing these values, it is easy to have the unit display the way you want&lt;br /&gt;
&lt;br /&gt;
== Optimization ==&lt;br /&gt;
&lt;br /&gt;
there is a special flag that goes into the animation block (not the frame) &lt;br /&gt;
&lt;br /&gt;
* ''offscreen'' a boolean saying if the unit's animation should be played when the unit is offscreen. You want the animation to play offscreen if the animation contains some usefull sound effects.This attribute defaults to true (play offscreen) except for standing and idle animations where it defaults to false&lt;br /&gt;
&lt;br /&gt;
== Cycling ==&lt;br /&gt;
&lt;br /&gt;
there is a special boolean parameter that can be put in an animation block (not the frame)&lt;br /&gt;
&lt;br /&gt;
* ''cycles'' a boolean value. if set to true the animation will cycles forever until it is replaced. That animation will not influence the end time of all related animations (for example a cycling defense animation will play normally but the overall duration of the fight animation will be only decided by the attack animation)&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[UnitTypeWML]]&lt;br /&gt;
* [[ReferenceWML]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: WML Reference]]&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SoC_Ideas_Sprite_Sheets2011&amp;diff=41433</id>
		<title>SoC Ideas Sprite Sheets2011</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SoC_Ideas_Sprite_Sheets2011&amp;diff=41433"/>
		<updated>2011-03-31T21:54:18Z</updated>

		<summary type="html">&lt;p&gt;Boucman: /* Additional Information */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:SoC2011Idea}}&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&amp;lt;h2&amp;gt;Allow wesnoth to support spritesheets&amp;lt;/h2&amp;gt;&lt;br /&gt;
Page for the idea: [[SoC_Ideas_Sprite_Sheets2011]]&lt;br /&gt;
&lt;br /&gt;
Currently, all the Wesnoth unit animations are based on thousands of small png&lt;br /&gt;
images, each image representing the unit in a single pose. For terrains the&lt;br /&gt;
situation is the same, it has a base image with a lot of transitions to other&lt;br /&gt;
terrains, which are now stored as seperate images.&lt;br /&gt;
&lt;br /&gt;
In a sprite sheet approach, each unit is represented by a single, huge, image&lt;br /&gt;
where all the unit images are put on a mosaïc pattern and the game knows where&lt;br /&gt;
to look for a given image.&lt;br /&gt;
&lt;br /&gt;
The advantage of having a large image with all positions is that it's more&lt;br /&gt;
efficient in memory. Also one large file is more effecient on the harddisk and&lt;br /&gt;
faster to load than a lot of smaller files. So the change to spritesheets will&lt;br /&gt;
have a lot of advantages.&lt;br /&gt;
&lt;br /&gt;
Regarding the implementation the student is free to come up with his/her own&lt;br /&gt;
solution and discuss that with the developers during the application period.&lt;br /&gt;
&lt;br /&gt;
{{#dpl:&lt;br /&gt;
 |resultsheader=''There are %PAGES% submitted student proposals for this idea''&lt;br /&gt;
 |oneresultheader=''There is 1 submitted student proposal for this idea''&lt;br /&gt;
 |suppresserrors=true&lt;br /&gt;
 |noresultsheader=''There are no submitted student proposals for this idea''&lt;br /&gt;
 |category=Summer of Code 2011 Student Page&amp;amp;SoC Ideas Sprite Sheets2011&lt;br /&gt;
 |notcategory=SoC 2011 Not Submitted To Google&lt;br /&gt;
 |include=#Description&lt;br /&gt;
 |mode=userformat&lt;br /&gt;
 |format=,,&amp;lt;br/&amp;gt;See [[%PAGE%|%TITLE%]] for more information.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;,&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Additional Information =&lt;br /&gt;
* How to build those huge sheets from our current images set?&lt;br /&gt;
* Wesnoth does not have a fixed number of frames per unit, nor does it have a fixed size for each unit frame. A naïve approach to the problem will not work.&lt;br /&gt;
== Small mail sent on the dev ML but of general interest for any student studying that proposal ==&lt;br /&gt;
The big problem with spritesheets is that a unit is made of lots of&lt;br /&gt;
images each with different sizes, and we would like to be able to work&lt;br /&gt;
with spritesheed in a non-tedious manner&lt;br /&gt;
* not tedious for artists that want to work with single images, which means either a tool to automate building spritesheets or being able to mix frames from images and from spritesheets or both. being able to re-split a spritesheet would probably be usefull too&lt;br /&gt;
* not tedious for animation developers, i.e never have to calculate coordinates and sizes to fill WML data, it could either be generated from the spritesheet, or the spritesheet could somehow contain the information (like a pink border around frames)&lt;br /&gt;
* not tedious (of course) for artists that like working directly with spritesheets. I don't know very well what their constraints would be&lt;br /&gt;
* not having to change the current WML would be a plus&lt;br /&gt;
&lt;br /&gt;
your proposal doesn't really explain how to solve all these problems,nor did you show that you studied how images are currently loaded in wesnoth, and now current code would be impacted. Hint: that's all in src/image.?pp&lt;br /&gt;
&lt;br /&gt;
here is an idea on how to do it, though you should build on it, not just redescribe what i'm putting below.&lt;br /&gt;
&lt;br /&gt;
WML is unchanged, i.e WML refer to image files without any special information&lt;br /&gt;
* in every image directory we add an image with a special name that is the spritesheet for that directory, and a WML file that matches filenames from that directory with the position in the spritesheet&lt;br /&gt;
* when the game is looking for an image, if the file exists it loads the file, if not it loads it from the spritesheet&lt;br /&gt;
* a tool is provided to take all images in a directory and make the spritesheet + WML (a reverse tool could be usefull but not mandatory)&lt;br /&gt;
&lt;br /&gt;
So, if an artist edits a spritesheet, the new image is loaded correctly, if an artist would rather use the image instead, he just has to add the image in the directory and it would complement the spritesheet or replace what's on the spritesheet transparently.&lt;br /&gt;
&lt;br /&gt;
As part of the release packaging, spritesheets would be regenerated so distributed content would be spritesheet based&lt;br /&gt;
&lt;br /&gt;
there are a few problems remaining with that, but i'll let you and any other potential student find them out and solve them :)&lt;br /&gt;
&lt;br /&gt;
= Whom to ask about this =&lt;br /&gt;
* Boucman (developer for the unit animation engine)&lt;br /&gt;
* thespaceinvader (artist, for usability questions)&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=EasyCoding&amp;diff=40842</id>
		<title>EasyCoding</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=EasyCoding&amp;diff=40842"/>
		<updated>2011-03-18T21:30:10Z</updated>

		<summary type="html">&lt;p&gt;Boucman: /* Option to disable terrain animations globally */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Foreword ==&lt;br /&gt;
This page is here to document easy to do coding tasks. It is not here to double the feature request database, and should only be filled by people that know the code well enough to judge the difficulty of a given task. &lt;br /&gt;
&lt;br /&gt;
If you are such a person, you should feel free to edit this page.&lt;br /&gt;
&lt;br /&gt;
If you're not, you should post a feature request and discuss your idea on the forum or IRC. A coder with better knowledge of the code might give you the green light to add your feature here.&lt;br /&gt;
&lt;br /&gt;
Anybody should feel free to add &amp;quot;clues&amp;quot; to any tasks, that is entry points, traps to avoid, person to contact to discuss and so on.&lt;br /&gt;
&lt;br /&gt;
If you plan to work on a feature, write your name at the bottom of the feature, with the date. Note that if you are too long at working on a feature I'll &amp;quot;free&amp;quot; it back (that is if you're not working on it. If you have problems implementing it, just tell us....)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[User:Boucman|Boucman]] 20:48, 3 October 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since bugs are sometimes a good opportunity to get a first idea of the code, i will add some here that are easy to fix as soon as i stumble upon them (the one i had in mind is fixed already ;-).&lt;br /&gt;
&lt;br /&gt;
--Yogi Bear, 28 February 2008&lt;br /&gt;
&lt;br /&gt;
== MP related features ==&lt;br /&gt;
&lt;br /&gt;
== WML related features ==&lt;br /&gt;
&lt;br /&gt;
=== Make map-related FormulaAI functions accessible to WML ===&lt;br /&gt;
As described in this forum post [http://forums.wesnoth.org/viewtopic.php?p=481087#p481087],&lt;br /&gt;
some of the FormulaAI functions should be made available as core functions instead of AI only functions, e.g. distance_between(). Full list of FormulaAI functions is available here: [http://wiki.wesnoth.org/FormulaAI_Functions]&lt;br /&gt;
&lt;br /&gt;
=== WML configurable village income / upkeep ===&lt;br /&gt;
Preferably as a [scenario], [side] or [campaign] keys. As per FR #6301 [https://gna.org/bugs/?6301]. Patch submitted: [https://gna.org/patch/index.php?1162] (gabba)&lt;br /&gt;
&lt;br /&gt;
--[[User:Boucman|Boucman]] 08:56, 28 February 2010 (UTC) : this is postponed for 1.8, can be considered reserved&lt;br /&gt;
&lt;br /&gt;
=== Add support of [if] for [scenario] ===&lt;br /&gt;
As per FR #4539 [https://gna.org/bugs/?4539]&lt;br /&gt;
&lt;br /&gt;
=== Side-specific results ===&lt;br /&gt;
Giving result=defeat or result=victory for specific sides. ([http://gna.org/bugs/index.php?4960 FR #4960]) -- [[User:dlr365|dlr365]] -- patch submitted [https://gna.org/bugs/index.php?4960]&lt;br /&gt;
&lt;br /&gt;
--[[User:Boucman|Boucman]] 08:58, 28 February 2010 (UTC) Patch seems abandonned, but can be used for further work feel free to take over the FR&lt;br /&gt;
&lt;br /&gt;
=== Support for leaderless multiplayergames ===&lt;br /&gt;
Add support for the WML key victory_when_enemies_defeated= in the scenario tag during multiplayergames. ([https://gna.org/bugs/index.php?8106 FR #8106])&lt;br /&gt;
--[[User:Endercoaster|endercoaster]] 30, March 2010. I'm gonna give this one a try.&lt;br /&gt;
&lt;br /&gt;
=== Support for standalone multiplayer scenarios ===&lt;br /&gt;
There used to be support for standalone scenarios in the userdata tree, in reorganising the trees this feature got lost and an add-on is now required to add a scenario.&lt;br /&gt;
Re-add this feature. It is probably a good idea to mirror the mainline multiplayer tree.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Support variable recall cost in wml ===&lt;br /&gt;
see https://gna.org/bugs/?16538&lt;br /&gt;
&lt;br /&gt;
the syntax needs to be discussed and refined, but the overall idea is good&lt;br /&gt;
&lt;br /&gt;
make sure to update whiteboard to handle this correctly&lt;br /&gt;
&lt;br /&gt;
Ask Boucman&lt;br /&gt;
&lt;br /&gt;
=== Other Ideas ===&lt;br /&gt;
See [[FutureWML]]; some ideas there are easier than others.&lt;br /&gt;
&lt;br /&gt;
== Improvements to AI ==&lt;br /&gt;
&lt;br /&gt;
Fix some todos, add new formula functions, or do minor improvements to the formula language. Make it easier to debug the formula language, add more ai components.&lt;br /&gt;
&lt;br /&gt;
Please discuss these with Crab, Dragonking, Sirp or Boucman&lt;br /&gt;
&lt;br /&gt;
=== AI Batch testing ===&lt;br /&gt;
&lt;br /&gt;
Finish patch #1169 [https://gna.org/patch/?1169]&lt;br /&gt;
&lt;br /&gt;
=== Add more ai actions ===&lt;br /&gt;
&lt;br /&gt;
Add an ai action (and add formula_ai function to do that) to set a goto on a unit&lt;br /&gt;
&lt;br /&gt;
Add an ai action (and add formula_ai function to do that) to send a chat message to a player&lt;br /&gt;
&lt;br /&gt;
Add an ai action to set formula ai variable (convert existing code from formula_ai)&lt;br /&gt;
&lt;br /&gt;
Add an ai action to set formula ai unit variable (convert existing code from formula_ai)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Add an ai action  (and add formula_ai function to do that) to fire a WML event &lt;br /&gt;
&lt;br /&gt;
=== write a (fai or c++ or lua) candidate action for leader control ===&lt;br /&gt;
&lt;br /&gt;
=== write a (fai or c++ or lua) candidate action for using leadership/illuminate  ===&lt;br /&gt;
special handling of units with leadership to have them support units. Only do it if it actually is useful (less hits needed to kill the unit) and ability to help multiple units in a single turn (assuming enough MP)&lt;br /&gt;
&lt;br /&gt;
=== write a (fai or c++ or lua) candidate action for healer control ===&lt;br /&gt;
Handle units with healing power, moving them at places where they can provide the most healing&lt;br /&gt;
&lt;br /&gt;
=== berserker improvement ===&lt;br /&gt;
The default AI's strategy of attacking as much as possible is very bad with berserker... A simple AI that would prevent the berserker from attacking (and keeping him close to fight without being exposed) and attack when the chance to kill is high enough would be an interesting addition&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== power projection improvement ===&lt;br /&gt;
AI sometimes wants to calculate 'how much firepower can enemy bring on location X'. in doing so, it considers enemy possible moves, time of day, attacks, enemy defense, etc.&lt;br /&gt;
There is specific problem with 'time_of_day' used in that calculation -sometimes, it's really needed to check 'time of day for NEXT turn', not time of day for THIS turn.(since the time of day might change next turn). &lt;br /&gt;
&lt;br /&gt;
power_projection must be fixed to account for the possibility of time_of_day being different.&lt;br /&gt;
&lt;br /&gt;
Note that some enemies might go after us (so, still on THIS turn), and some - before us (so, their next turn will be on NEXT turn).&lt;br /&gt;
&lt;br /&gt;
== GUI related features ==&lt;br /&gt;
-------------------&lt;br /&gt;
&lt;br /&gt;
Note at the moment Mordante is working on a new GUI system, these &lt;br /&gt;
changes will probably affect the way these items need to be implemented.&lt;br /&gt;
Contact Mordante on IRC before starting to work on these.&lt;br /&gt;
  &lt;br /&gt;
--[[User:SkeletonCrew|SkeletonCrew]] 14:04, 9 March 2008 (EDT)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Theme Changes ===&lt;br /&gt;
&lt;br /&gt;
* allow custom themes to display values of WML variables ([http://gna.org/bugs/index.php?6209 FR #6209])&lt;br /&gt;
* hide the hourglass item from the statusbar when there is no timer&lt;br /&gt;
&lt;br /&gt;
=== Widget Changes ===&lt;br /&gt;
* show side number, name and team association information in the status table &lt;br /&gt;
* make games sortable in the lobby (open slots, total number of players, era, XP modifier, gold per village, fog/shroud) &lt;br /&gt;
* input history (chat, commands, ..) - note: rujasu is working on this feature&lt;br /&gt;
=== Story Screen improvements ===&lt;br /&gt;
see http://www.wesnoth.org/forum/viewtopic.php?p=439346#p439346 for the suggestion and https://gna.org/patch/?1587 for a patch that already touched that area heavily&lt;br /&gt;
&lt;br /&gt;
== GUI2 related features ==&lt;br /&gt;
GUI2 is the new gui engine Mordante/SkeletonCrew is working on. &lt;br /&gt;
* Information on the wiki can be found here http://www.wesnoth.org/wiki/GUIToolkit&lt;br /&gt;
* The source code is under src/gui/&lt;br /&gt;
* The configuration config files are under data/gui/default&lt;br /&gt;
&lt;br /&gt;
Some tasks need the --new-widgets since the code is only shown in the experimental mode. Tasks which need this switch have the * in the title.&lt;br /&gt;
&lt;br /&gt;
At the moment there are no easy tasks available.&lt;br /&gt;
&lt;br /&gt;
== Miscellaneous ==&lt;br /&gt;
&lt;br /&gt;
=== More powerful village naming ===&lt;br /&gt;
'''Adding mountain names and other features to village names, having a second random name in village names'''&lt;br /&gt;
&lt;br /&gt;
Currently the village naming engine has a very good structure that could allow &lt;br /&gt;
more powerfull names to be generated. &lt;br /&gt;
Understanding how it works should be quite easy, and a few usefull improvements could be added.&lt;br /&gt;
&lt;br /&gt;
* Currently villages can use lake names and river names, this should be extended to other features like bridges, swamps, mountains etc...&lt;br /&gt;
* It would be nice to have a separate list of &amp;quot;first sylabus&amp;quot; and &amp;quot;last sylabus&amp;quot; for naming. That's not really needed in english, but some translations could use it&lt;br /&gt;
* Again, it is common to have villages with more than one &amp;quot;random&amp;quot; word in them. having a $name2 variable would be nice&lt;br /&gt;
&lt;br /&gt;
Euschn 24/03/2009&lt;br /&gt;
&lt;br /&gt;
=== Debug Mode ===&lt;br /&gt;
* New debug command functionality (setting additional status.variables, possibly terrain)&lt;br /&gt;
=== Option to disable terrain animations globally ===&lt;br /&gt;
see https://gna.org/bugs/?15976&lt;br /&gt;
&lt;br /&gt;
please think a little about use cases (editor, game etc...)&lt;br /&gt;
&lt;br /&gt;
ask boucman for details&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Add a cycle parameter to the unit animation WML ===&lt;br /&gt;
&lt;br /&gt;
Animations have a &amp;quot;cycle&amp;quot; internal parameter that decides if the animation loops when it finishes. &lt;br /&gt;
&lt;br /&gt;
Right now that parameter is decided purely by the engine depending on the circumstances, but it would make sense to move it to a frame paramter.&lt;br /&gt;
&lt;br /&gt;
This task is mainly to add a new boolean parameter in the particle class and using/exposing it to WML in a way similar to a unit_frame&lt;br /&gt;
&lt;br /&gt;
ask boucman for details&lt;br /&gt;
&lt;br /&gt;
== Bugs ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
[[NotSoEasyCoding]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Future]]&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SoC_Ideas_Simple_Content_Manager&amp;diff=40728</id>
		<title>SoC Ideas Simple Content Manager</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SoC_Ideas_Simple_Content_Manager&amp;diff=40728"/>
		<updated>2011-03-09T21:34:52Z</updated>

		<summary type="html">&lt;p&gt;Boucman: /* Whom to ask about this */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{SoC2011Idea}}&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
&amp;lt;h2&amp;gt;Create a simple content manager frontend for non-technical users&amp;lt;/h2&amp;gt;&lt;br /&gt;
More info at [[SoC_Ideas_Simple_Content_Manager]]&lt;br /&gt;
&lt;br /&gt;
Wesnoth has all sorts of contributors that are not coders (translators, graphists, multiplayer developers, musicians, etc)&lt;br /&gt;
&lt;br /&gt;
A large part of these users don't know how to use content managers (git, svn, etc...) and are not interested in learning. Wesnoth has been looking for a simple frontend to the most common content managers for those developers but none of these are simple enough for our use case. &lt;br /&gt;
&lt;br /&gt;
{{#dpl:&lt;br /&gt;
 |resultsheader=''There are %PAGES% submitted student proposals for this idea''&lt;br /&gt;
 |oneresultheader=''There is 1 submitted student proposal for this idea''&lt;br /&gt;
 |suppresserrors=true&lt;br /&gt;
 |noresultsheader=''There are no submitted student proposals for this idea''&lt;br /&gt;
 |category=Summer of Code 2011 Student Page&amp;amp;SoC Ideas IDEA NAME&lt;br /&gt;
 |notcategory=SoC 2011 Not Submitted To Google&lt;br /&gt;
 |include=#Description&lt;br /&gt;
 |mode=userformat&lt;br /&gt;
 |format=,,&amp;lt;br/&amp;gt;See [[%PAGE%|%TITLE%]] for more information.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;,&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=Additional information=&lt;br /&gt;
&lt;br /&gt;
This task would be to develop a front end for the most common SCM that would mask completely the underlying tool and would target people that want to contribute to open source, are not technically inclined, and don't want to learn. This tool would implement a minimal subset of SCM features with the philosophy that the user has the support of technicall people to do complicated tasks&lt;br /&gt;
&lt;br /&gt;
the following feature list is here to help understand the use-case for the tool&lt;br /&gt;
&lt;br /&gt;
'''things the tool might do'''&lt;br /&gt;
* update repository wrt distant repository&lt;br /&gt;
* commit to distant repository&lt;br /&gt;
* prepare a bundle to attach to a mail&lt;br /&gt;
* switch branch &lt;br /&gt;
* resolve merge conflicts&lt;br /&gt;
* build a report on the underlying SCM situation to allow debugging by someone else&lt;br /&gt;
* register as a handler to svn:// and git://&lt;br /&gt;
&lt;br /&gt;
'''things the tool shouldn't do''&lt;br /&gt;
* create a new project (if you want to do that, you should learn the real tool)&lt;br /&gt;
* create a new branch (a person with the real tool can do that on the repository for you in the rare case it's needed)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''other misc constraints'''&lt;br /&gt;
* python is the prefered language (all of wesnoth tool are in python) java could be used too (we already have some java code, so maintainability should be ok)&lt;br /&gt;
* it should be SCM agnostic (the point is to lower the barrier to entry for non-technical users)&lt;br /&gt;
* the UI should not be frightening to non-technical people (I.E give some thought to UI design in your proposal)&lt;br /&gt;
* it should integrate as properly as possible into the OS&lt;br /&gt;
* it should work on windows, Mac and linux&lt;br /&gt;
&lt;br /&gt;
= Whom to ask about this =&lt;br /&gt;
* Boucman (original idea)&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SoC_Ideas_Sprite_Sheets2011&amp;diff=40727</id>
		<title>SoC Ideas Sprite Sheets2011</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SoC_Ideas_Sprite_Sheets2011&amp;diff=40727"/>
		<updated>2011-03-09T21:34:14Z</updated>

		<summary type="html">&lt;p&gt;Boucman: /* Whom to ask about this */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:SoC2011Idea}}&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&amp;lt;h2&amp;gt;Allow wesnoth to support spritesheets&amp;lt;/h2&amp;gt;&lt;br /&gt;
Page for the idea: [[SoC_Ideas_Sprite_Sheets2011]]&lt;br /&gt;
&lt;br /&gt;
Currently, all the Wesnoth unit animations are based on thousands of small png&lt;br /&gt;
images, each image representing the unit in a single pose. For terrains the&lt;br /&gt;
situation is the same, it has a base image with a lot of transitions to other&lt;br /&gt;
terrains, which are now stored as seperate images.&lt;br /&gt;
&lt;br /&gt;
In a sprite sheet approach, each unit is represented by a single, huge, image&lt;br /&gt;
where all the unit images are put on a mosaïc pattern and the game knows where&lt;br /&gt;
to look for a given image.&lt;br /&gt;
&lt;br /&gt;
The advantage of having a large image with all positions is that it's more&lt;br /&gt;
efficient in memory. Also one large file is more effecient on the harddisk and&lt;br /&gt;
faster to load than a lot of smaller files. So the change to spritesheets will&lt;br /&gt;
have a lot of advantages.&lt;br /&gt;
&lt;br /&gt;
Regarding the implementation the student is free to come up with his/her own&lt;br /&gt;
solution and discuss that with the developers during the application period.&lt;br /&gt;
&lt;br /&gt;
{{#dpl:&lt;br /&gt;
 |resultsheader=''There are %PAGES% submitted student proposals for this idea''&lt;br /&gt;
 |oneresultheader=''There is 1 submitted student proposal for this idea''&lt;br /&gt;
 |suppresserrors=true&lt;br /&gt;
 |noresultsheader=''There are no submitted student proposals for this idea''&lt;br /&gt;
 |category=Summer of Code 2011 Student Page&amp;amp;SoC Ideas Sprite Sheets2011&lt;br /&gt;
 |notcategory=SoC 2011 Not Submitted To Google&lt;br /&gt;
 |include=#Description&lt;br /&gt;
 |mode=userformat&lt;br /&gt;
 |format=,,&amp;lt;br/&amp;gt;See [[%PAGE%|%TITLE%]] for more information.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;,&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Additional Information =&lt;br /&gt;
* How to build those huge sheets from our current images set?&lt;br /&gt;
* Wesnoth does not have a fixed number of frames per unit, nor does it have a fixed size for each unit frame. A naïve approach to the problem will not work.&lt;br /&gt;
&lt;br /&gt;
= Whom to ask about this =&lt;br /&gt;
* Boucman (developer for the unit animation engine)&lt;br /&gt;
* thespaceinvader (artist, for usability questions)&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SoC_Information_for_Google&amp;diff=40726</id>
		<title>SoC Information for Google</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SoC_Information_for_Google&amp;diff=40726"/>
		<updated>2011-03-09T21:20:15Z</updated>

		<summary type="html">&lt;p&gt;Boucman: /* If you are a large organization who is vouching for a small organization applying to GSoC for their first time this year, please list their name and why you think they'd be good candidates for GSoC here: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:SoC2011}}&lt;br /&gt;
&lt;br /&gt;
== SoC Information for Google ==&lt;br /&gt;
This is the info that we submit to google as Application in Summer of Code (current status: 2010). The submitter automatically becomes primary Admin. Most entries are mandatory and have to be filled out before the application can be submitted.&lt;br /&gt;
&lt;br /&gt;
==== Organization Name: ====&lt;br /&gt;
Battle for Wesnoth&lt;br /&gt;
&lt;br /&gt;
==== Description: ====&lt;br /&gt;
''Battle for Wesnoth'', or simply ''Wesnoth'', is a free, turn-based strategy game with role-playing elements that was designed in June 2003 by David White (Sirp).&lt;br /&gt;
&lt;br /&gt;
Although the core rules are fairly simple and meant to be easily learned[1], they provide interesting gameplay and rich tactical options. A major strength of the project is the Wesnoth Markup Language (WML) for writing scenarios. Programming skills are not required to compose with it, and a large WML-modding community has generated a great deal of user-maintained content. We polish the best of this content and lift it into our official release tree.&lt;br /&gt;
&lt;br /&gt;
The first stable release (1.0) was on October 2, 2005, and the latest stable release (1.8) happened in april 2010. Version 1.8 is a major stable checkpoint, and 1.10 is not anticipated before the end of 2011. The currentdevelopment cycle (1.9, leading to 1.10) will premier significant changes in gameplay, UI, and development tools, with many new concepts being introduced. That makes this year probably one of the best years for a SoC student to join, since the open-ended 1.9 will mean much more space to develop novel ideas&lt;br /&gt;
&lt;br /&gt;
''Wesnoth'' is one of the most successful open-source game projects in existence, with an exceptionally large developer base and user community:&lt;br /&gt;
&lt;br /&gt;
* According to Ohloh, a site that collects activity statistics on open-source projects, the ''Wesnoth'' development effort is in the top 2% of largest and most active projects.&lt;br /&gt;
* We support two multiplayer game servers (stable and development) with a usual minimum load of more than a hundred players.&lt;br /&gt;
* More than two thousands downloads a day&lt;br /&gt;
* 4.5 million downloads via SourceForge; many more via various mirrors of Linux distributions&lt;br /&gt;
* Best rated game at the Linux Game Tome[2]&lt;br /&gt;
* Game of the year 2007, 2008, 2009, and 2010 at LinuxQuestions.org[3][4]&lt;br /&gt;
* In general, ''Wesnoth'' tends to show up in the first or second position whenever anyone compiles a list of top open-source games.&lt;br /&gt;
&lt;br /&gt;
''Wesnoth'''s most notable features include:&lt;br /&gt;
&lt;br /&gt;
* A mature project with continuing active development and frequent improvements&lt;br /&gt;
* High quality artwork: both original graphics and music&lt;br /&gt;
* Well­-balanced by a tireless team of playtesters&lt;br /&gt;
* Fun, unique gameplay&lt;br /&gt;
* Even after six years of development and with a very solid, fun product already created, there are still plenty of new developers; the number of commits to Subversion is still increasing&lt;br /&gt;
* Strong support of internationalization with many supported languages, thus experience in working with non-native English speakers. In fact, more than half of our developers are not native English speakers.&lt;br /&gt;
&lt;br /&gt;
[1] http://www.wesnoth.org/wiki/WesnothPhilosophy&lt;br /&gt;
&lt;br /&gt;
[2] http://www.happypenguin.org/list?sort=avg_rating&lt;br /&gt;
&lt;br /&gt;
[3] http://www.linuxquestions.org/questions/linux-news-59/2009-linuxquestions.org-members-choice-award-winners-788028/&lt;br /&gt;
&lt;br /&gt;
[4] http://www.linuxquestions.org/questions/2010-linuxquestions-org-members-choice-awards-93/open-source-game-of-the-year-855937/&lt;br /&gt;
&lt;br /&gt;
==== Home page: ====&lt;br /&gt;
http://www.wesnoth.org/&lt;br /&gt;
&lt;br /&gt;
==== Main Organization License: ====&lt;br /&gt;
GNU General Public License version 2.0 (GPLv2) [Dropdown box answer!]&lt;br /&gt;
&lt;br /&gt;
==== Why is your organization applying to participate in GSoC 2011? What do you hope to gain by participating? ====&lt;br /&gt;
Most of our developers have particular areas of interest in which they work. Though they are efficient in their areas, there are other, presently uncovered, areas of the code with a need for improvements but a high barrier to entry for casual contributors.&lt;br /&gt;
&lt;br /&gt;
Our previous SoC experience shows that a motivated, full-time, student can be brought up to date in any area fairly quickly.&lt;br /&gt;
&lt;br /&gt;
By bringing new people in and allowing them to be actively responsible for an area of code, we hope to kickstart some areas of the project that are currently lagging behind.&lt;br /&gt;
&lt;br /&gt;
Moreover, our previous experiences has shown us that SoC developers tend to stay after the end of the Summer of Code and become valuable members of our community. This has been a win in all directions and we want it to happen again.&lt;br /&gt;
&lt;br /&gt;
==== If accepted, would this be your first year participating in GSoC? ====&lt;br /&gt;
No&lt;br /&gt;
&lt;br /&gt;
==== Did your organization participate in past GSoCs? If so, please summarize your involvement and the successes and challenges of your participation. ====&lt;br /&gt;
2008 results:&lt;br /&gt;
Wesnoth participated in GSoC 2008 with four students. Out of these, two were great successes (that is they became full-fledge developers before the actual start of GSoC), did huge improvement during GSoC (A new recruitment algorithm for the AI and the basic structure for a new map editor, the student finished this work after the summer), and are still active developers in the Wesnoth community.&lt;br /&gt;
&lt;br /&gt;
Of the two other, one of them was very active for the first half of GSoC and provided some useful infrastructure for AI development that we used as base in GSoC 2009, but was much less active and didn't reach expectations for the second half of GSoC. The lesson we learned is that great students should be left on their own, that's the best way to have them work, but average students should be monitored much more closely than we did. If things seems to start to go wrong, it's important to react very quick, to meet with other mentors and get things back on track early.&lt;br /&gt;
&lt;br /&gt;
Timezone problems were also a serious barrier for student/mentor communication, and we will take that more into account when pairing mentors and students&lt;br /&gt;
&lt;br /&gt;
For our other students, multiple problems collectively led to failure&lt;br /&gt;
* We should enforce IRC communication, E-mail is a barrier. This applies both for students and mentors. Both should be on IRC several hours a day, with overlapping hours.&lt;br /&gt;
* We should be more strict about mid-term evaluation. If the student is slightly lacking at mid-term we should give a clear message that he needs to get back on track.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2009 results:&lt;br /&gt;
In 2009 we mentored 6 students as part of Summer of Code. Out of these 5 projects were a success. From those 5 developers 3 are still part of our core development group and still maintain and improve the work they submitted as part of Summer of Code. One of the students even became the &amp;quot;head&amp;quot; of our AI development department and mentored a student this year. For a summary of the 2009 results have a look at [1].&lt;br /&gt;
&lt;br /&gt;
Sadly one student was not able to continue his work past midterm due to his computer failing completely as well as personal problems that we won't delve into further here. It was not a salvageable situation.&lt;br /&gt;
&lt;br /&gt;
2010 results:&lt;br /&gt;
In 2010 we mentored 4 students as part of Summer of Code, all the projects were a success. from those 4 developers, 1 is still part of our code development team and maintains the work he has done as part of Summer of Code.&lt;br /&gt;
&lt;br /&gt;
[1] http://forums.wesnoth.org/viewtopic.php?f=5&amp;amp;t=26955&lt;br /&gt;
&lt;br /&gt;
==== If your organization participated in past GSoCs, please let us know the ratio of students passing to students allocated, e.g. 2006: 3/6 for 3 out of 6 students passed in 2006. ====&lt;br /&gt;
2008: 2/4&lt;br /&gt;
2009: 5/6&lt;br /&gt;
2010: 4/4&lt;br /&gt;
&lt;br /&gt;
==== What is the URL for your ideas page? ====&lt;br /&gt;
http://wiki.wesnoth.org/SummerOfCodeIdeas&lt;br /&gt;
&lt;br /&gt;
==== What is the main development mailing list for your organization? This question will be shown to students who would like to get more information about applying to your organization for GSoC 2011. If your organization uses more than one list, please make sure to include a description of the list so students know which to use. ====&lt;br /&gt;
The main development mailing list is &amp;quot;wesnoth-dev@gna.org&amp;quot;. Our main means of communications is our IRC channel on freenode. If you have questions you should ask them in #wesnoth-dev on irc.freenode.net and wait for a reply (might take some hours!). The Wesnoth related channels are logged in public and the logs tend to be read by developers.&lt;br /&gt;
&lt;br /&gt;
==== What is the main IRC channel for your organization? ====&lt;br /&gt;
 #wesnoth-dev on irc.freenode.net&lt;br /&gt;
&lt;br /&gt;
==== Does your organization have an application template you would like to see students use? If so, please provide it now. Please note that it is a very good idea to ask students to provide you with their contact information as part of your template. Their contact details will not be shared with you automatically via the GSoC 2011 site. ====&lt;br /&gt;
We plan mainly to meet potential students through our IRC channel, but the following questions are Wesnoth specific and are worth pondering for any student, even if we don't need a formal answer. So please beside just answering these questions consider visiting us in IRC: #wesnoth-dev on irc.freenode.net. This is where most of our work takes place and participating in IRC is mandatory for GSoC students participating with Wesnoth. Our experience is that this is the easiest way to communicate and solve problems that come up.&lt;br /&gt;
&lt;br /&gt;
If you want to participate in GSoC as a student please copy http://wiki.wesnoth.org/SoC2011_Template_of_Student_page to a new page and fill it with the answers to the following questions&lt;br /&gt;
&lt;br /&gt;
Again, participating on IRC will be highly considered, you should not hesitate to ask any questions there, including how to fill a good proposal. We highly value your capacity to communicate and work in a team, so help other students, actively ask for proposal criticism, this can only help your proposal&lt;br /&gt;
&lt;br /&gt;
1) Basics&lt;br /&gt;
&lt;br /&gt;
1.1) Write a small introduction to yourself.&lt;br /&gt;
&lt;br /&gt;
1.2) State your preferred email address.&lt;br /&gt;
&lt;br /&gt;
1.3) If you have chosen a nick for IRC and Wesnoth forums, what is it?&lt;br /&gt;
&lt;br /&gt;
1.4) Why do you want to participate in summer of code?&lt;br /&gt;
&lt;br /&gt;
1.5) What are you studying, subject, level and school? &lt;br /&gt;
&lt;br /&gt;
1.6) What country are you from, at what time are you most likely to be able to join IRC?&lt;br /&gt;
&lt;br /&gt;
1.7) Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) Experience&lt;br /&gt;
&lt;br /&gt;
2.1) What programs/software have you worked on before?&lt;br /&gt;
&lt;br /&gt;
2.2) Have you developed software in a team environment before? (As opposed to hacking on something on your own)&lt;br /&gt;
&lt;br /&gt;
2.3) Have you participated to the Google Summer of Code before? As a mentor or a student? In what project? Were you successful? If not, why?&lt;br /&gt;
&lt;br /&gt;
2.4) Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.&lt;br /&gt;
&lt;br /&gt;
2.5) Gaming experience - Are you a gamer?&lt;br /&gt;
&lt;br /&gt;
2.5.1) What type of gamer are you?&lt;br /&gt;
&lt;br /&gt;
2.5.2) What type of games? &lt;br /&gt;
&lt;br /&gt;
2.5.3) What type of opponents do you prefer? &lt;br /&gt;
&lt;br /&gt;
2.5.4) Are you more interested in story or gameplay?&lt;br /&gt;
&lt;br /&gt;
2.5.5) Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.&lt;br /&gt;
&lt;br /&gt;
We do not plan to favor Wesnoth players as such, but some particular projects require a good feeling for the game which is hard to get without having played intensively.&lt;br /&gt;
&lt;br /&gt;
2.6) If you have contributed any patches to Wesnoth, please list them below. You can also list patches that have been submitted but not committed yet and patches that have not been specifically written for GSoC. If you have gained commit access to our SVN (during the evaluation period or earlier) please state so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Communication skills&lt;br /&gt;
&lt;br /&gt;
3.1) Though most of our developers are not native English speakers, English is the project's working language.  Describe your fluency level in written English.&lt;br /&gt;
&lt;br /&gt;
3.2) What spoken languages are you fluent in?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3.3) Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.&lt;br /&gt;
&lt;br /&gt;
3.4) Do you give constructive advice? &lt;br /&gt;
&lt;br /&gt;
3.5) Do you receive advice well? &lt;br /&gt;
&lt;br /&gt;
3.6) Are you good at sorting useful criticisms from useless ones?&lt;br /&gt;
&lt;br /&gt;
3.7) How autonomous are you when developing ? Would you rather discuss intensively changes and not start coding until you know what you want to do or would you rather code a proof of concept to &amp;quot;see how it turn out&amp;quot;, taking the risk of having it thrown away if it doesn't match what the project want&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4) Project&lt;br /&gt;
&lt;br /&gt;
4.1) Did you select a project from our list? If that is the case, what project did you select? What do you want to especially concentrate on?&lt;br /&gt;
&lt;br /&gt;
4.2) If you have invented your own project, please describe the project and the scope.&lt;br /&gt;
&lt;br /&gt;
4.3) Why did you choose this project?&lt;br /&gt;
&lt;br /&gt;
4.4) Include an estimated timeline for your work on the project. Don't forget to mention special things like &amp;quot;I booked holidays between A and B&amp;quot; and &amp;quot;I got an exam at ABC and won't be doing much then&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
4.5) Include as much technical detail about your implementation as you can&lt;br /&gt;
&lt;br /&gt;
4.6) What do you expect to gain from this project?&lt;br /&gt;
&lt;br /&gt;
4.7) What would make you stay in the Wesnoth community after the conclusion of SOC? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5) Practical considerations&lt;br /&gt;
&lt;br /&gt;
5.1) Are you familiar with any of the following tools or languages?&lt;br /&gt;
* Subversion (used for all commits)&lt;br /&gt;
* C++ (language used for all the normal source code)&lt;br /&gt;
* STL, Boost, Sdl (C++ libraries used by Wesnoth)&lt;br /&gt;
* Python (optional, mainly used for tools)&lt;br /&gt;
* build environments (eg cmake/autotools/scons)&lt;br /&gt;
* WML (the wesnoth specific scenario language)&lt;br /&gt;
* Lua (used in combination with WML to create scenarios)&lt;br /&gt;
&lt;br /&gt;
5.2) Which tools do you normally use for development? Why do you use them?&lt;br /&gt;
&lt;br /&gt;
5.3) What programming languages are you fluent in?&lt;br /&gt;
&lt;br /&gt;
5.4) Would you mind talking with your mentor on telephone / internet phone? We would like to have a backup way for communications for the case that somehow emails and IRC do fail. If you are willing to do so, please do list a phone number (including international code) so that we are able to contact you. You should probably *only* add this number in the application for you submit to google since the info in the wiki is available in public. We will *not* make any use of your number unless some case of &amp;quot;there is no way to contact you&amp;quot; does arise!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In general please try to be as verbose as possible in your answers and feel free to elaborate.&lt;br /&gt;
&lt;br /&gt;
==== What criteria did you use to select the individuals who will act as mentors for your organization? Please be as specific as possible. ====&lt;br /&gt;
Our first criterion was that all the people had to be volunteers. According to other open source projects and our experience from the last two years, being a SoC mentor takes a lot of time and the person has to be ready to spend quite some time with the student.&lt;br /&gt;
&lt;br /&gt;
Boucman is one of the oldest active developers around. He has rewritten the whole animation engine and made it an easily pluggable system allowing artists to easily specify exactly how they want the units to appear. He also started many community oriented projects like the Art Contribution[1] section of the wiki (now deprecated) and the WML Reference Manual[2]. He is responsible for dispatching and sorting the patches at http://patches.wesnoth.org that has created the new developer process we currently use. Boucman was a mentor in 2008, 2009 and 2010.&lt;br /&gt;
&lt;br /&gt;
Iurii Chernyi (Crab) has joined the team in 2009, taking part in Google Summer of Code 2009, and staying with the project as a developer after successful completion of GSoC. He's an expert on all aspects of current Wesnoth AI codebase (having fully reorganized it as part of GSoC 2009), and has fixed numerous bugs all over Wesnoth. He was a GSoC mentor and a GCI mentor and administrator in 2010. He is experienced in teaching other people, in areas like programming languages and math.&lt;br /&gt;
&lt;br /&gt;
Mordante is one of the most active developers on our IRC channel. Not only has he done preliminary studies and coding in multiple areas that are candidates for Summer of Code ideas, he also is one of the coders with the best overview of the Wesnoth code. A large part of his work involves refactoring and polishing existing code. Next to that he's very active with fixing bugs which leads him to all areas in the code base. He is currently completing a rewrite of the Wesnoth GUI library, making all windows configurable through WML. This should make it easier to use Wesnoth on different resolutions, from small handheld devices to large 30 inch screens. Mordante was a mentor in 2008, 2009 and 2010.&lt;br /&gt;
&lt;br /&gt;
All other developers listed in the ideas page are the leading capacities we do have for the respecting areas. Have a look at our list of &amp;quot;people who to contact&amp;quot; [3] for an easy reference. In general all our developers will mentor all students. That is, questions should just be asked in our IRC channel, where basically every developer who has an idea can and will directly answer.&lt;br /&gt;
&lt;br /&gt;
When choosing the mentors, we have kept in mind that most developers can answer most technical questions, and we have chosen people that are well known for interacting with new-comers/external developers and can provide general guidance and design advice, more than people with specific technical knowledge.&lt;br /&gt;
&lt;br /&gt;
[1] http://wiki.wesnoth.org/UnsortedContrib&lt;br /&gt;
&lt;br /&gt;
[2] http://wiki.wesnoth.org/ReferenceWML&lt;br /&gt;
&lt;br /&gt;
[3] http://wiki.wesnoth.org/SoC_People_to_bug_on_IRC&lt;br /&gt;
&lt;br /&gt;
==== What is your plan for dealing with disappearing students? ====&lt;br /&gt;
The first thing to do is to avoid this situation altogether. &lt;br /&gt;
&lt;br /&gt;
Wesnoth is a game, and as such has lots of developers that are not coders. In particular, artists are well known in the Wesnoth community for being very sensitive about criticism and our community is used to people being sensitive to critics. &lt;br /&gt;
&lt;br /&gt;
We will try to choose students that accept criticism and are able to filter constructive criticism from useless one. The Wesnoth developer community is used to judging people according to these criteria and the special title we are going to give to applicants will allow us to easily spot any such problems and discuss them before they grow out of control.&lt;br /&gt;
&lt;br /&gt;
If a student disappears, their mentor will be in charge of recontacting the student to see what is going wrong (available time, tension with other developers, with members of the community etc...). Depending on the actual problem, the mentor and the student will have to agree on possible ways to defuse the problem.&lt;br /&gt;
&lt;br /&gt;
If a student disappears completely and there is no way to get back to them, there is little the project can do except salvaging whatever can be salvaged from the code (the students will have SVN write access, so most of the work will be committed either to trunk or to a specific branch) and find a core developer to take on the job. This will probably be slower and less effective for the project, but it's the best we can do.&lt;br /&gt;
&lt;br /&gt;
==== What is your plan for dealing with disappearing mentors? ====&lt;br /&gt;
All our mentors are long time developers that volunteered for the job, so we don't expect that to happen. We observed in during the last years the amount of time required to mentor, and our mentors accepted the job knowing the amount of work it involved. All of this years mentors mentored last year as well.&lt;br /&gt;
&lt;br /&gt;
However, should it happen, we would continue to mentor as a developer community the student until we find a new &amp;quot;official&amp;quot; mentor to take on the job.&lt;br /&gt;
&lt;br /&gt;
==== What steps will you take to encourage students to interact with your project's community before, during and after the program? ====&lt;br /&gt;
Wesnoth has a particularly healthy community, both for developers and for players. &lt;br /&gt;
&lt;br /&gt;
Our general policy regarding new coders has always been &amp;quot;two (non trival) patches... you're in&amp;quot;. With other words, anybody that is able to get two non-trivial patches applied is offered commit privileges.&lt;br /&gt;
We have a developer responsible for applying patches and guiding new developers into our community. This is a well known and effective process we plan to apply to students, directing them to our EasyCoding pages [1] (these projects are usually a couple of hours long and hve been chosen to provide easy access to the respective area of code). This year, we also have added some simple coding tasks directly related to our GSoC ideas to be able to test students more specifically on their future project&lt;br /&gt;
&lt;br /&gt;
Usually, patches go back and forth a couple of times, to make sure that all secondary things are in place (indenting, coding style, modified buildfiles etc.) The idea is that coder education should take place before the coder gets commit rights, but that getting new coder in is one of the most important things to keep our project alive.&lt;br /&gt;
&lt;br /&gt;
If the student is proactive and ready to join IRC, all the developers are usually very welcoming, and good at directing newcomers to quickly give useful results.&lt;br /&gt;
&lt;br /&gt;
In 2008, 2009 and 2010 all students that were accepted (and a couple more) managed to have commit access before the start of the coding phase. We consider that this policy was successful and we plan to keep it this year.&lt;br /&gt;
&lt;br /&gt;
We also plan to give a special forum title to any students. This will allow all forum members to tell them apart from normal users and give them read/write access to the developer only forums. This will also allow us to quickly spot any problem they might have interacting with the player community. We have a very mature developer community, but our player community is made of all sort of people of all age and education, and it can sometimes be rough.&lt;br /&gt;
&lt;br /&gt;
Last, our experience from previous years is that students that participate in the community during the evaluation period will stay active in the community after that period. In previous years this has been a discriminating criterias for students of similar level, and overall we never had problems of students working &amp;quot;behind a black wall.&amp;quot; Our selection process tend to favor students who participate, and participation hasn't been a problem so far.&lt;br /&gt;
&lt;br /&gt;
[1] http://wiki.wesnoth.org/EasyCoding&lt;br /&gt;
&lt;br /&gt;
==== If you are a small or new organization applying to GSoC, please list a larger, established GSoC organization or a Googler that can vouch for you here. ====&lt;br /&gt;
&lt;br /&gt;
==== If you are a large organization who is vouching for a small organization applying to GSoC for their first time this year, please list their name and why you think they'd be good candidates for GSoC here: ====&lt;br /&gt;
* Darktable:&lt;br /&gt;
Darktable (see http://darktable.sourceforge.net/ and https://sourceforge.net/apps/trac/darktable/wiki/GSOC) is an open source raw development tool.&lt;br /&gt;
&lt;br /&gt;
There are currently no major open source raw development tools. Multiple tools cover the need (ufraw, rawtherapee etc...) but most of them are targeting technical users with interest in photography or signal processing experts rather than &amp;quot;normal&amp;quot; photographer. &lt;br /&gt;
&lt;br /&gt;
Darktable has a very good UI designed around what most photographers expects. It is also a project which is at this interesting stage where there is a solid infrastructure and it needs developer to do the fun part of adding new feature. This is the stage of a project which is the most interesting for developers to join.&lt;br /&gt;
&lt;br /&gt;
The Darktable development community is rather small (3 active developers plus occasional contributors). It could use the extra manpower but is large enough to mentor a student into a core developer pretty fast. &lt;br /&gt;
&lt;br /&gt;
Chances of a student finding it interesting are high, chances of the student bringing major contributions to the project are very high&lt;br /&gt;
&lt;br /&gt;
One of the experienced wesnoth mentor (boucman) is an active member of the Darktable community and has been spearheading the GSoC effort for that community and will offer advice and participation for the new mentors in that community. Wesnoth has had a dedicated IRC channel for mentor discussion which could be used by smaller projects for advice if the need arise&lt;br /&gt;
&lt;br /&gt;
* Unknown Horizons:&lt;br /&gt;
Unknown Horizons (http://www.unknown-horizons.org/) is a 2D realtime strategy simulation with an emphasis on economy and city building. &lt;br /&gt;
&lt;br /&gt;
This is a smaller open source game project with a really dedicated core team of developers. During our talks with the dev who wants to work as admin it was easy to see that they do think about what they do and got some well working infrastructure. Even though the team is rather small at the moment, they are well suited to handle some students and the project has a proven record of being able to actually release something and continue working on the code. Beside their abilities it is always good to support open source gaming, especially when it comes to rather underrepresented areas like real time strategy games.&lt;br /&gt;
&lt;br /&gt;
==== Anything else you'd like to tell us?  ====&lt;br /&gt;
There is nothing more to say.&lt;br /&gt;
&lt;br /&gt;
==== Backup Admin (Link ID): ====&lt;br /&gt;
noy&lt;br /&gt;
&lt;br /&gt;
==== Admin Agreement: ====&lt;br /&gt;
(some terms of service by Google that have to be agreed upon)&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SoC_Information_for_Google&amp;diff=40725</id>
		<title>SoC Information for Google</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SoC_Information_for_Google&amp;diff=40725"/>
		<updated>2011-03-09T21:17:08Z</updated>

		<summary type="html">&lt;p&gt;Boucman: /* What steps will you take to encourage students to interact with your project's community before, during and after the program? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:SoC2011}}&lt;br /&gt;
&lt;br /&gt;
== SoC Information for Google ==&lt;br /&gt;
This is the info that we submit to google as Application in Summer of Code (current status: 2010). The submitter automatically becomes primary Admin. Most entries are mandatory and have to be filled out before the application can be submitted.&lt;br /&gt;
&lt;br /&gt;
==== Organization Name: ====&lt;br /&gt;
Battle for Wesnoth&lt;br /&gt;
&lt;br /&gt;
==== Description: ====&lt;br /&gt;
''Battle for Wesnoth'', or simply ''Wesnoth'', is a free, turn-based strategy game with role-playing elements that was designed in June 2003 by David White (Sirp).&lt;br /&gt;
&lt;br /&gt;
Although the core rules are fairly simple and meant to be easily learned[1], they provide interesting gameplay and rich tactical options. A major strength of the project is the Wesnoth Markup Language (WML) for writing scenarios. Programming skills are not required to compose with it, and a large WML-modding community has generated a great deal of user-maintained content. We polish the best of this content and lift it into our official release tree.&lt;br /&gt;
&lt;br /&gt;
The first stable release (1.0) was on October 2, 2005, and the latest stable release (1.8) happened in april 2010. Version 1.8 is a major stable checkpoint, and 1.10 is not anticipated before the end of 2011. The currentdevelopment cycle (1.9, leading to 1.10) will premier significant changes in gameplay, UI, and development tools, with many new concepts being introduced. That makes this year probably one of the best years for a SoC student to join, since the open-ended 1.9 will mean much more space to develop novel ideas&lt;br /&gt;
&lt;br /&gt;
''Wesnoth'' is one of the most successful open-source game projects in existence, with an exceptionally large developer base and user community:&lt;br /&gt;
&lt;br /&gt;
* According to Ohloh, a site that collects activity statistics on open-source projects, the ''Wesnoth'' development effort is in the top 2% of largest and most active projects.&lt;br /&gt;
* We support two multiplayer game servers (stable and development) with a usual minimum load of more than a hundred players.&lt;br /&gt;
* More than two thousands downloads a day&lt;br /&gt;
* 4.5 million downloads via SourceForge; many more via various mirrors of Linux distributions&lt;br /&gt;
* Best rated game at the Linux Game Tome[2]&lt;br /&gt;
* Game of the year 2007, 2008, 2009, and 2010 at LinuxQuestions.org[3][4]&lt;br /&gt;
* In general, ''Wesnoth'' tends to show up in the first or second position whenever anyone compiles a list of top open-source games.&lt;br /&gt;
&lt;br /&gt;
''Wesnoth'''s most notable features include:&lt;br /&gt;
&lt;br /&gt;
* A mature project with continuing active development and frequent improvements&lt;br /&gt;
* High quality artwork: both original graphics and music&lt;br /&gt;
* Well­-balanced by a tireless team of playtesters&lt;br /&gt;
* Fun, unique gameplay&lt;br /&gt;
* Even after six years of development and with a very solid, fun product already created, there are still plenty of new developers; the number of commits to Subversion is still increasing&lt;br /&gt;
* Strong support of internationalization with many supported languages, thus experience in working with non-native English speakers. In fact, more than half of our developers are not native English speakers.&lt;br /&gt;
&lt;br /&gt;
[1] http://www.wesnoth.org/wiki/WesnothPhilosophy&lt;br /&gt;
&lt;br /&gt;
[2] http://www.happypenguin.org/list?sort=avg_rating&lt;br /&gt;
&lt;br /&gt;
[3] http://www.linuxquestions.org/questions/linux-news-59/2009-linuxquestions.org-members-choice-award-winners-788028/&lt;br /&gt;
&lt;br /&gt;
[4] http://www.linuxquestions.org/questions/2010-linuxquestions-org-members-choice-awards-93/open-source-game-of-the-year-855937/&lt;br /&gt;
&lt;br /&gt;
==== Home page: ====&lt;br /&gt;
http://www.wesnoth.org/&lt;br /&gt;
&lt;br /&gt;
==== Main Organization License: ====&lt;br /&gt;
GNU General Public License version 2.0 (GPLv2) [Dropdown box answer!]&lt;br /&gt;
&lt;br /&gt;
==== Why is your organization applying to participate in GSoC 2011? What do you hope to gain by participating? ====&lt;br /&gt;
Most of our developers have particular areas of interest in which they work. Though they are efficient in their areas, there are other, presently uncovered, areas of the code with a need for improvements but a high barrier to entry for casual contributors.&lt;br /&gt;
&lt;br /&gt;
Our previous SoC experience shows that a motivated, full-time, student can be brought up to date in any area fairly quickly.&lt;br /&gt;
&lt;br /&gt;
By bringing new people in and allowing them to be actively responsible for an area of code, we hope to kickstart some areas of the project that are currently lagging behind.&lt;br /&gt;
&lt;br /&gt;
Moreover, our previous experiences has shown us that SoC developers tend to stay after the end of the Summer of Code and become valuable members of our community. This has been a win in all directions and we want it to happen again.&lt;br /&gt;
&lt;br /&gt;
==== If accepted, would this be your first year participating in GSoC? ====&lt;br /&gt;
No&lt;br /&gt;
&lt;br /&gt;
==== Did your organization participate in past GSoCs? If so, please summarize your involvement and the successes and challenges of your participation. ====&lt;br /&gt;
2008 results:&lt;br /&gt;
Wesnoth participated in GSoC 2008 with four students. Out of these, two were great successes (that is they became full-fledge developers before the actual start of GSoC), did huge improvement during GSoC (A new recruitment algorithm for the AI and the basic structure for a new map editor, the student finished this work after the summer), and are still active developers in the Wesnoth community.&lt;br /&gt;
&lt;br /&gt;
Of the two other, one of them was very active for the first half of GSoC and provided some useful infrastructure for AI development that we used as base in GSoC 2009, but was much less active and didn't reach expectations for the second half of GSoC. The lesson we learned is that great students should be left on their own, that's the best way to have them work, but average students should be monitored much more closely than we did. If things seems to start to go wrong, it's important to react very quick, to meet with other mentors and get things back on track early.&lt;br /&gt;
&lt;br /&gt;
Timezone problems were also a serious barrier for student/mentor communication, and we will take that more into account when pairing mentors and students&lt;br /&gt;
&lt;br /&gt;
For our other students, multiple problems collectively led to failure&lt;br /&gt;
* We should enforce IRC communication, E-mail is a barrier. This applies both for students and mentors. Both should be on IRC several hours a day, with overlapping hours.&lt;br /&gt;
* We should be more strict about mid-term evaluation. If the student is slightly lacking at mid-term we should give a clear message that he needs to get back on track.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2009 results:&lt;br /&gt;
In 2009 we mentored 6 students as part of Summer of Code. Out of these 5 projects were a success. From those 5 developers 3 are still part of our core development group and still maintain and improve the work they submitted as part of Summer of Code. One of the students even became the &amp;quot;head&amp;quot; of our AI development department and mentored a student this year. For a summary of the 2009 results have a look at [1].&lt;br /&gt;
&lt;br /&gt;
Sadly one student was not able to continue his work past midterm due to his computer failing completely as well as personal problems that we won't delve into further here. It was not a salvageable situation.&lt;br /&gt;
&lt;br /&gt;
2010 results:&lt;br /&gt;
In 2010 we mentored 4 students as part of Summer of Code, all the projects were a success. from those 4 developers, 1 is still part of our code development team and maintains the work he has done as part of Summer of Code.&lt;br /&gt;
&lt;br /&gt;
[1] http://forums.wesnoth.org/viewtopic.php?f=5&amp;amp;t=26955&lt;br /&gt;
&lt;br /&gt;
==== If your organization participated in past GSoCs, please let us know the ratio of students passing to students allocated, e.g. 2006: 3/6 for 3 out of 6 students passed in 2006. ====&lt;br /&gt;
2008: 2/4&lt;br /&gt;
2009: 5/6&lt;br /&gt;
2010: 4/4&lt;br /&gt;
&lt;br /&gt;
==== What is the URL for your ideas page? ====&lt;br /&gt;
http://wiki.wesnoth.org/SummerOfCodeIdeas&lt;br /&gt;
&lt;br /&gt;
==== What is the main development mailing list for your organization? This question will be shown to students who would like to get more information about applying to your organization for GSoC 2011. If your organization uses more than one list, please make sure to include a description of the list so students know which to use. ====&lt;br /&gt;
The main development mailing list is &amp;quot;wesnoth-dev@gna.org&amp;quot;. Our main means of communications is our IRC channel on freenode. If you have questions you should ask them in #wesnoth-dev on irc.freenode.net and wait for a reply (might take some hours!). The Wesnoth related channels are logged in public and the logs tend to be read by developers.&lt;br /&gt;
&lt;br /&gt;
==== What is the main IRC channel for your organization? ====&lt;br /&gt;
 #wesnoth-dev on irc.freenode.net&lt;br /&gt;
&lt;br /&gt;
==== Does your organization have an application template you would like to see students use? If so, please provide it now. Please note that it is a very good idea to ask students to provide you with their contact information as part of your template. Their contact details will not be shared with you automatically via the GSoC 2011 site. ====&lt;br /&gt;
We plan mainly to meet potential students through our IRC channel, but the following questions are Wesnoth specific and are worth pondering for any student, even if we don't need a formal answer. So please beside just answering these questions consider visiting us in IRC: #wesnoth-dev on irc.freenode.net. This is where most of our work takes place and participating in IRC is mandatory for GSoC students participating with Wesnoth. Our experience is that this is the easiest way to communicate and solve problems that come up.&lt;br /&gt;
&lt;br /&gt;
If you want to participate in GSoC as a student please copy http://wiki.wesnoth.org/SoC2011_Template_of_Student_page to a new page and fill it with the answers to the following questions&lt;br /&gt;
&lt;br /&gt;
Again, participating on IRC will be highly considered, you should not hesitate to ask any questions there, including how to fill a good proposal. We highly value your capacity to communicate and work in a team, so help other students, actively ask for proposal criticism, this can only help your proposal&lt;br /&gt;
&lt;br /&gt;
1) Basics&lt;br /&gt;
&lt;br /&gt;
1.1) Write a small introduction to yourself.&lt;br /&gt;
&lt;br /&gt;
1.2) State your preferred email address.&lt;br /&gt;
&lt;br /&gt;
1.3) If you have chosen a nick for IRC and Wesnoth forums, what is it?&lt;br /&gt;
&lt;br /&gt;
1.4) Why do you want to participate in summer of code?&lt;br /&gt;
&lt;br /&gt;
1.5) What are you studying, subject, level and school? &lt;br /&gt;
&lt;br /&gt;
1.6) What country are you from, at what time are you most likely to be able to join IRC?&lt;br /&gt;
&lt;br /&gt;
1.7) Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) Experience&lt;br /&gt;
&lt;br /&gt;
2.1) What programs/software have you worked on before?&lt;br /&gt;
&lt;br /&gt;
2.2) Have you developed software in a team environment before? (As opposed to hacking on something on your own)&lt;br /&gt;
&lt;br /&gt;
2.3) Have you participated to the Google Summer of Code before? As a mentor or a student? In what project? Were you successful? If not, why?&lt;br /&gt;
&lt;br /&gt;
2.4) Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.&lt;br /&gt;
&lt;br /&gt;
2.5) Gaming experience - Are you a gamer?&lt;br /&gt;
&lt;br /&gt;
2.5.1) What type of gamer are you?&lt;br /&gt;
&lt;br /&gt;
2.5.2) What type of games? &lt;br /&gt;
&lt;br /&gt;
2.5.3) What type of opponents do you prefer? &lt;br /&gt;
&lt;br /&gt;
2.5.4) Are you more interested in story or gameplay?&lt;br /&gt;
&lt;br /&gt;
2.5.5) Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.&lt;br /&gt;
&lt;br /&gt;
We do not plan to favor Wesnoth players as such, but some particular projects require a good feeling for the game which is hard to get without having played intensively.&lt;br /&gt;
&lt;br /&gt;
2.6) If you have contributed any patches to Wesnoth, please list them below. You can also list patches that have been submitted but not committed yet and patches that have not been specifically written for GSoC. If you have gained commit access to our SVN (during the evaluation period or earlier) please state so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Communication skills&lt;br /&gt;
&lt;br /&gt;
3.1) Though most of our developers are not native English speakers, English is the project's working language.  Describe your fluency level in written English.&lt;br /&gt;
&lt;br /&gt;
3.2) What spoken languages are you fluent in?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3.3) Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.&lt;br /&gt;
&lt;br /&gt;
3.4) Do you give constructive advice? &lt;br /&gt;
&lt;br /&gt;
3.5) Do you receive advice well? &lt;br /&gt;
&lt;br /&gt;
3.6) Are you good at sorting useful criticisms from useless ones?&lt;br /&gt;
&lt;br /&gt;
3.7) How autonomous are you when developing ? Would you rather discuss intensively changes and not start coding until you know what you want to do or would you rather code a proof of concept to &amp;quot;see how it turn out&amp;quot;, taking the risk of having it thrown away if it doesn't match what the project want&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4) Project&lt;br /&gt;
&lt;br /&gt;
4.1) Did you select a project from our list? If that is the case, what project did you select? What do you want to especially concentrate on?&lt;br /&gt;
&lt;br /&gt;
4.2) If you have invented your own project, please describe the project and the scope.&lt;br /&gt;
&lt;br /&gt;
4.3) Why did you choose this project?&lt;br /&gt;
&lt;br /&gt;
4.4) Include an estimated timeline for your work on the project. Don't forget to mention special things like &amp;quot;I booked holidays between A and B&amp;quot; and &amp;quot;I got an exam at ABC and won't be doing much then&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
4.5) Include as much technical detail about your implementation as you can&lt;br /&gt;
&lt;br /&gt;
4.6) What do you expect to gain from this project?&lt;br /&gt;
&lt;br /&gt;
4.7) What would make you stay in the Wesnoth community after the conclusion of SOC? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5) Practical considerations&lt;br /&gt;
&lt;br /&gt;
5.1) Are you familiar with any of the following tools or languages?&lt;br /&gt;
* Subversion (used for all commits)&lt;br /&gt;
* C++ (language used for all the normal source code)&lt;br /&gt;
* STL, Boost, Sdl (C++ libraries used by Wesnoth)&lt;br /&gt;
* Python (optional, mainly used for tools)&lt;br /&gt;
* build environments (eg cmake/autotools/scons)&lt;br /&gt;
* WML (the wesnoth specific scenario language)&lt;br /&gt;
* Lua (used in combination with WML to create scenarios)&lt;br /&gt;
&lt;br /&gt;
5.2) Which tools do you normally use for development? Why do you use them?&lt;br /&gt;
&lt;br /&gt;
5.3) What programming languages are you fluent in?&lt;br /&gt;
&lt;br /&gt;
5.4) Would you mind talking with your mentor on telephone / internet phone? We would like to have a backup way for communications for the case that somehow emails and IRC do fail. If you are willing to do so, please do list a phone number (including international code) so that we are able to contact you. You should probably *only* add this number in the application for you submit to google since the info in the wiki is available in public. We will *not* make any use of your number unless some case of &amp;quot;there is no way to contact you&amp;quot; does arise!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In general please try to be as verbose as possible in your answers and feel free to elaborate.&lt;br /&gt;
&lt;br /&gt;
==== What criteria did you use to select the individuals who will act as mentors for your organization? Please be as specific as possible. ====&lt;br /&gt;
Our first criterion was that all the people had to be volunteers. According to other open source projects and our experience from the last two years, being a SoC mentor takes a lot of time and the person has to be ready to spend quite some time with the student.&lt;br /&gt;
&lt;br /&gt;
Boucman is one of the oldest active developers around. He has rewritten the whole animation engine and made it an easily pluggable system allowing artists to easily specify exactly how they want the units to appear. He also started many community oriented projects like the Art Contribution[1] section of the wiki (now deprecated) and the WML Reference Manual[2]. He is responsible for dispatching and sorting the patches at http://patches.wesnoth.org that has created the new developer process we currently use. Boucman was a mentor in 2008, 2009 and 2010.&lt;br /&gt;
&lt;br /&gt;
Iurii Chernyi (Crab) has joined the team in 2009, taking part in Google Summer of Code 2009, and staying with the project as a developer after successful completion of GSoC. He's an expert on all aspects of current Wesnoth AI codebase (having fully reorganized it as part of GSoC 2009), and has fixed numerous bugs all over Wesnoth. He was a GSoC mentor and a GCI mentor and administrator in 2010. He is experienced in teaching other people, in areas like programming languages and math.&lt;br /&gt;
&lt;br /&gt;
Mordante is one of the most active developers on our IRC channel. Not only has he done preliminary studies and coding in multiple areas that are candidates for Summer of Code ideas, he also is one of the coders with the best overview of the Wesnoth code. A large part of his work involves refactoring and polishing existing code. Next to that he's very active with fixing bugs which leads him to all areas in the code base. He is currently completing a rewrite of the Wesnoth GUI library, making all windows configurable through WML. This should make it easier to use Wesnoth on different resolutions, from small handheld devices to large 30 inch screens. Mordante was a mentor in 2008, 2009 and 2010.&lt;br /&gt;
&lt;br /&gt;
All other developers listed in the ideas page are the leading capacities we do have for the respecting areas. Have a look at our list of &amp;quot;people who to contact&amp;quot; [3] for an easy reference. In general all our developers will mentor all students. That is, questions should just be asked in our IRC channel, where basically every developer who has an idea can and will directly answer.&lt;br /&gt;
&lt;br /&gt;
When choosing the mentors, we have kept in mind that most developers can answer most technical questions, and we have chosen people that are well known for interacting with new-comers/external developers and can provide general guidance and design advice, more than people with specific technical knowledge.&lt;br /&gt;
&lt;br /&gt;
[1] http://wiki.wesnoth.org/UnsortedContrib&lt;br /&gt;
&lt;br /&gt;
[2] http://wiki.wesnoth.org/ReferenceWML&lt;br /&gt;
&lt;br /&gt;
[3] http://wiki.wesnoth.org/SoC_People_to_bug_on_IRC&lt;br /&gt;
&lt;br /&gt;
==== What is your plan for dealing with disappearing students? ====&lt;br /&gt;
The first thing to do is to avoid this situation altogether. &lt;br /&gt;
&lt;br /&gt;
Wesnoth is a game, and as such has lots of developers that are not coders. In particular, artists are well known in the Wesnoth community for being very sensitive about criticism and our community is used to people being sensitive to critics. &lt;br /&gt;
&lt;br /&gt;
We will try to choose students that accept criticism and are able to filter constructive criticism from useless one. The Wesnoth developer community is used to judging people according to these criteria and the special title we are going to give to applicants will allow us to easily spot any such problems and discuss them before they grow out of control.&lt;br /&gt;
&lt;br /&gt;
If a student disappears, their mentor will be in charge of recontacting the student to see what is going wrong (available time, tension with other developers, with members of the community etc...). Depending on the actual problem, the mentor and the student will have to agree on possible ways to defuse the problem.&lt;br /&gt;
&lt;br /&gt;
If a student disappears completely and there is no way to get back to them, there is little the project can do except salvaging whatever can be salvaged from the code (the students will have SVN write access, so most of the work will be committed either to trunk or to a specific branch) and find a core developer to take on the job. This will probably be slower and less effective for the project, but it's the best we can do.&lt;br /&gt;
&lt;br /&gt;
==== What is your plan for dealing with disappearing mentors? ====&lt;br /&gt;
All our mentors are long time developers that volunteered for the job, so we don't expect that to happen. We observed in during the last years the amount of time required to mentor, and our mentors accepted the job knowing the amount of work it involved. All of this years mentors mentored last year as well.&lt;br /&gt;
&lt;br /&gt;
However, should it happen, we would continue to mentor as a developer community the student until we find a new &amp;quot;official&amp;quot; mentor to take on the job.&lt;br /&gt;
&lt;br /&gt;
==== What steps will you take to encourage students to interact with your project's community before, during and after the program? ====&lt;br /&gt;
Wesnoth has a particularly healthy community, both for developers and for players. &lt;br /&gt;
&lt;br /&gt;
Our general policy regarding new coders has always been &amp;quot;two (non trival) patches... you're in&amp;quot;. With other words, anybody that is able to get two non-trivial patches applied is offered commit privileges.&lt;br /&gt;
We have a developer responsible for applying patches and guiding new developers into our community. This is a well known and effective process we plan to apply to students, directing them to our EasyCoding pages [1] (these projects are usually a couple of hours long and hve been chosen to provide easy access to the respective area of code). This year, we also have added some simple coding tasks directly related to our GSoC ideas to be able to test students more specifically on their future project&lt;br /&gt;
&lt;br /&gt;
Usually, patches go back and forth a couple of times, to make sure that all secondary things are in place (indenting, coding style, modified buildfiles etc.) The idea is that coder education should take place before the coder gets commit rights, but that getting new coder in is one of the most important things to keep our project alive.&lt;br /&gt;
&lt;br /&gt;
If the student is proactive and ready to join IRC, all the developers are usually very welcoming, and good at directing newcomers to quickly give useful results.&lt;br /&gt;
&lt;br /&gt;
In 2008, 2009 and 2010 all students that were accepted (and a couple more) managed to have commit access before the start of the coding phase. We consider that this policy was successful and we plan to keep it this year.&lt;br /&gt;
&lt;br /&gt;
We also plan to give a special forum title to any students. This will allow all forum members to tell them apart from normal users and give them read/write access to the developer only forums. This will also allow us to quickly spot any problem they might have interacting with the player community. We have a very mature developer community, but our player community is made of all sort of people of all age and education, and it can sometimes be rough.&lt;br /&gt;
&lt;br /&gt;
Last, our experience from previous years is that students that participate in the community during the evaluation period will stay active in the community after that period. In previous years this has been a discriminating criterias for students of similar level, and overall we never had problems of students working &amp;quot;behind a black wall.&amp;quot; Our selection process tend to favor students who participate, and participation hasn't been a problem so far.&lt;br /&gt;
&lt;br /&gt;
[1] http://wiki.wesnoth.org/EasyCoding&lt;br /&gt;
&lt;br /&gt;
==== If you are a small or new organization applying to GSoC, please list a larger, established GSoC organization or a Googler that can vouch for you here. ====&lt;br /&gt;
&lt;br /&gt;
==== If you are a large organization who is vouching for a small organization applying to GSoC for their first time this year, please list their name and why you think they'd be good candidates for GSoC here: ====&lt;br /&gt;
* Darktable:&lt;br /&gt;
Darktable (see http://darktable.sourceforge.net/ and https://sourceforge.net/apps/trac/darktable/wiki/GSOC) is an open source raw development tool.&lt;br /&gt;
&lt;br /&gt;
There are currently no major open source raw development tools. Multiple tools cover the need (ufraw, rawtherapee etc...) but most of them are targeting technical users with interest in photography or signal processing experts rather than &amp;quot;normal&amp;quot; photographer. &lt;br /&gt;
&lt;br /&gt;
Darktable has a very good UI designed around what most photographers expects. It is also a project which is at this interesting stage where there is a solid infrastructure and it needs developer to do the fun part of adding new feature. This is the stage of a project which is the most interesting for developers to join.&lt;br /&gt;
&lt;br /&gt;
The Darktable development community is rather small (3 active developers plus occasional contributors). It could use the extra manpower but is large enough to mentor a student into a core developer pretty fast. &lt;br /&gt;
&lt;br /&gt;
Chances of a student finding it interesting are high, chances of the student bringing major contributions to the project are very high&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Unknown Horizons:&lt;br /&gt;
Unknown Horizons (http://www.unknown-horizons.org/) is a 2D realtime strategy simulation with an emphasis on economy and city building. &lt;br /&gt;
&lt;br /&gt;
This is a smaller open source game project with a really dedicated core team of developers. During our talks with the dev who wants to work as admin it was easy to see that they do think about what they do and got some well working infrastructure. Even though the team is rather small at the moment, they are well suited to handle some students and the project has a proven record of being able to actually release something and continue working on the code. Beside their abilities it is always good to support open source gaming, especially when it comes to rather underrepresented areas like real time strategy games.&lt;br /&gt;
&lt;br /&gt;
==== Anything else you'd like to tell us?  ====&lt;br /&gt;
There is nothing more to say.&lt;br /&gt;
&lt;br /&gt;
==== Backup Admin (Link ID): ====&lt;br /&gt;
noy&lt;br /&gt;
&lt;br /&gt;
==== Admin Agreement: ====&lt;br /&gt;
(some terms of service by Google that have to be agreed upon)&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SoC_Information_for_Google&amp;diff=40724</id>
		<title>SoC Information for Google</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SoC_Information_for_Google&amp;diff=40724"/>
		<updated>2011-03-09T21:08:50Z</updated>

		<summary type="html">&lt;p&gt;Boucman: /* Does your organization have an application template you would like to see students use? If so, please provide it now. Please note that it is a very good idea to ask students to provide you with their contact information as part of your template. T&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:SoC2011}}&lt;br /&gt;
&lt;br /&gt;
== SoC Information for Google ==&lt;br /&gt;
This is the info that we submit to google as Application in Summer of Code (current status: 2010). The submitter automatically becomes primary Admin. Most entries are mandatory and have to be filled out before the application can be submitted.&lt;br /&gt;
&lt;br /&gt;
==== Organization Name: ====&lt;br /&gt;
Battle for Wesnoth&lt;br /&gt;
&lt;br /&gt;
==== Description: ====&lt;br /&gt;
''Battle for Wesnoth'', or simply ''Wesnoth'', is a free, turn-based strategy game with role-playing elements that was designed in June 2003 by David White (Sirp).&lt;br /&gt;
&lt;br /&gt;
Although the core rules are fairly simple and meant to be easily learned[1], they provide interesting gameplay and rich tactical options. A major strength of the project is the Wesnoth Markup Language (WML) for writing scenarios. Programming skills are not required to compose with it, and a large WML-modding community has generated a great deal of user-maintained content. We polish the best of this content and lift it into our official release tree.&lt;br /&gt;
&lt;br /&gt;
The first stable release (1.0) was on October 2, 2005, and the latest stable release (1.8) happened in april 2010. Version 1.8 is a major stable checkpoint, and 1.10 is not anticipated before the end of 2011. The currentdevelopment cycle (1.9, leading to 1.10) will premier significant changes in gameplay, UI, and development tools, with many new concepts being introduced. That makes this year probably one of the best years for a SoC student to join, since the open-ended 1.9 will mean much more space to develop novel ideas&lt;br /&gt;
&lt;br /&gt;
''Wesnoth'' is one of the most successful open-source game projects in existence, with an exceptionally large developer base and user community:&lt;br /&gt;
&lt;br /&gt;
* According to Ohloh, a site that collects activity statistics on open-source projects, the ''Wesnoth'' development effort is in the top 2% of largest and most active projects.&lt;br /&gt;
* We support two multiplayer game servers (stable and development) with a usual minimum load of more than a hundred players.&lt;br /&gt;
* More than two thousands downloads a day&lt;br /&gt;
* 4.5 million downloads via SourceForge; many more via various mirrors of Linux distributions&lt;br /&gt;
* Best rated game at the Linux Game Tome[2]&lt;br /&gt;
* Game of the year 2007, 2008, 2009, and 2010 at LinuxQuestions.org[3][4]&lt;br /&gt;
* In general, ''Wesnoth'' tends to show up in the first or second position whenever anyone compiles a list of top open-source games.&lt;br /&gt;
&lt;br /&gt;
''Wesnoth'''s most notable features include:&lt;br /&gt;
&lt;br /&gt;
* A mature project with continuing active development and frequent improvements&lt;br /&gt;
* High quality artwork: both original graphics and music&lt;br /&gt;
* Well­-balanced by a tireless team of playtesters&lt;br /&gt;
* Fun, unique gameplay&lt;br /&gt;
* Even after six years of development and with a very solid, fun product already created, there are still plenty of new developers; the number of commits to Subversion is still increasing&lt;br /&gt;
* Strong support of internationalization with many supported languages, thus experience in working with non-native English speakers. In fact, more than half of our developers are not native English speakers.&lt;br /&gt;
&lt;br /&gt;
[1] http://www.wesnoth.org/wiki/WesnothPhilosophy&lt;br /&gt;
&lt;br /&gt;
[2] http://www.happypenguin.org/list?sort=avg_rating&lt;br /&gt;
&lt;br /&gt;
[3] http://www.linuxquestions.org/questions/linux-news-59/2009-linuxquestions.org-members-choice-award-winners-788028/&lt;br /&gt;
&lt;br /&gt;
[4] http://www.linuxquestions.org/questions/2010-linuxquestions-org-members-choice-awards-93/open-source-game-of-the-year-855937/&lt;br /&gt;
&lt;br /&gt;
==== Home page: ====&lt;br /&gt;
http://www.wesnoth.org/&lt;br /&gt;
&lt;br /&gt;
==== Main Organization License: ====&lt;br /&gt;
GNU General Public License version 2.0 (GPLv2) [Dropdown box answer!]&lt;br /&gt;
&lt;br /&gt;
==== Why is your organization applying to participate in GSoC 2011? What do you hope to gain by participating? ====&lt;br /&gt;
Most of our developers have particular areas of interest in which they work. Though they are efficient in their areas, there are other, presently uncovered, areas of the code with a need for improvements but a high barrier to entry for casual contributors.&lt;br /&gt;
&lt;br /&gt;
Our previous SoC experience shows that a motivated, full-time, student can be brought up to date in any area fairly quickly.&lt;br /&gt;
&lt;br /&gt;
By bringing new people in and allowing them to be actively responsible for an area of code, we hope to kickstart some areas of the project that are currently lagging behind.&lt;br /&gt;
&lt;br /&gt;
Moreover, our previous experiences has shown us that SoC developers tend to stay after the end of the Summer of Code and become valuable members of our community. This has been a win in all directions and we want it to happen again.&lt;br /&gt;
&lt;br /&gt;
==== If accepted, would this be your first year participating in GSoC? ====&lt;br /&gt;
No&lt;br /&gt;
&lt;br /&gt;
==== Did your organization participate in past GSoCs? If so, please summarize your involvement and the successes and challenges of your participation. ====&lt;br /&gt;
2008 results:&lt;br /&gt;
Wesnoth participated in GSoC 2008 with four students. Out of these, two were great successes (that is they became full-fledge developers before the actual start of GSoC), did huge improvement during GSoC (A new recruitment algorithm for the AI and the basic structure for a new map editor, the student finished this work after the summer), and are still active developers in the Wesnoth community.&lt;br /&gt;
&lt;br /&gt;
Of the two other, one of them was very active for the first half of GSoC and provided some useful infrastructure for AI development that we used as base in GSoC 2009, but was much less active and didn't reach expectations for the second half of GSoC. The lesson we learned is that great students should be left on their own, that's the best way to have them work, but average students should be monitored much more closely than we did. If things seems to start to go wrong, it's important to react very quick, to meet with other mentors and get things back on track early.&lt;br /&gt;
&lt;br /&gt;
Timezone problems were also a serious barrier for student/mentor communication, and we will take that more into account when pairing mentors and students&lt;br /&gt;
&lt;br /&gt;
For our other students, multiple problems collectively led to failure&lt;br /&gt;
* We should enforce IRC communication, E-mail is a barrier. This applies both for students and mentors. Both should be on IRC several hours a day, with overlapping hours.&lt;br /&gt;
* We should be more strict about mid-term evaluation. If the student is slightly lacking at mid-term we should give a clear message that he needs to get back on track.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2009 results:&lt;br /&gt;
In 2009 we mentored 6 students as part of Summer of Code. Out of these 5 projects were a success. From those 5 developers 3 are still part of our core development group and still maintain and improve the work they submitted as part of Summer of Code. One of the students even became the &amp;quot;head&amp;quot; of our AI development department and mentored a student this year. For a summary of the 2009 results have a look at [1].&lt;br /&gt;
&lt;br /&gt;
Sadly one student was not able to continue his work past midterm due to his computer failing completely as well as personal problems that we won't delve into further here. It was not a salvageable situation.&lt;br /&gt;
&lt;br /&gt;
2010 results:&lt;br /&gt;
In 2010 we mentored 4 students as part of Summer of Code, all the projects were a success. from those 4 developers, 1 is still part of our code development team and maintains the work he has done as part of Summer of Code.&lt;br /&gt;
&lt;br /&gt;
[1] http://forums.wesnoth.org/viewtopic.php?f=5&amp;amp;t=26955&lt;br /&gt;
&lt;br /&gt;
==== If your organization participated in past GSoCs, please let us know the ratio of students passing to students allocated, e.g. 2006: 3/6 for 3 out of 6 students passed in 2006. ====&lt;br /&gt;
2008: 2/4&lt;br /&gt;
2009: 5/6&lt;br /&gt;
2010: 4/4&lt;br /&gt;
&lt;br /&gt;
==== What is the URL for your ideas page? ====&lt;br /&gt;
http://wiki.wesnoth.org/SummerOfCodeIdeas&lt;br /&gt;
&lt;br /&gt;
==== What is the main development mailing list for your organization? This question will be shown to students who would like to get more information about applying to your organization for GSoC 2011. If your organization uses more than one list, please make sure to include a description of the list so students know which to use. ====&lt;br /&gt;
The main development mailing list is &amp;quot;wesnoth-dev@gna.org&amp;quot;. Our main means of communications is our IRC channel on freenode. If you have questions you should ask them in #wesnoth-dev on irc.freenode.net and wait for a reply (might take some hours!). The Wesnoth related channels are logged in public and the logs tend to be read by developers.&lt;br /&gt;
&lt;br /&gt;
==== What is the main IRC channel for your organization? ====&lt;br /&gt;
 #wesnoth-dev on irc.freenode.net&lt;br /&gt;
&lt;br /&gt;
==== Does your organization have an application template you would like to see students use? If so, please provide it now. Please note that it is a very good idea to ask students to provide you with their contact information as part of your template. Their contact details will not be shared with you automatically via the GSoC 2011 site. ====&lt;br /&gt;
We plan mainly to meet potential students through our IRC channel, but the following questions are Wesnoth specific and are worth pondering for any student, even if we don't need a formal answer. So please beside just answering these questions consider visiting us in IRC: #wesnoth-dev on irc.freenode.net. This is where most of our work takes place and participating in IRC is mandatory for GSoC students participating with Wesnoth. Our experience is that this is the easiest way to communicate and solve problems that come up.&lt;br /&gt;
&lt;br /&gt;
If you want to participate in GSoC as a student please copy http://wiki.wesnoth.org/SoC2011_Template_of_Student_page to a new page and fill it with the answers to the following questions&lt;br /&gt;
&lt;br /&gt;
Again, participating on IRC will be highly considered, you should not hesitate to ask any questions there, including how to fill a good proposal. We highly value your capacity to communicate and work in a team, so help other students, actively ask for proposal criticism, this can only help your proposal&lt;br /&gt;
&lt;br /&gt;
1) Basics&lt;br /&gt;
&lt;br /&gt;
1.1) Write a small introduction to yourself.&lt;br /&gt;
&lt;br /&gt;
1.2) State your preferred email address.&lt;br /&gt;
&lt;br /&gt;
1.3) If you have chosen a nick for IRC and Wesnoth forums, what is it?&lt;br /&gt;
&lt;br /&gt;
1.4) Why do you want to participate in summer of code?&lt;br /&gt;
&lt;br /&gt;
1.5) What are you studying, subject, level and school? &lt;br /&gt;
&lt;br /&gt;
1.6) What country are you from, at what time are you most likely to be able to join IRC?&lt;br /&gt;
&lt;br /&gt;
1.7) Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) Experience&lt;br /&gt;
&lt;br /&gt;
2.1) What programs/software have you worked on before?&lt;br /&gt;
&lt;br /&gt;
2.2) Have you developed software in a team environment before? (As opposed to hacking on something on your own)&lt;br /&gt;
&lt;br /&gt;
2.3) Have you participated to the Google Summer of Code before? As a mentor or a student? In what project? Were you successful? If not, why?&lt;br /&gt;
&lt;br /&gt;
2.4) Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.&lt;br /&gt;
&lt;br /&gt;
2.5) Gaming experience - Are you a gamer?&lt;br /&gt;
&lt;br /&gt;
2.5.1) What type of gamer are you?&lt;br /&gt;
&lt;br /&gt;
2.5.2) What type of games? &lt;br /&gt;
&lt;br /&gt;
2.5.3) What type of opponents do you prefer? &lt;br /&gt;
&lt;br /&gt;
2.5.4) Are you more interested in story or gameplay?&lt;br /&gt;
&lt;br /&gt;
2.5.5) Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.&lt;br /&gt;
&lt;br /&gt;
We do not plan to favor Wesnoth players as such, but some particular projects require a good feeling for the game which is hard to get without having played intensively.&lt;br /&gt;
&lt;br /&gt;
2.6) If you have contributed any patches to Wesnoth, please list them below. You can also list patches that have been submitted but not committed yet and patches that have not been specifically written for GSoC. If you have gained commit access to our SVN (during the evaluation period or earlier) please state so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Communication skills&lt;br /&gt;
&lt;br /&gt;
3.1) Though most of our developers are not native English speakers, English is the project's working language.  Describe your fluency level in written English.&lt;br /&gt;
&lt;br /&gt;
3.2) What spoken languages are you fluent in?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3.3) Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.&lt;br /&gt;
&lt;br /&gt;
3.4) Do you give constructive advice? &lt;br /&gt;
&lt;br /&gt;
3.5) Do you receive advice well? &lt;br /&gt;
&lt;br /&gt;
3.6) Are you good at sorting useful criticisms from useless ones?&lt;br /&gt;
&lt;br /&gt;
3.7) How autonomous are you when developing ? Would you rather discuss intensively changes and not start coding until you know what you want to do or would you rather code a proof of concept to &amp;quot;see how it turn out&amp;quot;, taking the risk of having it thrown away if it doesn't match what the project want&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4) Project&lt;br /&gt;
&lt;br /&gt;
4.1) Did you select a project from our list? If that is the case, what project did you select? What do you want to especially concentrate on?&lt;br /&gt;
&lt;br /&gt;
4.2) If you have invented your own project, please describe the project and the scope.&lt;br /&gt;
&lt;br /&gt;
4.3) Why did you choose this project?&lt;br /&gt;
&lt;br /&gt;
4.4) Include an estimated timeline for your work on the project. Don't forget to mention special things like &amp;quot;I booked holidays between A and B&amp;quot; and &amp;quot;I got an exam at ABC and won't be doing much then&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
4.5) Include as much technical detail about your implementation as you can&lt;br /&gt;
&lt;br /&gt;
4.6) What do you expect to gain from this project?&lt;br /&gt;
&lt;br /&gt;
4.7) What would make you stay in the Wesnoth community after the conclusion of SOC? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5) Practical considerations&lt;br /&gt;
&lt;br /&gt;
5.1) Are you familiar with any of the following tools or languages?&lt;br /&gt;
* Subversion (used for all commits)&lt;br /&gt;
* C++ (language used for all the normal source code)&lt;br /&gt;
* STL, Boost, Sdl (C++ libraries used by Wesnoth)&lt;br /&gt;
* Python (optional, mainly used for tools)&lt;br /&gt;
* build environments (eg cmake/autotools/scons)&lt;br /&gt;
* WML (the wesnoth specific scenario language)&lt;br /&gt;
* Lua (used in combination with WML to create scenarios)&lt;br /&gt;
&lt;br /&gt;
5.2) Which tools do you normally use for development? Why do you use them?&lt;br /&gt;
&lt;br /&gt;
5.3) What programming languages are you fluent in?&lt;br /&gt;
&lt;br /&gt;
5.4) Would you mind talking with your mentor on telephone / internet phone? We would like to have a backup way for communications for the case that somehow emails and IRC do fail. If you are willing to do so, please do list a phone number (including international code) so that we are able to contact you. You should probably *only* add this number in the application for you submit to google since the info in the wiki is available in public. We will *not* make any use of your number unless some case of &amp;quot;there is no way to contact you&amp;quot; does arise!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In general please try to be as verbose as possible in your answers and feel free to elaborate.&lt;br /&gt;
&lt;br /&gt;
==== What criteria did you use to select the individuals who will act as mentors for your organization? Please be as specific as possible. ====&lt;br /&gt;
Our first criterion was that all the people had to be volunteers. According to other open source projects and our experience from the last two years, being a SoC mentor takes a lot of time and the person has to be ready to spend quite some time with the student.&lt;br /&gt;
&lt;br /&gt;
Boucman is one of the oldest active developers around. He has rewritten the whole animation engine and made it an easily pluggable system allowing artists to easily specify exactly how they want the units to appear. He also started many community oriented projects like the Art Contribution[1] section of the wiki (now deprecated) and the WML Reference Manual[2]. He is responsible for dispatching and sorting the patches at http://patches.wesnoth.org that has created the new developer process we currently use. Boucman was a mentor in 2008, 2009 and 2010.&lt;br /&gt;
&lt;br /&gt;
Iurii Chernyi (Crab) has joined the team in 2009, taking part in Google Summer of Code 2009, and staying with the project as a developer after successful completion of GSoC. He's an expert on all aspects of current Wesnoth AI codebase (having fully reorganized it as part of GSoC 2009), and has fixed numerous bugs all over Wesnoth. He was a GSoC mentor and a GCI mentor and administrator in 2010. He is experienced in teaching other people, in areas like programming languages and math.&lt;br /&gt;
&lt;br /&gt;
Mordante is one of the most active developers on our IRC channel. Not only has he done preliminary studies and coding in multiple areas that are candidates for Summer of Code ideas, he also is one of the coders with the best overview of the Wesnoth code. A large part of his work involves refactoring and polishing existing code. Next to that he's very active with fixing bugs which leads him to all areas in the code base. He is currently completing a rewrite of the Wesnoth GUI library, making all windows configurable through WML. This should make it easier to use Wesnoth on different resolutions, from small handheld devices to large 30 inch screens. Mordante was a mentor in 2008, 2009 and 2010.&lt;br /&gt;
&lt;br /&gt;
All other developers listed in the ideas page are the leading capacities we do have for the respecting areas. Have a look at our list of &amp;quot;people who to contact&amp;quot; [3] for an easy reference. In general all our developers will mentor all students. That is, questions should just be asked in our IRC channel, where basically every developer who has an idea can and will directly answer.&lt;br /&gt;
&lt;br /&gt;
When choosing the mentors, we have kept in mind that most developers can answer most technical questions, and we have chosen people that are well known for interacting with new-comers/external developers and can provide general guidance and design advice, more than people with specific technical knowledge.&lt;br /&gt;
&lt;br /&gt;
[1] http://wiki.wesnoth.org/UnsortedContrib&lt;br /&gt;
&lt;br /&gt;
[2] http://wiki.wesnoth.org/ReferenceWML&lt;br /&gt;
&lt;br /&gt;
[3] http://wiki.wesnoth.org/SoC_People_to_bug_on_IRC&lt;br /&gt;
&lt;br /&gt;
==== What is your plan for dealing with disappearing students? ====&lt;br /&gt;
The first thing to do is to avoid this situation altogether. &lt;br /&gt;
&lt;br /&gt;
Wesnoth is a game, and as such has lots of developers that are not coders. In particular, artists are well known in the Wesnoth community for being very sensitive about criticism and our community is used to people being sensitive to critics. &lt;br /&gt;
&lt;br /&gt;
We will try to choose students that accept criticism and are able to filter constructive criticism from useless one. The Wesnoth developer community is used to judging people according to these criteria and the special title we are going to give to applicants will allow us to easily spot any such problems and discuss them before they grow out of control.&lt;br /&gt;
&lt;br /&gt;
If a student disappears, their mentor will be in charge of recontacting the student to see what is going wrong (available time, tension with other developers, with members of the community etc...). Depending on the actual problem, the mentor and the student will have to agree on possible ways to defuse the problem.&lt;br /&gt;
&lt;br /&gt;
If a student disappears completely and there is no way to get back to them, there is little the project can do except salvaging whatever can be salvaged from the code (the students will have SVN write access, so most of the work will be committed either to trunk or to a specific branch) and find a core developer to take on the job. This will probably be slower and less effective for the project, but it's the best we can do.&lt;br /&gt;
&lt;br /&gt;
==== What is your plan for dealing with disappearing mentors? ====&lt;br /&gt;
All our mentors are long time developers that volunteered for the job, so we don't expect that to happen. We observed in during the last years the amount of time required to mentor, and our mentors accepted the job knowing the amount of work it involved. All of this years mentors mentored last year as well.&lt;br /&gt;
&lt;br /&gt;
However, should it happen, we would continue to mentor as a developer community the student until we find a new &amp;quot;official&amp;quot; mentor to take on the job.&lt;br /&gt;
&lt;br /&gt;
==== What steps will you take to encourage students to interact with your project's community before, during and after the program? ====&lt;br /&gt;
Wesnoth has a particularly healthy community, both for developers and for players. &lt;br /&gt;
&lt;br /&gt;
Our general policy regarding new coders has always been &amp;quot;two (non trival) patches... you're in&amp;quot;. With other words, anybody that is able to get two non-trivial patches applied is offered commit privileges.&lt;br /&gt;
We have a developer responsible for applying patches and guiding new developers into our community. This is a well known and effective process we plan to apply to students, directing them to our EasyCoding pages [1] (these projects are usually a couple of hours long and hve been chosen to provide easy access to the respective area of code).&lt;br /&gt;
&lt;br /&gt;
Usually, patches go back and forth a couple of times, to make sure that all secondary things are in place (indenting, coding style, modified buildfiles etc.) The idea is that coder education should take place before the coder gets commit rights, but that getting new coder in is one of the most important things to keep our project alive.&lt;br /&gt;
&lt;br /&gt;
If the student is proactive and ready to join IRC, all the developers are usually very welcoming, and good at directing newcomers to quickly give useful results.&lt;br /&gt;
&lt;br /&gt;
In 2008, 2009 and 2010 all students that were accepted (and a couple more) managed to have commit access before the start of the coding phase. We consider that this policy was successful and we plan to keep it this year.&lt;br /&gt;
&lt;br /&gt;
We also plan to give a special forum title to any students. This will allow all forum members to tell them apart from normal users and give them read/write access to the developer only forums. This will also allow us to quickly spot any problem they might have interacting with the player community. We have a very mature developer community, but our player community is made of all sort of people of all age and education, and it can sometimes be rough.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[1] http://wiki.wesnoth.org/EasyCoding&lt;br /&gt;
&lt;br /&gt;
==== If you are a small or new organization applying to GSoC, please list a larger, established GSoC organization or a Googler that can vouch for you here. ====&lt;br /&gt;
&lt;br /&gt;
==== If you are a large organization who is vouching for a small organization applying to GSoC for their first time this year, please list their name and why you think they'd be good candidates for GSoC here: ====&lt;br /&gt;
* Darktable:&lt;br /&gt;
Darktable (see http://darktable.sourceforge.net/ and https://sourceforge.net/apps/trac/darktable/wiki/GSOC) is an open source raw development tool.&lt;br /&gt;
&lt;br /&gt;
There are currently no major open source raw development tools. Multiple tools cover the need (ufraw, rawtherapee etc...) but most of them are targeting technical users with interest in photography or signal processing experts rather than &amp;quot;normal&amp;quot; photographer. &lt;br /&gt;
&lt;br /&gt;
Darktable has a very good UI designed around what most photographers expects. It is also a project which is at this interesting stage where there is a solid infrastructure and it needs developer to do the fun part of adding new feature. This is the stage of a project which is the most interesting for developers to join.&lt;br /&gt;
&lt;br /&gt;
The Darktable development community is rather small (3 active developers plus occasional contributors). It could use the extra manpower but is large enough to mentor a student into a core developer pretty fast. &lt;br /&gt;
&lt;br /&gt;
Chances of a student finding it interesting are high, chances of the student bringing major contributions to the project are very high&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Unknown Horizons:&lt;br /&gt;
Unknown Horizons (http://www.unknown-horizons.org/) is a 2D realtime strategy simulation with an emphasis on economy and city building. &lt;br /&gt;
&lt;br /&gt;
This is a smaller open source game project with a really dedicated core team of developers. During our talks with the dev who wants to work as admin it was easy to see that they do think about what they do and got some well working infrastructure. Even though the team is rather small at the moment, they are well suited to handle some students and the project has a proven record of being able to actually release something and continue working on the code. Beside their abilities it is always good to support open source gaming, especially when it comes to rather underrepresented areas like real time strategy games.&lt;br /&gt;
&lt;br /&gt;
==== Anything else you'd like to tell us?  ====&lt;br /&gt;
There is nothing more to say.&lt;br /&gt;
&lt;br /&gt;
==== Backup Admin (Link ID): ====&lt;br /&gt;
noy&lt;br /&gt;
&lt;br /&gt;
==== Admin Agreement: ====&lt;br /&gt;
(some terms of service by Google that have to be agreed upon)&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SoC_Information_for_Google&amp;diff=40723</id>
		<title>SoC Information for Google</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SoC_Information_for_Google&amp;diff=40723"/>
		<updated>2011-03-09T20:59:15Z</updated>

		<summary type="html">&lt;p&gt;Boucman: /* Description: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:SoC2011}}&lt;br /&gt;
&lt;br /&gt;
== SoC Information for Google ==&lt;br /&gt;
This is the info that we submit to google as Application in Summer of Code (current status: 2010). The submitter automatically becomes primary Admin. Most entries are mandatory and have to be filled out before the application can be submitted.&lt;br /&gt;
&lt;br /&gt;
==== Organization Name: ====&lt;br /&gt;
Battle for Wesnoth&lt;br /&gt;
&lt;br /&gt;
==== Description: ====&lt;br /&gt;
''Battle for Wesnoth'', or simply ''Wesnoth'', is a free, turn-based strategy game with role-playing elements that was designed in June 2003 by David White (Sirp).&lt;br /&gt;
&lt;br /&gt;
Although the core rules are fairly simple and meant to be easily learned[1], they provide interesting gameplay and rich tactical options. A major strength of the project is the Wesnoth Markup Language (WML) for writing scenarios. Programming skills are not required to compose with it, and a large WML-modding community has generated a great deal of user-maintained content. We polish the best of this content and lift it into our official release tree.&lt;br /&gt;
&lt;br /&gt;
The first stable release (1.0) was on October 2, 2005, and the latest stable release (1.8) happened in april 2010. Version 1.8 is a major stable checkpoint, and 1.10 is not anticipated before the end of 2011. The currentdevelopment cycle (1.9, leading to 1.10) will premier significant changes in gameplay, UI, and development tools, with many new concepts being introduced. That makes this year probably one of the best years for a SoC student to join, since the open-ended 1.9 will mean much more space to develop novel ideas&lt;br /&gt;
&lt;br /&gt;
''Wesnoth'' is one of the most successful open-source game projects in existence, with an exceptionally large developer base and user community:&lt;br /&gt;
&lt;br /&gt;
* According to Ohloh, a site that collects activity statistics on open-source projects, the ''Wesnoth'' development effort is in the top 2% of largest and most active projects.&lt;br /&gt;
* We support two multiplayer game servers (stable and development) with a usual minimum load of more than a hundred players.&lt;br /&gt;
* More than two thousands downloads a day&lt;br /&gt;
* 4.5 million downloads via SourceForge; many more via various mirrors of Linux distributions&lt;br /&gt;
* Best rated game at the Linux Game Tome[2]&lt;br /&gt;
* Game of the year 2007, 2008, 2009, and 2010 at LinuxQuestions.org[3][4]&lt;br /&gt;
* In general, ''Wesnoth'' tends to show up in the first or second position whenever anyone compiles a list of top open-source games.&lt;br /&gt;
&lt;br /&gt;
''Wesnoth'''s most notable features include:&lt;br /&gt;
&lt;br /&gt;
* A mature project with continuing active development and frequent improvements&lt;br /&gt;
* High quality artwork: both original graphics and music&lt;br /&gt;
* Well­-balanced by a tireless team of playtesters&lt;br /&gt;
* Fun, unique gameplay&lt;br /&gt;
* Even after six years of development and with a very solid, fun product already created, there are still plenty of new developers; the number of commits to Subversion is still increasing&lt;br /&gt;
* Strong support of internationalization with many supported languages, thus experience in working with non-native English speakers. In fact, more than half of our developers are not native English speakers.&lt;br /&gt;
&lt;br /&gt;
[1] http://www.wesnoth.org/wiki/WesnothPhilosophy&lt;br /&gt;
&lt;br /&gt;
[2] http://www.happypenguin.org/list?sort=avg_rating&lt;br /&gt;
&lt;br /&gt;
[3] http://www.linuxquestions.org/questions/linux-news-59/2009-linuxquestions.org-members-choice-award-winners-788028/&lt;br /&gt;
&lt;br /&gt;
[4] http://www.linuxquestions.org/questions/2010-linuxquestions-org-members-choice-awards-93/open-source-game-of-the-year-855937/&lt;br /&gt;
&lt;br /&gt;
==== Home page: ====&lt;br /&gt;
http://www.wesnoth.org/&lt;br /&gt;
&lt;br /&gt;
==== Main Organization License: ====&lt;br /&gt;
GNU General Public License version 2.0 (GPLv2) [Dropdown box answer!]&lt;br /&gt;
&lt;br /&gt;
==== Why is your organization applying to participate in GSoC 2011? What do you hope to gain by participating? ====&lt;br /&gt;
Most of our developers have particular areas of interest in which they work. Though they are efficient in their areas, there are other, presently uncovered, areas of the code with a need for improvements but a high barrier to entry for casual contributors.&lt;br /&gt;
&lt;br /&gt;
Our previous SoC experience shows that a motivated, full-time, student can be brought up to date in any area fairly quickly.&lt;br /&gt;
&lt;br /&gt;
By bringing new people in and allowing them to be actively responsible for an area of code, we hope to kickstart some areas of the project that are currently lagging behind.&lt;br /&gt;
&lt;br /&gt;
Moreover, our previous experiences has shown us that SoC developers tend to stay after the end of the Summer of Code and become valuable members of our community. This has been a win in all directions and we want it to happen again.&lt;br /&gt;
&lt;br /&gt;
==== If accepted, would this be your first year participating in GSoC? ====&lt;br /&gt;
No&lt;br /&gt;
&lt;br /&gt;
==== Did your organization participate in past GSoCs? If so, please summarize your involvement and the successes and challenges of your participation. ====&lt;br /&gt;
2008 results:&lt;br /&gt;
Wesnoth participated in GSoC 2008 with four students. Out of these, two were great successes (that is they became full-fledge developers before the actual start of GSoC), did huge improvement during GSoC (A new recruitment algorithm for the AI and the basic structure for a new map editor, the student finished this work after the summer), and are still active developers in the Wesnoth community.&lt;br /&gt;
&lt;br /&gt;
Of the two other, one of them was very active for the first half of GSoC and provided some useful infrastructure for AI development that we used as base in GSoC 2009, but was much less active and didn't reach expectations for the second half of GSoC. The lesson we learned is that great students should be left on their own, that's the best way to have them work, but average students should be monitored much more closely than we did. If things seems to start to go wrong, it's important to react very quick, to meet with other mentors and get things back on track early.&lt;br /&gt;
&lt;br /&gt;
Timezone problems were also a serious barrier for student/mentor communication, and we will take that more into account when pairing mentors and students&lt;br /&gt;
&lt;br /&gt;
For our other students, multiple problems collectively led to failure&lt;br /&gt;
* We should enforce IRC communication, E-mail is a barrier. This applies both for students and mentors. Both should be on IRC several hours a day, with overlapping hours.&lt;br /&gt;
* We should be more strict about mid-term evaluation. If the student is slightly lacking at mid-term we should give a clear message that he needs to get back on track.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2009 results:&lt;br /&gt;
In 2009 we mentored 6 students as part of Summer of Code. Out of these 5 projects were a success. From those 5 developers 3 are still part of our core development group and still maintain and improve the work they submitted as part of Summer of Code. One of the students even became the &amp;quot;head&amp;quot; of our AI development department and mentored a student this year. For a summary of the 2009 results have a look at [1].&lt;br /&gt;
&lt;br /&gt;
Sadly one student was not able to continue his work past midterm due to his computer failing completely as well as personal problems that we won't delve into further here. It was not a salvageable situation.&lt;br /&gt;
&lt;br /&gt;
2010 results:&lt;br /&gt;
In 2010 we mentored 4 students as part of Summer of Code, all the projects were a success. from those 4 developers, 1 is still part of our code development team and maintains the work he has done as part of Summer of Code.&lt;br /&gt;
&lt;br /&gt;
[1] http://forums.wesnoth.org/viewtopic.php?f=5&amp;amp;t=26955&lt;br /&gt;
&lt;br /&gt;
==== If your organization participated in past GSoCs, please let us know the ratio of students passing to students allocated, e.g. 2006: 3/6 for 3 out of 6 students passed in 2006. ====&lt;br /&gt;
2008: 2/4&lt;br /&gt;
2009: 5/6&lt;br /&gt;
2010: 4/4&lt;br /&gt;
&lt;br /&gt;
==== What is the URL for your ideas page? ====&lt;br /&gt;
http://wiki.wesnoth.org/SummerOfCodeIdeas&lt;br /&gt;
&lt;br /&gt;
==== What is the main development mailing list for your organization? This question will be shown to students who would like to get more information about applying to your organization for GSoC 2011. If your organization uses more than one list, please make sure to include a description of the list so students know which to use. ====&lt;br /&gt;
The main development mailing list is &amp;quot;wesnoth-dev@gna.org&amp;quot;. Our main means of communications is our IRC channel on freenode. If you have questions you should ask them in #wesnoth-dev on irc.freenode.net and wait for a reply (might take some hours!). The Wesnoth related channels are logged in public and the logs tend to be read by developers.&lt;br /&gt;
&lt;br /&gt;
==== What is the main IRC channel for your organization? ====&lt;br /&gt;
 #wesnoth-dev on irc.freenode.net&lt;br /&gt;
&lt;br /&gt;
==== Does your organization have an application template you would like to see students use? If so, please provide it now. Please note that it is a very good idea to ask students to provide you with their contact information as part of your template. Their contact details will not be shared with you automatically via the GSoC 2011 site. ====&lt;br /&gt;
We plan mainly to meet potential students through our IRC channel, but the following questions are Wesnoth specific and are worth pondering for any student, even if we don't need a formal answer. So please beside just answering these questions consider visiting us in IRC: #wesnoth-dev on irc.freenode.net. This is where most of our work takes place and participating in IRC is mandatory for GSoC students participating with Wesnoth. Our experience is that this is the easiest way to communicate and solve problems that come up.&lt;br /&gt;
&lt;br /&gt;
1) Basics&lt;br /&gt;
&lt;br /&gt;
1.1) Write a small introduction to yourself.&lt;br /&gt;
&lt;br /&gt;
1.2) State your preferred email address.&lt;br /&gt;
&lt;br /&gt;
1.3) If you have chosen a nick for IRC and Wesnoth forums, what is it?&lt;br /&gt;
&lt;br /&gt;
1.4) Why do you want to participate in summer of code?&lt;br /&gt;
&lt;br /&gt;
1.5) What are you studying, subject, level and school? &lt;br /&gt;
&lt;br /&gt;
1.6) What country are you from, at what time are you most likely to be able to join IRC?&lt;br /&gt;
&lt;br /&gt;
1.7) Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) Experience&lt;br /&gt;
&lt;br /&gt;
2.1) What programs/software have you worked on before?&lt;br /&gt;
&lt;br /&gt;
2.2) Have you developed software in a team environment before? (As opposed to hacking on something on your own)&lt;br /&gt;
&lt;br /&gt;
2.3) Have you participated to the Google Summer of Code before? As a mentor or a student? In what project? Were you successful? If not, why?&lt;br /&gt;
&lt;br /&gt;
2.4) Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.&lt;br /&gt;
&lt;br /&gt;
2.5) Gaming experience - Are you a gamer?&lt;br /&gt;
&lt;br /&gt;
2.5.1) What type of gamer are you?&lt;br /&gt;
&lt;br /&gt;
2.5.2) What type of games? &lt;br /&gt;
&lt;br /&gt;
2.5.3) What type of opponents do you prefer? &lt;br /&gt;
&lt;br /&gt;
2.5.4) Are you more interested in story or gameplay?&lt;br /&gt;
&lt;br /&gt;
2.5.5) Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.&lt;br /&gt;
&lt;br /&gt;
We do not plan to favor Wesnoth players as such, but some particular projects require a good feeling for the game which is hard to get without having played intensively.&lt;br /&gt;
&lt;br /&gt;
2.6) If you have contributed any patches to Wesnoth, please list them below. You can also list patches that have been submitted but not committed yet and patches that have not been specifically written for GSoC. If you have gained commit access to our SVN (during the evaluation period or earlier) please state so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Communication skills&lt;br /&gt;
&lt;br /&gt;
3.1) Though most of our developers are not native English speakers, English is the project's working language.  Describe your fluency level in written English.&lt;br /&gt;
&lt;br /&gt;
3.2) What spoken languages are you fluent in?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3.3) Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.&lt;br /&gt;
&lt;br /&gt;
3.4) Do you give constructive advice? &lt;br /&gt;
&lt;br /&gt;
3.5) Do you receive advice well? &lt;br /&gt;
&lt;br /&gt;
3.6) Are you good at sorting useful criticisms from useless ones?&lt;br /&gt;
&lt;br /&gt;
3.7) How autonomous are you when developing ? Would you rather discuss intensively changes and not start coding until you know what you want to do or would you rather code a proof of concept to &amp;quot;see how it turn out&amp;quot;, taking the risk of having it thrown away if it doesn't match what the project want&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4) Project&lt;br /&gt;
&lt;br /&gt;
4.1) Did you select a project from our list? If that is the case, what project did you select? What do you want to especially concentrate on?&lt;br /&gt;
&lt;br /&gt;
4.2) If you have invented your own project, please describe the project and the scope.&lt;br /&gt;
&lt;br /&gt;
4.3) Why did you choose this project?&lt;br /&gt;
&lt;br /&gt;
4.4) Include an estimated timeline for your work on the project. Don't forget to mention special things like &amp;quot;I booked holidays between A and B&amp;quot; and &amp;quot;I got an exam at ABC and won't be doing much then&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
4.5) Include as much technical detail about your implementation as you can&lt;br /&gt;
&lt;br /&gt;
4.6) What do you expect to gain from this project?&lt;br /&gt;
&lt;br /&gt;
4.7) What would make you stay in the Wesnoth community after the conclusion of SOC? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5) Practical considerations&lt;br /&gt;
&lt;br /&gt;
5.1) Are you familiar with any of the following tools or languages?&lt;br /&gt;
* Subversion (used for all commits)&lt;br /&gt;
* C++ (language used for all the normal source code)&lt;br /&gt;
* STL, Boost, Sdl (C++ libraries used by Wesnoth)&lt;br /&gt;
* Python (optional, mainly used for tools)&lt;br /&gt;
* build environments (eg cmake/autotools/scons)&lt;br /&gt;
* WML (the wesnoth specific scenario language)&lt;br /&gt;
* Lua (used in combination with WML to create scenarios)&lt;br /&gt;
&lt;br /&gt;
5.2) Which tools do you normally use for development? Why do you use them?&lt;br /&gt;
&lt;br /&gt;
5.3) What programming languages are you fluent in?&lt;br /&gt;
&lt;br /&gt;
5.4) Would you mind talking with your mentor on telephone / internet phone? We would like to have a backup way for communications for the case that somehow emails and IRC do fail. If you are willing to do so, please do list a phone number (including international code) so that we are able to contact you. You should probably *only* add this number in the application for you submit to google since the info in the wiki is available in public. We will *not* make any use of your number unless some case of &amp;quot;there is no way to contact you&amp;quot; does arise!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In general please try to be as verbose as possible in your answers and feel free to elaborate.&lt;br /&gt;
&lt;br /&gt;
==== What criteria did you use to select the individuals who will act as mentors for your organization? Please be as specific as possible. ====&lt;br /&gt;
Our first criterion was that all the people had to be volunteers. According to other open source projects and our experience from the last two years, being a SoC mentor takes a lot of time and the person has to be ready to spend quite some time with the student.&lt;br /&gt;
&lt;br /&gt;
Boucman is one of the oldest active developers around. He has rewritten the whole animation engine and made it an easily pluggable system allowing artists to easily specify exactly how they want the units to appear. He also started many community oriented projects like the Art Contribution[1] section of the wiki (now deprecated) and the WML Reference Manual[2]. He is responsible for dispatching and sorting the patches at http://patches.wesnoth.org that has created the new developer process we currently use. Boucman was a mentor in 2008, 2009 and 2010.&lt;br /&gt;
&lt;br /&gt;
Iurii Chernyi (Crab) has joined the team in 2009, taking part in Google Summer of Code 2009, and staying with the project as a developer after successful completion of GSoC. He's an expert on all aspects of current Wesnoth AI codebase (having fully reorganized it as part of GSoC 2009), and has fixed numerous bugs all over Wesnoth. He was a GSoC mentor and a GCI mentor and administrator in 2010. He is experienced in teaching other people, in areas like programming languages and math.&lt;br /&gt;
&lt;br /&gt;
Mordante is one of the most active developers on our IRC channel. Not only has he done preliminary studies and coding in multiple areas that are candidates for Summer of Code ideas, he also is one of the coders with the best overview of the Wesnoth code. A large part of his work involves refactoring and polishing existing code. Next to that he's very active with fixing bugs which leads him to all areas in the code base. He is currently completing a rewrite of the Wesnoth GUI library, making all windows configurable through WML. This should make it easier to use Wesnoth on different resolutions, from small handheld devices to large 30 inch screens. Mordante was a mentor in 2008, 2009 and 2010.&lt;br /&gt;
&lt;br /&gt;
All other developers listed in the ideas page are the leading capacities we do have for the respecting areas. Have a look at our list of &amp;quot;people who to contact&amp;quot; [3] for an easy reference. In general all our developers will mentor all students. That is, questions should just be asked in our IRC channel, where basically every developer who has an idea can and will directly answer.&lt;br /&gt;
&lt;br /&gt;
When choosing the mentors, we have kept in mind that most developers can answer most technical questions, and we have chosen people that are well known for interacting with new-comers/external developers and can provide general guidance and design advice, more than people with specific technical knowledge.&lt;br /&gt;
&lt;br /&gt;
[1] http://wiki.wesnoth.org/UnsortedContrib&lt;br /&gt;
&lt;br /&gt;
[2] http://wiki.wesnoth.org/ReferenceWML&lt;br /&gt;
&lt;br /&gt;
[3] http://wiki.wesnoth.org/SoC_People_to_bug_on_IRC&lt;br /&gt;
&lt;br /&gt;
==== What is your plan for dealing with disappearing students? ====&lt;br /&gt;
The first thing to do is to avoid this situation altogether. &lt;br /&gt;
&lt;br /&gt;
Wesnoth is a game, and as such has lots of developers that are not coders. In particular, artists are well known in the Wesnoth community for being very sensitive about criticism and our community is used to people being sensitive to critics. &lt;br /&gt;
&lt;br /&gt;
We will try to choose students that accept criticism and are able to filter constructive criticism from useless one. The Wesnoth developer community is used to judging people according to these criteria and the special title we are going to give to applicants will allow us to easily spot any such problems and discuss them before they grow out of control.&lt;br /&gt;
&lt;br /&gt;
If a student disappears, their mentor will be in charge of recontacting the student to see what is going wrong (available time, tension with other developers, with members of the community etc...). Depending on the actual problem, the mentor and the student will have to agree on possible ways to defuse the problem.&lt;br /&gt;
&lt;br /&gt;
If a student disappears completely and there is no way to get back to them, there is little the project can do except salvaging whatever can be salvaged from the code (the students will have SVN write access, so most of the work will be committed either to trunk or to a specific branch) and find a core developer to take on the job. This will probably be slower and less effective for the project, but it's the best we can do.&lt;br /&gt;
&lt;br /&gt;
==== What is your plan for dealing with disappearing mentors? ====&lt;br /&gt;
All our mentors are long time developers that volunteered for the job, so we don't expect that to happen. We observed in during the last years the amount of time required to mentor, and our mentors accepted the job knowing the amount of work it involved. All of this years mentors mentored last year as well.&lt;br /&gt;
&lt;br /&gt;
However, should it happen, we would continue to mentor as a developer community the student until we find a new &amp;quot;official&amp;quot; mentor to take on the job.&lt;br /&gt;
&lt;br /&gt;
==== What steps will you take to encourage students to interact with your project's community before, during and after the program? ====&lt;br /&gt;
Wesnoth has a particularly healthy community, both for developers and for players. &lt;br /&gt;
&lt;br /&gt;
Our general policy regarding new coders has always been &amp;quot;two (non trival) patches... you're in&amp;quot;. With other words, anybody that is able to get two non-trivial patches applied is offered commit privileges.&lt;br /&gt;
We have a developer responsible for applying patches and guiding new developers into our community. This is a well known and effective process we plan to apply to students, directing them to our EasyCoding pages [1] (these projects are usually a couple of hours long and hve been chosen to provide easy access to the respective area of code).&lt;br /&gt;
&lt;br /&gt;
Usually, patches go back and forth a couple of times, to make sure that all secondary things are in place (indenting, coding style, modified buildfiles etc.) The idea is that coder education should take place before the coder gets commit rights, but that getting new coder in is one of the most important things to keep our project alive.&lt;br /&gt;
&lt;br /&gt;
If the student is proactive and ready to join IRC, all the developers are usually very welcoming, and good at directing newcomers to quickly give useful results.&lt;br /&gt;
&lt;br /&gt;
In 2008, 2009 and 2010 all students that were accepted (and a couple more) managed to have commit access before the start of the coding phase. We consider that this policy was successful and we plan to keep it this year.&lt;br /&gt;
&lt;br /&gt;
We also plan to give a special forum title to any students. This will allow all forum members to tell them apart from normal users and give them read/write access to the developer only forums. This will also allow us to quickly spot any problem they might have interacting with the player community. We have a very mature developer community, but our player community is made of all sort of people of all age and education, and it can sometimes be rough.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[1] http://wiki.wesnoth.org/EasyCoding&lt;br /&gt;
&lt;br /&gt;
==== If you are a small or new organization applying to GSoC, please list a larger, established GSoC organization or a Googler that can vouch for you here. ====&lt;br /&gt;
&lt;br /&gt;
==== If you are a large organization who is vouching for a small organization applying to GSoC for their first time this year, please list their name and why you think they'd be good candidates for GSoC here: ====&lt;br /&gt;
* Darktable:&lt;br /&gt;
Darktable (see http://darktable.sourceforge.net/ and https://sourceforge.net/apps/trac/darktable/wiki/GSOC) is an open source raw development tool.&lt;br /&gt;
&lt;br /&gt;
There are currently no major open source raw development tools. Multiple tools cover the need (ufraw, rawtherapee etc...) but most of them are targeting technical users with interest in photography or signal processing experts rather than &amp;quot;normal&amp;quot; photographer. &lt;br /&gt;
&lt;br /&gt;
Darktable has a very good UI designed around what most photographers expects. It is also a project which is at this interesting stage where there is a solid infrastructure and it needs developer to do the fun part of adding new feature. This is the stage of a project which is the most interesting for developers to join.&lt;br /&gt;
&lt;br /&gt;
The Darktable development community is rather small (3 active developers plus occasional contributors). It could use the extra manpower but is large enough to mentor a student into a core developer pretty fast. &lt;br /&gt;
&lt;br /&gt;
Chances of a student finding it interesting are high, chances of the student bringing major contributions to the project are very high&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Unknown Horizons:&lt;br /&gt;
Unknown Horizons (http://www.unknown-horizons.org/) is a 2D realtime strategy simulation with an emphasis on economy and city building. &lt;br /&gt;
&lt;br /&gt;
This is a smaller open source game project with a really dedicated core team of developers. During our talks with the dev who wants to work as admin it was easy to see that they do think about what they do and got some well working infrastructure. Even though the team is rather small at the moment, they are well suited to handle some students and the project has a proven record of being able to actually release something and continue working on the code. Beside their abilities it is always good to support open source gaming, especially when it comes to rather underrepresented areas like real time strategy games.&lt;br /&gt;
&lt;br /&gt;
==== Anything else you'd like to tell us?  ====&lt;br /&gt;
There is nothing more to say.&lt;br /&gt;
&lt;br /&gt;
==== Backup Admin (Link ID): ====&lt;br /&gt;
noy&lt;br /&gt;
&lt;br /&gt;
==== Admin Agreement: ====&lt;br /&gt;
(some terms of service by Google that have to be agreed upon)&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SoC_Ideas_Whiteboard_2011&amp;diff=40722</id>
		<title>SoC Ideas Whiteboard 2011</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SoC_Ideas_Whiteboard_2011&amp;diff=40722"/>
		<updated>2011-03-09T20:50:09Z</updated>

		<summary type="html">&lt;p&gt;Boucman: /* Whom to ask about this */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:SoC2011Idea}}&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&amp;lt;h2&amp;gt;Improve Wesnoth's Whiteboard&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More info at [[SoC_Ideas_Whiteboard_2011]]&lt;br /&gt;
&lt;br /&gt;
A whiteboard planning UI was implemented last year for GSoC&lt;br /&gt;
&lt;br /&gt;
This years project would be to continue the work by polishing what was done last year and making it network aware so allies can see each other's plan &lt;br /&gt;
&lt;br /&gt;
{{#dpl:&lt;br /&gt;
 |resultsheader=''There are %PAGES% submitted student proposals for this idea''&lt;br /&gt;
 |oneresultheader=''There is 1 submitted student proposal for this idea''&lt;br /&gt;
 |suppresserrors=true&lt;br /&gt;
 |noresultsheader=''There are no submitted student proposals for this idea''&lt;br /&gt;
 |category=Summer of Code 2011 Student Page&amp;amp;SoC Ideas Whiteboard 2011&lt;br /&gt;
 |notcategory=SoC 2011 Not Submitted To Google&lt;br /&gt;
 |include=#Description&lt;br /&gt;
 |mode=userformat&lt;br /&gt;
 |format=,,&amp;lt;br/&amp;gt;See [[%PAGE%|%TITLE%]] for more information.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;,&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Implement the networked part of the Whiteboard =&lt;br /&gt;
&lt;br /&gt;
The [[GSoC-WesnothWhiteboard_Gabba|Whiteboard]] is an interface project that was started during GSoC 2010. It has several goals:&lt;br /&gt;
&lt;br /&gt;
1. Provide players a means to visually test out sequences of actions, especially for those which can't be undone such as attacks, or for moves which uncover shroud and thereby prevent undos.&lt;br /&gt;
&lt;br /&gt;
2. Allow players to plan out recruits, recalls and even attacks and moves, while they are waiting for their turn.&lt;br /&gt;
&lt;br /&gt;
3. Replace features such as waypoints (still present) and Delay Shroud Updates (present in 1.8, disabled but not removed from the code in 1.9). DSU in particular complicates life a lot for WML developers.&lt;br /&gt;
&lt;br /&gt;
''4. Allow allies to see each other's plans in multiplayer (and possibly to suggest moves to each other and to the AI).''&lt;br /&gt;
&lt;br /&gt;
5. Provide advanced interface features building on the work above, such as chance to kill calculations taking into account several attacks on the same unit planned through the whiteboard.&lt;br /&gt;
&lt;br /&gt;
1 and 2 as well as the DSU part of 3 were finished during GSoC 2010, even though they need a lot of tweaking and bugfixing. 4 is the focus of this project.&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
&lt;br /&gt;
The plans for the networked part are [[GSoC-WesnothWhiteboard_Gabba#Engine|laid out in this part of the Whiteboard GSoC 2010 page]].&lt;br /&gt;
Regarding last year's GSoC page, be aware that there are differences between those initial plans and the implementation currently in Wesnoth's code. [[GSoC-WesnothWhiteboard_Gabba#Calendar|This calendar]] will help you understand what was implemented and what was left out.&lt;br /&gt;
&lt;br /&gt;
== Additional Information ==&lt;br /&gt;
&lt;br /&gt;
* The whiteboard interface is not set in stone and might still undergo some important changes; the network part should therefore be decoupled from the UI and visuals as much as possible.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
* The devs who know the whiteboard best are Gabba (wrote most/all of it during GSoC 2010) and Boucman (mentored the GSoC project).&lt;br /&gt;
&lt;br /&gt;
* Gabba will be very sparingly available during april, but should be generally available to answer questions for most of the summer. Plan accordingly.&lt;br /&gt;
&lt;br /&gt;
* A good way of getting aquainted with the code is to fix [https://gna.org/bugs/index.php?group=wesnoth&amp;amp;func=browse&amp;amp;bug_group_id=117 some of the whiteboard bugs].&lt;br /&gt;
&lt;br /&gt;
* Feedback and ongoing discussion of the whiteboard's future goes on [http://forums.wesnoth.org/viewtopic.php?f=15&amp;amp;t=31338 in this thread].&lt;br /&gt;
&lt;br /&gt;
= Whom to ask about this =&lt;br /&gt;
Gabba and Boucman on #wesnoth-dev&lt;br /&gt;
= possible pre-soc tasks =&lt;br /&gt;
* Provide a way for WML to set and remove arrows using the arrow framework used in the whiteboard&lt;br /&gt;
* Provide a way for the AI to set and remove arrows using the framework used by whiteboard&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SoC_Ideas_LuaAI_2011&amp;diff=40719</id>
		<title>SoC Ideas LuaAI 2011</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SoC_Ideas_LuaAI_2011&amp;diff=40719"/>
		<updated>2011-03-09T20:44:36Z</updated>

		<summary type="html">&lt;p&gt;Boucman: /* Possible pre-gsoc tasks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:SoC2011Idea}}&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
&amp;lt;h2&amp;gt;Extend Wesnoth's Lua AI support and improve Wesnoth's AI&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
More info at [[SoC_Ideas_LuaAI_2011]]&lt;br /&gt;
&lt;br /&gt;
It is very important for Wesnoth to have a way of scripting AI without modifying the c++ source code. Some time ago, it was possible to use Python to code AIs, but it was removed due to security issues. Now, we have added Lua as a new way to script AI. The  core capabilities were already added, but we need to integrate Lua AI scripts better.&lt;br /&gt;
&lt;br /&gt;
Wesnoth AI consists of different components. Each component is a c++ object, which provides an interface to allow the ai to delegate part of the turn sequence to that c++ object. But, that c++ object can be a proxy for code written in different language, such as formula_ai or lua. So, we have a lua engine - a c++ class which is responsible with creating c++ proxies for lua code snippets. This lua engine must provide access to all the information that the c++ AI knows - caches like 'attacks' and 'possible moves', values of aspects such as 'aggression' and 'caution', etc. So, there's a large number of AI support functions which we need to expose to lua code.&lt;br /&gt;
&lt;br /&gt;
{{#dpl:&lt;br /&gt;
 |resultsheader=''There are %PAGES% submitted student proposals for this idea''&lt;br /&gt;
 |oneresultheader=''There is 1 submitted student proposal for this idea''&lt;br /&gt;
 |suppresserrors=true&lt;br /&gt;
 |noresultsheader=''There are no submitted student proposals for this idea''&lt;br /&gt;
 |category=Summer of Code 2011 Student Page&amp;amp;SoC Ideas Lua AI&lt;br /&gt;
 |notcategory=SoC 2011 Not Submitted To Google&lt;br /&gt;
 |include=#Description&lt;br /&gt;
 |mode=userformat&lt;br /&gt;
 |format=,,&amp;lt;br/&amp;gt;See [[%PAGE%|%TITLE%]] for more information.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;,&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=Required knowledge=&lt;br /&gt;
The student has to know or learn:&lt;br /&gt;
* Lua C++ api (src/scripting/lua.cpp is the example file)&lt;br /&gt;
* Basic WML (Wesnoth Markup language)&lt;br /&gt;
* Basic Lua &lt;br /&gt;
* Wesnoth game concepts. Gameplay experience is very important to have or gain.&lt;br /&gt;
&lt;br /&gt;
=Implementation plan=&lt;br /&gt;
To quote from Alpha Centauri, &amp;quot;Technological advance is an inherently iterative process. One does not simply take sand from the beach and produce a Dataprobe. We use crude tools to fashion better tools, and then our better tools to fashion more precise tools, and so on. Each minor refinement is a step in the process, and all of the steps must be taken. &amp;quot;.&lt;br /&gt;
* So, we firstly want to expose existing c++ things to lua.&lt;br /&gt;
* Then, we want to build a lua-based 'wesnoth lua ai standard library', a library of functions useful to an ai developer.&lt;br /&gt;
* Then, we want to build a library of high-level functions which will be directly usable by scenario developer, with the level of complexity like 'drop this 1-line macro here, set this unit variable there, and voila - the unit is now controlled by lua ai according to your wishes'&lt;br /&gt;
* example of such behavior are 'patrol', 'retreat', and 'guard' behaviors&lt;br /&gt;
* then, we want to improve the ai directly, areas like recruiting with multiple leaders, actually ''defending'' something, handling concepts like leadership,skirmish, illuminate, and other, even, created-from-WML, concepts&lt;br /&gt;
* then, we want to make sure that multiple ais can coordinate between themselves, and stick to a certain strategy in battle,as determined by situation and whims of scenario creator&lt;br /&gt;
&lt;br /&gt;
== First step: expose existing c++ things to lua ==&lt;br /&gt;
* we need to expose AI aspects to lua&lt;br /&gt;
* we need to expose AI movement maps to lua ( std::multimap&amp;lt;map_location, map_location&amp;gt; , four of them)&lt;br /&gt;
* we need to expose AI target lists to lua (target is a marker on the game map)&lt;br /&gt;
&lt;br /&gt;
when exposing things, we should make sure we provide a accessor which does the converted version and caches the converted version.&lt;br /&gt;
== Second step: wesnoth lua ai standard library ==&lt;br /&gt;
* we need to check and document ways for the AI author to include lua ai code in the scenario. for that, we should provide ways for the code to be injected by scenario, by era, by race, etc.&lt;br /&gt;
* we need to ensure that our .lua library code can be easily loaded by the AI engine. preferably, ensure that each library is only loaded once.&lt;br /&gt;
&lt;br /&gt;
=Useful links=&lt;br /&gt;
&lt;br /&gt;
* [[Customizing_AI_in_Wesnoth_1.8]]&lt;br /&gt;
* [[AI_Module]]&lt;br /&gt;
* [[LuaAI]]&lt;br /&gt;
* [[LuaWML]]&lt;br /&gt;
&lt;br /&gt;
=Definition of Done=&lt;br /&gt;
All information that is possible to use in c++ AI, is possible to use in Lua AI with relatively same level of complexity for AI author.&lt;br /&gt;
&lt;br /&gt;
=Whom to ask about this=&lt;br /&gt;
Ask Crab_ on #wesnoth-dev&lt;br /&gt;
&lt;br /&gt;
=Possible pre-gsoc tasks=&lt;br /&gt;
We want to make it easy to write Lua AI. The best way to ensure that is to try to write some AI components, and see what's easy, what's hard, and what's missing. So, here are a few things that can be done to get you started and to allow to code some useful lua/c++ code which can be included in wesnoth lua ai standard library.&lt;br /&gt;
&lt;br /&gt;
* Write the AI which can complete Scenario 1 of the '''Heir to the Throne''' campaign on easy difficulty.&lt;br /&gt;
* Write the AI which can complete Scenario 1 of '''The Hammer of Thursagan''' campaign on easy difficulty.&lt;br /&gt;
* Write a recruitment procedure for the AI which uses with multiple leaders intelligently&lt;br /&gt;
* Write a system to attach 'behavior instructions written in lua' to specific units&lt;br /&gt;
* Write a patrol formula in Lua&lt;br /&gt;
* Write a basic attack routine which allows to inject a Lua 'rate attack combination' function into it.&lt;br /&gt;
* Write a peacefull mob AI (independant units that flee all other unit and graze peacefully when far enough)&lt;br /&gt;
* Re-implement useful formula ai functions in lua.&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SoC_Ideas_Simple_Content_Manager&amp;diff=40584</id>
		<title>SoC Ideas Simple Content Manager</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SoC_Ideas_Simple_Content_Manager&amp;diff=40584"/>
		<updated>2011-03-07T18:47:59Z</updated>

		<summary type="html">&lt;p&gt;Boucman: Created page with '{{SoC2011Idea}}  = Submitted proposals: =  {{#dpl:  |resultsheader=''There are %PAGES% submitted student proposals for this idea''  |oneresultheader=''There is 1 submitted studen…'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{SoC2011Idea}}&lt;br /&gt;
&lt;br /&gt;
= Submitted proposals: =&lt;br /&gt;
&lt;br /&gt;
{{#dpl:&lt;br /&gt;
 |resultsheader=''There are %PAGES% submitted student proposals for this idea''&lt;br /&gt;
 |oneresultheader=''There is 1 submitted student proposal for this idea''&lt;br /&gt;
 |suppresserrors=true&lt;br /&gt;
 |noresultsheader=''There are no submitted student proposals for this idea''&lt;br /&gt;
 |category=Summer of Code 2011 Student Page&amp;amp;SoC Ideas IDEA NAME&lt;br /&gt;
 |notcategory=SoC 2011 Not Submitted To Google&lt;br /&gt;
 |include=#Description&lt;br /&gt;
 |mode=userformat&lt;br /&gt;
 |format=,,&amp;lt;br/&amp;gt;See [[%PAGE%|%TITLE%]] for more information.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;,&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=Description=&lt;br /&gt;
&amp;lt;h2&amp;gt;Create a simple content manatger frontend for non-technical users&amp;lt;/h2&amp;gt;&lt;br /&gt;
Wesnoth has all sorts of contributors that are not coders&lt;br /&gt;
* translators&lt;br /&gt;
* graphists&lt;br /&gt;
* MP developers&lt;br /&gt;
* musicians&lt;br /&gt;
* etc...&lt;br /&gt;
&lt;br /&gt;
A large part of these users don't know how to use content managers (git, svn, etc...) and are not interested in learning. Wesnoth has been looking for a simple frontend to the most common content managers for those developers but none of these are simple enough for our use case. &lt;br /&gt;
&lt;br /&gt;
This task would be to develop a front end for the most common SCM that would mask completely the underlying tool and would target people that want to contribute to open source, are not technically inclined, and don't want to learn. This tool would implement a minimal subset of SCM features with the philosophy that the user has the support of technicall people to do complicated tasks&lt;br /&gt;
&lt;br /&gt;
the following feature list is here to help understand the use-case for the tool&lt;br /&gt;
&lt;br /&gt;
'''things the tool might do'''&lt;br /&gt;
* update repository wrt distant repository&lt;br /&gt;
* commit to distant repository&lt;br /&gt;
* prepare a bundle to attach to a mail&lt;br /&gt;
* switch branch &lt;br /&gt;
* resolve merge conflicts&lt;br /&gt;
* build a report on the underlying SCM situation to allow debugging by someone else&lt;br /&gt;
* register as a handler to svn:// and git://&lt;br /&gt;
&lt;br /&gt;
'''things the tool shouldn't do''&lt;br /&gt;
* create a new project (if you want to do that, you should learn the real tool)&lt;br /&gt;
* create a new branch (a person with the real tool can do that on the repository for you in the rare case it's needed)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''other misc constraints'''&lt;br /&gt;
* python is the prefered language (all of wesnoth tool are in python) java could be used too (we already have some java code, so maintainability should be ok)&lt;br /&gt;
* it should be SCM agnostic (the point is to lower the barrier to entry for non-technical users)&lt;br /&gt;
* the UI should not be frightening to non-technical people (I.E give some thought to UI design in your proposal)&lt;br /&gt;
* it should integrate as properly as possible into the OS&lt;br /&gt;
* it should work on windows, Mac and linux&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SoC_Information_for_Google&amp;diff=40456</id>
		<title>SoC Information for Google</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SoC_Information_for_Google&amp;diff=40456"/>
		<updated>2011-03-05T19:19:34Z</updated>

		<summary type="html">&lt;p&gt;Boucman: /* If you are a large organization who is vouching for a small organization applying to GSoC for their first time this year, please list their name and why you think they'd be good candidates for GSoC here: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:SoC2010}}&lt;br /&gt;
&lt;br /&gt;
== SoC Information for Google ==&lt;br /&gt;
This is the info that we submit to google as Application in Summer of Code (current status: 2010). The submitter automatically becomes primary Admin. Most entries are mandatory and have to be filled out before the application can be submitted.&lt;br /&gt;
&lt;br /&gt;
==== Organization Name: ====&lt;br /&gt;
Battle for Wesnoth&lt;br /&gt;
&lt;br /&gt;
==== Description: ====&lt;br /&gt;
''Battle for Wesnoth'', or simply ''Wesnoth'', is a free, turn-based strategy game with role-playing elements that was designed in June 2003 by David White (Sirp).&lt;br /&gt;
&lt;br /&gt;
Although the core rules are fairly simple and meant to be easily learned[1], they provide interesting gameplay and rich tactical options. A major strength of the project is the Wesnoth Markup Language (WML) for writing scenarios. Programming skills are not required to compose with it, and a large WML-modding community has generated a great deal of user-maintained content. We polish the best of this content and lift it into our official release tree.&lt;br /&gt;
&lt;br /&gt;
The first stable release (1.0) was on October 2, 2005, and the latest stable release (1.8) is anticipated in the next few weeks. Version 1.8 is intended to be a major stable checkpoint. We expect the following development cycle (1.9, leading to 1.10) to premier significant changes in gameplay, UI, and development tools, with many new concepts being introduced. That makes this year probably one of the best years for a SoC student to join, since the open-ended 1.9 will mean much more space to develop novel ideas&lt;br /&gt;
&lt;br /&gt;
''Wesnoth'' is one of the most successful open-source game projects in existence, with an exceptionally large developer base and user community:&lt;br /&gt;
&lt;br /&gt;
* According to Ohloh, a site that collects activity statistics on open-source projects, the ''Wesnoth'' development effort is in the top 2% of largest and most active projects.&lt;br /&gt;
* We support two multiplayer game servers (stable and development) with a usual minimum load of more than a hundred players&lt;br /&gt;
* More than two thousands downloads a day&lt;br /&gt;
* 3 million downloads via SourceForge; many more via various mirrors of Linux distributions&lt;br /&gt;
* Best rated game at the Linux Game Tome[2]&lt;br /&gt;
* Game of the year 2007, 2008, and 2009 at LinuxQuestions.org[3]&lt;br /&gt;
* In general, ''Wesnoth'' tends to show up in the first or second position whenever anyone compiles a list of top open-source games.&lt;br /&gt;
&lt;br /&gt;
''Wesnoth'''s most notable features include:&lt;br /&gt;
&lt;br /&gt;
* A mature project with continuing active development and frequent improvements&lt;br /&gt;
* High quality artwork: both original graphics and music&lt;br /&gt;
* Well­-balanced by a tireless team of playtesters&lt;br /&gt;
* Fun, unique gameplay&lt;br /&gt;
* Even after six years of development and with a very solid, fun product already created, there are still plenty of new developers; the number of commits to Subversion is still increasing&lt;br /&gt;
* Strong support of internationalization with many supported languages, thus experience in working with non-native English speakers. In fact, more than half of our developers are not native English speakers.&lt;br /&gt;
&lt;br /&gt;
[1] http://www.wesnoth.org/wiki/WesnothPhilosophy&lt;br /&gt;
&lt;br /&gt;
[2] http://www.happypenguin.org/list?sort=avg_rating&lt;br /&gt;
&lt;br /&gt;
[3] http://www.linuxquestions.org/questions/linux-news-59/2009-linuxquestions.org-members-choice-award-winners-788028/&lt;br /&gt;
&lt;br /&gt;
==== Home page: ====&lt;br /&gt;
http://www.wesnoth.org/&lt;br /&gt;
&lt;br /&gt;
==== Main Organization License: ====&lt;br /&gt;
GNU General Public License version 2.0 (GPLv2) [Dropdown box answer!]&lt;br /&gt;
&lt;br /&gt;
==== Why is your organization applying to participate in GSoC 2011? What do you hope to gain by participating? ====&lt;br /&gt;
Most of our developers have particular areas of interest in which they work. Though they are efficient in their areas, there are other, presently uncovered, areas of the code with a need for improvements but a high barrier to entry for casual contributors.&lt;br /&gt;
&lt;br /&gt;
Our previous SoC experience shows that a motivated, full-time, student can be brought up to date in any area fairly quickly.&lt;br /&gt;
&lt;br /&gt;
By bringing new people in and allowing them to be actively responsible for an area of code, we hope to kickstart some areas of the project that are currently lagging behind.&lt;br /&gt;
&lt;br /&gt;
Moreover, our previous experiences has shown us that SoC developers tend to stay after the end of the Summer of Code and become valuable members of our community. This has been a win in all directions and we want it to happen again.&lt;br /&gt;
&lt;br /&gt;
==== If accepted, would this be your first year participating in GSoC? ====&lt;br /&gt;
No&lt;br /&gt;
&lt;br /&gt;
==== Did your organization participate in past GSoCs? If so, please summarize your involvement and the successes and challenges of your participation. ====&lt;br /&gt;
2008 results:&lt;br /&gt;
Wesnoth participated in GSoC 2008 with four students. Out of these, two were great successes (that is they became full-fledge developers before the actual start of GSoC), did huge improvement during GSoC (A new recruitment algorithm for the AI and the basic structure for a new map editor, the student finished this work after the summer), and are still active developers in the Wesnoth community.&lt;br /&gt;
&lt;br /&gt;
Of the two other, one of them was very active for the first half of GSoC and provided some useful infrastructure for AI development that we used as base in GSoC 2009, but was much less active and didn't reach expectations for the second half of GSoC. The lesson we learned is that great students should be left on their own, that's the best way to have them work, but average students should be monitored much more closely than we did. If things seems to start to go wrong, it's important to react very quick, to meet with other mentors and get things back on track early.&lt;br /&gt;
&lt;br /&gt;
Timezone problems were also a serious barrier for student/mentor communication, and we will take that more into account when pairing mentors and students&lt;br /&gt;
&lt;br /&gt;
For our other students, multiple problems collectively led to failure&lt;br /&gt;
* We should enforce IRC communication, E-mail is a barrier. This applies both for students and mentors. Both should be on IRC several hours a day, with overlapping hours.&lt;br /&gt;
* We should be more strict about mid-term evaluation. If the student is slightly lacking at mid-term we should give a clear message that he needs to get back on track.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2009 results:&lt;br /&gt;
In 2009 we mentored 6 students as part of Summer of Code. Out of these 5 projects were a success. From those 5 developers 3 are still part of our core development group and still maintain and improve the work they submitted as part of Summer of Code. One of the students even became the &amp;quot;head&amp;quot; of our AI development department and wants to mentor a student this year. For a summary of the 2009 results have a look at [1].&lt;br /&gt;
&lt;br /&gt;
Sadly one student was not able to continue his work past midterm due to his computer failing completely as well as personal problems that we won't delve into further here. It was not a salvageable situation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[1] http://forums.wesnoth.org/viewtopic.php?f=5&amp;amp;t=26955&lt;br /&gt;
&lt;br /&gt;
==== If your organization participated in past GSoCs, please let us know the ratio of students passing to students allocated, e.g. 2006: 3/6 for 3 out of 6 students passed in 2006. ====&lt;br /&gt;
2008: 2/4&lt;br /&gt;
2009: 5/6&lt;br /&gt;
2010: 4/4&lt;br /&gt;
&lt;br /&gt;
==== What is the URL for your ideas page? ====&lt;br /&gt;
http://wiki.wesnoth.org/SummerOfCodeIdeas&lt;br /&gt;
&lt;br /&gt;
==== What is the main development mailing list for your organization? This question will be shown to students who would like to get more information about applying to your organization for GSoC 2011. If your organization uses more than one list, please make sure to include a description of the list so students know which to use. ====&lt;br /&gt;
The main development mailing list is &amp;quot;wesnoth-dev@gna.org&amp;quot;. Our main means of communications is our IRC channel on freenode. If you have questions you should ask them in #wesnoth-dev on irc.freenode.net and wait for a reply (might take some hours!). The Wesnoth related channels are logged in public and the logs tend to be read by developers.&lt;br /&gt;
&lt;br /&gt;
==== What is the main IRC channel for your organization? ====&lt;br /&gt;
#wesnoth-dev on irc.freenode.net&lt;br /&gt;
&lt;br /&gt;
==== Does your organization have an application template you would like to see students use? If so, please provide it now. Please note that it is a very good idea to ask students to provide you with their contact information as part of your template. Their contact details will not be shared with you automatically via the GSoC 2011 site. ====&lt;br /&gt;
We plan mainly to meet potential students through our IRC channel, but the following questions are Wesnoth specific and are worth pondering for any student, even if we don't need a formal answer. So please beside just answering these questions consider visiting us in IRC: #wesnoth-dev on irc.freenode.net. This is where most of our work takes place and participating in IRC is mandatory for GSoC students participating with Wesnoth. Our experience is that this is the easiest way to communicate and solve problems that come up.&lt;br /&gt;
&lt;br /&gt;
1) Basics&lt;br /&gt;
&lt;br /&gt;
1.1) Write a small introduction to yourself.&lt;br /&gt;
&lt;br /&gt;
1.2) State your preferred email address.&lt;br /&gt;
&lt;br /&gt;
1.3) If you have chosen a nick for IRC and Wesnoth forums, what is it?&lt;br /&gt;
&lt;br /&gt;
1.4) Why do you want to participate in summer of code?&lt;br /&gt;
&lt;br /&gt;
1.5) What are you studying, subject, level and school? &lt;br /&gt;
&lt;br /&gt;
1.6) What country are you from, at what time are you most likely to be able to join IRC?&lt;br /&gt;
&lt;br /&gt;
1.7) Do you have other commitments for the summer period ? Do you plan to take any vacations ? If yes, when.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) Experience&lt;br /&gt;
&lt;br /&gt;
2.1) What programs/software have you worked on before?&lt;br /&gt;
&lt;br /&gt;
2.2) Have you developed software in a team environment before? (As opposed to hacking on something on your own)&lt;br /&gt;
&lt;br /&gt;
2.3) Have you participated to the Google Summer of Code before? As a mentor or a student? In what project? Were you successful? If not, why?&lt;br /&gt;
&lt;br /&gt;
2.4) Are you already involved with any open source development projects? If yes, please describe the project and the scope of your involvement.&lt;br /&gt;
&lt;br /&gt;
2.5) Gaming experience - Are you a gamer?&lt;br /&gt;
&lt;br /&gt;
2.5.1) What type of gamer are you?&lt;br /&gt;
&lt;br /&gt;
2.5.2) What type of games? &lt;br /&gt;
&lt;br /&gt;
2.5.3) What type of opponents do you prefer? &lt;br /&gt;
&lt;br /&gt;
2.5.4) Are you more interested in story or gameplay?&lt;br /&gt;
&lt;br /&gt;
2.5.5) Have you played Wesnoth? If so, tell us roughly for how long and whether you lean towards single player or multiplayer.&lt;br /&gt;
&lt;br /&gt;
We do not plan to favor Wesnoth players as such, but some particular projects require a good feeling for the game which is hard to get without having played intensively.&lt;br /&gt;
&lt;br /&gt;
2.6) If you have contributed any patches to Wesnoth, please list them below. You can also list patches that have been submitted but not committed yet and patches that have not been specifically written for GSoC. If you have gained commit access to our SVN (during the evaluation period or earlier) please state so.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Communication skills&lt;br /&gt;
&lt;br /&gt;
3.1) Though most of our developers are not native English speakers, English is the project's working language.  Describe your fluency level in written English.&lt;br /&gt;
&lt;br /&gt;
3.2) What spoken languages are you fluent in?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3.3) Are you good at interacting with other players? Our developer community is friendly, but the player community can be a bit rough.&lt;br /&gt;
&lt;br /&gt;
3.4) Do you give constructive advice? &lt;br /&gt;
&lt;br /&gt;
3.5) Do you receive advice well? &lt;br /&gt;
&lt;br /&gt;
3.6) Are you good at sorting useful criticisms from useless ones?&lt;br /&gt;
&lt;br /&gt;
3.7) How autonomous are you when developing ? Would you rather discuss intensively changes and not start coding until you know what you want to do or would you rather code a proof of concept to &amp;quot;see how it turn out&amp;quot;, taking the risk of having it thrown away if it doesn't match what the project want&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4) Project&lt;br /&gt;
&lt;br /&gt;
4.1) Did you select a project from our list? If that is the case, what project did you select? What do you want to especially concentrate on?&lt;br /&gt;
&lt;br /&gt;
4.2) If you have invented your own project, please describe the project and the scope.&lt;br /&gt;
&lt;br /&gt;
4.3) Why did you choose this project?&lt;br /&gt;
&lt;br /&gt;
4.4) Include an estimated timeline for your work on the project. Don't forget to mention special things like &amp;quot;I booked holidays between A and B&amp;quot; and &amp;quot;I got an exam at ABC and won't be doing much then&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
4.5) Include as much technical detail about your implementation as you can&lt;br /&gt;
&lt;br /&gt;
4.6) What do you expect to gain from this project?&lt;br /&gt;
&lt;br /&gt;
4.7) What would make you stay in the Wesnoth community after the conclusion of SOC? &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5) Practical considerations&lt;br /&gt;
&lt;br /&gt;
5.1) Are you familiar with any of the following tools or languages?&lt;br /&gt;
* Subversion (used for all commits)&lt;br /&gt;
* C++ (language used for all the normal source code)&lt;br /&gt;
* STL, Boost, Sdl (C++ libraries used by Wesnoth)&lt;br /&gt;
* Python (optional, mainly used for tools)&lt;br /&gt;
* build environments (eg cmake/autotools/scons)&lt;br /&gt;
* WML (the wesnoth specific scenario language)&lt;br /&gt;
* Lua (used in combination with WML to create scenarios)&lt;br /&gt;
&lt;br /&gt;
5.2) Which tools do you normally use for development? Why do you use them?&lt;br /&gt;
&lt;br /&gt;
5.3) What programming languages are you fluent in?&lt;br /&gt;
&lt;br /&gt;
5.4) Would you mind talking with your mentor on telephone / internet phone? We would like to have a backup way for communications for the case that somehow emails and IRC do fail. If you are willing to do so, please do list a phone number (including international code) so that we are able to contact you. You should probably *only* add this number in the application for you submit to google since the info in the wiki is available in public. We will *not* make any use of your number unless some case of &amp;quot;there is no way to contact you&amp;quot; does arise!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In general please try to be as verbose as possible in your answers and feel free to elaborate.&lt;br /&gt;
&lt;br /&gt;
==== What criteria did you use to select the individuals who will act as mentors for your organization? Please be as specific as possible. ====&lt;br /&gt;
Our first criterion was that all the people had to be volunteers. According to other open source projects and our experience from the last two years, being a SoC mentor takes a lot of time and the person has to be ready to spend quite some time with the student.&lt;br /&gt;
&lt;br /&gt;
Boucman is one of the oldest active developers around. He has rewritten the whole animation engine and made it an easily pluggable system allowing artists to easily specify exactly how they want the units to appear. He also started many community oriented projects like the Art Contribution[1] section of the wiki (now deprecated) and the WML Reference Manual[2]. He is responsible for dispatching and sorting the patches at http://patches.wesnoth.org that has created the new developer process we currently use. Boucman was a mentor in 2008 and 2009.&lt;br /&gt;
&lt;br /&gt;
Yurii Chernyi (Crab) has joined the team in 2009, taking part in Google Summer of Code 2009, and staying with the project as a developer after successful completion of GSoC. He's an expert on all aspects of current Wesnoth AI codebase (having fully reorganized it as part of GSoC 2009), and has fixed numerous bugs all over Wesnoth. He is experienced in teaching other people, in areas like programming languages and math.&lt;br /&gt;
&lt;br /&gt;
Mordante is one of the most active developers on our IRC channel. Not only has he done preliminary studies and coding in multiple areas that are candidates for Summer of Code ideas, he also is one of the coders with the best overview of the Wesnoth code. A large part of his work involves refactoring and polishing existing code. Next to that he's very active with fixing bugs which leads him to all areas in the code base. He is currently completing a rewrite of the Wesnoth GUI library, making all windows configurable through WML. This should make it easier to use Wesnoth on different resolutions, from small handheld devices to large 30 inch screens. Mordante was a mentor in 2008 and 2009.&lt;br /&gt;
&lt;br /&gt;
All other developers listed in the ideas page are the leading capacities we do have for the respecting areas. Have a look at our list of &amp;quot;people who to contact&amp;quot; [3] for an easy reference. In general all our developers will mentor all students. That is, questions should just be asked in our IRC channel, where basically every developer who has an idea can and will directly answer.&lt;br /&gt;
&lt;br /&gt;
When choosing the mentors, we have kept in mind that most developers can answer most technical questions, and we have chosen people that are well known for interacting with new-comers/external developers and can provide general guidance and design advice, more than people with specific technical knowledge.&lt;br /&gt;
&lt;br /&gt;
[1] http://wiki.wesnoth.org/UnsortedContrib&lt;br /&gt;
&lt;br /&gt;
[2] http://wiki.wesnoth.org/ReferenceWML&lt;br /&gt;
&lt;br /&gt;
[3] http://wiki.wesnoth.org/SoC_People_to_bug_on_IRC&lt;br /&gt;
&lt;br /&gt;
==== What is your plan for dealing with disappearing students? ====&lt;br /&gt;
The first thing to do is to avoid this situation altogether. &lt;br /&gt;
&lt;br /&gt;
Wesnoth is a game, and as such has lots of developers that are not coders. In particular, artists are well known in the Wesnoth community for being very sensitive about criticism and our community is used to people being sensitive to critics. &lt;br /&gt;
&lt;br /&gt;
We will try to choose students that accept criticism and are able to filter constructive criticism from useless one. The Wesnoth developer community is used to judging people according to these criteria and the special title we are going to give to applicants will allow us to easily spot any such problems and discuss them before they grow out of control.&lt;br /&gt;
&lt;br /&gt;
If a student disappears, their mentor will be in charge of recontacting the student to see what is going wrong (available time, tension with other developers, with members of the community etc...). Depending on the actual problem, the mentor and the student will have to agree on possible ways to defuse the problem.&lt;br /&gt;
&lt;br /&gt;
If a student disappears completely and there is no way to get back to them, there is little the project can do except salvaging whatever can be salvaged from the code (the students will have SVN write access, so most of the work will be committed either to trunk or to a specific branch) and find a core developer to take on the job. This will probably be slower and less effective for the project, but it's the best we can do.&lt;br /&gt;
&lt;br /&gt;
==== What is your plan for dealing with disappearing mentors? ====&lt;br /&gt;
All our mentors are long time developers that volunteered for the job, so we don't expect that to happen. We observed in 2008 the amount of time required to mentor, and our mentors accepted the job knowing the amount of work it involved. Most of them were mentors last year too.&lt;br /&gt;
&lt;br /&gt;
However, should it happen, we would continue to mentor as a developer community the student until we find a new &amp;quot;official&amp;quot; mentor to take on the job.&lt;br /&gt;
&lt;br /&gt;
==== What steps will you take to encourage students to interact with your project's community before, during and after the program? ====&lt;br /&gt;
Wesnoth has a particularly healthy community, both for developers and for players. &lt;br /&gt;
&lt;br /&gt;
Our general policy regarding new coders has always been &amp;quot;two (non trival) patches... you're in&amp;quot;. With other words, anybody that is able to get two non-trivial patches applied is offered commit privileges.&lt;br /&gt;
We have a developer responsible for applying patches and guiding new developers into our community. This is a well known and effective process we plan to apply to students, directing them to our EasyCoding pages [1] (these projects are usually a couple of hours long and hve been chosen to provide easy access to the respective area of code).&lt;br /&gt;
&lt;br /&gt;
Usually, patches go back and forth a couple of times, to make sure that all secondary things are in place (indenting, coding style, modified buildfiles etc.) The idea is that coder education should take place before the coder gets commit rights, but that getting new coder in is one of the most important things to keep our project alive.&lt;br /&gt;
&lt;br /&gt;
If the student is proactive and ready to join IRC, all the developers are usually very welcoming, and good at directing newcomers to quickly give useful results.&lt;br /&gt;
&lt;br /&gt;
In 2008 and 2009 all students that were accepted (and a couple more) managed to have commit access before the start of the coding phase. We consider that this policy was successful and we plan to keep it this year.&lt;br /&gt;
&lt;br /&gt;
We also plan to give a special forum title to any students. This will allow all forum members to tell them apart from normal users and give them read/write access to the developer only forums. This will also allow us to quickly spot any problem they might have interacting with the player community. We have a very mature developer community, but our player community is made of all sort of people of all age and education, and it can sometimes be rough.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[1] http://wiki.wesnoth.org/EasyCoding&lt;br /&gt;
&lt;br /&gt;
==== If you are a small or new organization applying to GSoC, please list a larger, established GSoC organization or a Googler that can vouch for you here. ====&lt;br /&gt;
&lt;br /&gt;
==== If you are a large organization who is vouching for a small organization applying to GSoC for their first time this year, please list their name and why you think they'd be good candidates for GSoC here: ====&lt;br /&gt;
&lt;br /&gt;
Darktable (see http://darktable.sourceforge.net/ and https://sourceforge.net/apps/trac/darktable/wiki/GSOC) is an open source raw developement tool.&lt;br /&gt;
&lt;br /&gt;
There are currently no major open source raw developement tools. Multiple tools cover the need (ufraw, rawtherapee etc...) but most of them are targetting technical users with interest in photography or signal processing experts rather than &amp;quot;normal&amp;quot; photographer. &lt;br /&gt;
&lt;br /&gt;
Darktable has a very good UI designed around what most photographers expects. It is also a project which is at this interesting stage where there is a solid infrastructure and it needs developer to do the fun part of adding new feature. This is the stage of a project which is the most interesting for developers to join.&lt;br /&gt;
&lt;br /&gt;
The Darktable developement community is rather small (3 active developers plus occasional contributors). It could use the extra manpower but is large enought to mentor a student into a core developer pretty fast. &lt;br /&gt;
&lt;br /&gt;
Chances of a student finding it interesting are high, chances of the student bringing major contributions to the project are very high&lt;br /&gt;
&lt;br /&gt;
==== Anything else you'd like to tell us?  ====&lt;br /&gt;
There is nothing more to say.&lt;br /&gt;
&lt;br /&gt;
==== Backup Admin (Link ID): ====&lt;br /&gt;
noy&lt;br /&gt;
&lt;br /&gt;
==== Admin Agreement: ====&lt;br /&gt;
(some terms of service by Google that have to be agreed upon)&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=SoC_Ideas_Whiteboard_2011&amp;diff=40407</id>
		<title>SoC Ideas Whiteboard 2011</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=SoC_Ideas_Whiteboard_2011&amp;diff=40407"/>
		<updated>2011-02-27T11:48:10Z</updated>

		<summary type="html">&lt;p&gt;Boucman: /* Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:SoC2011Idea}}&lt;br /&gt;
= Submitted proposals: =&lt;br /&gt;
&lt;br /&gt;
{{#dpl:&lt;br /&gt;
 |resultsheader=''There are %PAGES% submitted student proposals for this idea''&lt;br /&gt;
 |oneresultheader=''There is 1 submitted student proposal for this idea''&lt;br /&gt;
 |suppresserrors=true&lt;br /&gt;
 |noresultsheader=''There are no submitted student proposals for this idea''&lt;br /&gt;
 |category=Summer of Code 2011 Student Page&amp;amp;SoC Ideas Whiteboard 2011&lt;br /&gt;
 |notcategory=SoC 2011 Not Submitted To Google&lt;br /&gt;
 |include=#Description&lt;br /&gt;
 |mode=userformat&lt;br /&gt;
 |format=,,&amp;lt;br/&amp;gt;See [[%PAGE%|%TITLE%]] for more information.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;,&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&amp;lt;h2&amp;gt;Whiteboard&amp;lt;/h2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A whiteboard planning UI was implemented last year for GSoC&lt;br /&gt;
&lt;br /&gt;
This years project would be to continue the work by polishing what was done last year and making it network aware so allies can see each other's plan &lt;br /&gt;
&lt;br /&gt;
Page for the idea: [[SoC_Ideas_Whiteboard_2011]]&lt;br /&gt;
&lt;br /&gt;
= Implement the networked part of the Whiteboard =&lt;br /&gt;
&lt;br /&gt;
The [[GSoC-WesnothWhiteboard_Gabba|Whiteboard]] is an interface project that was started during GSoC 2010. It has several goals:&lt;br /&gt;
&lt;br /&gt;
1. Provide players a means to visually test out sequences of actions, especially for those which can't be undone such as attacks, or for moves which uncover shroud and thereby prevent undos.&lt;br /&gt;
&lt;br /&gt;
2. Allow players to plan out recruits, recalls and even attacks and moves, while they are waiting for their turn.&lt;br /&gt;
&lt;br /&gt;
3. Replace features such as waypoints (still present) and Delay Shroud Updates (present in 1.8, disabled but not removed from the code in 1.9). DSU in particular complicates life a lot for WML developers.&lt;br /&gt;
&lt;br /&gt;
''4. Allow allies to see each other's plans in multiplayer (and possibly to suggest moves to each other and to the AI).''&lt;br /&gt;
&lt;br /&gt;
5. Provide advanced interface features building on the work above, such as chance to kill calculations taking into account several attacks on the same unit planned through the whiteboard.&lt;br /&gt;
&lt;br /&gt;
1 and 2 as well as the DSU part of 3 were finished during GSoC 2010, even though they need a lot of tweaking and bugfixing. 4 is the focus of this project.&lt;br /&gt;
&lt;br /&gt;
== Specifications ==&lt;br /&gt;
&lt;br /&gt;
The plans for the networked part are [[GSoC-WesnothWhiteboard_Gabba#Engine|laid out in this part of the Whiteboard GSoC 2010 page]].&lt;br /&gt;
Regarding last year's GSoC page, be aware that there are differences between those initial plans and the implementation currently in Wesnoth's code. [[GSoC-WesnothWhiteboard_Gabba#Calendar|This calendar]] will help you understand what was implemented and what was left out.&lt;br /&gt;
&lt;br /&gt;
== Additional Information ==&lt;br /&gt;
&lt;br /&gt;
* The whiteboard interface is not set in stone and might still undergo some important changes; the network part should therefore be decoupled from the UI and visuals as much as possible.&lt;br /&gt;
&lt;br /&gt;
== Resources ==&lt;br /&gt;
&lt;br /&gt;
* The devs who know the whiteboard best are Gabba (wrote most/all of it during GSoC 2010) and Boucman (mentored the GSoC project).&lt;br /&gt;
&lt;br /&gt;
* Gabba will be very sparingly available during april, but should be generally available to answer questions for most of the summer. Plan accordingly.&lt;br /&gt;
&lt;br /&gt;
* A good way of getting aquainted with the code is to fix [https://gna.org/bugs/index.php?group=wesnoth&amp;amp;func=browse&amp;amp;bug_group_id=117 some of the whiteboard bugs].&lt;br /&gt;
&lt;br /&gt;
* Feedback and ongoing discussion of the whiteboard's future goes on [http://forums.wesnoth.org/viewtopic.php?f=15&amp;amp;t=31338 in this thread].&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=Fosdem2011&amp;diff=39717</id>
		<title>Fosdem2011</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=Fosdem2011&amp;diff=39717"/>
		<updated>2010-12-18T10:33:32Z</updated>

		<summary type="html">&lt;p&gt;Boucman: /* Schedule/Plans */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== General information ==&lt;br /&gt;
This page is meant to somehow coordinate the small Wesconf taking place at FOSDEM 2011. That is everyone attending should please list him/herself in the list of arrivals and stuff like this. FOSDEM 2011 will take place at the first weekend in Febuary 2011, on Saturday 5th and Sunday 6th.&lt;br /&gt;
&lt;br /&gt;
* Fosdem - http://fosdem.org/2011/&lt;br /&gt;
&lt;br /&gt;
== Schedule/Plans ==&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! (nick)name(s)&lt;br /&gt;
! Arrival&lt;br /&gt;
! Departure&lt;br /&gt;
! Accomodation&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| Ivanovic&lt;br /&gt;
| Fri, 4th&lt;br /&gt;
| Sun, 6th&lt;br /&gt;
| 2go4, not booked yet&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| Boucman&lt;br /&gt;
| Fri, 4th&lt;br /&gt;
| Sun, 6th&lt;br /&gt;
| 2go4, not booked yet&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For accomodations please keep in mind that parking in the center of Brussels is really problematic. It might make sense to drive to the University where FOSDEM takes place, park there and take the bus into the town center (where some of the hotels/hostels are).&lt;br /&gt;
&lt;br /&gt;
Possible hostels that we at least contacted over the last years (some of them might already be booked out by now!):&lt;br /&gt;
* [http://www.chab.be/ CHAB]&lt;br /&gt;
* [http://www.2go4.be/ 2go4] Note: groups bigger 6 are not allowed, so we can (officially) not form a complete Wesnoth group at this hostel, got to meet somewhere in town/at the university...&lt;br /&gt;
* [http://www.jeugdherbergen.be/brusselE.htm Bruegel YH]&lt;br /&gt;
&lt;br /&gt;
On the official FOSDEM page [http://www.fosdem.org/2011/practical/accommodation some more possible hotels/hostels] are listed.&lt;br /&gt;
&lt;br /&gt;
== Maps ==&lt;br /&gt;
* [http://tinyurl.com/3a65gr Bruegel YH]&lt;br /&gt;
* [http://tinyurl.com/35br9c Brussels Central (Train Station) → Bruegel YH]&lt;br /&gt;
* [http://tinyurl.com/37d9v4 Bruegel YH → Brussels Central (Train Station) → Novotel Grand Place]&lt;br /&gt;
* [http://tinyurl.com/2mzns6 Novotel Grand Place]&lt;br /&gt;
* [http://tinyurl.com/3dggg3 CrownePlaza (Europa)]&lt;br /&gt;
* [http://tinyurl.com/36epxj FOSDEM]&lt;br /&gt;
* [http://tinyurl.com/2w4bms Novotel Grand Place -&amp;gt; FOSDEM]&lt;br /&gt;
&lt;br /&gt;
== Transportation ==&lt;br /&gt;
Information about how to reach the FOSDEM is listed at the [http://www.fosdem.org/2011/transportation official transportation subpage].&lt;br /&gt;
&lt;br /&gt;
Short version of how to get there for those that reside in Bruegel YH and Novotel Grand Place (basically town center):&lt;br /&gt;
&lt;br /&gt;
* Enter Bus 71 (Debrouckere - Central Station (&amp;quot;Gare Centrale&amp;quot;) - Delta) somewhere at 'Central Station'&lt;br /&gt;
* Leave the bus at &amp;quot;ULB&amp;quot; (crossroads Ave. Adolphe Buyl - Sq. Deveze)&lt;br /&gt;
* Walk down Ave. Paul Heger on your right hand.&lt;br /&gt;
&lt;br /&gt;
== Wesnoth Hacking Room ==&lt;br /&gt;
&lt;br /&gt;
Wesnoth will not have a room of its own. Instead we will use one of the &amp;quot;general hacking rooms&amp;quot;. So far it is not sure which room it will be, if we do it like the last three years, it will be room number 115 in the building AW1. Last year this was the smaller of the two hacking rooms and we had no real problem with conquering (and holding) the first row in this room. There were not too many power outlets, so this year at least Ivanovic will bring one multi-outlet power strip plus some extension cable (5m or something like this). There is no wired network, everything wireless (and sometimes rather/very unstable!). Beside this you should bring laptops since there are no computers available for hacking.&lt;br /&gt;
&lt;br /&gt;
Short version:&lt;br /&gt;
 AW1 - Room 115&lt;br /&gt;
&lt;br /&gt;
== Planned discussion ==&lt;br /&gt;
We usually discuss all sorts of things at FOSDEM, this section is here to have a small bullet list of things that we actively want to discuss at FOSDEM.&lt;br /&gt;
* GSOC 2011: finding mentors, organizing the submission etc..&lt;br /&gt;
* GCI 2010/2011: was it good, should we try to do it again next year ?&lt;br /&gt;
* FOSDEM 2012 : trying to get a dev room with other games ?&lt;br /&gt;
* [wanted: discussion topics!]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Group Picture ==&lt;br /&gt;
&lt;br /&gt;
to be linked here after FOSDEM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== FOSDEM 2010 ==&lt;br /&gt;
We were already at FOSDEM 2010, here something as reference:&lt;br /&gt;
&lt;br /&gt;
* [http://www.wesnoth.org/wiki/Fosdem2010 FOSDEM 2010 wiki page]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== FOSDEM 2009 ==&lt;br /&gt;
We were already at FOSDEM 2009, here something as reference:&lt;br /&gt;
&lt;br /&gt;
* [http://www.wesnoth.org/wiki/Fosdem2009 FOSDEM 2009 wiki page]&lt;br /&gt;
&lt;br /&gt;
== FOSDEM 2008 ==&lt;br /&gt;
We were already at FOSDEM 2008, here something as reference:&lt;br /&gt;
&lt;br /&gt;
* [http://www.wesnoth.org/forum/viewtopic.php?p=283649#p283649 Forum topic (with group photo)]&lt;br /&gt;
* [http://www.wesnoth.org/wiki/Fosdem2008 2008 wiki page]&lt;br /&gt;
* [https://mail.gna.org/public/wesnoth-dev/2008-02/msg00078.html Summary of FOSDEM 2008 results]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Wesconf]]&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=Fosdem2011&amp;diff=39715</id>
		<title>Fosdem2011</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=Fosdem2011&amp;diff=39715"/>
		<updated>2010-12-18T10:29:31Z</updated>

		<summary type="html">&lt;p&gt;Boucman: Created page with '== General information == This page is meant to somehow coordinate the small Wesconf taking place at FOSDEM 2011. That is everyone attending should please list him/herself in the…'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== General information ==&lt;br /&gt;
This page is meant to somehow coordinate the small Wesconf taking place at FOSDEM 2011. That is everyone attending should please list him/herself in the list of arrivals and stuff like this. FOSDEM 2011 will take place at the first weekend in Febuary 2011, on Saturday 5th and Sunday 6th.&lt;br /&gt;
&lt;br /&gt;
* Fosdem - http://fosdem.org/2011/&lt;br /&gt;
&lt;br /&gt;
== Schedule/Plans ==&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; width=&amp;quot;100%&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! (nick)name(s)&lt;br /&gt;
! Arrival&lt;br /&gt;
! Departure&lt;br /&gt;
! Accomodation&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For accomodations please keep in mind that parking in the center of Brussels is really problematic. It might make sense to drive to the University where FOSDEM takes place, park there and take the bus into the town center (where some of the hotels/hostels are).&lt;br /&gt;
&lt;br /&gt;
Possible hostels that we at least contacted over the last years (some of them might already be booked out by now!):&lt;br /&gt;
* [http://www.chab.be/ CHAB]&lt;br /&gt;
* [http://www.2go4.be/ 2go4] Note: groups bigger 6 are not allowed, so we can (officially) not form a complete Wesnoth group at this hostel, got to meet somewhere in town/at the university...&lt;br /&gt;
* [http://www.jeugdherbergen.be/brusselE.htm Bruegel YH]&lt;br /&gt;
&lt;br /&gt;
On the official FOSDEM page [http://www.fosdem.org/2011/practical/accommodation some more possible hotels/hostels] are listed.&lt;br /&gt;
&lt;br /&gt;
== Maps ==&lt;br /&gt;
* [http://tinyurl.com/3a65gr Bruegel YH]&lt;br /&gt;
* [http://tinyurl.com/35br9c Brussels Central (Train Station) → Bruegel YH]&lt;br /&gt;
* [http://tinyurl.com/37d9v4 Bruegel YH → Brussels Central (Train Station) → Novotel Grand Place]&lt;br /&gt;
* [http://tinyurl.com/2mzns6 Novotel Grand Place]&lt;br /&gt;
* [http://tinyurl.com/3dggg3 CrownePlaza (Europa)]&lt;br /&gt;
* [http://tinyurl.com/36epxj FOSDEM]&lt;br /&gt;
* [http://tinyurl.com/2w4bms Novotel Grand Place -&amp;gt; FOSDEM]&lt;br /&gt;
&lt;br /&gt;
== Transportation ==&lt;br /&gt;
Information about how to reach the FOSDEM is listed at the [http://www.fosdem.org/2011/transportation official transportation subpage].&lt;br /&gt;
&lt;br /&gt;
Short version of how to get there for those that reside in Bruegel YH and Novotel Grand Place (basically town center):&lt;br /&gt;
&lt;br /&gt;
* Enter Bus 71 (Debrouckere - Central Station (&amp;quot;Gare Centrale&amp;quot;) - Delta) somewhere at 'Central Station'&lt;br /&gt;
* Leave the bus at &amp;quot;ULB&amp;quot; (crossroads Ave. Adolphe Buyl - Sq. Deveze)&lt;br /&gt;
* Walk down Ave. Paul Heger on your right hand.&lt;br /&gt;
&lt;br /&gt;
== Wesnoth Hacking Room ==&lt;br /&gt;
&lt;br /&gt;
Wesnoth will not have a room of its own. Instead we will use one of the &amp;quot;general hacking rooms&amp;quot;. So far it is not sure which room it will be, if we do it like the last three years, it will be room number 115 in the building AW1. Last year this was the smaller of the two hacking rooms and we had no real problem with conquering (and holding) the first row in this room. There were not too many power outlets, so this year at least Ivanovic will bring one multi-outlet power strip plus some extension cable (5m or something like this). There is no wired network, everything wireless (and sometimes rather/very unstable!). Beside this you should bring laptops since there are no computers available for hacking.&lt;br /&gt;
&lt;br /&gt;
Short version:&lt;br /&gt;
 AW1 - Room 115&lt;br /&gt;
&lt;br /&gt;
== Planned discussion ==&lt;br /&gt;
We usually discuss all sorts of things at FOSDEM, this section is here to have a small bullet list of things that we actively want to discuss at FOSDEM.&lt;br /&gt;
* GSOC 2011: finding mentors, organizing the submission etc..&lt;br /&gt;
* GCI 2010/2011: was it good, should we try to do it again next year ?&lt;br /&gt;
* FOSDEM 2012 : trying to get a dev room with other games ?&lt;br /&gt;
* [wanted: discussion topics!]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Group Picture ==&lt;br /&gt;
&lt;br /&gt;
to be linked here after FOSDEM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== FOSDEM 2010 ==&lt;br /&gt;
We were already at FOSDEM 2010, here something as reference:&lt;br /&gt;
&lt;br /&gt;
* [http://www.wesnoth.org/wiki/Fosdem2010 FOSDEM 2010 wiki page]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== FOSDEM 2009 ==&lt;br /&gt;
We were already at FOSDEM 2009, here something as reference:&lt;br /&gt;
&lt;br /&gt;
* [http://www.wesnoth.org/wiki/Fosdem2009 FOSDEM 2009 wiki page]&lt;br /&gt;
&lt;br /&gt;
== FOSDEM 2008 ==&lt;br /&gt;
We were already at FOSDEM 2008, here something as reference:&lt;br /&gt;
&lt;br /&gt;
* [http://www.wesnoth.org/forum/viewtopic.php?p=283649#p283649 Forum topic (with group photo)]&lt;br /&gt;
* [http://www.wesnoth.org/wiki/Fosdem2008 2008 wiki page]&lt;br /&gt;
* [https://mail.gna.org/public/wesnoth-dev/2008-02/msg00078.html Summary of FOSDEM 2008 results]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Wesconf]]&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=InterfaceActionsWML&amp;diff=39168</id>
		<title>InterfaceActionsWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=InterfaceActionsWML&amp;diff=39168"/>
		<updated>2010-11-29T22:59:26Z</updated>

		<summary type="html">&lt;p&gt;Boucman: /* Other interface tags */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WML Tags}}&lt;br /&gt;
== Interface actions ==&lt;br /&gt;
&lt;br /&gt;
Interface actions are actions that do not have an effect on gameplay;&lt;br /&gt;
instead, they show something to the player.  The main interface tags&lt;br /&gt;
are '''[message]''' and '''[objectives]''', but several other tags affect&lt;br /&gt;
the interface also.&lt;br /&gt;
&lt;br /&gt;
== [inspect] ==&lt;br /&gt;
This user interface action only works in debug mode. It displays the gamestate inspector dialog (the same one which can be brought up with '':inspect'' ), which can be used to inspect the values of WML variables, AI configuration, recall lists, and more.&lt;br /&gt;
&lt;br /&gt;
* '''name''': optional attribute to specify the name of this gamestate inspector dialog. It is just a label to help differentiate between different invocations of gamestate inspector dialog.&lt;br /&gt;
&lt;br /&gt;
== [message] ==&lt;br /&gt;
The most commonly used interface action is [message], which displays a message to the user in a dialog box. It can also be used to take input from the user.&lt;br /&gt;
&lt;br /&gt;
The following key/tags are accepted for [message]:&lt;br /&gt;
* [[StandardUnitFilter]]: The unit whose profile and name are displayed. Do not use a [filter] tag. If no unit matching this filter is found, the message is not displayed (The unit has probably been killed).&amp;lt;br&amp;gt;'''[message]''' elements should be constructed so that it is either guaranteed that a certain unit is alive, or so that dialog flows smoothly even if the message isn't displayed.&lt;br /&gt;
&lt;br /&gt;
* '''speaker''': an alternative to standard unit filter. You may specify as the value of the speaker attribute a unit id or any of the following special values:&lt;br /&gt;
** '''narrator''': the dialog box is displayed without a caption for the unit speaking or a unit image&lt;br /&gt;
** '''unit''': the primary unit for the event is speaking&lt;br /&gt;
** '''second_unit''': the secondary unit for the event is speaking&lt;br /&gt;
&lt;br /&gt;
* '''message''': (translatable) the text to display to the right of the image. ''message'' is sometimes multiple lines; if it is, be sure to use quotes(''' ' ''' or ''' &amp;quot; ''')&lt;br /&gt;
* '''[show_if]''': if present then this message will only be displayed if the conditional statement in this tag is passed (see [[ConditionalActionsWML#Condition_Tags|ConditionalActionsWML]])&lt;br /&gt;
* '''side_for''': (default: all sides) comma-separated list of sides for who message is shown.&lt;br /&gt;
* '''image''': (default: profile image of speaker) the image to display next to the message.&lt;br /&gt;
* '''caption''': (default: name of speaker) the caption to display beside the image. Name to be displayed. Note: use a translation mark to avoid wmllint errors.&lt;br /&gt;
* '''scroll''': {{DevFeature1.9}} Boolean specifying whether the game view should scroll to the speaking unit. Defaults to ''yes''.&lt;br /&gt;
* '''duration''': (default: 10) the minimum number of frames for this message to be displayed. (A frame lasts about 30 milliseconds.) During this time any dialog decisions will be disregarded.&lt;br /&gt;
* '''sound''': a sound effect (wav file) to play as the message is displayed. This can be a comma-separated list, from which one will be randomly chosen.&lt;br /&gt;
* '''[option]''': No '''[option]''' elements have to be used. If '''[option]''' elements are present, then each option will be displayed in a menu for the user to select one option.&lt;br /&gt;
** '''message''': (translatable) the text displayed for the option (see [[DescriptionWML]])&lt;br /&gt;
** '''[show_if]''': if present then this option will only be displayed if the conditional statement in this tag is passed (see [[InternalActionsWML]])&lt;br /&gt;
** '''[command]''': an element containing actions which are executed if the option is selected.&lt;br /&gt;
* '''[text_input]''': there can be only one [text_input] tag. this adds a text input field to the message.&lt;br /&gt;
** '''variable''': the variable that the user's input will be written to&lt;br /&gt;
** '''label''': a text label to the left of the input field&lt;br /&gt;
** '''max_length''': the maximum number of characters that may be typed into the field&lt;br /&gt;
** '''text''': text that is written into the field in the beginning&lt;br /&gt;
* Check [[EventWML#Multiplayer_safety]] to find out in which events you can safely use '''[option]''' and '''[text_input]''' without causing OOS.&lt;br /&gt;
&lt;br /&gt;
=== Formatting ===&lt;br /&gt;
In 1.8, [http://library.gnome.org/devel/pango/unstable/PangoMarkupFormat.html Pango markup formatting codes] have been adopted for '''[message]'''. These can also be used in unit names (user_description), objectives, and such. Note that you'll probably want to use a single quote ' instead of a double quote &amp;quot; as double quotes cannot be escaped, otherwise the string will appear fragmented and you may also encounter errors. Running wmllint on your campaign will up-convert it, warning you about unusual cases you must fix by hand.&lt;br /&gt;
&lt;br /&gt;
For example, if you wanted to write &amp;quot;You are victorious!&amp;quot; in large, italic, gold letters, you might write it this way:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;&amp;lt;span color='#BCB088' size='large' font-style='italic'&amp;gt;You are victorious!&amp;lt;/span&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These are the codes taken from the Pango markup formatting guide:&lt;br /&gt;
&lt;br /&gt;
*'''font''', '''font_desc''': A font description string, such as &amp;quot;Sans Italic 12&amp;quot;.&lt;br /&gt;
*'''font_family''', '''face''': A font family name.&lt;br /&gt;
*'''font_size''', '''size''': Font size in 1024ths of a point, or one of the absolute sizes 'xx-small', 'x-small', 'small', 'medium', 'large', 'x-large', 'xx-large', or one of the relative sizes 'smaller' or 'larger'.&lt;br /&gt;
*'''font_style''', '''style''': One of 'normal', 'oblique', 'italic'.&lt;br /&gt;
*'''font_weight''', '''weight''': One of 'ultralight', 'light', 'normal', 'bold', 'ultrabold', 'heavy', or a numeric weight.&lt;br /&gt;
*'''font_variant''', '''variant''': One of 'normal' or 'smallcaps'.&lt;br /&gt;
*'''font_stretch''', '''stretch''': One of 'ultracondensed', 'extracondensed', 'condensed', 'semicondensed', 'normal', 'semiexpanded', 'expanded', 'extraexpanded', 'ultraexpanded'.&lt;br /&gt;
*'''foreground''', '''fgcolor''', '''color''': An RGB color specification such as '#00FF00' or a color name such as 'red'.&lt;br /&gt;
*'''background, bgcolor''': An RGB color specification such as '#00FF00' or a color name such as 'red'.&lt;br /&gt;
*'''underline''': One of 'none', 'single', 'double', 'low', 'error'.&lt;br /&gt;
*'''underline_color''': The color of underlines; an RGB color specification such as '#00FF00' or a color name such as 'red'.&lt;br /&gt;
*'''rise''': Vertical displacement, in 10000ths of an em. Can be negative for subscript, positive for superscript.&lt;br /&gt;
*'''strikethrough''': 'true' or 'false' whether to strike through the text.&lt;br /&gt;
*'''strikethrough_color''': The color of strikethrough lines; an RGB color specification such as '#00FF00' or a color name such as 'red'&lt;br /&gt;
*'''fallback''': 'true' or 'false' whether to enable fallback. If disabled, then characters will only be used from the closest matching font on the system. No fallback will be done to other fonts on the system that might contain the characters in the text. Fallback is enabled by default. Most applications should not disable fallback.&lt;br /&gt;
*'''letter_spacing''': Inter-letter spacing in 1024ths of a point.&lt;br /&gt;
*'''gravity''': One of 'south', 'east', 'north', 'west', 'auto'.&lt;br /&gt;
*'''gravity_hint''': One of 'natural', 'strong', 'line'.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In 1.6, Wesnoth uses older text formatting options&lt;br /&gt;
* A tilde (~) as the first character causes the line to be boldfaced.&lt;br /&gt;
* An at symbol (@) as the first character causes the line to be green, as done with victory conditions.&lt;br /&gt;
* A pound symbol (#) as the first character causes the line to be red, as done with defeat conditions.&lt;br /&gt;
* An asterisk (*) as the first character causes the line to be bigger.&lt;br /&gt;
* A backquote (`) as the first character causes the line to be smaller.&lt;br /&gt;
* If used, the caption key text is boldfaced.&lt;br /&gt;
* An RGB colour code in the beginning causes the line to be the given colour. This can still be preceded by the above characters. Example: ''message=_&amp;quot;&amp;lt;255,0,0&amp;gt;Red!&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
== [objectives] ==&lt;br /&gt;
The other tag used for plot development is '''[objectives]'''.&lt;br /&gt;
The '''[objectives]''' tag overwrites any previously set objectives,&lt;br /&gt;
and displays text which should describe the objectives of the scenario.&lt;br /&gt;
Scenario objectives are displayed on the player's first turn after the tag is used,&lt;br /&gt;
or as part of the event if it triggers during that player's turn.&lt;br /&gt;
Objectives can also be accessed at any time in a scenario using the&lt;br /&gt;
&amp;quot;Scenario Objectives&amp;quot; game menu option, making this tag useful for&lt;br /&gt;
scenario-specific information that the player may need to refer to during play.&lt;br /&gt;
&lt;br /&gt;
This tag renders the ''objectives'' attribute of [scenario] obsolete (see ''objectives'', [[ScenarioWML]]).&lt;br /&gt;
Instead of using ''objectives'', use '''[objectives]''' to set scenario objectives inside a prestart event.&lt;br /&gt;
It can also be used to overwrite the starting objectives mid-scenario.&lt;br /&gt;
&lt;br /&gt;
Attributes of '''[objectives]''':&lt;br /&gt;
* '''side''': Default '0'. The side to set the objectives for. A value of 0 sets objectives for all sides.&lt;br /&gt;
* '''summary''': Displayed first in the objectives text, this should describe the basic objective for the overall scenario.  Can be omitted.&lt;br /&gt;
* '''note''': Displayed last in the objectives text, this is sometimes used for hints or additional information.  Can be omitted.&lt;br /&gt;
* '''victory_string''': Default ' _ &amp;quot;Victory:&amp;quot;', this text precedes the victory objectives.&lt;br /&gt;
* '''defeat_string''': Default ' _ &amp;quot;Defeat:&amp;quot;', this text precedes the defeat objectives.&lt;br /&gt;
* '''gold_carryover_string''' {{DevFeature1.9}}: Default ' _ &amp;quot;Gold carryover:&amp;quot;', this text precedes the gold carryover information.&lt;br /&gt;
* '''notes_string''' {{DevFeature1.9}}: Default ' _ &amp;quot;Notes:&amp;quot;', this text precedes the notes.&lt;br /&gt;
* '''silent''': Default: not present. If set to &amp;quot;yes&amp;quot;, the objectives are silently changed. Else, they will be shown to the user when appropriate.&lt;br /&gt;
&lt;br /&gt;
Tags of '''[objectives]''':&lt;br /&gt;
* '''[objective]''': describes a win or loss condition. Most scenarios have multiple win or loss conditions, so use a separate [objective] subtag for each line; this helps with translations.&lt;br /&gt;
** '''description''': text for the specific win or loss condition.&lt;br /&gt;
** '''condition''': The color and placement of the text. Values are 'win'(colored green, placed after ''victory_string'') and 'lose'(colored red, placed after ''defeat_string'')&lt;br /&gt;
** '''show_turn_counter''' {{DevFeature1.9}}: If set to yes, displays the number of turns remaining in the scenario. Only works if '''condition'''=lose. Default is no.&lt;br /&gt;
** '''[show_if]''': A condition that disables the objective if it doesn't hold. Conditional objectives are refreshed at '''[show_objectives]''' time only. {{DevFeature}}&lt;br /&gt;
* '''[gold_carryover]''' {{DevFeature1.9}}: describes how the gold carryover works in this scenario. This is intended to be a more convenient way of displaying carryover information than using the note= key in [objectives].&lt;br /&gt;
** '''bonus''' (boolean): whether an early finish bonus is granted. If omitted, early finish bonus is not mentioned.&lt;br /&gt;
** '''carryover_percentage''': the amount of carryover gold. If omitted, the amount is not mentioned.&lt;br /&gt;
* '''[note]''' {{DevFeature1.9}}: describes a note, usually used for hints or additional information. This is an easier way of adding several notes than concatenating them together into a single string to use with the ''note='' key.&lt;br /&gt;
** '''description''': the text of the note.&lt;br /&gt;
&lt;br /&gt;
=== Macros ===&lt;br /&gt;
There are a few predefined macros for Objectives that you can use to shorten the code: [http://www.wesnoth.org/macro-reference.xhtml#SET_OBJECTIVES SET_OBJECTIVES], [http://www.wesnoth.org/macro-reference.xhtml#VICTORY_CONDITION VICTORY_CONDITION], and [http://www.wesnoth.org/macro-reference.xhtml#DEFEAT_CONDITION DEFEAT_CONDITION]. Follow the links for each one to see complete syntax and example usage.&lt;br /&gt;
&lt;br /&gt;
== [set_menu_item] ==&lt;br /&gt;
This tag is used to add a custom option in the right-click context menu which can then be used to trigger arbitrary WML commands.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Due to limitations in portable devices where there are no scroll bars for context menus, there is a hard-coded limit of 7 custom WML menu items. If you really need to have more than 7 menu items, try combining some of them in a submenu.&lt;br /&gt;
&lt;br /&gt;
* '''id''': the unique id for this menu item. If a menu item with this id already exists, it allows you to set specific changes to that item.&lt;br /&gt;
* '''description''': the in-game text that will appear for this item in the menu.&lt;br /&gt;
* '''image''': the image to display next to this item.&lt;br /&gt;
* '''needs_select''': if ''yes'' (default ''no''), then the latest select event (see [[EventWML]]) that triggered before this menu item was chosen will be transmitted over the network before this menu item action will be. This only has any effect in networked multiplayer, and is intended to allow more elaborate menu item behaviour there without causing out of sync errors. If you don't know what this means, just leave it false.&lt;br /&gt;
* '''[show_if]''': If present, the menu item will only be available if the conditional statement (see [[InternalActionsWML]]) within evaluates to true. When this is evaluated, the WML variables ''$x1'' and ''$y1'' will point to the location on which the context menu was invoked, so it's possible to for example only enable the option on empty hexes or on a particular unit.&lt;br /&gt;
* '''[filter_location]''': contains a location filter similar to the one found inside Single Unit Filters (see [[FilterWML]]). The menu item will only be available on matching locations.&lt;br /&gt;
* '''[command]''': contains the WML actions to be executed when the menu item is selected. Again, the WML variables ''$x1'' and ''$y1'' will point to the location on which the context menu was invoked on.&lt;br /&gt;
&lt;br /&gt;
== Other interface tags ==&lt;br /&gt;
&lt;br /&gt;
The following tags are also action tags:&lt;br /&gt;
* '''[item]''': makes a graphical item appear on a certain hex. Note this only places the graphics for an item. It does not make the item do anything. Use a moveto event to make moving onto the item do something. &amp;lt;tt&amp;gt;''('''Hint:''' There are a number of predefined items that are used in various campaigns that you can make use of. You can find [http://www.wesnoth.org/macro-reference.xhtml#file:items.cfg a list of them] if you look into the items.cfg file in the wesnoth install directory (under /data/core/macros))''&amp;lt;/tt&amp;gt;&lt;br /&gt;
** '''x''', '''y''': the location to place the item.&lt;br /&gt;
** '''image''': the image (in ''images/'' as .png) to place on the hex.&lt;br /&gt;
** '''halo''': an image to place centered on the hex. Use this instead of ''image'' if the image is bigger than the hex or if you want to animate an image. ''Example (where the integer after the colon is the duration of each frame): halo=scenery/fire1.png:100,scenery/fire2.png:100,scenery/fire3.png:100,scenery/fire4.png:100,scenery/fire5.png:100,scenery/fire6.png:100,scenery/fire7.png:100,scenery/fire8.png:100''&lt;br /&gt;
** '''team_name''': name of the team for which the item is to be displayed (hidden for others). For multiple teams just put all the names in one string, for example separated by commas.&lt;br /&gt;
** '''visible_in_fog''': whether the item should be visible through fog or not. Default yes.&lt;br /&gt;
* '''[removeitem]''': removes any graphical items on a given hex. (In version 1.9.2, this was renamed to '''[remove_item]''')&lt;br /&gt;
** '''x''', '''y''': the hex to remove items off&lt;br /&gt;
** '''image''' if specified, only removes the given image item (This image name must include any [[ImagePathFunctionWML|image path functions]] appended to the original image name.)&lt;br /&gt;
* '''[print]''': displays a message across the screen. The message will disappear after a certain time.&lt;br /&gt;
** '''text''': (translatable) the text to display.&lt;br /&gt;
** '''size''': (default=12) the pointsize of the font to use&lt;br /&gt;
** '''duration''': (default=50) the length of time to display the text for. This is measured in the number of 'frames'. A frame in Wesnoth is usually displayed for around 30ms.&lt;br /&gt;
** '''red''', '''green''', '''blue''': (default=0,0,0) the color to display the text in. Values vary from 0-255.&lt;br /&gt;
* '''[move_unit_fake]''': moves an image of a unit along a certain path on the map. The path does not need to be a continuous list of adjacent hexes, so for example only the start and end points can be given, in which case the straightest line between those points will be calculated and used.&lt;br /&gt;
** '''type''': the type of the unit whose image to use&lt;br /&gt;
** '''x''': a comma-separated list of x locations to move along&lt;br /&gt;
** '''y''': a comma-separated list of y locations to move along (x and y values are matched pairs)&lt;br /&gt;
** '''side''': the side of the fake unit, used for team-coloring the fake unit&lt;br /&gt;
** '''gender''': the gender of the fake unit. Example: gender=female&lt;br /&gt;
** '''variation''': the variation of the fake unit. Example: variation=undead&lt;br /&gt;
* '''[move_units_fake]''': {{DevFeature1.9}} moves multiple images of units along paths on the map. These units are moved in lockstep.&lt;br /&gt;
** '''[fake_unit]''': A fake unit to move&lt;br /&gt;
*** '''type''': the type of unit whose image to use&lt;br /&gt;
*** '''x''': a comma-separated list of x locations to move along&lt;br /&gt;
*** '''y''': a comma-separated list of y locations to move along (x and y values are matched pairs)&lt;br /&gt;
*** '''side''': the side of the fake unit, used for team-coloring the fake unit&lt;br /&gt;
*** '''skip_steps''': the number of steps to skip before this unit starts moving&lt;br /&gt;
* '''[hide_unit]''': temporarily prevents the engine from displaying the given unit. The unit does not become invisible, as it would be with the '''[hides]''' ability; it is still the same plain unit, but without an image. Useful in conjunction with '''[move_unit_fake]''': to move a leader unit into position on-screen. Each '''[hide_unit]''' tag only hides one unit.&lt;br /&gt;
** '''x''', '''y''': location of the unit to be hidden. (NOT a standard unit filter! Just x and y.)&lt;br /&gt;
** {{DevFeature1.9}}: '''[hide_unit]''' accepts a [[StandardUnitFilter]] as argument and can disable several units at once.&lt;br /&gt;
* '''[unhide_unit]''': stops the currently hidden units from being hidden.&lt;br /&gt;
** {{DevFeature1.9}}: '''[unhide_unit]''' accepts a [[StandardUnitFilter]] as argument.&lt;br /&gt;
* '''[scroll]''': Scroll a certain number of pixels in a given direction. Useful for earthquake/shaking effects.&lt;br /&gt;
** '''x''', '''y''': the number of pixels to scroll along the x and y axis&lt;br /&gt;
* '''[scroll_to]''': Scroll to a given hex&lt;br /&gt;
** '''x''', '''y''': the hex to scroll to&lt;br /&gt;
** '''check_fogged''': whether to scroll even to locations covered in fog or shroud. Possible values ''true'' (don't scroll to fog) and ''false'' (scroll even to fog), with ''false'' as the default.&lt;br /&gt;
* '''[scroll_to_unit]''' Scroll to a given unit&lt;br /&gt;
** [[StandardUnitFilter]]&lt;br /&gt;
** '''check_fogged''': whether to scroll even to locations covered in fog or shroud. Possible values ''true'' (don't scroll to fog) and ''false'' (scroll even to fog), with ''false'' as the default.&lt;br /&gt;
* '''[select_unit]''': {{DevFeature1.9}} Selects a given unit&lt;br /&gt;
** [[StandardUnitFilter]]&lt;br /&gt;
** '''fire_event''': whether a ''select'' event should be triggered or not (def. ''no'').&lt;br /&gt;
** '''highlight''': whether the unit's current hex should be highlighted (def. ''yes'').&lt;br /&gt;
* '''[sound]''': Plays a sound&lt;br /&gt;
** '''name''': the filename of the sound to play (in ''sounds/'' as .wav or .ogg)&lt;br /&gt;
** '''repeat''': repeats the sound for a specified additional number of times (default=0)&lt;br /&gt;
* '''[sound_source]''': Creates a sound source. &amp;quot;Sound sources&amp;quot; is a general name for a mechanism which makes possible for map elements to emit sounds according to some rules, where &amp;quot;map elements&amp;quot; can be specific locations or terrain types. For now, only sound sources tied to locations are supported.&lt;br /&gt;
** '''id''': a unique identification key of the sound source&lt;br /&gt;
** '''sounds''': a list of comma separated, randomly played sounds associated with the sound source&lt;br /&gt;
** '''delay''': a numerical value (in milliseconds) of the minimal delay between two playbacks of the source's sound if the source remains visible on the screen; if one scrolls out and back in, the source will be considered as ready to play&lt;br /&gt;
** '''chance''': a percentage (a value from 0 to 100) describing the chance of the source being activated every second after the delay has passed or when the source's location appears on the screen (note that it cannot play more than one file at the same time)&lt;br /&gt;
** '''check_fogged''': possible values &amp;quot;true&amp;quot; and &amp;quot;false&amp;quot; - if true the source will not play if its locations are fogged&lt;br /&gt;
** '''check_shrouded''': {{DevFeature}} possible values &amp;quot;true&amp;quot; and &amp;quot;false&amp;quot; - if true the source will not play if its locations are shrouded&lt;br /&gt;
** '''x,y''': similar to x,y as found in a [[StandardLocationFilter]], these are the locations associated with the sound source&lt;br /&gt;
** '''fade_range''' (default = 3): distance in hexes that determines a &amp;quot;circular&amp;quot; area around the one specified by '''full_range''' where sound volume fades out linearly&lt;br /&gt;
** '''full_range''' (default = 14): distance in hexes that determines a &amp;quot;circular&amp;quot; area where source plays with full volume, relative to screen center&lt;br /&gt;
** '''loop''': number of times a sound sample should be looped if it stays visible. -1 means infinite (~65000)&lt;br /&gt;
* '''[remove_sound_source]''': Removes a previously defined sound source.&lt;br /&gt;
** '''id''': the identification key of the sound source to remove&lt;br /&gt;
* '''[music]''': Switches to playing different music&lt;br /&gt;
** '''name''': the filename of the music to play (in ''music/'' as .ogg)&lt;br /&gt;
** see [[MusicListWML]] for the correct syntax&lt;br /&gt;
* '''[volume]''': {{DevFeature1.9}} Changes the game volume to a percent of the preferences volume for the game being played. Values can go from 0 to 100:  &lt;br /&gt;
** '''music''':  Changes the music volume.&lt;br /&gt;
** '''sound''':  Changes the sound volume.&lt;br /&gt;
* '''[colour_adjust]''': tints the color of the screen. {{DevFeature1.9}}: now named '''[color_adjust]'''.&lt;br /&gt;
** '''red''', '''green''', '''blue''': values from -255 to 255, the amount to tint by for each color&lt;br /&gt;
* '''[delay]''': pauses the game&lt;br /&gt;
** '''time''': the time to pause in milliseconds&lt;br /&gt;
* '''[redraw]''': redraws the screen (this normally isn't done during events, although some of the other interface actions cause the screen or parts of it to be redrawn).&lt;br /&gt;
** '''side''': if used, recalculates fog and shroud for that side. Useful if you for example spawn friendly units in the middle of an event and want the shroud to update accordingly (otherwise units that spawn inside fog would remain invisible for the duration of the event, since the fog would not automatically get cleared around them).&lt;br /&gt;
* '''[unit_overlay]''': sets an image that will be drawn over a particular unit, and follow it around&lt;br /&gt;
** '''x''', '''y''': the location of the unit to overlay on&lt;br /&gt;
** '''image''': the image to place on the unit&lt;br /&gt;
** {{DevFeature1.9}}: '''[unit_overlay]''' accepts a [[StandardUnitFilter]] as argument&lt;br /&gt;
* '''[remove_unit_overlay]''': removes a particular overlayed image from a unit&lt;br /&gt;
** '''x''', '''y''': the location of the unit to remove an overlay from&lt;br /&gt;
** '''image''': the image to remove from the unit&lt;br /&gt;
** {{DevFeature1.9}}: '''[remove_unit_overlay]''' accepts a [[StandardUnitFilter]] as argument&lt;br /&gt;
* '''[animate_unit]''': Uses an animation of a unit to animate it on screen (if the unit has the corresponding animation).&lt;br /&gt;
** '''flag''': The key to find the custom animation in the unit description (see the '''[extra_anim]''' description in [[AnimationWML]]). Standard animations can be triggered with the following keywords: ''leading recruited standing idling levelin levelout healing healed poisoned movement defend attack death victory pre_teleport post_teleport''&lt;br /&gt;
** '''[filter]''' with a [[StandardUnitFilter]] as argument, see [[FilterWML]]. By default, the unit at the event location will be animated. You can use this tag to choose any other unit to animate.&lt;br /&gt;
** '''[primary_attack]''': If this tag is not present, the filter for animation will be triggered with no attack. If it is here, all attacks from the unit will be filtered, and a matching one will be used to filter the animation. Takes a weapon filter as argument, see [[FilterWML]].&lt;br /&gt;
** '''[secondary_attack]''': Similar to '''[primary_attack]'''. May be needed to trigger a defense animation correctly, if there are more than one animations available for the defending unit.&lt;br /&gt;
** '''hits''': yes/no/hit/miss/kill: which according variation of a attack/defense animation shall be chosen (required)&lt;br /&gt;
** '''text''': a text to hover during the animation &lt;br /&gt;
** '''red''': red value for the text color (0-255)&lt;br /&gt;
** '''green''': green value for the text color&lt;br /&gt;
** '''blue''': blue value for the text color&lt;br /&gt;
** '''with_bars''': yes/no: whether to display the status bars during the animation (e.g. the hitpoint bar)&lt;br /&gt;
** '''[animate]''': a sub block with the same syntax as '''[animate_unit]''' except that the '''[filter]''' block is mandatory to find the unit. This block will find and animate another unit simultaneously.&lt;br /&gt;
** '''[facing]''': a [[StandardLocationFilter]] specifying what direction the unit should be facing when animated&lt;br /&gt;
* '''[label]''' places a label on the map.&lt;br /&gt;
** '''x''', '''y''': the location of the label&lt;br /&gt;
** '''text''': what the label should say&lt;br /&gt;
** '''team_name''': if specified, the label will only be visible to the given team.&lt;br /&gt;
** '''colour''': color of the label. The format is r,g,b; r, g and b are numbers between 0 and 255. {{DevFeature1.9}}: now named '''color'''.&lt;br /&gt;
** '''visible_in_fog''': whether the label should be visible through fog or not. Default yes.&lt;br /&gt;
** '''visible_in_shroud''': whether the label should be visible through shroud or not. Default no.&lt;br /&gt;
** '''immutable''': whether this label is protected from being removed or changed by players. Default yes. {{DevFeature1.9}}&lt;br /&gt;
* '''[floating_text]''': {{DevFeature1.9}} floats text (similar to the damage and healing numbers) on the given locations.&lt;br /&gt;
** [[StandardLocationFilter]]: the text will be floated on all matching locations simultaneously.&lt;br /&gt;
** '''text''': the text to display.&lt;br /&gt;
* '''[deprecated_message]''' shows a deprecated message in the message area, this feature is only intended to be used to warn about deprecated macros in mainline. The message is not translatable.&lt;br /&gt;
** '''message''': the message to show.&lt;br /&gt;
* '''[wml_message]''' outputs a message to Wesnoth's console output. Intended for campaign designers to output silent text to the console, without annoying the player; then, that text might contain information useful for later bug-reporting. The log domain for it is '''wml''', and the '''debug/dbg''' log level is available for use with the '''logger''' attribute. Depending on the current log level ('''error''' by default), which may be changed with the in-game :log command, or the --log-&amp;lt;level&amp;gt;=wml command line switch, the messages are echoed to the in-game chat.&lt;br /&gt;
** '''message''': the message to show.&lt;br /&gt;
** '''logger''': the Wesnoth engine output logger that should catch the text; this might be 'err' (the errors log level), 'warn'/'wrn' (the warnings log level) or anything else (the information log level). Not all information will be displayed depending on the log level chosen when starting Wesnoth.&lt;br /&gt;
* '''[open_help]''' opens the in-game help.&lt;br /&gt;
** '''topic''': the id of the topic to open&lt;br /&gt;
* '''[show_objectives]''': {{DevFeature}} refreshes the objectives defined by [objectives] and its [show_if] tags, and displays them. (It is also called whenever the user explicitly asks for the objectives; this matters only if the tag was overridden by a [[LuaWML#register_wml_action|Lua]] script.)&lt;br /&gt;
** '''side''': the side to show the objectives. If not set, all sides are used.&lt;br /&gt;
* '''[chat]''' displays a message in the chat area. {{DevFeature1.9}}&lt;br /&gt;
** '''speaker''': The sender of the message. Normally this is a string. However if you enter the name of a variable in which a unit is stored (such as ''second_unit'') it will display that unit's name instead.&lt;br /&gt;
** '''message''': The message that should be displayed&lt;br /&gt;
** '''side''': A comma separated list of sides to show the message to. If the same machine controls multiple sides that are in this list, then the message will only be displayed once. If left blank the message will be send to all sides.&lt;br /&gt;
&lt;br /&gt;
== Useful Macros ==&lt;br /&gt;
There are some predefined macros that you find useful for interface actions. You can find a complete list along with a detailed explanation of how they work [http://www.wesnoth.org/macro-reference.xhtml here].&lt;br /&gt;
* '''{FLOATING_TEXT}''' Float some text over a unit similar to the damage numbers.&lt;br /&gt;
* '''{HIGHLIGHT_UNIT}''' Highlight a unit on the map. Use this to show important units&lt;br /&gt;
* '''{HIGHLIGHT_IMAGE}''' Places and highlights an image on the map. Use this to show important items or locations&lt;br /&gt;
* '''{SET_IMAGE}''' Places an image on the map which has no other function.&lt;br /&gt;
* '''{QUAKE &amp;lt;soundfile&amp;gt;}''' Creates a tremor like screenshake and plays &amp;lt;soundfile&amp;gt;. ('''{TREMOR}''' is a deprecated version, equivalent to '''{QUAKE (rumble.ogg)}''')&lt;br /&gt;
* '''{FLASH_WHITE}''' Flash the screen white momentarily. You can also replace WHITE with RED, BLUE or GREEN for a different colour.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[DirectActionsWML]]&lt;br /&gt;
* [[InternalActionsWML]]&lt;br /&gt;
* [[EventWML]]&lt;br /&gt;
* [[ReferenceWML]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: WML Reference]]&lt;br /&gt;
[[Category: ActionsWML]]&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=GCI/Playtesting&amp;diff=39034</id>
		<title>GCI/Playtesting</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=GCI/Playtesting&amp;diff=39034"/>
		<updated>2010-11-24T09:40:29Z</updated>

		<summary type="html">&lt;p&gt;Boucman: /* Wesnoth 1.9.2 Playtesting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Wesnoth 1.9.2 Playtesting =&lt;br /&gt;
Download from here: http://wiki.wesnoth.org/Download#Development_.281.9_branch.29&lt;br /&gt;
&lt;br /&gt;
Wesnoth 1.9 ships with 16 campaigns which total over 200 scenarios, each one with varying amounts of events, dialogue, cutscenes, special gameplay mechanics, and so on. It's inevitable that many scenarios contain bugs which have gone unnoticed or unreported. Also, most scenarios were originally written a long time ago when the game engine was much less versatile, meaning that some scenario mechanics don't function as naturally and conveniently as they could.&lt;br /&gt;
&lt;br /&gt;
This task involves picking a mainline campaign on a specific difficulty level, playing through it and reporting in as much detail as possible all bugs and glitches encountered as well as suggestions for improvement. Campaigns with scenario branching should get all their branches tested.&lt;br /&gt;
&lt;br /&gt;
Requirements&lt;br /&gt;
&lt;br /&gt;
Reasonably familiar with Wesnoth campaigns, so as to be able to identify bugs and suggest realistically doable gameplay-enhancing changes in detail. No coding in WML or otherwise required.&lt;br /&gt;
&lt;br /&gt;
Difficulty&lt;br /&gt;
&lt;br /&gt;
Depending on the student's skill medium to low. Students able to learn WML and fix bugs would increase the difficulty.&lt;br /&gt;
&lt;br /&gt;
Deliverable/expected proof&lt;br /&gt;
you should get latest version of wesnoth 1.9 or trunk&lt;br /&gt;
&lt;br /&gt;
- complete a report (wiki page, like GCI/Playtesting/Legend_of_Wesmere/Normal ) of what you've found&lt;br /&gt;
&lt;br /&gt;
- submit all bugs to bugs.wesnoth.org and link to them in your report&lt;br /&gt;
&lt;br /&gt;
- include answers to the following questionnaire for each scenario :&lt;br /&gt;
&lt;br /&gt;
- submit a package with end of scenario savegames&lt;br /&gt;
&lt;br /&gt;
(1) What difficulty levels and what version of Wesnoth have you played the scenario on?&lt;br /&gt;
&lt;br /&gt;
(2) How difficult did you find the scenario? (1-10)&lt;br /&gt;
&lt;br /&gt;
(3) How clear did you find the scenario objectives?&lt;br /&gt;
&lt;br /&gt;
(4) How clear and interesting did you find the dialog and storyline of the scenario?&lt;br /&gt;
&lt;br /&gt;
(5) What were your major challenges in meeting the objectives of the scenario?&lt;br /&gt;
&lt;br /&gt;
(6) How fun do you think the scenario is? (1-10)&lt;br /&gt;
&lt;br /&gt;
(7) What, if any, are changes you would have made to the scenario to make it more fun?&lt;br /&gt;
&lt;br /&gt;
(8) Was there any event that caused you to lose the game and forced you to reload or &lt;br /&gt;
restart the scenario?&lt;br /&gt;
&lt;br /&gt;
(9) If you know a bit of the Wesnoth Markup Language - do you think that the WML of this scenario is clear and well commented? If not which part would you like to be documented better?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a short list of the sort of bugs we are interested in&lt;br /&gt;
&lt;br /&gt;
* obvious bugs (crashes, scenario not working etc...)&lt;br /&gt;
* bad wordings/spelling mistakes/ typos &lt;br /&gt;
* terrain bugs (in particular missing transitions in mainline maps)&lt;br /&gt;
* unit animation bugs (animation glitches or wrong animation played. Note that missing animations are not considered bugs)&lt;br /&gt;
* inconsistent namings/backstory/ of characters&lt;br /&gt;
&lt;br /&gt;
some usefull wiki links&lt;br /&gt;
* [[DebugMode]]&lt;br /&gt;
* [[CommandMode]]&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=GCI/Playtesting&amp;diff=39033</id>
		<title>GCI/Playtesting</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=GCI/Playtesting&amp;diff=39033"/>
		<updated>2010-11-24T09:37:02Z</updated>

		<summary type="html">&lt;p&gt;Boucman: /* Wesnoth 1.9.2 Playtesting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Wesnoth 1.9.2 Playtesting =&lt;br /&gt;
Download from here: http://wiki.wesnoth.org/Download#Development_.281.9_branch.29&lt;br /&gt;
&lt;br /&gt;
Wesnoth 1.9 ships with 16 campaigns which total over 200 scenarios, each one with varying amounts of events, dialogue, cutscenes, special gameplay mechanics, and so on. It's inevitable that many scenarios contain bugs which have gone unnoticed or unreported. Also, most scenarios were originally written a long time ago when the game engine was much less versatile, meaning that some scenario mechanics don't function as naturally and conveniently as they could.&lt;br /&gt;
&lt;br /&gt;
This task involves picking a mainline campaign on a specific difficulty level, playing through it and reporting in as much detail as possible all bugs and glitches encountered as well as suggestions for improvement. Campaigns with scenario branching should get all their branches tested.&lt;br /&gt;
&lt;br /&gt;
Requirements&lt;br /&gt;
&lt;br /&gt;
Reasonably familiar with Wesnoth campaigns, so as to be able to identify bugs and suggest realistically doable gameplay-enhancing changes in detail. No coding in WML or otherwise required.&lt;br /&gt;
&lt;br /&gt;
Difficulty&lt;br /&gt;
&lt;br /&gt;
Depending on the student's skill medium to low. Students able to learn WML and fix bugs would increase the difficulty.&lt;br /&gt;
&lt;br /&gt;
Deliverable/expected proof&lt;br /&gt;
you should get latest version of wesnoth 1.9 or trunk&lt;br /&gt;
&lt;br /&gt;
- complete a report (wiki page, like GCI/Playtesting/Legend_of_Wesmere/Normal ) of what you've found&lt;br /&gt;
&lt;br /&gt;
- submit all bugs to bugs.wesnoth.org and link to them in your report&lt;br /&gt;
&lt;br /&gt;
- include answers to the following questionnaire for each scenario :&lt;br /&gt;
&lt;br /&gt;
- submit a package with end of scenario savegames&lt;br /&gt;
&lt;br /&gt;
(1) What difficulty levels and what version of Wesnoth have you played the scenario on?&lt;br /&gt;
&lt;br /&gt;
(2) How difficult did you find the scenario? (1-10)&lt;br /&gt;
&lt;br /&gt;
(3) How clear did you find the scenario objectives?&lt;br /&gt;
&lt;br /&gt;
(4) How clear and interesting did you find the dialog and storyline of the scenario?&lt;br /&gt;
&lt;br /&gt;
(5) What were your major challenges in meeting the objectives of the scenario?&lt;br /&gt;
&lt;br /&gt;
(6) How fun do you think the scenario is? (1-10)&lt;br /&gt;
&lt;br /&gt;
(7) What, if any, are changes you would have made to the scenario to make it more fun?&lt;br /&gt;
&lt;br /&gt;
(8) Was there any event that caused you to lose the game and forced you to reload or &lt;br /&gt;
restart the scenario?&lt;br /&gt;
&lt;br /&gt;
(9) If you know a bit of the Wesnoth Markup Language - do you think that the WML of this scenario is clear and well commented? If not which part would you like to be documented better?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Here is a short list of the sort of bugs we are interested in&lt;br /&gt;
&lt;br /&gt;
* obvious bugs (crashes, scenario not working etc...)&lt;br /&gt;
* bad wordings/spelling mistakes/ typos &lt;br /&gt;
* terrain bugs (in particular missing transitions in mainline maps)&lt;br /&gt;
* unit animation bugs (animation glitches or wrong animation played. Note that missing animations are not considered bugs)&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=AnimationWML&amp;diff=38784</id>
		<title>AnimationWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=AnimationWML&amp;diff=38784"/>
		<updated>2010-10-29T15:16:03Z</updated>

		<summary type="html">&lt;p&gt;Boucman: /* Field Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WML Tags}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This page covers unit animations. At any point in game, units are playing an animation. Even when the unit is standing, it is actually playing a single frame animation.&lt;br /&gt;
&lt;br /&gt;
This page will deal with the two problems of animations&lt;br /&gt;
* How are animations Chosen&lt;br /&gt;
* What exactly is drawn&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How animations are drawn ==&lt;br /&gt;
=== Animations ===&lt;br /&gt;
Any unit has a huge set of animations to choose from. Animations are WML blocks in the unit type, enclosed in either the generic type '''[animation]''' or some more specific tags such as '''[attack_anim]''' '''[idle_anim]''' and the like. An animation is what a unit displays when a given event is triggered, and a certain set of conditions are met such as&lt;br /&gt;
* unit is attacking&lt;br /&gt;
* unit is idling&lt;br /&gt;
* unit is attacking (event) and uses a melee weapon (condition)&lt;br /&gt;
* unit is attacking (event) and uses a melee weapon (condition) and opponent can't retaliate (condition)&lt;br /&gt;
&lt;br /&gt;
events and conditions are described entirely in the [animation] block, and will be discussed in the animation choice section.&lt;br /&gt;
&lt;br /&gt;
=== Frames ===&lt;br /&gt;
    &lt;br /&gt;
An animation is cut in frames. Frames are WML blocks that are contained either in '''[frame]''' WML blocks or in generic '''[xxx_frame]''' block. (the xxx part can be any string not starting with an underscore) the xxx part in the frame name is called the frame prefix. frames of the type '''[frame]''' are said to have an empty prefix&lt;br /&gt;
&lt;br /&gt;
A frame typically describes an image, where an how to render it. It can contain such things as&lt;br /&gt;
* the image to display&lt;br /&gt;
* how transparent should that image be&lt;br /&gt;
* where to draw that image.&lt;br /&gt;
&lt;br /&gt;
At any given time, an animation will display one frame for each frame prefix it can find. I.e if your animation has both '''[frame]''' and '''[missile_frame]''' blocks, both will be displayed at the same time&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The frame with the empty prefix is special in many way. It is assumed to contain the image representing the unit itself, and as such the engine will heavily temper with it in multiple ways, such as providing a default image if none is available, or forcing the image to be green when the unit is poisoned&lt;br /&gt;
&lt;br /&gt;
=== Timing, Clock, Multiple animations ===&lt;br /&gt;
When an animation is played it has an internal clock that is run. The step of this clock is the milisecond, and each frame is played for a given duration. Each animation also has a starting time which tells the animation engine at what value the animation clock should start&lt;br /&gt;
&lt;br /&gt;
This starting time is very important when multiple animations from different units are played synchronously  Typically a fight involves a unit playing its defense animation while the opponent plays it's attack animation (and a third might play its leading animation, too). In that case all animations have a common clock, and are played concurrently.&lt;br /&gt;
&lt;br /&gt;
The convention is that the &amp;quot;important time&amp;quot; (usually the time of the hit) is at time 0. everything before should be at negative time, everything after at positive time. This is a WML convention that is not enforced by the engine&lt;br /&gt;
&lt;br /&gt;
In that case, it is very important that these animations (which can have different lengths) be synchronized. Fight animations are synchronized around the point of impact, so they all reach time 0 when the attack lands (or misses). This is accomplished through the use of the '''start_time''' key of the '''[animation]''' tag.&lt;br /&gt;
&lt;br /&gt;
Just like the '''[frame]''' tag can have a prefix, so can the '''start_time''' key. A '''start_time''' key without prefix will affect a '''[frame]''' tag without prefix, while a '''start_time''' key with a prefix will affect a '''[frame]''' tag with the same prefix.&lt;br /&gt;
&lt;br /&gt;
==== Example Syntax ====&lt;br /&gt;
    [attack_anim]&lt;br /&gt;
        [filter_attack]&lt;br /&gt;
            name=bow&lt;br /&gt;
        [/filter_attack]&lt;br /&gt;
        '''start_time'''=-350&lt;br /&gt;
        '''missile_start_time'''=-150&lt;br /&gt;
        [missile_frame]&lt;br /&gt;
            duration=150&lt;br /&gt;
            image=&amp;quot;projectiles/missile-n.png&amp;quot;&lt;br /&gt;
            image_diagonal=&amp;quot;projectiles/missile-ne.png&amp;quot;&lt;br /&gt;
        [/missile_frame]&lt;br /&gt;
        [if]&lt;br /&gt;
            hits=yes&lt;br /&gt;
            [frame]&lt;br /&gt;
                duration=350&lt;br /&gt;
                sound=bow.ogg&lt;br /&gt;
            [/frame]&lt;br /&gt;
        [/if]&lt;br /&gt;
        [else]&lt;br /&gt;
            hits=no&lt;br /&gt;
            [frame]&lt;br /&gt;
                duration=350&lt;br /&gt;
                sound=bow-miss.ogg&lt;br /&gt;
            [/frame]&lt;br /&gt;
        [/else]&lt;br /&gt;
    [/attack_anim]&lt;br /&gt;
&lt;br /&gt;
=== The content of a frame ===&lt;br /&gt;
==== Syntax summary ====&lt;br /&gt;
 [frame]&lt;br /&gt;
    duration=&amp;lt;integer&amp;gt;&lt;br /&gt;
    begin=&amp;lt;deprecated,integer&amp;gt;&lt;br /&gt;
    end=&amp;lt;deprecated,integer&amp;gt;&lt;br /&gt;
    image=&amp;lt;string&amp;gt;&lt;br /&gt;
    image_diagonal=&amp;lt;string&amp;gt;&lt;br /&gt;
    image_mod=&amp;lt;string&amp;gt;&lt;br /&gt;
    sound=&amp;lt;string&amp;gt;&lt;br /&gt;
    halo=&amp;lt;progressive string&amp;gt;&lt;br /&gt;
    halo_x=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
    halo_y=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
    halo_mod=&amp;lt;string&amp;gt;&lt;br /&gt;
    alpha=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
    offset=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
    blend_color=&amp;lt; red, green, blue &amp;gt;&lt;br /&gt;
    blend_ratio=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
    text=&amp;lt;string&amp;gt;&lt;br /&gt;
    text_color=&amp;lt; red, green, blue &amp;gt;&lt;br /&gt;
    submerge=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
    x=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
    y=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
    directional_x=&amp;lt;dev feature 1.9,progressive int&amp;gt;&lt;br /&gt;
    directional_y=&amp;lt;dev feature 1.9,progressive int&amp;gt;&lt;br /&gt;
    layer=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
    auto_hflip=&amp;lt;dev feature 1.9, boolean&amp;gt;&lt;br /&gt;
    auto_vflip=&amp;lt;dev feature 1.9, boolean&amp;gt;&lt;br /&gt;
    primary=&amp;lt;dev feature 1.9, boolean&amp;gt;&lt;br /&gt;
 [/frame]&lt;br /&gt;
&lt;br /&gt;
==== Progressive parameters ====&lt;br /&gt;
&lt;br /&gt;
Some parameters above are marked as ''progressive'' This means that you can specify that during the time the frame is displayed, the parameter should smoothly slide from one value to an other.&lt;br /&gt;
&lt;br /&gt;
A typical example would be a unit progressively fading out, becoming transparent&lt;br /&gt;
&lt;br /&gt;
To do that, you could use:&lt;br /&gt;
&lt;br /&gt;
 alpha=1~0&lt;br /&gt;
&lt;br /&gt;
To make a frame, which is 900ms long, slide to transparent for 300ms, stay transparent for another 300ms and finally fade back to normal for 300ms, use:&lt;br /&gt;
&lt;br /&gt;
 alpha=1~0:300,0:300,0~1:300&lt;br /&gt;
&lt;br /&gt;
you could also specify it like that&lt;br /&gt;
&lt;br /&gt;
 alpha=1~0,0,0~1&lt;br /&gt;
&lt;br /&gt;
when a timing is missing, the engine will do its best to fill in in a fair way. &lt;br /&gt;
&lt;br /&gt;
a progressive string has a similar syntax&lt;br /&gt;
&lt;br /&gt;
 halo=halo1.png:300,halo2.png:300,halo2.png:300&lt;br /&gt;
&lt;br /&gt;
==== Field Description ====&lt;br /&gt;
&lt;br /&gt;
** '''begin''': (deprecated) will be replaced by '''duration= &amp;lt;end - begin &amp;gt;'''&lt;br /&gt;
** '''end''': (deprecated) see '''begin''' and also [[AnimationWML#Timing.2C_Clock.2C_Multiple_animations|Timing, Clock, Multiple animations]] section for coverage of '''start_time''' which combines with '''duration''' to replace '''begin=''' '''end='''.&lt;br /&gt;
** '''duration''': how long the frame should be displayed. Use instead of '''begin=''' and '''end='''.&lt;br /&gt;
** '''image''': the image to display during the frame.&lt;br /&gt;
** '''image_diagonal''': the image to display when the attack occurs diagonally (directions ne,se,sw,nw).&lt;br /&gt;
** '''image_mod''': a string modifications (see [[ImagePathFunctionWML]] ) that will be applied to all images&lt;br /&gt;
** '''sound''': the sound to play when the frame begins. Can be a comma-separated list of sounds, in which case one of them is chosen randomly every time.&lt;br /&gt;
** '''halo''': the halo to display at the time.&lt;br /&gt;
** '''halo_x''': the position the halo is displayed in pixel relative to the unit's center.&lt;br /&gt;
** '''halo_y''': the position the halo is displayed in pixel relative to the unit's center.&lt;br /&gt;
** '''halo_mod''': a string modifications (see [[ImagePathFunctionWML]] ) that will be applied to all haloes&lt;br /&gt;
** '''alpha''': transparency level to apply to the frame. This is a floating point progressive parameter ranging from 0.0 to 1.0.&lt;br /&gt;
** '''offset''': the position of the image relative to the hex the unit is facing, 0.0 will display the unit in the center of the hex, 1.0 in the center of the faced hex, -1.0 at the center of the hex behind you. This is a progressive parameter.&lt;br /&gt;
** '''blend_color''': a comma separated list of numbers representing a color in RGB (0-255) this color will be mixed to the frame to give it a tint.&lt;br /&gt;
** '''blend_ratio''': this is a progressive parameter ranging from 0 to 1: 0 means no tint, 1 means target color only.&lt;br /&gt;
** '''text''': if specified, floats a label with the given text above the unit (identical to the floating damage and healing numbers).&lt;br /&gt;
** '''text_color''': the color of the above floating label.&lt;br /&gt;
** '''submerge''': the part of the unit that should drawn with 50% opacity (for units in water)&lt;br /&gt;
** '''x''': x offset applied to the frame&lt;br /&gt;
** '''y''': y offset applied to the frame&lt;br /&gt;
** '''directional_x''': x offset applied to the frame in the direction the unit is facing&lt;br /&gt;
** '''directional_y''': y offset applied to the frame in the direction the unit is facing&lt;br /&gt;
** '''layer''': layer used to draw the frame, see discussion bellow&lt;br /&gt;
** '''auto_hflip''': should the image flip horizontally depending on sprite orientation&lt;br /&gt;
** '''auto_vflip''': should the image flip vertically depending on sprite orientation&lt;br /&gt;
** '''primary''': should the engine consider that frame as a primary frame (affected by visual effects like stone and poison)&lt;br /&gt;
&lt;br /&gt;
=== Drawing related animation content ===&lt;br /&gt;
==== Syntax summary ====&lt;br /&gt;
 [animation]&lt;br /&gt;
   &amp;lt;animation choice related content&amp;gt;&lt;br /&gt;
   [frame]&lt;br /&gt;
     &amp;lt;frame content&amp;gt;&lt;br /&gt;
   [/frame]&lt;br /&gt;
   [frame]&lt;br /&gt;
     &amp;lt;frame content&amp;gt;&lt;br /&gt;
   [/frame]&lt;br /&gt;
   start_time=&amp;lt;integer&amp;gt;&lt;br /&gt;
   offset=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
   image_mod=&amp;lt;string&amp;gt;&lt;br /&gt;
   blend_with=&amp;lt;r,g,b&amp;gt;&lt;br /&gt;
   blend_ratio=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
   halo=&amp;lt;progressive_string&amp;gt;&lt;br /&gt;
   halo_x=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   halo_y=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   halo_mod=&amp;lt;string&amp;gt;&lt;br /&gt;
   submerge=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
   x=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   y=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   directional_x=&amp;lt;dev1.9,progressive int&amp;gt;&lt;br /&gt;
   directional_y=&amp;lt;dev1.9,progressive int&amp;gt;&lt;br /&gt;
   layer=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   [xxx_frame]&lt;br /&gt;
     &amp;lt;frame content&amp;gt;&lt;br /&gt;
   [/xxx_frame]&lt;br /&gt;
   xxx_start_time=&amp;lt;integer&amp;gt;&lt;br /&gt;
   xxx_image_mod=&amp;lt;string&amp;gt;&lt;br /&gt;
   xxx_offset=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
   xxx_blend_with=&amp;lt;r,g,b&amp;gt;&lt;br /&gt;
   xxx_blend_ratio=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
   xxx_halo=&amp;lt;progressive_string&amp;gt;&lt;br /&gt;
   xxx_halo_x=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   xxx_halo_y=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   xxx_halo_mod=&amp;lt;string&amp;gt;&lt;br /&gt;
   xxx_submerge=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
   xxx_x=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   xxx_y=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   xxx_directional_x=&amp;lt;dev1.9,progressive int&amp;gt;&lt;br /&gt;
   xxx_directional_y=&amp;lt;dev1.9,progressive int&amp;gt;&lt;br /&gt;
   xxx_layer=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 [/animation]&lt;br /&gt;
&lt;br /&gt;
==== Parameter handling ====&lt;br /&gt;
All drawing related parameters in '''[animation]''' can be matched with a corresponding parameter in  a '''[frame]''' block (or a '''[xxx_frame]''' block) The value provided in the animation will be used if no value is provided in the frame. &lt;br /&gt;
&lt;br /&gt;
The point of these two level of parameters is to easily be able to specify a parameter at the animation level and override it for a special case of frame.&lt;br /&gt;
&lt;br /&gt;
== How animations are chosen ==&lt;br /&gt;
Within a unit decription block there are multiple animations. Each animation is meant to be played in a very special set of circumstances. We will discuss here how to tell the animation engine when a given animation should be played. &lt;br /&gt;
&lt;br /&gt;
Let's take an example. Suppose we have a unit which has the skirmisher ability. We have the folowing movement animations :&lt;br /&gt;
* a normal walking animation&lt;br /&gt;
* a swimming animation when the unit is in water&lt;br /&gt;
* a tiptioeing animation when moving next to an ennemy unit&lt;br /&gt;
&lt;br /&gt;
Ok. most of the time it's easy to guess what animation should be. However if you are both in water and next to an ennemy unit, the animation to play is not obvious.&lt;br /&gt;
&lt;br /&gt;
To solve that question, each animation has a number of filtering criterias. The engine follow the following rules to select an animation&lt;br /&gt;
* Start with all animations&lt;br /&gt;
* Drop all animations with a criteria that fails on the current situation&lt;br /&gt;
* Take the animations that have the most maching criterias&lt;br /&gt;
* If there are more than one animation remaining, take an animation randomly&lt;br /&gt;
* If all animations have been droped, the engine will provide a smart default.&lt;br /&gt;
    &lt;br /&gt;
here is a pseudo-code explaination of this algorithm:&lt;br /&gt;
&lt;br /&gt;
 foreach animation&lt;br /&gt;
    animation_score = 0&lt;br /&gt;
    foreach filter-criteria&lt;br /&gt;
      if &amp;lt;criteria-fails&amp;gt; &lt;br /&gt;
          animation_score = -1;&lt;br /&gt;
          break;&lt;br /&gt;
      elsif &amp;lt;criteria-matches&amp;gt; &lt;br /&gt;
          animation_score++&lt;br /&gt;
    endfor&lt;br /&gt;
    if animation_score &amp;gt; max_score&lt;br /&gt;
        &amp;lt;empty animation list&amp;gt;&lt;br /&gt;
        max_score = animation_score;&lt;br /&gt;
        push(animation,animation_list);&lt;br /&gt;
    elsif animation_score = max_score&lt;br /&gt;
        push(animation,animation_list);&lt;br /&gt;
 endfor&lt;br /&gt;
 &amp;lt;choose an animation randomly from animation_list&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
Note that all animations don't have all the filters...&lt;br /&gt;
&lt;br /&gt;
so, if we have a unit with&lt;br /&gt;
# an animation for water terrain&lt;br /&gt;
# an animation for SE on grassland&lt;br /&gt;
# an animation with no criteria&lt;br /&gt;
# an animation for N,NE,NW,S,SW,SE&lt;br /&gt;
# an animation for NW&lt;br /&gt;
&lt;br /&gt;
* 3. will never be taken, because 4. will always trump it&lt;br /&gt;
* on water going NW, it can be 1. 4. 5.&lt;br /&gt;
* on water, any direction but NW, it will be 1. or 4.&lt;br /&gt;
* on SE grassland it will be 2.&lt;br /&gt;
* on other grasslands, it will be 4. (4. or 5. if NW)&lt;br /&gt;
&lt;br /&gt;
=== Generic animation filters available for all animations ===&lt;br /&gt;
* '''apply_to''': a list of comma separated keywords describing what event should trigger the animation (movement, attack...) the complete list is given below&lt;br /&gt;
* '''value''': a list of comma separated integer, the meaning depends on the triggering event. the meaning is given with the list of event&lt;br /&gt;
* '''value_second''': a list of comma separated integer, the meaning depends on the triggering event. the meaning is given with the list of event&lt;br /&gt;
* '''terrain''': a list of comma separated terrain letters, the animation will only be used on these terrains.  See [[FilterWML]].  this has been replaced by '''terrain_type'''&lt;br /&gt;
* '''terrain_type''': a list of comma separated terrain letters, the animation will only be used on these terrains.  See [[FilterWML]].&lt;br /&gt;
* '''[filter]''': this will filter using a standard unit filter on the animated unit. Note that matching all criterias in the filter will only earn you one point for animation selection, but that you can have multiple '''[filter]''' blocks in an animation.&lt;br /&gt;
* '''[filter_second]''': this will filter using a standard unit filter on the unit in the hex faced. Note that matching all criteria in the filter will only earn you one point for animation selection, but that you can have multiple '''[filter_second]''' blocks in an animation. Also note that if the faced hex is empty, the whole filter will fail.&lt;br /&gt;
* '''direction''': a list of directions (n,ne,se,s,sw,nw), the animation will only be used when acting or moving in this direction (the attack direction for attack animations, moving direction for movement animations, direction of lead unit for leading animations, and so on).&lt;br /&gt;
* '''frequency''': this integer value allows to easily tweak the matching frequency of animations. The filter will fail n-1 times out of n, randomly. Note that unlike every other filter, matching this filter won't give an extra point.&lt;br /&gt;
* '''[filter_attack]''': a standard attack filter to match on the attacker's attack. See  [[FilterWML]]. &lt;br /&gt;
* '''[filter_second_attack]''': a standard attack filter to match on the defender's attack. See [[FilterWML]]. Also note that if the defender doesn't have any weapon to retaliate with, this filter will always fail. &lt;br /&gt;
* '''hits''': filters attack animations based on whether the attack hits, misses or kills. Accepts a list of the following:&lt;br /&gt;
** '''hit''': the attack hits, defender survives.&lt;br /&gt;
** '''no''' or '''miss''': the attack misses.&lt;br /&gt;
** '''kill''': the attack hits, defender dies.&lt;br /&gt;
** '''yes''': is an alias of '''hit,kill'''.&lt;br /&gt;
* '''swing''': a list of numbers representing the swing numbers this animation should match (numbered from 1). this has been replaced by value_second&lt;br /&gt;
* '''base_score''': {{DevFeature1.9}} : a number that will always be added to the score. Use with caution&lt;br /&gt;
&lt;br /&gt;
=== Events triggering animations and default animations ===&lt;br /&gt;
==== standing ====&lt;br /&gt;
This animation is triggered whenever any other animation is finished, and is played in loop until another animation is triggered&lt;br /&gt;
&lt;br /&gt;
this is the default &amp;quot;standing image&amp;quot; for the unit&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no standing animation is set a single frame animation based on the enclosing unit's '''image=''' field is used&lt;br /&gt;
==== selected ====&lt;br /&gt;
This animation is triggered whenever the unit is selected&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''blend_with=&amp;quot;0.0~0.3:100,0.3~0.0:200&amp;quot; blend_color=255,255,255''&lt;br /&gt;
==== recruited ====&lt;br /&gt;
This animation is triggered whenever the unit is recruited or recalled&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''highlight=0~1:600''&lt;br /&gt;
&lt;br /&gt;
==== recruiting ====&lt;br /&gt;
&lt;br /&gt;
This animation is triggered for the leader when a unit is recruited or recalled&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
no default animation is needed&lt;br /&gt;
&lt;br /&gt;
note that is not triggered for WML triggered animations&lt;br /&gt;
&lt;br /&gt;
==== levelin ====&lt;br /&gt;
This animation is triggered whenever the unit levels, before the unit is replaced by the new unit&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''blend_with=&amp;quot;1~0:600&amp;quot; blend_color=255,255,255''&lt;br /&gt;
==== levelout ====&lt;br /&gt;
This animation is triggered whenever the unit levels, after the unit is replaced by the new unit&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''blend_with=&amp;quot;0~1:600&amp;quot; blend_color=255,255,255''&lt;br /&gt;
==== movement ====&lt;br /&gt;
This animation is used whenever a unit moves. There are multiple things to consider when dealing with movement animation&lt;br /&gt;
* unit stay ''exactly'' 150ms in each hex. so you typically want to have an offset of ''0~1:150,0~1:150,0~1:150,0~1:150,0~1:150'' or something similar&lt;br /&gt;
* when a unit enters a hex, the current anim is tested again.&lt;br /&gt;
** if the current animation is still valid (i.e it passes all its filter) it is kept, whatever the final score is&lt;br /&gt;
** if it fails, a new movement anim is searched&lt;br /&gt;
&lt;br /&gt;
''value='' contains the number of steps already taken&lt;br /&gt;
&lt;br /&gt;
''value_second='' contains the number of steps left&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''offset=&amp;quot;0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
==== pre_movement ====&lt;br /&gt;
This animation is used before any unit movement&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0 &lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0 &lt;br /&gt;
&lt;br /&gt;
==== post_movement ====&lt;br /&gt;
This animation is used after any unit movement&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0 &lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
==== pre_teleport ====&lt;br /&gt;
This animation is triggered whenever the unit teleports, but before it has moved to the target hex&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''blend_with=&amp;quot;1~0:150&amp;quot; blend_color=255,255,255''&lt;br /&gt;
==== post_teleport ====&lt;br /&gt;
This animation is triggered whenever the unit teleports, but after it has moved to the target hex&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''blend_with=&amp;quot;0~1:150&amp;quot; blend_color=255,255,255''&lt;br /&gt;
==== healing ====&lt;br /&gt;
This animation is triggered when the unit has healing powers and uses them&lt;br /&gt;
&lt;br /&gt;
''value='' is the number of points healed&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
==== healed ====&lt;br /&gt;
This animation is triggered whenever the unit is healed for any reason&lt;br /&gt;
&lt;br /&gt;
''value='' is the number of points healed&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''blend_with=&amp;quot;0:30,0.5:30,0:30,0.5:30,0:30,0.5:30,0:30,0.5:30,0:30&amp;quot; blend_color=255,255,255''&lt;br /&gt;
and plays the sound ''heal.wav''&lt;br /&gt;
==== poisoned ====&lt;br /&gt;
This animation is triggered whenever the unit suffers poison dammage&lt;br /&gt;
&lt;br /&gt;
''value='' is the number of points lost&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''blend_with=&amp;quot;0:30,0.5:30,0:30,0.5:30,0:30,0.5:30,0:30,0.5:30,0:30&amp;quot; blend_color=0,255,0''&lt;br /&gt;
and plays the sound 'poison.ogg''&lt;br /&gt;
==== defend ====&lt;br /&gt;
This animation is triggered during a strike, of the unit receiving the blow&lt;br /&gt;
&lt;br /&gt;
''value='' is the number of point lost, if any&lt;br /&gt;
&lt;br /&gt;
''value_second='' is the number of the swing, starting from 1&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
==== attack ====&lt;br /&gt;
This animation is triggered during a strike, of the unit giving the blow&lt;br /&gt;
&lt;br /&gt;
''value='' is the number of damage dealt, if any&lt;br /&gt;
&lt;br /&gt;
''value_second='' is the number of the swing, starting from 1&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''offset=&amp;quot;0~0.6:150,0.6~0:150&amp;quot;'' for melee attacks&lt;br /&gt;
No default is provided for range attacks&lt;br /&gt;
==== leading ====&lt;br /&gt;
This animation is triggered for units with the leading special ability, when the unit they are leading is attacking&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is the number of the swing, starting from 1&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== resistance ====&lt;br /&gt;
This animation is triggered for units with the resistance special ability affecting neighbouring fights, when the unit they are helping is defending&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is the number of the swing, starting from 1&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
&lt;br /&gt;
==== death ====&lt;br /&gt;
This animation is triggered when a unit die.&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''highlight=1~0:600'' and plays the sound in ''die_sound='' of the enclosing unit&lt;br /&gt;
==== victory ====&lt;br /&gt;
This animation is triggered when a unit finishes a fight by killing the other unit&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
==== idling ====&lt;br /&gt;
This animation is called when the unit has been using its standing animation for a random duration.&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
&lt;br /&gt;
==== draw_weapon ====&lt;br /&gt;
This animation is played before a fight&lt;br /&gt;
&lt;br /&gt;
''hit='' is set to HIT for the attacker and MISS for the defender&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
&lt;br /&gt;
==== sheath_weapon ====&lt;br /&gt;
This animation is played after a fight simultaneously for all surviving units&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
&lt;br /&gt;
==== default ====&lt;br /&gt;
&lt;br /&gt;
This animation is never triggered, but is used as a base to create new animations&lt;br /&gt;
&lt;br /&gt;
''value='' is used depending of the type of animation it replaces&lt;br /&gt;
&lt;br /&gt;
''value_second='' is used depending of the type of animation it replaces&lt;br /&gt;
&lt;br /&gt;
A single animation made of the base frame is provided by the engine if no default animation is available&lt;br /&gt;
&lt;br /&gt;
==== extra animations ====&lt;br /&gt;
Other values are never called by the engine. However they can be triggered by WML events allowing custom animations.&lt;br /&gt;
&lt;br /&gt;
Note that WML events can also trigger standard animations.&lt;br /&gt;
''value='' is set from the WML event&lt;br /&gt;
&lt;br /&gt;
''value_second='' is set from the WML event&lt;br /&gt;
&lt;br /&gt;
== Shortcuts, tricks and quirks ==&lt;br /&gt;
&lt;br /&gt;
=== ''[if]'' and ''[else]'' ===&lt;br /&gt;
&lt;br /&gt;
Often, you need to do very slight variations in an animation (like a different sound depending on whether the unit hits or misses its attack), the '''[if]''' and '''[else]''' tags are meant to help you do that. &lt;br /&gt;
    &lt;br /&gt;
Using these in an animation is equivalent to having multiple animations, one with the '''[if]''' block and one with each of the ''[else]'' blocks. Any filtering flags in these blocks will replace the toplevel filters. You can have multiple '''[if]''' blocks in an animation, but you can't nest an '''[if]''' inside another. These should be written directly inside the '''[animation]''' block. The following example would make the '''[frame]''' inside the '''[if]''' be played when the attack misses, and the '''[frame]''' inside the '''[else]''' be played when the attack hits (producing a different sound):&lt;br /&gt;
&lt;br /&gt;
    [if]&lt;br /&gt;
        hits=no&lt;br /&gt;
        [frame]&lt;br /&gt;
            begin=-100&lt;br /&gt;
            end=100&lt;br /&gt;
            image=&amp;quot;units/dwarves/lord-attack.png&amp;quot;&lt;br /&gt;
            sound={SOUND_LIST:MISS}&lt;br /&gt;
        [/frame]&lt;br /&gt;
    [/if]&lt;br /&gt;
    [else]&lt;br /&gt;
        hits=yes&lt;br /&gt;
        [frame]&lt;br /&gt;
            begin=-100&lt;br /&gt;
            end=100&lt;br /&gt;
            image=&amp;quot;units/dwarves/lord-attack.png&amp;quot;&lt;br /&gt;
            sound=axe.ogg&lt;br /&gt;
        [/frame]&lt;br /&gt;
    [/else]&lt;br /&gt;
&lt;br /&gt;
note that this is very close to preprocessing and should be considered as such, especially with regard to scoring and animation selection&lt;br /&gt;
&lt;br /&gt;
=== Simplified animation blocks ===&lt;br /&gt;
To simplify the most common animation cases, you can use different blocks instead of the generic '''[animation]''' block. These are also here for backward compatibility, but are not deprecated and fully supported&lt;br /&gt;
&lt;br /&gt;
some of these use extra tags which are translated in the normal ''value='' tag&lt;br /&gt;
&lt;br /&gt;
some of these define '''[xxx_frame]''' blocks where the frame prefix starts with an underscore. This is not allowed in normal WML (prefix starting with underscore is reserved for the engine internal use). It is here for clarity purpose&lt;br /&gt;
&lt;br /&gt;
* '''[leading_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=leading&lt;br /&gt;
* '''[recruit_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=recruited&lt;br /&gt;
* '''[recruiting_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=recruiting&lt;br /&gt;
* '''[standing_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=standing,default&lt;br /&gt;
note for 1.4 :''default'' doesn't exist in 1.4, but the semantic is the same.&lt;br /&gt;
&lt;br /&gt;
i.e: the animation will be used to build default animations&lt;br /&gt;
* '''[idle_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=idling&lt;br /&gt;
* '''[levelin_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=levelin&lt;br /&gt;
* '''[levelout_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=levelout&lt;br /&gt;
* '''[healing_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=healing&lt;br /&gt;
 value=&amp;lt;damage= value&amp;gt;&lt;br /&gt;
* '''[healed_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=healed&lt;br /&gt;
 value=&amp;lt;healing= value&amp;gt;&lt;br /&gt;
 [_healed_sound_frame]&lt;br /&gt;
    sound=heal.wav&lt;br /&gt;
 [/_healed_sound_frame]&lt;br /&gt;
* '''[poison_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=poisoned&lt;br /&gt;
 value=&amp;lt;damage= value&amp;gt;&lt;br /&gt;
 [_poison_sound_frame]&lt;br /&gt;
    sound=poison.ogg&lt;br /&gt;
 [/_poison_sound_frame]&lt;br /&gt;
* '''[movement_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=movement&lt;br /&gt;
 offset=&amp;quot;0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150&amp;quot;&lt;br /&gt;
* '''[pre_movement_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=pre_movement&lt;br /&gt;
* '''[post_movement_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=post_movement&lt;br /&gt;
* '''[draw_weapon_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=draw_weapon&lt;br /&gt;
* '''[sheath_weapon_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=sheath_weapon_movement&lt;br /&gt;
* '''[defend]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=defend&lt;br /&gt;
 value=&amp;lt;damage= value&amp;gt;&lt;br /&gt;
 &amp;lt;WML content&amp;gt;&lt;br /&gt;
 [frame]&lt;br /&gt;
    blend_with=255,0,0&lt;br /&gt;
    blend_ratio=&amp;quot;0.5:50,0.0:50&amp;quot;&lt;br /&gt;
 [/frame]&lt;br /&gt;
&lt;br /&gt;
there are some subtil change compared to what is described above to avoid the red flash when value=0, but it should work as expected as far as WML author are concerned&lt;br /&gt;
 &lt;br /&gt;
* '''[attack_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
if the animation contains a missile frame&lt;br /&gt;
&lt;br /&gt;
 apply_to=attack&lt;br /&gt;
 missile_offset=&amp;quot;0~0.8&amp;quot;&lt;br /&gt;
&lt;br /&gt;
else&lt;br /&gt;
&lt;br /&gt;
 apply_to=attack&lt;br /&gt;
 offset=&amp;quot;0~0.6,0.6~0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* '''[death]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=death&lt;br /&gt;
 [_death_sound_frame]&lt;br /&gt;
    sound=&amp;lt;die_sound= of the enclosing [unit] tag&amp;gt;&lt;br /&gt;
 [/_death_sound_frame]&lt;br /&gt;
* '''[victory_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=victory&lt;br /&gt;
* '''[extra_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=&amp;lt;flag= value of the anim&amp;gt;&lt;br /&gt;
* '''[teleport_anim]''' will be cut into two at the clock-time 0&lt;br /&gt;
everything before zero becomes an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=pre_teleport&lt;br /&gt;
everything after zero becomes an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=post_teleport&lt;br /&gt;
&lt;br /&gt;
== Layering ==&lt;br /&gt;
The ''layer'' progressive parameter allows the animation writer to choose in what order the animation should be drawn.&lt;br /&gt;
&lt;br /&gt;
this value must be between 0 and 100&lt;br /&gt;
&lt;br /&gt;
* the back of haloes is drawn with a value of 10&lt;br /&gt;
* when unspecified, a animation is drawn with a value of 40&lt;br /&gt;
* terrain elements that are supposed to go in front of units (castles) are drawn with a value of 50&lt;br /&gt;
* orbs and status bars are drawn on layer 80&lt;br /&gt;
* when unspecified missile frames are drawn on layer 90&lt;br /&gt;
&lt;br /&gt;
by changing these values, it is easy to have the unit display the way you want&lt;br /&gt;
&lt;br /&gt;
== Optimization ==&lt;br /&gt;
&lt;br /&gt;
there is a special flag that goes into the animation block (not the frame) &lt;br /&gt;
&lt;br /&gt;
* ''offscreen'' a boolean saying if the unit's animation should be played when the unit is offscreen. You want the animation to play offscreen if the animation contains some usefull sound effects.This attribute defaults to true (play offscreen) except for standing and idle animations where it defaults to false&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[UnitTypeWML]]&lt;br /&gt;
* [[ReferenceWML]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: WML Reference]]&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=AnimationWML&amp;diff=38783</id>
		<title>AnimationWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=AnimationWML&amp;diff=38783"/>
		<updated>2010-10-29T15:14:01Z</updated>

		<summary type="html">&lt;p&gt;Boucman: /* Syntax summary */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WML Tags}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This page covers unit animations. At any point in game, units are playing an animation. Even when the unit is standing, it is actually playing a single frame animation.&lt;br /&gt;
&lt;br /&gt;
This page will deal with the two problems of animations&lt;br /&gt;
* How are animations Chosen&lt;br /&gt;
* What exactly is drawn&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How animations are drawn ==&lt;br /&gt;
=== Animations ===&lt;br /&gt;
Any unit has a huge set of animations to choose from. Animations are WML blocks in the unit type, enclosed in either the generic type '''[animation]''' or some more specific tags such as '''[attack_anim]''' '''[idle_anim]''' and the like. An animation is what a unit displays when a given event is triggered, and a certain set of conditions are met such as&lt;br /&gt;
* unit is attacking&lt;br /&gt;
* unit is idling&lt;br /&gt;
* unit is attacking (event) and uses a melee weapon (condition)&lt;br /&gt;
* unit is attacking (event) and uses a melee weapon (condition) and opponent can't retaliate (condition)&lt;br /&gt;
&lt;br /&gt;
events and conditions are described entirely in the [animation] block, and will be discussed in the animation choice section.&lt;br /&gt;
&lt;br /&gt;
=== Frames ===&lt;br /&gt;
    &lt;br /&gt;
An animation is cut in frames. Frames are WML blocks that are contained either in '''[frame]''' WML blocks or in generic '''[xxx_frame]''' block. (the xxx part can be any string not starting with an underscore) the xxx part in the frame name is called the frame prefix. frames of the type '''[frame]''' are said to have an empty prefix&lt;br /&gt;
&lt;br /&gt;
A frame typically describes an image, where an how to render it. It can contain such things as&lt;br /&gt;
* the image to display&lt;br /&gt;
* how transparent should that image be&lt;br /&gt;
* where to draw that image.&lt;br /&gt;
&lt;br /&gt;
At any given time, an animation will display one frame for each frame prefix it can find. I.e if your animation has both '''[frame]''' and '''[missile_frame]''' blocks, both will be displayed at the same time&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The frame with the empty prefix is special in many way. It is assumed to contain the image representing the unit itself, and as such the engine will heavily temper with it in multiple ways, such as providing a default image if none is available, or forcing the image to be green when the unit is poisoned&lt;br /&gt;
&lt;br /&gt;
=== Timing, Clock, Multiple animations ===&lt;br /&gt;
When an animation is played it has an internal clock that is run. The step of this clock is the milisecond, and each frame is played for a given duration. Each animation also has a starting time which tells the animation engine at what value the animation clock should start&lt;br /&gt;
&lt;br /&gt;
This starting time is very important when multiple animations from different units are played synchronously  Typically a fight involves a unit playing its defense animation while the opponent plays it's attack animation (and a third might play its leading animation, too). In that case all animations have a common clock, and are played concurrently.&lt;br /&gt;
&lt;br /&gt;
The convention is that the &amp;quot;important time&amp;quot; (usually the time of the hit) is at time 0. everything before should be at negative time, everything after at positive time. This is a WML convention that is not enforced by the engine&lt;br /&gt;
&lt;br /&gt;
In that case, it is very important that these animations (which can have different lengths) be synchronized. Fight animations are synchronized around the point of impact, so they all reach time 0 when the attack lands (or misses). This is accomplished through the use of the '''start_time''' key of the '''[animation]''' tag.&lt;br /&gt;
&lt;br /&gt;
Just like the '''[frame]''' tag can have a prefix, so can the '''start_time''' key. A '''start_time''' key without prefix will affect a '''[frame]''' tag without prefix, while a '''start_time''' key with a prefix will affect a '''[frame]''' tag with the same prefix.&lt;br /&gt;
&lt;br /&gt;
==== Example Syntax ====&lt;br /&gt;
    [attack_anim]&lt;br /&gt;
        [filter_attack]&lt;br /&gt;
            name=bow&lt;br /&gt;
        [/filter_attack]&lt;br /&gt;
        '''start_time'''=-350&lt;br /&gt;
        '''missile_start_time'''=-150&lt;br /&gt;
        [missile_frame]&lt;br /&gt;
            duration=150&lt;br /&gt;
            image=&amp;quot;projectiles/missile-n.png&amp;quot;&lt;br /&gt;
            image_diagonal=&amp;quot;projectiles/missile-ne.png&amp;quot;&lt;br /&gt;
        [/missile_frame]&lt;br /&gt;
        [if]&lt;br /&gt;
            hits=yes&lt;br /&gt;
            [frame]&lt;br /&gt;
                duration=350&lt;br /&gt;
                sound=bow.ogg&lt;br /&gt;
            [/frame]&lt;br /&gt;
        [/if]&lt;br /&gt;
        [else]&lt;br /&gt;
            hits=no&lt;br /&gt;
            [frame]&lt;br /&gt;
                duration=350&lt;br /&gt;
                sound=bow-miss.ogg&lt;br /&gt;
            [/frame]&lt;br /&gt;
        [/else]&lt;br /&gt;
    [/attack_anim]&lt;br /&gt;
&lt;br /&gt;
=== The content of a frame ===&lt;br /&gt;
==== Syntax summary ====&lt;br /&gt;
 [frame]&lt;br /&gt;
    duration=&amp;lt;integer&amp;gt;&lt;br /&gt;
    begin=&amp;lt;deprecated,integer&amp;gt;&lt;br /&gt;
    end=&amp;lt;deprecated,integer&amp;gt;&lt;br /&gt;
    image=&amp;lt;string&amp;gt;&lt;br /&gt;
    image_diagonal=&amp;lt;string&amp;gt;&lt;br /&gt;
    image_mod=&amp;lt;string&amp;gt;&lt;br /&gt;
    sound=&amp;lt;string&amp;gt;&lt;br /&gt;
    halo=&amp;lt;progressive string&amp;gt;&lt;br /&gt;
    halo_x=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
    halo_y=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
    halo_mod=&amp;lt;string&amp;gt;&lt;br /&gt;
    alpha=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
    offset=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
    blend_color=&amp;lt; red, green, blue &amp;gt;&lt;br /&gt;
    blend_ratio=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
    text=&amp;lt;string&amp;gt;&lt;br /&gt;
    text_color=&amp;lt; red, green, blue &amp;gt;&lt;br /&gt;
    submerge=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
    x=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
    y=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
    directional_x=&amp;lt;dev feature 1.9,progressive int&amp;gt;&lt;br /&gt;
    directional_y=&amp;lt;dev feature 1.9,progressive int&amp;gt;&lt;br /&gt;
    layer=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
    auto_hflip=&amp;lt;dev feature 1.9, boolean&amp;gt;&lt;br /&gt;
    auto_vflip=&amp;lt;dev feature 1.9, boolean&amp;gt;&lt;br /&gt;
    primary=&amp;lt;dev feature 1.9, boolean&amp;gt;&lt;br /&gt;
 [/frame]&lt;br /&gt;
&lt;br /&gt;
==== Progressive parameters ====&lt;br /&gt;
&lt;br /&gt;
Some parameters above are marked as ''progressive'' This means that you can specify that during the time the frame is displayed, the parameter should smoothly slide from one value to an other.&lt;br /&gt;
&lt;br /&gt;
A typical example would be a unit progressively fading out, becoming transparent&lt;br /&gt;
&lt;br /&gt;
To do that, you could use:&lt;br /&gt;
&lt;br /&gt;
 alpha=1~0&lt;br /&gt;
&lt;br /&gt;
To make a frame, which is 900ms long, slide to transparent for 300ms, stay transparent for another 300ms and finally fade back to normal for 300ms, use:&lt;br /&gt;
&lt;br /&gt;
 alpha=1~0:300,0:300,0~1:300&lt;br /&gt;
&lt;br /&gt;
you could also specify it like that&lt;br /&gt;
&lt;br /&gt;
 alpha=1~0,0,0~1&lt;br /&gt;
&lt;br /&gt;
when a timing is missing, the engine will do its best to fill in in a fair way. &lt;br /&gt;
&lt;br /&gt;
a progressive string has a similar syntax&lt;br /&gt;
&lt;br /&gt;
 halo=halo1.png:300,halo2.png:300,halo2.png:300&lt;br /&gt;
&lt;br /&gt;
==== Field Description ====&lt;br /&gt;
&lt;br /&gt;
** '''begin''': (deprecated) will be replaced by '''duration= &amp;lt;end - begin &amp;gt;'''&lt;br /&gt;
** '''end''': (deprecated) see '''begin''' and also [[AnimationWML#Timing.2C_Clock.2C_Multiple_animations|Timing, Clock, Multiple animations]] section for coverage of '''start_time''' which combines with '''duration''' to replace '''begin=''' '''end='''.&lt;br /&gt;
** '''duration''': how long the frame should be displayed. Use instead of '''begin=''' and '''end='''.&lt;br /&gt;
** '''image''': the image to display during the frame.&lt;br /&gt;
** '''image_diagonal''': the image to display when the attack occurs diagonally (directions ne,se,sw,nw).&lt;br /&gt;
** '''image_mod''': a string modifications (see [[ImagePathFunctionWML]] ) that will be applied to all images&lt;br /&gt;
** '''sound''': the sound to play when the frame begins. Can be a comma-separated list of sounds, in which case one of them is chosen randomly every time.&lt;br /&gt;
** '''halo''': the halo to display at the time.&lt;br /&gt;
** '''halo_x''': the position the halo is displayed in pixel relative to the unit's center.&lt;br /&gt;
** '''halo_y''': the position the halo is displayed in pixel relative to the unit's center.&lt;br /&gt;
** '''halo_mod''': a string modifications (see [[ImagePathFunctionWML]] ) that will be applied to all haloes&lt;br /&gt;
** '''alpha''': transparency level to apply to the frame. This is a floating point progressive parameter ranging from 0.0 to 1.0.&lt;br /&gt;
** '''offset''': the position of the image relative to the hex the unit is facing, 0.0 will display the unit in the center of the hex, 1.0 in the center of the faced hex, -1.0 at the center of the hex behind you. This is a progressive parameter.&lt;br /&gt;
** '''blend_color''': a comma separated list of numbers representing a color in RGB (0-255) this color will be mixed to the frame to give it a tint.&lt;br /&gt;
** '''blend_ratio''': this is a progressive parameter ranging from 0 to 1: 0 means no tint, 1 means target color only.&lt;br /&gt;
** '''text''': if specified, floats a label with the given text above the unit (identical to the floating damage and healing numbers).&lt;br /&gt;
** '''text_color''': the color of the above floating label.&lt;br /&gt;
** '''submerge''': the part of the unit that should drawn with 50% opacity (for units in water)&lt;br /&gt;
** '''x''': x offset applied to the frame&lt;br /&gt;
** '''y''': y offset applied to the frame&lt;br /&gt;
** '''directional_x''': x offset applied to the frame in the direction the unit is facing&lt;br /&gt;
** '''directional_y''': y offset applied to the frame in the direction the unit is facing&lt;br /&gt;
** '''layer''': layer used to draw the frame, see discussion bellow&lt;br /&gt;
&lt;br /&gt;
=== Drawing related animation content ===&lt;br /&gt;
==== Syntax summary ====&lt;br /&gt;
 [animation]&lt;br /&gt;
   &amp;lt;animation choice related content&amp;gt;&lt;br /&gt;
   [frame]&lt;br /&gt;
     &amp;lt;frame content&amp;gt;&lt;br /&gt;
   [/frame]&lt;br /&gt;
   [frame]&lt;br /&gt;
     &amp;lt;frame content&amp;gt;&lt;br /&gt;
   [/frame]&lt;br /&gt;
   start_time=&amp;lt;integer&amp;gt;&lt;br /&gt;
   offset=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
   image_mod=&amp;lt;string&amp;gt;&lt;br /&gt;
   blend_with=&amp;lt;r,g,b&amp;gt;&lt;br /&gt;
   blend_ratio=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
   halo=&amp;lt;progressive_string&amp;gt;&lt;br /&gt;
   halo_x=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   halo_y=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   halo_mod=&amp;lt;string&amp;gt;&lt;br /&gt;
   submerge=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
   x=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   y=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   directional_x=&amp;lt;dev1.9,progressive int&amp;gt;&lt;br /&gt;
   directional_y=&amp;lt;dev1.9,progressive int&amp;gt;&lt;br /&gt;
   layer=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   [xxx_frame]&lt;br /&gt;
     &amp;lt;frame content&amp;gt;&lt;br /&gt;
   [/xxx_frame]&lt;br /&gt;
   xxx_start_time=&amp;lt;integer&amp;gt;&lt;br /&gt;
   xxx_image_mod=&amp;lt;string&amp;gt;&lt;br /&gt;
   xxx_offset=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
   xxx_blend_with=&amp;lt;r,g,b&amp;gt;&lt;br /&gt;
   xxx_blend_ratio=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
   xxx_halo=&amp;lt;progressive_string&amp;gt;&lt;br /&gt;
   xxx_halo_x=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   xxx_halo_y=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   xxx_halo_mod=&amp;lt;string&amp;gt;&lt;br /&gt;
   xxx_submerge=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
   xxx_x=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   xxx_y=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   xxx_directional_x=&amp;lt;dev1.9,progressive int&amp;gt;&lt;br /&gt;
   xxx_directional_y=&amp;lt;dev1.9,progressive int&amp;gt;&lt;br /&gt;
   xxx_layer=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 [/animation]&lt;br /&gt;
&lt;br /&gt;
==== Parameter handling ====&lt;br /&gt;
All drawing related parameters in '''[animation]''' can be matched with a corresponding parameter in  a '''[frame]''' block (or a '''[xxx_frame]''' block) The value provided in the animation will be used if no value is provided in the frame. &lt;br /&gt;
&lt;br /&gt;
The point of these two level of parameters is to easily be able to specify a parameter at the animation level and override it for a special case of frame.&lt;br /&gt;
&lt;br /&gt;
== How animations are chosen ==&lt;br /&gt;
Within a unit decription block there are multiple animations. Each animation is meant to be played in a very special set of circumstances. We will discuss here how to tell the animation engine when a given animation should be played. &lt;br /&gt;
&lt;br /&gt;
Let's take an example. Suppose we have a unit which has the skirmisher ability. We have the folowing movement animations :&lt;br /&gt;
* a normal walking animation&lt;br /&gt;
* a swimming animation when the unit is in water&lt;br /&gt;
* a tiptioeing animation when moving next to an ennemy unit&lt;br /&gt;
&lt;br /&gt;
Ok. most of the time it's easy to guess what animation should be. However if you are both in water and next to an ennemy unit, the animation to play is not obvious.&lt;br /&gt;
&lt;br /&gt;
To solve that question, each animation has a number of filtering criterias. The engine follow the following rules to select an animation&lt;br /&gt;
* Start with all animations&lt;br /&gt;
* Drop all animations with a criteria that fails on the current situation&lt;br /&gt;
* Take the animations that have the most maching criterias&lt;br /&gt;
* If there are more than one animation remaining, take an animation randomly&lt;br /&gt;
* If all animations have been droped, the engine will provide a smart default.&lt;br /&gt;
    &lt;br /&gt;
here is a pseudo-code explaination of this algorithm:&lt;br /&gt;
&lt;br /&gt;
 foreach animation&lt;br /&gt;
    animation_score = 0&lt;br /&gt;
    foreach filter-criteria&lt;br /&gt;
      if &amp;lt;criteria-fails&amp;gt; &lt;br /&gt;
          animation_score = -1;&lt;br /&gt;
          break;&lt;br /&gt;
      elsif &amp;lt;criteria-matches&amp;gt; &lt;br /&gt;
          animation_score++&lt;br /&gt;
    endfor&lt;br /&gt;
    if animation_score &amp;gt; max_score&lt;br /&gt;
        &amp;lt;empty animation list&amp;gt;&lt;br /&gt;
        max_score = animation_score;&lt;br /&gt;
        push(animation,animation_list);&lt;br /&gt;
    elsif animation_score = max_score&lt;br /&gt;
        push(animation,animation_list);&lt;br /&gt;
 endfor&lt;br /&gt;
 &amp;lt;choose an animation randomly from animation_list&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
Note that all animations don't have all the filters...&lt;br /&gt;
&lt;br /&gt;
so, if we have a unit with&lt;br /&gt;
# an animation for water terrain&lt;br /&gt;
# an animation for SE on grassland&lt;br /&gt;
# an animation with no criteria&lt;br /&gt;
# an animation for N,NE,NW,S,SW,SE&lt;br /&gt;
# an animation for NW&lt;br /&gt;
&lt;br /&gt;
* 3. will never be taken, because 4. will always trump it&lt;br /&gt;
* on water going NW, it can be 1. 4. 5.&lt;br /&gt;
* on water, any direction but NW, it will be 1. or 4.&lt;br /&gt;
* on SE grassland it will be 2.&lt;br /&gt;
* on other grasslands, it will be 4. (4. or 5. if NW)&lt;br /&gt;
&lt;br /&gt;
=== Generic animation filters available for all animations ===&lt;br /&gt;
* '''apply_to''': a list of comma separated keywords describing what event should trigger the animation (movement, attack...) the complete list is given below&lt;br /&gt;
* '''value''': a list of comma separated integer, the meaning depends on the triggering event. the meaning is given with the list of event&lt;br /&gt;
* '''value_second''': a list of comma separated integer, the meaning depends on the triggering event. the meaning is given with the list of event&lt;br /&gt;
* '''terrain''': a list of comma separated terrain letters, the animation will only be used on these terrains.  See [[FilterWML]].  this has been replaced by '''terrain_type'''&lt;br /&gt;
* '''terrain_type''': a list of comma separated terrain letters, the animation will only be used on these terrains.  See [[FilterWML]].&lt;br /&gt;
* '''[filter]''': this will filter using a standard unit filter on the animated unit. Note that matching all criterias in the filter will only earn you one point for animation selection, but that you can have multiple '''[filter]''' blocks in an animation.&lt;br /&gt;
* '''[filter_second]''': this will filter using a standard unit filter on the unit in the hex faced. Note that matching all criteria in the filter will only earn you one point for animation selection, but that you can have multiple '''[filter_second]''' blocks in an animation. Also note that if the faced hex is empty, the whole filter will fail.&lt;br /&gt;
* '''direction''': a list of directions (n,ne,se,s,sw,nw), the animation will only be used when acting or moving in this direction (the attack direction for attack animations, moving direction for movement animations, direction of lead unit for leading animations, and so on).&lt;br /&gt;
* '''frequency''': this integer value allows to easily tweak the matching frequency of animations. The filter will fail n-1 times out of n, randomly. Note that unlike every other filter, matching this filter won't give an extra point.&lt;br /&gt;
* '''[filter_attack]''': a standard attack filter to match on the attacker's attack. See  [[FilterWML]]. &lt;br /&gt;
* '''[filter_second_attack]''': a standard attack filter to match on the defender's attack. See [[FilterWML]]. Also note that if the defender doesn't have any weapon to retaliate with, this filter will always fail. &lt;br /&gt;
* '''hits''': filters attack animations based on whether the attack hits, misses or kills. Accepts a list of the following:&lt;br /&gt;
** '''hit''': the attack hits, defender survives.&lt;br /&gt;
** '''no''' or '''miss''': the attack misses.&lt;br /&gt;
** '''kill''': the attack hits, defender dies.&lt;br /&gt;
** '''yes''': is an alias of '''hit,kill'''.&lt;br /&gt;
* '''swing''': a list of numbers representing the swing numbers this animation should match (numbered from 1). this has been replaced by value_second&lt;br /&gt;
* '''base_score''': {{DevFeature1.9}} : a number that will always be added to the score. Use with caution&lt;br /&gt;
&lt;br /&gt;
=== Events triggering animations and default animations ===&lt;br /&gt;
==== standing ====&lt;br /&gt;
This animation is triggered whenever any other animation is finished, and is played in loop until another animation is triggered&lt;br /&gt;
&lt;br /&gt;
this is the default &amp;quot;standing image&amp;quot; for the unit&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no standing animation is set a single frame animation based on the enclosing unit's '''image=''' field is used&lt;br /&gt;
==== selected ====&lt;br /&gt;
This animation is triggered whenever the unit is selected&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''blend_with=&amp;quot;0.0~0.3:100,0.3~0.0:200&amp;quot; blend_color=255,255,255''&lt;br /&gt;
==== recruited ====&lt;br /&gt;
This animation is triggered whenever the unit is recruited or recalled&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''highlight=0~1:600''&lt;br /&gt;
&lt;br /&gt;
==== recruiting ====&lt;br /&gt;
&lt;br /&gt;
This animation is triggered for the leader when a unit is recruited or recalled&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
no default animation is needed&lt;br /&gt;
&lt;br /&gt;
note that is not triggered for WML triggered animations&lt;br /&gt;
&lt;br /&gt;
==== levelin ====&lt;br /&gt;
This animation is triggered whenever the unit levels, before the unit is replaced by the new unit&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''blend_with=&amp;quot;1~0:600&amp;quot; blend_color=255,255,255''&lt;br /&gt;
==== levelout ====&lt;br /&gt;
This animation is triggered whenever the unit levels, after the unit is replaced by the new unit&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''blend_with=&amp;quot;0~1:600&amp;quot; blend_color=255,255,255''&lt;br /&gt;
==== movement ====&lt;br /&gt;
This animation is used whenever a unit moves. There are multiple things to consider when dealing with movement animation&lt;br /&gt;
* unit stay ''exactly'' 150ms in each hex. so you typically want to have an offset of ''0~1:150,0~1:150,0~1:150,0~1:150,0~1:150'' or something similar&lt;br /&gt;
* when a unit enters a hex, the current anim is tested again.&lt;br /&gt;
** if the current animation is still valid (i.e it passes all its filter) it is kept, whatever the final score is&lt;br /&gt;
** if it fails, a new movement anim is searched&lt;br /&gt;
&lt;br /&gt;
''value='' contains the number of steps already taken&lt;br /&gt;
&lt;br /&gt;
''value_second='' contains the number of steps left&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''offset=&amp;quot;0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
==== pre_movement ====&lt;br /&gt;
This animation is used before any unit movement&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0 &lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0 &lt;br /&gt;
&lt;br /&gt;
==== post_movement ====&lt;br /&gt;
This animation is used after any unit movement&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0 &lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
==== pre_teleport ====&lt;br /&gt;
This animation is triggered whenever the unit teleports, but before it has moved to the target hex&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''blend_with=&amp;quot;1~0:150&amp;quot; blend_color=255,255,255''&lt;br /&gt;
==== post_teleport ====&lt;br /&gt;
This animation is triggered whenever the unit teleports, but after it has moved to the target hex&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''blend_with=&amp;quot;0~1:150&amp;quot; blend_color=255,255,255''&lt;br /&gt;
==== healing ====&lt;br /&gt;
This animation is triggered when the unit has healing powers and uses them&lt;br /&gt;
&lt;br /&gt;
''value='' is the number of points healed&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
==== healed ====&lt;br /&gt;
This animation is triggered whenever the unit is healed for any reason&lt;br /&gt;
&lt;br /&gt;
''value='' is the number of points healed&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''blend_with=&amp;quot;0:30,0.5:30,0:30,0.5:30,0:30,0.5:30,0:30,0.5:30,0:30&amp;quot; blend_color=255,255,255''&lt;br /&gt;
and plays the sound ''heal.wav''&lt;br /&gt;
==== poisoned ====&lt;br /&gt;
This animation is triggered whenever the unit suffers poison dammage&lt;br /&gt;
&lt;br /&gt;
''value='' is the number of points lost&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''blend_with=&amp;quot;0:30,0.5:30,0:30,0.5:30,0:30,0.5:30,0:30,0.5:30,0:30&amp;quot; blend_color=0,255,0''&lt;br /&gt;
and plays the sound 'poison.ogg''&lt;br /&gt;
==== defend ====&lt;br /&gt;
This animation is triggered during a strike, of the unit receiving the blow&lt;br /&gt;
&lt;br /&gt;
''value='' is the number of point lost, if any&lt;br /&gt;
&lt;br /&gt;
''value_second='' is the number of the swing, starting from 1&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
==== attack ====&lt;br /&gt;
This animation is triggered during a strike, of the unit giving the blow&lt;br /&gt;
&lt;br /&gt;
''value='' is the number of damage dealt, if any&lt;br /&gt;
&lt;br /&gt;
''value_second='' is the number of the swing, starting from 1&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''offset=&amp;quot;0~0.6:150,0.6~0:150&amp;quot;'' for melee attacks&lt;br /&gt;
No default is provided for range attacks&lt;br /&gt;
==== leading ====&lt;br /&gt;
This animation is triggered for units with the leading special ability, when the unit they are leading is attacking&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is the number of the swing, starting from 1&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== resistance ====&lt;br /&gt;
This animation is triggered for units with the resistance special ability affecting neighbouring fights, when the unit they are helping is defending&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is the number of the swing, starting from 1&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
&lt;br /&gt;
==== death ====&lt;br /&gt;
This animation is triggered when a unit die.&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''highlight=1~0:600'' and plays the sound in ''die_sound='' of the enclosing unit&lt;br /&gt;
==== victory ====&lt;br /&gt;
This animation is triggered when a unit finishes a fight by killing the other unit&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
==== idling ====&lt;br /&gt;
This animation is called when the unit has been using its standing animation for a random duration.&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
&lt;br /&gt;
==== draw_weapon ====&lt;br /&gt;
This animation is played before a fight&lt;br /&gt;
&lt;br /&gt;
''hit='' is set to HIT for the attacker and MISS for the defender&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
&lt;br /&gt;
==== sheath_weapon ====&lt;br /&gt;
This animation is played after a fight simultaneously for all surviving units&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
&lt;br /&gt;
==== default ====&lt;br /&gt;
&lt;br /&gt;
This animation is never triggered, but is used as a base to create new animations&lt;br /&gt;
&lt;br /&gt;
''value='' is used depending of the type of animation it replaces&lt;br /&gt;
&lt;br /&gt;
''value_second='' is used depending of the type of animation it replaces&lt;br /&gt;
&lt;br /&gt;
A single animation made of the base frame is provided by the engine if no default animation is available&lt;br /&gt;
&lt;br /&gt;
==== extra animations ====&lt;br /&gt;
Other values are never called by the engine. However they can be triggered by WML events allowing custom animations.&lt;br /&gt;
&lt;br /&gt;
Note that WML events can also trigger standard animations.&lt;br /&gt;
''value='' is set from the WML event&lt;br /&gt;
&lt;br /&gt;
''value_second='' is set from the WML event&lt;br /&gt;
&lt;br /&gt;
== Shortcuts, tricks and quirks ==&lt;br /&gt;
&lt;br /&gt;
=== ''[if]'' and ''[else]'' ===&lt;br /&gt;
&lt;br /&gt;
Often, you need to do very slight variations in an animation (like a different sound depending on whether the unit hits or misses its attack), the '''[if]''' and '''[else]''' tags are meant to help you do that. &lt;br /&gt;
    &lt;br /&gt;
Using these in an animation is equivalent to having multiple animations, one with the '''[if]''' block and one with each of the ''[else]'' blocks. Any filtering flags in these blocks will replace the toplevel filters. You can have multiple '''[if]''' blocks in an animation, but you can't nest an '''[if]''' inside another. These should be written directly inside the '''[animation]''' block. The following example would make the '''[frame]''' inside the '''[if]''' be played when the attack misses, and the '''[frame]''' inside the '''[else]''' be played when the attack hits (producing a different sound):&lt;br /&gt;
&lt;br /&gt;
    [if]&lt;br /&gt;
        hits=no&lt;br /&gt;
        [frame]&lt;br /&gt;
            begin=-100&lt;br /&gt;
            end=100&lt;br /&gt;
            image=&amp;quot;units/dwarves/lord-attack.png&amp;quot;&lt;br /&gt;
            sound={SOUND_LIST:MISS}&lt;br /&gt;
        [/frame]&lt;br /&gt;
    [/if]&lt;br /&gt;
    [else]&lt;br /&gt;
        hits=yes&lt;br /&gt;
        [frame]&lt;br /&gt;
            begin=-100&lt;br /&gt;
            end=100&lt;br /&gt;
            image=&amp;quot;units/dwarves/lord-attack.png&amp;quot;&lt;br /&gt;
            sound=axe.ogg&lt;br /&gt;
        [/frame]&lt;br /&gt;
    [/else]&lt;br /&gt;
&lt;br /&gt;
note that this is very close to preprocessing and should be considered as such, especially with regard to scoring and animation selection&lt;br /&gt;
&lt;br /&gt;
=== Simplified animation blocks ===&lt;br /&gt;
To simplify the most common animation cases, you can use different blocks instead of the generic '''[animation]''' block. These are also here for backward compatibility, but are not deprecated and fully supported&lt;br /&gt;
&lt;br /&gt;
some of these use extra tags which are translated in the normal ''value='' tag&lt;br /&gt;
&lt;br /&gt;
some of these define '''[xxx_frame]''' blocks where the frame prefix starts with an underscore. This is not allowed in normal WML (prefix starting with underscore is reserved for the engine internal use). It is here for clarity purpose&lt;br /&gt;
&lt;br /&gt;
* '''[leading_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=leading&lt;br /&gt;
* '''[recruit_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=recruited&lt;br /&gt;
* '''[recruiting_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=recruiting&lt;br /&gt;
* '''[standing_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=standing,default&lt;br /&gt;
note for 1.4 :''default'' doesn't exist in 1.4, but the semantic is the same.&lt;br /&gt;
&lt;br /&gt;
i.e: the animation will be used to build default animations&lt;br /&gt;
* '''[idle_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=idling&lt;br /&gt;
* '''[levelin_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=levelin&lt;br /&gt;
* '''[levelout_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=levelout&lt;br /&gt;
* '''[healing_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=healing&lt;br /&gt;
 value=&amp;lt;damage= value&amp;gt;&lt;br /&gt;
* '''[healed_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=healed&lt;br /&gt;
 value=&amp;lt;healing= value&amp;gt;&lt;br /&gt;
 [_healed_sound_frame]&lt;br /&gt;
    sound=heal.wav&lt;br /&gt;
 [/_healed_sound_frame]&lt;br /&gt;
* '''[poison_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=poisoned&lt;br /&gt;
 value=&amp;lt;damage= value&amp;gt;&lt;br /&gt;
 [_poison_sound_frame]&lt;br /&gt;
    sound=poison.ogg&lt;br /&gt;
 [/_poison_sound_frame]&lt;br /&gt;
* '''[movement_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=movement&lt;br /&gt;
 offset=&amp;quot;0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150&amp;quot;&lt;br /&gt;
* '''[pre_movement_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=pre_movement&lt;br /&gt;
* '''[post_movement_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=post_movement&lt;br /&gt;
* '''[draw_weapon_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=draw_weapon&lt;br /&gt;
* '''[sheath_weapon_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=sheath_weapon_movement&lt;br /&gt;
* '''[defend]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=defend&lt;br /&gt;
 value=&amp;lt;damage= value&amp;gt;&lt;br /&gt;
 &amp;lt;WML content&amp;gt;&lt;br /&gt;
 [frame]&lt;br /&gt;
    blend_with=255,0,0&lt;br /&gt;
    blend_ratio=&amp;quot;0.5:50,0.0:50&amp;quot;&lt;br /&gt;
 [/frame]&lt;br /&gt;
&lt;br /&gt;
there are some subtil change compared to what is described above to avoid the red flash when value=0, but it should work as expected as far as WML author are concerned&lt;br /&gt;
 &lt;br /&gt;
* '''[attack_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
if the animation contains a missile frame&lt;br /&gt;
&lt;br /&gt;
 apply_to=attack&lt;br /&gt;
 missile_offset=&amp;quot;0~0.8&amp;quot;&lt;br /&gt;
&lt;br /&gt;
else&lt;br /&gt;
&lt;br /&gt;
 apply_to=attack&lt;br /&gt;
 offset=&amp;quot;0~0.6,0.6~0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* '''[death]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=death&lt;br /&gt;
 [_death_sound_frame]&lt;br /&gt;
    sound=&amp;lt;die_sound= of the enclosing [unit] tag&amp;gt;&lt;br /&gt;
 [/_death_sound_frame]&lt;br /&gt;
* '''[victory_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=victory&lt;br /&gt;
* '''[extra_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=&amp;lt;flag= value of the anim&amp;gt;&lt;br /&gt;
* '''[teleport_anim]''' will be cut into two at the clock-time 0&lt;br /&gt;
everything before zero becomes an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=pre_teleport&lt;br /&gt;
everything after zero becomes an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=post_teleport&lt;br /&gt;
&lt;br /&gt;
== Layering ==&lt;br /&gt;
The ''layer'' progressive parameter allows the animation writer to choose in what order the animation should be drawn.&lt;br /&gt;
&lt;br /&gt;
this value must be between 0 and 100&lt;br /&gt;
&lt;br /&gt;
* the back of haloes is drawn with a value of 10&lt;br /&gt;
* when unspecified, a animation is drawn with a value of 40&lt;br /&gt;
* terrain elements that are supposed to go in front of units (castles) are drawn with a value of 50&lt;br /&gt;
* orbs and status bars are drawn on layer 80&lt;br /&gt;
* when unspecified missile frames are drawn on layer 90&lt;br /&gt;
&lt;br /&gt;
by changing these values, it is easy to have the unit display the way you want&lt;br /&gt;
&lt;br /&gt;
== Optimization ==&lt;br /&gt;
&lt;br /&gt;
there is a special flag that goes into the animation block (not the frame) &lt;br /&gt;
&lt;br /&gt;
* ''offscreen'' a boolean saying if the unit's animation should be played when the unit is offscreen. You want the animation to play offscreen if the animation contains some usefull sound effects.This attribute defaults to true (play offscreen) except for standing and idle animations where it defaults to false&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[UnitTypeWML]]&lt;br /&gt;
* [[ReferenceWML]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: WML Reference]]&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=GCI&amp;diff=38738</id>
		<title>GCI</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=GCI&amp;diff=38738"/>
		<updated>2010-10-24T17:25:08Z</updated>

		<summary type="html">&lt;p&gt;Boucman: Created page with '== Google Code In task list ==  This page is a list of task ideas for the google code-in (see http://code.google.com/gci)   exemple of tasks from previous year http://code.google…'&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Google Code In task list ==&lt;br /&gt;
&lt;br /&gt;
This page is a list of task ideas for the google code-in (see http://code.google.com/gci)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
exemple of tasks from previous year&lt;br /&gt;
http://code.google.com/p/google-highly-open-participation-gnome/issues/list&lt;br /&gt;
&lt;br /&gt;
=== Task Template ===&lt;br /&gt;
One paragraph description of task&lt;br /&gt;
&lt;br /&gt;
requirement (expected technical knowledge)&lt;br /&gt;
&lt;br /&gt;
expected time for completion&lt;br /&gt;
&lt;br /&gt;
difficulty&lt;br /&gt;
&lt;br /&gt;
deliverable/expected proof&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=AnimationWML&amp;diff=38605</id>
		<title>AnimationWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=AnimationWML&amp;diff=38605"/>
		<updated>2010-10-02T10:29:01Z</updated>

		<summary type="html">&lt;p&gt;Boucman: /* Syntax summary */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WML Tags}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This page covers unit animations. At any point in game, units are playing an animation. Even when the unit is standing, it is actually playing a single frame animation.&lt;br /&gt;
&lt;br /&gt;
This page will deal with the two problems of animations&lt;br /&gt;
* How are animations Chosen&lt;br /&gt;
* What exactly is drawn&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How animations are drawn ==&lt;br /&gt;
=== Animations ===&lt;br /&gt;
Any unit has a huge set of animations to choose from. Animations are WML blocks in the unit type, enclosed in either the generic type '''[animation]''' or some more specific tags such as '''[attack_anim]''' '''[idle_anim]''' and the like. An animation is what a unit displays when a given event is triggered, and a certain set of conditions are met such as&lt;br /&gt;
* unit is attacking&lt;br /&gt;
* unit is idling&lt;br /&gt;
* unit is attacking (event) and uses a melee weapon (condition)&lt;br /&gt;
* unit is attacking (event) and uses a melee weapon (condition) and opponent can't retaliate (condition)&lt;br /&gt;
&lt;br /&gt;
events and conditions are described entirely in the [animation] block, and will be discussed in the animation choice section.&lt;br /&gt;
&lt;br /&gt;
=== Frames ===&lt;br /&gt;
    &lt;br /&gt;
An animation is cut in frames. Frames are WML blocks that are contained either in '''[frame]''' WML blocks or in generic '''[xxx_frame]''' block. (the xxx part can be any string not starting with an underscore) the xxx part in the frame name is called the frame prefix. frames of the type '''[frame]''' are said to have an empty prefix&lt;br /&gt;
&lt;br /&gt;
A frame typically describes an image, where an how to render it. It can contain such things as&lt;br /&gt;
* the image to display&lt;br /&gt;
* how transparent should that image be&lt;br /&gt;
* where to draw that image.&lt;br /&gt;
&lt;br /&gt;
At any given time, an animation will display one frame for each frame prefix it can find. I.e if your animation has both '''[frame]''' and '''[missile_frame]''' blocks, both will be displayed at the same time&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The frame with the empty prefix is special in many way. It is assumed to contain the image representing the unit itself, and as such the engine will heavily temper with it in multiple ways, such as providing a default image if none is available, or forcing the image to be green when the unit is poisoned&lt;br /&gt;
&lt;br /&gt;
=== Timing, Clock, Multiple animations ===&lt;br /&gt;
When an animation is played it has an internal clock that is run. The step of this clock is the milisecond, and each frame is played for a given duration. Each animation also has a starting time which tells the animation engine at what value the animation clock should start&lt;br /&gt;
&lt;br /&gt;
This starting time is very important when multiple animations from different units are played synchronously  Typically a fight involves a unit playing its defense animation while the opponent plays it's attack animation (and a third might play its leading animation, too). In that case all animations have a common clock, and are played concurrently.&lt;br /&gt;
&lt;br /&gt;
The convention is that the &amp;quot;important time&amp;quot; (usually the time of the hit) is at time 0. everything before should be at negative time, everything after at positive time. This is a WML convention that is not enforced by the engine&lt;br /&gt;
&lt;br /&gt;
In that case, it is very important that these animations (which can have different lengths) be synchronized. Fight animations are synchronized around the point of impact, so they all reach time 0 when the attack lands (or misses). This is accomplished through the use of the '''start_time''' key of the '''[animation]''' tag.&lt;br /&gt;
&lt;br /&gt;
Just like the '''[frame]''' tag can have a prefix, so can the '''start_time''' key. A '''start_time''' key without prefix will affect a '''[frame]''' tag without prefix, while a '''start_time''' key with a prefix will affect a '''[frame]''' tag with the same prefix.&lt;br /&gt;
&lt;br /&gt;
==== Example Syntax ====&lt;br /&gt;
    [attack_anim]&lt;br /&gt;
        [filter_attack]&lt;br /&gt;
            name=bow&lt;br /&gt;
        [/filter_attack]&lt;br /&gt;
        '''start_time'''=-350&lt;br /&gt;
        '''missile_start_time'''=-150&lt;br /&gt;
        [missile_frame]&lt;br /&gt;
            duration=150&lt;br /&gt;
            image=&amp;quot;projectiles/missile-n.png&amp;quot;&lt;br /&gt;
            image_diagonal=&amp;quot;projectiles/missile-ne.png&amp;quot;&lt;br /&gt;
        [/missile_frame]&lt;br /&gt;
        [if]&lt;br /&gt;
            hits=yes&lt;br /&gt;
            [frame]&lt;br /&gt;
                duration=350&lt;br /&gt;
                sound=bow.ogg&lt;br /&gt;
            [/frame]&lt;br /&gt;
        [/if]&lt;br /&gt;
        [else]&lt;br /&gt;
            hits=no&lt;br /&gt;
            [frame]&lt;br /&gt;
                duration=350&lt;br /&gt;
                sound=bow-miss.ogg&lt;br /&gt;
            [/frame]&lt;br /&gt;
        [/else]&lt;br /&gt;
    [/attack_anim]&lt;br /&gt;
&lt;br /&gt;
=== The content of a frame ===&lt;br /&gt;
==== Syntax summary ====&lt;br /&gt;
 [frame]&lt;br /&gt;
    duration=&amp;lt;integer&amp;gt;&lt;br /&gt;
    begin=&amp;lt;deprecated,integer&amp;gt;&lt;br /&gt;
    end=&amp;lt;deprecated,integer&amp;gt;&lt;br /&gt;
    image=&amp;lt;string&amp;gt;&lt;br /&gt;
    image_diagonal=&amp;lt;string&amp;gt;&lt;br /&gt;
    image_mod=&amp;lt;string&amp;gt;&lt;br /&gt;
    sound=&amp;lt;string&amp;gt;&lt;br /&gt;
    halo=&amp;lt;progressive string&amp;gt;&lt;br /&gt;
    halo_x=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
    halo_y=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
    halo_mod=&amp;lt;string&amp;gt;&lt;br /&gt;
    alpha=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
    offset=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
    blend_color=&amp;lt; red, green, blue &amp;gt;&lt;br /&gt;
    blend_ratio=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
    text=&amp;lt;string&amp;gt;&lt;br /&gt;
    text_color=&amp;lt; red, green, blue &amp;gt;&lt;br /&gt;
    submerge=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
    x=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
    y=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
    directional_x=&amp;lt;dev feature 1.9,progressive int&amp;gt;&lt;br /&gt;
    directional_y=&amp;lt;dev feature 1.9,progressive int&amp;gt;&lt;br /&gt;
    layer=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
 [/frame]&lt;br /&gt;
&lt;br /&gt;
==== Progressive parameters ====&lt;br /&gt;
&lt;br /&gt;
Some parameters above are marked as ''progressive'' This means that you can specify that during the time the frame is displayed, the parameter should smoothly slide from one value to an other.&lt;br /&gt;
&lt;br /&gt;
A typical example would be a unit progressively fading out, becoming transparent&lt;br /&gt;
&lt;br /&gt;
To do that, you could use:&lt;br /&gt;
&lt;br /&gt;
 alpha=1~0&lt;br /&gt;
&lt;br /&gt;
To make a frame, which is 900ms long, slide to transparent for 300ms, stay transparent for another 300ms and finally fade back to normal for 300ms, use:&lt;br /&gt;
&lt;br /&gt;
 alpha=1~0:300,0:300,0~1:300&lt;br /&gt;
&lt;br /&gt;
you could also specify it like that&lt;br /&gt;
&lt;br /&gt;
 alpha=1~0,0,0~1&lt;br /&gt;
&lt;br /&gt;
when a timing is missing, the engine will do its best to fill in in a fair way. &lt;br /&gt;
&lt;br /&gt;
a progressive string has a similar syntax&lt;br /&gt;
&lt;br /&gt;
 halo=halo1.png:300,halo2.png:300,halo2.png:300&lt;br /&gt;
&lt;br /&gt;
==== Field Description ====&lt;br /&gt;
&lt;br /&gt;
** '''begin''': (deprecated) will be replaced by '''duration= &amp;lt;end - begin &amp;gt;'''&lt;br /&gt;
** '''end''': (deprecated) see '''begin''' and also [[AnimationWML#Timing.2C_Clock.2C_Multiple_animations|Timing, Clock, Multiple animations]] section for coverage of '''start_time''' which combines with '''duration''' to replace '''begin=''' '''end='''.&lt;br /&gt;
** '''duration''': how long the frame should be displayed. Use instead of '''begin=''' and '''end='''.&lt;br /&gt;
** '''image''': the image to display during the frame.&lt;br /&gt;
** '''image_diagonal''': the image to display when the attack occurs diagonally (directions ne,se,sw,nw).&lt;br /&gt;
** '''image_mod''': a string modifications (see [[ImagePathFunctionWML]] ) that will be applied to all images&lt;br /&gt;
** '''sound''': the sound to play when the frame begins. Can be a comma-separated list of sounds, in which case one of them is chosen randomly every time.&lt;br /&gt;
** '''halo''': the halo to display at the time.&lt;br /&gt;
** '''halo_x''': the position the halo is displayed in pixel relative to the unit's center.&lt;br /&gt;
** '''halo_y''': the position the halo is displayed in pixel relative to the unit's center.&lt;br /&gt;
** '''halo_mod''': a string modifications (see [[ImagePathFunctionWML]] ) that will be applied to all haloes&lt;br /&gt;
** '''alpha''': transparency level to apply to the frame. This is a floating point progressive parameter ranging from 0.0 to 1.0.&lt;br /&gt;
** '''offset''': the position of the image relative to the hex the unit is facing, 0.0 will display the unit in the center of the hex, 1.0 in the center of the faced hex, -1.0 at the center of the hex behind you. This is a progressive parameter.&lt;br /&gt;
** '''blend_color''': a comma separated list of numbers representing a color in RGB (0-255) this color will be mixed to the frame to give it a tint.&lt;br /&gt;
** '''blend_ratio''': this is a progressive parameter ranging from 0 to 1: 0 means no tint, 1 means target color only.&lt;br /&gt;
** '''text''': if specified, floats a label with the given text above the unit (identical to the floating damage and healing numbers).&lt;br /&gt;
** '''text_color''': the color of the above floating label.&lt;br /&gt;
** '''submerge''': the part of the unit that should drawn with 50% opacity (for units in water)&lt;br /&gt;
** '''x''': x offset applied to the frame&lt;br /&gt;
** '''y''': y offset applied to the frame&lt;br /&gt;
** '''directional_x''': x offset applied to the frame in the direction the unit is facing&lt;br /&gt;
** '''directional_y''': y offset applied to the frame in the direction the unit is facing&lt;br /&gt;
** '''layer''': layer used to draw the frame, see discussion bellow&lt;br /&gt;
&lt;br /&gt;
=== Drawing related animation content ===&lt;br /&gt;
==== Syntax summary ====&lt;br /&gt;
 [animation]&lt;br /&gt;
   &amp;lt;animation choice related content&amp;gt;&lt;br /&gt;
   [frame]&lt;br /&gt;
     &amp;lt;frame content&amp;gt;&lt;br /&gt;
   [/frame]&lt;br /&gt;
   [frame]&lt;br /&gt;
     &amp;lt;frame content&amp;gt;&lt;br /&gt;
   [/frame]&lt;br /&gt;
   start_time=&amp;lt;integer&amp;gt;&lt;br /&gt;
   offset=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
   image_mod=&amp;lt;string&amp;gt;&lt;br /&gt;
   blend_with=&amp;lt;r,g,b&amp;gt;&lt;br /&gt;
   blend_ratio=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
   halo=&amp;lt;progressive_string&amp;gt;&lt;br /&gt;
   halo_x=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   halo_y=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   halo_mod=&amp;lt;string&amp;gt;&lt;br /&gt;
   submerge=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
   x=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   y=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   directional_x=&amp;lt;dev1.9,progressive int&amp;gt;&lt;br /&gt;
   directional_y=&amp;lt;dev1.9,progressive int&amp;gt;&lt;br /&gt;
   layer=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   [xxx_frame]&lt;br /&gt;
     &amp;lt;frame content&amp;gt;&lt;br /&gt;
   [/xxx_frame]&lt;br /&gt;
   xxx_start_time=&amp;lt;integer&amp;gt;&lt;br /&gt;
   xxx_image_mod=&amp;lt;string&amp;gt;&lt;br /&gt;
   xxx_offset=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
   xxx_blend_with=&amp;lt;r,g,b&amp;gt;&lt;br /&gt;
   xxx_blend_ratio=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
   xxx_halo=&amp;lt;progressive_string&amp;gt;&lt;br /&gt;
   xxx_halo_x=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   xxx_halo_y=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   xxx_halo_mod=&amp;lt;string&amp;gt;&lt;br /&gt;
   xxx_submerge=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
   xxx_x=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   xxx_y=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   xxx_directional_x=&amp;lt;dev1.9,progressive int&amp;gt;&lt;br /&gt;
   xxx_directional_y=&amp;lt;dev1.9,progressive int&amp;gt;&lt;br /&gt;
   xxx_layer=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 [/animation]&lt;br /&gt;
&lt;br /&gt;
==== Parameter handling ====&lt;br /&gt;
All drawing related parameters in '''[animation]''' can be matched with a corresponding parameter in  a '''[frame]''' block (or a '''[xxx_frame]''' block) The value provided in the animation will be used if no value is provided in the frame. &lt;br /&gt;
&lt;br /&gt;
The point of these two level of parameters is to easily be able to specify a parameter at the animation level and override it for a special case of frame.&lt;br /&gt;
&lt;br /&gt;
== How animations are chosen ==&lt;br /&gt;
Within a unit decription block there are multiple animations. Each animation is meant to be played in a very special set of circumstances. We will discuss here how to tell the animation engine when a given animation should be played. &lt;br /&gt;
&lt;br /&gt;
Let's take an example. Suppose we have a unit which has the skirmisher ability. We have the folowing movement animations :&lt;br /&gt;
* a normal walking animation&lt;br /&gt;
* a swimming animation when the unit is in water&lt;br /&gt;
* a tiptioeing animation when moving next to an ennemy unit&lt;br /&gt;
&lt;br /&gt;
Ok. most of the time it's easy to guess what animation should be. However if you are both in water and next to an ennemy unit, the animation to play is not obvious.&lt;br /&gt;
&lt;br /&gt;
To solve that question, each animation has a number of filtering criterias. The engine follow the following rules to select an animation&lt;br /&gt;
* Start with all animations&lt;br /&gt;
* Drop all animations with a criteria that fails on the current situation&lt;br /&gt;
* Take the animations that have the most maching criterias&lt;br /&gt;
* If there are more than one animation remaining, take an animation randomly&lt;br /&gt;
* If all animations have been droped, the engine will provide a smart default.&lt;br /&gt;
    &lt;br /&gt;
here is a pseudo-code explaination of this algorithm:&lt;br /&gt;
&lt;br /&gt;
 foreach animation&lt;br /&gt;
    animation_score = 0&lt;br /&gt;
    foreach filter-criteria&lt;br /&gt;
      if &amp;lt;criteria-fails&amp;gt; &lt;br /&gt;
          animation_score = -1;&lt;br /&gt;
          break;&lt;br /&gt;
      elsif &amp;lt;criteria-matches&amp;gt; &lt;br /&gt;
          animation_score++&lt;br /&gt;
    endfor&lt;br /&gt;
    if animation_score &amp;gt; max_score&lt;br /&gt;
        &amp;lt;empty animation list&amp;gt;&lt;br /&gt;
        max_score = animation_score;&lt;br /&gt;
        push(animation,animation_list);&lt;br /&gt;
    elsif animation_score = max_score&lt;br /&gt;
        push(animation,animation_list);&lt;br /&gt;
 endfor&lt;br /&gt;
 &amp;lt;choose an animation randomly from animation_list&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
Note that all animations don't have all the filters...&lt;br /&gt;
&lt;br /&gt;
so, if we have a unit with&lt;br /&gt;
# an animation for water terrain&lt;br /&gt;
# an animation for SE on grassland&lt;br /&gt;
# an animation with no criteria&lt;br /&gt;
# an animation for N,NE,NW,S,SW,SE&lt;br /&gt;
# an animation for NW&lt;br /&gt;
&lt;br /&gt;
* 3. will never be taken, because 4. will always trump it&lt;br /&gt;
* on water going NW, it can be 1. 4. 5.&lt;br /&gt;
* on water, any direction but NW, it will be 1. or 4.&lt;br /&gt;
* on SE grassland it will be 2.&lt;br /&gt;
* on other grasslands, it will be 4. (4. or 5. if NW)&lt;br /&gt;
&lt;br /&gt;
=== Generic animation filters available for all animations ===&lt;br /&gt;
* '''apply_to''': a list of comma separated keywords describing what event should trigger the animation (movement, attack...) the complete list is given below&lt;br /&gt;
* '''value''': a list of comma separated integer, the meaning depends on the triggering event. the meaning is given with the list of event&lt;br /&gt;
* '''value_second''': a list of comma separated integer, the meaning depends on the triggering event. the meaning is given with the list of event&lt;br /&gt;
* '''terrain''': a list of comma separated terrain letters, the animation will only be used on these terrains.  See [[FilterWML]].  this has been replaced by '''terrain_type'''&lt;br /&gt;
* '''terrain_type''': a list of comma separated terrain letters, the animation will only be used on these terrains.  See [[FilterWML]].&lt;br /&gt;
* '''[filter]''': this will filter using a standard unit filter on the animated unit. Note that matching all criterias in the filter will only earn you one point for animation selection, but that you can have multiple '''[filter]''' blocks in an animation.&lt;br /&gt;
* '''[filter_second]''': this will filter using a standard unit filter on the unit in the hex faced. Note that matching all criteria in the filter will only earn you one point for animation selection, but that you can have multiple '''[filter_second]''' blocks in an animation. Also note that if the faced hex is empty, the whole filter will fail.&lt;br /&gt;
* '''direction''': a list of directions (n,ne,se,s,sw,nw), the animation will only be used when acting or moving in this direction (the attack direction for attack animations, moving direction for movement animations, direction of lead unit for leading animations, and so on).&lt;br /&gt;
* '''frequency''': this integer value allows to easily tweak the matching frequency of animations. The filter will fail n-1 times out of n, randomly. Note that unlike every other filter, matching this filter won't give an extra point.&lt;br /&gt;
* '''[filter_attack]''': a standard attack filter to match on the attacker's attack. See  [[FilterWML]]. &lt;br /&gt;
* '''[filter_second_attack]''': a standard attack filter to match on the defender's attack. See [[FilterWML]]. Also note that if the defender doesn't have any weapon to retaliate with, this filter will always fail. &lt;br /&gt;
* '''hits''': filters attack animations based on whether the attack hits, misses or kills. Accepts a list of the following:&lt;br /&gt;
** '''hit''': the attack hits, defender survives.&lt;br /&gt;
** '''no''' or '''miss''': the attack misses.&lt;br /&gt;
** '''kill''': the attack hits, defender dies.&lt;br /&gt;
** '''yes''': is an alias of '''hit,kill'''.&lt;br /&gt;
* '''swing''': a list of numbers representing the swing numbers this animation should match (numbered from 1). this has been replaced by value_second&lt;br /&gt;
* '''base_score''': {{DevFeature1.9}} : a number that will always be added to the score. Use with caution&lt;br /&gt;
&lt;br /&gt;
=== Events triggering animations and default animations ===&lt;br /&gt;
==== standing ====&lt;br /&gt;
This animation is triggered whenever any other animation is finished, and is played in loop until another animation is triggered&lt;br /&gt;
&lt;br /&gt;
this is the default &amp;quot;standing image&amp;quot; for the unit&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no standing animation is set a single frame animation based on the enclosing unit's '''image=''' field is used&lt;br /&gt;
==== selected ====&lt;br /&gt;
This animation is triggered whenever the unit is selected&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''blend_with=&amp;quot;0.0~0.3:100,0.3~0.0:200&amp;quot; blend_color=255,255,255''&lt;br /&gt;
==== recruited ====&lt;br /&gt;
This animation is triggered whenever the unit is recruited or recalled&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''highlight=0~1:600''&lt;br /&gt;
&lt;br /&gt;
==== recruiting ====&lt;br /&gt;
&lt;br /&gt;
This animation is triggered for the leader when a unit is recruited or recalled&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
no default animation is needed&lt;br /&gt;
&lt;br /&gt;
note that is not triggered for WML triggered animations&lt;br /&gt;
&lt;br /&gt;
==== levelin ====&lt;br /&gt;
This animation is triggered whenever the unit levels, before the unit is replaced by the new unit&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''blend_with=&amp;quot;1~0:600&amp;quot; blend_color=255,255,255''&lt;br /&gt;
==== levelout ====&lt;br /&gt;
This animation is triggered whenever the unit levels, after the unit is replaced by the new unit&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''blend_with=&amp;quot;0~1:600&amp;quot; blend_color=255,255,255''&lt;br /&gt;
==== movement ====&lt;br /&gt;
This animation is used whenever a unit moves. There are multiple things to consider when dealing with movement animation&lt;br /&gt;
* unit stay ''exactly'' 150ms in each hex. so you typically want to have an offset of ''0~1:150,0~1:150,0~1:150,0~1:150,0~1:150'' or something similar&lt;br /&gt;
* when a unit enters a hex, the current anim is tested again.&lt;br /&gt;
** if the current animation is still valid (i.e it passes all its filter) it is kept, whatever the final score is&lt;br /&gt;
** if it fails, a new movement anim is searched&lt;br /&gt;
&lt;br /&gt;
''value='' contains the number of steps already taken&lt;br /&gt;
&lt;br /&gt;
''value_second='' contains the number of steps left&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''offset=&amp;quot;0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
==== pre_movement ====&lt;br /&gt;
This animation is used before any unit movement&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0 &lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0 &lt;br /&gt;
&lt;br /&gt;
==== post_movement ====&lt;br /&gt;
This animation is used after any unit movement&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0 &lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
==== pre_teleport ====&lt;br /&gt;
This animation is triggered whenever the unit teleports, but before it has moved to the target hex&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''blend_with=&amp;quot;1~0:150&amp;quot; blend_color=255,255,255''&lt;br /&gt;
==== post_teleport ====&lt;br /&gt;
This animation is triggered whenever the unit teleports, but after it has moved to the target hex&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''blend_with=&amp;quot;0~1:150&amp;quot; blend_color=255,255,255''&lt;br /&gt;
==== healing ====&lt;br /&gt;
This animation is triggered when the unit has healing powers and uses them&lt;br /&gt;
&lt;br /&gt;
''value='' is the number of points healed&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
==== healed ====&lt;br /&gt;
This animation is triggered whenever the unit is healed for any reason&lt;br /&gt;
&lt;br /&gt;
''value='' is the number of points healed&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''blend_with=&amp;quot;0:30,0.5:30,0:30,0.5:30,0:30,0.5:30,0:30,0.5:30,0:30&amp;quot; blend_color=255,255,255''&lt;br /&gt;
and plays the sound ''heal.wav''&lt;br /&gt;
==== poisoned ====&lt;br /&gt;
This animation is triggered whenever the unit suffers poison dammage&lt;br /&gt;
&lt;br /&gt;
''value='' is the number of points lost&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''blend_with=&amp;quot;0:30,0.5:30,0:30,0.5:30,0:30,0.5:30,0:30,0.5:30,0:30&amp;quot; blend_color=0,255,0''&lt;br /&gt;
and plays the sound 'poison.ogg''&lt;br /&gt;
==== defend ====&lt;br /&gt;
This animation is triggered during a strike, of the unit receiving the blow&lt;br /&gt;
&lt;br /&gt;
''value='' is the number of point lost, if any&lt;br /&gt;
&lt;br /&gt;
''value_second='' is the number of the swing, starting from 1&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
==== attack ====&lt;br /&gt;
This animation is triggered during a strike, of the unit giving the blow&lt;br /&gt;
&lt;br /&gt;
''value='' is the number of damage dealt, if any&lt;br /&gt;
&lt;br /&gt;
''value_second='' is the number of the swing, starting from 1&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''offset=&amp;quot;0~0.6:150,0.6~0:150&amp;quot;'' for melee attacks&lt;br /&gt;
No default is provided for range attacks&lt;br /&gt;
==== leading ====&lt;br /&gt;
This animation is triggered for units with the leading special ability, when the unit they are leading is attacking&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is the number of the swing, starting from 1&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== resistance ====&lt;br /&gt;
This animation is triggered for units with the resistance special ability affecting neighbouring fights, when the unit they are helping is defending&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is the number of the swing, starting from 1&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
&lt;br /&gt;
==== death ====&lt;br /&gt;
This animation is triggered when a unit die.&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''highlight=1~0:600'' and plays the sound in ''die_sound='' of the enclosing unit&lt;br /&gt;
==== victory ====&lt;br /&gt;
This animation is triggered when a unit finishes a fight by killing the other unit&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
==== idling ====&lt;br /&gt;
This animation is called when the unit has been using its standing animation for a random duration.&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
&lt;br /&gt;
==== draw_weapon ====&lt;br /&gt;
This animation is played before a fight&lt;br /&gt;
&lt;br /&gt;
''hit='' is set to HIT for the attacker and MISS for the defender&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
&lt;br /&gt;
==== sheath_weapon ====&lt;br /&gt;
This animation is played after a fight simultaneously for all surviving units&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
&lt;br /&gt;
==== default ====&lt;br /&gt;
&lt;br /&gt;
This animation is never triggered, but is used as a base to create new animations&lt;br /&gt;
&lt;br /&gt;
''value='' is used depending of the type of animation it replaces&lt;br /&gt;
&lt;br /&gt;
''value_second='' is used depending of the type of animation it replaces&lt;br /&gt;
&lt;br /&gt;
A single animation made of the base frame is provided by the engine if no default animation is available&lt;br /&gt;
&lt;br /&gt;
==== extra animations ====&lt;br /&gt;
Other values are never called by the engine. However they can be triggered by WML events allowing custom animations.&lt;br /&gt;
&lt;br /&gt;
Note that WML events can also trigger standard animations.&lt;br /&gt;
''value='' is set from the WML event&lt;br /&gt;
&lt;br /&gt;
''value_second='' is set from the WML event&lt;br /&gt;
&lt;br /&gt;
== Shortcuts, tricks and quirks ==&lt;br /&gt;
&lt;br /&gt;
=== ''[if]'' and ''[else]'' ===&lt;br /&gt;
&lt;br /&gt;
Often, you need to do very slight variations in an animation (like a different sound depending on whether the unit hits or misses its attack), the '''[if]''' and '''[else]''' tags are meant to help you do that. &lt;br /&gt;
    &lt;br /&gt;
Using these in an animation is equivalent to having multiple animations, one with the '''[if]''' block and one with each of the ''[else]'' blocks. Any filtering flags in these blocks will replace the toplevel filters. You can have multiple '''[if]''' blocks in an animation, but you can't nest an '''[if]''' inside another. These should be written directly inside the '''[animation]''' block. The following example would make the '''[frame]''' inside the '''[if]''' be played when the attack misses, and the '''[frame]''' inside the '''[else]''' be played when the attack hits (producing a different sound):&lt;br /&gt;
&lt;br /&gt;
    [if]&lt;br /&gt;
        hits=no&lt;br /&gt;
        [frame]&lt;br /&gt;
            begin=-100&lt;br /&gt;
            end=100&lt;br /&gt;
            image=&amp;quot;units/dwarves/lord-attack.png&amp;quot;&lt;br /&gt;
            sound={SOUND_LIST:MISS}&lt;br /&gt;
        [/frame]&lt;br /&gt;
    [/if]&lt;br /&gt;
    [else]&lt;br /&gt;
        hits=yes&lt;br /&gt;
        [frame]&lt;br /&gt;
            begin=-100&lt;br /&gt;
            end=100&lt;br /&gt;
            image=&amp;quot;units/dwarves/lord-attack.png&amp;quot;&lt;br /&gt;
            sound=axe.ogg&lt;br /&gt;
        [/frame]&lt;br /&gt;
    [/else]&lt;br /&gt;
&lt;br /&gt;
note that this is very close to preprocessing and should be considered as such, especially with regard to scoring and animation selection&lt;br /&gt;
&lt;br /&gt;
=== Simplified animation blocks ===&lt;br /&gt;
To simplify the most common animation cases, you can use different blocks instead of the generic '''[animation]''' block. These are also here for backward compatibility, but are not deprecated and fully supported&lt;br /&gt;
&lt;br /&gt;
some of these use extra tags which are translated in the normal ''value='' tag&lt;br /&gt;
&lt;br /&gt;
some of these define '''[xxx_frame]''' blocks where the frame prefix starts with an underscore. This is not allowed in normal WML (prefix starting with underscore is reserved for the engine internal use). It is here for clarity purpose&lt;br /&gt;
&lt;br /&gt;
* '''[leading_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=leading&lt;br /&gt;
* '''[recruit_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=recruited&lt;br /&gt;
* '''[recruiting_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=recruiting&lt;br /&gt;
* '''[standing_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=standing,default&lt;br /&gt;
note for 1.4 :''default'' doesn't exist in 1.4, but the semantic is the same.&lt;br /&gt;
&lt;br /&gt;
i.e: the animation will be used to build default animations&lt;br /&gt;
* '''[idle_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=idling&lt;br /&gt;
* '''[levelin_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=levelin&lt;br /&gt;
* '''[levelout_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=levelout&lt;br /&gt;
* '''[healing_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=healing&lt;br /&gt;
 value=&amp;lt;damage= value&amp;gt;&lt;br /&gt;
* '''[healed_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=healed&lt;br /&gt;
 value=&amp;lt;healing= value&amp;gt;&lt;br /&gt;
 [_healed_sound_frame]&lt;br /&gt;
    sound=heal.wav&lt;br /&gt;
 [/_healed_sound_frame]&lt;br /&gt;
* '''[poison_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=poisoned&lt;br /&gt;
 value=&amp;lt;damage= value&amp;gt;&lt;br /&gt;
 [_poison_sound_frame]&lt;br /&gt;
    sound=poison.ogg&lt;br /&gt;
 [/_poison_sound_frame]&lt;br /&gt;
* '''[movement_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=movement&lt;br /&gt;
 offset=&amp;quot;0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150&amp;quot;&lt;br /&gt;
* '''[pre_movement_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=pre_movement&lt;br /&gt;
* '''[post_movement_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=post_movement&lt;br /&gt;
* '''[draw_weapon_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=draw_weapon&lt;br /&gt;
* '''[sheath_weapon_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=sheath_weapon_movement&lt;br /&gt;
* '''[defend]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=defend&lt;br /&gt;
 value=&amp;lt;damage= value&amp;gt;&lt;br /&gt;
 &amp;lt;WML content&amp;gt;&lt;br /&gt;
 [frame]&lt;br /&gt;
    blend_with=255,0,0&lt;br /&gt;
    blend_ratio=&amp;quot;0.5:50,0.0:50&amp;quot;&lt;br /&gt;
 [/frame]&lt;br /&gt;
&lt;br /&gt;
there are some subtil change compared to what is described above to avoid the red flash when value=0, but it should work as expected as far as WML author are concerned&lt;br /&gt;
 &lt;br /&gt;
* '''[attack_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
if the animation contains a missile frame&lt;br /&gt;
&lt;br /&gt;
 apply_to=attack&lt;br /&gt;
 missile_offset=&amp;quot;0~0.8&amp;quot;&lt;br /&gt;
&lt;br /&gt;
else&lt;br /&gt;
&lt;br /&gt;
 apply_to=attack&lt;br /&gt;
 offset=&amp;quot;0~0.6,0.6~0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* '''[death]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=death&lt;br /&gt;
 [_death_sound_frame]&lt;br /&gt;
    sound=&amp;lt;die_sound= of the enclosing [unit] tag&amp;gt;&lt;br /&gt;
 [/_death_sound_frame]&lt;br /&gt;
* '''[victory_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=victory&lt;br /&gt;
* '''[extra_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=&amp;lt;flag= value of the anim&amp;gt;&lt;br /&gt;
* '''[teleport_anim]''' will be cut into two at the clock-time 0&lt;br /&gt;
everything before zero becomes an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=pre_teleport&lt;br /&gt;
everything after zero becomes an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=post_teleport&lt;br /&gt;
&lt;br /&gt;
== Layering ==&lt;br /&gt;
The ''layer'' progressive parameter allows the animation writer to choose in what order the animation should be drawn.&lt;br /&gt;
&lt;br /&gt;
this value must be between 0 and 100&lt;br /&gt;
&lt;br /&gt;
* the back of haloes is drawn with a value of 10&lt;br /&gt;
* when unspecified, a animation is drawn with a value of 40&lt;br /&gt;
* terrain elements that are supposed to go in front of units (castles) are drawn with a value of 50&lt;br /&gt;
* orbs and status bars are drawn on layer 80&lt;br /&gt;
* when unspecified missile frames are drawn on layer 90&lt;br /&gt;
&lt;br /&gt;
by changing these values, it is easy to have the unit display the way you want&lt;br /&gt;
&lt;br /&gt;
== Optimization ==&lt;br /&gt;
&lt;br /&gt;
there is a special flag that goes into the animation block (not the frame) &lt;br /&gt;
&lt;br /&gt;
* ''offscreen'' a boolean saying if the unit's animation should be played when the unit is offscreen. You want the animation to play offscreen if the animation contains some usefull sound effects.This attribute defaults to true (play offscreen) except for standing and idle animations where it defaults to false&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[UnitTypeWML]]&lt;br /&gt;
* [[ReferenceWML]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: WML Reference]]&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=AnimationWML&amp;diff=38604</id>
		<title>AnimationWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=AnimationWML&amp;diff=38604"/>
		<updated>2010-10-02T10:27:59Z</updated>

		<summary type="html">&lt;p&gt;Boucman: /* Field Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WML Tags}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This page covers unit animations. At any point in game, units are playing an animation. Even when the unit is standing, it is actually playing a single frame animation.&lt;br /&gt;
&lt;br /&gt;
This page will deal with the two problems of animations&lt;br /&gt;
* How are animations Chosen&lt;br /&gt;
* What exactly is drawn&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How animations are drawn ==&lt;br /&gt;
=== Animations ===&lt;br /&gt;
Any unit has a huge set of animations to choose from. Animations are WML blocks in the unit type, enclosed in either the generic type '''[animation]''' or some more specific tags such as '''[attack_anim]''' '''[idle_anim]''' and the like. An animation is what a unit displays when a given event is triggered, and a certain set of conditions are met such as&lt;br /&gt;
* unit is attacking&lt;br /&gt;
* unit is idling&lt;br /&gt;
* unit is attacking (event) and uses a melee weapon (condition)&lt;br /&gt;
* unit is attacking (event) and uses a melee weapon (condition) and opponent can't retaliate (condition)&lt;br /&gt;
&lt;br /&gt;
events and conditions are described entirely in the [animation] block, and will be discussed in the animation choice section.&lt;br /&gt;
&lt;br /&gt;
=== Frames ===&lt;br /&gt;
    &lt;br /&gt;
An animation is cut in frames. Frames are WML blocks that are contained either in '''[frame]''' WML blocks or in generic '''[xxx_frame]''' block. (the xxx part can be any string not starting with an underscore) the xxx part in the frame name is called the frame prefix. frames of the type '''[frame]''' are said to have an empty prefix&lt;br /&gt;
&lt;br /&gt;
A frame typically describes an image, where an how to render it. It can contain such things as&lt;br /&gt;
* the image to display&lt;br /&gt;
* how transparent should that image be&lt;br /&gt;
* where to draw that image.&lt;br /&gt;
&lt;br /&gt;
At any given time, an animation will display one frame for each frame prefix it can find. I.e if your animation has both '''[frame]''' and '''[missile_frame]''' blocks, both will be displayed at the same time&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The frame with the empty prefix is special in many way. It is assumed to contain the image representing the unit itself, and as such the engine will heavily temper with it in multiple ways, such as providing a default image if none is available, or forcing the image to be green when the unit is poisoned&lt;br /&gt;
&lt;br /&gt;
=== Timing, Clock, Multiple animations ===&lt;br /&gt;
When an animation is played it has an internal clock that is run. The step of this clock is the milisecond, and each frame is played for a given duration. Each animation also has a starting time which tells the animation engine at what value the animation clock should start&lt;br /&gt;
&lt;br /&gt;
This starting time is very important when multiple animations from different units are played synchronously  Typically a fight involves a unit playing its defense animation while the opponent plays it's attack animation (and a third might play its leading animation, too). In that case all animations have a common clock, and are played concurrently.&lt;br /&gt;
&lt;br /&gt;
The convention is that the &amp;quot;important time&amp;quot; (usually the time of the hit) is at time 0. everything before should be at negative time, everything after at positive time. This is a WML convention that is not enforced by the engine&lt;br /&gt;
&lt;br /&gt;
In that case, it is very important that these animations (which can have different lengths) be synchronized. Fight animations are synchronized around the point of impact, so they all reach time 0 when the attack lands (or misses). This is accomplished through the use of the '''start_time''' key of the '''[animation]''' tag.&lt;br /&gt;
&lt;br /&gt;
Just like the '''[frame]''' tag can have a prefix, so can the '''start_time''' key. A '''start_time''' key without prefix will affect a '''[frame]''' tag without prefix, while a '''start_time''' key with a prefix will affect a '''[frame]''' tag with the same prefix.&lt;br /&gt;
&lt;br /&gt;
==== Example Syntax ====&lt;br /&gt;
    [attack_anim]&lt;br /&gt;
        [filter_attack]&lt;br /&gt;
            name=bow&lt;br /&gt;
        [/filter_attack]&lt;br /&gt;
        '''start_time'''=-350&lt;br /&gt;
        '''missile_start_time'''=-150&lt;br /&gt;
        [missile_frame]&lt;br /&gt;
            duration=150&lt;br /&gt;
            image=&amp;quot;projectiles/missile-n.png&amp;quot;&lt;br /&gt;
            image_diagonal=&amp;quot;projectiles/missile-ne.png&amp;quot;&lt;br /&gt;
        [/missile_frame]&lt;br /&gt;
        [if]&lt;br /&gt;
            hits=yes&lt;br /&gt;
            [frame]&lt;br /&gt;
                duration=350&lt;br /&gt;
                sound=bow.ogg&lt;br /&gt;
            [/frame]&lt;br /&gt;
        [/if]&lt;br /&gt;
        [else]&lt;br /&gt;
            hits=no&lt;br /&gt;
            [frame]&lt;br /&gt;
                duration=350&lt;br /&gt;
                sound=bow-miss.ogg&lt;br /&gt;
            [/frame]&lt;br /&gt;
        [/else]&lt;br /&gt;
    [/attack_anim]&lt;br /&gt;
&lt;br /&gt;
=== The content of a frame ===&lt;br /&gt;
==== Syntax summary ====&lt;br /&gt;
 [frame]&lt;br /&gt;
    duration=&amp;lt;integer&amp;gt;&lt;br /&gt;
    begin=&amp;lt;deprecated,integer&amp;gt;&lt;br /&gt;
    end=&amp;lt;deprecated,integer&amp;gt;&lt;br /&gt;
    image=&amp;lt;string&amp;gt;&lt;br /&gt;
    image_diagonal=&amp;lt;string&amp;gt;&lt;br /&gt;
    image_mod=&amp;lt;string&amp;gt;&lt;br /&gt;
    sound=&amp;lt;string&amp;gt;&lt;br /&gt;
    halo=&amp;lt;progressive string&amp;gt;&lt;br /&gt;
    halo_x=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
    halo_y=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
    halo_mod=&amp;lt;string&amp;gt;&lt;br /&gt;
    alpha=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
    offset=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
    blend_color=&amp;lt; red, green, blue &amp;gt;&lt;br /&gt;
    blend_ratio=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
    text=&amp;lt;string&amp;gt;&lt;br /&gt;
    text_color=&amp;lt; red, green, blue &amp;gt;&lt;br /&gt;
    submerge=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
    x=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
    y=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
    directional_x=&amp;lt;dev feature 1.9,progressive int&amp;gt;&lt;br /&gt;
    directional_y=&amp;lt;dev feature 1.9,progressive int&amp;gt;&lt;br /&gt;
    layer=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
 [/frame]&lt;br /&gt;
&lt;br /&gt;
==== Progressive parameters ====&lt;br /&gt;
&lt;br /&gt;
Some parameters above are marked as ''progressive'' This means that you can specify that during the time the frame is displayed, the parameter should smoothly slide from one value to an other.&lt;br /&gt;
&lt;br /&gt;
A typical example would be a unit progressively fading out, becoming transparent&lt;br /&gt;
&lt;br /&gt;
To do that, you could use:&lt;br /&gt;
&lt;br /&gt;
 alpha=1~0&lt;br /&gt;
&lt;br /&gt;
To make a frame, which is 900ms long, slide to transparent for 300ms, stay transparent for another 300ms and finally fade back to normal for 300ms, use:&lt;br /&gt;
&lt;br /&gt;
 alpha=1~0:300,0:300,0~1:300&lt;br /&gt;
&lt;br /&gt;
you could also specify it like that&lt;br /&gt;
&lt;br /&gt;
 alpha=1~0,0,0~1&lt;br /&gt;
&lt;br /&gt;
when a timing is missing, the engine will do its best to fill in in a fair way. &lt;br /&gt;
&lt;br /&gt;
a progressive string has a similar syntax&lt;br /&gt;
&lt;br /&gt;
 halo=halo1.png:300,halo2.png:300,halo2.png:300&lt;br /&gt;
&lt;br /&gt;
==== Field Description ====&lt;br /&gt;
&lt;br /&gt;
** '''begin''': (deprecated) will be replaced by '''duration= &amp;lt;end - begin &amp;gt;'''&lt;br /&gt;
** '''end''': (deprecated) see '''begin''' and also [[AnimationWML#Timing.2C_Clock.2C_Multiple_animations|Timing, Clock, Multiple animations]] section for coverage of '''start_time''' which combines with '''duration''' to replace '''begin=''' '''end='''.&lt;br /&gt;
** '''duration''': how long the frame should be displayed. Use instead of '''begin=''' and '''end='''.&lt;br /&gt;
** '''image''': the image to display during the frame.&lt;br /&gt;
** '''image_diagonal''': the image to display when the attack occurs diagonally (directions ne,se,sw,nw).&lt;br /&gt;
** '''image_mod''': a string modifications (see [[ImagePathFunctionWML]] ) that will be applied to all images&lt;br /&gt;
** '''sound''': the sound to play when the frame begins. Can be a comma-separated list of sounds, in which case one of them is chosen randomly every time.&lt;br /&gt;
** '''halo''': the halo to display at the time.&lt;br /&gt;
** '''halo_x''': the position the halo is displayed in pixel relative to the unit's center.&lt;br /&gt;
** '''halo_y''': the position the halo is displayed in pixel relative to the unit's center.&lt;br /&gt;
** '''halo_mod''': a string modifications (see [[ImagePathFunctionWML]] ) that will be applied to all haloes&lt;br /&gt;
** '''alpha''': transparency level to apply to the frame. This is a floating point progressive parameter ranging from 0.0 to 1.0.&lt;br /&gt;
** '''offset''': the position of the image relative to the hex the unit is facing, 0.0 will display the unit in the center of the hex, 1.0 in the center of the faced hex, -1.0 at the center of the hex behind you. This is a progressive parameter.&lt;br /&gt;
** '''blend_color''': a comma separated list of numbers representing a color in RGB (0-255) this color will be mixed to the frame to give it a tint.&lt;br /&gt;
** '''blend_ratio''': this is a progressive parameter ranging from 0 to 1: 0 means no tint, 1 means target color only.&lt;br /&gt;
** '''text''': if specified, floats a label with the given text above the unit (identical to the floating damage and healing numbers).&lt;br /&gt;
** '''text_color''': the color of the above floating label.&lt;br /&gt;
** '''submerge''': the part of the unit that should drawn with 50% opacity (for units in water)&lt;br /&gt;
** '''x''': x offset applied to the frame&lt;br /&gt;
** '''y''': y offset applied to the frame&lt;br /&gt;
** '''directional_x''': x offset applied to the frame in the direction the unit is facing&lt;br /&gt;
** '''directional_y''': y offset applied to the frame in the direction the unit is facing&lt;br /&gt;
** '''layer''': layer used to draw the frame, see discussion bellow&lt;br /&gt;
&lt;br /&gt;
=== Drawing related animation content ===&lt;br /&gt;
==== Syntax summary ====&lt;br /&gt;
 [animation]&lt;br /&gt;
   &amp;lt;animation choice related content&amp;gt;&lt;br /&gt;
   [frame]&lt;br /&gt;
     &amp;lt;frame content&amp;gt;&lt;br /&gt;
   [/frame]&lt;br /&gt;
   [frame]&lt;br /&gt;
     &amp;lt;frame content&amp;gt;&lt;br /&gt;
   [/frame]&lt;br /&gt;
   start_time=&amp;lt;integer&amp;gt;&lt;br /&gt;
   offset=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
   image_mod=&amp;lt;string&amp;gt;&lt;br /&gt;
   blend_with=&amp;lt;r,g,b&amp;gt;&lt;br /&gt;
   blend_ratio=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
   halo=&amp;lt;progressive_string&amp;gt;&lt;br /&gt;
   halo_x=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   halo_y=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   halo_mod=&amp;lt;string&amp;gt;&lt;br /&gt;
   submerge=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
   x=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   y=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   layer=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   [xxx_frame]&lt;br /&gt;
     &amp;lt;frame content&amp;gt;&lt;br /&gt;
   [/xxx_frame]&lt;br /&gt;
   xxx_start_time=&amp;lt;integer&amp;gt;&lt;br /&gt;
   xxx_image_mod=&amp;lt;string&amp;gt;&lt;br /&gt;
   xxx_offset=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
   xxx_blend_with=&amp;lt;r,g,b&amp;gt;&lt;br /&gt;
   xxx_blend_ratio=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
   xxx_halo=&amp;lt;progressive_string&amp;gt;&lt;br /&gt;
   xxx_halo_x=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   xxx_halo_y=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   xxx_halo_mod=&amp;lt;string&amp;gt;&lt;br /&gt;
   xxx_submerge=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
   xxx_x=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   xxx_y=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   xxx_layer=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 [/animation]&lt;br /&gt;
&lt;br /&gt;
==== Parameter handling ====&lt;br /&gt;
All drawing related parameters in '''[animation]''' can be matched with a corresponding parameter in  a '''[frame]''' block (or a '''[xxx_frame]''' block) The value provided in the animation will be used if no value is provided in the frame. &lt;br /&gt;
&lt;br /&gt;
The point of these two level of parameters is to easily be able to specify a parameter at the animation level and override it for a special case of frame.&lt;br /&gt;
&lt;br /&gt;
== How animations are chosen ==&lt;br /&gt;
Within a unit decription block there are multiple animations. Each animation is meant to be played in a very special set of circumstances. We will discuss here how to tell the animation engine when a given animation should be played. &lt;br /&gt;
&lt;br /&gt;
Let's take an example. Suppose we have a unit which has the skirmisher ability. We have the folowing movement animations :&lt;br /&gt;
* a normal walking animation&lt;br /&gt;
* a swimming animation when the unit is in water&lt;br /&gt;
* a tiptioeing animation when moving next to an ennemy unit&lt;br /&gt;
&lt;br /&gt;
Ok. most of the time it's easy to guess what animation should be. However if you are both in water and next to an ennemy unit, the animation to play is not obvious.&lt;br /&gt;
&lt;br /&gt;
To solve that question, each animation has a number of filtering criterias. The engine follow the following rules to select an animation&lt;br /&gt;
* Start with all animations&lt;br /&gt;
* Drop all animations with a criteria that fails on the current situation&lt;br /&gt;
* Take the animations that have the most maching criterias&lt;br /&gt;
* If there are more than one animation remaining, take an animation randomly&lt;br /&gt;
* If all animations have been droped, the engine will provide a smart default.&lt;br /&gt;
    &lt;br /&gt;
here is a pseudo-code explaination of this algorithm:&lt;br /&gt;
&lt;br /&gt;
 foreach animation&lt;br /&gt;
    animation_score = 0&lt;br /&gt;
    foreach filter-criteria&lt;br /&gt;
      if &amp;lt;criteria-fails&amp;gt; &lt;br /&gt;
          animation_score = -1;&lt;br /&gt;
          break;&lt;br /&gt;
      elsif &amp;lt;criteria-matches&amp;gt; &lt;br /&gt;
          animation_score++&lt;br /&gt;
    endfor&lt;br /&gt;
    if animation_score &amp;gt; max_score&lt;br /&gt;
        &amp;lt;empty animation list&amp;gt;&lt;br /&gt;
        max_score = animation_score;&lt;br /&gt;
        push(animation,animation_list);&lt;br /&gt;
    elsif animation_score = max_score&lt;br /&gt;
        push(animation,animation_list);&lt;br /&gt;
 endfor&lt;br /&gt;
 &amp;lt;choose an animation randomly from animation_list&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
Note that all animations don't have all the filters...&lt;br /&gt;
&lt;br /&gt;
so, if we have a unit with&lt;br /&gt;
# an animation for water terrain&lt;br /&gt;
# an animation for SE on grassland&lt;br /&gt;
# an animation with no criteria&lt;br /&gt;
# an animation for N,NE,NW,S,SW,SE&lt;br /&gt;
# an animation for NW&lt;br /&gt;
&lt;br /&gt;
* 3. will never be taken, because 4. will always trump it&lt;br /&gt;
* on water going NW, it can be 1. 4. 5.&lt;br /&gt;
* on water, any direction but NW, it will be 1. or 4.&lt;br /&gt;
* on SE grassland it will be 2.&lt;br /&gt;
* on other grasslands, it will be 4. (4. or 5. if NW)&lt;br /&gt;
&lt;br /&gt;
=== Generic animation filters available for all animations ===&lt;br /&gt;
* '''apply_to''': a list of comma separated keywords describing what event should trigger the animation (movement, attack...) the complete list is given below&lt;br /&gt;
* '''value''': a list of comma separated integer, the meaning depends on the triggering event. the meaning is given with the list of event&lt;br /&gt;
* '''value_second''': a list of comma separated integer, the meaning depends on the triggering event. the meaning is given with the list of event&lt;br /&gt;
* '''terrain''': a list of comma separated terrain letters, the animation will only be used on these terrains.  See [[FilterWML]].  this has been replaced by '''terrain_type'''&lt;br /&gt;
* '''terrain_type''': a list of comma separated terrain letters, the animation will only be used on these terrains.  See [[FilterWML]].&lt;br /&gt;
* '''[filter]''': this will filter using a standard unit filter on the animated unit. Note that matching all criterias in the filter will only earn you one point for animation selection, but that you can have multiple '''[filter]''' blocks in an animation.&lt;br /&gt;
* '''[filter_second]''': this will filter using a standard unit filter on the unit in the hex faced. Note that matching all criteria in the filter will only earn you one point for animation selection, but that you can have multiple '''[filter_second]''' blocks in an animation. Also note that if the faced hex is empty, the whole filter will fail.&lt;br /&gt;
* '''direction''': a list of directions (n,ne,se,s,sw,nw), the animation will only be used when acting or moving in this direction (the attack direction for attack animations, moving direction for movement animations, direction of lead unit for leading animations, and so on).&lt;br /&gt;
* '''frequency''': this integer value allows to easily tweak the matching frequency of animations. The filter will fail n-1 times out of n, randomly. Note that unlike every other filter, matching this filter won't give an extra point.&lt;br /&gt;
* '''[filter_attack]''': a standard attack filter to match on the attacker's attack. See  [[FilterWML]]. &lt;br /&gt;
* '''[filter_second_attack]''': a standard attack filter to match on the defender's attack. See [[FilterWML]]. Also note that if the defender doesn't have any weapon to retaliate with, this filter will always fail. &lt;br /&gt;
* '''hits''': filters attack animations based on whether the attack hits, misses or kills. Accepts a list of the following:&lt;br /&gt;
** '''hit''': the attack hits, defender survives.&lt;br /&gt;
** '''no''' or '''miss''': the attack misses.&lt;br /&gt;
** '''kill''': the attack hits, defender dies.&lt;br /&gt;
** '''yes''': is an alias of '''hit,kill'''.&lt;br /&gt;
* '''swing''': a list of numbers representing the swing numbers this animation should match (numbered from 1). this has been replaced by value_second&lt;br /&gt;
* '''base_score''': {{DevFeature1.9}} : a number that will always be added to the score. Use with caution&lt;br /&gt;
&lt;br /&gt;
=== Events triggering animations and default animations ===&lt;br /&gt;
==== standing ====&lt;br /&gt;
This animation is triggered whenever any other animation is finished, and is played in loop until another animation is triggered&lt;br /&gt;
&lt;br /&gt;
this is the default &amp;quot;standing image&amp;quot; for the unit&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no standing animation is set a single frame animation based on the enclosing unit's '''image=''' field is used&lt;br /&gt;
==== selected ====&lt;br /&gt;
This animation is triggered whenever the unit is selected&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''blend_with=&amp;quot;0.0~0.3:100,0.3~0.0:200&amp;quot; blend_color=255,255,255''&lt;br /&gt;
==== recruited ====&lt;br /&gt;
This animation is triggered whenever the unit is recruited or recalled&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''highlight=0~1:600''&lt;br /&gt;
&lt;br /&gt;
==== recruiting ====&lt;br /&gt;
&lt;br /&gt;
This animation is triggered for the leader when a unit is recruited or recalled&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
no default animation is needed&lt;br /&gt;
&lt;br /&gt;
note that is not triggered for WML triggered animations&lt;br /&gt;
&lt;br /&gt;
==== levelin ====&lt;br /&gt;
This animation is triggered whenever the unit levels, before the unit is replaced by the new unit&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''blend_with=&amp;quot;1~0:600&amp;quot; blend_color=255,255,255''&lt;br /&gt;
==== levelout ====&lt;br /&gt;
This animation is triggered whenever the unit levels, after the unit is replaced by the new unit&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''blend_with=&amp;quot;0~1:600&amp;quot; blend_color=255,255,255''&lt;br /&gt;
==== movement ====&lt;br /&gt;
This animation is used whenever a unit moves. There are multiple things to consider when dealing with movement animation&lt;br /&gt;
* unit stay ''exactly'' 150ms in each hex. so you typically want to have an offset of ''0~1:150,0~1:150,0~1:150,0~1:150,0~1:150'' or something similar&lt;br /&gt;
* when a unit enters a hex, the current anim is tested again.&lt;br /&gt;
** if the current animation is still valid (i.e it passes all its filter) it is kept, whatever the final score is&lt;br /&gt;
** if it fails, a new movement anim is searched&lt;br /&gt;
&lt;br /&gt;
''value='' contains the number of steps already taken&lt;br /&gt;
&lt;br /&gt;
''value_second='' contains the number of steps left&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''offset=&amp;quot;0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
==== pre_movement ====&lt;br /&gt;
This animation is used before any unit movement&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0 &lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0 &lt;br /&gt;
&lt;br /&gt;
==== post_movement ====&lt;br /&gt;
This animation is used after any unit movement&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0 &lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
==== pre_teleport ====&lt;br /&gt;
This animation is triggered whenever the unit teleports, but before it has moved to the target hex&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''blend_with=&amp;quot;1~0:150&amp;quot; blend_color=255,255,255''&lt;br /&gt;
==== post_teleport ====&lt;br /&gt;
This animation is triggered whenever the unit teleports, but after it has moved to the target hex&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''blend_with=&amp;quot;0~1:150&amp;quot; blend_color=255,255,255''&lt;br /&gt;
==== healing ====&lt;br /&gt;
This animation is triggered when the unit has healing powers and uses them&lt;br /&gt;
&lt;br /&gt;
''value='' is the number of points healed&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
==== healed ====&lt;br /&gt;
This animation is triggered whenever the unit is healed for any reason&lt;br /&gt;
&lt;br /&gt;
''value='' is the number of points healed&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''blend_with=&amp;quot;0:30,0.5:30,0:30,0.5:30,0:30,0.5:30,0:30,0.5:30,0:30&amp;quot; blend_color=255,255,255''&lt;br /&gt;
and plays the sound ''heal.wav''&lt;br /&gt;
==== poisoned ====&lt;br /&gt;
This animation is triggered whenever the unit suffers poison dammage&lt;br /&gt;
&lt;br /&gt;
''value='' is the number of points lost&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''blend_with=&amp;quot;0:30,0.5:30,0:30,0.5:30,0:30,0.5:30,0:30,0.5:30,0:30&amp;quot; blend_color=0,255,0''&lt;br /&gt;
and plays the sound 'poison.ogg''&lt;br /&gt;
==== defend ====&lt;br /&gt;
This animation is triggered during a strike, of the unit receiving the blow&lt;br /&gt;
&lt;br /&gt;
''value='' is the number of point lost, if any&lt;br /&gt;
&lt;br /&gt;
''value_second='' is the number of the swing, starting from 1&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
==== attack ====&lt;br /&gt;
This animation is triggered during a strike, of the unit giving the blow&lt;br /&gt;
&lt;br /&gt;
''value='' is the number of damage dealt, if any&lt;br /&gt;
&lt;br /&gt;
''value_second='' is the number of the swing, starting from 1&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''offset=&amp;quot;0~0.6:150,0.6~0:150&amp;quot;'' for melee attacks&lt;br /&gt;
No default is provided for range attacks&lt;br /&gt;
==== leading ====&lt;br /&gt;
This animation is triggered for units with the leading special ability, when the unit they are leading is attacking&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is the number of the swing, starting from 1&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== resistance ====&lt;br /&gt;
This animation is triggered for units with the resistance special ability affecting neighbouring fights, when the unit they are helping is defending&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is the number of the swing, starting from 1&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
&lt;br /&gt;
==== death ====&lt;br /&gt;
This animation is triggered when a unit die.&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''highlight=1~0:600'' and plays the sound in ''die_sound='' of the enclosing unit&lt;br /&gt;
==== victory ====&lt;br /&gt;
This animation is triggered when a unit finishes a fight by killing the other unit&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
==== idling ====&lt;br /&gt;
This animation is called when the unit has been using its standing animation for a random duration.&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
&lt;br /&gt;
==== draw_weapon ====&lt;br /&gt;
This animation is played before a fight&lt;br /&gt;
&lt;br /&gt;
''hit='' is set to HIT for the attacker and MISS for the defender&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
&lt;br /&gt;
==== sheath_weapon ====&lt;br /&gt;
This animation is played after a fight simultaneously for all surviving units&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
&lt;br /&gt;
==== default ====&lt;br /&gt;
&lt;br /&gt;
This animation is never triggered, but is used as a base to create new animations&lt;br /&gt;
&lt;br /&gt;
''value='' is used depending of the type of animation it replaces&lt;br /&gt;
&lt;br /&gt;
''value_second='' is used depending of the type of animation it replaces&lt;br /&gt;
&lt;br /&gt;
A single animation made of the base frame is provided by the engine if no default animation is available&lt;br /&gt;
&lt;br /&gt;
==== extra animations ====&lt;br /&gt;
Other values are never called by the engine. However they can be triggered by WML events allowing custom animations.&lt;br /&gt;
&lt;br /&gt;
Note that WML events can also trigger standard animations.&lt;br /&gt;
''value='' is set from the WML event&lt;br /&gt;
&lt;br /&gt;
''value_second='' is set from the WML event&lt;br /&gt;
&lt;br /&gt;
== Shortcuts, tricks and quirks ==&lt;br /&gt;
&lt;br /&gt;
=== ''[if]'' and ''[else]'' ===&lt;br /&gt;
&lt;br /&gt;
Often, you need to do very slight variations in an animation (like a different sound depending on whether the unit hits or misses its attack), the '''[if]''' and '''[else]''' tags are meant to help you do that. &lt;br /&gt;
    &lt;br /&gt;
Using these in an animation is equivalent to having multiple animations, one with the '''[if]''' block and one with each of the ''[else]'' blocks. Any filtering flags in these blocks will replace the toplevel filters. You can have multiple '''[if]''' blocks in an animation, but you can't nest an '''[if]''' inside another. These should be written directly inside the '''[animation]''' block. The following example would make the '''[frame]''' inside the '''[if]''' be played when the attack misses, and the '''[frame]''' inside the '''[else]''' be played when the attack hits (producing a different sound):&lt;br /&gt;
&lt;br /&gt;
    [if]&lt;br /&gt;
        hits=no&lt;br /&gt;
        [frame]&lt;br /&gt;
            begin=-100&lt;br /&gt;
            end=100&lt;br /&gt;
            image=&amp;quot;units/dwarves/lord-attack.png&amp;quot;&lt;br /&gt;
            sound={SOUND_LIST:MISS}&lt;br /&gt;
        [/frame]&lt;br /&gt;
    [/if]&lt;br /&gt;
    [else]&lt;br /&gt;
        hits=yes&lt;br /&gt;
        [frame]&lt;br /&gt;
            begin=-100&lt;br /&gt;
            end=100&lt;br /&gt;
            image=&amp;quot;units/dwarves/lord-attack.png&amp;quot;&lt;br /&gt;
            sound=axe.ogg&lt;br /&gt;
        [/frame]&lt;br /&gt;
    [/else]&lt;br /&gt;
&lt;br /&gt;
note that this is very close to preprocessing and should be considered as such, especially with regard to scoring and animation selection&lt;br /&gt;
&lt;br /&gt;
=== Simplified animation blocks ===&lt;br /&gt;
To simplify the most common animation cases, you can use different blocks instead of the generic '''[animation]''' block. These are also here for backward compatibility, but are not deprecated and fully supported&lt;br /&gt;
&lt;br /&gt;
some of these use extra tags which are translated in the normal ''value='' tag&lt;br /&gt;
&lt;br /&gt;
some of these define '''[xxx_frame]''' blocks where the frame prefix starts with an underscore. This is not allowed in normal WML (prefix starting with underscore is reserved for the engine internal use). It is here for clarity purpose&lt;br /&gt;
&lt;br /&gt;
* '''[leading_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=leading&lt;br /&gt;
* '''[recruit_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=recruited&lt;br /&gt;
* '''[recruiting_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=recruiting&lt;br /&gt;
* '''[standing_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=standing,default&lt;br /&gt;
note for 1.4 :''default'' doesn't exist in 1.4, but the semantic is the same.&lt;br /&gt;
&lt;br /&gt;
i.e: the animation will be used to build default animations&lt;br /&gt;
* '''[idle_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=idling&lt;br /&gt;
* '''[levelin_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=levelin&lt;br /&gt;
* '''[levelout_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=levelout&lt;br /&gt;
* '''[healing_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=healing&lt;br /&gt;
 value=&amp;lt;damage= value&amp;gt;&lt;br /&gt;
* '''[healed_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=healed&lt;br /&gt;
 value=&amp;lt;healing= value&amp;gt;&lt;br /&gt;
 [_healed_sound_frame]&lt;br /&gt;
    sound=heal.wav&lt;br /&gt;
 [/_healed_sound_frame]&lt;br /&gt;
* '''[poison_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=poisoned&lt;br /&gt;
 value=&amp;lt;damage= value&amp;gt;&lt;br /&gt;
 [_poison_sound_frame]&lt;br /&gt;
    sound=poison.ogg&lt;br /&gt;
 [/_poison_sound_frame]&lt;br /&gt;
* '''[movement_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=movement&lt;br /&gt;
 offset=&amp;quot;0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150&amp;quot;&lt;br /&gt;
* '''[pre_movement_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=pre_movement&lt;br /&gt;
* '''[post_movement_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=post_movement&lt;br /&gt;
* '''[draw_weapon_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=draw_weapon&lt;br /&gt;
* '''[sheath_weapon_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=sheath_weapon_movement&lt;br /&gt;
* '''[defend]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=defend&lt;br /&gt;
 value=&amp;lt;damage= value&amp;gt;&lt;br /&gt;
 &amp;lt;WML content&amp;gt;&lt;br /&gt;
 [frame]&lt;br /&gt;
    blend_with=255,0,0&lt;br /&gt;
    blend_ratio=&amp;quot;0.5:50,0.0:50&amp;quot;&lt;br /&gt;
 [/frame]&lt;br /&gt;
&lt;br /&gt;
there are some subtil change compared to what is described above to avoid the red flash when value=0, but it should work as expected as far as WML author are concerned&lt;br /&gt;
 &lt;br /&gt;
* '''[attack_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
if the animation contains a missile frame&lt;br /&gt;
&lt;br /&gt;
 apply_to=attack&lt;br /&gt;
 missile_offset=&amp;quot;0~0.8&amp;quot;&lt;br /&gt;
&lt;br /&gt;
else&lt;br /&gt;
&lt;br /&gt;
 apply_to=attack&lt;br /&gt;
 offset=&amp;quot;0~0.6,0.6~0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* '''[death]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=death&lt;br /&gt;
 [_death_sound_frame]&lt;br /&gt;
    sound=&amp;lt;die_sound= of the enclosing [unit] tag&amp;gt;&lt;br /&gt;
 [/_death_sound_frame]&lt;br /&gt;
* '''[victory_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=victory&lt;br /&gt;
* '''[extra_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=&amp;lt;flag= value of the anim&amp;gt;&lt;br /&gt;
* '''[teleport_anim]''' will be cut into two at the clock-time 0&lt;br /&gt;
everything before zero becomes an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=pre_teleport&lt;br /&gt;
everything after zero becomes an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=post_teleport&lt;br /&gt;
&lt;br /&gt;
== Layering ==&lt;br /&gt;
The ''layer'' progressive parameter allows the animation writer to choose in what order the animation should be drawn.&lt;br /&gt;
&lt;br /&gt;
this value must be between 0 and 100&lt;br /&gt;
&lt;br /&gt;
* the back of haloes is drawn with a value of 10&lt;br /&gt;
* when unspecified, a animation is drawn with a value of 40&lt;br /&gt;
* terrain elements that are supposed to go in front of units (castles) are drawn with a value of 50&lt;br /&gt;
* orbs and status bars are drawn on layer 80&lt;br /&gt;
* when unspecified missile frames are drawn on layer 90&lt;br /&gt;
&lt;br /&gt;
by changing these values, it is easy to have the unit display the way you want&lt;br /&gt;
&lt;br /&gt;
== Optimization ==&lt;br /&gt;
&lt;br /&gt;
there is a special flag that goes into the animation block (not the frame) &lt;br /&gt;
&lt;br /&gt;
* ''offscreen'' a boolean saying if the unit's animation should be played when the unit is offscreen. You want the animation to play offscreen if the animation contains some usefull sound effects.This attribute defaults to true (play offscreen) except for standing and idle animations where it defaults to false&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[UnitTypeWML]]&lt;br /&gt;
* [[ReferenceWML]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: WML Reference]]&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=AnimationWML&amp;diff=38603</id>
		<title>AnimationWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=AnimationWML&amp;diff=38603"/>
		<updated>2010-10-02T10:27:14Z</updated>

		<summary type="html">&lt;p&gt;Boucman: /* Syntax summary */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WML Tags}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This page covers unit animations. At any point in game, units are playing an animation. Even when the unit is standing, it is actually playing a single frame animation.&lt;br /&gt;
&lt;br /&gt;
This page will deal with the two problems of animations&lt;br /&gt;
* How are animations Chosen&lt;br /&gt;
* What exactly is drawn&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How animations are drawn ==&lt;br /&gt;
=== Animations ===&lt;br /&gt;
Any unit has a huge set of animations to choose from. Animations are WML blocks in the unit type, enclosed in either the generic type '''[animation]''' or some more specific tags such as '''[attack_anim]''' '''[idle_anim]''' and the like. An animation is what a unit displays when a given event is triggered, and a certain set of conditions are met such as&lt;br /&gt;
* unit is attacking&lt;br /&gt;
* unit is idling&lt;br /&gt;
* unit is attacking (event) and uses a melee weapon (condition)&lt;br /&gt;
* unit is attacking (event) and uses a melee weapon (condition) and opponent can't retaliate (condition)&lt;br /&gt;
&lt;br /&gt;
events and conditions are described entirely in the [animation] block, and will be discussed in the animation choice section.&lt;br /&gt;
&lt;br /&gt;
=== Frames ===&lt;br /&gt;
    &lt;br /&gt;
An animation is cut in frames. Frames are WML blocks that are contained either in '''[frame]''' WML blocks or in generic '''[xxx_frame]''' block. (the xxx part can be any string not starting with an underscore) the xxx part in the frame name is called the frame prefix. frames of the type '''[frame]''' are said to have an empty prefix&lt;br /&gt;
&lt;br /&gt;
A frame typically describes an image, where an how to render it. It can contain such things as&lt;br /&gt;
* the image to display&lt;br /&gt;
* how transparent should that image be&lt;br /&gt;
* where to draw that image.&lt;br /&gt;
&lt;br /&gt;
At any given time, an animation will display one frame for each frame prefix it can find. I.e if your animation has both '''[frame]''' and '''[missile_frame]''' blocks, both will be displayed at the same time&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The frame with the empty prefix is special in many way. It is assumed to contain the image representing the unit itself, and as such the engine will heavily temper with it in multiple ways, such as providing a default image if none is available, or forcing the image to be green when the unit is poisoned&lt;br /&gt;
&lt;br /&gt;
=== Timing, Clock, Multiple animations ===&lt;br /&gt;
When an animation is played it has an internal clock that is run. The step of this clock is the milisecond, and each frame is played for a given duration. Each animation also has a starting time which tells the animation engine at what value the animation clock should start&lt;br /&gt;
&lt;br /&gt;
This starting time is very important when multiple animations from different units are played synchronously  Typically a fight involves a unit playing its defense animation while the opponent plays it's attack animation (and a third might play its leading animation, too). In that case all animations have a common clock, and are played concurrently.&lt;br /&gt;
&lt;br /&gt;
The convention is that the &amp;quot;important time&amp;quot; (usually the time of the hit) is at time 0. everything before should be at negative time, everything after at positive time. This is a WML convention that is not enforced by the engine&lt;br /&gt;
&lt;br /&gt;
In that case, it is very important that these animations (which can have different lengths) be synchronized. Fight animations are synchronized around the point of impact, so they all reach time 0 when the attack lands (or misses). This is accomplished through the use of the '''start_time''' key of the '''[animation]''' tag.&lt;br /&gt;
&lt;br /&gt;
Just like the '''[frame]''' tag can have a prefix, so can the '''start_time''' key. A '''start_time''' key without prefix will affect a '''[frame]''' tag without prefix, while a '''start_time''' key with a prefix will affect a '''[frame]''' tag with the same prefix.&lt;br /&gt;
&lt;br /&gt;
==== Example Syntax ====&lt;br /&gt;
    [attack_anim]&lt;br /&gt;
        [filter_attack]&lt;br /&gt;
            name=bow&lt;br /&gt;
        [/filter_attack]&lt;br /&gt;
        '''start_time'''=-350&lt;br /&gt;
        '''missile_start_time'''=-150&lt;br /&gt;
        [missile_frame]&lt;br /&gt;
            duration=150&lt;br /&gt;
            image=&amp;quot;projectiles/missile-n.png&amp;quot;&lt;br /&gt;
            image_diagonal=&amp;quot;projectiles/missile-ne.png&amp;quot;&lt;br /&gt;
        [/missile_frame]&lt;br /&gt;
        [if]&lt;br /&gt;
            hits=yes&lt;br /&gt;
            [frame]&lt;br /&gt;
                duration=350&lt;br /&gt;
                sound=bow.ogg&lt;br /&gt;
            [/frame]&lt;br /&gt;
        [/if]&lt;br /&gt;
        [else]&lt;br /&gt;
            hits=no&lt;br /&gt;
            [frame]&lt;br /&gt;
                duration=350&lt;br /&gt;
                sound=bow-miss.ogg&lt;br /&gt;
            [/frame]&lt;br /&gt;
        [/else]&lt;br /&gt;
    [/attack_anim]&lt;br /&gt;
&lt;br /&gt;
=== The content of a frame ===&lt;br /&gt;
==== Syntax summary ====&lt;br /&gt;
 [frame]&lt;br /&gt;
    duration=&amp;lt;integer&amp;gt;&lt;br /&gt;
    begin=&amp;lt;deprecated,integer&amp;gt;&lt;br /&gt;
    end=&amp;lt;deprecated,integer&amp;gt;&lt;br /&gt;
    image=&amp;lt;string&amp;gt;&lt;br /&gt;
    image_diagonal=&amp;lt;string&amp;gt;&lt;br /&gt;
    image_mod=&amp;lt;string&amp;gt;&lt;br /&gt;
    sound=&amp;lt;string&amp;gt;&lt;br /&gt;
    halo=&amp;lt;progressive string&amp;gt;&lt;br /&gt;
    halo_x=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
    halo_y=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
    halo_mod=&amp;lt;string&amp;gt;&lt;br /&gt;
    alpha=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
    offset=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
    blend_color=&amp;lt; red, green, blue &amp;gt;&lt;br /&gt;
    blend_ratio=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
    text=&amp;lt;string&amp;gt;&lt;br /&gt;
    text_color=&amp;lt; red, green, blue &amp;gt;&lt;br /&gt;
    submerge=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
    x=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
    y=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
    directional_x=&amp;lt;dev feature 1.9,progressive int&amp;gt;&lt;br /&gt;
    directional_y=&amp;lt;dev feature 1.9,progressive int&amp;gt;&lt;br /&gt;
    layer=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
 [/frame]&lt;br /&gt;
&lt;br /&gt;
==== Progressive parameters ====&lt;br /&gt;
&lt;br /&gt;
Some parameters above are marked as ''progressive'' This means that you can specify that during the time the frame is displayed, the parameter should smoothly slide from one value to an other.&lt;br /&gt;
&lt;br /&gt;
A typical example would be a unit progressively fading out, becoming transparent&lt;br /&gt;
&lt;br /&gt;
To do that, you could use:&lt;br /&gt;
&lt;br /&gt;
 alpha=1~0&lt;br /&gt;
&lt;br /&gt;
To make a frame, which is 900ms long, slide to transparent for 300ms, stay transparent for another 300ms and finally fade back to normal for 300ms, use:&lt;br /&gt;
&lt;br /&gt;
 alpha=1~0:300,0:300,0~1:300&lt;br /&gt;
&lt;br /&gt;
you could also specify it like that&lt;br /&gt;
&lt;br /&gt;
 alpha=1~0,0,0~1&lt;br /&gt;
&lt;br /&gt;
when a timing is missing, the engine will do its best to fill in in a fair way. &lt;br /&gt;
&lt;br /&gt;
a progressive string has a similar syntax&lt;br /&gt;
&lt;br /&gt;
 halo=halo1.png:300,halo2.png:300,halo2.png:300&lt;br /&gt;
&lt;br /&gt;
==== Field Description ====&lt;br /&gt;
&lt;br /&gt;
** '''begin''': (deprecated) will be replaced by '''duration= &amp;lt;end - begin &amp;gt;'''&lt;br /&gt;
** '''end''': (deprecated) see '''begin''' and also [[AnimationWML#Timing.2C_Clock.2C_Multiple_animations|Timing, Clock, Multiple animations]] section for coverage of '''start_time''' which combines with '''duration''' to replace '''begin=''' '''end='''.&lt;br /&gt;
** '''duration''': how long the frame should be displayed. Use instead of '''begin=''' and '''end='''.&lt;br /&gt;
** '''image''': the image to display during the frame.&lt;br /&gt;
** '''image_diagonal''': the image to display when the attack occurs diagonally (directions ne,se,sw,nw).&lt;br /&gt;
** '''image_mod''': a string modifications (see [[ImagePathFunctionWML]] ) that will be applied to all images&lt;br /&gt;
** '''sound''': the sound to play when the frame begins. Can be a comma-separated list of sounds, in which case one of them is chosen randomly every time.&lt;br /&gt;
** '''halo''': the halo to display at the time.&lt;br /&gt;
** '''halo_x''': the position the halo is displayed in pixel relative to the unit's center.&lt;br /&gt;
** '''halo_y''': the position the halo is displayed in pixel relative to the unit's center.&lt;br /&gt;
** '''halo_mod''': a string modifications (see [[ImagePathFunctionWML]] ) that will be applied to all haloes&lt;br /&gt;
** '''alpha''': transparency level to apply to the frame. This is a floating point progressive parameter ranging from 0.0 to 1.0.&lt;br /&gt;
** '''offset''': the position of the image relative to the hex the unit is facing, 0.0 will display the unit in the center of the hex, 1.0 in the center of the faced hex, -1.0 at the center of the hex behind you. This is a progressive parameter.&lt;br /&gt;
** '''blend_color''': a comma separated list of numbers representing a color in RGB (0-255) this color will be mixed to the frame to give it a tint.&lt;br /&gt;
** '''blend_ratio''': this is a progressive parameter ranging from 0 to 1: 0 means no tint, 1 means target color only.&lt;br /&gt;
** '''text''': if specified, floats a label with the given text above the unit (identical to the floating damage and healing numbers).&lt;br /&gt;
** '''text_color''': the color of the above floating label.&lt;br /&gt;
** '''submerge''': the part of the unit that should drawn with 50% opacity (for units in water)&lt;br /&gt;
** '''x''': x offset applied to the frame&lt;br /&gt;
** '''y''': y offset applied to the frame&lt;br /&gt;
** '''layer''': layer used to draw the frame, see discussion bellow&lt;br /&gt;
&lt;br /&gt;
=== Drawing related animation content ===&lt;br /&gt;
==== Syntax summary ====&lt;br /&gt;
 [animation]&lt;br /&gt;
   &amp;lt;animation choice related content&amp;gt;&lt;br /&gt;
   [frame]&lt;br /&gt;
     &amp;lt;frame content&amp;gt;&lt;br /&gt;
   [/frame]&lt;br /&gt;
   [frame]&lt;br /&gt;
     &amp;lt;frame content&amp;gt;&lt;br /&gt;
   [/frame]&lt;br /&gt;
   start_time=&amp;lt;integer&amp;gt;&lt;br /&gt;
   offset=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
   image_mod=&amp;lt;string&amp;gt;&lt;br /&gt;
   blend_with=&amp;lt;r,g,b&amp;gt;&lt;br /&gt;
   blend_ratio=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
   halo=&amp;lt;progressive_string&amp;gt;&lt;br /&gt;
   halo_x=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   halo_y=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   halo_mod=&amp;lt;string&amp;gt;&lt;br /&gt;
   submerge=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
   x=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   y=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   layer=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   [xxx_frame]&lt;br /&gt;
     &amp;lt;frame content&amp;gt;&lt;br /&gt;
   [/xxx_frame]&lt;br /&gt;
   xxx_start_time=&amp;lt;integer&amp;gt;&lt;br /&gt;
   xxx_image_mod=&amp;lt;string&amp;gt;&lt;br /&gt;
   xxx_offset=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
   xxx_blend_with=&amp;lt;r,g,b&amp;gt;&lt;br /&gt;
   xxx_blend_ratio=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
   xxx_halo=&amp;lt;progressive_string&amp;gt;&lt;br /&gt;
   xxx_halo_x=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   xxx_halo_y=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   xxx_halo_mod=&amp;lt;string&amp;gt;&lt;br /&gt;
   xxx_submerge=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
   xxx_x=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   xxx_y=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   xxx_layer=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 [/animation]&lt;br /&gt;
&lt;br /&gt;
==== Parameter handling ====&lt;br /&gt;
All drawing related parameters in '''[animation]''' can be matched with a corresponding parameter in  a '''[frame]''' block (or a '''[xxx_frame]''' block) The value provided in the animation will be used if no value is provided in the frame. &lt;br /&gt;
&lt;br /&gt;
The point of these two level of parameters is to easily be able to specify a parameter at the animation level and override it for a special case of frame.&lt;br /&gt;
&lt;br /&gt;
== How animations are chosen ==&lt;br /&gt;
Within a unit decription block there are multiple animations. Each animation is meant to be played in a very special set of circumstances. We will discuss here how to tell the animation engine when a given animation should be played. &lt;br /&gt;
&lt;br /&gt;
Let's take an example. Suppose we have a unit which has the skirmisher ability. We have the folowing movement animations :&lt;br /&gt;
* a normal walking animation&lt;br /&gt;
* a swimming animation when the unit is in water&lt;br /&gt;
* a tiptioeing animation when moving next to an ennemy unit&lt;br /&gt;
&lt;br /&gt;
Ok. most of the time it's easy to guess what animation should be. However if you are both in water and next to an ennemy unit, the animation to play is not obvious.&lt;br /&gt;
&lt;br /&gt;
To solve that question, each animation has a number of filtering criterias. The engine follow the following rules to select an animation&lt;br /&gt;
* Start with all animations&lt;br /&gt;
* Drop all animations with a criteria that fails on the current situation&lt;br /&gt;
* Take the animations that have the most maching criterias&lt;br /&gt;
* If there are more than one animation remaining, take an animation randomly&lt;br /&gt;
* If all animations have been droped, the engine will provide a smart default.&lt;br /&gt;
    &lt;br /&gt;
here is a pseudo-code explaination of this algorithm:&lt;br /&gt;
&lt;br /&gt;
 foreach animation&lt;br /&gt;
    animation_score = 0&lt;br /&gt;
    foreach filter-criteria&lt;br /&gt;
      if &amp;lt;criteria-fails&amp;gt; &lt;br /&gt;
          animation_score = -1;&lt;br /&gt;
          break;&lt;br /&gt;
      elsif &amp;lt;criteria-matches&amp;gt; &lt;br /&gt;
          animation_score++&lt;br /&gt;
    endfor&lt;br /&gt;
    if animation_score &amp;gt; max_score&lt;br /&gt;
        &amp;lt;empty animation list&amp;gt;&lt;br /&gt;
        max_score = animation_score;&lt;br /&gt;
        push(animation,animation_list);&lt;br /&gt;
    elsif animation_score = max_score&lt;br /&gt;
        push(animation,animation_list);&lt;br /&gt;
 endfor&lt;br /&gt;
 &amp;lt;choose an animation randomly from animation_list&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
Note that all animations don't have all the filters...&lt;br /&gt;
&lt;br /&gt;
so, if we have a unit with&lt;br /&gt;
# an animation for water terrain&lt;br /&gt;
# an animation for SE on grassland&lt;br /&gt;
# an animation with no criteria&lt;br /&gt;
# an animation for N,NE,NW,S,SW,SE&lt;br /&gt;
# an animation for NW&lt;br /&gt;
&lt;br /&gt;
* 3. will never be taken, because 4. will always trump it&lt;br /&gt;
* on water going NW, it can be 1. 4. 5.&lt;br /&gt;
* on water, any direction but NW, it will be 1. or 4.&lt;br /&gt;
* on SE grassland it will be 2.&lt;br /&gt;
* on other grasslands, it will be 4. (4. or 5. if NW)&lt;br /&gt;
&lt;br /&gt;
=== Generic animation filters available for all animations ===&lt;br /&gt;
* '''apply_to''': a list of comma separated keywords describing what event should trigger the animation (movement, attack...) the complete list is given below&lt;br /&gt;
* '''value''': a list of comma separated integer, the meaning depends on the triggering event. the meaning is given with the list of event&lt;br /&gt;
* '''value_second''': a list of comma separated integer, the meaning depends on the triggering event. the meaning is given with the list of event&lt;br /&gt;
* '''terrain''': a list of comma separated terrain letters, the animation will only be used on these terrains.  See [[FilterWML]].  this has been replaced by '''terrain_type'''&lt;br /&gt;
* '''terrain_type''': a list of comma separated terrain letters, the animation will only be used on these terrains.  See [[FilterWML]].&lt;br /&gt;
* '''[filter]''': this will filter using a standard unit filter on the animated unit. Note that matching all criterias in the filter will only earn you one point for animation selection, but that you can have multiple '''[filter]''' blocks in an animation.&lt;br /&gt;
* '''[filter_second]''': this will filter using a standard unit filter on the unit in the hex faced. Note that matching all criteria in the filter will only earn you one point for animation selection, but that you can have multiple '''[filter_second]''' blocks in an animation. Also note that if the faced hex is empty, the whole filter will fail.&lt;br /&gt;
* '''direction''': a list of directions (n,ne,se,s,sw,nw), the animation will only be used when acting or moving in this direction (the attack direction for attack animations, moving direction for movement animations, direction of lead unit for leading animations, and so on).&lt;br /&gt;
* '''frequency''': this integer value allows to easily tweak the matching frequency of animations. The filter will fail n-1 times out of n, randomly. Note that unlike every other filter, matching this filter won't give an extra point.&lt;br /&gt;
* '''[filter_attack]''': a standard attack filter to match on the attacker's attack. See  [[FilterWML]]. &lt;br /&gt;
* '''[filter_second_attack]''': a standard attack filter to match on the defender's attack. See [[FilterWML]]. Also note that if the defender doesn't have any weapon to retaliate with, this filter will always fail. &lt;br /&gt;
* '''hits''': filters attack animations based on whether the attack hits, misses or kills. Accepts a list of the following:&lt;br /&gt;
** '''hit''': the attack hits, defender survives.&lt;br /&gt;
** '''no''' or '''miss''': the attack misses.&lt;br /&gt;
** '''kill''': the attack hits, defender dies.&lt;br /&gt;
** '''yes''': is an alias of '''hit,kill'''.&lt;br /&gt;
* '''swing''': a list of numbers representing the swing numbers this animation should match (numbered from 1). this has been replaced by value_second&lt;br /&gt;
* '''base_score''': {{DevFeature1.9}} : a number that will always be added to the score. Use with caution&lt;br /&gt;
&lt;br /&gt;
=== Events triggering animations and default animations ===&lt;br /&gt;
==== standing ====&lt;br /&gt;
This animation is triggered whenever any other animation is finished, and is played in loop until another animation is triggered&lt;br /&gt;
&lt;br /&gt;
this is the default &amp;quot;standing image&amp;quot; for the unit&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no standing animation is set a single frame animation based on the enclosing unit's '''image=''' field is used&lt;br /&gt;
==== selected ====&lt;br /&gt;
This animation is triggered whenever the unit is selected&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''blend_with=&amp;quot;0.0~0.3:100,0.3~0.0:200&amp;quot; blend_color=255,255,255''&lt;br /&gt;
==== recruited ====&lt;br /&gt;
This animation is triggered whenever the unit is recruited or recalled&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''highlight=0~1:600''&lt;br /&gt;
&lt;br /&gt;
==== recruiting ====&lt;br /&gt;
&lt;br /&gt;
This animation is triggered for the leader when a unit is recruited or recalled&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
no default animation is needed&lt;br /&gt;
&lt;br /&gt;
note that is not triggered for WML triggered animations&lt;br /&gt;
&lt;br /&gt;
==== levelin ====&lt;br /&gt;
This animation is triggered whenever the unit levels, before the unit is replaced by the new unit&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''blend_with=&amp;quot;1~0:600&amp;quot; blend_color=255,255,255''&lt;br /&gt;
==== levelout ====&lt;br /&gt;
This animation is triggered whenever the unit levels, after the unit is replaced by the new unit&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''blend_with=&amp;quot;0~1:600&amp;quot; blend_color=255,255,255''&lt;br /&gt;
==== movement ====&lt;br /&gt;
This animation is used whenever a unit moves. There are multiple things to consider when dealing with movement animation&lt;br /&gt;
* unit stay ''exactly'' 150ms in each hex. so you typically want to have an offset of ''0~1:150,0~1:150,0~1:150,0~1:150,0~1:150'' or something similar&lt;br /&gt;
* when a unit enters a hex, the current anim is tested again.&lt;br /&gt;
** if the current animation is still valid (i.e it passes all its filter) it is kept, whatever the final score is&lt;br /&gt;
** if it fails, a new movement anim is searched&lt;br /&gt;
&lt;br /&gt;
''value='' contains the number of steps already taken&lt;br /&gt;
&lt;br /&gt;
''value_second='' contains the number of steps left&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''offset=&amp;quot;0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
==== pre_movement ====&lt;br /&gt;
This animation is used before any unit movement&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0 &lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0 &lt;br /&gt;
&lt;br /&gt;
==== post_movement ====&lt;br /&gt;
This animation is used after any unit movement&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0 &lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
==== pre_teleport ====&lt;br /&gt;
This animation is triggered whenever the unit teleports, but before it has moved to the target hex&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''blend_with=&amp;quot;1~0:150&amp;quot; blend_color=255,255,255''&lt;br /&gt;
==== post_teleport ====&lt;br /&gt;
This animation is triggered whenever the unit teleports, but after it has moved to the target hex&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''blend_with=&amp;quot;0~1:150&amp;quot; blend_color=255,255,255''&lt;br /&gt;
==== healing ====&lt;br /&gt;
This animation is triggered when the unit has healing powers and uses them&lt;br /&gt;
&lt;br /&gt;
''value='' is the number of points healed&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
==== healed ====&lt;br /&gt;
This animation is triggered whenever the unit is healed for any reason&lt;br /&gt;
&lt;br /&gt;
''value='' is the number of points healed&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''blend_with=&amp;quot;0:30,0.5:30,0:30,0.5:30,0:30,0.5:30,0:30,0.5:30,0:30&amp;quot; blend_color=255,255,255''&lt;br /&gt;
and plays the sound ''heal.wav''&lt;br /&gt;
==== poisoned ====&lt;br /&gt;
This animation is triggered whenever the unit suffers poison dammage&lt;br /&gt;
&lt;br /&gt;
''value='' is the number of points lost&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''blend_with=&amp;quot;0:30,0.5:30,0:30,0.5:30,0:30,0.5:30,0:30,0.5:30,0:30&amp;quot; blend_color=0,255,0''&lt;br /&gt;
and plays the sound 'poison.ogg''&lt;br /&gt;
==== defend ====&lt;br /&gt;
This animation is triggered during a strike, of the unit receiving the blow&lt;br /&gt;
&lt;br /&gt;
''value='' is the number of point lost, if any&lt;br /&gt;
&lt;br /&gt;
''value_second='' is the number of the swing, starting from 1&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
==== attack ====&lt;br /&gt;
This animation is triggered during a strike, of the unit giving the blow&lt;br /&gt;
&lt;br /&gt;
''value='' is the number of damage dealt, if any&lt;br /&gt;
&lt;br /&gt;
''value_second='' is the number of the swing, starting from 1&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''offset=&amp;quot;0~0.6:150,0.6~0:150&amp;quot;'' for melee attacks&lt;br /&gt;
No default is provided for range attacks&lt;br /&gt;
==== leading ====&lt;br /&gt;
This animation is triggered for units with the leading special ability, when the unit they are leading is attacking&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is the number of the swing, starting from 1&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== resistance ====&lt;br /&gt;
This animation is triggered for units with the resistance special ability affecting neighbouring fights, when the unit they are helping is defending&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is the number of the swing, starting from 1&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
&lt;br /&gt;
==== death ====&lt;br /&gt;
This animation is triggered when a unit die.&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''highlight=1~0:600'' and plays the sound in ''die_sound='' of the enclosing unit&lt;br /&gt;
==== victory ====&lt;br /&gt;
This animation is triggered when a unit finishes a fight by killing the other unit&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
==== idling ====&lt;br /&gt;
This animation is called when the unit has been using its standing animation for a random duration.&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
&lt;br /&gt;
==== draw_weapon ====&lt;br /&gt;
This animation is played before a fight&lt;br /&gt;
&lt;br /&gt;
''hit='' is set to HIT for the attacker and MISS for the defender&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
&lt;br /&gt;
==== sheath_weapon ====&lt;br /&gt;
This animation is played after a fight simultaneously for all surviving units&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
&lt;br /&gt;
==== default ====&lt;br /&gt;
&lt;br /&gt;
This animation is never triggered, but is used as a base to create new animations&lt;br /&gt;
&lt;br /&gt;
''value='' is used depending of the type of animation it replaces&lt;br /&gt;
&lt;br /&gt;
''value_second='' is used depending of the type of animation it replaces&lt;br /&gt;
&lt;br /&gt;
A single animation made of the base frame is provided by the engine if no default animation is available&lt;br /&gt;
&lt;br /&gt;
==== extra animations ====&lt;br /&gt;
Other values are never called by the engine. However they can be triggered by WML events allowing custom animations.&lt;br /&gt;
&lt;br /&gt;
Note that WML events can also trigger standard animations.&lt;br /&gt;
''value='' is set from the WML event&lt;br /&gt;
&lt;br /&gt;
''value_second='' is set from the WML event&lt;br /&gt;
&lt;br /&gt;
== Shortcuts, tricks and quirks ==&lt;br /&gt;
&lt;br /&gt;
=== ''[if]'' and ''[else]'' ===&lt;br /&gt;
&lt;br /&gt;
Often, you need to do very slight variations in an animation (like a different sound depending on whether the unit hits or misses its attack), the '''[if]''' and '''[else]''' tags are meant to help you do that. &lt;br /&gt;
    &lt;br /&gt;
Using these in an animation is equivalent to having multiple animations, one with the '''[if]''' block and one with each of the ''[else]'' blocks. Any filtering flags in these blocks will replace the toplevel filters. You can have multiple '''[if]''' blocks in an animation, but you can't nest an '''[if]''' inside another. These should be written directly inside the '''[animation]''' block. The following example would make the '''[frame]''' inside the '''[if]''' be played when the attack misses, and the '''[frame]''' inside the '''[else]''' be played when the attack hits (producing a different sound):&lt;br /&gt;
&lt;br /&gt;
    [if]&lt;br /&gt;
        hits=no&lt;br /&gt;
        [frame]&lt;br /&gt;
            begin=-100&lt;br /&gt;
            end=100&lt;br /&gt;
            image=&amp;quot;units/dwarves/lord-attack.png&amp;quot;&lt;br /&gt;
            sound={SOUND_LIST:MISS}&lt;br /&gt;
        [/frame]&lt;br /&gt;
    [/if]&lt;br /&gt;
    [else]&lt;br /&gt;
        hits=yes&lt;br /&gt;
        [frame]&lt;br /&gt;
            begin=-100&lt;br /&gt;
            end=100&lt;br /&gt;
            image=&amp;quot;units/dwarves/lord-attack.png&amp;quot;&lt;br /&gt;
            sound=axe.ogg&lt;br /&gt;
        [/frame]&lt;br /&gt;
    [/else]&lt;br /&gt;
&lt;br /&gt;
note that this is very close to preprocessing and should be considered as such, especially with regard to scoring and animation selection&lt;br /&gt;
&lt;br /&gt;
=== Simplified animation blocks ===&lt;br /&gt;
To simplify the most common animation cases, you can use different blocks instead of the generic '''[animation]''' block. These are also here for backward compatibility, but are not deprecated and fully supported&lt;br /&gt;
&lt;br /&gt;
some of these use extra tags which are translated in the normal ''value='' tag&lt;br /&gt;
&lt;br /&gt;
some of these define '''[xxx_frame]''' blocks where the frame prefix starts with an underscore. This is not allowed in normal WML (prefix starting with underscore is reserved for the engine internal use). It is here for clarity purpose&lt;br /&gt;
&lt;br /&gt;
* '''[leading_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=leading&lt;br /&gt;
* '''[recruit_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=recruited&lt;br /&gt;
* '''[recruiting_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=recruiting&lt;br /&gt;
* '''[standing_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=standing,default&lt;br /&gt;
note for 1.4 :''default'' doesn't exist in 1.4, but the semantic is the same.&lt;br /&gt;
&lt;br /&gt;
i.e: the animation will be used to build default animations&lt;br /&gt;
* '''[idle_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=idling&lt;br /&gt;
* '''[levelin_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=levelin&lt;br /&gt;
* '''[levelout_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=levelout&lt;br /&gt;
* '''[healing_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=healing&lt;br /&gt;
 value=&amp;lt;damage= value&amp;gt;&lt;br /&gt;
* '''[healed_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=healed&lt;br /&gt;
 value=&amp;lt;healing= value&amp;gt;&lt;br /&gt;
 [_healed_sound_frame]&lt;br /&gt;
    sound=heal.wav&lt;br /&gt;
 [/_healed_sound_frame]&lt;br /&gt;
* '''[poison_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=poisoned&lt;br /&gt;
 value=&amp;lt;damage= value&amp;gt;&lt;br /&gt;
 [_poison_sound_frame]&lt;br /&gt;
    sound=poison.ogg&lt;br /&gt;
 [/_poison_sound_frame]&lt;br /&gt;
* '''[movement_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=movement&lt;br /&gt;
 offset=&amp;quot;0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150&amp;quot;&lt;br /&gt;
* '''[pre_movement_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=pre_movement&lt;br /&gt;
* '''[post_movement_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=post_movement&lt;br /&gt;
* '''[draw_weapon_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=draw_weapon&lt;br /&gt;
* '''[sheath_weapon_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=sheath_weapon_movement&lt;br /&gt;
* '''[defend]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=defend&lt;br /&gt;
 value=&amp;lt;damage= value&amp;gt;&lt;br /&gt;
 &amp;lt;WML content&amp;gt;&lt;br /&gt;
 [frame]&lt;br /&gt;
    blend_with=255,0,0&lt;br /&gt;
    blend_ratio=&amp;quot;0.5:50,0.0:50&amp;quot;&lt;br /&gt;
 [/frame]&lt;br /&gt;
&lt;br /&gt;
there are some subtil change compared to what is described above to avoid the red flash when value=0, but it should work as expected as far as WML author are concerned&lt;br /&gt;
 &lt;br /&gt;
* '''[attack_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
if the animation contains a missile frame&lt;br /&gt;
&lt;br /&gt;
 apply_to=attack&lt;br /&gt;
 missile_offset=&amp;quot;0~0.8&amp;quot;&lt;br /&gt;
&lt;br /&gt;
else&lt;br /&gt;
&lt;br /&gt;
 apply_to=attack&lt;br /&gt;
 offset=&amp;quot;0~0.6,0.6~0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* '''[death]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=death&lt;br /&gt;
 [_death_sound_frame]&lt;br /&gt;
    sound=&amp;lt;die_sound= of the enclosing [unit] tag&amp;gt;&lt;br /&gt;
 [/_death_sound_frame]&lt;br /&gt;
* '''[victory_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=victory&lt;br /&gt;
* '''[extra_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=&amp;lt;flag= value of the anim&amp;gt;&lt;br /&gt;
* '''[teleport_anim]''' will be cut into two at the clock-time 0&lt;br /&gt;
everything before zero becomes an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=pre_teleport&lt;br /&gt;
everything after zero becomes an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=post_teleport&lt;br /&gt;
&lt;br /&gt;
== Layering ==&lt;br /&gt;
The ''layer'' progressive parameter allows the animation writer to choose in what order the animation should be drawn.&lt;br /&gt;
&lt;br /&gt;
this value must be between 0 and 100&lt;br /&gt;
&lt;br /&gt;
* the back of haloes is drawn with a value of 10&lt;br /&gt;
* when unspecified, a animation is drawn with a value of 40&lt;br /&gt;
* terrain elements that are supposed to go in front of units (castles) are drawn with a value of 50&lt;br /&gt;
* orbs and status bars are drawn on layer 80&lt;br /&gt;
* when unspecified missile frames are drawn on layer 90&lt;br /&gt;
&lt;br /&gt;
by changing these values, it is easy to have the unit display the way you want&lt;br /&gt;
&lt;br /&gt;
== Optimization ==&lt;br /&gt;
&lt;br /&gt;
there is a special flag that goes into the animation block (not the frame) &lt;br /&gt;
&lt;br /&gt;
* ''offscreen'' a boolean saying if the unit's animation should be played when the unit is offscreen. You want the animation to play offscreen if the animation contains some usefull sound effects.This attribute defaults to true (play offscreen) except for standing and idle animations where it defaults to false&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[UnitTypeWML]]&lt;br /&gt;
* [[ReferenceWML]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: WML Reference]]&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=EffectWML&amp;diff=38102</id>
		<title>EffectWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=EffectWML&amp;diff=38102"/>
		<updated>2010-08-29T19:10:59Z</updated>

		<summary type="html">&lt;p&gt;Boucman: /* the [effect] tag */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WML Tags}}&lt;br /&gt;
== the [effect] tag ==&lt;br /&gt;
&lt;br /&gt;
The tag [effect] is used to describe one modification to a unit.&lt;br /&gt;
Any number of [effect] tags can be used to describe a complete&lt;br /&gt;
modification.&lt;br /&gt;
Modifications are permanent changes to a unit;&lt;br /&gt;
currently there is no way of removing a modification.&lt;br /&gt;
Effects can contain a [filter] tag which applies the effect only if it matches.&lt;br /&gt;
See [[StandardUnitFilter]] for details.&lt;br /&gt;
&lt;br /&gt;
The following keys are always recognized for [effect]:&lt;br /&gt;
* '''unit_type''': only apply this effect if the affected unit's type name matches the value. (can be a list)&lt;br /&gt;
* '''unit_gender''': only apply this effect if the affected unit's gender name matches the value. (can be a list)&lt;br /&gt;
* '''times''': describes how much time the effect is applied. The default is to apply the effect once. Other possible value : &amp;quot;per level&amp;quot; which means that the effect is applied level times, where level is the unit level.&lt;br /&gt;
* '''apply_to''': describes what the effect actually affects.&lt;br /&gt;
[effect] uses different keys depending on the value of '''apply_to'''.  '''apply_to''' can take the following values:&lt;br /&gt;
* '''new_attack''': will use all other keys and tags as the description of an attack that will be added to the unit. See [attack] in [[UnitTypeWML]].&lt;br /&gt;
* '''remove_attacks''': remove the matching attacks. All tags from the attack filter construct will be used to match the attack; see [[FilterWML]]. Do not use a [filter] tag otherwise it will not work properly.&lt;br /&gt;
* '''attack''': find an attack and modify it.  All tags from the attack filter construct will be used to match the attack; see [[FilterWML]].  After that, the following keys and tags can be used to modify the attack.  Note: do not use a [filter] tag.  Just put the keys you want to filter on inside the [effect] tag.&lt;br /&gt;
** '''set_name''': change the attack's name (ie identifier).&lt;br /&gt;
** '''set_description''': change the attack's description (ie displayed name). &lt;br /&gt;
** '''set_type''': change the attack type. The standard values are '''blade''', '''pierce''', '''impact''', '''fire''', '''cold''', and '''arcane'''.&lt;br /&gt;
** '''[set_specials]''': change the attack's specials. The specials to add are given exactly as in the [specials] tag.&lt;br /&gt;
*** '''mode''': if '''append''', adds the given specials to the attack. If '''replace''', replaces the existing specials with the given ones. Default '''replace'''.&lt;br /&gt;
** '''remove_specials''': remove the listed specials. The value of this key is the coma-separated list of the id of the specials to remove. This key is always evaluated before a [set_specials] tags in the same [effect]&lt;br /&gt;
** '''increase_damage''': increases the attack's damage.  This can be positive or negative, so you can use it to decrease damage as well.  If it ends in a percent(''''%''''), the change in damage will be a percentage ratio of the attack's original damage.&lt;br /&gt;
** '''increase_attacks''': increases the number of attack strikes. Like '''increase_damage''', it can be positive or negative, or a percentage.&lt;br /&gt;
** '''attack_weight''': change the attack's attack_weight. See [attack] in [[UnitTypeWML]] for explanations about attack_weight.&lt;br /&gt;
** '''defense_weight''': change the attack's defense_weight. See [attack] in [[UnitTypeWML]] for explanations about defense_weight.&lt;br /&gt;
* '''hitpoints''': modifies the unit's HP and/or max HP.&lt;br /&gt;
** '''increase''': the amount to increase the unit's HP.&lt;br /&gt;
** '''heal_full''': if present  and not set to &amp;quot;no&amp;quot; the unit will be put back to full HP.&lt;br /&gt;
** '''increase_total''': will increase the total HP of the unit.  Can be specified either as a negative or a positive value.  It can also be specified as a percentage of the current total; i.e. &amp;quot;-50%&amp;quot; will cut max HP in half.&lt;br /&gt;
** '''violate_maximum''': it the unit ends up with more than its max HP after these modifications, and this key is present (set to any non-null value, ex. '''yes'''), the unit's HP won't be lowered to its max HP.&lt;br /&gt;
* '''movement''': modifies the unit's movement points.&lt;br /&gt;
** '''increase''': maximum movement is increased by this amount. It can be positive, negative, or specified as a percentage.&lt;br /&gt;
** '''set''': maximum movement is set to a specific value.&lt;br /&gt;
* '''max_experience''': affects the amount of XP the unit needs for the next level.&lt;br /&gt;
** '''increase''': how to change the xp; again it can be negative, positive or a percentage.&lt;br /&gt;
* '''loyal''': no keys associated. The affected unit will be loyal i.e have an upkeep of 0.&lt;br /&gt;
* '''movement_costs''': speed through specific terrain is modified&lt;br /&gt;
** '''replace''': If set to &amp;quot;true&amp;quot;, any new values replace the old ones. Otherwise, new values are added to old values (negative values allowed).&lt;br /&gt;
** '''[movement_costs]''': a subtag that describes the new movement costs just like in [[UnitTypeWML]] for describing a unit type&lt;br /&gt;
* '''defense''': Sets unit chance to be hit in specific terrain (100 - defense value)&lt;br /&gt;
** '''replace''': If set to &amp;quot;true&amp;quot;, any new values replace the old ones. Otherwise, new values are added to old values (negative values allowed).&lt;br /&gt;
** '''[defense]''': a subtag that describes the new defense just like in [[UnitTypeWML]] for describing a unit type&lt;br /&gt;
* '''resistance''': Sets percent damage taken from combat&lt;br /&gt;
** '''replace''': If set to &amp;quot;true&amp;quot;, any new values replace the old ones. Otherwise, new values are added to old values (negative values allowed).&lt;br /&gt;
** '''[resistance]''': a subtag that describes the new resistance just like in [[UnitTypeWML]] for describing a unit type&lt;br /&gt;
* '''variation''': switches the unit into one of its variations.&lt;br /&gt;
** '''name''': the id of the variation to invoke.&lt;br /&gt;
* '''type''': transforms the unit into a new unit_type.&lt;br /&gt;
** '''name''': the id of the unit_type to invoke.&lt;br /&gt;
* '''status''': modifies the status affecting the unit.&lt;br /&gt;
** '''add''': a list of status modifications to add. Beware, these may be reapplied later, such as when the unit is recalled or levels up; if in an event, you can use [[InternalActionsWML|[store_unit]]] and [[DirectActionsWML|[unstore_unit]]], modifying unit.status.name directly, to avoid this, or if you are creating the unit, you can just add it to the unit's [status] tag in the [unit] tag.  These are listed in [status], [[SingleUnitWML]].&lt;br /&gt;
** '''remove''': a list of status modifications to remove.&lt;br /&gt;
* '''zoc''': toggle the zone of control.&lt;br /&gt;
** '''value''': new value for zoc (0=disable, other=enable).&lt;br /&gt;
* '''profile''': customize the profile for this unit type&lt;br /&gt;
** '''portrait''': new image to display when the unit speaks&lt;br /&gt;
** '''description''': sets the text to display when hovering over the unit's type in the righthand pane&lt;br /&gt;
* '''new_ability''': Adds one or more abilities to a unit.&lt;br /&gt;
** '''[abilities]''': A subtag that contains the ability definitions.&lt;br /&gt;
* '''remove_ability''': Removes one or more abilities from a unit. Abilities are not reference counted: added, added, removed = gone.&lt;br /&gt;
** '''[abilities]''': A subtag that contains the ability definitions. Strictly speaking, all that is needed is the id= inside some tag.&lt;br /&gt;
* '''new_animation''': contain animations that will be added to the unit, it can contain multiple animation blocks, {{DevFeature1.9}} and a single &amp;quot;id=&amp;quot; line. That Id should be unique for each effect block and is used by the engine to reuse WML parsing, making the loading faster&lt;br /&gt;
* '''image_mod''': modify the image path function([[ImagePathFunctionWML]]) of all the unit's frames&lt;br /&gt;
** '''replace''': the image path function to be used, e.g. &amp;quot;RC(magenta&amp;gt;red)&amp;quot;&lt;br /&gt;
* '''ellipse''': Change the image used for the unit's ellipse&lt;br /&gt;
**'''ellipse''' : the new image to use&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[UnitTypeWML]]&lt;br /&gt;
* [[ReferenceWML]]&lt;br /&gt;
* [[AnimationWML]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: WML Reference]]&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=EffectWML&amp;diff=38100</id>
		<title>EffectWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=EffectWML&amp;diff=38100"/>
		<updated>2010-08-29T16:41:04Z</updated>

		<summary type="html">&lt;p&gt;Boucman: /* See Also */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WML Tags}}&lt;br /&gt;
== the [effect] tag ==&lt;br /&gt;
&lt;br /&gt;
The tag [effect] is used to describe one modification to a unit.&lt;br /&gt;
Any number of [effect] tags can be used to describe a complete&lt;br /&gt;
modification.&lt;br /&gt;
Modifications are permanent changes to a unit;&lt;br /&gt;
currently there is no way of removing a modification.&lt;br /&gt;
Effects can contain a [filter] tag which applies the effect only if it matches.&lt;br /&gt;
See [[StandardUnitFilter]] for details.&lt;br /&gt;
&lt;br /&gt;
The following keys are always recognized for [effect]:&lt;br /&gt;
* '''unit_type''': only apply this effect if the affected unit's type name matches the value. (can be a list)&lt;br /&gt;
* '''unit_gender''': only apply this effect if the affected unit's gender name matches the value. (can be a list)&lt;br /&gt;
* '''times''': describes how much time the effect is applied. The default is to apply the effect once. Other possible value : &amp;quot;per level&amp;quot; which means that the effect is applied level times, where level is the unit level.&lt;br /&gt;
* '''apply_to''': describes what the effect actually affects.&lt;br /&gt;
[effect] uses different keys depending on the value of '''apply_to'''.  '''apply_to''' can take the following values:&lt;br /&gt;
* '''new_attack''': will use all other keys and tags as the description of an attack that will be added to the unit. See [attack] in [[UnitTypeWML]].&lt;br /&gt;
* '''remove_attacks''': remove the matching attacks. All tags from the attack filter construct will be used to match the attack; see [[FilterWML]]. Do not use a [filter] tag otherwise it will not work properly.&lt;br /&gt;
* '''attack''': find an attack and modify it.  All tags from the attack filter construct will be used to match the attack; see [[FilterWML]].  After that, the following keys and tags can be used to modify the attack.  Note: do not use a [filter] tag.  Just put the keys you want to filter on inside the [effect] tag.&lt;br /&gt;
** '''set_name''': change the attack's name (ie identifier).&lt;br /&gt;
** '''set_description''': change the attack's description (ie displayed name). &lt;br /&gt;
** '''set_type''': change the attack type. The standard values are '''blade''', '''pierce''', '''impact''', '''fire''', '''cold''', and '''arcane'''.&lt;br /&gt;
** '''[set_specials]''': change the attack's specials. The specials to add are given exactly as in the [specials] tag.&lt;br /&gt;
*** '''mode''': if '''append''', adds the given specials to the attack. If '''replace''', replaces the existing specials with the given ones. Default '''replace'''.&lt;br /&gt;
** '''remove_specials''': remove the listed specials. The value of this key is the coma-separated list of the id of the specials to remove. This key is always evaluated before a [set_specials] tags in the same [effect]&lt;br /&gt;
** '''increase_damage''': increases the attack's damage.  This can be positive or negative, so you can use it to decrease damage as well.  If it ends in a percent(''''%''''), the change in damage will be a percentage ratio of the attack's original damage.&lt;br /&gt;
** '''increase_attacks''': increases the number of attack strikes. Like '''increase_damage''', it can be positive or negative, or a percentage.&lt;br /&gt;
** '''attack_weight''': change the attack's attack_weight. See [attack] in [[UnitTypeWML]] for explanations about attack_weight.&lt;br /&gt;
** '''defense_weight''': change the attack's defense_weight. See [attack] in [[UnitTypeWML]] for explanations about defense_weight.&lt;br /&gt;
* '''hitpoints''': modifies the unit's HP and/or max HP.&lt;br /&gt;
** '''increase''': the amount to increase the unit's HP.&lt;br /&gt;
** '''heal_full''': if present  and not set to &amp;quot;no&amp;quot; the unit will be put back to full HP.&lt;br /&gt;
** '''increase_total''': will increase the total HP of the unit.  Can be specified either as a negative or a positive value.  It can also be specified as a percentage of the current total; i.e. &amp;quot;-50%&amp;quot; will cut max HP in half.&lt;br /&gt;
** '''violate_maximum''': it the unit ends up with more than its max HP after these modifications, and this key is present (set to any non-null value, ex. '''yes'''), the unit's HP won't be lowered to its max HP.&lt;br /&gt;
* '''movement''': modifies the unit's movement points.&lt;br /&gt;
** '''increase''': maximum movement is increased by this amount. It can be positive, negative, or specified as a percentage.&lt;br /&gt;
** '''set''': maximum movement is set to a specific value.&lt;br /&gt;
* '''max_experience''': affects the amount of XP the unit needs for the next level.&lt;br /&gt;
** '''increase''': how to change the xp; again it can be negative, positive or a percentage.&lt;br /&gt;
* '''loyal''': no keys associated. The affected unit will be loyal i.e have an upkeep of 0.&lt;br /&gt;
* '''movement_costs''': speed through specific terrain is modified&lt;br /&gt;
** '''replace''': If set to &amp;quot;true&amp;quot;, any new values replace the old ones. Otherwise, new values are added to old values (negative values allowed).&lt;br /&gt;
** '''[movement_costs]''': a subtag that describes the new movement costs just like in [[UnitTypeWML]] for describing a unit type&lt;br /&gt;
* '''defense''': Sets unit chance to be hit in specific terrain (100 - defense value)&lt;br /&gt;
** '''replace''': If set to &amp;quot;true&amp;quot;, any new values replace the old ones. Otherwise, new values are added to old values (negative values allowed).&lt;br /&gt;
** '''[defense]''': a subtag that describes the new defense just like in [[UnitTypeWML]] for describing a unit type&lt;br /&gt;
* '''resistance''': Sets percent damage taken from combat&lt;br /&gt;
** '''replace''': If set to &amp;quot;true&amp;quot;, any new values replace the old ones. Otherwise, new values are added to old values (negative values allowed).&lt;br /&gt;
** '''[resistance]''': a subtag that describes the new resistance just like in [[UnitTypeWML]] for describing a unit type&lt;br /&gt;
* '''variation''': switches the unit into one of its variations.&lt;br /&gt;
** '''name''': the id of the variation to invoke.&lt;br /&gt;
* '''type''': transforms the unit into a new unit_type.&lt;br /&gt;
** '''name''': the id of the unit_type to invoke.&lt;br /&gt;
* '''status''': modifies the status affecting the unit.&lt;br /&gt;
** '''add''': a list of status modifications to add. Beware, these may be reapplied later, such as when the unit is recalled or levels up; if in an event, you can use [[InternalActionsWML|[store_unit]]] and [[DirectActionsWML|[unstore_unit]]], modifying unit.status.name directly, to avoid this, or if you are creating the unit, you can just add it to the unit's [status] tag in the [unit] tag.  These are listed in [status], [[SingleUnitWML]].&lt;br /&gt;
** '''remove''': a list of status modifications to remove.&lt;br /&gt;
* '''zoc''': toggle the zone of control.&lt;br /&gt;
** '''value''': new value for zoc (0=disable, other=enable).&lt;br /&gt;
* '''profile''': customize the profile for this unit type&lt;br /&gt;
** '''portrait''': new image to display when the unit speaks&lt;br /&gt;
** '''description''': sets the text to display when hovering over the unit's type in the righthand pane&lt;br /&gt;
* '''new_ability''': Adds one or more abilities to a unit.&lt;br /&gt;
** '''[abilities]''': A subtag that contains the ability definitions.&lt;br /&gt;
* '''remove_ability''': Removes one or more abilities from a unit. Abilities are not reference counted: added, added, removed = gone.&lt;br /&gt;
** '''[abilities]''': A subtag that contains the ability definitions. Strictly speaking, all that is needed is the id= inside some tag.&lt;br /&gt;
* '''new_animation''': contain animations that will be added to the unit&lt;br /&gt;
* '''image_mod''': modify the image path function([[ImagePathFunctionWML]]) of all the unit's frames&lt;br /&gt;
** '''replace''': the image path function to be used, e.g. &amp;quot;RC(magenta&amp;gt;red)&amp;quot;&lt;br /&gt;
* '''ellipse''': Change the image used for the unit's ellipse&lt;br /&gt;
**'''ellipse''' : the new image to use&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[UnitTypeWML]]&lt;br /&gt;
* [[ReferenceWML]]&lt;br /&gt;
* [[AnimationWML]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: WML Reference]]&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=AnimationWML&amp;diff=38097</id>
		<title>AnimationWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=AnimationWML&amp;diff=38097"/>
		<updated>2010-08-29T12:11:50Z</updated>

		<summary type="html">&lt;p&gt;Boucman: /* Layering */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WML Tags}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
This page covers unit animations. At any point in game, units are playing an animation. Even when the unit is standing, it is actually playing a single frame animation.&lt;br /&gt;
&lt;br /&gt;
This page will deal with the two problems of animations&lt;br /&gt;
* How are animations Chosen&lt;br /&gt;
* What exactly is drawn&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How animations are drawn ==&lt;br /&gt;
=== Animations ===&lt;br /&gt;
Any unit has a huge set of animations to choose from. Animations are WML blocks in the unit type, enclosed in either the generic type '''[animation]''' or some more specific tags such as '''[attack_anim]''' '''[idle_anim]''' and the like. An animation is what a unit displays when a given event is triggered, and a certain set of conditions are met such as&lt;br /&gt;
* unit is attacking&lt;br /&gt;
* unit is idling&lt;br /&gt;
* unit is attacking (event) and uses a melee weapon (condition)&lt;br /&gt;
* unit is attacking (event) and uses a melee weapon (condition) and opponent can't retaliate (condition)&lt;br /&gt;
&lt;br /&gt;
events and conditions are described entirely in the [animation] block, and will be discussed in the animation choice section.&lt;br /&gt;
&lt;br /&gt;
=== Frames ===&lt;br /&gt;
    &lt;br /&gt;
An animation is cut in frames. Frames are WML blocks that are contained either in '''[frame]''' WML blocks or in generic '''[xxx_frame]''' block. (the xxx part can be any string not starting with an underscore) the xxx part in the frame name is called the frame prefix. frames of the type '''[frame]''' are said to have an empty prefix&lt;br /&gt;
&lt;br /&gt;
A frame typically describes an image, where an how to render it. It can contain such things as&lt;br /&gt;
* the image to display&lt;br /&gt;
* how transparent should that image be&lt;br /&gt;
* where to draw that image.&lt;br /&gt;
&lt;br /&gt;
At any given time, an animation will display one frame for each frame prefix it can find. I.e if your animation has both '''[frame]''' and '''[missile_frame]''' blocks, both will be displayed at the same time&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The frame with the empty prefix is special in many way. It is assumed to contain the image representing the unit itself, and as such the engine will heavily temper with it in multiple ways, such as providing a default image if none is available, or forcing the image to be green when the unit is poisoned&lt;br /&gt;
&lt;br /&gt;
=== Timing, Clock, Multiple animations ===&lt;br /&gt;
When an animation is played it has an internal clock that is run. The step of this clock is the milisecond, and each frame is played for a given duration. Each animation also has a starting time which tells the animation engine at what value the animation clock should start&lt;br /&gt;
&lt;br /&gt;
This starting time is very important when multiple animations from different units are played synchronously  Typically a fight involves a unit playing its defense animation while the opponent plays it's attack animation (and a third might play its leading animation, too). In that case all animations have a common clock, and are played concurrently.&lt;br /&gt;
&lt;br /&gt;
The convention is that the &amp;quot;important time&amp;quot; (usually the time of the hit) is at time 0. everything before should be at negative time, everything after at positive time. This is a WML convention that is not enforced by the engine&lt;br /&gt;
&lt;br /&gt;
In that case, it is very important that these animations (which can have different lengths) be synchronized. Fight animations are synchronized around the point of impact, so they all reach time 0 when the attack lands (or misses). This is accomplished through the use of the '''start_time''' key of the '''[animation]''' tag.&lt;br /&gt;
&lt;br /&gt;
Just like the '''[frame]''' tag can have a prefix, so can the '''start_time''' key. A '''start_time''' key without prefix will affect a '''[frame]''' tag without prefix, while a '''start_time''' key with a prefix will affect a '''[frame]''' tag with the same prefix.&lt;br /&gt;
&lt;br /&gt;
==== Example Syntax ====&lt;br /&gt;
    [attack_anim]&lt;br /&gt;
        [filter_attack]&lt;br /&gt;
            name=bow&lt;br /&gt;
        [/filter_attack]&lt;br /&gt;
        '''start_time'''=-350&lt;br /&gt;
        '''missile_start_time'''=-150&lt;br /&gt;
        [missile_frame]&lt;br /&gt;
            duration=150&lt;br /&gt;
            image=&amp;quot;projectiles/missile-n.png&amp;quot;&lt;br /&gt;
            image_diagonal=&amp;quot;projectiles/missile-ne.png&amp;quot;&lt;br /&gt;
        [/missile_frame]&lt;br /&gt;
        [if]&lt;br /&gt;
            hits=yes&lt;br /&gt;
            [frame]&lt;br /&gt;
                duration=350&lt;br /&gt;
                sound=bow.ogg&lt;br /&gt;
            [/frame]&lt;br /&gt;
        [/if]&lt;br /&gt;
        [else]&lt;br /&gt;
            hits=no&lt;br /&gt;
            [frame]&lt;br /&gt;
                duration=350&lt;br /&gt;
                sound=bow-miss.ogg&lt;br /&gt;
            [/frame]&lt;br /&gt;
        [/else]&lt;br /&gt;
    [/attack_anim]&lt;br /&gt;
&lt;br /&gt;
=== The content of a frame ===&lt;br /&gt;
==== Syntax summary ====&lt;br /&gt;
 [frame]&lt;br /&gt;
    duration=&amp;lt;integer&amp;gt;&lt;br /&gt;
    begin=&amp;lt;deprecated,integer&amp;gt;&lt;br /&gt;
    end=&amp;lt;deprecated,integer&amp;gt;&lt;br /&gt;
    image=&amp;lt;string&amp;gt;&lt;br /&gt;
    image_diagonal=&amp;lt;string&amp;gt;&lt;br /&gt;
    image_mod=&amp;lt;string&amp;gt;&lt;br /&gt;
    sound=&amp;lt;string&amp;gt;&lt;br /&gt;
    halo=&amp;lt;progressive string&amp;gt;&lt;br /&gt;
    halo_x=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
    halo_y=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
    halo_mod=&amp;lt;string&amp;gt;&lt;br /&gt;
    alpha=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
    offset=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
    blend_color=&amp;lt; red, green, blue &amp;gt;&lt;br /&gt;
    blend_ratio=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
    text=&amp;lt;string&amp;gt;&lt;br /&gt;
    text_color=&amp;lt; red, green, blue &amp;gt;&lt;br /&gt;
    submerge=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
    x=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
    y=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
    layer=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
 [/frame]&lt;br /&gt;
&lt;br /&gt;
==== Progressive parameters ====&lt;br /&gt;
&lt;br /&gt;
Some parameters above are marked as ''progressive'' This means that you can specify that during the time the frame is displayed, the parameter should smoothly slide from one value to an other.&lt;br /&gt;
&lt;br /&gt;
A typical example would be a unit progressively fading out, becoming transparent&lt;br /&gt;
&lt;br /&gt;
To do that, you could use:&lt;br /&gt;
&lt;br /&gt;
 alpha=1~0&lt;br /&gt;
&lt;br /&gt;
To make a frame, which is 900ms long, slide to transparent for 300ms, stay transparent for another 300ms and finally fade back to normal for 300ms, use:&lt;br /&gt;
&lt;br /&gt;
 alpha=1~0:300,0:300,0~1:300&lt;br /&gt;
&lt;br /&gt;
you could also specify it like that&lt;br /&gt;
&lt;br /&gt;
 alpha=1~0,0,0~1&lt;br /&gt;
&lt;br /&gt;
when a timing is missing, the engine will do its best to fill in in a fair way. &lt;br /&gt;
&lt;br /&gt;
a progressive string has a similar syntax&lt;br /&gt;
&lt;br /&gt;
 halo=halo1.png:300,halo2.png:300,halo2.png:300&lt;br /&gt;
&lt;br /&gt;
==== Field Description ====&lt;br /&gt;
&lt;br /&gt;
** '''begin''': (deprecated) will be replaced by '''duration= &amp;lt;end - begin &amp;gt;'''&lt;br /&gt;
** '''end''': (deprecated) see '''begin''' and also [[AnimationWML#Timing.2C_Clock.2C_Multiple_animations|Timing, Clock, Multiple animations]] section for coverage of '''start_time''' which combines with '''duration''' to replace '''begin=''' '''end='''.&lt;br /&gt;
** '''duration''': how long the frame should be displayed. Use instead of '''begin=''' and '''end='''.&lt;br /&gt;
** '''image''': the image to display during the frame.&lt;br /&gt;
** '''image_diagonal''': the image to display when the attack occurs diagonally (directions ne,se,sw,nw).&lt;br /&gt;
** '''image_mod''': a string modifications (see [[ImagePathFunctionWML]] ) that will be applied to all images&lt;br /&gt;
** '''sound''': the sound to play when the frame begins. Can be a comma-separated list of sounds, in which case one of them is chosen randomly every time.&lt;br /&gt;
** '''halo''': the halo to display at the time.&lt;br /&gt;
** '''halo_x''': the position the halo is displayed in pixel relative to the unit's center.&lt;br /&gt;
** '''halo_y''': the position the halo is displayed in pixel relative to the unit's center.&lt;br /&gt;
** '''halo_mod''': a string modifications (see [[ImagePathFunctionWML]] ) that will be applied to all haloes&lt;br /&gt;
** '''alpha''': transparency level to apply to the frame. This is a floating point progressive parameter ranging from 0.0 to 1.0.&lt;br /&gt;
** '''offset''': the position of the image relative to the hex the unit is facing, 0.0 will display the unit in the center of the hex, 1.0 in the center of the faced hex, -1.0 at the center of the hex behind you. This is a progressive parameter.&lt;br /&gt;
** '''blend_color''': a comma separated list of numbers representing a color in RGB (0-255) this color will be mixed to the frame to give it a tint.&lt;br /&gt;
** '''blend_ratio''': this is a progressive parameter ranging from 0 to 1: 0 means no tint, 1 means target color only.&lt;br /&gt;
** '''text''': if specified, floats a label with the given text above the unit (identical to the floating damage and healing numbers).&lt;br /&gt;
** '''text_color''': the color of the above floating label.&lt;br /&gt;
** '''submerge''': the part of the unit that should drawn with 50% opacity (for units in water)&lt;br /&gt;
** '''x''': x offset applied to the frame&lt;br /&gt;
** '''y''': y offset applied to the frame&lt;br /&gt;
** '''layer''': layer used to draw the frame, see discussion bellow&lt;br /&gt;
&lt;br /&gt;
=== Drawing related animation content ===&lt;br /&gt;
==== Syntax summary ====&lt;br /&gt;
 [animation]&lt;br /&gt;
   &amp;lt;animation choice related content&amp;gt;&lt;br /&gt;
   [frame]&lt;br /&gt;
     &amp;lt;frame content&amp;gt;&lt;br /&gt;
   [/frame]&lt;br /&gt;
   [frame]&lt;br /&gt;
     &amp;lt;frame content&amp;gt;&lt;br /&gt;
   [/frame]&lt;br /&gt;
   start_time=&amp;lt;integer&amp;gt;&lt;br /&gt;
   offset=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
   image_mod=&amp;lt;string&amp;gt;&lt;br /&gt;
   blend_with=&amp;lt;r,g,b&amp;gt;&lt;br /&gt;
   blend_ratio=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
   halo=&amp;lt;progressive_string&amp;gt;&lt;br /&gt;
   halo_x=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   halo_y=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   halo_mod=&amp;lt;string&amp;gt;&lt;br /&gt;
   submerge=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
   x=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   y=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   layer=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
   [xxx_frame]&lt;br /&gt;
     &amp;lt;frame content&amp;gt;&lt;br /&gt;
   [/xxx_frame]&lt;br /&gt;
   xxx_start_time=&amp;lt;integer&amp;gt;&lt;br /&gt;
   xxx_image_mod=&amp;lt;string&amp;gt;&lt;br /&gt;
   xxx_offset=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
   xxx_blend_with=&amp;lt;r,g,b&amp;gt;&lt;br /&gt;
   xxx_blend_ratio=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
   xxx_halo=&amp;lt;progressive_string&amp;gt;&lt;br /&gt;
   xxx_halo_x=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   xxx_halo_y=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   xxx_halo_mod=&amp;lt;string&amp;gt;&lt;br /&gt;
   xxx_submerge=&amp;lt;progressive float&amp;gt;&lt;br /&gt;
   xxx_x=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   xxx_y=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
   xxx_layer=&amp;lt;progressive int&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 [/animation]&lt;br /&gt;
&lt;br /&gt;
==== Parameter handling ====&lt;br /&gt;
All drawing related parameters in '''[animation]''' can be matched with a corresponding parameter in  a '''[frame]''' block (or a '''[xxx_frame]''' block) The value provided in the animation will be used if no value is provided in the frame. &lt;br /&gt;
&lt;br /&gt;
The point of these two level of parameters is to easily be able to specify a parameter at the animation level and override it for a special case of frame.&lt;br /&gt;
&lt;br /&gt;
== How animations are chosen ==&lt;br /&gt;
Within a unit decription block there are multiple animations. Each animation is meant to be played in a very special set of circumstances. We will discuss here how to tell the animation engine when a given animation should be played. &lt;br /&gt;
&lt;br /&gt;
Let's take an example. Suppose we have a unit which has the skirmisher ability. We have the folowing movement animations :&lt;br /&gt;
* a normal walking animation&lt;br /&gt;
* a swimming animation when the unit is in water&lt;br /&gt;
* a tiptioeing animation when moving next to an ennemy unit&lt;br /&gt;
&lt;br /&gt;
Ok. most of the time it's easy to guess what animation should be. However if you are both in water and next to an ennemy unit, the animation to play is not obvious.&lt;br /&gt;
&lt;br /&gt;
To solve that question, each animation has a number of filtering criterias. The engine follow the following rules to select an animation&lt;br /&gt;
* Start with all animations&lt;br /&gt;
* Drop all animations with a criteria that fails on the current situation&lt;br /&gt;
* Take the animations that have the most maching criterias&lt;br /&gt;
* If there are more than one animation remaining, take an animation randomly&lt;br /&gt;
* If all animations have been droped, the engine will provide a smart default.&lt;br /&gt;
    &lt;br /&gt;
here is a pseudo-code explaination of this algorithm:&lt;br /&gt;
&lt;br /&gt;
 foreach animation&lt;br /&gt;
    animation_score = 0&lt;br /&gt;
    foreach filter-criteria&lt;br /&gt;
      if &amp;lt;criteria-fails&amp;gt; &lt;br /&gt;
          animation_score = -1;&lt;br /&gt;
          break;&lt;br /&gt;
      elsif &amp;lt;criteria-matches&amp;gt; &lt;br /&gt;
          animation_score++&lt;br /&gt;
    endfor&lt;br /&gt;
    if animation_score &amp;gt; max_score&lt;br /&gt;
        &amp;lt;empty animation list&amp;gt;&lt;br /&gt;
        max_score = animation_score;&lt;br /&gt;
        push(animation,animation_list);&lt;br /&gt;
    elsif animation_score = max_score&lt;br /&gt;
        push(animation,animation_list);&lt;br /&gt;
 endfor&lt;br /&gt;
 &amp;lt;choose an animation randomly from animation_list&amp;gt;&lt;br /&gt;
&lt;br /&gt;
	&lt;br /&gt;
Note that all animations don't have all the filters...&lt;br /&gt;
&lt;br /&gt;
so, if we have a unit with&lt;br /&gt;
# an animation for water terrain&lt;br /&gt;
# an animation for SE on grassland&lt;br /&gt;
# an animation with no criteria&lt;br /&gt;
# an animation for N,NE,NW,S,SW,SE&lt;br /&gt;
# an animation for NW&lt;br /&gt;
&lt;br /&gt;
* 3. will never be taken, because 4. will always trump it&lt;br /&gt;
* on water going NW, it can be 1. 4. 5.&lt;br /&gt;
* on water, any direction but NW, it will be 1. or 4.&lt;br /&gt;
* on SE grassland it will be 2.&lt;br /&gt;
* on other grasslands, it will be 4. (4. or 5. if NW)&lt;br /&gt;
&lt;br /&gt;
=== Generic animation filters available for all animations ===&lt;br /&gt;
* '''apply_to''': a list of comma separated keywords describing what event should trigger the animation (movement, attack...) the complete list is given below&lt;br /&gt;
* '''value''': a list of comma separated integer, the meaning depends on the triggering event. the meaning is given with the list of event&lt;br /&gt;
* '''value_second''': a list of comma separated integer, the meaning depends on the triggering event. the meaning is given with the list of event&lt;br /&gt;
* '''terrain''': a list of comma separated terrain letters, the animation will only be used on these terrains.  See [[FilterWML]].  this has been replaced by '''terrain_type'''&lt;br /&gt;
* '''terrain_type''': a list of comma separated terrain letters, the animation will only be used on these terrains.  See [[FilterWML]].&lt;br /&gt;
* '''[filter]''': this will filter using a standard unit filter on the animated unit. Note that matching all criterias in the filter will only earn you one point for animation selection, but that you can have multiple '''[filter]''' blocks in an animation.&lt;br /&gt;
* '''[filter_second]''': this will filter using a standard unit filter on the unit in the hex faced. Note that matching all criteria in the filter will only earn you one point for animation selection, but that you can have multiple '''[filter_second]''' blocks in an animation. Also note that if the faced hex is empty, the whole filter will fail.&lt;br /&gt;
* '''direction''': a list of directions (n,ne,se,s,sw,nw), the animation will only be used when acting or moving in this direction (the attack direction for attack animations, moving direction for movement animations, direction of lead unit for leading animations, and so on).&lt;br /&gt;
* '''frequency''': this integer value allows to easily tweak the matching frequency of animations. The filter will fail n-1 times out of n, randomly. Note that unlike every other filter, matching this filter won't give an extra point.&lt;br /&gt;
* '''[filter_attack]''': a standard attack filter to match on the attacker's attack. See  [[FilterWML]]. &lt;br /&gt;
* '''[filter_second_attack]''': a standard attack filter to match on the defender's attack. See [[FilterWML]]. Also note that if the defender doesn't have any weapon to retaliate with, this filter will always fail. &lt;br /&gt;
* '''hits''': filters attack animations based on whether the attack hits, misses or kills. Accepts a list of the following:&lt;br /&gt;
** '''hit''': the attack hits, defender survives.&lt;br /&gt;
** '''no''' or '''miss''': the attack misses.&lt;br /&gt;
** '''kill''': the attack hits, defender dies.&lt;br /&gt;
** '''yes''': is an alias of '''hit,kill'''.&lt;br /&gt;
* '''swing''': a list of numbers representing the swing numbers this animation should match (numbered from 1). this has been replaced by value_second&lt;br /&gt;
* '''base_score''': {{DevFeature1.9}} : a number that will always be added to the score. Use with caution&lt;br /&gt;
&lt;br /&gt;
=== Events triggering animations and default animations ===&lt;br /&gt;
==== standing ====&lt;br /&gt;
This animation is triggered whenever any other animation is finished, and is played in loop until another animation is triggered&lt;br /&gt;
&lt;br /&gt;
this is the default &amp;quot;standing image&amp;quot; for the unit&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no standing animation is set a single frame animation based on the enclosing unit's '''image=''' field is used&lt;br /&gt;
==== selected ====&lt;br /&gt;
This animation is triggered whenever the unit is selected&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''blend_with=&amp;quot;0.0~0.3:100,0.3~0.0:200&amp;quot; blend_color=255,255,255''&lt;br /&gt;
==== recruited ====&lt;br /&gt;
This animation is triggered whenever the unit is recruited or recalled&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''highlight=0~1:600''&lt;br /&gt;
&lt;br /&gt;
==== recruiting ====&lt;br /&gt;
&lt;br /&gt;
This animation is triggered for the leader when a unit is recruited or recalled&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
no default animation is needed&lt;br /&gt;
&lt;br /&gt;
note that is not triggered for WML triggered animations&lt;br /&gt;
&lt;br /&gt;
==== levelin ====&lt;br /&gt;
This animation is triggered whenever the unit levels, before the unit is replaced by the new unit&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''blend_with=&amp;quot;1~0:600&amp;quot; blend_color=255,255,255''&lt;br /&gt;
==== levelout ====&lt;br /&gt;
This animation is triggered whenever the unit levels, after the unit is replaced by the new unit&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''blend_with=&amp;quot;0~1:600&amp;quot; blend_color=255,255,255''&lt;br /&gt;
==== movement ====&lt;br /&gt;
This animation is used whenever a unit moves. There are multiple things to consider when dealing with movement animation&lt;br /&gt;
* unit stay ''exactly'' 150ms in each hex. so you typically want to have an offset of ''0~1:150,0~1:150,0~1:150,0~1:150,0~1:150'' or something similar&lt;br /&gt;
* when a unit enters a hex, the current anim is tested again.&lt;br /&gt;
** if the current animation is still valid (i.e it passes all its filter) it is kept, whatever the final score is&lt;br /&gt;
** if it fails, a new movement anim is searched&lt;br /&gt;
&lt;br /&gt;
''value='' contains the number of steps already taken&lt;br /&gt;
&lt;br /&gt;
''value_second='' contains the number of steps left&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''offset=&amp;quot;0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
==== pre_movement ====&lt;br /&gt;
This animation is used before any unit movement&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0 &lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0 &lt;br /&gt;
&lt;br /&gt;
==== post_movement ====&lt;br /&gt;
This animation is used after any unit movement&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0 &lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
==== pre_teleport ====&lt;br /&gt;
This animation is triggered whenever the unit teleports, but before it has moved to the target hex&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''blend_with=&amp;quot;1~0:150&amp;quot; blend_color=255,255,255''&lt;br /&gt;
==== post_teleport ====&lt;br /&gt;
This animation is triggered whenever the unit teleports, but after it has moved to the target hex&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''blend_with=&amp;quot;0~1:150&amp;quot; blend_color=255,255,255''&lt;br /&gt;
==== healing ====&lt;br /&gt;
This animation is triggered when the unit has healing powers and uses them&lt;br /&gt;
&lt;br /&gt;
''value='' is the number of points healed&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
==== healed ====&lt;br /&gt;
This animation is triggered whenever the unit is healed for any reason&lt;br /&gt;
&lt;br /&gt;
''value='' is the number of points healed&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''blend_with=&amp;quot;0:30,0.5:30,0:30,0.5:30,0:30,0.5:30,0:30,0.5:30,0:30&amp;quot; blend_color=255,255,255''&lt;br /&gt;
and plays the sound ''heal.wav''&lt;br /&gt;
==== poisoned ====&lt;br /&gt;
This animation is triggered whenever the unit suffers poison dammage&lt;br /&gt;
&lt;br /&gt;
''value='' is the number of points lost&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''blend_with=&amp;quot;0:30,0.5:30,0:30,0.5:30,0:30,0.5:30,0:30,0.5:30,0:30&amp;quot; blend_color=0,255,0''&lt;br /&gt;
and plays the sound 'poison.ogg''&lt;br /&gt;
==== defend ====&lt;br /&gt;
This animation is triggered during a strike, of the unit receiving the blow&lt;br /&gt;
&lt;br /&gt;
''value='' is the number of point lost, if any&lt;br /&gt;
&lt;br /&gt;
''value_second='' is the number of the swing, starting from 1&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
==== attack ====&lt;br /&gt;
This animation is triggered during a strike, of the unit giving the blow&lt;br /&gt;
&lt;br /&gt;
''value='' is the number of damage dealt, if any&lt;br /&gt;
&lt;br /&gt;
''value_second='' is the number of the swing, starting from 1&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''offset=&amp;quot;0~0.6:150,0.6~0:150&amp;quot;'' for melee attacks&lt;br /&gt;
No default is provided for range attacks&lt;br /&gt;
==== leading ====&lt;br /&gt;
This animation is triggered for units with the leading special ability, when the unit they are leading is attacking&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is the number of the swing, starting from 1&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== resistance ====&lt;br /&gt;
This animation is triggered for units with the resistance special ability affecting neighbouring fights, when the unit they are helping is defending&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is the number of the swing, starting from 1&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
&lt;br /&gt;
==== death ====&lt;br /&gt;
This animation is triggered when a unit die.&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
if no animation is available, the default uses the standing animation(s) with ''highlight=1~0:600'' and plays the sound in ''die_sound='' of the enclosing unit&lt;br /&gt;
==== victory ====&lt;br /&gt;
This animation is triggered when a unit finishes a fight by killing the other unit&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
==== idling ====&lt;br /&gt;
This animation is called when the unit has been using its standing animation for a random duration.&lt;br /&gt;
&lt;br /&gt;
''value='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
''value_second='' is not used, and always contains 0&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
&lt;br /&gt;
==== draw_weapon ====&lt;br /&gt;
This animation is played before a fight&lt;br /&gt;
&lt;br /&gt;
''hit='' is set to HIT for the attacker and MISS for the defender&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
&lt;br /&gt;
==== sheath_weapon ====&lt;br /&gt;
This animation is played after a fight simultaneously for all surviving units&lt;br /&gt;
&lt;br /&gt;
No default is provided by the engine&lt;br /&gt;
&lt;br /&gt;
==== default ====&lt;br /&gt;
&lt;br /&gt;
This animation is never triggered, but is used as a base to create new animations&lt;br /&gt;
&lt;br /&gt;
''value='' is used depending of the type of animation it replaces&lt;br /&gt;
&lt;br /&gt;
''value_second='' is used depending of the type of animation it replaces&lt;br /&gt;
&lt;br /&gt;
A single animation made of the base frame is provided by the engine if no default animation is available&lt;br /&gt;
&lt;br /&gt;
==== extra animations ====&lt;br /&gt;
Other values are never called by the engine. However they can be triggered by WML events allowing custom animations.&lt;br /&gt;
&lt;br /&gt;
Note that WML events can also trigger standard animations.&lt;br /&gt;
''value='' is set from the WML event&lt;br /&gt;
&lt;br /&gt;
''value_second='' is set from the WML event&lt;br /&gt;
&lt;br /&gt;
== Shortcuts, tricks and quirks ==&lt;br /&gt;
&lt;br /&gt;
=== ''[if]'' and ''[else]'' ===&lt;br /&gt;
&lt;br /&gt;
Often, you need to do very slight variations in an animation (like a different sound depending on whether the unit hits or misses its attack), the '''[if]''' and '''[else]''' tags are meant to help you do that. &lt;br /&gt;
    &lt;br /&gt;
Using these in an animation is equivalent to having multiple animations, one with the '''[if]''' block and one with each of the ''[else]'' blocks. Any filtering flags in these blocks will replace the toplevel filters. You can have multiple '''[if]''' blocks in an animation, but you can't nest an '''[if]''' inside another. These should be written directly inside the '''[animation]''' block. The following example would make the '''[frame]''' inside the '''[if]''' be played when the attack misses, and the '''[frame]''' inside the '''[else]''' be played when the attack hits (producing a different sound):&lt;br /&gt;
&lt;br /&gt;
    [if]&lt;br /&gt;
        hits=no&lt;br /&gt;
        [frame]&lt;br /&gt;
            begin=-100&lt;br /&gt;
            end=100&lt;br /&gt;
            image=&amp;quot;units/dwarves/lord-attack.png&amp;quot;&lt;br /&gt;
            sound={SOUND_LIST:MISS}&lt;br /&gt;
        [/frame]&lt;br /&gt;
    [/if]&lt;br /&gt;
    [else]&lt;br /&gt;
        hits=yes&lt;br /&gt;
        [frame]&lt;br /&gt;
            begin=-100&lt;br /&gt;
            end=100&lt;br /&gt;
            image=&amp;quot;units/dwarves/lord-attack.png&amp;quot;&lt;br /&gt;
            sound=axe.ogg&lt;br /&gt;
        [/frame]&lt;br /&gt;
    [/else]&lt;br /&gt;
&lt;br /&gt;
note that this is very close to preprocessing and should be considered as such, especially with regard to scoring and animation selection&lt;br /&gt;
&lt;br /&gt;
=== Simplified animation blocks ===&lt;br /&gt;
To simplify the most common animation cases, you can use different blocks instead of the generic '''[animation]''' block. These are also here for backward compatibility, but are not deprecated and fully supported&lt;br /&gt;
&lt;br /&gt;
some of these use extra tags which are translated in the normal ''value='' tag&lt;br /&gt;
&lt;br /&gt;
some of these define '''[xxx_frame]''' blocks where the frame prefix starts with an underscore. This is not allowed in normal WML (prefix starting with underscore is reserved for the engine internal use). It is here for clarity purpose&lt;br /&gt;
&lt;br /&gt;
* '''[leading_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=leading&lt;br /&gt;
* '''[recruit_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=recruited&lt;br /&gt;
* '''[recruiting_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=recruiting&lt;br /&gt;
* '''[standing_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=standing,default&lt;br /&gt;
note for 1.4 :''default'' doesn't exist in 1.4, but the semantic is the same.&lt;br /&gt;
&lt;br /&gt;
i.e: the animation will be used to build default animations&lt;br /&gt;
* '''[idle_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=idling&lt;br /&gt;
* '''[levelin_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=levelin&lt;br /&gt;
* '''[levelout_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=levelout&lt;br /&gt;
* '''[healing_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=healing&lt;br /&gt;
 value=&amp;lt;damage= value&amp;gt;&lt;br /&gt;
* '''[healed_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=healed&lt;br /&gt;
 value=&amp;lt;healing= value&amp;gt;&lt;br /&gt;
 [_healed_sound_frame]&lt;br /&gt;
    sound=heal.wav&lt;br /&gt;
 [/_healed_sound_frame]&lt;br /&gt;
* '''[poison_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=poisoned&lt;br /&gt;
 value=&amp;lt;damage= value&amp;gt;&lt;br /&gt;
 [_poison_sound_frame]&lt;br /&gt;
    sound=poison.ogg&lt;br /&gt;
 [/_poison_sound_frame]&lt;br /&gt;
* '''[movement_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=movement&lt;br /&gt;
 offset=&amp;quot;0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150,0~1:150&amp;quot;&lt;br /&gt;
* '''[pre_movement_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=pre_movement&lt;br /&gt;
* '''[post_movement_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=post_movement&lt;br /&gt;
* '''[draw_weapon_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=draw_weapon&lt;br /&gt;
* '''[sheath_weapon_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=sheath_weapon_movement&lt;br /&gt;
* '''[defend]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=defend&lt;br /&gt;
 value=&amp;lt;damage= value&amp;gt;&lt;br /&gt;
 &amp;lt;WML content&amp;gt;&lt;br /&gt;
 [frame]&lt;br /&gt;
    blend_with=255,0,0&lt;br /&gt;
    blend_ratio=&amp;quot;0.5:50,0.0:50&amp;quot;&lt;br /&gt;
 [/frame]&lt;br /&gt;
&lt;br /&gt;
there are some subtil change compared to what is described above to avoid the red flash when value=0, but it should work as expected as far as WML author are concerned&lt;br /&gt;
 &lt;br /&gt;
* '''[attack_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
if the animation contains a missile frame&lt;br /&gt;
&lt;br /&gt;
 apply_to=attack&lt;br /&gt;
 missile_offset=&amp;quot;0~0.8&amp;quot;&lt;br /&gt;
&lt;br /&gt;
else&lt;br /&gt;
&lt;br /&gt;
 apply_to=attack&lt;br /&gt;
 offset=&amp;quot;0~0.6,0.6~0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* '''[death]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=death&lt;br /&gt;
 [_death_sound_frame]&lt;br /&gt;
    sound=&amp;lt;die_sound= of the enclosing [unit] tag&amp;gt;&lt;br /&gt;
 [/_death_sound_frame]&lt;br /&gt;
* '''[victory_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=victory&lt;br /&gt;
* '''[extra_anim]''' is an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=&amp;lt;flag= value of the anim&amp;gt;&lt;br /&gt;
* '''[teleport_anim]''' will be cut into two at the clock-time 0&lt;br /&gt;
everything before zero becomes an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=pre_teleport&lt;br /&gt;
everything after zero becomes an animation with the following parameters automatically set&lt;br /&gt;
 apply_to=post_teleport&lt;br /&gt;
&lt;br /&gt;
== Layering ==&lt;br /&gt;
The ''layer'' progressive parameter allows the animation writer to choose in what order the animation should be drawn.&lt;br /&gt;
&lt;br /&gt;
this value must be between 0 and 100&lt;br /&gt;
&lt;br /&gt;
* the back of haloes is drawn with a value of 10&lt;br /&gt;
* when unspecified, a animation is drawn with a value of 40&lt;br /&gt;
* terrain elements that are supposed to go in front of units (castles) are drawn with a value of 50&lt;br /&gt;
* orbs and status bars are drawn on layer 80&lt;br /&gt;
* when unspecified missile frames are drawn on layer 90&lt;br /&gt;
&lt;br /&gt;
by changing these values, it is easy to have the unit display the way you want&lt;br /&gt;
&lt;br /&gt;
== Optimization ==&lt;br /&gt;
&lt;br /&gt;
there is a special flag that goes into the animation block (not the frame) &lt;br /&gt;
&lt;br /&gt;
* ''offscreen'' a boolean saying if the unit's animation should be played when the unit is offscreen. You want the animation to play offscreen if the animation contains some usefull sound effects.This attribute defaults to true (play offscreen) except for standing and idle animations where it defaults to false&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[UnitTypeWML]]&lt;br /&gt;
* [[ReferenceWML]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: WML Reference]]&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=EasyCoding&amp;diff=38061</id>
		<title>EasyCoding</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=EasyCoding&amp;diff=38061"/>
		<updated>2010-08-27T13:06:44Z</updated>

		<summary type="html">&lt;p&gt;Boucman: /* Support for standalone multiplayer scenarios */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Foreword ==&lt;br /&gt;
This page is here to document easy to do coding tasks. It is not here to double the feature request database, and should only be filled by people that know the code well enough to judge the difficulty of a given task. &lt;br /&gt;
&lt;br /&gt;
If you are such a person, you should feel free to edit this page.&lt;br /&gt;
&lt;br /&gt;
If you're not, you should post a feature request and discuss your idea on the forum or IRC. A coder with better knowledge of the code might give you the green light to add your feature here.&lt;br /&gt;
&lt;br /&gt;
Anybody should feel free to add &amp;quot;clues&amp;quot; to any tasks, that is entry points, traps to avoid, person to contact to discuss and so on.&lt;br /&gt;
&lt;br /&gt;
If you plan to work on a feature, write your name at the bottom of the feature, with the date. Note that if you are too long at working on a feature I'll &amp;quot;free&amp;quot; it back (that is if you're not working on it. If you have problems implementing it, just tell us....)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[User:Boucman|Boucman]] 20:48, 3 October 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since bugs are sometimes a good opportunity to get a first idea of the code, i will add some here that are easy to fix as soon as i stumble upon them (the one i had in mind is fixed already ;-).&lt;br /&gt;
&lt;br /&gt;
--Yogi Bear, 28 February 2008&lt;br /&gt;
&lt;br /&gt;
== MP related features ==&lt;br /&gt;
&lt;br /&gt;
== WML related features ==&lt;br /&gt;
&lt;br /&gt;
=== WML configurable village income / upkeep ===&lt;br /&gt;
Preferably as a [scenario], [side] or [campaign] keys. As per FR #6301 [https://gna.org/bugs/?6301]. Patch submitted: [https://gna.org/patch/index.php?1162] (gabba)&lt;br /&gt;
&lt;br /&gt;
--[[User:Boucman|Boucman]] 08:56, 28 February 2010 (UTC) : this is postponed for 1.8, can be considered reserved&lt;br /&gt;
&lt;br /&gt;
=== Add support of [if] for [scenario] ===&lt;br /&gt;
As per FR #4539 [https://gna.org/bugs/?4539]&lt;br /&gt;
&lt;br /&gt;
=== Side-specific results ===&lt;br /&gt;
Giving result=defeat or result=victory for specific sides. ([http://gna.org/bugs/index.php?4960 FR #4960]) -- [[User:dlr365|dlr365]] -- patch submitted [https://gna.org/bugs/index.php?4960]&lt;br /&gt;
&lt;br /&gt;
--[[User:Boucman|Boucman]] 08:58, 28 February 2010 (UTC) Patch seems abandonned, but can be used for further work feel free to take over the FR&lt;br /&gt;
&lt;br /&gt;
=== Support for leaderless multiplayergames ===&lt;br /&gt;
Add support for the WML key victory_when_enemies_defeated= in the scenario tag during multiplayergames. ([https://gna.org/bugs/index.php?8106 FR #8106])&lt;br /&gt;
--[[User:Endercoaster|endercoaster]] 30, March 2010. I'm gonna give this one a try.&lt;br /&gt;
&lt;br /&gt;
=== Support for standalone multiplayer scenarios ===&lt;br /&gt;
There used to be support for standalone scenarios in the userdata tree, in reorganising the trees this feature got lost and an add-on is now required to add a scenario.&lt;br /&gt;
Re-add this feature. It is probably a good idea to mirror the mainline multiplayer tree.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Support variable recall cost in wml ===&lt;br /&gt;
see https://gna.org/bugs/?16538&lt;br /&gt;
&lt;br /&gt;
the syntax needs to be discussed and refined, but the overall idea is good&lt;br /&gt;
&lt;br /&gt;
make sure to update whiteboard to handle this correctly&lt;br /&gt;
&lt;br /&gt;
Ask Boucman&lt;br /&gt;
&lt;br /&gt;
=== Other Ideas ===&lt;br /&gt;
See [[FutureWML]]; some ideas there are easier than others.&lt;br /&gt;
&lt;br /&gt;
== Improvements to AI ==&lt;br /&gt;
&lt;br /&gt;
Fix some todos, add new formula functions, or do minor improvements to the formula language. Make it easier to debug the formula language, add more ai components.&lt;br /&gt;
&lt;br /&gt;
Please discuss these with Crab, Dragonking, Sirp or Boucman&lt;br /&gt;
&lt;br /&gt;
=== AI Batch testing ===&lt;br /&gt;
&lt;br /&gt;
Finish patch #1169 [https://gna.org/patch/?1169]&lt;br /&gt;
&lt;br /&gt;
=== Add more ai actions ===&lt;br /&gt;
&lt;br /&gt;
Add an ai action (and add formula_ai function to do that) to set a goto on a unit&lt;br /&gt;
&lt;br /&gt;
Add an ai action (and add formula_ai function to do that) to send a chat message to a player&lt;br /&gt;
&lt;br /&gt;
Add an ai action to set formula ai variable (convert existing code from formula_ai)&lt;br /&gt;
&lt;br /&gt;
Add an ai action to set formula ai unit variable (convert existing code from formula_ai)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Add an ai action  (and add formula_ai function to do that) to fire a WML event &lt;br /&gt;
&lt;br /&gt;
=== write a (fai or c++ or lua) candidate action for leader control ===&lt;br /&gt;
&lt;br /&gt;
=== write a (fai or c++ or lua) candidate action for using leadership/illuminate  ===&lt;br /&gt;
special handling of units with leadership to have them support units. Only do it if it actually is useful (less hits needed to kill the unit) and ability to help multiple units in a single turn (assuming enough MP)&lt;br /&gt;
&lt;br /&gt;
=== write a (fai or c++ or lua) candidate action for healer control ===&lt;br /&gt;
Handle units with healing power, moving them at places where they can provide the most healing&lt;br /&gt;
&lt;br /&gt;
=== berserker improvement ===&lt;br /&gt;
The default AI's strategy of attacking as much as possible is very bad with berserker... A simple AI that would prevent the berserker from attacking (and keeping him close to fight without being exposed) and attack when the chance to kill is high enough would be an interesting addition&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== power projection improvement ===&lt;br /&gt;
AI sometimes wants to calculate 'how much firepower can enemy bring on location X'. in doing so, it considers enemy possible moves, time of day, attacks, enemy defense, etc.&lt;br /&gt;
There is specific problem with 'time_of_day' used in that calculation -sometimes, it's really needed to check 'time of day for NEXT turn', not time of day for THIS turn.(since the time of day might change next turn). &lt;br /&gt;
&lt;br /&gt;
power_projection must be fixed to account for the possibility of time_of_day being different.&lt;br /&gt;
&lt;br /&gt;
Note that some enemies might go after us (so, still on THIS turn), and some - before us (so, their next turn will be on NEXT turn).&lt;br /&gt;
&lt;br /&gt;
== GUI related features ==&lt;br /&gt;
-------------------&lt;br /&gt;
&lt;br /&gt;
Note at the moment Mordante is working on a new GUI system, these &lt;br /&gt;
changes will probably affect the way these items need to be implemented.&lt;br /&gt;
Contact Mordante on IRC before starting to work on these.&lt;br /&gt;
  &lt;br /&gt;
--[[User:SkeletonCrew|SkeletonCrew]] 14:04, 9 March 2008 (EDT)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Theme Changes ===&lt;br /&gt;
&lt;br /&gt;
* allow custom themes to display values of WML variables ([http://gna.org/bugs/index.php?6209 FR #6209])&lt;br /&gt;
* hide the hourglass item from the statusbar when there is no timer&lt;br /&gt;
&lt;br /&gt;
=== Widget Changes ===&lt;br /&gt;
* show side number, name and team association information in the status table &lt;br /&gt;
* make games sortable in the lobby (open slots, total number of players, era, XP modifier, gold per village, fog/shroud) &lt;br /&gt;
* input history (chat, commands, ..) - note: rujasu is working on this feature&lt;br /&gt;
=== Story Screen improvements ===&lt;br /&gt;
see http://www.wesnoth.org/forum/viewtopic.php?p=439346#p439346 for the suggestion and https://gna.org/patch/?1587 for a patch that already touched that area heavily&lt;br /&gt;
&lt;br /&gt;
== GUI2 related features ==&lt;br /&gt;
GUI2 is the new gui engine Mordante/SkeletonCrew is working on. &lt;br /&gt;
* Information on the wiki can be found here http://www.wesnoth.org/wiki/GUIToolkit&lt;br /&gt;
* The source code is under src/gui/&lt;br /&gt;
* The configuration config files are under data/gui/default&lt;br /&gt;
&lt;br /&gt;
Some tasks need the --new-widgets since the code is only shown in the experimental mode. Tasks which need this switch have the * in the title.&lt;br /&gt;
&lt;br /&gt;
At the moment there are no easy tasks available.&lt;br /&gt;
&lt;br /&gt;
== Miscellaneous ==&lt;br /&gt;
&lt;br /&gt;
=== More powerful village naming ===&lt;br /&gt;
'''Adding mountain names and other features to village names, having a second random name in village names'''&lt;br /&gt;
&lt;br /&gt;
Currently the village naming engine has a very good structure that could allow &lt;br /&gt;
more powerfull names to be generated. &lt;br /&gt;
Understanding how it works should be quite easy, and a few usefull improvements could be added.&lt;br /&gt;
&lt;br /&gt;
* Currently villages can use lake names and river names, this should be extended to other features like bridges, swamps, mountains etc...&lt;br /&gt;
* It would be nice to have a separate list of &amp;quot;first sylabus&amp;quot; and &amp;quot;last sylabus&amp;quot; for naming. That's not really needed in english, but some translations could use it&lt;br /&gt;
* Again, it is common to have villages with more than one &amp;quot;random&amp;quot; word in them. having a $name2 variable would be nice&lt;br /&gt;
&lt;br /&gt;
Euschn 24/03/2009&lt;br /&gt;
&lt;br /&gt;
=== Debug Mode ===&lt;br /&gt;
* New debug command functionality (setting additional status.variables, possibly terrain)&lt;br /&gt;
=== Option to disable terrain animations globally ===&lt;br /&gt;
see https://gna.org/bugs/?15976&lt;br /&gt;
&lt;br /&gt;
please think a little about use cases (editor, game etc...)&lt;br /&gt;
&lt;br /&gt;
ask boucman for details&lt;br /&gt;
&lt;br /&gt;
== Bugs ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
[[NotSoEasyCoding]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Future]]&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=PreprocessorRef&amp;diff=37994</id>
		<title>PreprocessorRef</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=PreprocessorRef&amp;diff=37994"/>
		<updated>2010-08-20T19:12:29Z</updated>

		<summary type="html">&lt;p&gt;Boucman: /* The WML preprocessor */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WML Tags}}&lt;br /&gt;
== The WML preprocessor ==&lt;br /&gt;
&lt;br /&gt;
Wesnoth loads just one configuration file directly: '''data/_main.cfg'''.&lt;br /&gt;
However the WML preprocessor allows to include more files.&lt;br /&gt;
Whenever a WML file is read by Wesnoth, it is passed through the preprocessor.&lt;br /&gt;
&lt;br /&gt;
The preprocessor can interpret a simple language of string-expansions known as &amp;quot;macros.&amp;quot; A macro should always be defined '''before''' the place where it needs to be used.&lt;br /&gt;
&lt;br /&gt;
The preprocessor is applied recursively, so included files will&lt;br /&gt;
be parsed for macros, and after macro expansion will be parsed for macros&lt;br /&gt;
again, and so on.  As a result, you should not write a recursive macro,&lt;br /&gt;
because it will cause errors&lt;br /&gt;
(but, alas, not necessarily error messages).&lt;br /&gt;
&lt;br /&gt;
The following directives are used to create and use ''macros'',&lt;br /&gt;
i.e. shortcuts which reduce repetition of information.&lt;br /&gt;
See [[UtilWML]], [[UsefulWMLFragments]] for examples and [http://www.wesnoth.org/macro-reference.xhtml the macro reference] for the predefined core macros.&lt;br /&gt;
* '''#define ''symbol'' [''parameters''] ''newline'' ''substitution'' #enddef''' all subsequent occurences of '''{''symbol'' [''arguments'']}''' (see below) will be replaced by ''substitution'' with all occurences of any parameter {''parameter''} within ''substitution'' replaced by the parameter's corresponding value in ''arguments''.  For example, the UNIT macro used below would be defined:&lt;br /&gt;
&lt;br /&gt;
 #define UNIT TYPE X Y## the ordering is important here;&lt;br /&gt;
                      ## since WML does not distinguish&lt;br /&gt;
                      ## data into different types, only&lt;br /&gt;
                      ## the ordering is used to determine which&lt;br /&gt;
                      ## arguments apply to which parameters.&lt;br /&gt;
 [unit]&lt;br /&gt;
 type={TYPE}## the unit will be of type TYPE, so different&lt;br /&gt;
            ## instantiations&lt;br /&gt;
            ## of this macro can create different units.&lt;br /&gt;
 x={X}&lt;br /&gt;
 y={Y}&lt;br /&gt;
 side=2## the unit will be an enemy, regardless of the parameter&lt;br /&gt;
       ## values. This reduces &amp;quot;repetition of information&amp;quot;,&lt;br /&gt;
       ## since it is no longer necessary to specify&lt;br /&gt;
       ## each created unit as an enemy.&lt;br /&gt;
 [/unit]&lt;br /&gt;
 #enddef&lt;br /&gt;
(See [[SingleUnitWML]] for information on creating units using WML.)&lt;br /&gt;
* '''{''symbol'' [''arguments'']}''' if ''symbol'' is defined, the preprocessor will replace this instruction by the expression ''symbol'' is defined as, using ''arguments'' as parameters.  You can create multiple word arguments by using parentheses to restrain the argument.  For example, while '''{UNIT Wolf Rider 18 24}''' will attempt to create a &amp;quot;Wolf&amp;quot; at (Rider,18), causing Wesnoth to crash, the macro '''{UNIT (Wolf Rider) 18 24}''' will create a &amp;quot;Wolf Rider&amp;quot; at (18,24) as it should. ('''UNIT''' is defined above).  See the ''#define'' preprocessor instruction above for information on defining symbols, including symbols with arguments.  Several symbols are defined in the normal game code; for reference they are listed in [[UtilWML]].&lt;br /&gt;
&lt;br /&gt;
Note: Using the name-string of an existing macro as the name-string of a macro argument will always overwrite the original definition of the macro, e.g.:&lt;br /&gt;
 #define VARIABLE&lt;br /&gt;
 #enddef&lt;br /&gt;
 #define MACRO VARIABLE&lt;br /&gt;
  {VARIABLE} # is calling for the argument, not for the macro above&lt;br /&gt;
 #enddef&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unlike the other preprocessor directives, #ifdef and #ifndef are not&lt;br /&gt;
mere conveniences.&lt;br /&gt;
They are necessary to distinguish between different modes of play.&lt;br /&gt;
* '''#ifdef ''symbol'' ''substitution-if-stored''  [#else ''substitution-if-not-stored''] #endif'''  If ''symbol'' has been stored, the whole block will be replaced by ''substitution-if-stored''.  If not, it will be replaced by ''substitution-if-not-stored'' if it is available.  ''symbol'' can take the following values:&lt;br /&gt;
** a campaign difficulty level.  Usually '''EASY''', '''NORMAL''', or '''HARD''', it is decided by the key ''difficulties'' (see [[CampaignWML]]).&lt;br /&gt;
** a campaign ID. Each campaign stores a preprocessor ID.  See ''define'', [[CampaignWML]].&lt;br /&gt;
** '''MULTIPLAYER''' is stored when the player is playing or setting up a multiplayer game (i.e. a game with '''scenario_type=multiplayer''').&lt;br /&gt;
** '''DEBUG_MODE''' is stored when the player has launched wesnoth in debug mode (i.e. with '''-d''')&lt;br /&gt;
** '''TUTORIAL''' is stored when the player is playing the tutorial.&lt;br /&gt;
** '''APPLE''' is stored if the computer Wesnoth is being run on is an Apple. (this one is only available to the configuration of the game)&lt;br /&gt;
** '''LOW_MEM''' {{DevFeature1.9}} The binary was compiled with the LOW_MEM option&lt;br /&gt;
** '''TINY''' The binary was compiled with the TINY_GUI option&lt;br /&gt;
* '''#ifndef''' behaves exactly like '''#ifdef''', except that it inverts the test sense; guarded text is included only if ''symbol'' has not been stored.&lt;br /&gt;
''#undef'' can be useful too if ''#ifdef'' is not enough.&lt;br /&gt;
* '''#undef ''symbol'' '''  erases ''symbol''&lt;br /&gt;
* '''#ifhave''' {{DevFeature1.9}} checks for the existence of a file.&lt;br /&gt;
* '''#ifnhave''' {{DevFeature1.9}} is the inverted version of '''#ifhave'''.&lt;br /&gt;
&lt;br /&gt;
These directives expand a file by including other files, ''filename'' may not contain '..' or the directive will be skipped:&lt;br /&gt;
* '''{''filename''}''' if ''filename'' isn't a predefined symbol (see above), Wesnoth will assume it's a path to a file in the main '''data/''' subdirectory of Wesnoth and include the file it points to here &amp;quot;as is&amp;quot;.  Forward slashes('''/''') should be used to separate directories from their elements, even if your platform uses a different symbol such as colon (''':''') or backslash ('''\''').  &lt;br /&gt;
* '''{~''filename''}''' similar to above, but the preprocessor assumes that the filename is relative to '''data/''' subdirectory of the user data directory.  The ''user data directory'' varies depending on platform. See [[EditingWesnoth#Where_is_my_user_data_directory.3F|Where_is_my_user_data_directory?]]&lt;br /&gt;
&lt;br /&gt;
* '''{./''filename''}''' is similar to the '''{''filename''}''' directive, but is assumed to be relative to the directory which contains the file in which this appears.  For example, if used in game.cfg, it is equivalent to '''{''filename''}'''.&lt;br /&gt;
* If ''filename'' points to a directory, the preprocessor will include all files in the directory ''filename'', non-recursively and in alphabetical order.  Starting in 1.3.3, some files in such directories are handled specially.  &lt;br /&gt;
&lt;br /&gt;
If there is a file named ''dir/_main.cfg'' in a directory referenced as '''{''dir''}''', only that ''_main.cfg'' file is processed; it may include other files in itself, of course . This feature is useful for creating WML directories that are self-contained WML packages with their own initializations (like campaigns). This can replace the older convention of having a ''dir.cfg'' at the same level as ''dir'' which does '''{''dir''}''' somewhere in itself.&lt;br /&gt;
&lt;br /&gt;
If there are files named ''dir/*/_main.cfg'' in a directory referenced as '''{''dir''}''', where * is any subdirectories ''dir'', then they all are processed (except if there is also a file named ''dir/_main.cfg''). This means that if you have a layout like this:&lt;br /&gt;
 dir/&lt;br /&gt;
 dir/a/_main.cfg&lt;br /&gt;
 dir/a/other.cfg&lt;br /&gt;
 dir/b/_main.cfg&lt;br /&gt;
 dir/b/other.cfg&lt;br /&gt;
 dir/other.cfg&lt;br /&gt;
Then '''{dir}''' will process (in alphabetical order): dir/a/_main.cfg, dir/b/main.cfg, dir/other.cfg.&lt;br /&gt;
&lt;br /&gt;
If there is a file named ''dir/_final.cfg'' in a directory referenced as '''{''dir''}''' (and no ''main.cfg'', so that all files in the directory are processed normally) the ''_final.cfg'' is guaranteed to be processed ''after'' all other files in the directory.&lt;br /&gt;
&lt;br /&gt;
If there is a file named ''dir/_initial.cfg'' in a directory referenced as '''{''dir''}''' (and no ''main.cfg'', so that all files in the directory are processed normally) the ''_initial.cfg'' is guaranteed to be processed ''before'' all other files in the directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that the parser was changed various times, so don't expect older Wesnoth version to behave exactly the same.&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.9}} Including non-existent file is now a fatal error and halts the preprocessing. Use #ifhave to test for the existence of files that aren't a part of your own add-on.&lt;br /&gt;
&lt;br /&gt;
== The preprocessor command line == &lt;br /&gt;
{{DevFeature1.9}} &lt;br /&gt;
&lt;br /&gt;
As of wesnoth 1.9, there are some new command line arguments available for the wesnoth executable:&lt;br /&gt;
--preprocess&lt;br /&gt;
--preprocess-input-macros&lt;br /&gt;
--preprocess-output-macros&lt;br /&gt;
&lt;br /&gt;
Commands details:&lt;br /&gt;
&lt;br /&gt;
===--preprocess===&lt;br /&gt;
&lt;br /&gt;
 --preprocess[=define1,define2,...] &amp;lt;file/folder&amp;gt; &amp;lt;target directory&amp;gt;&lt;br /&gt;
or the short form:&lt;br /&gt;
 -p[=define1,define2,...] &amp;lt;file/folder&amp;gt; &amp;lt;target directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The define1,define2,... is a list of defines, to be added ''before'' anything is preprocessed. &lt;br /&gt;
&lt;br /&gt;
The preprocess command will '''preprocess first''' the common config files in ''data/core'', and afterwards, the specified ones. You can specifiy a single file to be preprocesses (if you want to preprocess multiple separate files, you have to invoke the command separately), or an entire folder (this will be preprocessed on the known preprocessor rules). &lt;br /&gt;
&lt;br /&gt;
The resulted preprocessed files will be written in the target directory. There will be 2 types of files: the .cfg files and .plain files (this contain the line symbols and textdomain changes)&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;file/folder&amp;gt; and &amp;lt;target directory&amp;gt; are not in ''absolute path'' form, they will be treated like relative to the wesnoth's executable path. &lt;br /&gt;
&lt;br /&gt;
Some examples:&lt;br /&gt;
 -p ~/wesnoth/data/campaigns/tutorial ~/result &lt;br /&gt;
will preprocess entire tutorial folder, and write the resulted files in the ~/result folder&lt;br /&gt;
 -p=MULTIPLAYER data/campaigns/my_campaign/some_scenario.cfg data/result&lt;br /&gt;
will add the ''MULTIPLAYER'' define in defines list and then preprocess the scenario config file&lt;br /&gt;
 -p=SINGLEPLAYER,HARD ~/wesnoth/data/campaigns/my_campaign ~/result&lt;br /&gt;
will add the ''SINGLEPLAYER'' and ''HARD'' defines before preprocessing the files.&lt;br /&gt;
&lt;br /&gt;
Note! As you saw in the examples, the '=' character is mandatory if you want to specify any auxiliar defines&lt;br /&gt;
&lt;br /&gt;
===--preprocess-input-macros===&lt;br /&gt;
 --preprocess-input-macros &amp;lt;file&amp;gt;&lt;br /&gt;
This command will take the specified file, parse the defines in it, and will use them when preprocessing the resource with --preprocess. The file must contain only [preproc_define]s. This is different than adding defines to --preprocess, as it contains the macro information.&lt;br /&gt;
&lt;br /&gt;
===--preprocess-output-macro===&lt;br /&gt;
 --preprocess-output-macro [&amp;lt;file&amp;gt;]&lt;br /&gt;
Outputs the defines_map resulted from preprocessing. This is will include (if any) --preprocess-input-macro file's content.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you want a more detailed log, you can simply add the command: &amp;quot;--log-debug=all&amp;quot; or &amp;quot;--log-info=all&amp;quot; before the preprocessing command, so you will see how things are parsed,etc.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[SyntaxWML]]&lt;br /&gt;
* [[ReferenceWML]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: WML Reference]]&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=PreprocessorRef&amp;diff=37993</id>
		<title>PreprocessorRef</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=PreprocessorRef&amp;diff=37993"/>
		<updated>2010-08-20T18:30:38Z</updated>

		<summary type="html">&lt;p&gt;Boucman: /* The WML preprocessor */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WML Tags}}&lt;br /&gt;
== The WML preprocessor ==&lt;br /&gt;
&lt;br /&gt;
Wesnoth loads just one configuration file directly: '''data/_main.cfg'''.&lt;br /&gt;
However the WML preprocessor allows to include more files.&lt;br /&gt;
Whenever a WML file is read by Wesnoth, it is passed through the preprocessor.&lt;br /&gt;
&lt;br /&gt;
The preprocessor can interpret a simple language of string-expansions known as &amp;quot;macros.&amp;quot; A macro should always be defined '''before''' the place where it needs to be used.&lt;br /&gt;
&lt;br /&gt;
The preprocessor is applied recursively, so included files will&lt;br /&gt;
be parsed for macros, and after macro expansion will be parsed for macros&lt;br /&gt;
again, and so on.  As a result, you should not write a recursive macro,&lt;br /&gt;
because it will cause errors&lt;br /&gt;
(but, alas, not necessarily error messages).&lt;br /&gt;
&lt;br /&gt;
The following directives are used to create and use ''macros'',&lt;br /&gt;
i.e. shortcuts which reduce repetition of information.&lt;br /&gt;
See [[UtilWML]], [[UsefulWMLFragments]] for examples and [http://www.wesnoth.org/macro-reference.xhtml the macro reference] for the predefined core macros.&lt;br /&gt;
* '''#define ''symbol'' [''parameters''] ''newline'' ''substitution'' #enddef''' all subsequent occurences of '''{''symbol'' [''arguments'']}''' (see below) will be replaced by ''substitution'' with all occurences of any parameter {''parameter''} within ''substitution'' replaced by the parameter's corresponding value in ''arguments''.  For example, the UNIT macro used below would be defined:&lt;br /&gt;
&lt;br /&gt;
 #define UNIT TYPE X Y## the ordering is important here;&lt;br /&gt;
                      ## since WML does not distinguish&lt;br /&gt;
                      ## data into different types, only&lt;br /&gt;
                      ## the ordering is used to determine which&lt;br /&gt;
                      ## arguments apply to which parameters.&lt;br /&gt;
 [unit]&lt;br /&gt;
 type={TYPE}## the unit will be of type TYPE, so different&lt;br /&gt;
            ## instantiations&lt;br /&gt;
            ## of this macro can create different units.&lt;br /&gt;
 x={X}&lt;br /&gt;
 y={Y}&lt;br /&gt;
 side=2## the unit will be an enemy, regardless of the parameter&lt;br /&gt;
       ## values. This reduces &amp;quot;repetition of information&amp;quot;,&lt;br /&gt;
       ## since it is no longer necessary to specify&lt;br /&gt;
       ## each created unit as an enemy.&lt;br /&gt;
 [/unit]&lt;br /&gt;
 #enddef&lt;br /&gt;
(See [[SingleUnitWML]] for information on creating units using WML.)&lt;br /&gt;
* '''{''symbol'' [''arguments'']}''' if ''symbol'' is defined, the preprocessor will replace this instruction by the expression ''symbol'' is defined as, using ''arguments'' as parameters.  You can create multiple word arguments by using parentheses to restrain the argument.  For example, while '''{UNIT Wolf Rider 18 24}''' will attempt to create a &amp;quot;Wolf&amp;quot; at (Rider,18), causing Wesnoth to crash, the macro '''{UNIT (Wolf Rider) 18 24}''' will create a &amp;quot;Wolf Rider&amp;quot; at (18,24) as it should. ('''UNIT''' is defined above).  See the ''#define'' preprocessor instruction above for information on defining symbols, including symbols with arguments.  Several symbols are defined in the normal game code; for reference they are listed in [[UtilWML]].&lt;br /&gt;
&lt;br /&gt;
Note: Using the name-string of an existing macro as the name-string of a macro argument will always overwrite the original definition of the macro, e.g.:&lt;br /&gt;
 #define VARIABLE&lt;br /&gt;
 #enddef&lt;br /&gt;
 #define MACRO VARIABLE&lt;br /&gt;
  {VARIABLE} # is calling for the argument, not for the macro above&lt;br /&gt;
 #enddef&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unlike the other preprocessor directives, #ifdef and #ifndef are not&lt;br /&gt;
mere conveniences.&lt;br /&gt;
They are necessary to distinguish between different modes of play.&lt;br /&gt;
* '''#ifdef ''symbol'' ''substitution-if-stored''  [#else ''substitution-if-not-stored''] #endif'''  If ''symbol'' has been stored, the whole block will be replaced by ''substitution-if-stored''.  If not, it will be replaced by ''substitution-if-not-stored'' if it is available.  ''symbol'' can take the following values:&lt;br /&gt;
** a campaign difficulty level.  Usually '''EASY''', '''NORMAL''', or '''HARD''', it is decided by the key ''difficulties'' (see [[CampaignWML]]).&lt;br /&gt;
** a campaign ID. Each campaign stores a preprocessor ID.  See ''define'', [[CampaignWML]].&lt;br /&gt;
** '''MULTIPLAYER''' is stored when the player is playing or setting up a multiplayer game (i.e. a game with '''scenario_type=multiplayer''').&lt;br /&gt;
** '''DEBUG_MODE''' is stored when the player has launched wesnoth in debug mode (i.e. with '''-d''')&lt;br /&gt;
** '''TUTORIAL''' is stored when the player is playing the tutorial.&lt;br /&gt;
** '''APPLE''' is stored if the computer Wesnoth is being run on is an Apple. (this one is only available to the configuration of the game)&lt;br /&gt;
** '''LOW_MEM''' {{DevFeature1.9}} The binary was compiled with the LOW_MEM option&lt;br /&gt;
** '''USE_TINY_GUI''' {{DevFeature1.9}} The binary was compiled with the TINY_GUI option&lt;br /&gt;
* '''#ifndef''' behaves exactly like '''#ifdef''', except that it inverts the test sense; guarded text is included only if ''symbol'' has not been stored.&lt;br /&gt;
''#undef'' can be useful too if ''#ifdef'' is not enough.&lt;br /&gt;
* '''#undef ''symbol'' '''  erases ''symbol''&lt;br /&gt;
* '''#ifhave''' {{DevFeature1.9}} checks for the existence of a file.&lt;br /&gt;
* '''#ifnhave''' {{DevFeature1.9}} is the inverted version of '''#ifhave'''.&lt;br /&gt;
&lt;br /&gt;
These directives expand a file by including other files, ''filename'' may not contain '..' or the directive will be skipped:&lt;br /&gt;
* '''{''filename''}''' if ''filename'' isn't a predefined symbol (see above), Wesnoth will assume it's a path to a file in the main '''data/''' subdirectory of Wesnoth and include the file it points to here &amp;quot;as is&amp;quot;.  Forward slashes('''/''') should be used to separate directories from their elements, even if your platform uses a different symbol such as colon (''':''') or backslash ('''\''').  &lt;br /&gt;
* '''{~''filename''}''' similar to above, but the preprocessor assumes that the filename is relative to '''data/''' subdirectory of the user data directory.  The ''user data directory'' varies depending on platform. See [[EditingWesnoth#Where_is_my_user_data_directory.3F|Where_is_my_user_data_directory?]]&lt;br /&gt;
&lt;br /&gt;
* '''{./''filename''}''' is similar to the '''{''filename''}''' directive, but is assumed to be relative to the directory which contains the file in which this appears.  For example, if used in game.cfg, it is equivalent to '''{''filename''}'''.&lt;br /&gt;
* If ''filename'' points to a directory, the preprocessor will include all files in the directory ''filename'', non-recursively and in alphabetical order.  Starting in 1.3.3, some files in such directories are handled specially.  &lt;br /&gt;
&lt;br /&gt;
If there is a file named ''dir/_main.cfg'' in a directory referenced as '''{''dir''}''', only that ''_main.cfg'' file is processed; it may include other files in itself, of course . This feature is useful for creating WML directories that are self-contained WML packages with their own initializations (like campaigns). This can replace the older convention of having a ''dir.cfg'' at the same level as ''dir'' which does '''{''dir''}''' somewhere in itself.&lt;br /&gt;
&lt;br /&gt;
If there are files named ''dir/*/_main.cfg'' in a directory referenced as '''{''dir''}''', where * is any subdirectories ''dir'', then they all are processed (except if there is also a file named ''dir/_main.cfg''). This means that if you have a layout like this:&lt;br /&gt;
 dir/&lt;br /&gt;
 dir/a/_main.cfg&lt;br /&gt;
 dir/a/other.cfg&lt;br /&gt;
 dir/b/_main.cfg&lt;br /&gt;
 dir/b/other.cfg&lt;br /&gt;
 dir/other.cfg&lt;br /&gt;
Then '''{dir}''' will process (in alphabetical order): dir/a/_main.cfg, dir/b/main.cfg, dir/other.cfg.&lt;br /&gt;
&lt;br /&gt;
If there is a file named ''dir/_final.cfg'' in a directory referenced as '''{''dir''}''' (and no ''main.cfg'', so that all files in the directory are processed normally) the ''_final.cfg'' is guaranteed to be processed ''after'' all other files in the directory.&lt;br /&gt;
&lt;br /&gt;
If there is a file named ''dir/_initial.cfg'' in a directory referenced as '''{''dir''}''' (and no ''main.cfg'', so that all files in the directory are processed normally) the ''_initial.cfg'' is guaranteed to be processed ''before'' all other files in the directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that the parser was changed various times, so don't expect older Wesnoth version to behave exactly the same.&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.9}} Including non-existent file is now a fatal error and halts the preprocessing. Use #ifhave to test for the existence of files that aren't a part of your own add-on.&lt;br /&gt;
&lt;br /&gt;
== The preprocessor command line == &lt;br /&gt;
{{DevFeature1.9}} &lt;br /&gt;
&lt;br /&gt;
As of wesnoth 1.9, there are some new command line arguments available for the wesnoth executable:&lt;br /&gt;
--preprocess&lt;br /&gt;
--preprocess-input-macros&lt;br /&gt;
--preprocess-output-macros&lt;br /&gt;
&lt;br /&gt;
Commands details:&lt;br /&gt;
&lt;br /&gt;
===--preprocess===&lt;br /&gt;
&lt;br /&gt;
 --preprocess[=define1,define2,...] &amp;lt;file/folder&amp;gt; &amp;lt;target directory&amp;gt;&lt;br /&gt;
or the short form:&lt;br /&gt;
 -p[=define1,define2,...] &amp;lt;file/folder&amp;gt; &amp;lt;target directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The define1,define2,... is a list of defines, to be added ''before'' anything is preprocessed. &lt;br /&gt;
&lt;br /&gt;
The preprocess command will '''preprocess first''' the common config files in ''data/core'', and afterwards, the specified ones. You can specifiy a single file to be preprocesses (if you want to preprocess multiple separate files, you have to invoke the command separately), or an entire folder (this will be preprocessed on the known preprocessor rules). &lt;br /&gt;
&lt;br /&gt;
The resulted preprocessed files will be written in the target directory. There will be 2 types of files: the .cfg files and .plain files (this contain the line symbols and textdomain changes)&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;file/folder&amp;gt; and &amp;lt;target directory&amp;gt; are not in ''absolute path'' form, they will be treated like relative to the wesnoth's executable path. &lt;br /&gt;
&lt;br /&gt;
Some examples:&lt;br /&gt;
 -p ~/wesnoth/data/campaigns/tutorial ~/result &lt;br /&gt;
will preprocess entire tutorial folder, and write the resulted files in the ~/result folder&lt;br /&gt;
 -p=MULTIPLAYER data/campaigns/my_campaign/some_scenario.cfg data/result&lt;br /&gt;
will add the ''MULTIPLAYER'' define in defines list and then preprocess the scenario config file&lt;br /&gt;
 -p=SINGLEPLAYER,HARD ~/wesnoth/data/campaigns/my_campaign ~/result&lt;br /&gt;
will add the ''SINGLEPLAYER'' and ''HARD'' defines before preprocessing the files.&lt;br /&gt;
&lt;br /&gt;
Note! As you saw in the examples, the '=' character is mandatory if you want to specify any auxiliar defines&lt;br /&gt;
&lt;br /&gt;
===--preprocess-input-macros===&lt;br /&gt;
 --preprocess-input-macros &amp;lt;file&amp;gt;&lt;br /&gt;
This command will take the specified file, parse the defines in it, and will use them when preprocessing the resource with --preprocess. The file must contain only [preproc_define]s. This is different than adding defines to --preprocess, as it contains the macro information.&lt;br /&gt;
&lt;br /&gt;
===--preprocess-output-macro===&lt;br /&gt;
 --preprocess-output-macro [&amp;lt;file&amp;gt;]&lt;br /&gt;
Outputs the defines_map resulted from preprocessing. This is will include (if any) --preprocess-input-macro file's content.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you want a more detailed log, you can simply add the command: &amp;quot;--log-debug=all&amp;quot; or &amp;quot;--log-info=all&amp;quot; before the preprocessing command, so you will see how things are parsed,etc.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[SyntaxWML]]&lt;br /&gt;
* [[ReferenceWML]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: WML Reference]]&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=PreprocessorRef&amp;diff=37992</id>
		<title>PreprocessorRef</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=PreprocessorRef&amp;diff=37992"/>
		<updated>2010-08-20T18:27:42Z</updated>

		<summary type="html">&lt;p&gt;Boucman: /* The WML preprocessor */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WML Tags}}&lt;br /&gt;
== The WML preprocessor ==&lt;br /&gt;
&lt;br /&gt;
Wesnoth loads just one configuration file directly: '''data/_main.cfg'''.&lt;br /&gt;
However the WML preprocessor allows to include more files.&lt;br /&gt;
Whenever a WML file is read by Wesnoth, it is passed through the preprocessor.&lt;br /&gt;
&lt;br /&gt;
The preprocessor can interpret a simple language of string-expansions known as &amp;quot;macros.&amp;quot; A macro should always be defined '''before''' the place where it needs to be used.&lt;br /&gt;
&lt;br /&gt;
The preprocessor is applied recursively, so included files will&lt;br /&gt;
be parsed for macros, and after macro expansion will be parsed for macros&lt;br /&gt;
again, and so on.  As a result, you should not write a recursive macro,&lt;br /&gt;
because it will cause errors&lt;br /&gt;
(but, alas, not necessarily error messages).&lt;br /&gt;
&lt;br /&gt;
The following directives are used to create and use ''macros'',&lt;br /&gt;
i.e. shortcuts which reduce repetition of information.&lt;br /&gt;
See [[UtilWML]], [[UsefulWMLFragments]] for examples and [http://www.wesnoth.org/macro-reference.xhtml the macro reference] for the predefined core macros.&lt;br /&gt;
* '''#define ''symbol'' [''parameters''] ''newline'' ''substitution'' #enddef''' all subsequent occurences of '''{''symbol'' [''arguments'']}''' (see below) will be replaced by ''substitution'' with all occurences of any parameter {''parameter''} within ''substitution'' replaced by the parameter's corresponding value in ''arguments''.  For example, the UNIT macro used below would be defined:&lt;br /&gt;
&lt;br /&gt;
 #define UNIT TYPE X Y## the ordering is important here;&lt;br /&gt;
                      ## since WML does not distinguish&lt;br /&gt;
                      ## data into different types, only&lt;br /&gt;
                      ## the ordering is used to determine which&lt;br /&gt;
                      ## arguments apply to which parameters.&lt;br /&gt;
 [unit]&lt;br /&gt;
 type={TYPE}## the unit will be of type TYPE, so different&lt;br /&gt;
            ## instantiations&lt;br /&gt;
            ## of this macro can create different units.&lt;br /&gt;
 x={X}&lt;br /&gt;
 y={Y}&lt;br /&gt;
 side=2## the unit will be an enemy, regardless of the parameter&lt;br /&gt;
       ## values. This reduces &amp;quot;repetition of information&amp;quot;,&lt;br /&gt;
       ## since it is no longer necessary to specify&lt;br /&gt;
       ## each created unit as an enemy.&lt;br /&gt;
 [/unit]&lt;br /&gt;
 #enddef&lt;br /&gt;
(See [[SingleUnitWML]] for information on creating units using WML.)&lt;br /&gt;
* '''{''symbol'' [''arguments'']}''' if ''symbol'' is defined, the preprocessor will replace this instruction by the expression ''symbol'' is defined as, using ''arguments'' as parameters.  You can create multiple word arguments by using parentheses to restrain the argument.  For example, while '''{UNIT Wolf Rider 18 24}''' will attempt to create a &amp;quot;Wolf&amp;quot; at (Rider,18), causing Wesnoth to crash, the macro '''{UNIT (Wolf Rider) 18 24}''' will create a &amp;quot;Wolf Rider&amp;quot; at (18,24) as it should. ('''UNIT''' is defined above).  See the ''#define'' preprocessor instruction above for information on defining symbols, including symbols with arguments.  Several symbols are defined in the normal game code; for reference they are listed in [[UtilWML]].&lt;br /&gt;
&lt;br /&gt;
Note: Using the name-string of an existing macro as the name-string of a macro argument will always overwrite the original definition of the macro, e.g.:&lt;br /&gt;
 #define VARIABLE&lt;br /&gt;
 #enddef&lt;br /&gt;
 #define MACRO VARIABLE&lt;br /&gt;
  {VARIABLE} # is calling for the argument, not for the macro above&lt;br /&gt;
 #enddef&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unlike the other preprocessor directives, #ifdef and #ifndef are not&lt;br /&gt;
mere conveniences.&lt;br /&gt;
They are necessary to distinguish between different modes of play.&lt;br /&gt;
* '''#ifdef ''symbol'' ''substitution-if-stored''  [#else ''substitution-if-not-stored''] #endif'''  If ''symbol'' has been stored, the whole block will be replaced by ''substitution-if-stored''.  If not, it will be replaced by ''substitution-if-not-stored'' if it is available.  ''symbol'' can take the following values:&lt;br /&gt;
** a campaign difficulty level.  Usually '''EASY''', '''NORMAL''', or '''HARD''', it is decided by the key ''difficulties'' (see [[CampaignWML]]).&lt;br /&gt;
** a campaign ID. Each campaign stores a preprocessor ID.  See ''define'', [[CampaignWML]].&lt;br /&gt;
** '''MULTIPLAYER''' is stored when the player is playing or setting up a multiplayer game (i.e. a game with '''scenario_type=multiplayer''').&lt;br /&gt;
** '''DEBUG_MODE''' is stored when the player has launched wesnoth in debug mode (i.e. with '''-d''')&lt;br /&gt;
** '''TUTORIAL''' is stored when the player is playing the tutorial.&lt;br /&gt;
** '''APPLE''' is stored if the computer Wesnoth is being run on is an Apple. (this one is only available to the configuration of the game)&lt;br /&gt;
** '''LOW_MEM''' {{DevFeature1.9}} The binary was compiled with the LOW_MEM option&lt;br /&gt;
* '''#ifndef''' behaves exactly like '''#ifdef''', except that it inverts the test sense; guarded text is included only if ''symbol'' has not been stored.&lt;br /&gt;
''#undef'' can be useful too if ''#ifdef'' is not enough.&lt;br /&gt;
* '''#undef ''symbol'' '''  erases ''symbol''&lt;br /&gt;
* '''#ifhave''' {{DevFeature1.9}} checks for the existence of a file.&lt;br /&gt;
* '''#ifnhave''' {{DevFeature1.9}} is the inverted version of '''#ifhave'''.&lt;br /&gt;
&lt;br /&gt;
These directives expand a file by including other files, ''filename'' may not contain '..' or the directive will be skipped:&lt;br /&gt;
* '''{''filename''}''' if ''filename'' isn't a predefined symbol (see above), Wesnoth will assume it's a path to a file in the main '''data/''' subdirectory of Wesnoth and include the file it points to here &amp;quot;as is&amp;quot;.  Forward slashes('''/''') should be used to separate directories from their elements, even if your platform uses a different symbol such as colon (''':''') or backslash ('''\''').  &lt;br /&gt;
* '''{~''filename''}''' similar to above, but the preprocessor assumes that the filename is relative to '''data/''' subdirectory of the user data directory.  The ''user data directory'' varies depending on platform. See [[EditingWesnoth#Where_is_my_user_data_directory.3F|Where_is_my_user_data_directory?]]&lt;br /&gt;
&lt;br /&gt;
* '''{./''filename''}''' is similar to the '''{''filename''}''' directive, but is assumed to be relative to the directory which contains the file in which this appears.  For example, if used in game.cfg, it is equivalent to '''{''filename''}'''.&lt;br /&gt;
* If ''filename'' points to a directory, the preprocessor will include all files in the directory ''filename'', non-recursively and in alphabetical order.  Starting in 1.3.3, some files in such directories are handled specially.  &lt;br /&gt;
&lt;br /&gt;
If there is a file named ''dir/_main.cfg'' in a directory referenced as '''{''dir''}''', only that ''_main.cfg'' file is processed; it may include other files in itself, of course . This feature is useful for creating WML directories that are self-contained WML packages with their own initializations (like campaigns). This can replace the older convention of having a ''dir.cfg'' at the same level as ''dir'' which does '''{''dir''}''' somewhere in itself.&lt;br /&gt;
&lt;br /&gt;
If there are files named ''dir/*/_main.cfg'' in a directory referenced as '''{''dir''}''', where * is any subdirectories ''dir'', then they all are processed (except if there is also a file named ''dir/_main.cfg''). This means that if you have a layout like this:&lt;br /&gt;
 dir/&lt;br /&gt;
 dir/a/_main.cfg&lt;br /&gt;
 dir/a/other.cfg&lt;br /&gt;
 dir/b/_main.cfg&lt;br /&gt;
 dir/b/other.cfg&lt;br /&gt;
 dir/other.cfg&lt;br /&gt;
Then '''{dir}''' will process (in alphabetical order): dir/a/_main.cfg, dir/b/main.cfg, dir/other.cfg.&lt;br /&gt;
&lt;br /&gt;
If there is a file named ''dir/_final.cfg'' in a directory referenced as '''{''dir''}''' (and no ''main.cfg'', so that all files in the directory are processed normally) the ''_final.cfg'' is guaranteed to be processed ''after'' all other files in the directory.&lt;br /&gt;
&lt;br /&gt;
If there is a file named ''dir/_initial.cfg'' in a directory referenced as '''{''dir''}''' (and no ''main.cfg'', so that all files in the directory are processed normally) the ''_initial.cfg'' is guaranteed to be processed ''before'' all other files in the directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note that the parser was changed various times, so don't expect older Wesnoth version to behave exactly the same.&lt;br /&gt;
&lt;br /&gt;
{{DevFeature1.9}} Including non-existent file is now a fatal error and halts the preprocessing. Use #ifhave to test for the existence of files that aren't a part of your own add-on.&lt;br /&gt;
&lt;br /&gt;
== The preprocessor command line == &lt;br /&gt;
{{DevFeature1.9}} &lt;br /&gt;
&lt;br /&gt;
As of wesnoth 1.9, there are some new command line arguments available for the wesnoth executable:&lt;br /&gt;
--preprocess&lt;br /&gt;
--preprocess-input-macros&lt;br /&gt;
--preprocess-output-macros&lt;br /&gt;
&lt;br /&gt;
Commands details:&lt;br /&gt;
&lt;br /&gt;
===--preprocess===&lt;br /&gt;
&lt;br /&gt;
 --preprocess[=define1,define2,...] &amp;lt;file/folder&amp;gt; &amp;lt;target directory&amp;gt;&lt;br /&gt;
or the short form:&lt;br /&gt;
 -p[=define1,define2,...] &amp;lt;file/folder&amp;gt; &amp;lt;target directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The define1,define2,... is a list of defines, to be added ''before'' anything is preprocessed. &lt;br /&gt;
&lt;br /&gt;
The preprocess command will '''preprocess first''' the common config files in ''data/core'', and afterwards, the specified ones. You can specifiy a single file to be preprocesses (if you want to preprocess multiple separate files, you have to invoke the command separately), or an entire folder (this will be preprocessed on the known preprocessor rules). &lt;br /&gt;
&lt;br /&gt;
The resulted preprocessed files will be written in the target directory. There will be 2 types of files: the .cfg files and .plain files (this contain the line symbols and textdomain changes)&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;file/folder&amp;gt; and &amp;lt;target directory&amp;gt; are not in ''absolute path'' form, they will be treated like relative to the wesnoth's executable path. &lt;br /&gt;
&lt;br /&gt;
Some examples:&lt;br /&gt;
 -p ~/wesnoth/data/campaigns/tutorial ~/result &lt;br /&gt;
will preprocess entire tutorial folder, and write the resulted files in the ~/result folder&lt;br /&gt;
 -p=MULTIPLAYER data/campaigns/my_campaign/some_scenario.cfg data/result&lt;br /&gt;
will add the ''MULTIPLAYER'' define in defines list and then preprocess the scenario config file&lt;br /&gt;
 -p=SINGLEPLAYER,HARD ~/wesnoth/data/campaigns/my_campaign ~/result&lt;br /&gt;
will add the ''SINGLEPLAYER'' and ''HARD'' defines before preprocessing the files.&lt;br /&gt;
&lt;br /&gt;
Note! As you saw in the examples, the '=' character is mandatory if you want to specify any auxiliar defines&lt;br /&gt;
&lt;br /&gt;
===--preprocess-input-macros===&lt;br /&gt;
 --preprocess-input-macros &amp;lt;file&amp;gt;&lt;br /&gt;
This command will take the specified file, parse the defines in it, and will use them when preprocessing the resource with --preprocess. The file must contain only [preproc_define]s. This is different than adding defines to --preprocess, as it contains the macro information.&lt;br /&gt;
&lt;br /&gt;
===--preprocess-output-macro===&lt;br /&gt;
 --preprocess-output-macro [&amp;lt;file&amp;gt;]&lt;br /&gt;
Outputs the defines_map resulted from preprocessing. This is will include (if any) --preprocess-input-macro file's content.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you want a more detailed log, you can simply add the command: &amp;quot;--log-debug=all&amp;quot; or &amp;quot;--log-info=all&amp;quot; before the preprocessing command, so you will see how things are parsed,etc.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[SyntaxWML]]&lt;br /&gt;
* [[ReferenceWML]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: WML Reference]]&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=TerrainMacrosWML&amp;diff=37134</id>
		<title>TerrainMacrosWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=TerrainMacrosWML&amp;diff=37134"/>
		<updated>2010-07-10T17:28:21Z</updated>

		<summary type="html">&lt;p&gt;Boucman: /* DISABLE_BASE_TRANSITIONS_F TERRAINLIST FLAG */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DevFeature1.9}}&lt;br /&gt;
This page is entirely base on the 1.9 macros, they are very close to the 1.8 macros, but no attempt has been done to document the difference&lt;br /&gt;
&lt;br /&gt;
== Flag Management ==&lt;br /&gt;
This section lists the common flags used by macros and their high level signification&lt;br /&gt;
* '''base''': is set on all hex when the base tile is set.&lt;br /&gt;
* '''overlay''': is set on all hex that have something drawn on the hex itself (i.e not a transition) over the base terrain.&lt;br /&gt;
* '''village''': is set when a village is added on a tile.&lt;br /&gt;
* '''transition-@R*''': is set on a tile which has a transition on it's corresponding side set (i.e if there is a transition with the tile at its north, transition-n will be set) possible values: ''n,ne,nw,s,se,sw'' Also not that the macros handl it in a reciprocal way. in other word if a tile has transition-n set, it's northern neighbour should have transition-s set&lt;br /&gt;
* '''overlay-connect-@R*''' : used for bridges, the bridge on this tile. The bridge &amp;quot;actually has&amp;quot; an &amp;quot;exit direction&amp;quot; in the @R direction indicated.&lt;br /&gt;
* '''overlay-away-@R*''' : used for bridges, the bridge does NOT have an exit on the given direction, but would be expected to...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''A note about ''overlay-@R'' and ''overlay-away-@R'' flags '''&lt;br /&gt;
&lt;br /&gt;
Suppose we have a ''n-&amp;gt;s'' bridge hex who's ''ne'' neighbour is a ''ne-&amp;gt;sw'' bridge. This mean that the ''n-&amp;gt;s'' is actually a turn in the bridge that should use a graphic depicting a ''s-&amp;gt;ne'' corner.&lt;br /&gt;
&lt;br /&gt;
In that case the tile will have ''overlay-s'' and ''overlay-ne'' set (the directions where the bridge actually exits) and ''overlay-away-n'' (the direction where the bridge would exit according to terrain codes, but doesnt because of overall layout)&lt;br /&gt;
&lt;br /&gt;
== Layer Management ==&lt;br /&gt;
* '''-1000''': default layer for base tiles&lt;br /&gt;
* '''-80''': overlays that should always be drawn under units (like rails etc...)&lt;br /&gt;
* '''0''': default layer for overlays and villages&lt;br /&gt;
Normal units are drawn above layer 0, except if the basey of the tile is &amp;gt; 56 in which case they are drawn below&lt;br /&gt;
* '''1''': used by the base tile of castles/keeps&lt;br /&gt;
Flying/moving units are always drawn over terrain&lt;br /&gt;
== Precedence Management ==&lt;br /&gt;
TBSL&lt;br /&gt;
== Base Management ==&lt;br /&gt;
TBSL&lt;br /&gt;
&lt;br /&gt;
== Macro naming convention ==&lt;br /&gt;
for some common types of tiles, we have a lot of variation of macros. To simplify, they follow a naming convention&lt;br /&gt;
&lt;br /&gt;
=== Macro names ===&lt;br /&gt;
Type is the type of macros (like KEEP,OVERLAY etc...) we are using&lt;br /&gt;
&lt;br /&gt;
* '''TYPE'''''_PLFB'' : puts an image on a tile&lt;br /&gt;
* '''TYPE_RANDOM'''''_LFB'' : puts an image from a random set on a tile&lt;br /&gt;
* '''TYPE_RESTRICTED[23]'''''_PLFB'': puts an image on a tile if the tile has one [two or three] neighbours of a given type&lt;br /&gt;
* '''TYPE_RESTRICTED[23]_RANDOM'''''_PLFB'': combination of above&lt;br /&gt;
* '''TYPE_ROTATION_RESTRICTED[23]'''''_PLFB'': combination of above + the images will be named according to where the neighbours are&lt;br /&gt;
* '''TYPE_ROTATION_RESTRICTED[23]_RANDOM'''''_PLFB'': combination of above&lt;br /&gt;
&lt;br /&gt;
here ''_PLFB'' means any combination of _P _PL _PF etc... will also be correct macro names with the corresponding parameters&lt;br /&gt;
&lt;br /&gt;
each section describing a type will explain what values for PLFB are used for the functions that don't have them as parameters&lt;br /&gt;
&lt;br /&gt;
=== Macro Parameters ===&lt;br /&gt;
&lt;br /&gt;
These macros always have the parameters in the same orders (not all macros have all parameters, see below&lt;br /&gt;
&lt;br /&gt;
 TERRAIN ADJACENT PROB LAYER FLAG BUILDER IMAGESTEM&lt;br /&gt;
&lt;br /&gt;
* '''TERRAIN''' : the type of terrain to put the image on&lt;br /&gt;
* '''ADJACENT''' : ''only for restricted'' the type of neighbours to test for&lt;br /&gt;
* '''PROB''' : ''only for _P'' The probability of the rules generated by the macros of being applied. See the discussion in [[TerrainGraphicsTutorial#Cumulative_Probabilities]] for complications&lt;br /&gt;
* '''LAYER''' : ''only for _L'' The layer that will be used for the generated rules&lt;br /&gt;
* '''FLAG''' : ''only for _F'' A flag to test and set on the tile&lt;br /&gt;
* '''BUILDER''' : ''only for _B'' the builder macro that will be used to create the animations  in the image= field of the generated terrain code. See the dicussion at the begining of the builder section&lt;br /&gt;
* '''IMAGESTEM''': the basename on which filenames will be based.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Image Names ===&lt;br /&gt;
* '''_RANDOM_'''&lt;br /&gt;
** {{BUILDER} {IMAGESTEM} ()}&lt;br /&gt;
** {{BUILDER} {IMAGESTEM}2 ()}&lt;br /&gt;
** {{BUILDER} {IMAGESTEM}3 ()}&lt;br /&gt;
** ''etc up to 11''&lt;br /&gt;
* '''_ROTATION_'''&lt;br /&gt;
** '''1''' : {{BUILDER} {IMAGESTEM} (-@R0)} with @R0 being the orientation of the neighbouring tile&lt;br /&gt;
** '''2''' : {{BUILDER} {IMAGESTEM} (-@R0-@R1)} with @R0 and @R1 being the orientations of the neighbouring tiles&lt;br /&gt;
** '''3''' : {{BUILDER} {IMAGESTEM} (-@R0-@R1-@R2)} with @R0, @R1 and @R2 being the orientations of the neighbouring tiles&lt;br /&gt;
* '''_RANDOM_ + _ROTATION_'''&lt;br /&gt;
** {{BUILDER} {IMAGESTEM}# (-@R#)} ''similar to above with all combinations''&lt;br /&gt;
&lt;br /&gt;
== The TEST_COMPLETE macro ==&lt;br /&gt;
&lt;br /&gt;
there is one more macro which exist for most families of macro&lt;br /&gt;
&lt;br /&gt;
 #define TYPE_COMPLETE_LFB TERRAIN ADJACENT LAYER FLAG BUILDER IMAGESTEM&lt;br /&gt;
    {TYPE_ROTATION_RESTRICTED3_RANDOM_LFB  ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small (-@R0-@R1-@R2)}&lt;br /&gt;
    {TYPE_ROTATION_RESTRICTED2_RANDOM_LFB  ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small (-@R0-@R1)}&lt;br /&gt;
    {TYPE_ROTATION_RESTRICTED_RANDOM_LFB   ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small (-@R0)}&lt;br /&gt;
    {TYPE_RESTRICTED_RANDOM_LFB            ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small ()}&lt;br /&gt;
    {TYPE_SINGLE_RANDOM_LFB                ({TERRAIN})               {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
 #enddef&lt;br /&gt;
&lt;br /&gt;
This macro is a simpler way of handling the most common case of &amp;quot;use a smaller variation when next to some terrains&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* If it has three neighbours, it will try IMAGESTEM-small#-R1-R2-R3&lt;br /&gt;
* if it has two neighbour or the correct image wasn't found, it will try two-sided variations&lt;br /&gt;
* if it has one neighbour or the correct image wasn't found, it will try one sided variations&lt;br /&gt;
* if it has still not found anything, it will try IMAGESTEM-small&lt;br /&gt;
* if it has no neighbour or still hasn't found anything, it will try based on IMAGESTEM&lt;br /&gt;
&lt;br /&gt;
== Image Builder macros ==&lt;br /&gt;
=== The problem ===&lt;br /&gt;
suppose we want to animate a transition with the following line&lt;br /&gt;
 image=image1;image2;image3&lt;br /&gt;
Since it's a transition, we would like to write something like (simplified)&lt;br /&gt;
 {TRANSITION_BASE &amp;lt;parameters&amp;gt; image1;image2;image3}&lt;br /&gt;
However, for a north transition, the macro would expand to something similar to&lt;br /&gt;
 image=image1;image2;image3-n&lt;br /&gt;
Which is wrong, we want the prefix added to all images in the animation&lt;br /&gt;
 image=image1-n;image2-n;image3-n&lt;br /&gt;
To get the result we want, we use macro indirection. In other word, we have a set of macros who take two parameters&lt;br /&gt;
 #define BUILDER IMAGESTEM POSTFIX&lt;br /&gt;
Which are in charge of returning what should be on the right side of the image= So, with the following macro&lt;br /&gt;
 #define MY_BUILDER IMAGESTEM POSTFIX&lt;br /&gt;
 {IMAGESTEM}1{POSTFIX};{IMAGESTEM}2{POSTFIX};{IMAGESTEM}3{POSTFIX};&lt;br /&gt;
and the following code in the TRANSITION_BASE macro&lt;br /&gt;
 image={{BUILDER} {IMAGESTEM} -n}&lt;br /&gt;
a call to&lt;br /&gt;
 {TRANSITION_BASE_B &amp;lt;parameters&amp;gt; MY_BUILDER image}&lt;br /&gt;
would correctly expand.&lt;br /&gt;
&lt;br /&gt;
=== Common parameters for all builders ===&lt;br /&gt;
All builders must have exactly the same parameters&lt;br /&gt;
* IMAGESTEM : the base name of the image from which to build&lt;br /&gt;
* POSTFIX : a postfix to add to all images&lt;br /&gt;
 &lt;br /&gt;
=== IMAGE_SINGLE IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a single image image= line (i.e not animated) mainly used as default value for BUILDER parameter of meta-macros&lt;br /&gt;
=== ANIMATION_03 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a Three image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
=== ANIMATION_04 IMAGESTEM POSTFIX === &lt;br /&gt;
builds a four image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
=== ANIMATION_10 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a ten image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
* IMAGESTEM-A05&lt;br /&gt;
* IMAGESTEM-A06&lt;br /&gt;
* IMAGESTEM-A07&lt;br /&gt;
* IMAGESTEM-A08&lt;br /&gt;
* IMAGESTEM-A09&lt;br /&gt;
* IMAGESTEM-A10&lt;br /&gt;
=== ANIMATION_15 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a fifteen image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
* IMAGESTEM-A05&lt;br /&gt;
* IMAGESTEM-A06&lt;br /&gt;
* IMAGESTEM-A07&lt;br /&gt;
* IMAGESTEM-A08&lt;br /&gt;
* IMAGESTEM-A09&lt;br /&gt;
* IMAGESTEM-A10&lt;br /&gt;
* IMAGESTEM-A11&lt;br /&gt;
* IMAGESTEM-A12&lt;br /&gt;
* IMAGESTEM-A13&lt;br /&gt;
* IMAGESTEM-A14&lt;br /&gt;
* IMAGESTEM-A15&lt;br /&gt;
=== ANIMATION_04_140 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a four image animation, each image being displayed for 140 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
=== ANIMATION_18_70 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a eighteen image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
* IMAGESTEM-A05&lt;br /&gt;
* IMAGESTEM-A06&lt;br /&gt;
* IMAGESTEM-A07&lt;br /&gt;
* IMAGESTEM-A08&lt;br /&gt;
* IMAGESTEM-A09&lt;br /&gt;
* IMAGESTEM-A10&lt;br /&gt;
* IMAGESTEM-A11&lt;br /&gt;
* IMAGESTEM-A12&lt;br /&gt;
* IMAGESTEM-A13&lt;br /&gt;
* IMAGESTEM-A14&lt;br /&gt;
* IMAGESTEM-A15&lt;br /&gt;
* IMAGESTEM-A16&lt;br /&gt;
* IMAGESTEM-A17&lt;br /&gt;
* IMAGESTEM-A18&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Base tile related macros ==&lt;br /&gt;
&lt;br /&gt;
Base terrains have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''TERRAIN_BASE'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': -1000&lt;br /&gt;
* '''FLAG'''': ''base''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Overlay related macros==&lt;br /&gt;
&lt;br /&gt;
Overlays have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''OVERLAY'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': 0&lt;br /&gt;
* '''FLAG'''': ''overlay''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Keep related macros ==&lt;br /&gt;
&lt;br /&gt;
Keeps are base terrains (they use the same flag) but drawn on layer -1&lt;br /&gt;
&lt;br /&gt;
Keeps have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''KEEP_BASE'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': -1&lt;br /&gt;
* '''FLAG'''': ''base''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Village related macros ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
villages have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''VILLAGE'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': 0&lt;br /&gt;
* '''FLAG'''': ''village''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Transition related macros ==&lt;br /&gt;
&lt;br /&gt;
=== Generic Functions ===&lt;br /&gt;
transitions  have most of the macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''TRANSITION'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': -500&lt;br /&gt;
* '''FLAG''': ''transition-@&amp;lt;side&amp;gt;''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However, unlike all previous type of macros, they are related to a ''side'' instead of the whole hex. Thus the following rules&lt;br /&gt;
&lt;br /&gt;
* There are no ROTATION macros. Since they are always side related.&lt;br /&gt;
* All images are named as if they were ROTATION macros since they are all side related&lt;br /&gt;
* There is no SINGLE variation since it doesn't make sense to have it (a side is always relative to two hex)&lt;br /&gt;
* The flags are set and tested on a side related basis. i.e there can be more than one transition per tile, if they don't cover the same direction&lt;br /&gt;
* for RESTRICTED2 and RESTRICTED3, we only check for neighbouring hex of the ADJACENT type. This makes more sense for borders&lt;br /&gt;
* the COMPLETE variant looks as follows&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 #define BORDER_COMPLETE_LFB TERRAIN ADJACENT LAYER FLAG BUILDER IMAGESTEM&lt;br /&gt;
    {BORDER_RESTRICTED3_RANDOM_LFB  ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
    {BORDER_RESTRICTED2_RANDOM_LFB  ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
    {BORDER_RESTRICTED_RANDOM_LFB   ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
    {BORDER_RESTRICTED_RANDOM_LFB   ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
 #enddef&lt;br /&gt;
&lt;br /&gt;
=== DISABLE_BASE_TRANSITIONS TERRAINLIST ===&lt;br /&gt;
This macro will set all transition-@R* on the tile (''n,ne,se,s,sw'')  thus preventing any other transition from being added&lt;br /&gt;
&lt;br /&gt;
'''Flag Management'''&lt;br /&gt;
will set all transition-@R* on the TERRAINLIST tiles&lt;br /&gt;
=== DISABLE_BASE_TRANSITIONS_F TERRAINLIST FLAG ===&lt;br /&gt;
This macro will set all &amp;lt;FLAG&amp;gt;-@R* on the tile (''n,ne,se,s,sw'')  thus preventing any other transition from being added&lt;br /&gt;
&lt;br /&gt;
'''Flag Management'''&lt;br /&gt;
will set all &amp;lt;FLAG&amp;gt;-@R* on the TERRAINLIST tiles&lt;br /&gt;
&lt;br /&gt;
== Track Type macros ==&lt;br /&gt;
&lt;br /&gt;
These macros handle anything that is layed in a connected way over multiple tiles (typically bridges and tiles)&lt;br /&gt;
&lt;br /&gt;
=== the TRACK macro ===&lt;br /&gt;
&lt;br /&gt;
'''TRACK_''LF'' &amp;lt;NWSEterrain&amp;gt; &amp;lt;NSterrain&amp;gt; &amp;lt;NESWterrain&amp;gt; &amp;lt;basename'''&lt;br /&gt;
&lt;br /&gt;
This macro will add the base terrain on the three terrains corresponding to the three directions.This macro will awlays take random variations, and defaults to layer -80 with flag=overlay&lt;br /&gt;
&lt;br /&gt;
The images used are named &lt;br /&gt;
* base#-ns.png : non-connected on a north-south orientation,&lt;br /&gt;
* base#-nesw.png : non connected on a north-east south-west orientation&lt;br /&gt;
* base#-senw.png : non connected on a south-east north-west orientation&lt;br /&gt;
* base#-&amp;lt;connections&amp;gt; : tile used when the bridge is connected on the corresponding sides (separated by '-', ordered clockwise starting with north)&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' the engine will use the straight tile when it doesn't find any fitting tile&lt;br /&gt;
&lt;br /&gt;
'''NOTE:''' if some connection tiles don't seem to be used properly, please post a screenshot from the editor with terrain names enabled and contact boucman&lt;br /&gt;
&lt;br /&gt;
'''NOTE''' you will notice that there is no builder. Builders are incompatible with bridges (in other word,the IMAGE_SINGLE builder is hardwired)&lt;br /&gt;
&lt;br /&gt;
=== Transition related macros ===&lt;br /&gt;
Bridges are tricky because you usually don't want the same transitions depending if the bridge ends on a given edge or not.&lt;br /&gt;
&lt;br /&gt;
The following macros help&lt;br /&gt;
&lt;br /&gt;
'''TRACK_BORDER_RESTRICTED_''PLF'' &amp;lt;terrain&amp;gt; &amp;lt;adjacent&amp;gt; &amp;lt;IMAGE&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
Will match only if terrain is a bridge, on the side matching adjacent, and if the bridge does have a connection or ending on the given side.&lt;br /&gt;
&lt;br /&gt;
Note that adjacent can be a bridge too, but this macro won't check that adjacent exits on the corresponding side&lt;br /&gt;
&lt;br /&gt;
the image will be drawn on the &amp;lt;terrain&amp;gt; hex with the orientation appended to it&lt;br /&gt;
&lt;br /&gt;
'''TRACK_BORDER_RESTRICTED_RANDOM_''LF''''' similar, with random variations&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=TerrainMacrosWML&amp;diff=37133</id>
		<title>TerrainMacrosWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=TerrainMacrosWML&amp;diff=37133"/>
		<updated>2010-07-10T17:05:02Z</updated>

		<summary type="html">&lt;p&gt;Boucman: /* Terrain Specific */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DevFeature1.9}}&lt;br /&gt;
This page is entirely base on the 1.9 macros, they are very close to the 1.8 macros, but no attempt has been done to document the difference&lt;br /&gt;
&lt;br /&gt;
== Flag Management ==&lt;br /&gt;
This section lists the common flags used by macros and their high level signification&lt;br /&gt;
* '''base''': is set on all hex when the base tile is set.&lt;br /&gt;
* '''overlay''': is set on all hex that have something drawn on the hex itself (i.e not a transition) over the base terrain.&lt;br /&gt;
* '''village''': is set when a village is added on a tile.&lt;br /&gt;
* '''transition-@R*''': is set on a tile which has a transition on it's corresponding side set (i.e if there is a transition with the tile at its north, transition-n will be set) possible values: ''n,ne,nw,s,se,sw'' Also not that the macros handl it in a reciprocal way. in other word if a tile has transition-n set, it's northern neighbour should have transition-s set&lt;br /&gt;
* '''overlay-connect-@R*''' : used for bridges, the bridge on this tile. The bridge &amp;quot;actually has&amp;quot; an &amp;quot;exit direction&amp;quot; in the @R direction indicated.&lt;br /&gt;
* '''overlay-away-@R*''' : used for bridges, the bridge does NOT have an exit on the given direction, but would be expected to...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''A note about ''overlay-@R'' and ''overlay-away-@R'' flags '''&lt;br /&gt;
&lt;br /&gt;
Suppose we have a ''n-&amp;gt;s'' bridge hex who's ''ne'' neighbour is a ''ne-&amp;gt;sw'' bridge. This mean that the ''n-&amp;gt;s'' is actually a turn in the bridge that should use a graphic depicting a ''s-&amp;gt;ne'' corner.&lt;br /&gt;
&lt;br /&gt;
In that case the tile will have ''overlay-s'' and ''overlay-ne'' set (the directions where the bridge actually exits) and ''overlay-away-n'' (the direction where the bridge would exit according to terrain codes, but doesnt because of overall layout)&lt;br /&gt;
&lt;br /&gt;
== Layer Management ==&lt;br /&gt;
* '''-1000''': default layer for base tiles&lt;br /&gt;
* '''-80''': overlays that should always be drawn under units (like rails etc...)&lt;br /&gt;
* '''0''': default layer for overlays and villages&lt;br /&gt;
Normal units are drawn above layer 0, except if the basey of the tile is &amp;gt; 56 in which case they are drawn below&lt;br /&gt;
* '''1''': used by the base tile of castles/keeps&lt;br /&gt;
Flying/moving units are always drawn over terrain&lt;br /&gt;
== Precedence Management ==&lt;br /&gt;
TBSL&lt;br /&gt;
== Base Management ==&lt;br /&gt;
TBSL&lt;br /&gt;
&lt;br /&gt;
== Macro naming convention ==&lt;br /&gt;
for some common types of tiles, we have a lot of variation of macros. To simplify, they follow a naming convention&lt;br /&gt;
&lt;br /&gt;
=== Macro names ===&lt;br /&gt;
Type is the type of macros (like KEEP,OVERLAY etc...) we are using&lt;br /&gt;
&lt;br /&gt;
* '''TYPE'''''_PLFB'' : puts an image on a tile&lt;br /&gt;
* '''TYPE_RANDOM'''''_LFB'' : puts an image from a random set on a tile&lt;br /&gt;
* '''TYPE_RESTRICTED[23]'''''_PLFB'': puts an image on a tile if the tile has one [two or three] neighbours of a given type&lt;br /&gt;
* '''TYPE_RESTRICTED[23]_RANDOM'''''_PLFB'': combination of above&lt;br /&gt;
* '''TYPE_ROTATION_RESTRICTED[23]'''''_PLFB'': combination of above + the images will be named according to where the neighbours are&lt;br /&gt;
* '''TYPE_ROTATION_RESTRICTED[23]_RANDOM'''''_PLFB'': combination of above&lt;br /&gt;
&lt;br /&gt;
here ''_PLFB'' means any combination of _P _PL _PF etc... will also be correct macro names with the corresponding parameters&lt;br /&gt;
&lt;br /&gt;
each section describing a type will explain what values for PLFB are used for the functions that don't have them as parameters&lt;br /&gt;
&lt;br /&gt;
=== Macro Parameters ===&lt;br /&gt;
&lt;br /&gt;
These macros always have the parameters in the same orders (not all macros have all parameters, see below&lt;br /&gt;
&lt;br /&gt;
 TERRAIN ADJACENT PROB LAYER FLAG BUILDER IMAGESTEM&lt;br /&gt;
&lt;br /&gt;
* '''TERRAIN''' : the type of terrain to put the image on&lt;br /&gt;
* '''ADJACENT''' : ''only for restricted'' the type of neighbours to test for&lt;br /&gt;
* '''PROB''' : ''only for _P'' The probability of the rules generated by the macros of being applied. See the discussion in [[TerrainGraphicsTutorial#Cumulative_Probabilities]] for complications&lt;br /&gt;
* '''LAYER''' : ''only for _L'' The layer that will be used for the generated rules&lt;br /&gt;
* '''FLAG''' : ''only for _F'' A flag to test and set on the tile&lt;br /&gt;
* '''BUILDER''' : ''only for _B'' the builder macro that will be used to create the animations  in the image= field of the generated terrain code. See the dicussion at the begining of the builder section&lt;br /&gt;
* '''IMAGESTEM''': the basename on which filenames will be based.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Image Names ===&lt;br /&gt;
* '''_RANDOM_'''&lt;br /&gt;
** {{BUILDER} {IMAGESTEM} ()}&lt;br /&gt;
** {{BUILDER} {IMAGESTEM}2 ()}&lt;br /&gt;
** {{BUILDER} {IMAGESTEM}3 ()}&lt;br /&gt;
** ''etc up to 11''&lt;br /&gt;
* '''_ROTATION_'''&lt;br /&gt;
** '''1''' : {{BUILDER} {IMAGESTEM} (-@R0)} with @R0 being the orientation of the neighbouring tile&lt;br /&gt;
** '''2''' : {{BUILDER} {IMAGESTEM} (-@R0-@R1)} with @R0 and @R1 being the orientations of the neighbouring tiles&lt;br /&gt;
** '''3''' : {{BUILDER} {IMAGESTEM} (-@R0-@R1-@R2)} with @R0, @R1 and @R2 being the orientations of the neighbouring tiles&lt;br /&gt;
* '''_RANDOM_ + _ROTATION_'''&lt;br /&gt;
** {{BUILDER} {IMAGESTEM}# (-@R#)} ''similar to above with all combinations''&lt;br /&gt;
&lt;br /&gt;
== The TEST_COMPLETE macro ==&lt;br /&gt;
&lt;br /&gt;
there is one more macro which exist for most families of macro&lt;br /&gt;
&lt;br /&gt;
 #define TYPE_COMPLETE_LFB TERRAIN ADJACENT LAYER FLAG BUILDER IMAGESTEM&lt;br /&gt;
    {TYPE_ROTATION_RESTRICTED3_RANDOM_LFB  ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small (-@R0-@R1-@R2)}&lt;br /&gt;
    {TYPE_ROTATION_RESTRICTED2_RANDOM_LFB  ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small (-@R0-@R1)}&lt;br /&gt;
    {TYPE_ROTATION_RESTRICTED_RANDOM_LFB   ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small (-@R0)}&lt;br /&gt;
    {TYPE_RESTRICTED_RANDOM_LFB            ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small ()}&lt;br /&gt;
    {TYPE_SINGLE_RANDOM_LFB                ({TERRAIN})               {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
 #enddef&lt;br /&gt;
&lt;br /&gt;
This macro is a simpler way of handling the most common case of &amp;quot;use a smaller variation when next to some terrains&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* If it has three neighbours, it will try IMAGESTEM-small#-R1-R2-R3&lt;br /&gt;
* if it has two neighbour or the correct image wasn't found, it will try two-sided variations&lt;br /&gt;
* if it has one neighbour or the correct image wasn't found, it will try one sided variations&lt;br /&gt;
* if it has still not found anything, it will try IMAGESTEM-small&lt;br /&gt;
* if it has no neighbour or still hasn't found anything, it will try based on IMAGESTEM&lt;br /&gt;
&lt;br /&gt;
== Image Builder macros ==&lt;br /&gt;
=== The problem ===&lt;br /&gt;
suppose we want to animate a transition with the following line&lt;br /&gt;
 image=image1;image2;image3&lt;br /&gt;
Since it's a transition, we would like to write something like (simplified)&lt;br /&gt;
 {TRANSITION_BASE &amp;lt;parameters&amp;gt; image1;image2;image3}&lt;br /&gt;
However, for a north transition, the macro would expand to something similar to&lt;br /&gt;
 image=image1;image2;image3-n&lt;br /&gt;
Which is wrong, we want the prefix added to all images in the animation&lt;br /&gt;
 image=image1-n;image2-n;image3-n&lt;br /&gt;
To get the result we want, we use macro indirection. In other word, we have a set of macros who take two parameters&lt;br /&gt;
 #define BUILDER IMAGESTEM POSTFIX&lt;br /&gt;
Which are in charge of returning what should be on the right side of the image= So, with the following macro&lt;br /&gt;
 #define MY_BUILDER IMAGESTEM POSTFIX&lt;br /&gt;
 {IMAGESTEM}1{POSTFIX};{IMAGESTEM}2{POSTFIX};{IMAGESTEM}3{POSTFIX};&lt;br /&gt;
and the following code in the TRANSITION_BASE macro&lt;br /&gt;
 image={{BUILDER} {IMAGESTEM} -n}&lt;br /&gt;
a call to&lt;br /&gt;
 {TRANSITION_BASE_B &amp;lt;parameters&amp;gt; MY_BUILDER image}&lt;br /&gt;
would correctly expand.&lt;br /&gt;
&lt;br /&gt;
=== Common parameters for all builders ===&lt;br /&gt;
All builders must have exactly the same parameters&lt;br /&gt;
* IMAGESTEM : the base name of the image from which to build&lt;br /&gt;
* POSTFIX : a postfix to add to all images&lt;br /&gt;
 &lt;br /&gt;
=== IMAGE_SINGLE IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a single image image= line (i.e not animated) mainly used as default value for BUILDER parameter of meta-macros&lt;br /&gt;
=== ANIMATION_03 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a Three image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
=== ANIMATION_04 IMAGESTEM POSTFIX === &lt;br /&gt;
builds a four image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
=== ANIMATION_10 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a ten image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
* IMAGESTEM-A05&lt;br /&gt;
* IMAGESTEM-A06&lt;br /&gt;
* IMAGESTEM-A07&lt;br /&gt;
* IMAGESTEM-A08&lt;br /&gt;
* IMAGESTEM-A09&lt;br /&gt;
* IMAGESTEM-A10&lt;br /&gt;
=== ANIMATION_15 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a fifteen image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
* IMAGESTEM-A05&lt;br /&gt;
* IMAGESTEM-A06&lt;br /&gt;
* IMAGESTEM-A07&lt;br /&gt;
* IMAGESTEM-A08&lt;br /&gt;
* IMAGESTEM-A09&lt;br /&gt;
* IMAGESTEM-A10&lt;br /&gt;
* IMAGESTEM-A11&lt;br /&gt;
* IMAGESTEM-A12&lt;br /&gt;
* IMAGESTEM-A13&lt;br /&gt;
* IMAGESTEM-A14&lt;br /&gt;
* IMAGESTEM-A15&lt;br /&gt;
=== ANIMATION_04_140 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a four image animation, each image being displayed for 140 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
=== ANIMATION_18_70 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a eighteen image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
* IMAGESTEM-A05&lt;br /&gt;
* IMAGESTEM-A06&lt;br /&gt;
* IMAGESTEM-A07&lt;br /&gt;
* IMAGESTEM-A08&lt;br /&gt;
* IMAGESTEM-A09&lt;br /&gt;
* IMAGESTEM-A10&lt;br /&gt;
* IMAGESTEM-A11&lt;br /&gt;
* IMAGESTEM-A12&lt;br /&gt;
* IMAGESTEM-A13&lt;br /&gt;
* IMAGESTEM-A14&lt;br /&gt;
* IMAGESTEM-A15&lt;br /&gt;
* IMAGESTEM-A16&lt;br /&gt;
* IMAGESTEM-A17&lt;br /&gt;
* IMAGESTEM-A18&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Base tile related macros ==&lt;br /&gt;
&lt;br /&gt;
Base terrains have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''TERRAIN_BASE'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': -1000&lt;br /&gt;
* '''FLAG'''': ''base''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Overlay related macros==&lt;br /&gt;
&lt;br /&gt;
Overlays have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''OVERLAY'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': 0&lt;br /&gt;
* '''FLAG'''': ''overlay''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Keep related macros ==&lt;br /&gt;
&lt;br /&gt;
Keeps are base terrains (they use the same flag) but drawn on layer -1&lt;br /&gt;
&lt;br /&gt;
Keeps have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''KEEP_BASE'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': -1&lt;br /&gt;
* '''FLAG'''': ''base''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Village related macros ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
villages have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''VILLAGE'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': 0&lt;br /&gt;
* '''FLAG'''': ''village''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Transition related macros ==&lt;br /&gt;
&lt;br /&gt;
=== Generic Functions ===&lt;br /&gt;
transitions  have most of the macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''TRANSITION'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': -500&lt;br /&gt;
* '''FLAG''': ''transition-@&amp;lt;side&amp;gt;''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However, unlike all previous type of macros, they are related to a ''side'' instead of the whole hex. Thus the following rules&lt;br /&gt;
&lt;br /&gt;
* There are no ROTATION macros. Since they are always side related.&lt;br /&gt;
* All images are named as if they were ROTATION macros since they are all side related&lt;br /&gt;
* There is no SINGLE variation since it doesn't make sense to have it (a side is always relative to two hex)&lt;br /&gt;
* The flags are set and tested on a side related basis. i.e there can be more than one transition per tile, if they don't cover the same direction&lt;br /&gt;
* for RESTRICTED2 and RESTRICTED3, we only check for neighbouring hex of the ADJACENT type. This makes more sense for borders&lt;br /&gt;
* the COMPLETE variant looks as follows&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 #define BORDER_COMPLETE_LFB TERRAIN ADJACENT LAYER FLAG BUILDER IMAGESTEM&lt;br /&gt;
    {BORDER_RESTRICTED3_RANDOM_LFB  ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
    {BORDER_RESTRICTED2_RANDOM_LFB  ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
    {BORDER_RESTRICTED_RANDOM_LFB   ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
    {BORDER_RESTRICTED_RANDOM_LFB   ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
 #enddef&lt;br /&gt;
&lt;br /&gt;
=== DISABLE_BASE_TRANSITIONS TERRAINLIST ===&lt;br /&gt;
This macro will set all transition-@R* on the tile (''n,ne,se,s,sw'')  thus preventing any other transition from being added&lt;br /&gt;
&lt;br /&gt;
'''Flag Management'''&lt;br /&gt;
will set all transition-@R* on the TERRAINLIST tiles&lt;br /&gt;
=== DISABLE_BASE_TRANSITIONS_F TERRAINLIST FLAG ===&lt;br /&gt;
This macro will set all &amp;lt;FLAG&amp;gt;-@R* on the tile (''n,ne,se,s,sw'')  thus preventing any other transition from being added&lt;br /&gt;
&lt;br /&gt;
'''Flag Management'''&lt;br /&gt;
will set all &amp;lt;FLAG&amp;gt;-@R* on the TERRAINLIST tiles&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=TerrainMacrosWML&amp;diff=37132</id>
		<title>TerrainMacrosWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=TerrainMacrosWML&amp;diff=37132"/>
		<updated>2010-07-10T17:04:44Z</updated>

		<summary type="html">&lt;p&gt;Boucman: /* Terrain Specific */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DevFeature1.9}}&lt;br /&gt;
This page is entirely base on the 1.9 macros, they are very close to the 1.8 macros, but no attempt has been done to document the difference&lt;br /&gt;
&lt;br /&gt;
== Flag Management ==&lt;br /&gt;
This section lists the common flags used by macros and their high level signification&lt;br /&gt;
* '''base''': is set on all hex when the base tile is set.&lt;br /&gt;
* '''overlay''': is set on all hex that have something drawn on the hex itself (i.e not a transition) over the base terrain.&lt;br /&gt;
* '''village''': is set when a village is added on a tile.&lt;br /&gt;
* '''transition-@R*''': is set on a tile which has a transition on it's corresponding side set (i.e if there is a transition with the tile at its north, transition-n will be set) possible values: ''n,ne,nw,s,se,sw'' Also not that the macros handl it in a reciprocal way. in other word if a tile has transition-n set, it's northern neighbour should have transition-s set&lt;br /&gt;
* '''overlay-connect-@R*''' : used for bridges, the bridge on this tile. The bridge &amp;quot;actually has&amp;quot; an &amp;quot;exit direction&amp;quot; in the @R direction indicated.&lt;br /&gt;
* '''overlay-away-@R*''' : used for bridges, the bridge does NOT have an exit on the given direction, but would be expected to...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''A note about ''overlay-@R'' and ''overlay-away-@R'' flags '''&lt;br /&gt;
&lt;br /&gt;
Suppose we have a ''n-&amp;gt;s'' bridge hex who's ''ne'' neighbour is a ''ne-&amp;gt;sw'' bridge. This mean that the ''n-&amp;gt;s'' is actually a turn in the bridge that should use a graphic depicting a ''s-&amp;gt;ne'' corner.&lt;br /&gt;
&lt;br /&gt;
In that case the tile will have ''overlay-s'' and ''overlay-ne'' set (the directions where the bridge actually exits) and ''overlay-away-n'' (the direction where the bridge would exit according to terrain codes, but doesnt because of overall layout)&lt;br /&gt;
&lt;br /&gt;
== Layer Management ==&lt;br /&gt;
* '''-1000''': default layer for base tiles&lt;br /&gt;
* '''-80''': overlays that should always be drawn under units (like rails etc...)&lt;br /&gt;
* '''0''': default layer for overlays and villages&lt;br /&gt;
Normal units are drawn above layer 0, except if the basey of the tile is &amp;gt; 56 in which case they are drawn below&lt;br /&gt;
* '''1''': used by the base tile of castles/keeps&lt;br /&gt;
Flying/moving units are always drawn over terrain&lt;br /&gt;
== Precedence Management ==&lt;br /&gt;
TBSL&lt;br /&gt;
== Base Management ==&lt;br /&gt;
TBSL&lt;br /&gt;
&lt;br /&gt;
== Macro naming convention ==&lt;br /&gt;
for some common types of tiles, we have a lot of variation of macros. To simplify, they follow a naming convention&lt;br /&gt;
&lt;br /&gt;
=== Macro names ===&lt;br /&gt;
Type is the type of macros (like KEEP,OVERLAY etc...) we are using&lt;br /&gt;
&lt;br /&gt;
* '''TYPE'''''_PLFB'' : puts an image on a tile&lt;br /&gt;
* '''TYPE_RANDOM'''''_LFB'' : puts an image from a random set on a tile&lt;br /&gt;
* '''TYPE_RESTRICTED[23]'''''_PLFB'': puts an image on a tile if the tile has one [two or three] neighbours of a given type&lt;br /&gt;
* '''TYPE_RESTRICTED[23]_RANDOM'''''_PLFB'': combination of above&lt;br /&gt;
* '''TYPE_ROTATION_RESTRICTED[23]'''''_PLFB'': combination of above + the images will be named according to where the neighbours are&lt;br /&gt;
* '''TYPE_ROTATION_RESTRICTED[23]_RANDOM'''''_PLFB'': combination of above&lt;br /&gt;
&lt;br /&gt;
here ''_PLFB'' means any combination of _P _PL _PF etc... will also be correct macro names with the corresponding parameters&lt;br /&gt;
&lt;br /&gt;
each section describing a type will explain what values for PLFB are used for the functions that don't have them as parameters&lt;br /&gt;
&lt;br /&gt;
=== Macro Parameters ===&lt;br /&gt;
&lt;br /&gt;
These macros always have the parameters in the same orders (not all macros have all parameters, see below&lt;br /&gt;
&lt;br /&gt;
 TERRAIN ADJACENT PROB LAYER FLAG BUILDER IMAGESTEM&lt;br /&gt;
&lt;br /&gt;
* '''TERRAIN''' : the type of terrain to put the image on&lt;br /&gt;
* '''ADJACENT''' : ''only for restricted'' the type of neighbours to test for&lt;br /&gt;
* '''PROB''' : ''only for _P'' The probability of the rules generated by the macros of being applied. See the discussion in [[TerrainGraphicsTutorial#Cumulative_Probabilities]] for complications&lt;br /&gt;
* '''LAYER''' : ''only for _L'' The layer that will be used for the generated rules&lt;br /&gt;
* '''FLAG''' : ''only for _F'' A flag to test and set on the tile&lt;br /&gt;
* '''BUILDER''' : ''only for _B'' the builder macro that will be used to create the animations  in the image= field of the generated terrain code. See the dicussion at the begining of the builder section&lt;br /&gt;
* '''IMAGESTEM''': the basename on which filenames will be based.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Image Names ===&lt;br /&gt;
* '''_RANDOM_'''&lt;br /&gt;
** {{BUILDER} {IMAGESTEM} ()}&lt;br /&gt;
** {{BUILDER} {IMAGESTEM}2 ()}&lt;br /&gt;
** {{BUILDER} {IMAGESTEM}3 ()}&lt;br /&gt;
** ''etc up to 11''&lt;br /&gt;
* '''_ROTATION_'''&lt;br /&gt;
** '''1''' : {{BUILDER} {IMAGESTEM} (-@R0)} with @R0 being the orientation of the neighbouring tile&lt;br /&gt;
** '''2''' : {{BUILDER} {IMAGESTEM} (-@R0-@R1)} with @R0 and @R1 being the orientations of the neighbouring tiles&lt;br /&gt;
** '''3''' : {{BUILDER} {IMAGESTEM} (-@R0-@R1-@R2)} with @R0, @R1 and @R2 being the orientations of the neighbouring tiles&lt;br /&gt;
* '''_RANDOM_ + _ROTATION_'''&lt;br /&gt;
** {{BUILDER} {IMAGESTEM}# (-@R#)} ''similar to above with all combinations''&lt;br /&gt;
&lt;br /&gt;
== The TEST_COMPLETE macro ==&lt;br /&gt;
&lt;br /&gt;
there is one more macro which exist for most families of macro&lt;br /&gt;
&lt;br /&gt;
 #define TYPE_COMPLETE_LFB TERRAIN ADJACENT LAYER FLAG BUILDER IMAGESTEM&lt;br /&gt;
    {TYPE_ROTATION_RESTRICTED3_RANDOM_LFB  ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small (-@R0-@R1-@R2)}&lt;br /&gt;
    {TYPE_ROTATION_RESTRICTED2_RANDOM_LFB  ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small (-@R0-@R1)}&lt;br /&gt;
    {TYPE_ROTATION_RESTRICTED_RANDOM_LFB   ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small (-@R0)}&lt;br /&gt;
    {TYPE_RESTRICTED_RANDOM_LFB            ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small ()}&lt;br /&gt;
    {TYPE_SINGLE_RANDOM_LFB                ({TERRAIN})               {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
 #enddef&lt;br /&gt;
&lt;br /&gt;
This macro is a simpler way of handling the most common case of &amp;quot;use a smaller variation when next to some terrains&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* If it has three neighbours, it will try IMAGESTEM-small#-R1-R2-R3&lt;br /&gt;
* if it has two neighbour or the correct image wasn't found, it will try two-sided variations&lt;br /&gt;
* if it has one neighbour or the correct image wasn't found, it will try one sided variations&lt;br /&gt;
* if it has still not found anything, it will try IMAGESTEM-small&lt;br /&gt;
* if it has no neighbour or still hasn't found anything, it will try based on IMAGESTEM&lt;br /&gt;
&lt;br /&gt;
== Image Builder macros ==&lt;br /&gt;
=== The problem ===&lt;br /&gt;
suppose we want to animate a transition with the following line&lt;br /&gt;
 image=image1;image2;image3&lt;br /&gt;
Since it's a transition, we would like to write something like (simplified)&lt;br /&gt;
 {TRANSITION_BASE &amp;lt;parameters&amp;gt; image1;image2;image3}&lt;br /&gt;
However, for a north transition, the macro would expand to something similar to&lt;br /&gt;
 image=image1;image2;image3-n&lt;br /&gt;
Which is wrong, we want the prefix added to all images in the animation&lt;br /&gt;
 image=image1-n;image2-n;image3-n&lt;br /&gt;
To get the result we want, we use macro indirection. In other word, we have a set of macros who take two parameters&lt;br /&gt;
 #define BUILDER IMAGESTEM POSTFIX&lt;br /&gt;
Which are in charge of returning what should be on the right side of the image= So, with the following macro&lt;br /&gt;
 #define MY_BUILDER IMAGESTEM POSTFIX&lt;br /&gt;
 {IMAGESTEM}1{POSTFIX};{IMAGESTEM}2{POSTFIX};{IMAGESTEM}3{POSTFIX};&lt;br /&gt;
and the following code in the TRANSITION_BASE macro&lt;br /&gt;
 image={{BUILDER} {IMAGESTEM} -n}&lt;br /&gt;
a call to&lt;br /&gt;
 {TRANSITION_BASE_B &amp;lt;parameters&amp;gt; MY_BUILDER image}&lt;br /&gt;
would correctly expand.&lt;br /&gt;
&lt;br /&gt;
=== Common parameters for all builders ===&lt;br /&gt;
All builders must have exactly the same parameters&lt;br /&gt;
* IMAGESTEM : the base name of the image from which to build&lt;br /&gt;
* POSTFIX : a postfix to add to all images&lt;br /&gt;
 &lt;br /&gt;
=== IMAGE_SINGLE IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a single image image= line (i.e not animated) mainly used as default value for BUILDER parameter of meta-macros&lt;br /&gt;
=== ANIMATION_03 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a Three image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
=== ANIMATION_04 IMAGESTEM POSTFIX === &lt;br /&gt;
builds a four image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
=== ANIMATION_10 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a ten image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
* IMAGESTEM-A05&lt;br /&gt;
* IMAGESTEM-A06&lt;br /&gt;
* IMAGESTEM-A07&lt;br /&gt;
* IMAGESTEM-A08&lt;br /&gt;
* IMAGESTEM-A09&lt;br /&gt;
* IMAGESTEM-A10&lt;br /&gt;
=== ANIMATION_15 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a fifteen image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
* IMAGESTEM-A05&lt;br /&gt;
* IMAGESTEM-A06&lt;br /&gt;
* IMAGESTEM-A07&lt;br /&gt;
* IMAGESTEM-A08&lt;br /&gt;
* IMAGESTEM-A09&lt;br /&gt;
* IMAGESTEM-A10&lt;br /&gt;
* IMAGESTEM-A11&lt;br /&gt;
* IMAGESTEM-A12&lt;br /&gt;
* IMAGESTEM-A13&lt;br /&gt;
* IMAGESTEM-A14&lt;br /&gt;
* IMAGESTEM-A15&lt;br /&gt;
=== ANIMATION_04_140 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a four image animation, each image being displayed for 140 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
=== ANIMATION_18_70 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a eighteen image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
* IMAGESTEM-A05&lt;br /&gt;
* IMAGESTEM-A06&lt;br /&gt;
* IMAGESTEM-A07&lt;br /&gt;
* IMAGESTEM-A08&lt;br /&gt;
* IMAGESTEM-A09&lt;br /&gt;
* IMAGESTEM-A10&lt;br /&gt;
* IMAGESTEM-A11&lt;br /&gt;
* IMAGESTEM-A12&lt;br /&gt;
* IMAGESTEM-A13&lt;br /&gt;
* IMAGESTEM-A14&lt;br /&gt;
* IMAGESTEM-A15&lt;br /&gt;
* IMAGESTEM-A16&lt;br /&gt;
* IMAGESTEM-A17&lt;br /&gt;
* IMAGESTEM-A18&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Base tile related macros ==&lt;br /&gt;
&lt;br /&gt;
Base terrains have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''TERRAIN_BASE'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': -1000&lt;br /&gt;
* '''FLAG'''': ''base''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Overlay related macros==&lt;br /&gt;
&lt;br /&gt;
Overlays have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''OVERLAY'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': 0&lt;br /&gt;
* '''FLAG'''': ''overlay''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Keep related macros ==&lt;br /&gt;
&lt;br /&gt;
Keeps are base terrains (they use the same flag) but drawn on layer -1&lt;br /&gt;
&lt;br /&gt;
Keeps have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''KEEP_BASE'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': -1&lt;br /&gt;
* '''FLAG'''': ''base''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Village related macros ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
villages have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''VILLAGE'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': 0&lt;br /&gt;
* '''FLAG'''': ''village''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Transition related macros ==&lt;br /&gt;
&lt;br /&gt;
=== Generic Functions ===&lt;br /&gt;
transitions  have most of the macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''TRANSITION'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': -500&lt;br /&gt;
* '''FLAG''': ''transition-@&amp;lt;side&amp;gt;''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However, unlike all previous type of macros, they are related to a ''side'' instead of the whole hex. Thus the following rules&lt;br /&gt;
&lt;br /&gt;
* There are no ROTATION macros. Since they are always side related.&lt;br /&gt;
* All images are named as if they were ROTATION macros since they are all side related&lt;br /&gt;
* There is no SINGLE variation since it doesn't make sense to have it (a side is always relative to two hex)&lt;br /&gt;
* The flags are set and tested on a side related basis. i.e there can be more than one transition per tile, if they don't cover the same direction&lt;br /&gt;
* for RESTRICTED2 and RESTRICTED3, we only check for neighbouring hex of the ADJACENT type. This makes more sense for borders&lt;br /&gt;
* the COMPLETE variant looks as follows&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 #define BORDER_COMPLETE_LFB TERRAIN ADJACENT LAYER FLAG BUILDER IMAGESTEM&lt;br /&gt;
    {BORDER_RESTRICTED3_RANDOM_LFB  ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
    {BORDER_RESTRICTED2_RANDOM_LFB  ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
    {BORDER_RESTRICTED_RANDOM_LFB   ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
    {BORDER_RESTRICTED_RANDOM_LFB   ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
 #enddef&lt;br /&gt;
&lt;br /&gt;
=== DISABLE_BASE_TRANSITIONS TERRAINLIST ===&lt;br /&gt;
This macro will set all transition-@R* on the tile (''n,ne,se,s,sw'')  thus preventing any other transition from being added&lt;br /&gt;
&lt;br /&gt;
'''Flag Management'''&lt;br /&gt;
will set all transition-@R* on the TERRAINLIST tiles&lt;br /&gt;
=== DISABLE_BASE_TRANSITIONS_F TERRAINLIST FLAG ===&lt;br /&gt;
This macro will set all &amp;lt;FLAG&amp;gt;-@R* on the tile (''n,ne,se,s,sw'')  thus preventing any other transition from being added&lt;br /&gt;
&lt;br /&gt;
'''Flag Management'''&lt;br /&gt;
will set all &amp;lt;FLAG&amp;gt;-@R* on the TERRAINLIST tiles&lt;br /&gt;
&lt;br /&gt;
== Terrain Specific ==&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=EasyCoding&amp;diff=37047</id>
		<title>EasyCoding</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=EasyCoding&amp;diff=37047"/>
		<updated>2010-07-01T21:36:15Z</updated>

		<summary type="html">&lt;p&gt;Boucman: /* GUI related features */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Foreword ==&lt;br /&gt;
This page is here to document easy to do coding tasks. It is not here to double the feature request database, and should only be filled by people that know the code well enough to judge the difficulty of a given task. &lt;br /&gt;
&lt;br /&gt;
If you are such a person, you should feel free to edit this page.&lt;br /&gt;
&lt;br /&gt;
If you're not, you should post a feature request and discuss your idea on the forum or IRC. A coder with better knowledge of the code might give you the green light to add your feature here.&lt;br /&gt;
&lt;br /&gt;
Anybody should feel free to add &amp;quot;clues&amp;quot; to any tasks, that is entry points, traps to avoid, person to contact to discuss and so on.&lt;br /&gt;
&lt;br /&gt;
If you plan to work on a feature, write your name at the bottom of the feature, with the date. Note that if you are too long at working on a feature I'll &amp;quot;free&amp;quot; it back (that is if you're not working on it. If you have problems implementing it, just tell us....)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[User:Boucman|Boucman]] 20:48, 3 October 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Since bugs are sometimes a good opportunity to get a first idea of the code, i will add some here that are easy to fix as soon as i stumble upon them (the one i had in mind is fixed already ;-).&lt;br /&gt;
&lt;br /&gt;
--Yogi Bear, 28 February 2008&lt;br /&gt;
&lt;br /&gt;
== MP related features ==&lt;br /&gt;
&lt;br /&gt;
== WML related features ==&lt;br /&gt;
&lt;br /&gt;
=== WML configurable village income / upkeep ===&lt;br /&gt;
Preferably as a [scenario], [side] or [campaign] keys. As per FR #6301 [https://gna.org/bugs/?6301]. Patch submitted: [https://gna.org/patch/index.php?1162] (gabba)&lt;br /&gt;
&lt;br /&gt;
--[[User:Boucman|Boucman]] 08:56, 28 February 2010 (UTC) : this is postponed for 1.8, can be considered reserved&lt;br /&gt;
&lt;br /&gt;
=== Add support of [if] for [scenario] ===&lt;br /&gt;
As per FR #4539 [https://gna.org/bugs/?4539]&lt;br /&gt;
&lt;br /&gt;
=== Side-specific results ===&lt;br /&gt;
Giving result=defeat or result=victory for specific sides. ([http://gna.org/bugs/index.php?4960 FR #4960]) -- [[User:dlr365|dlr365]] -- patch submitted [https://gna.org/bugs/index.php?4960]&lt;br /&gt;
&lt;br /&gt;
--[[User:Boucman|Boucman]] 08:58, 28 February 2010 (UTC) Patch seems abandonned, but can be used for further work feel free to take over the FR&lt;br /&gt;
&lt;br /&gt;
=== Support for leaderless multiplayergames ===&lt;br /&gt;
Add support for the WML key victory_when_enemies_defeated= in the scenario tag during multiplayergames. ([https://gna.org/bugs/index.php?8106 FR #8106])&lt;br /&gt;
--[[User:Endercoaster|endercoaster]] 30, March 2010. I'm gonna give this one a try.&lt;br /&gt;
&lt;br /&gt;
=== Support for standalone multiplayer scenarios ===&lt;br /&gt;
There used to be support for standalone scenarios in the userdata tree, in reorganising the trees this feature got lost and an add-on is now required to add a scenario.&lt;br /&gt;
Re-add this feature. It is probably a good idea to mirror the mainline multiplayer tree.&lt;br /&gt;
&lt;br /&gt;
=== Other Ideas ===&lt;br /&gt;
See [[FutureWML]]; some ideas there are easier than others.&lt;br /&gt;
&lt;br /&gt;
== Improvements to AI ==&lt;br /&gt;
&lt;br /&gt;
Fix some todos, add new formula functions, or do minor improvements to the formula language. Make it easier to debug the formula language, add more ai components.&lt;br /&gt;
&lt;br /&gt;
Please discuss these with Crab, Dragonking, Sirp or Boucman&lt;br /&gt;
&lt;br /&gt;
=== AI Batch testing ===&lt;br /&gt;
&lt;br /&gt;
Finish patch #1169 [https://gna.org/patch/?1169]&lt;br /&gt;
&lt;br /&gt;
=== Add more ai actions ===&lt;br /&gt;
&lt;br /&gt;
Add an ai action (and add formula_ai function to do that) to set a goto on a unit&lt;br /&gt;
&lt;br /&gt;
Add an ai action (and add formula_ai function to do that) to send a chat message to a player&lt;br /&gt;
&lt;br /&gt;
Add an ai action to set formula ai variable (convert existing code from formula_ai)&lt;br /&gt;
&lt;br /&gt;
Add an ai action to set formula ai unit variable (convert existing code from formula_ai)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Add an ai action  (and add formula_ai function to do that) to fire a WML event &lt;br /&gt;
&lt;br /&gt;
=== write a (fai or c++ or lua) candidate action for leader control ===&lt;br /&gt;
&lt;br /&gt;
=== write a (fai or c++ or lua) candidate action for using leadership/illuminate  ===&lt;br /&gt;
special handling of units with leadership to have them support units. Only do it if it actually is useful (less hits needed to kill the unit) and ability to help multiple units in a single turn (assuming enough MP)&lt;br /&gt;
&lt;br /&gt;
=== write a (fai or c++ or lua) candidate action for healer control ===&lt;br /&gt;
Handle units with healing power, moving them at places where they can provide the most healing&lt;br /&gt;
&lt;br /&gt;
=== berserker improvement ===&lt;br /&gt;
The default AI's strategy of attacking as much as possible is very bad with berserker... A simple AI that would prevent the berserker from attacking (and keeping him close to fight without being exposed) and attack when the chance to kill is high enough would be an interesting addition&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== power projection improvement ===&lt;br /&gt;
AI sometimes wants to calculate 'how much firepower can enemy bring on location X'. in doing so, it considers enemy possible moves, time of day, attacks, enemy defense, etc.&lt;br /&gt;
There is specific problem with 'time_of_day' used in that calculation -sometimes, it's really needed to check 'time of day for NEXT turn', not time of day for THIS turn.(since the time of day might change next turn). &lt;br /&gt;
&lt;br /&gt;
power_projection must be fixed to account for the possibility of time_of_day being different.&lt;br /&gt;
&lt;br /&gt;
Note that some enemies might go after us (so, still on THIS turn), and some - before us (so, their next turn will be on NEXT turn).&lt;br /&gt;
&lt;br /&gt;
== GUI related features ==&lt;br /&gt;
-------------------&lt;br /&gt;
&lt;br /&gt;
Note at the moment Mordante is working on a new GUI system, these &lt;br /&gt;
changes will probably affect the way these items need to be implemented.&lt;br /&gt;
Contact Mordante on IRC before starting to work on these.&lt;br /&gt;
  &lt;br /&gt;
--[[User:SkeletonCrew|SkeletonCrew]] 14:04, 9 March 2008 (EDT)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Theme Changes ===&lt;br /&gt;
&lt;br /&gt;
* allow custom themes to display values of WML variables ([http://gna.org/bugs/index.php?6209 FR #6209])&lt;br /&gt;
* hide the hourglass item from the statusbar when there is no timer&lt;br /&gt;
&lt;br /&gt;
=== Widget Changes ===&lt;br /&gt;
* show side number, name and team association information in the status table &lt;br /&gt;
* make games sortable in the lobby (open slots, total number of players, era, XP modifier, gold per village, fog/shroud) &lt;br /&gt;
* input history (chat, commands, ..) - note: rujasu is working on this feature&lt;br /&gt;
=== Story Screen improvements ===&lt;br /&gt;
see http://www.wesnoth.org/forum/viewtopic.php?p=439346#p439346 for the suggestion and https://gna.org/patch/?1587 for a patch that already touched that area heavily&lt;br /&gt;
&lt;br /&gt;
== GUI2 related features ==&lt;br /&gt;
GUI2 is the new gui engine Mordante/SkeletonCrew is working on. &lt;br /&gt;
* Information on the wiki can be found here http://www.wesnoth.org/wiki/GUIToolkit&lt;br /&gt;
* The source code is under src/gui/&lt;br /&gt;
* The configuration config files are under data/gui/default&lt;br /&gt;
&lt;br /&gt;
Some tasks need the --new-widgets since the code is only shown in the experimental mode. Tasks which need this switch have the * in the title.&lt;br /&gt;
&lt;br /&gt;
At the moment there are no easy tasks available.&lt;br /&gt;
&lt;br /&gt;
== Miscellaneous ==&lt;br /&gt;
&lt;br /&gt;
=== More powerful village naming ===&lt;br /&gt;
'''Adding mountain names and other features to village names, having a second random name in village names'''&lt;br /&gt;
&lt;br /&gt;
Currently the village naming engine has a very good structure that could allow &lt;br /&gt;
more powerfull names to be generated. &lt;br /&gt;
Understanding how it works should be quite easy, and a few usefull improvements could be added.&lt;br /&gt;
&lt;br /&gt;
* Currently villages can use lake names and river names, this should be extended to other features like bridges, swamps, mountains etc...&lt;br /&gt;
* It would be nice to have a separate list of &amp;quot;first sylabus&amp;quot; and &amp;quot;last sylabus&amp;quot; for naming. That's not really needed in english, but some translations could use it&lt;br /&gt;
* Again, it is common to have villages with more than one &amp;quot;random&amp;quot; word in them. having a $name2 variable would be nice&lt;br /&gt;
&lt;br /&gt;
Euschn 24/03/2009&lt;br /&gt;
&lt;br /&gt;
=== Debug Mode ===&lt;br /&gt;
* New debug command functionality (setting additional status.variables, possibly terrain)&lt;br /&gt;
=== Option to disable terrain animations globally ===&lt;br /&gt;
see https://gna.org/bugs/?15976&lt;br /&gt;
&lt;br /&gt;
please think a little about use cases (editor, game etc...)&lt;br /&gt;
&lt;br /&gt;
ask boucman for details&lt;br /&gt;
&lt;br /&gt;
== Bugs ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
[[NotSoEasyCoding]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Future]]&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=TerrainMacrosWML&amp;diff=36835</id>
		<title>TerrainMacrosWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=TerrainMacrosWML&amp;diff=36835"/>
		<updated>2010-06-24T14:24:30Z</updated>

		<summary type="html">&lt;p&gt;Boucman: /* Flag Management */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DevFeature1.9}}&lt;br /&gt;
This page is entirely base on the 1.9 macros, they are very close to the 1.8 macros, but no attempt has been done to document the difference&lt;br /&gt;
&lt;br /&gt;
== Flag Management ==&lt;br /&gt;
This section lists the common flags used by macros and their high level signification&lt;br /&gt;
* '''base''': is set on all hex when the base tile is set.&lt;br /&gt;
* '''overlay''': is set on all hex that have something drawn on the hex itself (i.e not a transition) over the base terrain.&lt;br /&gt;
* '''village''': is set when a village is added on a tile.&lt;br /&gt;
* '''transition-@R*''': is set on a tile which has a transition on it's corresponding side set (i.e if there is a transition with the tile at its north, transition-n will be set) possible values: ''n,ne,nw,s,se,sw'' Also not that the macros handl it in a reciprocal way. in other word if a tile has transition-n set, it's northern neighbour should have transition-s set&lt;br /&gt;
* '''overlay-connect-@R*''' : used for bridges, the bridge on this tile. The bridge &amp;quot;actually has&amp;quot; an &amp;quot;exit direction&amp;quot; in the @R direction indicated.&lt;br /&gt;
* '''overlay-away-@R*''' : used for bridges, the bridge does NOT have an exit on the given direction, but would be expected to...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''A note about ''overlay-@R'' and ''overlay-away-@R'' flags '''&lt;br /&gt;
&lt;br /&gt;
Suppose we have a ''n-&amp;gt;s'' bridge hex who's ''ne'' neighbour is a ''ne-&amp;gt;sw'' bridge. This mean that the ''n-&amp;gt;s'' is actually a turn in the bridge that should use a graphic depicting a ''s-&amp;gt;ne'' corner.&lt;br /&gt;
&lt;br /&gt;
In that case the tile will have ''overlay-s'' and ''overlay-ne'' set (the directions where the bridge actually exits) and ''overlay-away-n'' (the direction where the bridge would exit according to terrain codes, but doesnt because of overall layout)&lt;br /&gt;
&lt;br /&gt;
== Layer Management ==&lt;br /&gt;
* '''-1000''': default layer for base tiles&lt;br /&gt;
* '''-80''': overlays that should always be drawn under units (like rails etc...)&lt;br /&gt;
* '''0''': default layer for overlays and villages&lt;br /&gt;
Normal units are drawn above layer 0, except if the basey of the tile is &amp;gt; 56 in which case they are drawn below&lt;br /&gt;
* '''1''': used by the base tile of castles/keeps&lt;br /&gt;
Flying/moving units are always drawn over terrain&lt;br /&gt;
== Precedence Management ==&lt;br /&gt;
TBSL&lt;br /&gt;
== Base Management ==&lt;br /&gt;
TBSL&lt;br /&gt;
&lt;br /&gt;
== Macro naming convention ==&lt;br /&gt;
for some common types of tiles, we have a lot of variation of macros. To simplify, they follow a naming convention&lt;br /&gt;
&lt;br /&gt;
=== Macro names ===&lt;br /&gt;
Type is the type of macros (like KEEP,OVERLAY etc...) we are using&lt;br /&gt;
&lt;br /&gt;
* '''TYPE'''''_PLFB'' : puts an image on a tile&lt;br /&gt;
* '''TYPE_RANDOM'''''_LFB'' : puts an image from a random set on a tile&lt;br /&gt;
* '''TYPE_RESTRICTED[23]'''''_PLFB'': puts an image on a tile if the tile has one [two or three] neighbours of a given type&lt;br /&gt;
* '''TYPE_RESTRICTED[23]_RANDOM'''''_PLFB'': combination of above&lt;br /&gt;
* '''TYPE_ROTATION_RESTRICTED[23]'''''_PLFB'': combination of above + the images will be named according to where the neighbours are&lt;br /&gt;
* '''TYPE_ROTATION_RESTRICTED[23]_RANDOM'''''_PLFB'': combination of above&lt;br /&gt;
&lt;br /&gt;
here ''_PLFB'' means any combination of _P _PL _PF etc... will also be correct macro names with the corresponding parameters&lt;br /&gt;
&lt;br /&gt;
each section describing a type will explain what values for PLFB are used for the functions that don't have them as parameters&lt;br /&gt;
&lt;br /&gt;
=== Macro Parameters ===&lt;br /&gt;
&lt;br /&gt;
These macros always have the parameters in the same orders (not all macros have all parameters, see below&lt;br /&gt;
&lt;br /&gt;
 TERRAIN ADJACENT PROB LAYER FLAG BUILDER IMAGESTEM&lt;br /&gt;
&lt;br /&gt;
* '''TERRAIN''' : the type of terrain to put the image on&lt;br /&gt;
* '''ADJACENT''' : ''only for restricted'' the type of neighbours to test for&lt;br /&gt;
* '''PROB''' : ''only for _P'' The probability of the rules generated by the macros of being applied. See the discussion in [[TerrainGraphicsTutorial#Cumulative_Probabilities]] for complications&lt;br /&gt;
* '''LAYER''' : ''only for _L'' The layer that will be used for the generated rules&lt;br /&gt;
* '''FLAG''' : ''only for _F'' A flag to test and set on the tile&lt;br /&gt;
* '''BUILDER''' : ''only for _B'' the builder macro that will be used to create the animations  in the image= field of the generated terrain code. See the dicussion at the begining of the builder section&lt;br /&gt;
* '''IMAGESTEM''': the basename on which filenames will be based.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Image Names ===&lt;br /&gt;
* '''_RANDOM_'''&lt;br /&gt;
** {{BUILDER} {IMAGESTEM} ()}&lt;br /&gt;
** {{BUILDER} {IMAGESTEM}2 ()}&lt;br /&gt;
** {{BUILDER} {IMAGESTEM}3 ()}&lt;br /&gt;
** ''etc up to 11''&lt;br /&gt;
* '''_ROTATION_'''&lt;br /&gt;
** '''1''' : {{BUILDER} {IMAGESTEM} (-@R0)} with @R0 being the orientation of the neighbouring tile&lt;br /&gt;
** '''2''' : {{BUILDER} {IMAGESTEM} (-@R0-@R1)} with @R0 and @R1 being the orientations of the neighbouring tiles&lt;br /&gt;
** '''3''' : {{BUILDER} {IMAGESTEM} (-@R0-@R1-@R2)} with @R0, @R1 and @R2 being the orientations of the neighbouring tiles&lt;br /&gt;
* '''_RANDOM_ + _ROTATION_'''&lt;br /&gt;
** {{BUILDER} {IMAGESTEM}# (-@R#)} ''similar to above with all combinations''&lt;br /&gt;
&lt;br /&gt;
== The TEST_COMPLETE macro ==&lt;br /&gt;
&lt;br /&gt;
there is one more macro which exist for most families of macro&lt;br /&gt;
&lt;br /&gt;
 #define TYPE_COMPLETE_LFB TERRAIN ADJACENT LAYER FLAG BUILDER IMAGESTEM&lt;br /&gt;
    {TYPE_ROTATION_RESTRICTED3_RANDOM_LFB  ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small (-@R0-@R1-@R2)}&lt;br /&gt;
    {TYPE_ROTATION_RESTRICTED2_RANDOM_LFB  ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small (-@R0-@R1)}&lt;br /&gt;
    {TYPE_ROTATION_RESTRICTED_RANDOM_LFB   ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small (-@R0)}&lt;br /&gt;
    {TYPE_RESTRICTED_RANDOM_LFB            ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small ()}&lt;br /&gt;
    {TYPE_SINGLE_RANDOM_LFB                ({TERRAIN})               {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
 #enddef&lt;br /&gt;
&lt;br /&gt;
This macro is a simpler way of handling the most common case of &amp;quot;use a smaller variation when next to some terrains&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* If it has three neighbours, it will try IMAGESTEM-small#-R1-R2-R3&lt;br /&gt;
* if it has two neighbour or the correct image wasn't found, it will try two-sided variations&lt;br /&gt;
* if it has one neighbour or the correct image wasn't found, it will try one sided variations&lt;br /&gt;
* if it has still not found anything, it will try IMAGESTEM-small&lt;br /&gt;
* if it has no neighbour or still hasn't found anything, it will try based on IMAGESTEM&lt;br /&gt;
&lt;br /&gt;
== Image Builder macros ==&lt;br /&gt;
=== The problem ===&lt;br /&gt;
suppose we want to animate a transition with the following line&lt;br /&gt;
 image=image1;image2;image3&lt;br /&gt;
Since it's a transition, we would like to write something like (simplified)&lt;br /&gt;
 {TRANSITION_BASE &amp;lt;parameters&amp;gt; image1;image2;image3}&lt;br /&gt;
However, for a north transition, the macro would expand to something similar to&lt;br /&gt;
 image=image1;image2;image3-n&lt;br /&gt;
Which is wrong, we want the prefix added to all images in the animation&lt;br /&gt;
 image=image1-n;image2-n;image3-n&lt;br /&gt;
To get the result we want, we use macro indirection. In other word, we have a set of macros who take two parameters&lt;br /&gt;
 #define BUILDER IMAGESTEM POSTFIX&lt;br /&gt;
Which are in charge of returning what should be on the right side of the image= So, with the following macro&lt;br /&gt;
 #define MY_BUILDER IMAGESTEM POSTFIX&lt;br /&gt;
 {IMAGESTEM}1{POSTFIX};{IMAGESTEM}2{POSTFIX};{IMAGESTEM}3{POSTFIX};&lt;br /&gt;
and the following code in the TRANSITION_BASE macro&lt;br /&gt;
 image={{BUILDER} {IMAGESTEM} -n}&lt;br /&gt;
a call to&lt;br /&gt;
 {TRANSITION_BASE_B &amp;lt;parameters&amp;gt; MY_BUILDER image}&lt;br /&gt;
would correctly expand.&lt;br /&gt;
&lt;br /&gt;
=== Common parameters for all builders ===&lt;br /&gt;
All builders must have exactly the same parameters&lt;br /&gt;
* IMAGESTEM : the base name of the image from which to build&lt;br /&gt;
* POSTFIX : a postfix to add to all images&lt;br /&gt;
 &lt;br /&gt;
=== IMAGE_SINGLE IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a single image image= line (i.e not animated) mainly used as default value for BUILDER parameter of meta-macros&lt;br /&gt;
=== ANIMATION_03 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a Three image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
=== ANIMATION_04 IMAGESTEM POSTFIX === &lt;br /&gt;
builds a four image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
=== ANIMATION_10 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a ten image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
* IMAGESTEM-A05&lt;br /&gt;
* IMAGESTEM-A06&lt;br /&gt;
* IMAGESTEM-A07&lt;br /&gt;
* IMAGESTEM-A08&lt;br /&gt;
* IMAGESTEM-A09&lt;br /&gt;
* IMAGESTEM-A10&lt;br /&gt;
=== ANIMATION_15 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a fifteen image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
* IMAGESTEM-A05&lt;br /&gt;
* IMAGESTEM-A06&lt;br /&gt;
* IMAGESTEM-A07&lt;br /&gt;
* IMAGESTEM-A08&lt;br /&gt;
* IMAGESTEM-A09&lt;br /&gt;
* IMAGESTEM-A10&lt;br /&gt;
* IMAGESTEM-A11&lt;br /&gt;
* IMAGESTEM-A12&lt;br /&gt;
* IMAGESTEM-A13&lt;br /&gt;
* IMAGESTEM-A14&lt;br /&gt;
* IMAGESTEM-A15&lt;br /&gt;
=== ANIMATION_04_140 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a four image animation, each image being displayed for 140 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
=== ANIMATION_18_70 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a eighteen image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
* IMAGESTEM-A05&lt;br /&gt;
* IMAGESTEM-A06&lt;br /&gt;
* IMAGESTEM-A07&lt;br /&gt;
* IMAGESTEM-A08&lt;br /&gt;
* IMAGESTEM-A09&lt;br /&gt;
* IMAGESTEM-A10&lt;br /&gt;
* IMAGESTEM-A11&lt;br /&gt;
* IMAGESTEM-A12&lt;br /&gt;
* IMAGESTEM-A13&lt;br /&gt;
* IMAGESTEM-A14&lt;br /&gt;
* IMAGESTEM-A15&lt;br /&gt;
* IMAGESTEM-A16&lt;br /&gt;
* IMAGESTEM-A17&lt;br /&gt;
* IMAGESTEM-A18&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Base tile related macros ==&lt;br /&gt;
&lt;br /&gt;
Base terrains have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''TERRAIN_BASE'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': -1000&lt;br /&gt;
* '''FLAG'''': ''base''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Overlay related macros==&lt;br /&gt;
&lt;br /&gt;
Overlays have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''OVERLAY'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': 0&lt;br /&gt;
* '''FLAG'''': ''overlay''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Keep related macros ==&lt;br /&gt;
&lt;br /&gt;
Keeps are base terrains (they use the same flag) but drawn on layer -1&lt;br /&gt;
&lt;br /&gt;
Keeps have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''KEEP_BASE'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': -1&lt;br /&gt;
* '''FLAG'''': ''base''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Village related macros ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
villages have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''VILLAGE'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': 0&lt;br /&gt;
* '''FLAG'''': ''village''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Transition related macros ==&lt;br /&gt;
&lt;br /&gt;
=== Generic Functions ===&lt;br /&gt;
transitions  have most of the macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''TRANSITION'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': -500&lt;br /&gt;
* '''FLAG''': ''transition-@&amp;lt;side&amp;gt;''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However, unlike all previous type of macros, they are related to a ''side'' instead of the whole hex. Thus the following rules&lt;br /&gt;
&lt;br /&gt;
* There are no ROTATION macros. Since they are always side related.&lt;br /&gt;
* All images are named as if they were ROTATION macros since they are all side related&lt;br /&gt;
* There is no SINGLE variation since it doesn't make sense to have it (a side is always relative to two hex)&lt;br /&gt;
* The flags are set and tested on a side related basis. i.e there can be more than one transition per tile, if they don't cover the same direction&lt;br /&gt;
* for RESTRICTED2 and RESTRICTED3, we only check for neighbouring hex of the ADJACENT type. This makes more sense for borders&lt;br /&gt;
* the COMPLETE variant looks as follows&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 #define BORDER_COMPLETE_LFB TERRAIN ADJACENT LAYER FLAG BUILDER IMAGESTEM&lt;br /&gt;
    {BORDER_RESTRICTED3_RANDOM_LFB  ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
    {BORDER_RESTRICTED2_RANDOM_LFB  ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
    {BORDER_RESTRICTED_RANDOM_LFB   ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
    {BORDER_RESTRICTED_RANDOM_LFB   ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
 #enddef&lt;br /&gt;
&lt;br /&gt;
=== DISABLE_BASE_TRANSITIONS TERRAINLIST ===&lt;br /&gt;
This macro will set all transition-@R* on the tile (''n,ne,se,s,sw'')  thus preventing any other transition from being added&lt;br /&gt;
&lt;br /&gt;
'''Flag Management'''&lt;br /&gt;
will set all transition-@R* on the TERRAINLIST tiles&lt;br /&gt;
=== DISABLE_BASE_TRANSITIONS_F TERRAINLIST FLAG ===&lt;br /&gt;
This macro will set all &amp;lt;FLAG&amp;gt;-@R* on the tile (''n,ne,se,s,sw'')  thus preventing any other transition from being added&lt;br /&gt;
&lt;br /&gt;
'''Flag Management'''&lt;br /&gt;
will set all &amp;lt;FLAG&amp;gt;-@R* on the TERRAINLIST tiles&lt;br /&gt;
&lt;br /&gt;
== Terrain Specific ==&lt;br /&gt;
=== SIMPLE_FOREST_TERRAIN TERRAINLIST ADJACENT IMAGESTEM ===&lt;br /&gt;
&lt;br /&gt;
will use an image IMAGESTEM-small# when next to adjacent and IMAGESTEM# anywhere else&lt;br /&gt;
&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-small&lt;br /&gt;
* IMAGESTEM-small2&lt;br /&gt;
* IMAGESTEM-small3&lt;br /&gt;
* IMAGESTEM-small4&lt;br /&gt;
* IMAGESTEM-small5&lt;br /&gt;
* IMAGESTEM-small6&lt;br /&gt;
* IMAGESTEM-small7&lt;br /&gt;
* IMAGESTEM-small8&lt;br /&gt;
* IMAGESTEM-small9&lt;br /&gt;
* IMAGESTEM&lt;br /&gt;
* IMAGESTEM2&lt;br /&gt;
* IMAGESTEM3&lt;br /&gt;
* IMAGESTEM4&lt;br /&gt;
* IMAGESTEM5&lt;br /&gt;
* IMAGESTEM6&lt;br /&gt;
* IMAGESTEM7&lt;br /&gt;
* IMAGESTEM8&lt;br /&gt;
* IMAGESTEM9&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''' Parameters ''' &lt;br /&gt;
* '''ADJACENT''': regexp of terrains that will use -small images&lt;br /&gt;
&lt;br /&gt;
''' Flage management '''&lt;br /&gt;
this is technically an overlay. It is drawn on layer 0 with other overlays and test/set the overlay flag&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=TerrainMacrosWML&amp;diff=36801</id>
		<title>TerrainMacrosWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=TerrainMacrosWML&amp;diff=36801"/>
		<updated>2010-06-18T17:50:01Z</updated>

		<summary type="html">&lt;p&gt;Boucman: /* Flag Management */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DevFeature1.9}}&lt;br /&gt;
This page is entirely base on the 1.9 macros, they are very close to the 1.8 macros, but no attempt has been done to document the difference&lt;br /&gt;
&lt;br /&gt;
== Flag Management ==&lt;br /&gt;
This section lists the common flags used by macros and their high level signification&lt;br /&gt;
* '''base''': is set on all hex when the base tile is set.&lt;br /&gt;
* '''overlay''': is set on all hex that have something drawn on the hex itself (i.e not a transition) over the base terrain.&lt;br /&gt;
* '''village''': is set when a village is added on a tile.&lt;br /&gt;
* '''transition-@R*''': is set on a tile which has a transition on it's corresponding side set (i.e if there is a transition with the tile at its north, transition-n will be set) possible values: ''n,ne,nw,s,se,sw'' Also not that the macros handl it in a reciprocal way. in other word if a tile has transition-n set, it's northern neighbour should have transition-s set&lt;br /&gt;
* '''overlay-@R*''' : used for bridges, the bridge on this tile. The bridge &amp;quot;actually has&amp;quot; an &amp;quot;exit direction&amp;quot; in the @R direction indicated.&lt;br /&gt;
* '''overlay-away-@R*''' : used for bridges, the bridge does NOT have an exit on the given direction, but would be expected to...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''A note about ''overlay-@R'' and ''overlay-away-@R'' flags '''&lt;br /&gt;
&lt;br /&gt;
Suppose we have a ''n-&amp;gt;s'' bridge hex who's ''ne'' neighbour is a ''ne-&amp;gt;sw'' bridge. This mean that the ''n-&amp;gt;s'' is actually a turn in the bridge that should use a graphic depicting a ''s-&amp;gt;ne'' corner.&lt;br /&gt;
&lt;br /&gt;
In that case the tile will have ''overlay-s'' and ''overlay-ne'' set (the directions where the bridge actually exits) and ''overlay-away-n'' (the direction where the bridge would exit according to terrain codes, but doesnt because of overall layout)&lt;br /&gt;
&lt;br /&gt;
== Layer Management ==&lt;br /&gt;
* '''-1000''': default layer for base tiles&lt;br /&gt;
* '''-80''': overlays that should always be drawn under units (like rails etc...)&lt;br /&gt;
* '''0''': default layer for overlays and villages&lt;br /&gt;
Normal units are drawn above layer 0, except if the basey of the tile is &amp;gt; 56 in which case they are drawn below&lt;br /&gt;
* '''1''': used by the base tile of castles/keeps&lt;br /&gt;
Flying/moving units are always drawn over terrain&lt;br /&gt;
== Precedence Management ==&lt;br /&gt;
TBSL&lt;br /&gt;
== Base Management ==&lt;br /&gt;
TBSL&lt;br /&gt;
&lt;br /&gt;
== Macro naming convention ==&lt;br /&gt;
for some common types of tiles, we have a lot of variation of macros. To simplify, they follow a naming convention&lt;br /&gt;
&lt;br /&gt;
=== Macro names ===&lt;br /&gt;
Type is the type of macros (like KEEP,OVERLAY etc...) we are using&lt;br /&gt;
&lt;br /&gt;
* '''TYPE'''''_PLFB'' : puts an image on a tile&lt;br /&gt;
* '''TYPE_RANDOM'''''_LFB'' : puts an image from a random set on a tile&lt;br /&gt;
* '''TYPE_RESTRICTED[23]'''''_PLFB'': puts an image on a tile if the tile has one [two or three] neighbours of a given type&lt;br /&gt;
* '''TYPE_RESTRICTED[23]_RANDOM'''''_PLFB'': combination of above&lt;br /&gt;
* '''TYPE_ROTATION_RESTRICTED[23]'''''_PLFB'': combination of above + the images will be named according to where the neighbours are&lt;br /&gt;
* '''TYPE_ROTATION_RESTRICTED[23]_RANDOM'''''_PLFB'': combination of above&lt;br /&gt;
&lt;br /&gt;
here ''_PLFB'' means any combination of _P _PL _PF etc... will also be correct macro names with the corresponding parameters&lt;br /&gt;
&lt;br /&gt;
each section describing a type will explain what values for PLFB are used for the functions that don't have them as parameters&lt;br /&gt;
&lt;br /&gt;
=== Macro Parameters ===&lt;br /&gt;
&lt;br /&gt;
These macros always have the parameters in the same orders (not all macros have all parameters, see below&lt;br /&gt;
&lt;br /&gt;
 TERRAIN ADJACENT PROB LAYER FLAG BUILDER IMAGESTEM&lt;br /&gt;
&lt;br /&gt;
* '''TERRAIN''' : the type of terrain to put the image on&lt;br /&gt;
* '''ADJACENT''' : ''only for restricted'' the type of neighbours to test for&lt;br /&gt;
* '''PROB''' : ''only for _P'' The probability of the rules generated by the macros of being applied. See the discussion in [[TerrainGraphicsTutorial#Cumulative_Probabilities]] for complications&lt;br /&gt;
* '''LAYER''' : ''only for _L'' The layer that will be used for the generated rules&lt;br /&gt;
* '''FLAG''' : ''only for _F'' A flag to test and set on the tile&lt;br /&gt;
* '''BUILDER''' : ''only for _B'' the builder macro that will be used to create the animations  in the image= field of the generated terrain code. See the dicussion at the begining of the builder section&lt;br /&gt;
* '''IMAGESTEM''': the basename on which filenames will be based.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Image Names ===&lt;br /&gt;
* '''_RANDOM_'''&lt;br /&gt;
** {{BUILDER} {IMAGESTEM} ()}&lt;br /&gt;
** {{BUILDER} {IMAGESTEM}2 ()}&lt;br /&gt;
** {{BUILDER} {IMAGESTEM}3 ()}&lt;br /&gt;
** ''etc up to 11''&lt;br /&gt;
* '''_ROTATION_'''&lt;br /&gt;
** '''1''' : {{BUILDER} {IMAGESTEM} (-@R0)} with @R0 being the orientation of the neighbouring tile&lt;br /&gt;
** '''2''' : {{BUILDER} {IMAGESTEM} (-@R0-@R1)} with @R0 and @R1 being the orientations of the neighbouring tiles&lt;br /&gt;
** '''3''' : {{BUILDER} {IMAGESTEM} (-@R0-@R1-@R2)} with @R0, @R1 and @R2 being the orientations of the neighbouring tiles&lt;br /&gt;
* '''_RANDOM_ + _ROTATION_'''&lt;br /&gt;
** {{BUILDER} {IMAGESTEM}# (-@R#)} ''similar to above with all combinations''&lt;br /&gt;
&lt;br /&gt;
== The TEST_COMPLETE macro ==&lt;br /&gt;
&lt;br /&gt;
there is one more macro which exist for most families of macro&lt;br /&gt;
&lt;br /&gt;
 #define TYPE_COMPLETE_LFB TERRAIN ADJACENT LAYER FLAG BUILDER IMAGESTEM&lt;br /&gt;
    {TYPE_ROTATION_RESTRICTED3_RANDOM_LFB  ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small (-@R0-@R1-@R2)}&lt;br /&gt;
    {TYPE_ROTATION_RESTRICTED2_RANDOM_LFB  ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small (-@R0-@R1)}&lt;br /&gt;
    {TYPE_ROTATION_RESTRICTED_RANDOM_LFB   ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small (-@R0)}&lt;br /&gt;
    {TYPE_RESTRICTED_RANDOM_LFB            ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small ()}&lt;br /&gt;
    {TYPE_SINGLE_RANDOM_LFB                ({TERRAIN})               {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
 #enddef&lt;br /&gt;
&lt;br /&gt;
This macro is a simpler way of handling the most common case of &amp;quot;use a smaller variation when next to some terrains&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* If it has three neighbours, it will try IMAGESTEM-small#-R1-R2-R3&lt;br /&gt;
* if it has two neighbour or the correct image wasn't found, it will try two-sided variations&lt;br /&gt;
* if it has one neighbour or the correct image wasn't found, it will try one sided variations&lt;br /&gt;
* if it has still not found anything, it will try IMAGESTEM-small&lt;br /&gt;
* if it has no neighbour or still hasn't found anything, it will try based on IMAGESTEM&lt;br /&gt;
&lt;br /&gt;
== Image Builder macros ==&lt;br /&gt;
=== The problem ===&lt;br /&gt;
suppose we want to animate a transition with the following line&lt;br /&gt;
 image=image1;image2;image3&lt;br /&gt;
Since it's a transition, we would like to write something like (simplified)&lt;br /&gt;
 {TRANSITION_BASE &amp;lt;parameters&amp;gt; image1;image2;image3}&lt;br /&gt;
However, for a north transition, the macro would expand to something similar to&lt;br /&gt;
 image=image1;image2;image3-n&lt;br /&gt;
Which is wrong, we want the prefix added to all images in the animation&lt;br /&gt;
 image=image1-n;image2-n;image3-n&lt;br /&gt;
To get the result we want, we use macro indirection. In other word, we have a set of macros who take two parameters&lt;br /&gt;
 #define BUILDER IMAGESTEM POSTFIX&lt;br /&gt;
Which are in charge of returning what should be on the right side of the image= So, with the following macro&lt;br /&gt;
 #define MY_BUILDER IMAGESTEM POSTFIX&lt;br /&gt;
 {IMAGESTEM}1{POSTFIX};{IMAGESTEM}2{POSTFIX};{IMAGESTEM}3{POSTFIX};&lt;br /&gt;
and the following code in the TRANSITION_BASE macro&lt;br /&gt;
 image={{BUILDER} {IMAGESTEM} -n}&lt;br /&gt;
a call to&lt;br /&gt;
 {TRANSITION_BASE_B &amp;lt;parameters&amp;gt; MY_BUILDER image}&lt;br /&gt;
would correctly expand.&lt;br /&gt;
&lt;br /&gt;
=== Common parameters for all builders ===&lt;br /&gt;
All builders must have exactly the same parameters&lt;br /&gt;
* IMAGESTEM : the base name of the image from which to build&lt;br /&gt;
* POSTFIX : a postfix to add to all images&lt;br /&gt;
 &lt;br /&gt;
=== IMAGE_SINGLE IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a single image image= line (i.e not animated) mainly used as default value for BUILDER parameter of meta-macros&lt;br /&gt;
=== ANIMATION_03 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a Three image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
=== ANIMATION_04 IMAGESTEM POSTFIX === &lt;br /&gt;
builds a four image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
=== ANIMATION_10 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a ten image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
* IMAGESTEM-A05&lt;br /&gt;
* IMAGESTEM-A06&lt;br /&gt;
* IMAGESTEM-A07&lt;br /&gt;
* IMAGESTEM-A08&lt;br /&gt;
* IMAGESTEM-A09&lt;br /&gt;
* IMAGESTEM-A10&lt;br /&gt;
=== ANIMATION_15 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a fifteen image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
* IMAGESTEM-A05&lt;br /&gt;
* IMAGESTEM-A06&lt;br /&gt;
* IMAGESTEM-A07&lt;br /&gt;
* IMAGESTEM-A08&lt;br /&gt;
* IMAGESTEM-A09&lt;br /&gt;
* IMAGESTEM-A10&lt;br /&gt;
* IMAGESTEM-A11&lt;br /&gt;
* IMAGESTEM-A12&lt;br /&gt;
* IMAGESTEM-A13&lt;br /&gt;
* IMAGESTEM-A14&lt;br /&gt;
* IMAGESTEM-A15&lt;br /&gt;
=== ANIMATION_04_140 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a four image animation, each image being displayed for 140 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
=== ANIMATION_18_70 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a eighteen image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
* IMAGESTEM-A05&lt;br /&gt;
* IMAGESTEM-A06&lt;br /&gt;
* IMAGESTEM-A07&lt;br /&gt;
* IMAGESTEM-A08&lt;br /&gt;
* IMAGESTEM-A09&lt;br /&gt;
* IMAGESTEM-A10&lt;br /&gt;
* IMAGESTEM-A11&lt;br /&gt;
* IMAGESTEM-A12&lt;br /&gt;
* IMAGESTEM-A13&lt;br /&gt;
* IMAGESTEM-A14&lt;br /&gt;
* IMAGESTEM-A15&lt;br /&gt;
* IMAGESTEM-A16&lt;br /&gt;
* IMAGESTEM-A17&lt;br /&gt;
* IMAGESTEM-A18&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Base tile related macros ==&lt;br /&gt;
&lt;br /&gt;
Base terrains have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''TERRAIN_BASE'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': -1000&lt;br /&gt;
* '''FLAG'''': ''base''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Overlay related macros==&lt;br /&gt;
&lt;br /&gt;
Overlays have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''OVERLAY'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': 0&lt;br /&gt;
* '''FLAG'''': ''overlay''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Keep related macros ==&lt;br /&gt;
&lt;br /&gt;
Keeps are base terrains (they use the same flag) but drawn on layer -1&lt;br /&gt;
&lt;br /&gt;
Keeps have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''KEEP_BASE'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': -1&lt;br /&gt;
* '''FLAG'''': ''base''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Village related macros ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
villages have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''VILLAGE'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': 0&lt;br /&gt;
* '''FLAG'''': ''village''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Transition related macros ==&lt;br /&gt;
&lt;br /&gt;
=== Generic Functions ===&lt;br /&gt;
transitions  have most of the macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''TRANSITION'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': -500&lt;br /&gt;
* '''FLAG''': ''transition-@&amp;lt;side&amp;gt;''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However, unlike all previous type of macros, they are related to a ''side'' instead of the whole hex. Thus the following rules&lt;br /&gt;
&lt;br /&gt;
* There are no ROTATION macros. Since they are always side related.&lt;br /&gt;
* All images are named as if they were ROTATION macros since they are all side related&lt;br /&gt;
* There is no SINGLE variation since it doesn't make sense to have it (a side is always relative to two hex)&lt;br /&gt;
* The flags are set and tested on a side related basis. i.e there can be more than one transition per tile, if they don't cover the same direction&lt;br /&gt;
* for RESTRICTED2 and RESTRICTED3, we only check for neighbouring hex of the ADJACENT type. This makes more sense for borders&lt;br /&gt;
* the COMPLETE variant looks as follows&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 #define BORDER_COMPLETE_LFB TERRAIN ADJACENT LAYER FLAG BUILDER IMAGESTEM&lt;br /&gt;
    {BORDER_RESTRICTED3_RANDOM_LFB  ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
    {BORDER_RESTRICTED2_RANDOM_LFB  ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
    {BORDER_RESTRICTED_RANDOM_LFB   ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
    {BORDER_RESTRICTED_RANDOM_LFB   ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
 #enddef&lt;br /&gt;
&lt;br /&gt;
=== DISABLE_BASE_TRANSITIONS TERRAINLIST ===&lt;br /&gt;
This macro will set all transition-@R* on the tile (''n,ne,se,s,sw'')  thus preventing any other transition from being added&lt;br /&gt;
&lt;br /&gt;
'''Flag Management'''&lt;br /&gt;
will set all transition-@R* on the TERRAINLIST tiles&lt;br /&gt;
=== DISABLE_BASE_TRANSITIONS_F TERRAINLIST FLAG ===&lt;br /&gt;
This macro will set all &amp;lt;FLAG&amp;gt;-@R* on the tile (''n,ne,se,s,sw'')  thus preventing any other transition from being added&lt;br /&gt;
&lt;br /&gt;
'''Flag Management'''&lt;br /&gt;
will set all &amp;lt;FLAG&amp;gt;-@R* on the TERRAINLIST tiles&lt;br /&gt;
&lt;br /&gt;
== Terrain Specific ==&lt;br /&gt;
=== SIMPLE_FOREST_TERRAIN TERRAINLIST ADJACENT IMAGESTEM ===&lt;br /&gt;
&lt;br /&gt;
will use an image IMAGESTEM-small# when next to adjacent and IMAGESTEM# anywhere else&lt;br /&gt;
&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-small&lt;br /&gt;
* IMAGESTEM-small2&lt;br /&gt;
* IMAGESTEM-small3&lt;br /&gt;
* IMAGESTEM-small4&lt;br /&gt;
* IMAGESTEM-small5&lt;br /&gt;
* IMAGESTEM-small6&lt;br /&gt;
* IMAGESTEM-small7&lt;br /&gt;
* IMAGESTEM-small8&lt;br /&gt;
* IMAGESTEM-small9&lt;br /&gt;
* IMAGESTEM&lt;br /&gt;
* IMAGESTEM2&lt;br /&gt;
* IMAGESTEM3&lt;br /&gt;
* IMAGESTEM4&lt;br /&gt;
* IMAGESTEM5&lt;br /&gt;
* IMAGESTEM6&lt;br /&gt;
* IMAGESTEM7&lt;br /&gt;
* IMAGESTEM8&lt;br /&gt;
* IMAGESTEM9&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''' Parameters ''' &lt;br /&gt;
* '''ADJACENT''': regexp of terrains that will use -small images&lt;br /&gt;
&lt;br /&gt;
''' Flage management '''&lt;br /&gt;
this is technically an overlay. It is drawn on layer 0 with other overlays and test/set the overlay flag&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=TerrainMacrosWML&amp;diff=36800</id>
		<title>TerrainMacrosWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=TerrainMacrosWML&amp;diff=36800"/>
		<updated>2010-06-18T15:22:45Z</updated>

		<summary type="html">&lt;p&gt;Boucman: /* Image Names */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DevFeature1.9}}&lt;br /&gt;
This page is entirely base on the 1.9 macros, they are very close to the 1.8 macros, but no attempt has been done to document the difference&lt;br /&gt;
&lt;br /&gt;
== Flag Management ==&lt;br /&gt;
This section lists the common flags used by macros and their high level signification&lt;br /&gt;
* '''base''': is set on all hex when the base tile is set.&lt;br /&gt;
* '''overlay''': is set on all hex that have something drawn on the hex itself (i.e not a transition) over the base terrain.&lt;br /&gt;
* '''village''': is set when a village is added on a tile.&lt;br /&gt;
* '''transition-@R*''': is set on a tile which has a transition on it's corresponding side set (i.e if there is a transition with the tile at its north, transition-n will be set) possible values: ''n,ne,nw,s,se,sw'' Also not that the macros handl it in a reciprocal way. in other word if a tile has transition-n set, it's northern neighbour should have transition-s set&lt;br /&gt;
* '''angle_@R*''' : used for bridges, the bridge on this tile. The bridge &amp;quot;actually has&amp;quot; an &amp;quot;exit direction&amp;quot; in the @R direction indicated.&lt;br /&gt;
* '''angleaway_@R*''' : used for bridges, the bridge does NOT have an exit on the given direction, but would be expected to...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''A note about ''angle_'' and ''angleaway_'' flags '''&lt;br /&gt;
&lt;br /&gt;
Suppose we have a ''n-&amp;gt;s'' bridge hex who's ''ne'' neighbour is a ''ne-&amp;gt;sw'' bridge. This mean that the ''n-&amp;gt;s'' is actually a turn in the bridge that should use a graphic depicting a ''s-&amp;gt;ne'' corner.&lt;br /&gt;
&lt;br /&gt;
In that case the tile will have ''angle_s'' and ''angle_ne'' set (the directions where the bridge actually exits) and ''angleaway_n'' (the direction where the bridge would exit according to terrain codes, but doesnt because of overall layout)&lt;br /&gt;
&lt;br /&gt;
== Layer Management ==&lt;br /&gt;
* '''-1000''': default layer for base tiles&lt;br /&gt;
* '''-80''': overlays that should always be drawn under units (like rails etc...)&lt;br /&gt;
* '''0''': default layer for overlays and villages&lt;br /&gt;
Normal units are drawn above layer 0, except if the basey of the tile is &amp;gt; 56 in which case they are drawn below&lt;br /&gt;
* '''1''': used by the base tile of castles/keeps&lt;br /&gt;
Flying/moving units are always drawn over terrain&lt;br /&gt;
== Precedence Management ==&lt;br /&gt;
TBSL&lt;br /&gt;
== Base Management ==&lt;br /&gt;
TBSL&lt;br /&gt;
&lt;br /&gt;
== Macro naming convention ==&lt;br /&gt;
for some common types of tiles, we have a lot of variation of macros. To simplify, they follow a naming convention&lt;br /&gt;
&lt;br /&gt;
=== Macro names ===&lt;br /&gt;
Type is the type of macros (like KEEP,OVERLAY etc...) we are using&lt;br /&gt;
&lt;br /&gt;
* '''TYPE'''''_PLFB'' : puts an image on a tile&lt;br /&gt;
* '''TYPE_RANDOM'''''_LFB'' : puts an image from a random set on a tile&lt;br /&gt;
* '''TYPE_RESTRICTED[23]'''''_PLFB'': puts an image on a tile if the tile has one [two or three] neighbours of a given type&lt;br /&gt;
* '''TYPE_RESTRICTED[23]_RANDOM'''''_PLFB'': combination of above&lt;br /&gt;
* '''TYPE_ROTATION_RESTRICTED[23]'''''_PLFB'': combination of above + the images will be named according to where the neighbours are&lt;br /&gt;
* '''TYPE_ROTATION_RESTRICTED[23]_RANDOM'''''_PLFB'': combination of above&lt;br /&gt;
&lt;br /&gt;
here ''_PLFB'' means any combination of _P _PL _PF etc... will also be correct macro names with the corresponding parameters&lt;br /&gt;
&lt;br /&gt;
each section describing a type will explain what values for PLFB are used for the functions that don't have them as parameters&lt;br /&gt;
&lt;br /&gt;
=== Macro Parameters ===&lt;br /&gt;
&lt;br /&gt;
These macros always have the parameters in the same orders (not all macros have all parameters, see below&lt;br /&gt;
&lt;br /&gt;
 TERRAIN ADJACENT PROB LAYER FLAG BUILDER IMAGESTEM&lt;br /&gt;
&lt;br /&gt;
* '''TERRAIN''' : the type of terrain to put the image on&lt;br /&gt;
* '''ADJACENT''' : ''only for restricted'' the type of neighbours to test for&lt;br /&gt;
* '''PROB''' : ''only for _P'' The probability of the rules generated by the macros of being applied. See the discussion in [[TerrainGraphicsTutorial#Cumulative_Probabilities]] for complications&lt;br /&gt;
* '''LAYER''' : ''only for _L'' The layer that will be used for the generated rules&lt;br /&gt;
* '''FLAG''' : ''only for _F'' A flag to test and set on the tile&lt;br /&gt;
* '''BUILDER''' : ''only for _B'' the builder macro that will be used to create the animations  in the image= field of the generated terrain code. See the dicussion at the begining of the builder section&lt;br /&gt;
* '''IMAGESTEM''': the basename on which filenames will be based.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Image Names ===&lt;br /&gt;
* '''_RANDOM_'''&lt;br /&gt;
** {{BUILDER} {IMAGESTEM} ()}&lt;br /&gt;
** {{BUILDER} {IMAGESTEM}2 ()}&lt;br /&gt;
** {{BUILDER} {IMAGESTEM}3 ()}&lt;br /&gt;
** ''etc up to 11''&lt;br /&gt;
* '''_ROTATION_'''&lt;br /&gt;
** '''1''' : {{BUILDER} {IMAGESTEM} (-@R0)} with @R0 being the orientation of the neighbouring tile&lt;br /&gt;
** '''2''' : {{BUILDER} {IMAGESTEM} (-@R0-@R1)} with @R0 and @R1 being the orientations of the neighbouring tiles&lt;br /&gt;
** '''3''' : {{BUILDER} {IMAGESTEM} (-@R0-@R1-@R2)} with @R0, @R1 and @R2 being the orientations of the neighbouring tiles&lt;br /&gt;
* '''_RANDOM_ + _ROTATION_'''&lt;br /&gt;
** {{BUILDER} {IMAGESTEM}# (-@R#)} ''similar to above with all combinations''&lt;br /&gt;
&lt;br /&gt;
== The TEST_COMPLETE macro ==&lt;br /&gt;
&lt;br /&gt;
there is one more macro which exist for most families of macro&lt;br /&gt;
&lt;br /&gt;
 #define TYPE_COMPLETE_LFB TERRAIN ADJACENT LAYER FLAG BUILDER IMAGESTEM&lt;br /&gt;
    {TYPE_ROTATION_RESTRICTED3_RANDOM_LFB  ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small (-@R0-@R1-@R2)}&lt;br /&gt;
    {TYPE_ROTATION_RESTRICTED2_RANDOM_LFB  ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small (-@R0-@R1)}&lt;br /&gt;
    {TYPE_ROTATION_RESTRICTED_RANDOM_LFB   ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small (-@R0)}&lt;br /&gt;
    {TYPE_RESTRICTED_RANDOM_LFB            ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small ()}&lt;br /&gt;
    {TYPE_SINGLE_RANDOM_LFB                ({TERRAIN})               {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
 #enddef&lt;br /&gt;
&lt;br /&gt;
This macro is a simpler way of handling the most common case of &amp;quot;use a smaller variation when next to some terrains&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* If it has three neighbours, it will try IMAGESTEM-small#-R1-R2-R3&lt;br /&gt;
* if it has two neighbour or the correct image wasn't found, it will try two-sided variations&lt;br /&gt;
* if it has one neighbour or the correct image wasn't found, it will try one sided variations&lt;br /&gt;
* if it has still not found anything, it will try IMAGESTEM-small&lt;br /&gt;
* if it has no neighbour or still hasn't found anything, it will try based on IMAGESTEM&lt;br /&gt;
&lt;br /&gt;
== Image Builder macros ==&lt;br /&gt;
=== The problem ===&lt;br /&gt;
suppose we want to animate a transition with the following line&lt;br /&gt;
 image=image1;image2;image3&lt;br /&gt;
Since it's a transition, we would like to write something like (simplified)&lt;br /&gt;
 {TRANSITION_BASE &amp;lt;parameters&amp;gt; image1;image2;image3}&lt;br /&gt;
However, for a north transition, the macro would expand to something similar to&lt;br /&gt;
 image=image1;image2;image3-n&lt;br /&gt;
Which is wrong, we want the prefix added to all images in the animation&lt;br /&gt;
 image=image1-n;image2-n;image3-n&lt;br /&gt;
To get the result we want, we use macro indirection. In other word, we have a set of macros who take two parameters&lt;br /&gt;
 #define BUILDER IMAGESTEM POSTFIX&lt;br /&gt;
Which are in charge of returning what should be on the right side of the image= So, with the following macro&lt;br /&gt;
 #define MY_BUILDER IMAGESTEM POSTFIX&lt;br /&gt;
 {IMAGESTEM}1{POSTFIX};{IMAGESTEM}2{POSTFIX};{IMAGESTEM}3{POSTFIX};&lt;br /&gt;
and the following code in the TRANSITION_BASE macro&lt;br /&gt;
 image={{BUILDER} {IMAGESTEM} -n}&lt;br /&gt;
a call to&lt;br /&gt;
 {TRANSITION_BASE_B &amp;lt;parameters&amp;gt; MY_BUILDER image}&lt;br /&gt;
would correctly expand.&lt;br /&gt;
&lt;br /&gt;
=== Common parameters for all builders ===&lt;br /&gt;
All builders must have exactly the same parameters&lt;br /&gt;
* IMAGESTEM : the base name of the image from which to build&lt;br /&gt;
* POSTFIX : a postfix to add to all images&lt;br /&gt;
 &lt;br /&gt;
=== IMAGE_SINGLE IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a single image image= line (i.e not animated) mainly used as default value for BUILDER parameter of meta-macros&lt;br /&gt;
=== ANIMATION_03 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a Three image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
=== ANIMATION_04 IMAGESTEM POSTFIX === &lt;br /&gt;
builds a four image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
=== ANIMATION_10 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a ten image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
* IMAGESTEM-A05&lt;br /&gt;
* IMAGESTEM-A06&lt;br /&gt;
* IMAGESTEM-A07&lt;br /&gt;
* IMAGESTEM-A08&lt;br /&gt;
* IMAGESTEM-A09&lt;br /&gt;
* IMAGESTEM-A10&lt;br /&gt;
=== ANIMATION_15 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a fifteen image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
* IMAGESTEM-A05&lt;br /&gt;
* IMAGESTEM-A06&lt;br /&gt;
* IMAGESTEM-A07&lt;br /&gt;
* IMAGESTEM-A08&lt;br /&gt;
* IMAGESTEM-A09&lt;br /&gt;
* IMAGESTEM-A10&lt;br /&gt;
* IMAGESTEM-A11&lt;br /&gt;
* IMAGESTEM-A12&lt;br /&gt;
* IMAGESTEM-A13&lt;br /&gt;
* IMAGESTEM-A14&lt;br /&gt;
* IMAGESTEM-A15&lt;br /&gt;
=== ANIMATION_04_140 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a four image animation, each image being displayed for 140 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
=== ANIMATION_18_70 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a eighteen image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
* IMAGESTEM-A05&lt;br /&gt;
* IMAGESTEM-A06&lt;br /&gt;
* IMAGESTEM-A07&lt;br /&gt;
* IMAGESTEM-A08&lt;br /&gt;
* IMAGESTEM-A09&lt;br /&gt;
* IMAGESTEM-A10&lt;br /&gt;
* IMAGESTEM-A11&lt;br /&gt;
* IMAGESTEM-A12&lt;br /&gt;
* IMAGESTEM-A13&lt;br /&gt;
* IMAGESTEM-A14&lt;br /&gt;
* IMAGESTEM-A15&lt;br /&gt;
* IMAGESTEM-A16&lt;br /&gt;
* IMAGESTEM-A17&lt;br /&gt;
* IMAGESTEM-A18&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Base tile related macros ==&lt;br /&gt;
&lt;br /&gt;
Base terrains have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''TERRAIN_BASE'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': -1000&lt;br /&gt;
* '''FLAG'''': ''base''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Overlay related macros==&lt;br /&gt;
&lt;br /&gt;
Overlays have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''OVERLAY'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': 0&lt;br /&gt;
* '''FLAG'''': ''overlay''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Keep related macros ==&lt;br /&gt;
&lt;br /&gt;
Keeps are base terrains (they use the same flag) but drawn on layer -1&lt;br /&gt;
&lt;br /&gt;
Keeps have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''KEEP_BASE'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': -1&lt;br /&gt;
* '''FLAG'''': ''base''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Village related macros ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
villages have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''VILLAGE'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': 0&lt;br /&gt;
* '''FLAG'''': ''village''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Transition related macros ==&lt;br /&gt;
&lt;br /&gt;
=== Generic Functions ===&lt;br /&gt;
transitions  have most of the macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''TRANSITION'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': -500&lt;br /&gt;
* '''FLAG''': ''transition-@&amp;lt;side&amp;gt;''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However, unlike all previous type of macros, they are related to a ''side'' instead of the whole hex. Thus the following rules&lt;br /&gt;
&lt;br /&gt;
* There are no ROTATION macros. Since they are always side related.&lt;br /&gt;
* All images are named as if they were ROTATION macros since they are all side related&lt;br /&gt;
* There is no SINGLE variation since it doesn't make sense to have it (a side is always relative to two hex)&lt;br /&gt;
* The flags are set and tested on a side related basis. i.e there can be more than one transition per tile, if they don't cover the same direction&lt;br /&gt;
* for RESTRICTED2 and RESTRICTED3, we only check for neighbouring hex of the ADJACENT type. This makes more sense for borders&lt;br /&gt;
* the COMPLETE variant looks as follows&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 #define BORDER_COMPLETE_LFB TERRAIN ADJACENT LAYER FLAG BUILDER IMAGESTEM&lt;br /&gt;
    {BORDER_RESTRICTED3_RANDOM_LFB  ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
    {BORDER_RESTRICTED2_RANDOM_LFB  ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
    {BORDER_RESTRICTED_RANDOM_LFB   ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
    {BORDER_RESTRICTED_RANDOM_LFB   ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
 #enddef&lt;br /&gt;
&lt;br /&gt;
=== DISABLE_BASE_TRANSITIONS TERRAINLIST ===&lt;br /&gt;
This macro will set all transition-@R* on the tile (''n,ne,se,s,sw'')  thus preventing any other transition from being added&lt;br /&gt;
&lt;br /&gt;
'''Flag Management'''&lt;br /&gt;
will set all transition-@R* on the TERRAINLIST tiles&lt;br /&gt;
=== DISABLE_BASE_TRANSITIONS_F TERRAINLIST FLAG ===&lt;br /&gt;
This macro will set all &amp;lt;FLAG&amp;gt;-@R* on the tile (''n,ne,se,s,sw'')  thus preventing any other transition from being added&lt;br /&gt;
&lt;br /&gt;
'''Flag Management'''&lt;br /&gt;
will set all &amp;lt;FLAG&amp;gt;-@R* on the TERRAINLIST tiles&lt;br /&gt;
&lt;br /&gt;
== Terrain Specific ==&lt;br /&gt;
=== SIMPLE_FOREST_TERRAIN TERRAINLIST ADJACENT IMAGESTEM ===&lt;br /&gt;
&lt;br /&gt;
will use an image IMAGESTEM-small# when next to adjacent and IMAGESTEM# anywhere else&lt;br /&gt;
&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-small&lt;br /&gt;
* IMAGESTEM-small2&lt;br /&gt;
* IMAGESTEM-small3&lt;br /&gt;
* IMAGESTEM-small4&lt;br /&gt;
* IMAGESTEM-small5&lt;br /&gt;
* IMAGESTEM-small6&lt;br /&gt;
* IMAGESTEM-small7&lt;br /&gt;
* IMAGESTEM-small8&lt;br /&gt;
* IMAGESTEM-small9&lt;br /&gt;
* IMAGESTEM&lt;br /&gt;
* IMAGESTEM2&lt;br /&gt;
* IMAGESTEM3&lt;br /&gt;
* IMAGESTEM4&lt;br /&gt;
* IMAGESTEM5&lt;br /&gt;
* IMAGESTEM6&lt;br /&gt;
* IMAGESTEM7&lt;br /&gt;
* IMAGESTEM8&lt;br /&gt;
* IMAGESTEM9&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''' Parameters ''' &lt;br /&gt;
* '''ADJACENT''': regexp of terrains that will use -small images&lt;br /&gt;
&lt;br /&gt;
''' Flage management '''&lt;br /&gt;
this is technically an overlay. It is drawn on layer 0 with other overlays and test/set the overlay flag&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=TerrainMacrosWML&amp;diff=36799</id>
		<title>TerrainMacrosWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=TerrainMacrosWML&amp;diff=36799"/>
		<updated>2010-06-18T14:15:31Z</updated>

		<summary type="html">&lt;p&gt;Boucman: /* Flag Management */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DevFeature1.9}}&lt;br /&gt;
This page is entirely base on the 1.9 macros, they are very close to the 1.8 macros, but no attempt has been done to document the difference&lt;br /&gt;
&lt;br /&gt;
== Flag Management ==&lt;br /&gt;
This section lists the common flags used by macros and their high level signification&lt;br /&gt;
* '''base''': is set on all hex when the base tile is set.&lt;br /&gt;
* '''overlay''': is set on all hex that have something drawn on the hex itself (i.e not a transition) over the base terrain.&lt;br /&gt;
* '''village''': is set when a village is added on a tile.&lt;br /&gt;
* '''transition-@R*''': is set on a tile which has a transition on it's corresponding side set (i.e if there is a transition with the tile at its north, transition-n will be set) possible values: ''n,ne,nw,s,se,sw'' Also not that the macros handl it in a reciprocal way. in other word if a tile has transition-n set, it's northern neighbour should have transition-s set&lt;br /&gt;
* '''angle_@R*''' : used for bridges, the bridge on this tile. The bridge &amp;quot;actually has&amp;quot; an &amp;quot;exit direction&amp;quot; in the @R direction indicated.&lt;br /&gt;
* '''angleaway_@R*''' : used for bridges, the bridge does NOT have an exit on the given direction, but would be expected to...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''A note about ''angle_'' and ''angleaway_'' flags '''&lt;br /&gt;
&lt;br /&gt;
Suppose we have a ''n-&amp;gt;s'' bridge hex who's ''ne'' neighbour is a ''ne-&amp;gt;sw'' bridge. This mean that the ''n-&amp;gt;s'' is actually a turn in the bridge that should use a graphic depicting a ''s-&amp;gt;ne'' corner.&lt;br /&gt;
&lt;br /&gt;
In that case the tile will have ''angle_s'' and ''angle_ne'' set (the directions where the bridge actually exits) and ''angleaway_n'' (the direction where the bridge would exit according to terrain codes, but doesnt because of overall layout)&lt;br /&gt;
&lt;br /&gt;
== Layer Management ==&lt;br /&gt;
* '''-1000''': default layer for base tiles&lt;br /&gt;
* '''-80''': overlays that should always be drawn under units (like rails etc...)&lt;br /&gt;
* '''0''': default layer for overlays and villages&lt;br /&gt;
Normal units are drawn above layer 0, except if the basey of the tile is &amp;gt; 56 in which case they are drawn below&lt;br /&gt;
* '''1''': used by the base tile of castles/keeps&lt;br /&gt;
Flying/moving units are always drawn over terrain&lt;br /&gt;
== Precedence Management ==&lt;br /&gt;
TBSL&lt;br /&gt;
== Base Management ==&lt;br /&gt;
TBSL&lt;br /&gt;
&lt;br /&gt;
== Macro naming convention ==&lt;br /&gt;
for some common types of tiles, we have a lot of variation of macros. To simplify, they follow a naming convention&lt;br /&gt;
&lt;br /&gt;
=== Macro names ===&lt;br /&gt;
Type is the type of macros (like KEEP,OVERLAY etc...) we are using&lt;br /&gt;
&lt;br /&gt;
* '''TYPE'''''_PLFB'' : puts an image on a tile&lt;br /&gt;
* '''TYPE_RANDOM'''''_LFB'' : puts an image from a random set on a tile&lt;br /&gt;
* '''TYPE_RESTRICTED[23]'''''_PLFB'': puts an image on a tile if the tile has one [two or three] neighbours of a given type&lt;br /&gt;
* '''TYPE_RESTRICTED[23]_RANDOM'''''_PLFB'': combination of above&lt;br /&gt;
* '''TYPE_ROTATION_RESTRICTED[23]'''''_PLFB'': combination of above + the images will be named according to where the neighbours are&lt;br /&gt;
* '''TYPE_ROTATION_RESTRICTED[23]_RANDOM'''''_PLFB'': combination of above&lt;br /&gt;
&lt;br /&gt;
here ''_PLFB'' means any combination of _P _PL _PF etc... will also be correct macro names with the corresponding parameters&lt;br /&gt;
&lt;br /&gt;
each section describing a type will explain what values for PLFB are used for the functions that don't have them as parameters&lt;br /&gt;
&lt;br /&gt;
=== Macro Parameters ===&lt;br /&gt;
&lt;br /&gt;
These macros always have the parameters in the same orders (not all macros have all parameters, see below&lt;br /&gt;
&lt;br /&gt;
 TERRAIN ADJACENT PROB LAYER FLAG BUILDER IMAGESTEM&lt;br /&gt;
&lt;br /&gt;
* '''TERRAIN''' : the type of terrain to put the image on&lt;br /&gt;
* '''ADJACENT''' : ''only for restricted'' the type of neighbours to test for&lt;br /&gt;
* '''PROB''' : ''only for _P'' The probability of the rules generated by the macros of being applied. See the discussion in [[TerrainGraphicsTutorial#Cumulative_Probabilities]] for complications&lt;br /&gt;
* '''LAYER''' : ''only for _L'' The layer that will be used for the generated rules&lt;br /&gt;
* '''FLAG''' : ''only for _F'' A flag to test and set on the tile&lt;br /&gt;
* '''BUILDER''' : ''only for _B'' the builder macro that will be used to create the animations  in the image= field of the generated terrain code. See the dicussion at the begining of the builder section&lt;br /&gt;
* '''IMAGESTEM''': the basename on which filenames will be based.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Image Names ===&lt;br /&gt;
* '''_RANDOM_'''&lt;br /&gt;
** {{BUILDER} {IMAGESTEM} ()}&lt;br /&gt;
** {{BUILDER} {IMAGESTEM}2 ()}&lt;br /&gt;
** {{BUILDER} {IMAGESTEM}3 ()}&lt;br /&gt;
** ''etc up to 11''&lt;br /&gt;
* '''_ROTATION_'''&lt;br /&gt;
** '''1''' : {{BUILDER} {IMAGESTEM} (-@R0)} with @R0 being the orientation of the neighbouring tile&lt;br /&gt;
** '''2''' : {{BUILDER} {IMAGESTEM} (-@R0-@R1)} with @R0 and @R1 being the orientations of the neighbouring tiles&lt;br /&gt;
** '''3''' : {{BUILDER} {IMAGESTEM} (-@R0-@R1-@R2)} with @R0, @R1 and @R2 being the orientations of the neighbouring tiles&lt;br /&gt;
* '''_RANDOM_ + _ROTATION_'''&lt;br /&gt;
** {{BUILDER} {IMAGESTEM}# (-@R#)} ''similar to above with all combinations''&lt;br /&gt;
&lt;br /&gt;
== The TEST_COMPLETE macro ==&lt;br /&gt;
&lt;br /&gt;
there is one more macro which exist for most families of macro&lt;br /&gt;
&lt;br /&gt;
 #define TYPE_COMPLETE_LFB TERRAIN ADJACENT LAYER FLAG BUILDER IMAGESTEM&lt;br /&gt;
    {TYPE_ROTATION_RESTRICTED3_RANDOM_LFB  ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small (-@R0-@R1-@R2)}&lt;br /&gt;
    {TYPE_ROTATION_RESTRICTED2_RANDOM_LFB  ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small (-@R0-@R1)}&lt;br /&gt;
    {TYPE_ROTATION_RESTRICTED_RANDOM_LFB   ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small (-@R0)}&lt;br /&gt;
    {TYPE_RESTRICTED_RANDOM_LFB            ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small ()}&lt;br /&gt;
    {TYPE_SINGLE_RANDOM_LFB                ({TERRAIN})               {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
 #enddef&lt;br /&gt;
&lt;br /&gt;
This macro is a simpler way of handling the most common case of &amp;quot;use a smaller variation when next to some terrains&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* If it has three neighbours, it will try IMAGESTEM-small#-R1-R2-R3&lt;br /&gt;
* if it has two neighbour or the correct image wasn't found, it will try two-sided variations&lt;br /&gt;
* if it has one neighbour or the correct image wasn't found, it will try one sided variations&lt;br /&gt;
* if it has still not found anything, it will try IMAGESTEM-small&lt;br /&gt;
* if it has no neighbour or still hasn't found anything, it will try based on IMAGESTEM&lt;br /&gt;
&lt;br /&gt;
== Image Builder macros ==&lt;br /&gt;
=== The problem ===&lt;br /&gt;
suppose we want to animate a transition with the following line&lt;br /&gt;
 image=image1;image2;image3&lt;br /&gt;
Since it's a transition, we would like to write something like (simplified)&lt;br /&gt;
 {TRANSITION_BASE &amp;lt;parameters&amp;gt; image1;image2;image3}&lt;br /&gt;
However, for a north transition, the macro would expand to something similar to&lt;br /&gt;
 image=image1;image2;image3-n&lt;br /&gt;
Which is wrong, we want the prefix added to all images in the animation&lt;br /&gt;
 image=image1-n;image2-n;image3-n&lt;br /&gt;
To get the result we want, we use macro indirection. In other word, we have a set of macros who take two parameters&lt;br /&gt;
 #define BUILDER IMAGESTEM POSTFIX&lt;br /&gt;
Which are in charge of returning what should be on the right side of the image= So, with the following macro&lt;br /&gt;
 #define MY_BUILDER IMAGESTEM POSTFIX&lt;br /&gt;
 {IMAGESTEM}1{POSTFIX};{IMAGESTEM}2{POSTFIX};{IMAGESTEM}3{POSTFIX};&lt;br /&gt;
and the following code in the TRANSITION_BASE macro&lt;br /&gt;
 image={{BUILDER} {IMAGESTEM} -n}&lt;br /&gt;
a call to&lt;br /&gt;
 {TRANSITION_BASE_B &amp;lt;parameters&amp;gt; MY_BUILDER image}&lt;br /&gt;
would correctly expand.&lt;br /&gt;
&lt;br /&gt;
=== Common parameters for all builders ===&lt;br /&gt;
All builders must have exactly the same parameters&lt;br /&gt;
* IMAGESTEM : the base name of the image from which to build&lt;br /&gt;
* POSTFIX : a postfix to add to all images&lt;br /&gt;
 &lt;br /&gt;
=== IMAGE_SINGLE IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a single image image= line (i.e not animated) mainly used as default value for BUILDER parameter of meta-macros&lt;br /&gt;
=== ANIMATION_03 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a Three image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
=== ANIMATION_04 IMAGESTEM POSTFIX === &lt;br /&gt;
builds a four image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
=== ANIMATION_10 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a ten image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
* IMAGESTEM-A05&lt;br /&gt;
* IMAGESTEM-A06&lt;br /&gt;
* IMAGESTEM-A07&lt;br /&gt;
* IMAGESTEM-A08&lt;br /&gt;
* IMAGESTEM-A09&lt;br /&gt;
* IMAGESTEM-A10&lt;br /&gt;
=== ANIMATION_15 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a fifteen image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
* IMAGESTEM-A05&lt;br /&gt;
* IMAGESTEM-A06&lt;br /&gt;
* IMAGESTEM-A07&lt;br /&gt;
* IMAGESTEM-A08&lt;br /&gt;
* IMAGESTEM-A09&lt;br /&gt;
* IMAGESTEM-A10&lt;br /&gt;
* IMAGESTEM-A11&lt;br /&gt;
* IMAGESTEM-A12&lt;br /&gt;
* IMAGESTEM-A13&lt;br /&gt;
* IMAGESTEM-A14&lt;br /&gt;
* IMAGESTEM-A15&lt;br /&gt;
=== ANIMATION_04_140 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a four image animation, each image being displayed for 140 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
=== ANIMATION_18_70 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a eighteen image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
* IMAGESTEM-A05&lt;br /&gt;
* IMAGESTEM-A06&lt;br /&gt;
* IMAGESTEM-A07&lt;br /&gt;
* IMAGESTEM-A08&lt;br /&gt;
* IMAGESTEM-A09&lt;br /&gt;
* IMAGESTEM-A10&lt;br /&gt;
* IMAGESTEM-A11&lt;br /&gt;
* IMAGESTEM-A12&lt;br /&gt;
* IMAGESTEM-A13&lt;br /&gt;
* IMAGESTEM-A14&lt;br /&gt;
* IMAGESTEM-A15&lt;br /&gt;
* IMAGESTEM-A16&lt;br /&gt;
* IMAGESTEM-A17&lt;br /&gt;
* IMAGESTEM-A18&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Base tile related macros ==&lt;br /&gt;
&lt;br /&gt;
Base terrains have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''TERRAIN_BASE'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': -1000&lt;br /&gt;
* '''FLAG'''': ''base''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Overlay related macros==&lt;br /&gt;
&lt;br /&gt;
Overlays have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''OVERLAY'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': 0&lt;br /&gt;
* '''FLAG'''': ''overlay''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Keep related macros ==&lt;br /&gt;
&lt;br /&gt;
Keeps are base terrains (they use the same flag) but drawn on layer -1&lt;br /&gt;
&lt;br /&gt;
Keeps have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''KEEP_BASE'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': -1&lt;br /&gt;
* '''FLAG'''': ''base''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Village related macros ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
villages have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''VILLAGE'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': 0&lt;br /&gt;
* '''FLAG'''': ''village''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Transition related macros ==&lt;br /&gt;
&lt;br /&gt;
=== Generic Functions ===&lt;br /&gt;
transitions  have most of the macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''TRANSITION'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': -500&lt;br /&gt;
* '''FLAG''': ''transition-@&amp;lt;side&amp;gt;''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However, unlike all previous type of macros, they are related to a ''side'' instead of the whole hex. Thus the following rules&lt;br /&gt;
&lt;br /&gt;
* There are no ROTATION macros. Since they are always side related, they are always transition like&lt;br /&gt;
* All images are named as if they were ROTATION macros (since they are painting on a side&lt;br /&gt;
* The flags are set and tested on a side related basis. i.e there can be more than one transition per tile, if they don't cover the same direction&lt;br /&gt;
* the non-RESTRICTED variations don't exist, they don't really make sense&lt;br /&gt;
* for RESTRICTED2 and RESTRICTED3, we only check for neighbouring hex of the ADJACENT type. This makes more sense for borders&lt;br /&gt;
* the COMPLETE variant looks as follows&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 #define BORDER_COMPLETE_LFB TERRAIN ADJACENT LAYER FLAG BUILDER IMAGESTEM&lt;br /&gt;
    {BORDER_RESTRICTED3_RANDOM_LFB  ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
    {BORDER_RESTRICTED2_RANDOM_LFB  ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
    {BORDER_RESTRICTED_RANDOM_LFB   ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
    {BORDER_RESTRICTED_RANDOM_LFB   ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
    {BORDER_SINGLE_RANDOM_LFB       ({TERRAIN})               {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
 #enddef&lt;br /&gt;
&lt;br /&gt;
=== DISABLE_BASE_TRANSITIONS TERRAINLIST ===&lt;br /&gt;
This macro will set all transition-@R* on the tile (''n,ne,se,s,sw'')  thus preventing any other transition from being added&lt;br /&gt;
&lt;br /&gt;
'''Flag Management'''&lt;br /&gt;
will set all transition-@R* on the TERRAINLIST tiles&lt;br /&gt;
=== DISABLE_BASE_TRANSITIONS_F TERRAINLIST FLAG ===&lt;br /&gt;
This macro will set all &amp;lt;FLAG&amp;gt;-@R* on the tile (''n,ne,se,s,sw'')  thus preventing any other transition from being added&lt;br /&gt;
&lt;br /&gt;
'''Flag Management'''&lt;br /&gt;
will set all &amp;lt;FLAG&amp;gt;-@R* on the TERRAINLIST tiles&lt;br /&gt;
&lt;br /&gt;
== Terrain Specific ==&lt;br /&gt;
=== SIMPLE_FOREST_TERRAIN TERRAINLIST ADJACENT IMAGESTEM ===&lt;br /&gt;
&lt;br /&gt;
will use an image IMAGESTEM-small# when next to adjacent and IMAGESTEM# anywhere else&lt;br /&gt;
&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-small&lt;br /&gt;
* IMAGESTEM-small2&lt;br /&gt;
* IMAGESTEM-small3&lt;br /&gt;
* IMAGESTEM-small4&lt;br /&gt;
* IMAGESTEM-small5&lt;br /&gt;
* IMAGESTEM-small6&lt;br /&gt;
* IMAGESTEM-small7&lt;br /&gt;
* IMAGESTEM-small8&lt;br /&gt;
* IMAGESTEM-small9&lt;br /&gt;
* IMAGESTEM&lt;br /&gt;
* IMAGESTEM2&lt;br /&gt;
* IMAGESTEM3&lt;br /&gt;
* IMAGESTEM4&lt;br /&gt;
* IMAGESTEM5&lt;br /&gt;
* IMAGESTEM6&lt;br /&gt;
* IMAGESTEM7&lt;br /&gt;
* IMAGESTEM8&lt;br /&gt;
* IMAGESTEM9&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''' Parameters ''' &lt;br /&gt;
* '''ADJACENT''': regexp of terrains that will use -small images&lt;br /&gt;
&lt;br /&gt;
''' Flage management '''&lt;br /&gt;
this is technically an overlay. It is drawn on layer 0 with other overlays and test/set the overlay flag&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=TerrainMacrosWML&amp;diff=36766</id>
		<title>TerrainMacrosWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=TerrainMacrosWML&amp;diff=36766"/>
		<updated>2010-06-13T17:12:08Z</updated>

		<summary type="html">&lt;p&gt;Boucman: /* Image Names */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DevFeature1.9}}&lt;br /&gt;
This page is entirely base on the 1.9 macros, they are very close to the 1.8 macros, but no attempt has been done to document the difference&lt;br /&gt;
&lt;br /&gt;
== Flag Management ==&lt;br /&gt;
This section lists the common flags used by macros and their high level signification&lt;br /&gt;
* '''base''': is set on all hex when the base tile is set.&lt;br /&gt;
* '''overlay''': is set on all hex that have something drawn on the hex itself (i.e not a transition) over the base terrain.&lt;br /&gt;
* '''village''': is set when a village is added on a tile.&lt;br /&gt;
* '''transition-@R*''': is set on a tile which has a transition on it's corresponding side set (i.e if there is a transition with the tile at its north, transition-n will be set) possible values: ''n,ne,nw,s,se,sw'' Also not that the macros handl it in a reciprocal way. in other word if a tile has transition-n set, it's northern neighbour should have transition-s set&lt;br /&gt;
* '''angle_@R*''' : used for bridges, the bridge on this tile. The bridge has an &amp;quot;exit direction&amp;quot; in the @R direction indicated.&lt;br /&gt;
* '''angleaway_@R*''' : used for bridges, the bridge does NOT have an exit on the given direction&lt;br /&gt;
&lt;br /&gt;
== Layer Management ==&lt;br /&gt;
* '''-1000''': default layer for base tiles&lt;br /&gt;
* '''-80''': overlays that should always be drawn under units (like rails etc...)&lt;br /&gt;
* '''0''': default layer for overlays and villages&lt;br /&gt;
Normal units are drawn above layer 0, except if the basey of the tile is &amp;gt; 56 in which case they are drawn below&lt;br /&gt;
* '''1''': used by the base tile of castles/keeps&lt;br /&gt;
Flying/moving units are always drawn over terrain&lt;br /&gt;
== Precedence Management ==&lt;br /&gt;
TBSL&lt;br /&gt;
== Base Management ==&lt;br /&gt;
TBSL&lt;br /&gt;
&lt;br /&gt;
== Macro naming convention ==&lt;br /&gt;
for some common types of tiles, we have a lot of variation of macros. To simplify, they follow a naming convention&lt;br /&gt;
&lt;br /&gt;
=== Macro names ===&lt;br /&gt;
Type is the type of macros (like KEEP,OVERLAY etc...) we are using&lt;br /&gt;
&lt;br /&gt;
* '''TYPE'''''_PLFB'' : puts an image on a tile&lt;br /&gt;
* '''TYPE_RANDOM'''''_LFB'' : puts an image from a random set on a tile&lt;br /&gt;
* '''TYPE_RESTRICTED[23]'''''_PLFB'': puts an image on a tile if the tile has one [two or three] neighbours of a given type&lt;br /&gt;
* '''TYPE_RESTRICTED[23]_RANDOM'''''_PLFB'': combination of above&lt;br /&gt;
* '''TYPE_ROTATION_RESTRICTED[23]'''''_PLFB'': combination of above + the images will be named according to where the neighbours are&lt;br /&gt;
* '''TYPE_ROTATION_RESTRICTED[23]_RANDOM'''''_PLFB'': combination of above&lt;br /&gt;
&lt;br /&gt;
here ''_PLFB'' means any combination of _P _PL _PF etc... will also be correct macro names with the corresponding parameters&lt;br /&gt;
&lt;br /&gt;
each section describing a type will explain what values for PLFB are used for the functions that don't have them as parameters&lt;br /&gt;
&lt;br /&gt;
=== Macro Parameters ===&lt;br /&gt;
&lt;br /&gt;
These macros always have the parameters in the same orders (not all macros have all parameters, see below&lt;br /&gt;
&lt;br /&gt;
 TERRAIN ADJACENT PROB LAYER FLAG BUILDER IMAGESTEM&lt;br /&gt;
&lt;br /&gt;
* '''TERRAIN''' : the type of terrain to put the image on&lt;br /&gt;
* '''ADJACENT''' : ''only for restricted'' the type of neighbours to test for&lt;br /&gt;
* '''PROB''' : ''only for _P'' The probability of the rules generated by the macros of being applied. See the discussion in [[TerrainGraphicsTutorial#Cumulative_Probabilities]] for complications&lt;br /&gt;
* '''LAYER''' : ''only for _L'' The layer that will be used for the generated rules&lt;br /&gt;
* '''FLAG''' : ''only for _F'' A flag to test and set on the tile&lt;br /&gt;
* '''BUILDER''' : ''only for _B'' the builder macro that will be used to create the animations  in the image= field of the generated terrain code. See the dicussion at the begining of the builder section&lt;br /&gt;
* '''IMAGESTEM''': the basename on which filenames will be based.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Image Names ===&lt;br /&gt;
* '''_RANDOM_'''&lt;br /&gt;
** {{BUILDER} {IMAGESTEM} ()}&lt;br /&gt;
** {{BUILDER} {IMAGESTEM}2 ()}&lt;br /&gt;
** {{BUILDER} {IMAGESTEM}3 ()}&lt;br /&gt;
** ''etc up to 11''&lt;br /&gt;
* '''_ROTATION_'''&lt;br /&gt;
** '''1''' : {{BUILDER} {IMAGESTEM} (-@R0)} with @R0 being the orientation of the neighbouring tile&lt;br /&gt;
** '''2''' : {{BUILDER} {IMAGESTEM} (-@R0-@R1)} with @R0 and @R1 being the orientations of the neighbouring tiles&lt;br /&gt;
** '''3''' : {{BUILDER} {IMAGESTEM} (-@R0-@R1-@R2)} with @R0, @R1 and @R2 being the orientations of the neighbouring tiles&lt;br /&gt;
* '''_RANDOM_ + _ROTATION_'''&lt;br /&gt;
** {{BUILDER} {IMAGESTEM}# (-@R#)} ''similar to above with all combinations''&lt;br /&gt;
&lt;br /&gt;
== The TEST_COMPLETE macro ==&lt;br /&gt;
&lt;br /&gt;
there is one more macro which exist for most families of macro&lt;br /&gt;
&lt;br /&gt;
 #define TYPE_COMPLETE_LFB TERRAIN ADJACENT LAYER FLAG BUILDER IMAGESTEM&lt;br /&gt;
    {TYPE_ROTATION_RESTRICTED3_RANDOM_LFB  ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small (-@R0-@R1-@R2)}&lt;br /&gt;
    {TYPE_ROTATION_RESTRICTED2_RANDOM_LFB  ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small (-@R0-@R1)}&lt;br /&gt;
    {TYPE_ROTATION_RESTRICTED_RANDOM_LFB   ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small (-@R0)}&lt;br /&gt;
    {TYPE_RESTRICTED_RANDOM_LFB            ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small ()}&lt;br /&gt;
    {TYPE_SINGLE_RANDOM_LFB                ({TERRAIN})               {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
 #enddef&lt;br /&gt;
&lt;br /&gt;
This macro is a simpler way of handling the most common case of &amp;quot;use a smaller variation when next to some terrains&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* If it has three neighbours, it will try IMAGESTEM-small#-R1-R2-R3&lt;br /&gt;
* if it has two neighbour or the correct image wasn't found, it will try two-sided variations&lt;br /&gt;
* if it has one neighbour or the correct image wasn't found, it will try one sided variations&lt;br /&gt;
* if it has still not found anything, it will try IMAGESTEM-small&lt;br /&gt;
* if it has no neighbour or still hasn't found anything, it will try based on IMAGESTEM&lt;br /&gt;
&lt;br /&gt;
== Image Builder macros ==&lt;br /&gt;
=== The problem ===&lt;br /&gt;
suppose we want to animate a transition with the following line&lt;br /&gt;
 image=image1;image2;image3&lt;br /&gt;
Since it's a transition, we would like to write something like (simplified)&lt;br /&gt;
 {TRANSITION_BASE &amp;lt;parameters&amp;gt; image1;image2;image3}&lt;br /&gt;
However, for a north transition, the macro would expand to something similar to&lt;br /&gt;
 image=image1;image2;image3-n&lt;br /&gt;
Which is wrong, we want the prefix added to all images in the animation&lt;br /&gt;
 image=image1-n;image2-n;image3-n&lt;br /&gt;
To get the result we want, we use macro indirection. In other word, we have a set of macros who take two parameters&lt;br /&gt;
 #define BUILDER IMAGESTEM POSTFIX&lt;br /&gt;
Which are in charge of returning what should be on the right side of the image= So, with the following macro&lt;br /&gt;
 #define MY_BUILDER IMAGESTEM POSTFIX&lt;br /&gt;
 {IMAGESTEM}1{POSTFIX};{IMAGESTEM}2{POSTFIX};{IMAGESTEM}3{POSTFIX};&lt;br /&gt;
and the following code in the TRANSITION_BASE macro&lt;br /&gt;
 image={{BUILDER} {IMAGESTEM} -n}&lt;br /&gt;
a call to&lt;br /&gt;
 {TRANSITION_BASE_B &amp;lt;parameters&amp;gt; MY_BUILDER image}&lt;br /&gt;
would correctly expand.&lt;br /&gt;
&lt;br /&gt;
=== Common parameters for all builders ===&lt;br /&gt;
All builders must have exactly the same parameters&lt;br /&gt;
* IMAGESTEM : the base name of the image from which to build&lt;br /&gt;
* POSTFIX : a postfix to add to all images&lt;br /&gt;
 &lt;br /&gt;
=== IMAGE_SINGLE IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a single image image= line (i.e not animated) mainly used as default value for BUILDER parameter of meta-macros&lt;br /&gt;
=== ANIMATION_03 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a Three image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
=== ANIMATION_04 IMAGESTEM POSTFIX === &lt;br /&gt;
builds a four image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
=== ANIMATION_10 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a ten image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
* IMAGESTEM-A05&lt;br /&gt;
* IMAGESTEM-A06&lt;br /&gt;
* IMAGESTEM-A07&lt;br /&gt;
* IMAGESTEM-A08&lt;br /&gt;
* IMAGESTEM-A09&lt;br /&gt;
* IMAGESTEM-A10&lt;br /&gt;
=== ANIMATION_15 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a fifteen image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
* IMAGESTEM-A05&lt;br /&gt;
* IMAGESTEM-A06&lt;br /&gt;
* IMAGESTEM-A07&lt;br /&gt;
* IMAGESTEM-A08&lt;br /&gt;
* IMAGESTEM-A09&lt;br /&gt;
* IMAGESTEM-A10&lt;br /&gt;
* IMAGESTEM-A11&lt;br /&gt;
* IMAGESTEM-A12&lt;br /&gt;
* IMAGESTEM-A13&lt;br /&gt;
* IMAGESTEM-A14&lt;br /&gt;
* IMAGESTEM-A15&lt;br /&gt;
=== ANIMATION_04_140 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a four image animation, each image being displayed for 140 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
=== ANIMATION_18_70 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a eighteen image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
* IMAGESTEM-A05&lt;br /&gt;
* IMAGESTEM-A06&lt;br /&gt;
* IMAGESTEM-A07&lt;br /&gt;
* IMAGESTEM-A08&lt;br /&gt;
* IMAGESTEM-A09&lt;br /&gt;
* IMAGESTEM-A10&lt;br /&gt;
* IMAGESTEM-A11&lt;br /&gt;
* IMAGESTEM-A12&lt;br /&gt;
* IMAGESTEM-A13&lt;br /&gt;
* IMAGESTEM-A14&lt;br /&gt;
* IMAGESTEM-A15&lt;br /&gt;
* IMAGESTEM-A16&lt;br /&gt;
* IMAGESTEM-A17&lt;br /&gt;
* IMAGESTEM-A18&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Base tile related macros ==&lt;br /&gt;
&lt;br /&gt;
Base terrains have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''TERRAIN_BASE'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': -1000&lt;br /&gt;
* '''FLAG'''': ''base''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Overlay related macros==&lt;br /&gt;
&lt;br /&gt;
Overlays have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''OVERLAY'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': 0&lt;br /&gt;
* '''FLAG'''': ''overlay''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Keep related macros ==&lt;br /&gt;
&lt;br /&gt;
Keeps are base terrains (they use the same flag) but drawn on layer -1&lt;br /&gt;
&lt;br /&gt;
Keeps have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''KEEP_BASE'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': -1&lt;br /&gt;
* '''FLAG'''': ''base''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Village related macros ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
villages have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''VILLAGE'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': 0&lt;br /&gt;
* '''FLAG'''': ''village''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Transition related macros ==&lt;br /&gt;
&lt;br /&gt;
=== Generic Functions ===&lt;br /&gt;
transitions  have most of the macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''TRANSITION'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': -500&lt;br /&gt;
* '''FLAG''': ''transition-@&amp;lt;side&amp;gt;''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However, unlike all previous type of macros, they are related to a ''side'' instead of the whole hex. Thus the following rules&lt;br /&gt;
&lt;br /&gt;
* There are no ROTATION macros. Since they are always side related, they are always transition like&lt;br /&gt;
* All images are named as if they were ROTATION macros (since they are painting on a side&lt;br /&gt;
* The flags are set and tested on a side related basis. i.e there can be more than one transition per tile, if they don't cover the same direction&lt;br /&gt;
* the non-RESTRICTED variations don't exist, they don't really make sense&lt;br /&gt;
* for RESTRICTED2 and RESTRICTED3, we only check for neighbouring hex of the ADJACENT type. This makes more sense for borders&lt;br /&gt;
* the COMPLETE variant looks as follows&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 #define BORDER_COMPLETE_LFB TERRAIN ADJACENT LAYER FLAG BUILDER IMAGESTEM&lt;br /&gt;
    {BORDER_RESTRICTED3_RANDOM_LFB  ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
    {BORDER_RESTRICTED2_RANDOM_LFB  ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
    {BORDER_RESTRICTED_RANDOM_LFB   ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
    {BORDER_RESTRICTED_RANDOM_LFB   ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
    {BORDER_SINGLE_RANDOM_LFB       ({TERRAIN})               {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
 #enddef&lt;br /&gt;
&lt;br /&gt;
=== DISABLE_BASE_TRANSITIONS TERRAINLIST ===&lt;br /&gt;
This macro will set all transition-@R* on the tile (''n,ne,se,s,sw'')  thus preventing any other transition from being added&lt;br /&gt;
&lt;br /&gt;
'''Flag Management'''&lt;br /&gt;
will set all transition-@R* on the TERRAINLIST tiles&lt;br /&gt;
=== DISABLE_BASE_TRANSITIONS_F TERRAINLIST FLAG ===&lt;br /&gt;
This macro will set all &amp;lt;FLAG&amp;gt;-@R* on the tile (''n,ne,se,s,sw'')  thus preventing any other transition from being added&lt;br /&gt;
&lt;br /&gt;
'''Flag Management'''&lt;br /&gt;
will set all &amp;lt;FLAG&amp;gt;-@R* on the TERRAINLIST tiles&lt;br /&gt;
&lt;br /&gt;
== Terrain Specific ==&lt;br /&gt;
=== SIMPLE_FOREST_TERRAIN TERRAINLIST ADJACENT IMAGESTEM ===&lt;br /&gt;
&lt;br /&gt;
will use an image IMAGESTEM-small# when next to adjacent and IMAGESTEM# anywhere else&lt;br /&gt;
&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-small&lt;br /&gt;
* IMAGESTEM-small2&lt;br /&gt;
* IMAGESTEM-small3&lt;br /&gt;
* IMAGESTEM-small4&lt;br /&gt;
* IMAGESTEM-small5&lt;br /&gt;
* IMAGESTEM-small6&lt;br /&gt;
* IMAGESTEM-small7&lt;br /&gt;
* IMAGESTEM-small8&lt;br /&gt;
* IMAGESTEM-small9&lt;br /&gt;
* IMAGESTEM&lt;br /&gt;
* IMAGESTEM2&lt;br /&gt;
* IMAGESTEM3&lt;br /&gt;
* IMAGESTEM4&lt;br /&gt;
* IMAGESTEM5&lt;br /&gt;
* IMAGESTEM6&lt;br /&gt;
* IMAGESTEM7&lt;br /&gt;
* IMAGESTEM8&lt;br /&gt;
* IMAGESTEM9&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''' Parameters ''' &lt;br /&gt;
* '''ADJACENT''': regexp of terrains that will use -small images&lt;br /&gt;
&lt;br /&gt;
''' Flage management '''&lt;br /&gt;
this is technically an overlay. It is drawn on layer 0 with other overlays and test/set the overlay flag&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=TerrainMacrosWML&amp;diff=36765</id>
		<title>TerrainMacrosWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=TerrainMacrosWML&amp;diff=36765"/>
		<updated>2010-06-13T17:11:51Z</updated>

		<summary type="html">&lt;p&gt;Boucman: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DevFeature1.9}}&lt;br /&gt;
This page is entirely base on the 1.9 macros, they are very close to the 1.8 macros, but no attempt has been done to document the difference&lt;br /&gt;
&lt;br /&gt;
== Flag Management ==&lt;br /&gt;
This section lists the common flags used by macros and their high level signification&lt;br /&gt;
* '''base''': is set on all hex when the base tile is set.&lt;br /&gt;
* '''overlay''': is set on all hex that have something drawn on the hex itself (i.e not a transition) over the base terrain.&lt;br /&gt;
* '''village''': is set when a village is added on a tile.&lt;br /&gt;
* '''transition-@R*''': is set on a tile which has a transition on it's corresponding side set (i.e if there is a transition with the tile at its north, transition-n will be set) possible values: ''n,ne,nw,s,se,sw'' Also not that the macros handl it in a reciprocal way. in other word if a tile has transition-n set, it's northern neighbour should have transition-s set&lt;br /&gt;
* '''angle_@R*''' : used for bridges, the bridge on this tile. The bridge has an &amp;quot;exit direction&amp;quot; in the @R direction indicated.&lt;br /&gt;
* '''angleaway_@R*''' : used for bridges, the bridge does NOT have an exit on the given direction&lt;br /&gt;
&lt;br /&gt;
== Layer Management ==&lt;br /&gt;
* '''-1000''': default layer for base tiles&lt;br /&gt;
* '''-80''': overlays that should always be drawn under units (like rails etc...)&lt;br /&gt;
* '''0''': default layer for overlays and villages&lt;br /&gt;
Normal units are drawn above layer 0, except if the basey of the tile is &amp;gt; 56 in which case they are drawn below&lt;br /&gt;
* '''1''': used by the base tile of castles/keeps&lt;br /&gt;
Flying/moving units are always drawn over terrain&lt;br /&gt;
== Precedence Management ==&lt;br /&gt;
TBSL&lt;br /&gt;
== Base Management ==&lt;br /&gt;
TBSL&lt;br /&gt;
&lt;br /&gt;
== Macro naming convention ==&lt;br /&gt;
for some common types of tiles, we have a lot of variation of macros. To simplify, they follow a naming convention&lt;br /&gt;
&lt;br /&gt;
=== Macro names ===&lt;br /&gt;
Type is the type of macros (like KEEP,OVERLAY etc...) we are using&lt;br /&gt;
&lt;br /&gt;
* '''TYPE'''''_PLFB'' : puts an image on a tile&lt;br /&gt;
* '''TYPE_RANDOM'''''_LFB'' : puts an image from a random set on a tile&lt;br /&gt;
* '''TYPE_RESTRICTED[23]'''''_PLFB'': puts an image on a tile if the tile has one [two or three] neighbours of a given type&lt;br /&gt;
* '''TYPE_RESTRICTED[23]_RANDOM'''''_PLFB'': combination of above&lt;br /&gt;
* '''TYPE_ROTATION_RESTRICTED[23]'''''_PLFB'': combination of above + the images will be named according to where the neighbours are&lt;br /&gt;
* '''TYPE_ROTATION_RESTRICTED[23]_RANDOM'''''_PLFB'': combination of above&lt;br /&gt;
&lt;br /&gt;
here ''_PLFB'' means any combination of _P _PL _PF etc... will also be correct macro names with the corresponding parameters&lt;br /&gt;
&lt;br /&gt;
each section describing a type will explain what values for PLFB are used for the functions that don't have them as parameters&lt;br /&gt;
&lt;br /&gt;
=== Macro Parameters ===&lt;br /&gt;
&lt;br /&gt;
These macros always have the parameters in the same orders (not all macros have all parameters, see below&lt;br /&gt;
&lt;br /&gt;
 TERRAIN ADJACENT PROB LAYER FLAG BUILDER IMAGESTEM&lt;br /&gt;
&lt;br /&gt;
* '''TERRAIN''' : the type of terrain to put the image on&lt;br /&gt;
* '''ADJACENT''' : ''only for restricted'' the type of neighbours to test for&lt;br /&gt;
* '''PROB''' : ''only for _P'' The probability of the rules generated by the macros of being applied. See the discussion in [[TerrainGraphicsTutorial#Cumulative_Probabilities]] for complications&lt;br /&gt;
* '''LAYER''' : ''only for _L'' The layer that will be used for the generated rules&lt;br /&gt;
* '''FLAG''' : ''only for _F'' A flag to test and set on the tile&lt;br /&gt;
* '''BUILDER''' : ''only for _B'' the builder macro that will be used to create the animations  in the image= field of the generated terrain code. See the dicussion at the begining of the builder section&lt;br /&gt;
* '''IMAGESTEM''': the basename on which filenames will be based.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Image Names ===&lt;br /&gt;
* '''_RANDOM_'''&lt;br /&gt;
** {{BUILDER} {IMAGESTEM} ()}&lt;br /&gt;
** {{BUILDER} {IMAGESTEM}2 ()}&lt;br /&gt;
** {{BUILDER} {IMAGESTEM}3 ()}&lt;br /&gt;
** ''etc up to 11''&lt;br /&gt;
* '''_ROTATION_'''&lt;br /&gt;
** '''1''' : {{BUILDER} {IMAGESTEM} (-@R0)} with @R0 being the orientation of the neighbouring tile&lt;br /&gt;
** '''2''' : {{BUILDER} {IMAGESTEM} (-@R0-@R1)} with @R0 and @R1 being the orientations of the neighbouring tiles&lt;br /&gt;
** '''3''' : {{BUILDER} {IMAGESTEM} (-@R0-@R1-@R2)} with @R0, @R1 and @R2 being the orientations of the neighbouring tiles&lt;br /&gt;
* '''_RANDOM_ + _ROTATION_'''&lt;br /&gt;
** {{BUILDER} {IMAGESTEM}# (-@R#)} ''similar to above with all combinations''&lt;br /&gt;
== The TEST_COMPLETE macro ==&lt;br /&gt;
&lt;br /&gt;
there is one more macro which exist for most families of macro&lt;br /&gt;
&lt;br /&gt;
 #define TYPE_COMPLETE_LFB TERRAIN ADJACENT LAYER FLAG BUILDER IMAGESTEM&lt;br /&gt;
    {TYPE_ROTATION_RESTRICTED3_RANDOM_LFB  ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small (-@R0-@R1-@R2)}&lt;br /&gt;
    {TYPE_ROTATION_RESTRICTED2_RANDOM_LFB  ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small (-@R0-@R1)}&lt;br /&gt;
    {TYPE_ROTATION_RESTRICTED_RANDOM_LFB   ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small (-@R0)}&lt;br /&gt;
    {TYPE_RESTRICTED_RANDOM_LFB            ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small ()}&lt;br /&gt;
    {TYPE_SINGLE_RANDOM_LFB                ({TERRAIN})               {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
 #enddef&lt;br /&gt;
&lt;br /&gt;
This macro is a simpler way of handling the most common case of &amp;quot;use a smaller variation when next to some terrains&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* If it has three neighbours, it will try IMAGESTEM-small#-R1-R2-R3&lt;br /&gt;
* if it has two neighbour or the correct image wasn't found, it will try two-sided variations&lt;br /&gt;
* if it has one neighbour or the correct image wasn't found, it will try one sided variations&lt;br /&gt;
* if it has still not found anything, it will try IMAGESTEM-small&lt;br /&gt;
* if it has no neighbour or still hasn't found anything, it will try based on IMAGESTEM&lt;br /&gt;
&lt;br /&gt;
== Image Builder macros ==&lt;br /&gt;
=== The problem ===&lt;br /&gt;
suppose we want to animate a transition with the following line&lt;br /&gt;
 image=image1;image2;image3&lt;br /&gt;
Since it's a transition, we would like to write something like (simplified)&lt;br /&gt;
 {TRANSITION_BASE &amp;lt;parameters&amp;gt; image1;image2;image3}&lt;br /&gt;
However, for a north transition, the macro would expand to something similar to&lt;br /&gt;
 image=image1;image2;image3-n&lt;br /&gt;
Which is wrong, we want the prefix added to all images in the animation&lt;br /&gt;
 image=image1-n;image2-n;image3-n&lt;br /&gt;
To get the result we want, we use macro indirection. In other word, we have a set of macros who take two parameters&lt;br /&gt;
 #define BUILDER IMAGESTEM POSTFIX&lt;br /&gt;
Which are in charge of returning what should be on the right side of the image= So, with the following macro&lt;br /&gt;
 #define MY_BUILDER IMAGESTEM POSTFIX&lt;br /&gt;
 {IMAGESTEM}1{POSTFIX};{IMAGESTEM}2{POSTFIX};{IMAGESTEM}3{POSTFIX};&lt;br /&gt;
and the following code in the TRANSITION_BASE macro&lt;br /&gt;
 image={{BUILDER} {IMAGESTEM} -n}&lt;br /&gt;
a call to&lt;br /&gt;
 {TRANSITION_BASE_B &amp;lt;parameters&amp;gt; MY_BUILDER image}&lt;br /&gt;
would correctly expand.&lt;br /&gt;
&lt;br /&gt;
=== Common parameters for all builders ===&lt;br /&gt;
All builders must have exactly the same parameters&lt;br /&gt;
* IMAGESTEM : the base name of the image from which to build&lt;br /&gt;
* POSTFIX : a postfix to add to all images&lt;br /&gt;
 &lt;br /&gt;
=== IMAGE_SINGLE IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a single image image= line (i.e not animated) mainly used as default value for BUILDER parameter of meta-macros&lt;br /&gt;
=== ANIMATION_03 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a Three image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
=== ANIMATION_04 IMAGESTEM POSTFIX === &lt;br /&gt;
builds a four image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
=== ANIMATION_10 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a ten image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
* IMAGESTEM-A05&lt;br /&gt;
* IMAGESTEM-A06&lt;br /&gt;
* IMAGESTEM-A07&lt;br /&gt;
* IMAGESTEM-A08&lt;br /&gt;
* IMAGESTEM-A09&lt;br /&gt;
* IMAGESTEM-A10&lt;br /&gt;
=== ANIMATION_15 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a fifteen image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
* IMAGESTEM-A05&lt;br /&gt;
* IMAGESTEM-A06&lt;br /&gt;
* IMAGESTEM-A07&lt;br /&gt;
* IMAGESTEM-A08&lt;br /&gt;
* IMAGESTEM-A09&lt;br /&gt;
* IMAGESTEM-A10&lt;br /&gt;
* IMAGESTEM-A11&lt;br /&gt;
* IMAGESTEM-A12&lt;br /&gt;
* IMAGESTEM-A13&lt;br /&gt;
* IMAGESTEM-A14&lt;br /&gt;
* IMAGESTEM-A15&lt;br /&gt;
=== ANIMATION_04_140 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a four image animation, each image being displayed for 140 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
=== ANIMATION_18_70 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a eighteen image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
* IMAGESTEM-A05&lt;br /&gt;
* IMAGESTEM-A06&lt;br /&gt;
* IMAGESTEM-A07&lt;br /&gt;
* IMAGESTEM-A08&lt;br /&gt;
* IMAGESTEM-A09&lt;br /&gt;
* IMAGESTEM-A10&lt;br /&gt;
* IMAGESTEM-A11&lt;br /&gt;
* IMAGESTEM-A12&lt;br /&gt;
* IMAGESTEM-A13&lt;br /&gt;
* IMAGESTEM-A14&lt;br /&gt;
* IMAGESTEM-A15&lt;br /&gt;
* IMAGESTEM-A16&lt;br /&gt;
* IMAGESTEM-A17&lt;br /&gt;
* IMAGESTEM-A18&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Base tile related macros ==&lt;br /&gt;
&lt;br /&gt;
Base terrains have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''TERRAIN_BASE'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': -1000&lt;br /&gt;
* '''FLAG'''': ''base''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Overlay related macros==&lt;br /&gt;
&lt;br /&gt;
Overlays have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''OVERLAY'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': 0&lt;br /&gt;
* '''FLAG'''': ''overlay''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Keep related macros ==&lt;br /&gt;
&lt;br /&gt;
Keeps are base terrains (they use the same flag) but drawn on layer -1&lt;br /&gt;
&lt;br /&gt;
Keeps have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''KEEP_BASE'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': -1&lt;br /&gt;
* '''FLAG'''': ''base''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Village related macros ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
villages have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''VILLAGE'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': 0&lt;br /&gt;
* '''FLAG'''': ''village''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Transition related macros ==&lt;br /&gt;
&lt;br /&gt;
=== Generic Functions ===&lt;br /&gt;
transitions  have most of the macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''TRANSITION'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': -500&lt;br /&gt;
* '''FLAG''': ''transition-@&amp;lt;side&amp;gt;''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However, unlike all previous type of macros, they are related to a ''side'' instead of the whole hex. Thus the following rules&lt;br /&gt;
&lt;br /&gt;
* There are no ROTATION macros. Since they are always side related, they are always transition like&lt;br /&gt;
* All images are named as if they were ROTATION macros (since they are painting on a side&lt;br /&gt;
* The flags are set and tested on a side related basis. i.e there can be more than one transition per tile, if they don't cover the same direction&lt;br /&gt;
* the non-RESTRICTED variations don't exist, they don't really make sense&lt;br /&gt;
* for RESTRICTED2 and RESTRICTED3, we only check for neighbouring hex of the ADJACENT type. This makes more sense for borders&lt;br /&gt;
* the COMPLETE variant looks as follows&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 #define BORDER_COMPLETE_LFB TERRAIN ADJACENT LAYER FLAG BUILDER IMAGESTEM&lt;br /&gt;
    {BORDER_RESTRICTED3_RANDOM_LFB  ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
    {BORDER_RESTRICTED2_RANDOM_LFB  ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
    {BORDER_RESTRICTED_RANDOM_LFB   ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
    {BORDER_RESTRICTED_RANDOM_LFB   ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
    {BORDER_SINGLE_RANDOM_LFB       ({TERRAIN})               {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
 #enddef&lt;br /&gt;
&lt;br /&gt;
=== DISABLE_BASE_TRANSITIONS TERRAINLIST ===&lt;br /&gt;
This macro will set all transition-@R* on the tile (''n,ne,se,s,sw'')  thus preventing any other transition from being added&lt;br /&gt;
&lt;br /&gt;
'''Flag Management'''&lt;br /&gt;
will set all transition-@R* on the TERRAINLIST tiles&lt;br /&gt;
=== DISABLE_BASE_TRANSITIONS_F TERRAINLIST FLAG ===&lt;br /&gt;
This macro will set all &amp;lt;FLAG&amp;gt;-@R* on the tile (''n,ne,se,s,sw'')  thus preventing any other transition from being added&lt;br /&gt;
&lt;br /&gt;
'''Flag Management'''&lt;br /&gt;
will set all &amp;lt;FLAG&amp;gt;-@R* on the TERRAINLIST tiles&lt;br /&gt;
&lt;br /&gt;
== Terrain Specific ==&lt;br /&gt;
=== SIMPLE_FOREST_TERRAIN TERRAINLIST ADJACENT IMAGESTEM ===&lt;br /&gt;
&lt;br /&gt;
will use an image IMAGESTEM-small# when next to adjacent and IMAGESTEM# anywhere else&lt;br /&gt;
&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-small&lt;br /&gt;
* IMAGESTEM-small2&lt;br /&gt;
* IMAGESTEM-small3&lt;br /&gt;
* IMAGESTEM-small4&lt;br /&gt;
* IMAGESTEM-small5&lt;br /&gt;
* IMAGESTEM-small6&lt;br /&gt;
* IMAGESTEM-small7&lt;br /&gt;
* IMAGESTEM-small8&lt;br /&gt;
* IMAGESTEM-small9&lt;br /&gt;
* IMAGESTEM&lt;br /&gt;
* IMAGESTEM2&lt;br /&gt;
* IMAGESTEM3&lt;br /&gt;
* IMAGESTEM4&lt;br /&gt;
* IMAGESTEM5&lt;br /&gt;
* IMAGESTEM6&lt;br /&gt;
* IMAGESTEM7&lt;br /&gt;
* IMAGESTEM8&lt;br /&gt;
* IMAGESTEM9&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''' Parameters ''' &lt;br /&gt;
* '''ADJACENT''': regexp of terrains that will use -small images&lt;br /&gt;
&lt;br /&gt;
''' Flage management '''&lt;br /&gt;
this is technically an overlay. It is drawn on layer 0 with other overlays and test/set the overlay flag&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=TerrainMacrosWML&amp;diff=36764</id>
		<title>TerrainMacrosWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=TerrainMacrosWML&amp;diff=36764"/>
		<updated>2010-06-13T16:37:51Z</updated>

		<summary type="html">&lt;p&gt;Boucman: /* Generic Functions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DevFeature1.9}}&lt;br /&gt;
This page is entirely base on the 1.9 macros, they are very close to the 1.8 macros, but no attempt has been done to document the difference&lt;br /&gt;
&lt;br /&gt;
== Flag Management ==&lt;br /&gt;
This section lists the common flags used by macros and their high level signification&lt;br /&gt;
* '''base''': is set on all hex when the base tile is set.&lt;br /&gt;
* '''overlay''': is set on all hex that have something drawn on the hex itself (i.e not a transition) over the base terrain.&lt;br /&gt;
* '''village''': is set when a village is added on a tile.&lt;br /&gt;
* '''transition-@R*''': is set on a tile which has a transition on it's corresponding side set (i.e if there is a transition with the tile at its north, transition-n will be set) possible values: ''n,ne,nw,s,se,sw'' Also not that the macros handl it in a reciprocal way. in other word if a tile has transition-n set, it's northern neighbour should have transition-s set&lt;br /&gt;
* '''angle_@R*''' : used for bridges, the bridge on this tile. The bridge has an &amp;quot;exit direction&amp;quot; in the @R direction indicated.&lt;br /&gt;
* '''angleaway_@R*''' : used for bridges, the bridge does NOT have an exit on the given direction&lt;br /&gt;
&lt;br /&gt;
== Layer Management ==&lt;br /&gt;
* '''-1000''': default layer for base tiles&lt;br /&gt;
* '''-80''': overlays that should always be drawn under units (like rails etc...)&lt;br /&gt;
* '''0''': default layer for overlays and villages&lt;br /&gt;
Normal units are drawn above layer 0, except if the basey of the tile is &amp;gt; 56 in which case they are drawn below&lt;br /&gt;
* '''1''': used by the base tile of castles/keeps&lt;br /&gt;
Flying/moving units are always drawn over terrain&lt;br /&gt;
== Precedence Management ==&lt;br /&gt;
TBSL&lt;br /&gt;
== Base Management ==&lt;br /&gt;
TBSL&lt;br /&gt;
&lt;br /&gt;
== Macro naming convention ==&lt;br /&gt;
for some common types of tiles, we have a lot of variation of macros. To simplify, they follow a naming convention&lt;br /&gt;
&lt;br /&gt;
=== Macro names ===&lt;br /&gt;
Type is the type of macros (like KEEP,OVERLAY etc...) we are using&lt;br /&gt;
&lt;br /&gt;
* '''TYPE'''''_PLFB'' : puts an image on a tile&lt;br /&gt;
* '''TYPE_RANDOM'''''_LFB'' : puts an image from a random set on a tile&lt;br /&gt;
* '''TYPE_RESTRICTED[23]'''''_PLFB'': puts an image on a tile if the tile has one [two or three] neighbours of a given type&lt;br /&gt;
* '''TYPE_RESTRICTED[23]_RANDOM'''''_PLFB'': combination of above&lt;br /&gt;
* '''TYPE_ROTATION_RESTRICTED[23]'''''_PLFB'': combination of above + the images will be named according to where the neighbours are&lt;br /&gt;
* '''TYPE_ROTATION_RESTRICTED[23]_RANDOM'''''_PLFB'': combination of above&lt;br /&gt;
&lt;br /&gt;
here ''_PLFB'' means any combination of _P _PL _PF etc... will also be correct macro names with the corresponding parameters&lt;br /&gt;
&lt;br /&gt;
each section describing a type will explain what values for PLFB are used for the functions that don't have them as parameters&lt;br /&gt;
&lt;br /&gt;
=== Macro Parameters ===&lt;br /&gt;
&lt;br /&gt;
These macros always have the parameters in the same orders (not all macros have all parameters, see below&lt;br /&gt;
&lt;br /&gt;
 TERRAIN ADJACENT PROB LAYER FLAG BUILDER IMAGESTEM&lt;br /&gt;
&lt;br /&gt;
* '''TERRAIN''' : the type of terrain to put the image on&lt;br /&gt;
* '''ADJACENT''' : ''only for restricted'' the type of neighbours to test for&lt;br /&gt;
* '''PROB''' : ''only for _P'' The probability of the rules generated by the macros of being applied. See the discussion in [[TerrainGraphicsTutorial#Cumulative_Probabilities]] for complications&lt;br /&gt;
* '''LAYER''' : ''only for _L'' The layer that will be used for the generated rules&lt;br /&gt;
* '''FLAG''' : ''only for _F'' A flag to test and set on the tile&lt;br /&gt;
* '''BUILDER''' : ''only for _B'' the builder macro that will be used to create the animations  in the image= field of the generated terrain code. See the dicussion at the begining of the builder section&lt;br /&gt;
* '''IMAGESTEM''': the basename on which filenames will be based.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Image Names ===&lt;br /&gt;
* '''_RANDOM_'''&lt;br /&gt;
** {{BUILDER} {IMAGESTEM} ()}&lt;br /&gt;
** {{BUILDER} {IMAGESTEM}2 ()}&lt;br /&gt;
** {{BUILDER} {IMAGESTEM}3 ()}&lt;br /&gt;
** ''etc up to 11''&lt;br /&gt;
* '''_ROTATION_'''&lt;br /&gt;
** '''1''' : {{BUILDER} {IMAGESTEM} (-@R0)} with @R0 being the orientation of the neighbouring tile&lt;br /&gt;
** '''2''' : {{BUILDER} {IMAGESTEM} (-@R0-@R1)} with @R0 and @R1 being the orientations of the neighbouring tiles&lt;br /&gt;
** '''3''' : {{BUILDER} {IMAGESTEM} (-@R0-@R1-@R2)} with @R0, @R1 and @R2 being the orientations of the neighbouring tiles&lt;br /&gt;
* '''_RANDOM_ + _ROTATION_'''&lt;br /&gt;
** {{BUILDER} {IMAGESTEM}# (-@R#)} ''similar to above with all combinations''&lt;br /&gt;
== The TEST_COMPLETE macro ==&lt;br /&gt;
&lt;br /&gt;
there is one more macro which exist for most families of macro&lt;br /&gt;
&lt;br /&gt;
 #define TYPE_COMPLETE_LFB TERRAIN ADJACENT LAYER FLAG BUILDER IMAGESTEM&lt;br /&gt;
    {TYPE_ROTATION_RESTRICTED3_RANDOM_LFB  ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small (-@R0-@R1-@R2)}&lt;br /&gt;
    {TYPE_ROTATION_RESTRICTED2_RANDOM_LFB  ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small (-@R0-@R1)}&lt;br /&gt;
    {TYPE_ROTATION_RESTRICTED_RANDOM_LFB   ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small (-@R0)}&lt;br /&gt;
    {TYPE_RESTRICTED_RANDOM_LFB            ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small ()}&lt;br /&gt;
    {TYPE_SINGLE_RANDOM_LFB                ({TERRAIN})               {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
 #enddef&lt;br /&gt;
&lt;br /&gt;
This macro is a simpler way of handling the most common case of &amp;quot;use a smaller variation when next to some terrains&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* If it has three neighbours, it will try IMAGESTEM-small#-R1-R2-R3&lt;br /&gt;
* if it has two neighbour or the correct image wasn't found, it will try two-sided variations&lt;br /&gt;
* if it has one neighbour or the correct image wasn't found, it will try one sided variations&lt;br /&gt;
* if it has still not found anything, it will try IMAGESTEM-small&lt;br /&gt;
* if it has no neighbour or still hasn't found anything, it will try based on IMAGESTEM&lt;br /&gt;
&lt;br /&gt;
== Image Builder macros ==&lt;br /&gt;
=== The problem ===&lt;br /&gt;
suppose we want to animate a transition with the following line&lt;br /&gt;
 image=image1;image2;image3&lt;br /&gt;
Since it's a transition, we would like to write something like (simplified)&lt;br /&gt;
 {TRANSITION_BASE &amp;lt;parameters&amp;gt; image1;image2;image3}&lt;br /&gt;
However, for a north transition, the macro would expand to something similar to&lt;br /&gt;
 image=image1;image2;image3-n&lt;br /&gt;
Which is wrong, we want the prefix added to all images in the animation&lt;br /&gt;
 image=image1-n;image2-n;image3-n&lt;br /&gt;
To get the result we want, we use macro indirection. In other word, we have a set of macros who take two parameters&lt;br /&gt;
 #define BUILDER IMAGESTEM POSTFIX&lt;br /&gt;
Which are in charge of returning what should be on the right side of the image= So, with the following macro&lt;br /&gt;
 #define MY_BUILDER IMAGESTEM POSTFIX&lt;br /&gt;
 {IMAGESTEM}1{POSTFIX};{IMAGESTEM}2{POSTFIX};{IMAGESTEM}3{POSTFIX};&lt;br /&gt;
and the following code in the TRANSITION_BASE macro&lt;br /&gt;
 image={{BUILDER} {IMAGESTEM} -n}&lt;br /&gt;
a call to&lt;br /&gt;
 {TRANSITION_BASE_B &amp;lt;parameters&amp;gt; MY_BUILDER image}&lt;br /&gt;
would correctly expand.&lt;br /&gt;
&lt;br /&gt;
=== Common parameters for all builders ===&lt;br /&gt;
All builders must have exactly the same parameters&lt;br /&gt;
* IMAGESTEM : the base name of the image from which to build&lt;br /&gt;
* POSTFIX : a postfix to add to all images&lt;br /&gt;
 &lt;br /&gt;
=== IMAGE_SINGLE IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a single image image= line (i.e not animated) mainly used as default value for BUILDER parameter of meta-macros&lt;br /&gt;
=== ANIMATION_03 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a Three image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
=== ANIMATION_04 IMAGESTEM POSTFIX === &lt;br /&gt;
builds a four image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
=== ANIMATION_10 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a ten image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
* IMAGESTEM-A05&lt;br /&gt;
* IMAGESTEM-A06&lt;br /&gt;
* IMAGESTEM-A07&lt;br /&gt;
* IMAGESTEM-A08&lt;br /&gt;
* IMAGESTEM-A09&lt;br /&gt;
* IMAGESTEM-A10&lt;br /&gt;
=== ANIMATION_15 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a fifteen image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
* IMAGESTEM-A05&lt;br /&gt;
* IMAGESTEM-A06&lt;br /&gt;
* IMAGESTEM-A07&lt;br /&gt;
* IMAGESTEM-A08&lt;br /&gt;
* IMAGESTEM-A09&lt;br /&gt;
* IMAGESTEM-A10&lt;br /&gt;
* IMAGESTEM-A11&lt;br /&gt;
* IMAGESTEM-A12&lt;br /&gt;
* IMAGESTEM-A13&lt;br /&gt;
* IMAGESTEM-A14&lt;br /&gt;
* IMAGESTEM-A15&lt;br /&gt;
=== ANIMATION_04_140 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a four image animation, each image being displayed for 140 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
=== ANIMATION_18_70 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a eighteen image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
* IMAGESTEM-A05&lt;br /&gt;
* IMAGESTEM-A06&lt;br /&gt;
* IMAGESTEM-A07&lt;br /&gt;
* IMAGESTEM-A08&lt;br /&gt;
* IMAGESTEM-A09&lt;br /&gt;
* IMAGESTEM-A10&lt;br /&gt;
* IMAGESTEM-A11&lt;br /&gt;
* IMAGESTEM-A12&lt;br /&gt;
* IMAGESTEM-A13&lt;br /&gt;
* IMAGESTEM-A14&lt;br /&gt;
* IMAGESTEM-A15&lt;br /&gt;
* IMAGESTEM-A16&lt;br /&gt;
* IMAGESTEM-A17&lt;br /&gt;
* IMAGESTEM-A18&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Base tile related macros ==&lt;br /&gt;
&lt;br /&gt;
Base terrains have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''TERRAIN_BASE'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': -1000&lt;br /&gt;
* '''FLAG'''': ''base''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Overlay related macros==&lt;br /&gt;
&lt;br /&gt;
Overlays have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''OVERLAY'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': 0&lt;br /&gt;
* '''FLAG'''': ''overlay''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Keep related macros ==&lt;br /&gt;
&lt;br /&gt;
Keeps are base terrains (they use the same flag) but drawn on layer -1&lt;br /&gt;
&lt;br /&gt;
Keeps have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''KEEP_BASE'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': -1&lt;br /&gt;
* '''FLAG'''': ''base''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Village related macros ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
villages have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''VILLAGE'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': 0&lt;br /&gt;
* '''FLAG'''': ''village''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Transition related macros ==&lt;br /&gt;
&lt;br /&gt;
=== Generic Functions ===&lt;br /&gt;
transitions  have most of the macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''TRANSITION'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': -500&lt;br /&gt;
* '''FLAG''': ''transition-@&amp;lt;side&amp;gt;''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However, unlike all previous type of macros, they are related to a ''side'' instead of the whole hex. Thus the following rules&lt;br /&gt;
&lt;br /&gt;
* There are no ROTATION macros. Since they are always side related, they are always transition like&lt;br /&gt;
* All images are named as if they were ROTATION macros (since they are painting on a side&lt;br /&gt;
* The flags are set and tested on a side related basis. i.e there can be more than one transition per tile, if they don't cover the same direction&lt;br /&gt;
* the non-RESTRICTED variations exist, they will apply unconditionnaly, whatever the neighbour is... This is usually not what you want&lt;br /&gt;
* for RESTRICTED2 and RESTRICTED3, we only check for neighbouring hex of the ADJACENT type. This makes more sense for borders&lt;br /&gt;
* the COMPLETE variant looks as follows&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 #define BORDER_COMPLETE_LFB TERRAIN ADJACENT LAYER FLAG BUILDER IMAGESTEM&lt;br /&gt;
    {BORDER_RESTRICTED3_RANDOM_LFB  ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
    {BORDER_RESTRICTED2_RANDOM_LFB  ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
    {BORDER_RESTRICTED_RANDOM_LFB   ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
    {BORDER_RESTRICTED_RANDOM_LFB   ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
    {BORDER_SINGLE_RANDOM_LFB       ({TERRAIN})               {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
 #enddef&lt;br /&gt;
&lt;br /&gt;
=== DISABLE_BASE_TRANSITIONS TERRAINLIST ===&lt;br /&gt;
This macro will set all transition-@R* on the tile (''n,ne,se,s,sw'')  thus preventing any other transition from being added&lt;br /&gt;
&lt;br /&gt;
'''Flag Management'''&lt;br /&gt;
will set all transition-@R* on the TERRAINLIST tiles&lt;br /&gt;
=== DISABLE_BASE_TRANSITIONS_F TERRAINLIST FLAG ===&lt;br /&gt;
This macro will set all &amp;lt;FLAG&amp;gt;-@R* on the tile (''n,ne,se,s,sw'')  thus preventing any other transition from being added&lt;br /&gt;
&lt;br /&gt;
'''Flag Management'''&lt;br /&gt;
will set all &amp;lt;FLAG&amp;gt;-@R* on the TERRAINLIST tiles&lt;br /&gt;
&lt;br /&gt;
== Terrain Specific ==&lt;br /&gt;
=== SIMPLE_FOREST_TERRAIN TERRAINLIST ADJACENT IMAGESTEM ===&lt;br /&gt;
&lt;br /&gt;
will use an image IMAGESTEM-small# when next to adjacent and IMAGESTEM# anywhere else&lt;br /&gt;
&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-small&lt;br /&gt;
* IMAGESTEM-small2&lt;br /&gt;
* IMAGESTEM-small3&lt;br /&gt;
* IMAGESTEM-small4&lt;br /&gt;
* IMAGESTEM-small5&lt;br /&gt;
* IMAGESTEM-small6&lt;br /&gt;
* IMAGESTEM-small7&lt;br /&gt;
* IMAGESTEM-small8&lt;br /&gt;
* IMAGESTEM-small9&lt;br /&gt;
* IMAGESTEM&lt;br /&gt;
* IMAGESTEM2&lt;br /&gt;
* IMAGESTEM3&lt;br /&gt;
* IMAGESTEM4&lt;br /&gt;
* IMAGESTEM5&lt;br /&gt;
* IMAGESTEM6&lt;br /&gt;
* IMAGESTEM7&lt;br /&gt;
* IMAGESTEM8&lt;br /&gt;
* IMAGESTEM9&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''' Parameters ''' &lt;br /&gt;
* '''ADJACENT''': regexp of terrains that will use -small images&lt;br /&gt;
&lt;br /&gt;
''' Flage management '''&lt;br /&gt;
this is technically an overlay. It is drawn on layer 0 with other overlays and test/set the overlay flag&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=TerrainMacrosWML&amp;diff=36763</id>
		<title>TerrainMacrosWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=TerrainMacrosWML&amp;diff=36763"/>
		<updated>2010-06-13T16:36:56Z</updated>

		<summary type="html">&lt;p&gt;Boucman: /* TO BE DOCUMENTED */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DevFeature1.9}}&lt;br /&gt;
This page is entirely base on the 1.9 macros, they are very close to the 1.8 macros, but no attempt has been done to document the difference&lt;br /&gt;
&lt;br /&gt;
== Flag Management ==&lt;br /&gt;
This section lists the common flags used by macros and their high level signification&lt;br /&gt;
* '''base''': is set on all hex when the base tile is set.&lt;br /&gt;
* '''overlay''': is set on all hex that have something drawn on the hex itself (i.e not a transition) over the base terrain.&lt;br /&gt;
* '''village''': is set when a village is added on a tile.&lt;br /&gt;
* '''transition-@R*''': is set on a tile which has a transition on it's corresponding side set (i.e if there is a transition with the tile at its north, transition-n will be set) possible values: ''n,ne,nw,s,se,sw'' Also not that the macros handl it in a reciprocal way. in other word if a tile has transition-n set, it's northern neighbour should have transition-s set&lt;br /&gt;
* '''angle_@R*''' : used for bridges, the bridge on this tile. The bridge has an &amp;quot;exit direction&amp;quot; in the @R direction indicated.&lt;br /&gt;
* '''angleaway_@R*''' : used for bridges, the bridge does NOT have an exit on the given direction&lt;br /&gt;
&lt;br /&gt;
== Layer Management ==&lt;br /&gt;
* '''-1000''': default layer for base tiles&lt;br /&gt;
* '''-80''': overlays that should always be drawn under units (like rails etc...)&lt;br /&gt;
* '''0''': default layer for overlays and villages&lt;br /&gt;
Normal units are drawn above layer 0, except if the basey of the tile is &amp;gt; 56 in which case they are drawn below&lt;br /&gt;
* '''1''': used by the base tile of castles/keeps&lt;br /&gt;
Flying/moving units are always drawn over terrain&lt;br /&gt;
== Precedence Management ==&lt;br /&gt;
TBSL&lt;br /&gt;
== Base Management ==&lt;br /&gt;
TBSL&lt;br /&gt;
&lt;br /&gt;
== Macro naming convention ==&lt;br /&gt;
for some common types of tiles, we have a lot of variation of macros. To simplify, they follow a naming convention&lt;br /&gt;
&lt;br /&gt;
=== Macro names ===&lt;br /&gt;
Type is the type of macros (like KEEP,OVERLAY etc...) we are using&lt;br /&gt;
&lt;br /&gt;
* '''TYPE'''''_PLFB'' : puts an image on a tile&lt;br /&gt;
* '''TYPE_RANDOM'''''_LFB'' : puts an image from a random set on a tile&lt;br /&gt;
* '''TYPE_RESTRICTED[23]'''''_PLFB'': puts an image on a tile if the tile has one [two or three] neighbours of a given type&lt;br /&gt;
* '''TYPE_RESTRICTED[23]_RANDOM'''''_PLFB'': combination of above&lt;br /&gt;
* '''TYPE_ROTATION_RESTRICTED[23]'''''_PLFB'': combination of above + the images will be named according to where the neighbours are&lt;br /&gt;
* '''TYPE_ROTATION_RESTRICTED[23]_RANDOM'''''_PLFB'': combination of above&lt;br /&gt;
&lt;br /&gt;
here ''_PLFB'' means any combination of _P _PL _PF etc... will also be correct macro names with the corresponding parameters&lt;br /&gt;
&lt;br /&gt;
each section describing a type will explain what values for PLFB are used for the functions that don't have them as parameters&lt;br /&gt;
&lt;br /&gt;
=== Macro Parameters ===&lt;br /&gt;
&lt;br /&gt;
These macros always have the parameters in the same orders (not all macros have all parameters, see below&lt;br /&gt;
&lt;br /&gt;
 TERRAIN ADJACENT PROB LAYER FLAG BUILDER IMAGESTEM&lt;br /&gt;
&lt;br /&gt;
* '''TERRAIN''' : the type of terrain to put the image on&lt;br /&gt;
* '''ADJACENT''' : ''only for restricted'' the type of neighbours to test for&lt;br /&gt;
* '''PROB''' : ''only for _P'' The probability of the rules generated by the macros of being applied. See the discussion in [[TerrainGraphicsTutorial#Cumulative_Probabilities]] for complications&lt;br /&gt;
* '''LAYER''' : ''only for _L'' The layer that will be used for the generated rules&lt;br /&gt;
* '''FLAG''' : ''only for _F'' A flag to test and set on the tile&lt;br /&gt;
* '''BUILDER''' : ''only for _B'' the builder macro that will be used to create the animations  in the image= field of the generated terrain code. See the dicussion at the begining of the builder section&lt;br /&gt;
* '''IMAGESTEM''': the basename on which filenames will be based.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Image Names ===&lt;br /&gt;
* '''_RANDOM_'''&lt;br /&gt;
** {{BUILDER} {IMAGESTEM} ()}&lt;br /&gt;
** {{BUILDER} {IMAGESTEM}2 ()}&lt;br /&gt;
** {{BUILDER} {IMAGESTEM}3 ()}&lt;br /&gt;
** ''etc up to 11''&lt;br /&gt;
* '''_ROTATION_'''&lt;br /&gt;
** '''1''' : {{BUILDER} {IMAGESTEM} (-@R0)} with @R0 being the orientation of the neighbouring tile&lt;br /&gt;
** '''2''' : {{BUILDER} {IMAGESTEM} (-@R0-@R1)} with @R0 and @R1 being the orientations of the neighbouring tiles&lt;br /&gt;
** '''3''' : {{BUILDER} {IMAGESTEM} (-@R0-@R1-@R2)} with @R0, @R1 and @R2 being the orientations of the neighbouring tiles&lt;br /&gt;
* '''_RANDOM_ + _ROTATION_'''&lt;br /&gt;
** {{BUILDER} {IMAGESTEM}# (-@R#)} ''similar to above with all combinations''&lt;br /&gt;
== The TEST_COMPLETE macro ==&lt;br /&gt;
&lt;br /&gt;
there is one more macro which exist for most families of macro&lt;br /&gt;
&lt;br /&gt;
 #define TYPE_COMPLETE_LFB TERRAIN ADJACENT LAYER FLAG BUILDER IMAGESTEM&lt;br /&gt;
    {TYPE_ROTATION_RESTRICTED3_RANDOM_LFB  ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small (-@R0-@R1-@R2)}&lt;br /&gt;
    {TYPE_ROTATION_RESTRICTED2_RANDOM_LFB  ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small (-@R0-@R1)}&lt;br /&gt;
    {TYPE_ROTATION_RESTRICTED_RANDOM_LFB   ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small (-@R0)}&lt;br /&gt;
    {TYPE_RESTRICTED_RANDOM_LFB            ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small ()}&lt;br /&gt;
    {TYPE_SINGLE_RANDOM_LFB                ({TERRAIN})               {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
 #enddef&lt;br /&gt;
&lt;br /&gt;
This macro is a simpler way of handling the most common case of &amp;quot;use a smaller variation when next to some terrains&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* If it has three neighbours, it will try IMAGESTEM-small#-R1-R2-R3&lt;br /&gt;
* if it has two neighbour or the correct image wasn't found, it will try two-sided variations&lt;br /&gt;
* if it has one neighbour or the correct image wasn't found, it will try one sided variations&lt;br /&gt;
* if it has still not found anything, it will try IMAGESTEM-small&lt;br /&gt;
* if it has no neighbour or still hasn't found anything, it will try based on IMAGESTEM&lt;br /&gt;
&lt;br /&gt;
== Image Builder macros ==&lt;br /&gt;
=== The problem ===&lt;br /&gt;
suppose we want to animate a transition with the following line&lt;br /&gt;
 image=image1;image2;image3&lt;br /&gt;
Since it's a transition, we would like to write something like (simplified)&lt;br /&gt;
 {TRANSITION_BASE &amp;lt;parameters&amp;gt; image1;image2;image3}&lt;br /&gt;
However, for a north transition, the macro would expand to something similar to&lt;br /&gt;
 image=image1;image2;image3-n&lt;br /&gt;
Which is wrong, we want the prefix added to all images in the animation&lt;br /&gt;
 image=image1-n;image2-n;image3-n&lt;br /&gt;
To get the result we want, we use macro indirection. In other word, we have a set of macros who take two parameters&lt;br /&gt;
 #define BUILDER IMAGESTEM POSTFIX&lt;br /&gt;
Which are in charge of returning what should be on the right side of the image= So, with the following macro&lt;br /&gt;
 #define MY_BUILDER IMAGESTEM POSTFIX&lt;br /&gt;
 {IMAGESTEM}1{POSTFIX};{IMAGESTEM}2{POSTFIX};{IMAGESTEM}3{POSTFIX};&lt;br /&gt;
and the following code in the TRANSITION_BASE macro&lt;br /&gt;
 image={{BUILDER} {IMAGESTEM} -n}&lt;br /&gt;
a call to&lt;br /&gt;
 {TRANSITION_BASE_B &amp;lt;parameters&amp;gt; MY_BUILDER image}&lt;br /&gt;
would correctly expand.&lt;br /&gt;
&lt;br /&gt;
=== Common parameters for all builders ===&lt;br /&gt;
All builders must have exactly the same parameters&lt;br /&gt;
* IMAGESTEM : the base name of the image from which to build&lt;br /&gt;
* POSTFIX : a postfix to add to all images&lt;br /&gt;
 &lt;br /&gt;
=== IMAGE_SINGLE IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a single image image= line (i.e not animated) mainly used as default value for BUILDER parameter of meta-macros&lt;br /&gt;
=== ANIMATION_03 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a Three image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
=== ANIMATION_04 IMAGESTEM POSTFIX === &lt;br /&gt;
builds a four image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
=== ANIMATION_10 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a ten image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
* IMAGESTEM-A05&lt;br /&gt;
* IMAGESTEM-A06&lt;br /&gt;
* IMAGESTEM-A07&lt;br /&gt;
* IMAGESTEM-A08&lt;br /&gt;
* IMAGESTEM-A09&lt;br /&gt;
* IMAGESTEM-A10&lt;br /&gt;
=== ANIMATION_15 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a fifteen image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
* IMAGESTEM-A05&lt;br /&gt;
* IMAGESTEM-A06&lt;br /&gt;
* IMAGESTEM-A07&lt;br /&gt;
* IMAGESTEM-A08&lt;br /&gt;
* IMAGESTEM-A09&lt;br /&gt;
* IMAGESTEM-A10&lt;br /&gt;
* IMAGESTEM-A11&lt;br /&gt;
* IMAGESTEM-A12&lt;br /&gt;
* IMAGESTEM-A13&lt;br /&gt;
* IMAGESTEM-A14&lt;br /&gt;
* IMAGESTEM-A15&lt;br /&gt;
=== ANIMATION_04_140 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a four image animation, each image being displayed for 140 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
=== ANIMATION_18_70 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a eighteen image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
* IMAGESTEM-A05&lt;br /&gt;
* IMAGESTEM-A06&lt;br /&gt;
* IMAGESTEM-A07&lt;br /&gt;
* IMAGESTEM-A08&lt;br /&gt;
* IMAGESTEM-A09&lt;br /&gt;
* IMAGESTEM-A10&lt;br /&gt;
* IMAGESTEM-A11&lt;br /&gt;
* IMAGESTEM-A12&lt;br /&gt;
* IMAGESTEM-A13&lt;br /&gt;
* IMAGESTEM-A14&lt;br /&gt;
* IMAGESTEM-A15&lt;br /&gt;
* IMAGESTEM-A16&lt;br /&gt;
* IMAGESTEM-A17&lt;br /&gt;
* IMAGESTEM-A18&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Base tile related macros ==&lt;br /&gt;
&lt;br /&gt;
Base terrains have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''TERRAIN_BASE'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': -1000&lt;br /&gt;
* '''FLAG'''': ''base''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Overlay related macros==&lt;br /&gt;
&lt;br /&gt;
Overlays have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''OVERLAY'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': 0&lt;br /&gt;
* '''FLAG'''': ''overlay''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Keep related macros ==&lt;br /&gt;
&lt;br /&gt;
Keeps are base terrains (they use the same flag) but drawn on layer -1&lt;br /&gt;
&lt;br /&gt;
Keeps have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''KEEP_BASE'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': -1&lt;br /&gt;
* '''FLAG'''': ''base''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Village related macros ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
villages have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''VILLAGE'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': 0&lt;br /&gt;
* '''FLAG'''': ''village''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Transition related macros ==&lt;br /&gt;
&lt;br /&gt;
=== Generic Functions ===&lt;br /&gt;
transitions  have most of the macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''TRANSITION'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': -500&lt;br /&gt;
* '''FLAG''': ''transition-@&amp;lt;side&amp;gt;''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However, unlike all previous type of macros, they are related to a ''side'' instead of the whole hex. Thus the following rules&lt;br /&gt;
&lt;br /&gt;
* There are no ROTATION macros. Since they are always side related, they are always transition like&lt;br /&gt;
* All images are named as if they were ROTATION macros (since they are painting on a side&lt;br /&gt;
* The flags are set and tested on a side related basis. i.e there can be more than one transition per tile, if they don't cover the same direction&lt;br /&gt;
* the non-RESTRICTED variations exist, they will apply unconditionnaly, whatever the neighbour is... This is usually not what you want&lt;br /&gt;
* for RESTRICTED2 and RESTRICTED3, we only check for neighbouring hex of the ADJACENT type. This makes more sense for borders&lt;br /&gt;
&lt;br /&gt;
=== DISABLE_BASE_TRANSITIONS TERRAINLIST ===&lt;br /&gt;
This macro will set all transition-@R* on the tile (''n,ne,se,s,sw'')  thus preventing any other transition from being added&lt;br /&gt;
&lt;br /&gt;
'''Flag Management'''&lt;br /&gt;
will set all transition-@R* on the TERRAINLIST tiles&lt;br /&gt;
=== DISABLE_BASE_TRANSITIONS_F TERRAINLIST FLAG ===&lt;br /&gt;
This macro will set all &amp;lt;FLAG&amp;gt;-@R* on the tile (''n,ne,se,s,sw'')  thus preventing any other transition from being added&lt;br /&gt;
&lt;br /&gt;
'''Flag Management'''&lt;br /&gt;
will set all &amp;lt;FLAG&amp;gt;-@R* on the TERRAINLIST tiles&lt;br /&gt;
&lt;br /&gt;
== Terrain Specific ==&lt;br /&gt;
=== SIMPLE_FOREST_TERRAIN TERRAINLIST ADJACENT IMAGESTEM ===&lt;br /&gt;
&lt;br /&gt;
will use an image IMAGESTEM-small# when next to adjacent and IMAGESTEM# anywhere else&lt;br /&gt;
&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-small&lt;br /&gt;
* IMAGESTEM-small2&lt;br /&gt;
* IMAGESTEM-small3&lt;br /&gt;
* IMAGESTEM-small4&lt;br /&gt;
* IMAGESTEM-small5&lt;br /&gt;
* IMAGESTEM-small6&lt;br /&gt;
* IMAGESTEM-small7&lt;br /&gt;
* IMAGESTEM-small8&lt;br /&gt;
* IMAGESTEM-small9&lt;br /&gt;
* IMAGESTEM&lt;br /&gt;
* IMAGESTEM2&lt;br /&gt;
* IMAGESTEM3&lt;br /&gt;
* IMAGESTEM4&lt;br /&gt;
* IMAGESTEM5&lt;br /&gt;
* IMAGESTEM6&lt;br /&gt;
* IMAGESTEM7&lt;br /&gt;
* IMAGESTEM8&lt;br /&gt;
* IMAGESTEM9&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''' Parameters ''' &lt;br /&gt;
* '''ADJACENT''': regexp of terrains that will use -small images&lt;br /&gt;
&lt;br /&gt;
''' Flage management '''&lt;br /&gt;
this is technically an overlay. It is drawn on layer 0 with other overlays and test/set the overlay flag&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=TerrainMacrosWML&amp;diff=36761</id>
		<title>TerrainMacrosWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=TerrainMacrosWML&amp;diff=36761"/>
		<updated>2010-06-13T09:58:50Z</updated>

		<summary type="html">&lt;p&gt;Boucman: /* Generic Functions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DevFeature1.9}}&lt;br /&gt;
This page is entirely base on the 1.9 macros, they are very close to the 1.8 macros, but no attempt has been done to document the difference&lt;br /&gt;
&lt;br /&gt;
== Flag Management ==&lt;br /&gt;
This section lists the common flags used by macros and their high level signification&lt;br /&gt;
* '''base''': is set on all hex when the base tile is set.&lt;br /&gt;
* '''overlay''': is set on all hex that have something drawn on the hex itself (i.e not a transition) over the base terrain.&lt;br /&gt;
* '''village''': is set when a village is added on a tile.&lt;br /&gt;
* '''transition-@R*''': is set on a tile which has a transition on it's corresponding side set (i.e if there is a transition with the tile at its north, transition-n will be set) possible values: ''n,ne,nw,s,se,sw'' Also not that the macros handl it in a reciprocal way. in other word if a tile has transition-n set, it's northern neighbour should have transition-s set&lt;br /&gt;
* '''angle_@R*''' : used for bridges, the bridge on this tile. The bridge has an &amp;quot;exit direction&amp;quot; in the @R direction indicated.&lt;br /&gt;
* '''angleaway_@R*''' : used for bridges, the bridge does NOT have an exit on the given direction&lt;br /&gt;
&lt;br /&gt;
== Layer Management ==&lt;br /&gt;
* '''-1000''': default layer for base tiles&lt;br /&gt;
* '''-80''': overlays that should always be drawn under units (like rails etc...)&lt;br /&gt;
* '''0''': default layer for overlays and villages&lt;br /&gt;
Normal units are drawn above layer 0, except if the basey of the tile is &amp;gt; 56 in which case they are drawn below&lt;br /&gt;
* '''1''': used by the base tile of castles/keeps&lt;br /&gt;
Flying/moving units are always drawn over terrain&lt;br /&gt;
== Precedence Management ==&lt;br /&gt;
TBSL&lt;br /&gt;
== Base Management ==&lt;br /&gt;
TBSL&lt;br /&gt;
&lt;br /&gt;
== Macro naming convention ==&lt;br /&gt;
for some common types of tiles, we have a lot of variation of macros. To simplify, they follow a naming convention&lt;br /&gt;
&lt;br /&gt;
=== Macro names ===&lt;br /&gt;
Type is the type of macros (like KEEP,OVERLAY etc...) we are using&lt;br /&gt;
&lt;br /&gt;
* '''TYPE'''''_PLFB'' : puts an image on a tile&lt;br /&gt;
* '''TYPE_RANDOM'''''_LFB'' : puts an image from a random set on a tile&lt;br /&gt;
* '''TYPE_RESTRICTED[23]'''''_PLFB'': puts an image on a tile if the tile has one [two or three] neighbours of a given type&lt;br /&gt;
* '''TYPE_RESTRICTED[23]_RANDOM'''''_PLFB'': combination of above&lt;br /&gt;
* '''TYPE_ROTATION_RESTRICTED[23]'''''_PLFB'': combination of above + the images will be named according to where the neighbours are&lt;br /&gt;
* '''TYPE_ROTATION_RESTRICTED[23]_RANDOM'''''_PLFB'': combination of above&lt;br /&gt;
&lt;br /&gt;
here ''_PLFB'' means any combination of _P _PL _PF etc... will also be correct macro names with the corresponding parameters&lt;br /&gt;
&lt;br /&gt;
each section describing a type will explain what values for PLFB are used for the functions that don't have them as parameters&lt;br /&gt;
&lt;br /&gt;
=== Macro Parameters ===&lt;br /&gt;
&lt;br /&gt;
These macros always have the parameters in the same orders (not all macros have all parameters, see below&lt;br /&gt;
&lt;br /&gt;
 TERRAIN ADJACENT PROB LAYER FLAG BUILDER IMAGESTEM&lt;br /&gt;
&lt;br /&gt;
* '''TERRAIN''' : the type of terrain to put the image on&lt;br /&gt;
* '''ADJACENT''' : ''only for restricted'' the type of neighbours to test for&lt;br /&gt;
* '''PROB''' : ''only for _P'' The probability of the rules generated by the macros of being applied. See the discussion in [[TerrainGraphicsTutorial#Cumulative_Probabilities]] for complications&lt;br /&gt;
* '''LAYER''' : ''only for _L'' The layer that will be used for the generated rules&lt;br /&gt;
* '''FLAG''' : ''only for _F'' A flag to test and set on the tile&lt;br /&gt;
* '''BUILDER''' : ''only for _B'' the builder macro that will be used to create the animations  in the image= field of the generated terrain code. See the dicussion at the begining of the builder section&lt;br /&gt;
* '''IMAGESTEM''': the basename on which filenames will be based.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Image Names ===&lt;br /&gt;
* '''_RANDOM_'''&lt;br /&gt;
** {{BUILDER} {IMAGESTEM} ()}&lt;br /&gt;
** {{BUILDER} {IMAGESTEM}2 ()}&lt;br /&gt;
** {{BUILDER} {IMAGESTEM}3 ()}&lt;br /&gt;
** ''etc up to 11''&lt;br /&gt;
* '''_ROTATION_'''&lt;br /&gt;
** '''1''' : {{BUILDER} {IMAGESTEM} (-@R0)} with @R0 being the orientation of the neighbouring tile&lt;br /&gt;
** '''2''' : {{BUILDER} {IMAGESTEM} (-@R0-@R1)} with @R0 and @R1 being the orientations of the neighbouring tiles&lt;br /&gt;
** '''3''' : {{BUILDER} {IMAGESTEM} (-@R0-@R1-@R2)} with @R0, @R1 and @R2 being the orientations of the neighbouring tiles&lt;br /&gt;
* '''_RANDOM_ + _ROTATION_'''&lt;br /&gt;
** {{BUILDER} {IMAGESTEM}# (-@R#)} ''similar to above with all combinations''&lt;br /&gt;
== The TEST_COMPLETE macro ==&lt;br /&gt;
&lt;br /&gt;
there is one more macro which exist for most families of macro&lt;br /&gt;
&lt;br /&gt;
 #define TYPE_COMPLETE_LFB TERRAIN ADJACENT LAYER FLAG BUILDER IMAGESTEM&lt;br /&gt;
    {TYPE_ROTATION_RESTRICTED3_RANDOM_LFB  ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small (-@R0-@R1-@R2)}&lt;br /&gt;
    {TYPE_ROTATION_RESTRICTED2_RANDOM_LFB  ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small (-@R0-@R1)}&lt;br /&gt;
    {TYPE_ROTATION_RESTRICTED_RANDOM_LFB   ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small (-@R0)}&lt;br /&gt;
    {TYPE_RESTRICTED_RANDOM_LFB            ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small ()}&lt;br /&gt;
    {TYPE_SINGLE_RANDOM_LFB                ({TERRAIN})               {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
 #enddef&lt;br /&gt;
&lt;br /&gt;
This macro is a simpler way of handling the most common case of &amp;quot;use a smaller variation when next to some terrains&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* If it has three neighbours, it will try IMAGESTEM-small#-R1-R2-R3&lt;br /&gt;
* if it has two neighbour or the correct image wasn't found, it will try two-sided variations&lt;br /&gt;
* if it has one neighbour or the correct image wasn't found, it will try one sided variations&lt;br /&gt;
* if it has still not found anything, it will try IMAGESTEM-small&lt;br /&gt;
* if it has no neighbour or still hasn't found anything, it will try based on IMAGESTEM&lt;br /&gt;
&lt;br /&gt;
== Image Builder macros ==&lt;br /&gt;
=== The problem ===&lt;br /&gt;
suppose we want to animate a transition with the following line&lt;br /&gt;
 image=image1;image2;image3&lt;br /&gt;
Since it's a transition, we would like to write something like (simplified)&lt;br /&gt;
 {TRANSITION_BASE &amp;lt;parameters&amp;gt; image1;image2;image3}&lt;br /&gt;
However, for a north transition, the macro would expand to something similar to&lt;br /&gt;
 image=image1;image2;image3-n&lt;br /&gt;
Which is wrong, we want the prefix added to all images in the animation&lt;br /&gt;
 image=image1-n;image2-n;image3-n&lt;br /&gt;
To get the result we want, we use macro indirection. In other word, we have a set of macros who take two parameters&lt;br /&gt;
 #define BUILDER IMAGESTEM POSTFIX&lt;br /&gt;
Which are in charge of returning what should be on the right side of the image= So, with the following macro&lt;br /&gt;
 #define MY_BUILDER IMAGESTEM POSTFIX&lt;br /&gt;
 {IMAGESTEM}1{POSTFIX};{IMAGESTEM}2{POSTFIX};{IMAGESTEM}3{POSTFIX};&lt;br /&gt;
and the following code in the TRANSITION_BASE macro&lt;br /&gt;
 image={{BUILDER} {IMAGESTEM} -n}&lt;br /&gt;
a call to&lt;br /&gt;
 {TRANSITION_BASE_B &amp;lt;parameters&amp;gt; MY_BUILDER image}&lt;br /&gt;
would correctly expand.&lt;br /&gt;
&lt;br /&gt;
=== Common parameters for all builders ===&lt;br /&gt;
All builders must have exactly the same parameters&lt;br /&gt;
* IMAGESTEM : the base name of the image from which to build&lt;br /&gt;
* POSTFIX : a postfix to add to all images&lt;br /&gt;
 &lt;br /&gt;
=== IMAGE_SINGLE IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a single image image= line (i.e not animated) mainly used as default value for BUILDER parameter of meta-macros&lt;br /&gt;
=== ANIMATION_03 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a Three image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
=== ANIMATION_04 IMAGESTEM POSTFIX === &lt;br /&gt;
builds a four image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
=== ANIMATION_10 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a ten image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
* IMAGESTEM-A05&lt;br /&gt;
* IMAGESTEM-A06&lt;br /&gt;
* IMAGESTEM-A07&lt;br /&gt;
* IMAGESTEM-A08&lt;br /&gt;
* IMAGESTEM-A09&lt;br /&gt;
* IMAGESTEM-A10&lt;br /&gt;
=== ANIMATION_15 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a fifteen image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
* IMAGESTEM-A05&lt;br /&gt;
* IMAGESTEM-A06&lt;br /&gt;
* IMAGESTEM-A07&lt;br /&gt;
* IMAGESTEM-A08&lt;br /&gt;
* IMAGESTEM-A09&lt;br /&gt;
* IMAGESTEM-A10&lt;br /&gt;
* IMAGESTEM-A11&lt;br /&gt;
* IMAGESTEM-A12&lt;br /&gt;
* IMAGESTEM-A13&lt;br /&gt;
* IMAGESTEM-A14&lt;br /&gt;
* IMAGESTEM-A15&lt;br /&gt;
=== ANIMATION_04_140 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a four image animation, each image being displayed for 140 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
=== ANIMATION_18_70 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a eighteen image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
* IMAGESTEM-A05&lt;br /&gt;
* IMAGESTEM-A06&lt;br /&gt;
* IMAGESTEM-A07&lt;br /&gt;
* IMAGESTEM-A08&lt;br /&gt;
* IMAGESTEM-A09&lt;br /&gt;
* IMAGESTEM-A10&lt;br /&gt;
* IMAGESTEM-A11&lt;br /&gt;
* IMAGESTEM-A12&lt;br /&gt;
* IMAGESTEM-A13&lt;br /&gt;
* IMAGESTEM-A14&lt;br /&gt;
* IMAGESTEM-A15&lt;br /&gt;
* IMAGESTEM-A16&lt;br /&gt;
* IMAGESTEM-A17&lt;br /&gt;
* IMAGESTEM-A18&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Base tile related macros ==&lt;br /&gt;
&lt;br /&gt;
Base terrains have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''TERRAIN_BASE'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': -1000&lt;br /&gt;
* '''FLAG'''': ''base''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Overlay related macros==&lt;br /&gt;
&lt;br /&gt;
Overlays have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''OVERLAY'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': 0&lt;br /&gt;
* '''FLAG'''': ''overlay''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Keep related macros ==&lt;br /&gt;
&lt;br /&gt;
Keeps are base terrains (they use the same flag) but drawn on layer -1&lt;br /&gt;
&lt;br /&gt;
Keeps have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''KEEP_BASE'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': -1&lt;br /&gt;
* '''FLAG'''': ''base''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Village related macros ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
villages have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''VILLAGE'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': 0&lt;br /&gt;
* '''FLAG'''': ''village''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Transition related macros ==&lt;br /&gt;
&lt;br /&gt;
=== Generic Functions ===&lt;br /&gt;
transitions  have most of the macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''TRANSITION'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': -500&lt;br /&gt;
* '''FLAG''': ''transition-@&amp;lt;side&amp;gt;''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However, unlike all previous type of macros, they are related to a ''side'' instead of the whole hex. Thus the following rules&lt;br /&gt;
&lt;br /&gt;
* There are no ROTATION macros. Since they are always side related, they are always transition like&lt;br /&gt;
* All images are named as if they were ROTATION macros (since they are painting on a side&lt;br /&gt;
* The flags are set and tested on a side related basis. i.e there can be more than one transition per tile, if they don't cover the same direction&lt;br /&gt;
* the non-RESTRICTED variations exist, they will apply unconditionnaly, whatever the neighbour is... This is usually not what you want&lt;br /&gt;
* for RESTRICTED2 and RESTRICTED3, we only check for neighbouring hex of the ADJACENT type. This makes more sense for borders&lt;br /&gt;
&lt;br /&gt;
=== DISABLE_BASE_TRANSITIONS TERRAINLIST ===&lt;br /&gt;
This macro will set all transition-@R* on the tile (''n,ne,se,s,sw'')  thus preventing any other transition from being added&lt;br /&gt;
&lt;br /&gt;
'''Flag Management'''&lt;br /&gt;
will set all transition-@R* on the TERRAINLIST tiles&lt;br /&gt;
=== DISABLE_BASE_TRANSITIONS_F TERRAINLIST FLAG ===&lt;br /&gt;
This macro will set all &amp;lt;FLAG&amp;gt;-@R* on the tile (''n,ne,se,s,sw'')  thus preventing any other transition from being added&lt;br /&gt;
&lt;br /&gt;
'''Flag Management'''&lt;br /&gt;
will set all &amp;lt;FLAG&amp;gt;-@R* on the TERRAINLIST tiles&lt;br /&gt;
&lt;br /&gt;
== Terrain Specific ==&lt;br /&gt;
=== SIMPLE_FOREST_TERRAIN TERRAINLIST ADJACENT IMAGESTEM ===&lt;br /&gt;
&lt;br /&gt;
will use an image IMAGESTEM-small# when next to adjacent and IMAGESTEM# anywhere else&lt;br /&gt;
&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-small&lt;br /&gt;
* IMAGESTEM-small2&lt;br /&gt;
* IMAGESTEM-small3&lt;br /&gt;
* IMAGESTEM-small4&lt;br /&gt;
* IMAGESTEM-small5&lt;br /&gt;
* IMAGESTEM-small6&lt;br /&gt;
* IMAGESTEM-small7&lt;br /&gt;
* IMAGESTEM-small8&lt;br /&gt;
* IMAGESTEM-small9&lt;br /&gt;
* IMAGESTEM&lt;br /&gt;
* IMAGESTEM2&lt;br /&gt;
* IMAGESTEM3&lt;br /&gt;
* IMAGESTEM4&lt;br /&gt;
* IMAGESTEM5&lt;br /&gt;
* IMAGESTEM6&lt;br /&gt;
* IMAGESTEM7&lt;br /&gt;
* IMAGESTEM8&lt;br /&gt;
* IMAGESTEM9&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''' Parameters ''' &lt;br /&gt;
* '''ADJACENT''': regexp of terrains that will use -small images&lt;br /&gt;
&lt;br /&gt;
''' Flage management '''&lt;br /&gt;
this is technically an overlay. It is drawn on layer 0 with other overlays and test/set the overlay flag&lt;br /&gt;
&lt;br /&gt;
== TO BE DOCUMENTED ==&lt;br /&gt;
=== misc.cfg ===&lt;br /&gt;
#meta-macro WALL_TRANSITION TERRAIN ADJACENT P=PROB=100 L=LAYER=0 F=FLAG=overlay IMAGESTEM&lt;br /&gt;
#meta-macro WALL_TRANSITION2 TERRAIN1 TERRAIN2 ADJACENT P=PROB=100 L=LAYER=0 F=FLAG=overlay IMAGESTEM&lt;br /&gt;
#meta-macro WALL_TRANSITION3 TERRAIN1 TERRAIN2 TERRAIN3 P=PROB=100 L=LAYER=0 F=FLAG=overlay IMAGESTEM&lt;br /&gt;
&lt;br /&gt;
#define SIMPLE_OVERLAY_TERRAIN TERRAINLIST RESTRICTING IMAGESTEM&lt;br /&gt;
&lt;br /&gt;
=== bridges.cfg ===&lt;br /&gt;
#define IMAGE_L_N LAYER NAME&lt;br /&gt;
#define DOCK_END IMAGESTEM WATER_TERRAIN_NAME BRIDGETYPE_NAME BEACHSIDE_AFFIX X Y&lt;br /&gt;
#define RAMP_BRIDGE IMAGESTEM BRIDGETYPE_NAME BRIDGES_VALUE R0 R1 R2 R3 R4 R5 S0 S1 S2 S3 S4 S5&lt;br /&gt;
#define RAMP_END IMAGESTEM WATER_TERRAIN_NAME NOTERM_AFFIX BRIDGETYPE_NAME R0 R1 R2 R3 R4 R5 X Y&lt;br /&gt;
#define BRIDGE_Y BRIDGETYPE1_NAME BRIDGETYPE2_NAME BRIDGETYPE3_NAME Y_IMAGE R0 R1 R2 R3 R4 R5 S0 S1 S2 S3 S4 S5&lt;br /&gt;
#define BRIDGECONNECT BRIDGETYPE_NAME R0 R1 R2 R3 R4 R5 X Y&lt;br /&gt;
#define CORNER ANGLE_IMAGE BRIDGETYPE1_NAME BRIDGETYPE2_NAME A1 A2 A3 A4 A5 A6 S0 S1 S2 S3 S4 S5&lt;br /&gt;
#define BRIDGE SE_NW_VALUE N_S_VALUE NE_SW_VALUE WATER_TERRAIN_NAME NOTERM_AFFIX IMAGESTEM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== canyon.cfg ===&lt;br /&gt;
#define TRANS_0 TERRAIN&lt;br /&gt;
#define TRANS_1 TERRAIN&lt;br /&gt;
#define TRANS_2 TERRAIN&lt;br /&gt;
#define TRANS_3 TERRAIN&lt;br /&gt;
#define TRANS_4 TERRAIN&lt;br /&gt;
#define TRANS_5 TERRAIN&lt;br /&gt;
#define CANYON TERRAIN IMAGESTEM&lt;br /&gt;
=== castles.cfg ===&lt;br /&gt;
#define TERRAIN_ADJACENT_CORNER_LAYER TERRAIN1 TERRAIN2 TERRAIN3 LAYER BASE_POSITION IMAGESTEM&lt;br /&gt;
#define TERRAIN_ADJACENT_CORNER TERRAIN1 TERRAIN2 TERRAIN3 BASE_POSITION IMAGESTEM&lt;br /&gt;
#define TERRAIN_ADJACENT_CORNER_FLAG1 TERRAIN1 TERRAIN2 TERRAIN3 BASE_POSITION FLAG IMAGESTEM&lt;br /&gt;
#define TERRAIN_ADJACENT_CORNER_PROB TERRAIN1 TERRAIN2 TERRAIN3 BASE_POSITION IMAGESTEM PROB&lt;br /&gt;
=== foresetcastle.cfg ===&lt;br /&gt;
#define FORESTADJCASTLEA FOREST_ID ID PROB TILE_IMAGE&lt;br /&gt;
#define FORESTADJCASTLES FOREST_ID ID PROB TILE_IMAGE&lt;br /&gt;
#define FORESTADJCASTLEO FOREST_ID ID PROB TILE_IMAGE&lt;br /&gt;
#define FORESTADJCASTLE FOREST_ID ID PROB TILE_IMAGE&lt;br /&gt;
#define FORESTADJ FOREST_ID ID PROB TILE_IMAGE&lt;br /&gt;
#define MOUNTAINADJCASTLEA FOREST_ID ID PROB TILE_IMAGE&lt;br /&gt;
=== mountains.cfg ===&lt;br /&gt;
#define MOUNTAINS_2x2 TERRAIN PROB FLAG IMAGESTEM&lt;br /&gt;
#define MOUNTAINS_2x4_NW_SE TERRAIN PROB FLAG IMAGESTEM&lt;br /&gt;
#define MOUNTAINS_2x4_SW_NE TERRAIN PROB FLAG IMAGESTEM&lt;br /&gt;
#define MOUNTAINS_1x3_NW_SE TERRAIN PROB FLAG IMAGESTEM&lt;br /&gt;
#define MOUNTAINS_1x3_SW_NE TERRAIN PROB FLAG IMAGESTEM&lt;br /&gt;
#define MOUNTAIN_SINGLE TERRAIN PROB FLAG IMAGESTEM&lt;br /&gt;
#define PEAKS_LARGE TERRAIN PROB FLAG IMAGESTEM&lt;br /&gt;
#define PEAKS_1x2_SW_NE TERRAIN PROB FLAG IMAGESTEM&lt;br /&gt;
=== rails.cfg ===&lt;br /&gt;
#define RAIL_SWITCH IMAGESTEM BRIDGETYPE_NAME BRIDGETYPE_JOIN_NAME SWITCHSIDE_AFFIX MAINRAIL_AFFIX SWITCH_REVERSE_AFFIX X Y&lt;br /&gt;
#define RAIL_END IMAGESTEM BRIDGETYPE_NAME TRACKSIDE_AFFIX X Y&lt;br /&gt;
#define RAILWAY SE_NW_VALUE N_S_VALUE NE_SW_VALUE IMAGESTEM&lt;br /&gt;
&lt;br /&gt;
=== walls.cfg ===&lt;br /&gt;
#define IMAGE_NW BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_N BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_NE BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_SE BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_S BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_SW BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_NW_N BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_N_NE BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_NE_SE BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_SE_S BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_S_SW BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_SW_NW BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_NW_N_NE BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_N_NE_SE BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_NE_SE_S BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_SE_S_SW BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_S_SW_NW BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_SW_NW_N BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_N_NE_SE_S BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_S_SW_NW_N BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_NW_N_NE_SE BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_SW_NW_N_NE BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_NE_SE_S_SW BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_SE_S_SW_NW BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_NW_N_NE_SE_S BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_N_NE_SE_S_SW BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_NE_SE_S_SW_NW BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_SE_S_SW_NW_N BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_S_SW_NW_N_NE BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_SW_NW_N_NE_SE BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_N_NE_SE_S_SW_NW BUILDER IMAGESTEM&lt;br /&gt;
#define WALL_1_VARIATION PROB TERRAIN_PATTERN ADJACENT BUILDER IMAGESTEM&lt;br /&gt;
#define WALL_ADJACENT_1 TERRAIN_PATTERN ADJACENT BUILDER IMAGESTEM&lt;br /&gt;
#define WALL_2_VARIATION PROB TERRAIN_PATTERN ADJACENT BUILDER IMAGESTEM&lt;br /&gt;
#define WALL_ADJACENT_2 TERRAIN_PATTERN ADJACENT BUILDER IMAGESTEM&lt;br /&gt;
#define WALL_ADJACENT_3 TERRAIN_PATTERN ADJACENT BUILDER IMAGESTEM&lt;br /&gt;
#define WALL_ADJACENT_4 TERRAIN_PATTERN ADJACENT BUILDER IMAGESTEM&lt;br /&gt;
#define WALL_ADJACENT_5 TERRAIN_PATTERN ADJACENT BUILDER IMAGESTEM&lt;br /&gt;
#define WALL_ADJACENT_6 TERRAIN_PATTERN ADJACENT BUILDER IMAGESTEM&lt;br /&gt;
#define DISABLE_WALLS TERRAIN1 TERRAIN2 TERRAIN3&lt;br /&gt;
#define WALL_ADJACENT TERRAIN_PATTERN ADJACENT BUILDER IMAGESTEM BASE_NAME&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=TerrainMacrosWML&amp;diff=36760</id>
		<title>TerrainMacrosWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=TerrainMacrosWML&amp;diff=36760"/>
		<updated>2010-06-13T09:56:39Z</updated>

		<summary type="html">&lt;p&gt;Boucman: /* Transition related macros */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DevFeature1.9}}&lt;br /&gt;
This page is entirely base on the 1.9 macros, they are very close to the 1.8 macros, but no attempt has been done to document the difference&lt;br /&gt;
&lt;br /&gt;
== Flag Management ==&lt;br /&gt;
This section lists the common flags used by macros and their high level signification&lt;br /&gt;
* '''base''': is set on all hex when the base tile is set.&lt;br /&gt;
* '''overlay''': is set on all hex that have something drawn on the hex itself (i.e not a transition) over the base terrain.&lt;br /&gt;
* '''village''': is set when a village is added on a tile.&lt;br /&gt;
* '''transition-@R*''': is set on a tile which has a transition on it's corresponding side set (i.e if there is a transition with the tile at its north, transition-n will be set) possible values: ''n,ne,nw,s,se,sw'' Also not that the macros handl it in a reciprocal way. in other word if a tile has transition-n set, it's northern neighbour should have transition-s set&lt;br /&gt;
* '''angle_@R*''' : used for bridges, the bridge on this tile. The bridge has an &amp;quot;exit direction&amp;quot; in the @R direction indicated.&lt;br /&gt;
* '''angleaway_@R*''' : used for bridges, the bridge does NOT have an exit on the given direction&lt;br /&gt;
&lt;br /&gt;
== Layer Management ==&lt;br /&gt;
* '''-1000''': default layer for base tiles&lt;br /&gt;
* '''-80''': overlays that should always be drawn under units (like rails etc...)&lt;br /&gt;
* '''0''': default layer for overlays and villages&lt;br /&gt;
Normal units are drawn above layer 0, except if the basey of the tile is &amp;gt; 56 in which case they are drawn below&lt;br /&gt;
* '''1''': used by the base tile of castles/keeps&lt;br /&gt;
Flying/moving units are always drawn over terrain&lt;br /&gt;
== Precedence Management ==&lt;br /&gt;
TBSL&lt;br /&gt;
== Base Management ==&lt;br /&gt;
TBSL&lt;br /&gt;
&lt;br /&gt;
== Macro naming convention ==&lt;br /&gt;
for some common types of tiles, we have a lot of variation of macros. To simplify, they follow a naming convention&lt;br /&gt;
&lt;br /&gt;
=== Macro names ===&lt;br /&gt;
Type is the type of macros (like KEEP,OVERLAY etc...) we are using&lt;br /&gt;
&lt;br /&gt;
* '''TYPE'''''_PLFB'' : puts an image on a tile&lt;br /&gt;
* '''TYPE_RANDOM'''''_LFB'' : puts an image from a random set on a tile&lt;br /&gt;
* '''TYPE_RESTRICTED[23]'''''_PLFB'': puts an image on a tile if the tile has one [two or three] neighbours of a given type&lt;br /&gt;
* '''TYPE_RESTRICTED[23]_RANDOM'''''_PLFB'': combination of above&lt;br /&gt;
* '''TYPE_ROTATION_RESTRICTED[23]'''''_PLFB'': combination of above + the images will be named according to where the neighbours are&lt;br /&gt;
* '''TYPE_ROTATION_RESTRICTED[23]_RANDOM'''''_PLFB'': combination of above&lt;br /&gt;
&lt;br /&gt;
here ''_PLFB'' means any combination of _P _PL _PF etc... will also be correct macro names with the corresponding parameters&lt;br /&gt;
&lt;br /&gt;
each section describing a type will explain what values for PLFB are used for the functions that don't have them as parameters&lt;br /&gt;
&lt;br /&gt;
=== Macro Parameters ===&lt;br /&gt;
&lt;br /&gt;
These macros always have the parameters in the same orders (not all macros have all parameters, see below&lt;br /&gt;
&lt;br /&gt;
 TERRAIN ADJACENT PROB LAYER FLAG BUILDER IMAGESTEM&lt;br /&gt;
&lt;br /&gt;
* '''TERRAIN''' : the type of terrain to put the image on&lt;br /&gt;
* '''ADJACENT''' : ''only for restricted'' the type of neighbours to test for&lt;br /&gt;
* '''PROB''' : ''only for _P'' The probability of the rules generated by the macros of being applied. See the discussion in [[TerrainGraphicsTutorial#Cumulative_Probabilities]] for complications&lt;br /&gt;
* '''LAYER''' : ''only for _L'' The layer that will be used for the generated rules&lt;br /&gt;
* '''FLAG''' : ''only for _F'' A flag to test and set on the tile&lt;br /&gt;
* '''BUILDER''' : ''only for _B'' the builder macro that will be used to create the animations  in the image= field of the generated terrain code. See the dicussion at the begining of the builder section&lt;br /&gt;
* '''IMAGESTEM''': the basename on which filenames will be based.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Image Names ===&lt;br /&gt;
* '''_RANDOM_'''&lt;br /&gt;
** {{BUILDER} {IMAGESTEM} ()}&lt;br /&gt;
** {{BUILDER} {IMAGESTEM}2 ()}&lt;br /&gt;
** {{BUILDER} {IMAGESTEM}3 ()}&lt;br /&gt;
** ''etc up to 11''&lt;br /&gt;
* '''_ROTATION_'''&lt;br /&gt;
** '''1''' : {{BUILDER} {IMAGESTEM} (-@R0)} with @R0 being the orientation of the neighbouring tile&lt;br /&gt;
** '''2''' : {{BUILDER} {IMAGESTEM} (-@R0-@R1)} with @R0 and @R1 being the orientations of the neighbouring tiles&lt;br /&gt;
** '''3''' : {{BUILDER} {IMAGESTEM} (-@R0-@R1-@R2)} with @R0, @R1 and @R2 being the orientations of the neighbouring tiles&lt;br /&gt;
* '''_RANDOM_ + _ROTATION_'''&lt;br /&gt;
** {{BUILDER} {IMAGESTEM}# (-@R#)} ''similar to above with all combinations''&lt;br /&gt;
== The TEST_COMPLETE macro ==&lt;br /&gt;
&lt;br /&gt;
there is one more macro which exist for most families of macro&lt;br /&gt;
&lt;br /&gt;
 #define TYPE_COMPLETE_LFB TERRAIN ADJACENT LAYER FLAG BUILDER IMAGESTEM&lt;br /&gt;
    {TYPE_ROTATION_RESTRICTED3_RANDOM_LFB  ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small (-@R0-@R1-@R2)}&lt;br /&gt;
    {TYPE_ROTATION_RESTRICTED2_RANDOM_LFB  ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small (-@R0-@R1)}&lt;br /&gt;
    {TYPE_ROTATION_RESTRICTED_RANDOM_LFB   ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small (-@R0)}&lt;br /&gt;
    {TYPE_RESTRICTED_RANDOM_LFB            ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small ()}&lt;br /&gt;
    {TYPE_SINGLE_RANDOM_LFB                ({TERRAIN})               {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
 #enddef&lt;br /&gt;
&lt;br /&gt;
This macro is a simpler way of handling the most common case of &amp;quot;use a smaller variation when next to some terrains&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* If it has three neighbours, it will try IMAGESTEM-small#-R1-R2-R3&lt;br /&gt;
* if it has two neighbour or the correct image wasn't found, it will try two-sided variations&lt;br /&gt;
* if it has one neighbour or the correct image wasn't found, it will try one sided variations&lt;br /&gt;
* if it has still not found anything, it will try IMAGESTEM-small&lt;br /&gt;
* if it has no neighbour or still hasn't found anything, it will try based on IMAGESTEM&lt;br /&gt;
&lt;br /&gt;
== Image Builder macros ==&lt;br /&gt;
=== The problem ===&lt;br /&gt;
suppose we want to animate a transition with the following line&lt;br /&gt;
 image=image1;image2;image3&lt;br /&gt;
Since it's a transition, we would like to write something like (simplified)&lt;br /&gt;
 {TRANSITION_BASE &amp;lt;parameters&amp;gt; image1;image2;image3}&lt;br /&gt;
However, for a north transition, the macro would expand to something similar to&lt;br /&gt;
 image=image1;image2;image3-n&lt;br /&gt;
Which is wrong, we want the prefix added to all images in the animation&lt;br /&gt;
 image=image1-n;image2-n;image3-n&lt;br /&gt;
To get the result we want, we use macro indirection. In other word, we have a set of macros who take two parameters&lt;br /&gt;
 #define BUILDER IMAGESTEM POSTFIX&lt;br /&gt;
Which are in charge of returning what should be on the right side of the image= So, with the following macro&lt;br /&gt;
 #define MY_BUILDER IMAGESTEM POSTFIX&lt;br /&gt;
 {IMAGESTEM}1{POSTFIX};{IMAGESTEM}2{POSTFIX};{IMAGESTEM}3{POSTFIX};&lt;br /&gt;
and the following code in the TRANSITION_BASE macro&lt;br /&gt;
 image={{BUILDER} {IMAGESTEM} -n}&lt;br /&gt;
a call to&lt;br /&gt;
 {TRANSITION_BASE_B &amp;lt;parameters&amp;gt; MY_BUILDER image}&lt;br /&gt;
would correctly expand.&lt;br /&gt;
&lt;br /&gt;
=== Common parameters for all builders ===&lt;br /&gt;
All builders must have exactly the same parameters&lt;br /&gt;
* IMAGESTEM : the base name of the image from which to build&lt;br /&gt;
* POSTFIX : a postfix to add to all images&lt;br /&gt;
 &lt;br /&gt;
=== IMAGE_SINGLE IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a single image image= line (i.e not animated) mainly used as default value for BUILDER parameter of meta-macros&lt;br /&gt;
=== ANIMATION_03 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a Three image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
=== ANIMATION_04 IMAGESTEM POSTFIX === &lt;br /&gt;
builds a four image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
=== ANIMATION_10 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a ten image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
* IMAGESTEM-A05&lt;br /&gt;
* IMAGESTEM-A06&lt;br /&gt;
* IMAGESTEM-A07&lt;br /&gt;
* IMAGESTEM-A08&lt;br /&gt;
* IMAGESTEM-A09&lt;br /&gt;
* IMAGESTEM-A10&lt;br /&gt;
=== ANIMATION_15 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a fifteen image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
* IMAGESTEM-A05&lt;br /&gt;
* IMAGESTEM-A06&lt;br /&gt;
* IMAGESTEM-A07&lt;br /&gt;
* IMAGESTEM-A08&lt;br /&gt;
* IMAGESTEM-A09&lt;br /&gt;
* IMAGESTEM-A10&lt;br /&gt;
* IMAGESTEM-A11&lt;br /&gt;
* IMAGESTEM-A12&lt;br /&gt;
* IMAGESTEM-A13&lt;br /&gt;
* IMAGESTEM-A14&lt;br /&gt;
* IMAGESTEM-A15&lt;br /&gt;
=== ANIMATION_04_140 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a four image animation, each image being displayed for 140 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
=== ANIMATION_18_70 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a eighteen image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
* IMAGESTEM-A05&lt;br /&gt;
* IMAGESTEM-A06&lt;br /&gt;
* IMAGESTEM-A07&lt;br /&gt;
* IMAGESTEM-A08&lt;br /&gt;
* IMAGESTEM-A09&lt;br /&gt;
* IMAGESTEM-A10&lt;br /&gt;
* IMAGESTEM-A11&lt;br /&gt;
* IMAGESTEM-A12&lt;br /&gt;
* IMAGESTEM-A13&lt;br /&gt;
* IMAGESTEM-A14&lt;br /&gt;
* IMAGESTEM-A15&lt;br /&gt;
* IMAGESTEM-A16&lt;br /&gt;
* IMAGESTEM-A17&lt;br /&gt;
* IMAGESTEM-A18&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Base tile related macros ==&lt;br /&gt;
&lt;br /&gt;
Base terrains have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''TERRAIN_BASE'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': -1000&lt;br /&gt;
* '''FLAG'''': ''base''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Overlay related macros==&lt;br /&gt;
&lt;br /&gt;
Overlays have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''OVERLAY'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': 0&lt;br /&gt;
* '''FLAG'''': ''overlay''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Keep related macros ==&lt;br /&gt;
&lt;br /&gt;
Keeps are base terrains (they use the same flag) but drawn on layer -1&lt;br /&gt;
&lt;br /&gt;
Keeps have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''KEEP_BASE'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': -1&lt;br /&gt;
* '''FLAG'''': ''base''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Village related macros ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
villages have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''VILLAGE'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': 0&lt;br /&gt;
* '''FLAG'''': ''village''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Transition related macros ==&lt;br /&gt;
&lt;br /&gt;
=== Generic Functions ===&lt;br /&gt;
transitions  have most of the macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''TRANSITION'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': -500&lt;br /&gt;
* '''FLAG''': ''transition-@&amp;lt;side&amp;gt;''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However, unlike all previous type of macros, they are related to a ''side'' instead of the whole hex. Thus the following rules&lt;br /&gt;
&lt;br /&gt;
* There are no ROTATION macros. Since they are always side related, they are always transition like&lt;br /&gt;
* All images are named as if they were ROTATION macros (since they are painting on a side&lt;br /&gt;
* The flags are set and tested on a side related basis. i.e there can be more than one transition per tile, if they don't cover the same direction&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== DISABLE_BASE_TRANSITIONS TERRAINLIST ===&lt;br /&gt;
This macro will set all transition-@R* on the tile (''n,ne,se,s,sw'')  thus preventing any other transition from being added&lt;br /&gt;
&lt;br /&gt;
'''Flag Management'''&lt;br /&gt;
will set all transition-@R* on the TERRAINLIST tiles&lt;br /&gt;
=== DISABLE_BASE_TRANSITIONS_F TERRAINLIST FLAG ===&lt;br /&gt;
This macro will set all &amp;lt;FLAG&amp;gt;-@R* on the tile (''n,ne,se,s,sw'')  thus preventing any other transition from being added&lt;br /&gt;
&lt;br /&gt;
'''Flag Management'''&lt;br /&gt;
will set all &amp;lt;FLAG&amp;gt;-@R* on the TERRAINLIST tiles&lt;br /&gt;
&lt;br /&gt;
== Terrain Specific ==&lt;br /&gt;
=== SIMPLE_FOREST_TERRAIN TERRAINLIST ADJACENT IMAGESTEM ===&lt;br /&gt;
&lt;br /&gt;
will use an image IMAGESTEM-small# when next to adjacent and IMAGESTEM# anywhere else&lt;br /&gt;
&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-small&lt;br /&gt;
* IMAGESTEM-small2&lt;br /&gt;
* IMAGESTEM-small3&lt;br /&gt;
* IMAGESTEM-small4&lt;br /&gt;
* IMAGESTEM-small5&lt;br /&gt;
* IMAGESTEM-small6&lt;br /&gt;
* IMAGESTEM-small7&lt;br /&gt;
* IMAGESTEM-small8&lt;br /&gt;
* IMAGESTEM-small9&lt;br /&gt;
* IMAGESTEM&lt;br /&gt;
* IMAGESTEM2&lt;br /&gt;
* IMAGESTEM3&lt;br /&gt;
* IMAGESTEM4&lt;br /&gt;
* IMAGESTEM5&lt;br /&gt;
* IMAGESTEM6&lt;br /&gt;
* IMAGESTEM7&lt;br /&gt;
* IMAGESTEM8&lt;br /&gt;
* IMAGESTEM9&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''' Parameters ''' &lt;br /&gt;
* '''ADJACENT''': regexp of terrains that will use -small images&lt;br /&gt;
&lt;br /&gt;
''' Flage management '''&lt;br /&gt;
this is technically an overlay. It is drawn on layer 0 with other overlays and test/set the overlay flag&lt;br /&gt;
&lt;br /&gt;
== TO BE DOCUMENTED ==&lt;br /&gt;
=== misc.cfg ===&lt;br /&gt;
#meta-macro WALL_TRANSITION TERRAIN ADJACENT P=PROB=100 L=LAYER=0 F=FLAG=overlay IMAGESTEM&lt;br /&gt;
#meta-macro WALL_TRANSITION2 TERRAIN1 TERRAIN2 ADJACENT P=PROB=100 L=LAYER=0 F=FLAG=overlay IMAGESTEM&lt;br /&gt;
#meta-macro WALL_TRANSITION3 TERRAIN1 TERRAIN2 TERRAIN3 P=PROB=100 L=LAYER=0 F=FLAG=overlay IMAGESTEM&lt;br /&gt;
&lt;br /&gt;
#define SIMPLE_OVERLAY_TERRAIN TERRAINLIST RESTRICTING IMAGESTEM&lt;br /&gt;
&lt;br /&gt;
=== bridges.cfg ===&lt;br /&gt;
#define IMAGE_L_N LAYER NAME&lt;br /&gt;
#define DOCK_END IMAGESTEM WATER_TERRAIN_NAME BRIDGETYPE_NAME BEACHSIDE_AFFIX X Y&lt;br /&gt;
#define RAMP_BRIDGE IMAGESTEM BRIDGETYPE_NAME BRIDGES_VALUE R0 R1 R2 R3 R4 R5 S0 S1 S2 S3 S4 S5&lt;br /&gt;
#define RAMP_END IMAGESTEM WATER_TERRAIN_NAME NOTERM_AFFIX BRIDGETYPE_NAME R0 R1 R2 R3 R4 R5 X Y&lt;br /&gt;
#define BRIDGE_Y BRIDGETYPE1_NAME BRIDGETYPE2_NAME BRIDGETYPE3_NAME Y_IMAGE R0 R1 R2 R3 R4 R5 S0 S1 S2 S3 S4 S5&lt;br /&gt;
#define BRIDGECONNECT BRIDGETYPE_NAME R0 R1 R2 R3 R4 R5 X Y&lt;br /&gt;
#define CORNER ANGLE_IMAGE BRIDGETYPE1_NAME BRIDGETYPE2_NAME A1 A2 A3 A4 A5 A6 S0 S1 S2 S3 S4 S5&lt;br /&gt;
#define BRIDGE SE_NW_VALUE N_S_VALUE NE_SW_VALUE WATER_TERRAIN_NAME NOTERM_AFFIX IMAGESTEM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== canyon.cfg ===&lt;br /&gt;
#define TRANS_0 TERRAIN&lt;br /&gt;
#define TRANS_1 TERRAIN&lt;br /&gt;
#define TRANS_2 TERRAIN&lt;br /&gt;
#define TRANS_3 TERRAIN&lt;br /&gt;
#define TRANS_4 TERRAIN&lt;br /&gt;
#define TRANS_5 TERRAIN&lt;br /&gt;
#define CANYON TERRAIN IMAGESTEM&lt;br /&gt;
=== castles.cfg ===&lt;br /&gt;
#define TERRAIN_ADJACENT_CORNER_LAYER TERRAIN1 TERRAIN2 TERRAIN3 LAYER BASE_POSITION IMAGESTEM&lt;br /&gt;
#define TERRAIN_ADJACENT_CORNER TERRAIN1 TERRAIN2 TERRAIN3 BASE_POSITION IMAGESTEM&lt;br /&gt;
#define TERRAIN_ADJACENT_CORNER_FLAG1 TERRAIN1 TERRAIN2 TERRAIN3 BASE_POSITION FLAG IMAGESTEM&lt;br /&gt;
#define TERRAIN_ADJACENT_CORNER_PROB TERRAIN1 TERRAIN2 TERRAIN3 BASE_POSITION IMAGESTEM PROB&lt;br /&gt;
=== foresetcastle.cfg ===&lt;br /&gt;
#define FORESTADJCASTLEA FOREST_ID ID PROB TILE_IMAGE&lt;br /&gt;
#define FORESTADJCASTLES FOREST_ID ID PROB TILE_IMAGE&lt;br /&gt;
#define FORESTADJCASTLEO FOREST_ID ID PROB TILE_IMAGE&lt;br /&gt;
#define FORESTADJCASTLE FOREST_ID ID PROB TILE_IMAGE&lt;br /&gt;
#define FORESTADJ FOREST_ID ID PROB TILE_IMAGE&lt;br /&gt;
#define MOUNTAINADJCASTLEA FOREST_ID ID PROB TILE_IMAGE&lt;br /&gt;
=== mountains.cfg ===&lt;br /&gt;
#define MOUNTAINS_2x2 TERRAIN PROB FLAG IMAGESTEM&lt;br /&gt;
#define MOUNTAINS_2x4_NW_SE TERRAIN PROB FLAG IMAGESTEM&lt;br /&gt;
#define MOUNTAINS_2x4_SW_NE TERRAIN PROB FLAG IMAGESTEM&lt;br /&gt;
#define MOUNTAINS_1x3_NW_SE TERRAIN PROB FLAG IMAGESTEM&lt;br /&gt;
#define MOUNTAINS_1x3_SW_NE TERRAIN PROB FLAG IMAGESTEM&lt;br /&gt;
#define MOUNTAIN_SINGLE TERRAIN PROB FLAG IMAGESTEM&lt;br /&gt;
#define PEAKS_LARGE TERRAIN PROB FLAG IMAGESTEM&lt;br /&gt;
#define PEAKS_1x2_SW_NE TERRAIN PROB FLAG IMAGESTEM&lt;br /&gt;
=== rails.cfg ===&lt;br /&gt;
#define RAIL_SWITCH IMAGESTEM BRIDGETYPE_NAME BRIDGETYPE_JOIN_NAME SWITCHSIDE_AFFIX MAINRAIL_AFFIX SWITCH_REVERSE_AFFIX X Y&lt;br /&gt;
#define RAIL_END IMAGESTEM BRIDGETYPE_NAME TRACKSIDE_AFFIX X Y&lt;br /&gt;
#define RAILWAY SE_NW_VALUE N_S_VALUE NE_SW_VALUE IMAGESTEM&lt;br /&gt;
&lt;br /&gt;
=== walls.cfg ===&lt;br /&gt;
#define IMAGE_NW BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_N BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_NE BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_SE BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_S BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_SW BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_NW_N BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_N_NE BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_NE_SE BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_SE_S BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_S_SW BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_SW_NW BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_NW_N_NE BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_N_NE_SE BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_NE_SE_S BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_SE_S_SW BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_S_SW_NW BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_SW_NW_N BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_N_NE_SE_S BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_S_SW_NW_N BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_NW_N_NE_SE BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_SW_NW_N_NE BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_NE_SE_S_SW BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_SE_S_SW_NW BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_NW_N_NE_SE_S BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_N_NE_SE_S_SW BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_NE_SE_S_SW_NW BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_SE_S_SW_NW_N BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_S_SW_NW_N_NE BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_SW_NW_N_NE_SE BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_N_NE_SE_S_SW_NW BUILDER IMAGESTEM&lt;br /&gt;
#define WALL_1_VARIATION PROB TERRAIN_PATTERN ADJACENT BUILDER IMAGESTEM&lt;br /&gt;
#define WALL_ADJACENT_1 TERRAIN_PATTERN ADJACENT BUILDER IMAGESTEM&lt;br /&gt;
#define WALL_2_VARIATION PROB TERRAIN_PATTERN ADJACENT BUILDER IMAGESTEM&lt;br /&gt;
#define WALL_ADJACENT_2 TERRAIN_PATTERN ADJACENT BUILDER IMAGESTEM&lt;br /&gt;
#define WALL_ADJACENT_3 TERRAIN_PATTERN ADJACENT BUILDER IMAGESTEM&lt;br /&gt;
#define WALL_ADJACENT_4 TERRAIN_PATTERN ADJACENT BUILDER IMAGESTEM&lt;br /&gt;
#define WALL_ADJACENT_5 TERRAIN_PATTERN ADJACENT BUILDER IMAGESTEM&lt;br /&gt;
#define WALL_ADJACENT_6 TERRAIN_PATTERN ADJACENT BUILDER IMAGESTEM&lt;br /&gt;
#define DISABLE_WALLS TERRAIN1 TERRAIN2 TERRAIN3&lt;br /&gt;
#define WALL_ADJACENT TERRAIN_PATTERN ADJACENT BUILDER IMAGESTEM BASE_NAME&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.wesnoth.org/index.php?title=TerrainMacrosWML&amp;diff=36698</id>
		<title>TerrainMacrosWML</title>
		<link rel="alternate" type="text/html" href="https://wiki.wesnoth.org/index.php?title=TerrainMacrosWML&amp;diff=36698"/>
		<updated>2010-05-30T15:10:04Z</updated>

		<summary type="html">&lt;p&gt;Boucman: /* Flag Management */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DevFeature1.9}}&lt;br /&gt;
This page is entirely base on the 1.9 macros, they are very close to the 1.8 macros, but no attempt has been done to document the difference&lt;br /&gt;
&lt;br /&gt;
== Flag Management ==&lt;br /&gt;
This section lists the common flags used by macros and their high level signification&lt;br /&gt;
* '''base''': is set on all hex when the base tile is set.&lt;br /&gt;
* '''overlay''': is set on all hex that have something drawn on the hex itself (i.e not a transition) over the base terrain.&lt;br /&gt;
* '''village''': is set when a village is added on a tile.&lt;br /&gt;
* '''transition-@R*''': is set on a tile which has a transition on it's corresponding side set (i.e if there is a transition with the tile at its north, transition-n will be set) possible values: ''n,ne,nw,s,se,sw'' Also not that the macros handl it in a reciprocal way. in other word if a tile has transition-n set, it's northern neighbour should have transition-s set&lt;br /&gt;
* '''angle_@R*''' : used for bridges, the bridge on this tile. The bridge has an &amp;quot;exit direction&amp;quot; in the @R direction indicated.&lt;br /&gt;
* '''angleaway_@R*''' : used for bridges, the bridge does NOT have an exit on the given direction&lt;br /&gt;
&lt;br /&gt;
== Layer Management ==&lt;br /&gt;
* '''-1000''': default layer for base tiles&lt;br /&gt;
* '''-80''': overlays that should always be drawn under units (like rails etc...)&lt;br /&gt;
* '''0''': default layer for overlays and villages&lt;br /&gt;
Normal units are drawn above layer 0, except if the basey of the tile is &amp;gt; 56 in which case they are drawn below&lt;br /&gt;
* '''1''': used by the base tile of castles/keeps&lt;br /&gt;
Flying/moving units are always drawn over terrain&lt;br /&gt;
== Precedence Management ==&lt;br /&gt;
TBSL&lt;br /&gt;
== Base Management ==&lt;br /&gt;
TBSL&lt;br /&gt;
&lt;br /&gt;
== Macro naming convention ==&lt;br /&gt;
for some common types of tiles, we have a lot of variation of macros. To simplify, they follow a naming convention&lt;br /&gt;
&lt;br /&gt;
=== Macro names ===&lt;br /&gt;
Type is the type of macros (like KEEP,OVERLAY etc...) we are using&lt;br /&gt;
&lt;br /&gt;
* '''TYPE'''''_PLFB'' : puts an image on a tile&lt;br /&gt;
* '''TYPE_RANDOM'''''_LFB'' : puts an image from a random set on a tile&lt;br /&gt;
* '''TYPE_RESTRICTED[23]'''''_PLFB'': puts an image on a tile if the tile has one [two or three] neighbours of a given type&lt;br /&gt;
* '''TYPE_RESTRICTED[23]_RANDOM'''''_PLFB'': combination of above&lt;br /&gt;
* '''TYPE_ROTATION_RESTRICTED[23]'''''_PLFB'': combination of above + the images will be named according to where the neighbours are&lt;br /&gt;
* '''TYPE_ROTATION_RESTRICTED[23]_RANDOM'''''_PLFB'': combination of above&lt;br /&gt;
&lt;br /&gt;
here ''_PLFB'' means any combination of _P _PL _PF etc... will also be correct macro names with the corresponding parameters&lt;br /&gt;
&lt;br /&gt;
each section describing a type will explain what values for PLFB are used for the functions that don't have them as parameters&lt;br /&gt;
&lt;br /&gt;
=== Macro Parameters ===&lt;br /&gt;
&lt;br /&gt;
These macros always have the parameters in the same orders (not all macros have all parameters, see below&lt;br /&gt;
&lt;br /&gt;
 TERRAIN ADJACENT PROB LAYER FLAG BUILDER IMAGESTEM&lt;br /&gt;
&lt;br /&gt;
* '''TERRAIN''' : the type of terrain to put the image on&lt;br /&gt;
* '''ADJACENT''' : ''only for restricted'' the type of neighbours to test for&lt;br /&gt;
* '''PROB''' : ''only for _P'' The probability of the rules generated by the macros of being applied. See the discussion in [[TerrainGraphicsTutorial#Cumulative_Probabilities]] for complications&lt;br /&gt;
* '''LAYER''' : ''only for _L'' The layer that will be used for the generated rules&lt;br /&gt;
* '''FLAG''' : ''only for _F'' A flag to test and set on the tile&lt;br /&gt;
* '''BUILDER''' : ''only for _B'' the builder macro that will be used to create the animations  in the image= field of the generated terrain code. See the dicussion at the begining of the builder section&lt;br /&gt;
* '''IMAGESTEM''': the basename on which filenames will be based.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Image Names ===&lt;br /&gt;
* '''_RANDOM_'''&lt;br /&gt;
** {{BUILDER} {IMAGESTEM} ()}&lt;br /&gt;
** {{BUILDER} {IMAGESTEM}2 ()}&lt;br /&gt;
** {{BUILDER} {IMAGESTEM}3 ()}&lt;br /&gt;
** ''etc up to 11''&lt;br /&gt;
* '''_ROTATION_'''&lt;br /&gt;
** '''1''' : {{BUILDER} {IMAGESTEM} (-@R0)} with @R0 being the orientation of the neighbouring tile&lt;br /&gt;
** '''2''' : {{BUILDER} {IMAGESTEM} (-@R0-@R1)} with @R0 and @R1 being the orientations of the neighbouring tiles&lt;br /&gt;
** '''3''' : {{BUILDER} {IMAGESTEM} (-@R0-@R1-@R2)} with @R0, @R1 and @R2 being the orientations of the neighbouring tiles&lt;br /&gt;
* '''_RANDOM_ + _ROTATION_'''&lt;br /&gt;
** {{BUILDER} {IMAGESTEM}# (-@R#)} ''similar to above with all combinations''&lt;br /&gt;
== The TEST_COMPLETE macro ==&lt;br /&gt;
&lt;br /&gt;
there is one more macro which exist for most families of macro&lt;br /&gt;
&lt;br /&gt;
 #define TYPE_COMPLETE_LFB TERRAIN ADJACENT LAYER FLAG BUILDER IMAGESTEM&lt;br /&gt;
    {TYPE_ROTATION_RESTRICTED3_RANDOM_LFB  ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small (-@R0-@R1-@R2)}&lt;br /&gt;
    {TYPE_ROTATION_RESTRICTED2_RANDOM_LFB  ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small (-@R0-@R1)}&lt;br /&gt;
    {TYPE_ROTATION_RESTRICTED_RANDOM_LFB   ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small (-@R0)}&lt;br /&gt;
    {TYPE_RESTRICTED_RANDOM_LFB            ({TERRAIN})  ({ADJACENT}) {LAYER} {FLAG} {BUILDER} {IMAGESTEM}-small ()}&lt;br /&gt;
    {TYPE_SINGLE_RANDOM_LFB                ({TERRAIN})               {LAYER} {FLAG} {BUILDER} {IMAGESTEM}}&lt;br /&gt;
 #enddef&lt;br /&gt;
&lt;br /&gt;
This macro is a simpler way of handling the most common case of &amp;quot;use a smaller variation when next to some terrains&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* If it has three neighbours, it will try IMAGESTEM-small#-R1-R2-R3&lt;br /&gt;
* if it has two neighbour or the correct image wasn't found, it will try two-sided variations&lt;br /&gt;
* if it has one neighbour or the correct image wasn't found, it will try one sided variations&lt;br /&gt;
* if it has still not found anything, it will try IMAGESTEM-small&lt;br /&gt;
* if it has no neighbour or still hasn't found anything, it will try based on IMAGESTEM&lt;br /&gt;
&lt;br /&gt;
== Image Builder macros ==&lt;br /&gt;
=== The problem ===&lt;br /&gt;
suppose we want to animate a transition with the following line&lt;br /&gt;
 image=image1;image2;image3&lt;br /&gt;
Since it's a transition, we would like to write something like (simplified)&lt;br /&gt;
 {TRANSITION_BASE &amp;lt;parameters&amp;gt; image1;image2;image3}&lt;br /&gt;
However, for a north transition, the macro would expand to something similar to&lt;br /&gt;
 image=image1;image2;image3-n&lt;br /&gt;
Which is wrong, we want the prefix added to all images in the animation&lt;br /&gt;
 image=image1-n;image2-n;image3-n&lt;br /&gt;
To get the result we want, we use macro indirection. In other word, we have a set of macros who take two parameters&lt;br /&gt;
 #define BUILDER IMAGESTEM POSTFIX&lt;br /&gt;
Which are in charge of returning what should be on the right side of the image= So, with the following macro&lt;br /&gt;
 #define MY_BUILDER IMAGESTEM POSTFIX&lt;br /&gt;
 {IMAGESTEM}1{POSTFIX};{IMAGESTEM}2{POSTFIX};{IMAGESTEM}3{POSTFIX};&lt;br /&gt;
and the following code in the TRANSITION_BASE macro&lt;br /&gt;
 image={{BUILDER} {IMAGESTEM} -n}&lt;br /&gt;
a call to&lt;br /&gt;
 {TRANSITION_BASE_B &amp;lt;parameters&amp;gt; MY_BUILDER image}&lt;br /&gt;
would correctly expand.&lt;br /&gt;
&lt;br /&gt;
=== Common parameters for all builders ===&lt;br /&gt;
All builders must have exactly the same parameters&lt;br /&gt;
* IMAGESTEM : the base name of the image from which to build&lt;br /&gt;
* POSTFIX : a postfix to add to all images&lt;br /&gt;
 &lt;br /&gt;
=== IMAGE_SINGLE IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a single image image= line (i.e not animated) mainly used as default value for BUILDER parameter of meta-macros&lt;br /&gt;
=== ANIMATION_03 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a Three image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
=== ANIMATION_04 IMAGESTEM POSTFIX === &lt;br /&gt;
builds a four image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
=== ANIMATION_10 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a ten image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
* IMAGESTEM-A05&lt;br /&gt;
* IMAGESTEM-A06&lt;br /&gt;
* IMAGESTEM-A07&lt;br /&gt;
* IMAGESTEM-A08&lt;br /&gt;
* IMAGESTEM-A09&lt;br /&gt;
* IMAGESTEM-A10&lt;br /&gt;
=== ANIMATION_15 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a fifteen image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
* IMAGESTEM-A05&lt;br /&gt;
* IMAGESTEM-A06&lt;br /&gt;
* IMAGESTEM-A07&lt;br /&gt;
* IMAGESTEM-A08&lt;br /&gt;
* IMAGESTEM-A09&lt;br /&gt;
* IMAGESTEM-A10&lt;br /&gt;
* IMAGESTEM-A11&lt;br /&gt;
* IMAGESTEM-A12&lt;br /&gt;
* IMAGESTEM-A13&lt;br /&gt;
* IMAGESTEM-A14&lt;br /&gt;
* IMAGESTEM-A15&lt;br /&gt;
=== ANIMATION_04_140 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a four image animation, each image being displayed for 140 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
=== ANIMATION_18_70 IMAGESTEM POSTFIX ===&lt;br /&gt;
builds a eighteen image animation, each image being displayed for 100 ms&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-A01&lt;br /&gt;
* IMAGESTEM-A02&lt;br /&gt;
* IMAGESTEM-A03&lt;br /&gt;
* IMAGESTEM-A04&lt;br /&gt;
* IMAGESTEM-A05&lt;br /&gt;
* IMAGESTEM-A06&lt;br /&gt;
* IMAGESTEM-A07&lt;br /&gt;
* IMAGESTEM-A08&lt;br /&gt;
* IMAGESTEM-A09&lt;br /&gt;
* IMAGESTEM-A10&lt;br /&gt;
* IMAGESTEM-A11&lt;br /&gt;
* IMAGESTEM-A12&lt;br /&gt;
* IMAGESTEM-A13&lt;br /&gt;
* IMAGESTEM-A14&lt;br /&gt;
* IMAGESTEM-A15&lt;br /&gt;
* IMAGESTEM-A16&lt;br /&gt;
* IMAGESTEM-A17&lt;br /&gt;
* IMAGESTEM-A18&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Base tile related macros ==&lt;br /&gt;
&lt;br /&gt;
Base terrains have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''TERRAIN_BASE'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': -1000&lt;br /&gt;
* '''FLAG'''': ''base''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Overlay related macros==&lt;br /&gt;
&lt;br /&gt;
Overlays have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''OVERLAY'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': 0&lt;br /&gt;
* '''FLAG'''': ''overlay''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Keep related macros ==&lt;br /&gt;
&lt;br /&gt;
Keeps are base terrains (they use the same flag) but drawn on layer -1&lt;br /&gt;
&lt;br /&gt;
Keeps have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''KEEP_BASE'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': -1&lt;br /&gt;
* '''FLAG'''': ''base''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Village related macros ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
villages have all the combinations of macros as described in the naming convention section with the following definition&lt;br /&gt;
&lt;br /&gt;
* '''TYPE''' : the name for all macros starts with '''VILLAGE'''&lt;br /&gt;
* '''PROB''' : 100&lt;br /&gt;
* '''LAYER''': 0&lt;br /&gt;
* '''FLAG'''': ''village''&lt;br /&gt;
* '''BUILDER''': IMAGE_SINGLE&lt;br /&gt;
&lt;br /&gt;
== Transition related macros ==&lt;br /&gt;
=== TRANSITION_BASE TERRAIN ADJACENT P=PROB=100 L=LAYER=-500 F=FLAG=transition B=BUILDER=IMAGE_SINGLE IMAGESTEM ===&lt;br /&gt;
&lt;br /&gt;
This is the most basic form of transition, it will try to put a transition between the tile TERRAIN and ADJACENT&lt;br /&gt;
&lt;br /&gt;
It will try to find the best matching image (with ''n,ne,se,s,sw,nw'' for @R flags)&lt;br /&gt;
&lt;br /&gt;
i.e if your TERRAIN matches 2 ADJACENT tiles,&lt;br /&gt;
* it will not match for 4 sided and 3 sided images&lt;br /&gt;
* it will try 2 sided transitions with PROB (see also the FLAG discussion below)&lt;br /&gt;
* if it doesn't match it will 1 sided transition similarly&lt;br /&gt;
&lt;br /&gt;
'''Images Used'''&lt;br /&gt;
* {{BUILDER} {IMAGESTEM} -@R0-@R1-@R2-@R3}&lt;br /&gt;
* {{BUILDER} {IMAGESTEM} -@R0-@R1-@R2}&lt;br /&gt;
* {{BUILDER} {IMAGESTEM} -@R0-@R1}&lt;br /&gt;
* {{BUILDER} {IMAGESTEM} -@R0}&lt;br /&gt;
'''Flag Management'''&lt;br /&gt;
&lt;br /&gt;
This macro checks flags according to the common transition policy, i.e it will check that both this tile and the ADJACENT neighbours don't have the transition-@R# flags before applying.&lt;br /&gt;
&lt;br /&gt;
suppose our TERRAIN has two ADJACENT on north and north east&lt;br /&gt;
&lt;br /&gt;
it will check the following flags before adding {{BUILDER} {IMAGESTEM} -n-ne}&lt;br /&gt;
* TERRAIN has neither transition-n nor transition-ne set&lt;br /&gt;
* the north ADJACENT doesn't have transition-s set&lt;br /&gt;
* the north east ADJACENT doesn't have transition-sw set&lt;br /&gt;
if the conditions are met, it will apply the transition and set all the flags mentionned above&lt;br /&gt;
&lt;br /&gt;
it will then try to apply {{BUILDER} {IMAGESTEM} -n} and check the following flags&lt;br /&gt;
* TERRAIN has neither transition-n set&lt;br /&gt;
* the north ADJACENT doesn't have transition-s set&lt;br /&gt;
(note that if the first rule applied, it will have set some flags and this rule will always fail)&lt;br /&gt;
again, if it can apply, it will set the flags mentionned above&lt;br /&gt;
&lt;br /&gt;
it will then try to apply {{BUILDER} {IMAGESTEM} -ne} and check the following flags&lt;br /&gt;
* TERRAIN has neither transition-ne set&lt;br /&gt;
* the north ADJACENT doesn't have transition-sw set&lt;br /&gt;
(note that if the first rule applied, it will have set some flags and this rule will always fail, however this rule could be applied with the second rule above since no flag contradict)&lt;br /&gt;
again, if it can apply, it will set the flags mentionned above&lt;br /&gt;
&lt;br /&gt;
=== DISABLE_BASE_TRANSITIONS TERRAINLIST ===&lt;br /&gt;
This macro will set all transition-@R* on the tile (''n,ne,se,s,sw'')  thus preventing any other transition from being added&lt;br /&gt;
&lt;br /&gt;
'''Flag Management'''&lt;br /&gt;
will set all transition-@R* on the TERRAINLIST tiles&lt;br /&gt;
&lt;br /&gt;
== Terrain Specific ==&lt;br /&gt;
=== SIMPLE_FOREST_TERRAIN TERRAINLIST ADJACENT IMAGESTEM ===&lt;br /&gt;
&lt;br /&gt;
will use an image IMAGESTEM-small# when next to adjacent and IMAGESTEM# anywhere else&lt;br /&gt;
&lt;br /&gt;
''' Images Used '''&lt;br /&gt;
* IMAGESTEM-small&lt;br /&gt;
* IMAGESTEM-small2&lt;br /&gt;
* IMAGESTEM-small3&lt;br /&gt;
* IMAGESTEM-small4&lt;br /&gt;
* IMAGESTEM-small5&lt;br /&gt;
* IMAGESTEM-small6&lt;br /&gt;
* IMAGESTEM-small7&lt;br /&gt;
* IMAGESTEM-small8&lt;br /&gt;
* IMAGESTEM-small9&lt;br /&gt;
* IMAGESTEM&lt;br /&gt;
* IMAGESTEM2&lt;br /&gt;
* IMAGESTEM3&lt;br /&gt;
* IMAGESTEM4&lt;br /&gt;
* IMAGESTEM5&lt;br /&gt;
* IMAGESTEM6&lt;br /&gt;
* IMAGESTEM7&lt;br /&gt;
* IMAGESTEM8&lt;br /&gt;
* IMAGESTEM9&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
''' Parameters ''' &lt;br /&gt;
* '''ADJACENT''': regexp of terrains that will use -small images&lt;br /&gt;
&lt;br /&gt;
''' Flage management '''&lt;br /&gt;
this is technically an overlay. It is drawn on layer 0 with other overlays and test/set the overlay flag&lt;br /&gt;
&lt;br /&gt;
== TO BE DOCUMENTED ==&lt;br /&gt;
=== misc.cfg ===&lt;br /&gt;
#meta-macro WALL_TRANSITION TERRAIN ADJACENT P=PROB=100 L=LAYER=0 F=FLAG=overlay IMAGESTEM&lt;br /&gt;
#meta-macro WALL_TRANSITION2 TERRAIN1 TERRAIN2 ADJACENT P=PROB=100 L=LAYER=0 F=FLAG=overlay IMAGESTEM&lt;br /&gt;
#meta-macro WALL_TRANSITION3 TERRAIN1 TERRAIN2 TERRAIN3 P=PROB=100 L=LAYER=0 F=FLAG=overlay IMAGESTEM&lt;br /&gt;
&lt;br /&gt;
#define SIMPLE_OVERLAY_TERRAIN TERRAINLIST RESTRICTING IMAGESTEM&lt;br /&gt;
&lt;br /&gt;
=== bridges.cfg ===&lt;br /&gt;
#define IMAGE_L_N LAYER NAME&lt;br /&gt;
#define DOCK_END IMAGESTEM WATER_TERRAIN_NAME BRIDGETYPE_NAME BEACHSIDE_AFFIX X Y&lt;br /&gt;
#define RAMP_BRIDGE IMAGESTEM BRIDGETYPE_NAME BRIDGES_VALUE R0 R1 R2 R3 R4 R5 S0 S1 S2 S3 S4 S5&lt;br /&gt;
#define RAMP_END IMAGESTEM WATER_TERRAIN_NAME NOTERM_AFFIX BRIDGETYPE_NAME R0 R1 R2 R3 R4 R5 X Y&lt;br /&gt;
#define BRIDGE_Y BRIDGETYPE1_NAME BRIDGETYPE2_NAME BRIDGETYPE3_NAME Y_IMAGE R0 R1 R2 R3 R4 R5 S0 S1 S2 S3 S4 S5&lt;br /&gt;
#define BRIDGECONNECT BRIDGETYPE_NAME R0 R1 R2 R3 R4 R5 X Y&lt;br /&gt;
#define CORNER ANGLE_IMAGE BRIDGETYPE1_NAME BRIDGETYPE2_NAME A1 A2 A3 A4 A5 A6 S0 S1 S2 S3 S4 S5&lt;br /&gt;
#define BRIDGE SE_NW_VALUE N_S_VALUE NE_SW_VALUE WATER_TERRAIN_NAME NOTERM_AFFIX IMAGESTEM&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== canyon.cfg ===&lt;br /&gt;
#define TRANS_0 TERRAIN&lt;br /&gt;
#define TRANS_1 TERRAIN&lt;br /&gt;
#define TRANS_2 TERRAIN&lt;br /&gt;
#define TRANS_3 TERRAIN&lt;br /&gt;
#define TRANS_4 TERRAIN&lt;br /&gt;
#define TRANS_5 TERRAIN&lt;br /&gt;
#define CANYON TERRAIN IMAGESTEM&lt;br /&gt;
=== castles.cfg ===&lt;br /&gt;
#define TERRAIN_ADJACENT_CORNER_LAYER TERRAIN1 TERRAIN2 TERRAIN3 LAYER BASE_POSITION IMAGESTEM&lt;br /&gt;
#define TERRAIN_ADJACENT_CORNER TERRAIN1 TERRAIN2 TERRAIN3 BASE_POSITION IMAGESTEM&lt;br /&gt;
#define TERRAIN_ADJACENT_CORNER_FLAG1 TERRAIN1 TERRAIN2 TERRAIN3 BASE_POSITION FLAG IMAGESTEM&lt;br /&gt;
#define TERRAIN_ADJACENT_CORNER_PROB TERRAIN1 TERRAIN2 TERRAIN3 BASE_POSITION IMAGESTEM PROB&lt;br /&gt;
=== foresetcastle.cfg ===&lt;br /&gt;
#define FORESTADJCASTLEA FOREST_ID ID PROB TILE_IMAGE&lt;br /&gt;
#define FORESTADJCASTLES FOREST_ID ID PROB TILE_IMAGE&lt;br /&gt;
#define FORESTADJCASTLEO FOREST_ID ID PROB TILE_IMAGE&lt;br /&gt;
#define FORESTADJCASTLE FOREST_ID ID PROB TILE_IMAGE&lt;br /&gt;
#define FORESTADJ FOREST_ID ID PROB TILE_IMAGE&lt;br /&gt;
#define MOUNTAINADJCASTLEA FOREST_ID ID PROB TILE_IMAGE&lt;br /&gt;
=== mountains.cfg ===&lt;br /&gt;
#define MOUNTAINS_2x2 TERRAIN PROB FLAG IMAGESTEM&lt;br /&gt;
#define MOUNTAINS_2x4_NW_SE TERRAIN PROB FLAG IMAGESTEM&lt;br /&gt;
#define MOUNTAINS_2x4_SW_NE TERRAIN PROB FLAG IMAGESTEM&lt;br /&gt;
#define MOUNTAINS_1x3_NW_SE TERRAIN PROB FLAG IMAGESTEM&lt;br /&gt;
#define MOUNTAINS_1x3_SW_NE TERRAIN PROB FLAG IMAGESTEM&lt;br /&gt;
#define MOUNTAIN_SINGLE TERRAIN PROB FLAG IMAGESTEM&lt;br /&gt;
#define PEAKS_LARGE TERRAIN PROB FLAG IMAGESTEM&lt;br /&gt;
#define PEAKS_1x2_SW_NE TERRAIN PROB FLAG IMAGESTEM&lt;br /&gt;
=== rails.cfg ===&lt;br /&gt;
#define RAIL_SWITCH IMAGESTEM BRIDGETYPE_NAME BRIDGETYPE_JOIN_NAME SWITCHSIDE_AFFIX MAINRAIL_AFFIX SWITCH_REVERSE_AFFIX X Y&lt;br /&gt;
#define RAIL_END IMAGESTEM BRIDGETYPE_NAME TRACKSIDE_AFFIX X Y&lt;br /&gt;
#define RAILWAY SE_NW_VALUE N_S_VALUE NE_SW_VALUE IMAGESTEM&lt;br /&gt;
&lt;br /&gt;
=== walls.cfg ===&lt;br /&gt;
#define IMAGE_NW BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_N BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_NE BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_SE BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_S BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_SW BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_NW_N BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_N_NE BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_NE_SE BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_SE_S BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_S_SW BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_SW_NW BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_NW_N_NE BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_N_NE_SE BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_NE_SE_S BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_SE_S_SW BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_S_SW_NW BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_SW_NW_N BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_N_NE_SE_S BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_S_SW_NW_N BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_NW_N_NE_SE BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_SW_NW_N_NE BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_NE_SE_S_SW BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_SE_S_SW_NW BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_NW_N_NE_SE_S BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_N_NE_SE_S_SW BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_NE_SE_S_SW_NW BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_SE_S_SW_NW_N BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_S_SW_NW_N_NE BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_SW_NW_N_NE_SE BUILDER IMAGESTEM&lt;br /&gt;
#define IMAGE_N_NE_SE_S_SW_NW BUILDER IMAGESTEM&lt;br /&gt;
#define WALL_1_VARIATION PROB TERRAIN_PATTERN ADJACENT BUILDER IMAGESTEM&lt;br /&gt;
#define WALL_ADJACENT_1 TERRAIN_PATTERN ADJACENT BUILDER IMAGESTEM&lt;br /&gt;
#define WALL_2_VARIATION PROB TERRAIN_PATTERN ADJACENT BUILDER IMAGESTEM&lt;br /&gt;
#define WALL_ADJACENT_2 TERRAIN_PATTERN ADJACENT BUILDER IMAGESTEM&lt;br /&gt;
#define WALL_ADJACENT_3 TERRAIN_PATTERN ADJACENT BUILDER IMAGESTEM&lt;br /&gt;
#define WALL_ADJACENT_4 TERRAIN_PATTERN ADJACENT BUILDER IMAGESTEM&lt;br /&gt;
#define WALL_ADJACENT_5 TERRAIN_PATTERN ADJACENT BUILDER IMAGESTEM&lt;br /&gt;
#define WALL_ADJACENT_6 TERRAIN_PATTERN ADJACENT BUILDER IMAGESTEM&lt;br /&gt;
#define DISABLE_WALLS TERRAIN1 TERRAIN2 TERRAIN3&lt;br /&gt;
#define WALL_ADJACENT TERRAIN_PATTERN ADJACENT BUILDER IMAGESTEM BASE_NAME&lt;/div&gt;</summary>
		<author><name>Boucman</name></author>
		
	</entry>
</feed>