When?

World in Flames is the computer version of Australian Design Group classic board game. World In Flames is a highly detailed game covering the both Europe and Pacific Theaters of Operations during World War II. If you want grand strategy this game is for you.

Moderator: Shannon V. OKeets

User avatar
Edfactor
Posts: 106
Joined: Fri Jun 13, 2008 8:51 pm
Location: Dallas

RE: Long Time Coming!

Post by Edfactor »

ORIGINAL: macgregor
It seems now that MWiF is entering it's final phase before completion. Notwithstanding the number of bugs reported, I think we can dust off our old rule books, or, the latest 'RAW'. If not November, I don't expect it to take much longer. As when I first played regular WiF, I probably won't be bidding too high. Convoys and Cruisers should be a very nice touch, as I've never played with those options.


There is still alot to do, so don't get excited yet. The AIO alone will be a killer and probably very time intensive. I would hope for an April 2010 release honestly. I think it's more important to get it right then to get it out.
User avatar
Jagdtiger14
Posts: 1685
Joined: Mon Jan 21, 2008 11:58 pm
Location: Miami Beach

RE: Long Time Coming!

Post by Jagdtiger14 »

Besides the bugs, there is tons of other work listed.  The earliest optimistic release might be in time for Origins 2010...so maybe early June. 
 
Conflict with the unexpected: two qualities are indispensable; first, an intellect which, even in the midst of this obscurity, is not without some traces of inner light which lead to the truth; second, the courage to follow this faint light. KvC
User avatar
composer99
Posts: 2931
Joined: Mon Jun 06, 2005 8:00 am
Location: Ottawa, Canada
Contact:

RE: Long Time Coming!

Post by composer99 »

An Origins release would probably be more suitable for a game of this nature than a November/Christmas release.

I can see people all excited about MWiF at Origins shelling out for it. People buying MWiF for their casual gamer buddies at Christmas? Not so much (although I might have asked for it for Christmas from my family).
~ Composer99
macgregor
Posts: 1049
Joined: Tue Feb 10, 2004 6:44 pm

RE: Long Time Coming!

Post by macgregor »

ORIGINAL: Edfactor
There is still alot to do, so don't get excited yet. The AIO alone will be a killer and probably very time intensive. I would hope for an April 2010 release honestly. I think it's more important to get it right then to get it out.
Are you now Steve's spokesman or Matrix's? Honestly. So far Steve has said beginning of November is out. I think I'll wait to hear it from his mouth that he still needs at least 9 more months to release.
User avatar
yvesp
Posts: 2083
Joined: Fri Sep 12, 2008 3:10 pm

RE: Long Time Coming!

Post by yvesp »

ORIGINAL: macgregor

ORIGINAL: Edfactor
There is still alot to do, so don't get excited yet. The AIO alone will be a killer and probably very time intensive. I would hope for an April 2010 release honestly. I think it's more important to get it right then to get it out.
Are you now Steve's spokesman or Matrix's? Honestly. So far Steve has said beginning of November is out. I think I'll wait to hear it from his mouth that he still needs at least 9 more months to release.

You're right, and it's not good that Steve didn't say anything at all...
Or that the official site still mentions "in development" rather than a tentative release date.

If you read my answer to Steve monthly report two or three months ago, I was dubious on the November release because I wrotte then that it was a very optimistic schedule, so this setback doesn't really come as a surprise to me. I still had hoped otherwise, but previous reports were not that good either (no serious work on the AIO for three months... hum...).

I do agree that an April/May release is much more realistic, given that the AIO is still mostly in computer limbo ; the fact that all is supposedly layed down on paper is good, but vastly unsufficient. There is still a hell of a lot of work to do there.

Steve, hang on! We're behind you, and always ready to wait for a good product!

Yves
User avatar
Norden_slith
Posts: 166
Joined: Wed Aug 27, 2003 11:07 am
Location: expatriate german

RE: Long Time Coming!

Post by Norden_slith »

ORIGINAL: yvesp

ORIGINAL: macgregor

ORIGINAL: Edfactor
There is still alot to do, so don't get excited yet. The AIO alone will be a killer and probably very time intensive. I would hope for an April 2010 release honestly. I think it's more important to get it right then to get it out.
Are you now Steve's spokesman or Matrix's? Honestly. So far Steve has said beginning of November is out. I think I'll wait to hear it from his mouth that he still needs at least 9 more months to release.

You're right, and it's not good that Steve didn't say anything at all...
Or that the official site still mentions "in development" rather than a tentative release date.

If you read my answer to Steve monthly report two or three months ago, I was dubious on the November release because I wrotte then that it was a very optimistic schedule, so this setback doesn't really come as a surprise to me. I still had hoped otherwise, but previous reports were not that good either (no serious work on the AIO for three months... hum...).

I do agree that an April/May release is much more realistic, given that the AIO is still mostly in computer limbo ; the fact that all is supposedly layed down on paper is good, but vastly unsufficient. There is still a hell of a lot of work to do there.

Steve, hang on! We're behind you, and always ready to wait for a good product!

Yves

And when all that AI code finally IS scripted, the bugreporting and tweaking will reach new highs, no doubt. I must admit that next summer or even later gets more and more likely. Anyway, Steves tenacity and sheer will is impressive.
Norden
---------------------------------------------------------------
Hexagonally challenged
brian brian
Posts: 3191
Joined: Wed Nov 16, 2005 6:39 pm

RE: Long Time Coming!

Post by brian brian »

bugs bugs bugs, humanity would be pretty screwed without bugs
macgregor
Posts: 1049
Joined: Tue Feb 10, 2004 6:44 pm

RE: Long Time Coming!

Post by macgregor »

