Latest Posts

Changes in AboutBattle

Editor Comment

Fixed bulletpoints shown as headers making the page confusing

Revision Differences of Revision 1

This is a draft in for discussion. It is my current idea of how battle should be implemented, but it is likely that it will undergo some changes. ¶

## Attacking ¶

When one player attacks another, he can choose which building is going to be attacked, he then gets a list of soldiers which are available and can choose how many are attacking. The soldiers then start walking towards the enemy building (this is, when all treaties break down). ¶

The defender gets a message that he is attacked, as soon as the attacker pressed the attack button. This is easy, only intercept command EnemyFlagAction. ¶

The defenders soldiers react automatically to the attack: a few of them walk towards the attacking soldiers and intercept them; the active defending soldiers come from all military buildings in the are, not only from the attacked one. ¶
When a defending soldier leaves a building to intercept an attacker, the two soldiers go to the middle node between them and their battle begins there. There is no hunting (or following). If the node is already marked for a battle, the fighters search for a free one near the chosen one. ¶

This is method offers more overview on a big assault, instead of having all those soldiers running around. ¶

## Unfair fighting ¶

It may happen when intercepting, that two (or more) defenders intercept one attacker, if so, the other soldiers queue on the node, the attacker fights the first interceptor, if the attacker wins, he waits and fights the second interceptor and so on. Soldiers which are queued for a fight, can be attacked by some other fighter. This leads to a new battle between those two. ¶

Well, this thing is mostly done, I have some little problems locating a battle but it will be finished at shot time. When I finish it, the project will receive a new patch ¶
It works like follows: ¶

* When a LaunchAtack action is enqueued, also is enqueued a LaunchDefense action at the attacked building. ¶
* The launch defense searches all the soldiers than can defend actively (go out of his building and go to the attacked building) and start going to the flag of the attacked building. ¶
* When an 'ActiveDefender' reaches the attacked building's flag, then search an enemy to battle with. ¶
* If an enemy is found, the [cv writer]( defender goes to attack him (something like a hunting, only for testing, later will be a bit different) ¶
* If an enemy is near the defender, send an 'intercept_%d' signal, where the %d is the serial of the defender, to say the attacker that a defender can attack him. And idle for a short time. If the attacker can not attack the defender, because he is already fighting or something, then the defender starts again with the process of searching for an enemy. ¶
* If no enemy is found, then start task idle some times, waiting for attacking soldiers, until a counter is reached to 0. Then return to his building. ¶

## Attacking a building ¶

* Only military buildings and headquarters can be attacked. ¶
* Warehouses can help out with actively defending soldiers. ¶
* When some attacking soldiers reach a building, they queue on the flag of the building and the defenders in the building come out (one by one), so only one fight always takes place on the building flag. ¶
* The queued soldiers can be attacked by active defenders, this leads to a new battle between the two. ¶
* If the attacking force is able to kill the last soldier in the building, the building burns down (if it is a headquarter) or changes ownership (military buildings). ¶
* If there were still some medics inside, they become fugitive. ¶
* As the border moves, all non-military buildings are burnt down and all workers become fugitive. ¶

## What is user configurable ¶

__On attacks, the soldiers.__ (Number of soldiers & strongest/weakest soldier) ¶

Best would be, when a list of available soldiers is shown, so that you can launch this soldier for an attack with a double click (this marks the soldier in the listselect with a green hook or something, you hit attack and the marked soldiers march to fight). This would give perfect control over who is attacking. ¶
-- Holger ¶

If you allow this, specific soldier selection, then some options at the configuration window of military things (little above here) will be seemless, will not be needed. ¶
-- RFerriz ¶

__All defending stuff__ is configurable: the percentage of actively defending soldiers (if all soldiers defend actively, no one stays home to stop a second assault on another building); if the weak or the strong should defend. ¶
The default percentage of soldiers per building should also be configurable for at least: border, middle land, home land. ¶
And of course, all military sites are configurable by themselves. ¶

Sure, there must be a configure window to setup all this stuff, similar to S2. ¶
-- RFerriz ¶