Page 1 of 2

AI for Partisans

Posted: Sun Nov 13, 2005 3:10 pm
by Mziln
Partisans should be placed to:

Disrupt movement of enemy major powers factories or resources into/through a hex, the use any resources or factories, and supply

overrun Enemy aircraft and naval units.

If you are using Option 31: Saved Oil, they can destroy saved oil.

If you are using Option 30: Factory Destruction & Construction destroy factorys.

Partisans can be particulary effective in Asia to disrupt the flow of resources to Japan. Who has limited ability at the start of the game to counter them.

RE: AI for Partisans

Posted: Sun Nov 13, 2005 5:05 pm
by Shannon V. OKeets
ORIGINAL: Mziln
Partisans should be placed to:

Disrupt movement of enemy major powers factories or resources into/through a hex, the use any resources or factories, and supply

overrun Enemy aircraft and naval units.

If you are using Option 31: Saved Oil, they can destroy saved oil.

If you are using Option 30: Factory Destruction & Construction destroy factorys.

Partisans can be particulary effective in Asia to disrupt the flow of resources to Japan. Who has limited ability at the start of the game to counter them.

Nice. I can use this.

How do you feel about trying to avoid units that might destroy them? For example, is it better to do some damage immediately (at the risk of being crushed in the next turn) or safely lurk about, threatening to do mean and nasty things? There is a new optional rule where you can combine two partisans into an HQ unit. Should that be done whenever possible?

RE: AI for Partisans

Posted: Sun Nov 13, 2005 7:42 pm
by Mziln
[:D] Personaly I would happily exchange a free partisan for any enemy combat unit especially a stack of combat units. But you could prioritize partisans.

Partisan Agressive Stance:
(1) Destroy enemy units.
(2) Cut resource/supply lines.
(3) Make more partisans.

Partisan Srategic Stance:
(1) Cut resource/supply lines.
(2) Destroy enemy units.
(3) Make more partisans.

Partisan Defensive Stance:
(1) Make more partisans.
(2) Destroy enemy units.
(3) Cut resource/supply lines.


Rule 22.4.16 Partisan HQs Option 72 (PoliF)

Zoya K. would be a good replacement. If you can get the HQ into the U.S.S.R. lines.

Tito only if there are Yougoslav units in the game.

RE: AI for Partisans

Posted: Sun Nov 13, 2005 9:31 pm
by Shannon V. OKeets
ORIGINAL: Mziln
[:D] Personaly I would happily exchange a free partisan for any enemy combat unit especially a stack of combat units. But you could prioritize partisans.

Partisan Agressive Stance:
(1) Destroy enemy units.
(2) Cut resource/supply lines.
(3) Make more partisans.

Partisan Srategic Stance:
(1) Cut resource/supply lines.
(2) Destroy enemy units.
(3) Make more partisans.

Partisan Defensive Stance:
(1) Make more partisans.
(2) Destroy enemy units.
(3) Cut resource/supply lines.


Rule 22.4.16 Partisan HQs Option 72 (PoliF)

Zoya K. would be a good replacement. If you can get the HQ into the U.S.S.R. lines.

Tito only if there are Yougoslav units in the game.

Sounds good to me. I assume by "make more partisans" you mean to stay alive so the odds improve.

RE: AI for Partisans

Posted: Mon Nov 14, 2005 6:07 am
by Mziln
Yup


RE: AI for Partisans

Posted: Mon Nov 14, 2005 7:06 am
by c92nichj
Sounds good to me. I assume by "make more partisans" you mean to stay alive so the odds improve.
The desert/mountains in Northern China is a good place for this.
Also place them in Forest if possible as they gain an extra combat factor. In my current game I have two chineese 0 factor partisans in the forest south of Hang-Chow and it is a pain to get them out of there.

RE: AI for Partisans

Posted: Mon Nov 14, 2005 10:30 am
by Froonp
Partisan Agressive Stance:
(1) Destroy enemy units.
(2) Cut resource/supply lines.
(3) Make more partisans.

Partisan Srategic Stance:
(1) Cut resource/supply lines.
(2) Destroy enemy units.
(3) Make more partisans.

Partisan Defensive Stance:
(1) Make more partisans.
(2) Destroy enemy units.
(3) Cut resource/supply lines.
Sounds very good to me too.
Rule 22.4.16 Partisan HQs Option 72 (PoliF)
Zoya K. would be a good replacement. If you can get the HQ into the U.S.S.R. lines.
Tito only if there are Yougoslav units in the game.
I differ here from you. I'd say that both the HQ Part are good to create from 2 PART units because they are a good combat unit, they are always in supply and does not need oil.
I'll make Tito even if there were no Yugoslav units (anyway, there can't be Yugoslav units if there is Tito, because if there is Tito it means that Yugoslavia was conquered, so no Yugoslav units, am I mistaken ?), and I would make Zoya even if it cannot go into the USSR lines. It is great even if behind the German Lines. USSR PART are great (when they appear, which is far from done) at cutting the German lines, and can even manage at pocketing them sometimes if the German is not very cautious.