I'm sure Steve takes comfort in knowing you guys have already allotted him the time he needs to complete the 'big blue' AIO you all want. Actually that doesn't do justice to your proposed AIO. The game of WiF is infinitely more complex than chess. At this point I'm just looking for a game, any game, that will suit my grognard needs. When it is released, I will be loyal to that game. Have fun gentlemen.
User avatar
HansHafen
Posts: 258
Joined: Sun Feb 03, 2008 6:50 am
Contact:

RE: Long Time Coming!

Post by HansHafen »

I am just scared the AI will be extremely hard to code and get right. WIF is so complex and any logical, methodical decision tree will be like a 300 year old Redwood at a minimum! The AI has to think point to point on the frontline, but also has to see in depth, behind the front lines for potential threats including armor, planes, Offensive chits etc. I want it to be possible, but I am concerned. It seems as though it is difficult enough just to get the sequence of play working correctly.
 
I am very happy with what I see so far however! It looks fantastic! I'm so excited I could pee my pants. [:)]
User avatar
yvesp
Posts: 2083
Joined: Fri Sep 12, 2008 3:10 pm

RE: Long Time Coming!

Post by yvesp »

ORIGINAL: HansHafen

I am just scared the AI will be extremely hard to code and get right. WIF is so complex and any logical, methodical decision tree will be like a 300 year old Redwood at a minimum! The AI has to think point to point on the frontline, but also has to see in depth, behind the front lines for potential threats including armor, planes, Offensive chits etc. I want it to be possible, but I am concerned.


Just my two cents there :

I believe that Steve would do very good to only build the AIO inner architecture and leave the actual script
writing to the community. He would gain some time this way. However, writing a script langage (and inner
tables) adaptable enough for the scripts to be really useful is already in itself a daunting task... In effect,
this is "just" creating a language and the compiler that goes with it...

Yves
User avatar
coregames
Posts: 470
Joined: Thu Aug 12, 2004 4:45 pm
Contact:

RE: Long Time Coming!

Post by coregames »

ORIGINAL: yvesp

Just my two cents there :

I believe that Steve would do very good to only build the AIO inner architecture and leave the actual script
writing to the community. He would gain some time this way. However, writing a script langage (and inner
tables) adaptable enough for the scripts to be really useful is already in itself a daunting task... In effect,
this is "just" creating a language and the compiler that goes with it...

Yves

I believe that is the course that Steve has laid out, where the AIO parser is the bulk of his work, and playtesters (and subsequently, players) largely determine what the game actually chooses to do in given situations. In the 18 months following the release of the game, intricacies of strategic decision-making will be honed by feedback from the public.
"The creative combination lays bare the presumption of a lie." -- Lasker

Keith Henderson
Petracelli69
Posts: 18
Joined: Mon Oct 13, 2008 7:47 pm

RE: Long Time Coming!

Post by Petracelli69 »

Steve
 
Thanks for the update and keep up the good work. I'm for one looking forward to the release and the fruits of your hard labour.
 
regards
 
Phil
Shooterguy
Posts: 8
Joined: Fri Aug 07, 2009 4:10 pm

RE: Long Time Coming!

Post by Shooterguy »

Steve,

Keep fighting the good fight. [&o] You've got a lot of people pulling for you, and a lot of potential sales once this is done!

R/ Paul
User avatar
Norden_slith
Posts: 166
Joined: Wed Aug 27, 2003 11:07 am
Location: expatriate german

RE: Long Time Coming!

Post by Norden_slith »

ORIGINAL: brian brian

bugs bugs bugs, humanity would be pretty screwed without bugs

True, luckily we dont have to report all of them [;)] .

Norden
Norden
---------------------------------------------------------------
Hexagonally challenged
User avatar
composer99
Posts: 2931
Joined: Mon Jun 06, 2005 8:00 am
Location: Ottawa, Canada
Contact:

RE: Long Time Coming!

Post by composer99 »

But entomologists keep wanting to classify the damn things. [;)]
~ Composer99
User avatar
Snydly
Posts: 46
Joined: Wed Oct 04, 2006 3:48 am

RE: Long Time Coming!

Post by Snydly »

Keep up the Good Work Steve [;)]
Looking forward to playing my favorite board game WIF on the computer.
Martos
Posts: 2
Joined: Tue Jan 01, 2008 7:30 pm

RE: Long Time Coming!

Post by Martos »

Whew! To be fair, there appears to be a lot of work still on the plate. Here's to hoping it goes as smoothly as possible. Keep up the good work!
User avatar
mavraamides
Posts: 424
Joined: Fri Apr 01, 2005 8:25 pm

RE: Long Time Coming!

Post by mavraamides »

ORIGINAL: yvesp

ORIGINAL: HansHafen

I am just scared the AI will be extremely hard to code and get right. WIF is so complex and any logical, methodical decision tree will be like a 300 year old Redwood at a minimum! The AI has to think point to point on the frontline, but also has to see in depth, behind the front lines for potential threats including armor, planes, Offensive chits etc. I want it to be possible, but I am concerned.

AI script languages already exist. Lua comes to mind.

No need to re-invent the wheel, IMO.


Just my two cents there :

I believe that Steve would do very good to only build the AIO inner architecture and leave the actual script
writing to the community. He would gain some time this way. However, writing a script langage (and inner
tables) adaptable enough for the scripts to be really useful is already in itself a daunting task... In effect,
this is "just" creating a language and the compiler that goes with it...

Yves
Shannon V. OKeets
Posts: 22165
Joined: Wed May 18, 2005 11:51 pm
Location: Honolulu, Hawaii
Contact:

RE: Long Time Coming!

Post by Shannon V. OKeets »

ORIGINAL: GordianKnot

ORIGINAL: yvesp

ORIGINAL: HansHafen

I am just scared the AI will be extremely hard to code and get right. WIF is so complex and any logical, methodical decision tree will be like a 300 year old Redwood at a minimum! The AI has to think point to point on the frontline, but also has to see in depth, behind the front lines for potential threats including armor, planes, Offensive chits etc. I want it to be possible, but I am concerned.

