User Tools

Site Tools


gamemanual:gm_war

War

The Game Mechanics section of the manual details the internal formula used in the game's calculations. This section of the manual uses pseudo-code and may not be 100% the same as the code in the game.

The Game Mechanics part of the manual is mainly designed to be a reference for the frequently asked question, “Why do I get this rating when I do X, Y, Z?!” Usually, this answer involves many different variables, which this section of the manual demonstrates.

The game mechanics section of the manual shows how the sausage gets made. So you really may want to avoid this portion of the manual if you enjoy the game.

Variables

Name Description Name Description
City Status The war status for the country, 1=Normal, 0=Limited, -1 War, -2 Total War. Compensation The amount of money the government will offer you for your factory. If you choose to fight them, you could lose it all without any payment.
Factory_Monthly_Costs Monthly costs of operating your factory at idle. year The current game year
WarEnds_Months The war will end in this many months. totalGDP The GDPs of all the countries at war with each other. As defined by taking every city's per capita income and multiplying it by the city population.
National Per Capita The per capita of each city in the country National Population The population of each city in the country
Number Of Countries The number of countries at war

Factory Destruction

City Bombardment

20% chance each turn:
{
    Select city with -2 "Total War" status.

    Destroy all factories in city.
    
    Set city to -1 "War" status.
}

Munitions Factory Bombing

10% chance each turn while producing munitions:
{
    Select Random City At War With -2 "Total War" status.

    If Player has Factory in City
    {
        Destroy Player Factory In City
    }
}

Munitions Accident

5% chance each turn while someone is producing munitions
{
    Select Random Factory Producing Munitions

     Destroy Factory
}

Factory Confiscation

Munitions Factory

 
5% chance each turn while producing munitions:
{
    Select Random City At War

    if Player HQ Country DOES NOT EQUAL City Country
    {
        Select Player Factory In City.
        
        Compensation = Factory_Built_Cost * 1.25
        
        Make Offer to Player
    }
}

Munitions Payments

for each factory producing munitions
{
    if(factory in HQ Country)
        Munitions_Revenues = Munitions_Revenues + (Factory_Monthly_Costs * 5+((year-1900)/10))
    else
        Munitions_Revenues = Munitions_Revenues + (Factory_Monthly_Costs * 3+((year-1900)/10))
}

Military Contracts

Random War Generation

0.4% chance each turn
{
    CityStatus = Random Number Between (0 AND 2) * -1
    
    WarEnds_Months = Random Number Between (0 AND 60) + 3
    
    if(CityStatus = 0)
        Select Random country not at war.
    else
        Select Random Number Between (2 AND 6) Countries
        
    
    
    For Each Country At War
    {
        totalGDP = totalGDP  + (National Per Capita * National Population)
    }
    
    For Each Country At War
    {
        if(Number Of Countries > 2 AND (National Per Capita * National Population) < (totalGDP/Number Of Countries) * 1.5 OR
            Number Of Countries = 2 AND (National Per Capita * National Population) < totalGDP 0.75) OR
            Number Of Countries = 1)
        {
            Set City Status of all cities in country
        }
    }
    
    
}
gamemanual/gm_war.txt · Last modified: 2022/08/09 15:51 by admin