RE: AI for Partisans

Posted: Mon Nov 14, 2005 6:01 pm
by Mziln
In CWiF, assuming you had Poland align with the Commonwealth. Click on the "Add Additional Units" button for the Commonwealth during production after Poland has been conqured.

See: Rule 13.7.5 Liberation.

Yes, there could be Yugoslav units.

Also note that Partisans do not go away after liberation unless destroyed or combined to form a HQ.

RE: AI for Partisans

Posted: Mon Nov 14, 2005 6:13 pm
by c92nichj
I think partisans are overpowered in normal WIF and as the rule will be the same in MWIF I expect them to be so here as well.

That a partisan unit would be able to launch an attack and eliminate an armysized unit was historically not very likely to happen, in WIF that can happen with more than a 20% chance.

RE: AI for Partisans

Posted: Mon Nov 14, 2005 7:44 pm
by Froonp
See: Rule 13.7.5 Liberation.
Yes, there could be Yugoslav units.
Also note that Partisans do not go away after liberation unless destroyed or combined to form a HQ.
Yes you're right [;)]

RE: AI for Partisans

Posted: Sat Dec 10, 2005 11:26 pm
by Incy
Usually it's better to do some damage immediately rather than try to survive longterm.

Tree more considerations:
-If there is room behind lines Partisans should try to setup in areas that are OOS to the enemy! Bringing in supply to take a PART is a pain and a waste.
-If a partisan can be placed so it can join friendly lines befrore it can be taken out, that has a value in itself. It can beef up defence (and/or make a singlestack a doublestack!), and it can be used as a losstaker. Plus it still generates partisans. The value of achieving a linkup is IMHO worth around 1.5BP
-Partisans can have high tactical value if thay can be placed in spots they won't be autokilled to the rear of areas you are conducting offensives. Such partisans can tactically be used to cut supply & retreat paths, reinforcement & evacuation rail paths, degrade enemy manouvre as you attack. Thay can also pose a serious threath to rear airfields (even if planes are faceup it's not fun if they are flipped just at the critical moment).This role is especially suited to fastmoving PART.

Also, if a potential target hex is in a location that causes some disruption (supply or production), the value of choosing that hex should be multiplied by a number larger than one for each of:
-Units must be railed/must make more than one move in order to gather enough force to kill the partisan (i.e. get "convincing" odds vs. it)
-Supply bearing units must be brought in
-the partisan will actually be in a viable defence position (strong enough position that the enemy must risk taking losses to kill it)

It might be a good idea to write general "placing anything weak to avoid getting it killed" and "placing anything weak so it's really annoying to the enemy/useful to you" code that can be reused for many tasks, such as
-Placing PART
-PARA-drop site choosing
-Setup
-RTB & rebase of aircraft & ships (or placing aircraft & ships at all)
-choosing invasions sites
-choosing retreat hexes (if attacker, try to calculate lowest rather than highest value)
-Choosing rail targethexes




RE: AI for Partisans

Posted: Sun Dec 11, 2005 1:06 am
by Shannon V. OKeets
ORIGINAL: Incy

It might be a good idea to write general "placing anything weak to avoid getting it killed" and "placing anything weak so it's really annoying to the enemy/useful to you" code that can be reused for many tasks, such as
-Placing PART
-PARA-drop site choosing
-Setup
-RTB & rebase of aircraft & ships (or placing aircraft & ships at all)
-choosing invasions sites
-choosing retreat hexes (if attacker, try to calculate lowest rather than highest value)
-Choosing rail targethexes

All of the rest of your suggestions are excellent. And missing from my AI design document. Thank you.

I do not know exactly what you mean by the above, however. Placing Partisans makes sense, but the rest I find unclear.

RE: AI for Partisans

Posted: Sun Dec 11, 2005 1:34 am
by Incy
-PARA-drop site choosing
When you paradrop you want to do an "avoid getting it killed" check and a "placing it where it's really annoying to the enemy/useful to you" check. In effect, exactly the same as placing PART (plus you have to do other things, like consider supply and air cover, of course)

-Setup
Similar, during setup (initial and upon DOW), you might want to do such checks, especially the "avoid getting it killed". Setup is kind of similar to placing a lot of PART or doing many paradrops at once

-RTB & rebase of aircraft & ships (or placing aircraft & ships at all)
Again, when you RTB skips and planes, you want to run a "avoid getting it killed" check.