AI script languages already exist. Lua comes to mind.

No need to re-invent the wheel, IMO.


Just my two cents there :

I believe that Steve would do very good to only build the AIO inner architecture and leave the actual script
writing to the community. He would gain some time this way. However, writing a script langage (and inner
tables) adaptable enough for the scripts to be really useful is already in itself a daunting task... In effect,
this is "just" creating a language and the compiler that goes with it...

Yves
Did you have a comment here? All I see is a copy of an earlier post.
===
As for writing a script language for the casual player to use "to write his own scripts", ...

Have you stopped by a good book store and looked at the section on programming languages? Try to find a book there that is less than 100 pages. Then try to read the first 2 chapters.

I have no interest in trying to teach inexperienced programmers how to program. Nor am I interested in writing the definitive book on LAIO (Language for AI Opponent), which I've created for MWIF's AIO. To do so would require at least another year of work. Just laying out the chapters and sketching in the content for each would be time consuming. To hope that the result would be practical and used by more than a few dozen people would be very optimistic.

Here is an example of a simple script for setting up the units:

===========
// ****************************************************************************
// Persian setup script - last modified Nov. 26, 2008
// ****************************************************************************
// Local variables for Priority rules
// ******************************
CapitalDefensePriority: Integer
OilwellDefensePriority: Integer
BorderDefensePriority: Integer
MarauderDefensePriority: Integer
// ******************************
// Local variables for selecting Defense randomly
// ******************************
MaxRandomNumber: Integer
CaptialBottom: Integer
OilwellBottom: Integer
BorderBottom: Integer
MarauderBottom: Integer
RandomNumber: Integer
// ******************************
// Local variables for Defenses rules
// *******************************
MARSmall: Boolean
Location1: Hex
Location2: Hex
Location3: Hex
UnitSmall: Boolean
TargetHex: Hex
// ****************************************************************************
//
// Primary Rule for Persian Setup
//
// ****************************************************************************

R.PrimaryRule
// *******************************
// Set starting value for each defense
// *******************************
CapitalDefensePriority = 80
OilwellDefensePriority = 60
BorderDefensePriority = 60
MarauderDefensePriority = 5
// *******************************
// Modify Defense Weight if current situation makes any defenses better or worse
// *******************************
// Reinforcements might arrive
// *******************************
IF PersianReinforcementMightArrive THEN
(CapitalDefensePriority = CapitalDefensePriority + 25) AND
(BorderDefensePriority = BorderDefensePriority + 20)
// *******************************
// Defenders are might survive!
// *******************************
IF WeakAttackingForce THEN
(CapitalDefensePriority = CapitalDefensePriority + 25) AND
(BorderDefensePriority = BorderDefensePriority +- 20) AND
(MarauderDefensePriority = MarauderDefensePriority - 4)
// *******************************
// Defenders are doomed
// *******************************
IF OverwhelmingAttackingForce THEN
(CapitalDefensePriority = CapitalDefensePriority - 25) AND
(OilwellDefensePriority = OilwellDefensePriority + 20) AND
(BorderDefensePriority = BorderDefensePriority - 20) AND
(MarauderDefensePriority = MarauderDefensePriority + 5)
// *******************************
// Bad weather means stay and fight
// *******************************
IF BadWeather THEN
(CapitalDefensePriority = CapitalDefensePriority + 5) AND
(BorderDefensePriority = BorderDefensePriority + 5)
// *******************************
// Set Bottoms for selecting a Defense randomly. The cut-off values (bottoms)
// serve as the top of the defense that precedes it.
// So, Capital Defense is from 0 to OilwellBottom;
// OilwellDefense is from OilwellBottom to BorderBottom;
// *******************************
MaxRandomNumber = CapitalDefensePriority
OilwellBottom = MaxRandomNumber
IF OilwellDefenseFeasible THEN
Inc(MaxRandomNumber, OilwellDefensePriority)
// *******************************
// BorderDefense is from BorderBottom to MarauderBottom;
// *******************************
BorderBottom = MaxRandomNumber
IF BorderDefenseFeasible THEN
Inc(MaxRandomNumber, BorderDefensePriority)
// *******************************
// MarauderDefense is from MarauderBottom to MaxRandomNumber.
// *******************************
MarauderBottom = MaxRandomNumber
IF MarauderDefenseFeasible THEN
Inc(MaxRandomNumber, MarauderDefensePriority)
// *******************************
// Generate a random number and use it to choose one setup
// *******************************
RandomNumber = Random(1, MaxRandomNumber)
IF RandomNumber > MarauderBottom THEN
Setup = MarauderDefense
ELSE IF RandomNumber > BorderBottom THEN
Setup = BorderDefense
ELSE IF RandomNumber > OilwellBottom THEN
Setup = OilwellDefense
ELSE Setup = CapitalDefense
// ****************************************************************************
//
// Non-primary Rules for Persian Setup
//
// ***************************************************************************
//
// Rules that modify defense priorities
//
// ***************************************************************************

R.BadWeather
// *******************************
// Weather in Mediterranean is NOT Fine
// *******************************
Return NOT (Weather.Mediterranean = Fine)

R.PersianReinforcementMightArrive
// *******************************
// Chance for Persian MIL to arrive?
// *******************************
// *******************************
// LAIO function EstimatedImpulsesRemainingInTurn
// Returns the estimated number of impulses remaining in the current turn
// *******************************
Return (WeakAttackingForce OR EstimatedImpulsesRemainingInTurn <= 2)

R.WeakAttackingForce
// *******************************
// With the maximum estimated attack forces, possible for defenders to survive?
// Odds <= 3:1
// *******************************
Return Max(Countries.ForEach(AtWarPersiaRoughEstimateOfAttackForce, C)) >= 9

R.OverwhelmingAttackingForce
// *******************************
// Are the maximum estimated attack forces likely to take no losses? Odds >= 7:1
// *******************************
Return Max(Countries.ForEach(AtWarPersiaRoughEstimateOfAttackForce, C)) >= 21

R.AtWarPersiaRoughEstimateOfAttackForce
// *******************************
// Make a rough estimate of air and land units likely to participate in an
// attack against the defenders
// The variable C is set when this rule is called
// *******************************
IF C.AtWar(Persia) THEN
Return Sum(C.Units.ForEach(UnitCloseToPersianBorder, Unit))
ELSE Return 0

R.UnitCloseToPersianBorder
// *******************************
// Strength of Land or Air unit close to the Persian Border
// The variable Unit is set when this rule is called
// *******************************
IF Unit.Organized AND
(Unit.InSupply OR
Unit.CanBeInSupply) AND
Unit.UnitType IN LandUnitSet AND
Unit.HexDist(Persia) <= 4 THEN
Return Unit.Attack
ELSE IF Unit.Organized AND
(Unit.InSupply OR
Unit.CanBeInSupply) AND
Unit.UnitType IN AirUnitSet AND
Unit.Range(Teheran) <= 4 THEN
Return Unit.Tact
ELSE Return 0
// ****************************************************************************
//
// End of rules used to modify defense priority
// Beginning of feasible defense rules
//
// ****************************************************************************

R.BorderDefenseFeasible
// *******************************
// Border defense
//
// Feasible given A and B and C
// A) No Risk of paradrop on the capital
// B) No Risk of a two front land advance on the capital
// C) No Risk of having the land unit flipped
// *******************************
Return (NOT ParadropThreatToTeheran) AND
(NOT TwoFrontLandAdvance) AND
(NOT SetupHasThreatOfLandUnitDisorganized(BorderDefense))

R.OilwellDefenceFeasible
// *******************************
// Oil well defense
//
// Feasible given A and either B or C
// A) JapanInterferenceInPersiaPossible
// B) Risk of paradrop on the oil wells
// C) Risk of invasion on the oil wells
// *******************************
Return JapanInterferenceInPersiaPossible AND
(ParadropThreatToOilwells OR
InvasionThreatToOilwells)

R.MarauderDefenseFeasible
// *******************************
// Marauder defense
//
// Feasible given A or B
// A) Chance to conquer Iraq
// B) Chance to overrun a disorganized unit
// *******************************
Return ChanceToConquerIraq OR
ChanceToOverrunDisorganizedUnit

R.JapanInterferenceInPersiaPossible
// *******************************
// JapanInterferenceInPersiaPossible
//
// IF A and B
// A) Japan plans to send units to Perisa immediately
// B) Japan is at war with attacking country or prepared to declare war on it
// *******************************
Return JapanReadyToSendUnitsToPersia AND
JapanWarWithPersianAggressor

R.JapanReadyToSendUnitsToPersia

// *******************************
// LAIO function Preparations(X, Action)
// Checks if the country X is plans to take do Action
// *******************************
IF Preparations(Japan, MasterPlanFightForOilwellsInPersia)) = False THEN
Return False
Else
// *******************************
// Can Japan send a unit to Persia?
// *******************************
// Loop over all TRS/AMPH
// *******************************
Return (MajorTransportAvailable OR
// *******************************
// Loop over all TRS/AMPH/SCS
// *******************************
MinorTransportAvailable)

R.MajorTransportAvailable
// *******************************
// Does Japan have a corps capable transport available?
// *******************************
UnitSmall = False // Unit is corps size
Return Japan.Units.FirstThat(TransportAvailable, Transport)

R.MinorTransportAvailable
// *******************************
// Does Japan have a division capable transport available?
// *******************************
UnitSmall=True // Unit is division size
Return Japan.LandUnits.FirstThat(TransportAvailable, Transport)