-choosing invasions sites
Same as paradrop and invasion, except your choice of target hexes are again changing. But again you would do good to do a "avoid getting it killed" check and a "place it where it's really annoying to the enemy/useful to you" check.

-choosing retreat hexes (if attacker, try to calculate lowest rather than highest value)
Maybe somwhat less similar, you can place an enemy unit in one of a number of hexes, and you want to run "where am I sure to get it killed" and "place it where it isn't really annoying to you/isn't useful to the enemy" checks

-Choosing rail targethexes[/quote]
Again, a unit drops outr of "nowhere" and will be exposed(i.e. flipped. What among a number of railhead will you place it on to make sure you won't get it killed/ it will be annoying/useful to the correct side. Really not that different than from placing a partisan.

Incy
ORIGINAL: Shannon V. OKeets
ORIGINAL: Incy

It might be a good idea to write general "placing anything weak to avoid getting it killed" and "placing anything weak so it's really annoying to the enemy/useful to you" code that can be reused for many tasks, such as
-Placing PART
-PARA-drop site choosing
-Setup
-RTB & rebase of aircraft & ships (or placing aircraft & ships at all)
-choosing invasions sites
-choosing retreat hexes (if attacker, try to calculate lowest rather than highest value)
-Choosing rail targethexes

All of the rest of your suggestions are excellent. And missing from my AI design document. Thank you.

I do not know exactly what you mean by the above, however. Placing Partisans makes sense, but the rest I find unclear.

RE: AI for Partisans

Posted: Sun Dec 11, 2005 8:32 am
by Shannon V. OKeets
What you say now makes sense to me. But I don't necessarily agree with it all.

For me the primary (almost exclusive) purpose of partisans is to annoy the enemy. Staying alive does that in and of itself, with the bonus that it increases the chances of more partisans coming along to keep the current ones company. So your suggestions are perfect for how they should be handled.

For the other unit types/movements the primary purpose is usually someting else. I wouldn't expect to make a paradrop or invasion unless it is part of something larger that is going on. Simply throwing units behind enemy lines with the expectation that the enemy will kill them on the next impulse/turn would rarely be something I would want to do. (Or have the AIO do).

Setting up a minor, who is doomed to be crushed is more comparable to the partisans, but the focus there is usually protecting home cities so complete conquest is prevented. Forays behind enemy lines are usually much less annoying to the enemy than simply staying unconquered for one more impulse.

RTB also has other objectives beyond annoying the enemy. Staying alive should be the primary purpose and positioning the air/naval units so they can be productive on the next turn the immedaite second priority. If the units are doomed, then I like your suggestions here too.

If your advice is to avoid getting vulnerable units killed in general, then I agree. This can be tricky though. We don't want to create an AIO that plays like General McClellan (American Civil War) who never wanted to get his nice new army dirty, and avoided combat risk to the point of never getting anything done.


................

I have been redoing the procedures for calculating the value of air units. What I have now takes the effect of air missions on ground combat (ground strikes and ground support) and calculates the air unit's worth in terms of the change in combat losses on the ground. I then take fighters and determine their impact on the success of the air mission(s) and indirectly get their effect on the combat losses on the ground. I need to reread and edit what I have written a few more times. Once I get it polished up, I'll post it for everyone to review and critique. I have also started on measuring the value of naval units in some detail (I am about half done on that).

RE: AI for Partisans

Posted: Sun Dec 11, 2005 11:46 pm
by Incy
There's of course much more to all the missions I list than just doing those two checks.
Just pointing out that there's good potential for code reuse here.
Something akin to (hope javastyle pseudocode is OK with you)

/**
* Class to hold a hex plus some score assigned to it
*/
ScoredHex extends Hex{
private long score
....
}


/**
* Method that scores hexes for how annoying a unit in the hex would be to the enemy
*/
ScoredHex[] findBloodyAnnoynigHexes(Hex[] hexesToChooseFrom) {
....
}

/**
* Method that scores hexes for how safe they are from the enemy
* updates rather than sets a score if the input is instanceof a ScoredHex
*/
ScoredHex[] findSafeHexes(Hex[] hexesToChooseFrom) {
....
}

/**
* Method that places partisans
*/
Hex placePartisan(Hex[] hexesToChooseFrom) {
ScoredHex[] targetHexes = findBloodyAnnoynigHexes(hexesToChooseFrom);
targetHexes = findSafeHexes(targetHexes );
return targetHexes[0];
}

/**
* Method that finds target hexes for paratroopers
* Returns a list of ScoredHex that lets other code evaluate how and if a PARA-drop would fit into operational plans
*/
ScoredHex[] findTargetHexesForPara(Hex[] hexesToChooseFrom) {
ScoredHex[] targetHexes = findBloodyAnnoynigHexes(hexesToChooseFrom);
targetHexes = findSafeHexes(targetHexes );
targetHexes = findHexesSafeToFlyTo(targetHexes);
targetHexes = findHexesThatCanBeLinkedUpToSoon(targetHexes);
....
return targetHexes;
}

etc, etc


RE: AI for Partisans

Posted: Tue Dec 13, 2005 10:05 pm
by Shannon V. OKeets
ORIGINAL: Incy

There's of course much more to all the missions I list than just doing those two checks.
Just pointing out that there's good potential for code reuse here.
Something akin to (hope javastyle pseudocode is OK with you)

/**
* Class to hold a hex plus some score assigned to it
*/
ScoredHex extends Hex{
private long score
....
}


/**
* Method that scores hexes for how annoying a unit in the hex would be to the enemy
*/
ScoredHex[] findBloodyAnnoynigHexes(Hex[] hexesToChooseFrom) {
....
}

/**
* Method that scores hexes for how safe they are from the enemy
* updates rather than sets a score if the input is instanceof a ScoredHex
*/
ScoredHex[] findSafeHexes(Hex[] hexesToChooseFrom) {
....
}

/**
* Method that places partisans
*/
Hex placePartisan(Hex[] hexesToChooseFrom) {
ScoredHex[] targetHexes = findBloodyAnnoynigHexes(hexesToChooseFrom);
targetHexes = findSafeHexes(targetHexes );
return targetHexes[0];
}

/**
* Method that finds target hexes for paratroopers
* Returns a list of ScoredHex that lets other code evaluate how and if a PARA-drop would fit into operational plans
*/
ScoredHex[] findTargetHexesForPara(Hex[] hexesToChooseFrom) {
ScoredHex[] targetHexes = findBloodyAnnoynigHexes(hexesToChooseFrom);
targetHexes = findSafeHexes(targetHexes );
targetHexes = findHexesSafeToFlyTo(targetHexes);
targetHexes = findHexesThatCanBeLinkedUpToSoon(targetHexes);
....
return targetHexes;
}

etc, etc

After looking at this for a few days, I guess I don't find it all that helpful. Sorry.

I still think of programming problems in terms of variables: define their type, allocate memory, initialize them, modify them, reference them, release memory. Sometimes there is also read and write them to disk (or from the keyboard or mouse click, and display them on the screen).

I put groups of variables into logical structures or relationships, defining classes/objects and databases along the way.

For me, reusability of code is more about efficiency and polishing once functionality has been achieved. In the past I have been burned too many times striving to achieve reusable code early in the programming project, only to discover that there are so many exceptions that the reusable part of the code is lost in all the conditional branching logic to handle the different cases.

What I usually do is write the documentation for methods as in-line comments before writing any actual code. I then put in the loop structures and branching logic. Lastly I write the particulars of what is being done (function calls and procedures and the like). Variables are defined along the way and checked to see that they are coded for the list I gave above (i.e., type, memory, init, mod, ref, read/write).

There is an earlier step, which is to write out the design specification for the task. This I do in simple text. My firm belilef, based on extensive experience, is that if I can't write the task out clearly in simple English, then I shouldn't go anywhere near trying to code it. Once the English description of the task is done, I have a clear definition of what I am trying to do and can start on the in-line documentation.

This is probably more than you wanted to know, but I thought I should do more than simply say "thanks, but no thanks" in reply to the pseudo-Java code you wrote.

RE: AI for Partisans

Posted: Fri Jun 09, 2006 12:38 pm
by Froonp
Bump. I didn't want this to fall off the end of the thread list and it might be handy to make it more visible for newcomers to read.

Cheers, Neilster
And what about this one Neilster ? [:D]

RE: AI for Partisans

Posted: Fri Jun 09, 2006 8:41 pm
by trees trees
Don't forget garrison AI for conquering major powers. And lately, the colonial powers in Asia. It's darn embarassing when Malayan rebels blow up your oil storage area in Singapore in 1940, and then the Kachin cut the Burma Road far more effectively than the Japanese ever can that same year. But against Partisans there is that quote "he who defends everything, defends ....

RE: AI for Partisans

Posted: Sat Jun 10, 2006 12:37 pm
by Neilster
ORIGINAL: Froonp
Bump. I didn't want this to fall off the end of the thread list and it might be handy to make it more visible for newcomers to read.

Cheers, Neilster
And what about this one Neilster ? [:D]

Those sneaky partisans [:@]. Always hiding out in densely forested parts of the forum.

Thanks Patrice.

Cheers, Neilster

RE: AI for Partisans

Posted: Wed Nov 22, 2006 5:44 am
by Neilster
Falling off the end of the list. Time to bump it for the new people.

Cheers, Neilster