R.TransportAvailable
// *******************************
// Transport's type is TRS or AMPH (or SCS if the unit transport is a DIV);
// Transport is in supply, organized, and in
// the Persian Gulf or within range of it
// The variable Transport is set when this rule is called
// *******************************
IF (NOT UnitSmall) AND
(((Transport.UnitType = AMPH) AND
(NOT (Unit.UnitType IN [HQA, ARM, MECH, ART]))) OR
(Transport.UnitType = TRS)) AND
Transport.Organized AND
(Transport.InSupply OR
Transport.CanBeInSupply) AND
((Transport.SeaArea = PersianGulf) OR
Transport.Range(PersianGulf)) THEN
Return Japan.FirstThat(TransportUnitAvailable, U)
ELSE IF UnitSmall AND
(((Transport.UnitType = AMPH) AND
(NOT Unit.UnitType IN [HQA, ARM, MECH, ART])) OR
(Transport.UnitType = TRS) OR
(Option.SCSTransport AND
(Transport.UnitType = SCS) AND
(Unit.UnitType IN InfantrySet) AND
(NOT (Unit.UnitType IN MotorizedSet)))) AND
Transport.Organized AND
(Transport.InSupply OR
Transport.CanBeInSupply) AND
((Transport.SeaArea = PersianGulf) OR
(Transport.Range(PersianGulf)) THEN
Return Japan.FirstThat(TransportUnitAvailable, U)
ELSE Return False

R.TransportUnitAvailable
// *******************************
// Can any land unit be transported?
// The variable Unit is set when this rule is called
// *******************************
Return ((Unit.Hex IN [PersianGulf.CoastalHex]) OR
(Transport.Cargo = Unit)) AND
Unit.Organized AND
(Unit.Small = UnitSmall) AND
Unit.CooperatesWith(Transport) AND
(Unit.InSupply OR
Unit.CanBeInSupply)

R.JapanWarWithPersianAggressor
// *******************************
// Japan being at war with a country with which Persia is at war or Japan
// willing to declare war on same
// *******************************
Return Countries.FirstThat(CountryAtWarPersiaAndJapan, C)

R.CountryAtWarPersiaAndJapan
// *******************************
// Country war with Persia and either at war with Japan or soon to be at war
// with Japan
// *******************************
Return C.AtWar(Persia) AND
(C.AtWar(Japan) OR
// *******************************
// LAIO function Preparations(X, Action, Y)
// Checks if the country X is prepared to take Action against country Y
// *******************************
Preparations(Japan, ImminentWar, C))

R.SetupHasThreatOfLandUnitDisorganized(GivenSetup)
// *******************************
// Check if any unit in a setup has the threat of being disorganized
// The variable GivenSetup is an argument when this rule is called
// *******************************
// LAIO function SetupUnits(GivenSetup)
// Returns all units in GivenSetup
// *******************************
Return SetupUnits(GivenSetup).ForEach(LocationsGroundStrikeThreat, TargetUnit)

R.LocationsGroundStrikeThreat
// *******************************
// Checks if any of a unit's locations in a setup has the risk of being ground
// struck
// The variables GivenSetup and TargetUnit are set when this rule is called
// *******************************
// LAIO function SetupLocations(GivenSetup, TargetUnit)
// Returns all possible hexes where TargetUnit can be placed in GivenSetup
// *******************************
Return SetupLocations(GivenSetup, TargetUnit).FirstThat(NoGroundStrikeThreat,
TargetHex)

R.NoGroundStrikeThreat
// *******************************
// If No Threat of having TargetUnit ground struck
// The variable Location is set when this rule is called
// *******************************
Return NOT GroundStrikeThreat

R.GroundStrikeThreat
// *******************************
// Threat of having TargetUnit ground struck in TargetHex
// LAIO function Product multiplies probabilities of failure.
// *******************************
Return Product(Countries.ForEach(AtWarPersiaGroundStrike, C) <= .70

R.AtWarPersiaGroundStrike
// *******************************
// Countries at war with Persia and a ground strike is possible
// The variable C is set when this rule is called
// *******************************
IF C.AtWar(Persia) THEN
Return Product(C.Units.ForEach(GroundStrikePossible, AttackUnit))
ELSE Return 1

R.GroundStrikePossible
// *******************************
// Ground strike possible
// The variables AttackUnit, TargetUnit, and TargetHex are set before this rule
// is called
// *******************************
IF AttackUnit.Organized AND
(AttackUnit.InSupply OR
AttackUnit.CanBeInSupply) AND
AttackUnit.CanGroundStrike AND
AttackUnit.Range(TargetHex) THEN
Return ProbUnsuccesfulGroundStrike(AttackUnit)
ELSE Return 1

R.ProbUnsuccesfulGroundStrike
// *******************************
// Chance of unsuccesful ground strike
// The variables AttackUnit, TargetUnit, and TargetHex are set before this rule
// is called
// *******************************
// Probability ground strike(s) fail; there are 2 when target unit is surprised
// *******************************
IF TargetUnit.SurprisedBy(AttackUnit) THEN
Return ((10 - AttackUnit.Tact(TargetHex))/10) *
((10 - AttackUnit.Tact(TargetHex))/10)
ELSE Return (10 - AttackUnit.Tact(TargetHex))/10

R.TwoFrontLandAdvance
// *******************************
// Threat of a two front land advance on the capital
// *******************************
// Land units on both sides of the Caspian Sea
// *******************************
Return (ThreatNWBorder AND
ThreatNEBorder) OR
// *******************************
// Land units on one side of the Caspian Sea and also in Iraq, close to the
// Persian border
// *******************************
((ThreatNWBorder OR
ThreatNEBorder) AND
ThreatWestBorder)

R.ThreatNWBorder
// *******************************
// Enemy land unit on the border close to the west side of the Caspian Sea
// *******************************
// We only need to find a single qualified unit for the threat to be real
// *******************************
Return Countries.FirstThat(AtWarPersiaGroundInvasionNW, C)

R.AtWarPersiaGroundInvasionNW
// *******************************
// Countries at war with Persia - ground invasion NW
// The variable C is set when this rule is called
// *******************************
IF C.AtWar(Persia) THEN
Return C.Units.FirstThat(AttackerAvailableNW, Unit)
ELSE Return False

R.AttackerAvailableNW
// *******************************
// Enemy land unit on the NW border, and close enough to reach Teheran
// The variable Unit is set when this rule is called
// *******************************
Return FastUnitAvailable AND
LandUnitNWBorder

R.FastUnitAvailable
// *******************************
// Fast moving landunit available
// *******************************
Return Unit.Organized AND
(Unit.InSupply OR
Unit.CanBeInSupply) AND
(Unit.UnitType IN LandUnitSet) AND
// *******************************
// Possible for unit to reach Teheran in 2 moves
// ********************************
Unit.ImpulsesToReach(Teheran) <= 2

R.LandUnitNWBorder
// *******************************
// Enemy land unit on the NW border
// *******************************
// Any unit within 5 hexes of the border hex (71, 77)
// *******************************
Return Unit.HexDist(71, 77) <= 5

R.ThreatNEBorder
// *******************************
// Enemy land unit on the border close to the east side of the Caspian Sea
// *******************************
// We only need to find a single qualified unit for the threat to be real
// *******************************
Return Countries.FirstThat(AtWarPersiaGroundInvasionNE, C)

R.AtWarPersiaGroundInvasionNE
// *******************************
// Countries at war with Persia - ground invasion NE
// The variable C is set when this rule is called
// *******************************
IF C.AtWar(Persia) THEN
Return C.Units.FirstThat(AttackerAvailableNE, Unit)
ELSE
Return False

R.AttackerAvailableNE
// *******************************
// Enemy land unit on the NE border, and close enough to reach Teheran
// The variable Unit is set when this rule is called
// *******************************
Return FastUnitAvailable AND
LandUnitNEBorder

R.LandUnitNEBorder
// *******************************
// Enemy land unit on the NE border
// *******************************
Return Unit.HexDist(71, 83) <= 5

R.ThreatWestBorder
// *******************************
// Land unit in Iraq, close to Persian border
// *******************************
// We only need to find a single qualified unit for the threat to be real
// *******************************
Return Countries.FirstThat(AtWarPersiaGroundInvasionWest, C)

R.AtWarPersiaGroundInvasionWest
// *******************************
// Countries at war with Persia - ground invasion west
// The variable C is set when this rule is called
// *******************************
IF C.AtWar(Persia) THEN
Return C.Units.FirstThat(AttackerAvailableWest, Unit)
ELSE Return False

R.AttackerAvailableWest
// *******************************
// Enemy land unit on the west border, and close enough to reach Teheran
// The variable Unit is set when this rule is called
// *******************************
Return FastUnitAvailable AND
LandUnitWestBorder

R.LandUnitWestBorder
// *******************************
// Enemy land unit on the Iraq border
// *******************************
// Any hex in that is within two hexes of the Iraqi-Persian border
// *******************************
Return (Unit.Hex IN Iraq) AND
(Unit.HexDist(Persia) <= 2)

R.InvasionThreatToOilwells
// *******************************
// Invasion threat to oil wells (which are all in coastal hexes)
// *******************************
// Only when weather in Mediterranean is rain or fine
// *******************************
Return (Weather.Mediterranean IN [Fine, Rain]) AND
// *******************************
// Loop over all TRS/AMPH
// *******************************
(MajorInvasionAvailable OR
// *******************************
// Loop over all USSR TRS/AMPH/SCS
// *******************************
MinorInvasionAvailable)

R.MajorInvasionAvailable
// *******************************
// Major invasion available
// *******************************
MARSmall = False
// *******************************
// We only need to find a single qualified unit for the threat to be real
// *******************************
Return Countries.FirstThat(AtWarPersiaTRSAvailable, C)

R.AtWarPersiaTRSAvailable
// *******************************
// Countries at war with Persia - TRS available
// The variable C is set when this rule is called
// *******************************
IF C.AtWar(Persia) OR
CooperatesWithCountryAtWarPersia(C) THEN
Return C.Units.FirstThat(TRSAvailable, Transport)
ELSE Return False

R.CooperatesWithCountryAtWarPersia
// *******************************
// Does a country cooperate with any country
// that is at war with Persia?
// The variable C is set when this rule is called
// *******************************
Return Countries.FirstThat(NotAtWarPersiaButCooperates, C2, C)

R.NotAtWarPersiaButCooperates
// *******************************
// Country not a war with Persia but Cooperates with that is
// The variable C2, C and set when this rule is called
// *******************************
Return NOT C2.AtWar(Persia) AND
C2.Cooperates(C)

R.MinorInvasionAvailable
// *******************************
// Major invasion available
// *******************************
MARSmall = True
Return Countries.FirstThat(AtWarPersiaDivisionTransportAvailable, C)

R.AtWarPersiaDivisionTransportAvailable
// *******************************
// Countries at war with Persia - division transport available
// The variable C is set when this rule is called
// *******************************
IF C.AtWar(Persia) OR
CooperatesWithCountryAtWarPersia(C) THEN
Return C.Units.FirstThat(DivisionTransportAvailable, Transport)
ELSE Return False

R.TRSAvailable
// *******************************
// TRS/AMPH is available and in the sea area or within range of it
// The variable Transport is set when this rule is called
// *******************************
// Transport's type is TRS/AMPH; Transport is in supply, organized, and in
// the Persian Gulf or within range of it with the sea box >= 2
// *******************************
IF (Transport.UnitType IN [TRS, AMPH]) AND
Transport.Organized AND
(Transport.InSupply OR
Transport.CanBeInSupply) AND
(((Transport.SeaArea = PersianGulf) AND
(Transport.SeaBox >= 2)) OR
(Transport.Range(PersianGulf) AND
(Transport.Movement >= PersianGulf.Box2))) THEN
Return Countries.FirstThat(AtWarPersiaInvadingUnitAvailable, C)
ELSE Return False

R.AtWarPersiaInvadingUnitAvailable
// *******************************
// Countries at war with Persia - invading unit available
// The variable C is set when this rule is called
// *******************************
IF C.AtWar(Persia) THEN
Return C.Units.FirstThat(InvadingUnitAvailable, Unit)
ELSE Return False

R.InvadingUnitAvailable
// *****************************
// Land unit available, on a coastal hex or stacked with TRS/AMPH, and the unit
// can also be carried by the available transport
// The variable Unit is set when this rule is called
// *******************************
// Non-MAR can only invade from AMPH if option AmphibiousUnits is used
// *******************************
IF Option.AmphibiousUnits AND
(NOT (Unit.UnitType IN MarineSet)) AND
(Transport.UnitType = TRS) THEN
Return False
// *******************************
// Land unit is coastal hex Persian Gulf/stacked with TRS and unit is in supply,
// is organized Infantry, and small matches MARSmall
// *******************************
ELSE IF (Unit.Hex IN [PersianGulf.CoastalHex] OR
Transport.Cargo = Unit) AND
Unit.Organized AND
(Unit.Small = MARSmall) AND
(Unit.UnitType IN InfantrySet) AND
(NOT (Unit.UnitType IN MotorizedSet) AND
Unit.CooperatesWith(Transport) AND
(Unit.InSupply OR
Unit.CanBeInSupply) THEN
Return True
ELSE Return False

R.DivisionTransportAvailable
// *******************************
// TRS/AMPH/SCS is available and in sea area or within range of it
// *******************************
// Transport's type is TRS or AMPH or SCS; transport is in supply, organized,
// and in the Persian Gulf or within range of it with the sea box >= 3
// The variable Transport is set when this rule is called
// *******************************
IF ((Transport.UnitType IN [TRS, AMPH]) OR
((Transport.UnitType = SCS) AND
Option.SCSInvasion)) AND
Transport.Organized AND
(((Transport.SeaArea = PersianGulf) AND
(Transport.SeaBox >= 3)) OR
(Transport.Range(PersianGulf) AND
(Transport.Movement >= PersianGulf.Box3))) AND
(Transport.InSupply OR
Transport.CanBeInSupply) THEN
Return Countries.FirstThat(AtWarPersiaInvadingUnitAvailable, C)
ELSE Return False

R.ParadropThreatToOilwells
// *******************************
// Paradrop threat to oil wells
// *******************************
// Only if the weather in the Mediterranean zone is neither storm nor blizzard
// *******************************
Return (NOT (Weather.Mediterranean IN [Storm, Blizzard])) AND
Countries.FirstThat(AtWarPersiaATROilWells, C)

R.AtWarPersiaATROilWells
// *******************************
// Loop over all countries at war with Persia – ATR
// The variable C is set when this rule is called
// *******************************
IF C.AtWar(Persia) THEN
Return C.Units.FirstThat(ATROilwells, ATR)
ELSE Return False

R.ATROilWells
// *****************************
// Para unit available that can be carried by an ATR within range of an oil well
// *******************************
Location1 = (80, 77)
Location2 = (82, 78)
Location3 = (84, 79)

Return ATRAvailable AND
(ATR.WithinRange(Location1) OR
ATR.WithinRange(Location2) OR
ATR.WithinRange(Location3))

R.ParadropThreatToTeheran
// *******************************
// Paradrop threat to Teheran
// *******************************
// Only if the weather in the Mediterranean zone is neither storm nor blizzard
// *******************************
IF Weather.Mediterranean IN [Storm, Blizzard] THEN
Return False
// *******************************
// Loop over all attacking nations ATR
// *******************************
ELSE Return Countries.FirstThat(AtWarPersiaATRTeheran, C)

R.AtWarPersiaATRTeheran
// *******************************
// ATR's range gets it to within 3 hexes of Teheran
// The variable C is set when this rule is called
// *******************************
IF C.AtWar(Persia) THEN
Return C.Units.FirstThat(ATRCloseTeheran, ATR)
ELSE Return False

R.ATRCloseTeheran
// *******************************
// ATR can land a unit within 3 hexes of Teheran
// The variable ATR is set when this rule is called
// *******************************
Return ATRAvailable AND
ATR.Range > (ATR.HexDist(Teheran) - 3)

R.ATRAvailable
// *******************************
// Air transport available
// *******************************
// Unit is a ATR, organized, in supply, and has range to reach the target
// *******************************
IF (ATR.UnitType = ATR) AND
ATR.Organized AND
(ATR.InSupply OR
ATR.CanBeInSupply) THEN
Return Countries.FirstThat(AtWarPersiaParaAvailable, C2)
ELSE Return False

R.AtWarPersiaParaAvailable
// *******************************
// Para unit available for ATR
// The variable C2 is set when this rule is called
// *******************************
IF C2.AtWar(Persia) THEN
Return C2.Units.FirstThat(ParaAvailable, Para)
ELSE
Return False

R.ParaAvailable
// *******************************
// Para available
// *******************************
// Para is a PARA, organized, in supply, and within movement range of ATR's hex
// *******************************
Return (Para.UnitType = PARA) AND
Para.Organized AND
(Para.InSupply OR
Para.CanBeInSupply) AND
Para.MovementRange(ATR.Hex)
Para.CooperatesWith(ATR)

R.ChanceToOverrunDisorganizedUnit
// ****************************************************************************
// Chance to overrun a disorganized unit
//
// IF A, B, C, D AND E
// A) There is a disorganized Allied naval/air/supply unit(s) without a land
// unit guarding it
// B) The Persian CAV can reach it in one impulse
// C) The axis major power controlling Persia is at war with allied major power
// that controls the disorganized unit
// D) The Persian CAV can enter the country/territory that the disorganized unit
// is located in
// E) The Allies can’t move or rail a unit to protect the disorganized unit
// ****************************************************************************
Return Allied.Units.ForEach(ChanceToOverrun, U)

R.ChanceToOverrun
// *******************************
// Chance to overrun Unit?
// *******************************
Return Unit.Disrupted AND
(Unit.UnitType IN (Air, Naval, SupplyUnit)) AND
Persia.BorderHexes.FirstThat(UnitWithinFourHexes, Hex, Unit) AND
PersianCavCanReachDisorganizedUnitHex AND
(Persia.AtWar(Unit.Country) OR
Persia.ControllingMajorPower.AtWar(Unit.Country) AND
(NOT Allied.Units.FirstThat(LandUnitProtectingHex, Hex, Unit)) AND
(NOT AlliedUnitCanMoveToThreatenedHex(Unit.Hex)) AND
MinorCountryUnitsCanEnter(Persia, Unit.Hex.Country) THEN

R.AlliedUnitCanMoveToThreatenedHex
// *******************************
// Checks if the Allies can move a land unit to a threaded hex one impulse
// The variable Hex is set when this rule is called
// *******************************
TargetHex = Hex
Return Allied.Units.FirstThat(UnitCanBeMovedToTargetHex, U)

R.LandUnitProtectingHex
// *******************************
// Checks if a the land unit are in the same hex
// The variable Hex, Unit are set when this rule is called
// *******************************
Return Hex = Unit.Hex

R.UnitWithinFourHexes
// *******************************
// Checks if a the distance between two hexes are 4 or less
// The variable Hex, Unit are set when this rule is called
// *******************************
Return HexDist(Hex, Unit.Hex) <= 4

R.PersianCavCanReachDisorganizedUnitHex
// *******************************
// Checks if the Persian 3-4 CAV can reach a Hex from any Persian border hex
// The variable UnitHex is set when this rule is called
// *******************************
Return Peria.BorderHexes.FirstThat(CanReachDisorganizedUnit, Hex, UnitHex)

R.CanReachDisorganizedUnit
// *******************************
// Checks if the Persian 3-4 CAV can reach Hex X from Hex Y in one impulse
// The variable Hex, UnitHex are set when this rule is called
// *******************************
// Temporarily assign a location for specific Persian unit
// *******************************
Persia.Unit(3-4 CAV).Hex = Hex
// *******************************
// Can the Persian CAV reach the disrupted unit hex from the
// temporary location in one impulse?
// *******************************
Return Persia.Unit(3-4 CAV).ImpulsesToReach(UnitHex.Hex) = 1

R.ChanceToConquerIraq
// *******************************
// Chance to conquer Iraq
//
// IF A, B, C, D AND E
// A) Iraq is controlled/conquered by the Allies
// B) There is no allied unit in Baghdad
// C) the Persian CAV can reach Baghdad in one impulses
// D) Major power controlling Persia is at war with Major power controlling Iraq
// E) The Allies can’t move or rail a unit to Baghdad
// *******************************
Return (Iraq.Side = sdAllied) AND
(NOT AlliedUnitInBaghdad) AND
PossibleForPersianCAVToReachBaghdad AND
Persia.ControllingMajorPower.AtWar(Iraq.ControllingMajorPower) AND
(NOT AlliedUnitCanBeMovedToBaghdad) THEN

R.AlliedUnitInBaghdad
// *******************************
// Check if Baghdad is occupied by an Allied unit
// *******************************
Return MapStacks(Baghdad).FirstThat(AlliedUnit, U)

R.AlliedUnit
// *******************************
// Check if unit is controlled by the Allied side
// *******************************
Return U.Side = adAllied

R.PossibleForPersianCAVToReachBaghdad
// *******************************
// Possible for Persian CAV to reach Baghdad in 1 moves
// *******************************
Return (Persia.Unit(CAV (3-4)).ImpulsesToReach(Baghdad) = 1)

R.AlliedUnitCanMoveToBaghdad
// *******************************
// Checks if the Allies can move a unit to Baghdad in one impulse
// *******************************
TargetHex = Baghdad
Return Allied.Units.FirstThat(UnitCanMoveToTargetHex, U)

R.UnitCanMoveToTargetHex
// *******************************
// Can a unit be moved to TargetHex in one impules
// TargetHex is an input parameter to this rule.
// *******************************
IF Unit.Organized AND
(Unit.InSupply OR
Unit.CanBeInSupply) AND
(Unit.UnitType IN LandUnitSet) AND
Unit.ImpulsesToReach(TargetHex) = 1 THEN
Return True
ELSE IF Unit.Organized AND
Unit.UnitType IN LandUnitSet AND
RailMovePossible(Unit, TargetHex) AND
(RailDist(Unit.Hex, TargetHex) <= 60) THEN
Return True
ELSE Return False
// ****************************************************************************
//
// End of rules; Beginning of setups.
//
// ****************************************************************************
[Setup BorderDefense]
// *******************************
// Border Defense
// *******************************
// NW attack
// *******************************
1 CAV (3-4), (72,78) OR
1 CAV (3-4), (73,77) OR
1 CAV (3-4), (74,79) OR
// *******************************
// NE attack
// *******************************
1 CAV (3-4), Bandar Shah

[Setup OilwellDefense]
// *******************************
// Oil Well Defense
// *******************************
1 CAV (3-4), Bandar Shah OR
1 CAV (3-4), (82,78) OR
1 CAV (3-4), (83,78)

[Setup CapitalDefense]
// *******************************
// Capital Defense
// *******************************
1 CAV (3-4), Teheran

[Setup MarauderDefense]
// *******************************
// Marauder Defense
// *******************************
// Iraq attack
// *******************************
1 CAV (3-4), (75,74) OR
// *******************************
// Overrunning a disorganized unit
// Border Hexes 2 space appart if possible
// *******************************
1 CAV (3-4), (81,76) OR // Swamp E of Bandar Shaput
1 CAV (3-4), (79,76) OR
1 CAV (3-4), (77,75) OR
1 CAV (3-4), (75,74) OR
1 CAV (3-4), (73,75) OR
1 CAV (3-4), (72,75) OR
1 CAV (3-4), (71,74) OR
1 CAV (3-4), (69,74) OR
1 CAV (3-4), (70,75) OR
1 CAV (3-4), (70,76) OR
1 CAV (3-4), (72,78) OR
1 CAV (3-4), (73,83) OR // Swamp hex 2 hex NE Bandar Shah
1 CAV (3-4), (71,84) OR
1 CAV (3-4), (71,85) OR
1 CAV (3-4), (72,88) OR
1 CAV (3-4), (73,89) OR
1 CAV (3-4), (75,89) OR
1 CAV (3-4), (77,89) OR
1 CAV (3-4), (79,89) OR
1 CAV (3-4), (80,90) OR
1 CAV (3-4), (82,89) OR
1 CAV (3-4), (84,89) OR
1 CAV (3-4), (86,90) OR
1 CAV (3-4), (88,89)
===========
Steve

Perfection is an elusive goal.
User avatar
wworld7
Posts: 1726
Joined: Tue Feb 25, 2003 2:57 am
Location: The Nutmeg State

RE: Long Time Coming!

Post by wworld7 »

Steve,

All that and not even one line of code for the special Irish leadership bonus.

Bah Humbug!!!
Flipper
Post Reply

Return to “World in Flames”