Developer Resource

Search Filter Reference

How search_filters work in MD focus trees, what every relevant filter means, and how to assign them.

How search_filters work in MD focus trees, what every relevant filter means, and how to assign them.

How Search Filters Work

Each focus can have one or more search_filters values. They power the filter buttons in the focus search UI: clicking a filter shows only focuses tagged with it. Every focus must have at least one filter.

search_filters = { FOCUS_FILTER_POLITICAL FOCUS_FILTER_ISRPOLIT }

Multiple filters are space-separated inside the braces, on a single line.

Two-Layer Convention

Most country trees use a two-layer approach:

  1. Country-specific filter: which country/faction the focus belongs to (e.g. FOCUS_FILTER_ISRPOLIT, FOCUS_FILTER_RUSSIA_ECONOMY). Always include this.
  2. Generic filter: the broad category (e.g. FOCUS_FILTER_POLITICAL, FOCUS_FILTER_INDUSTRY). Makes the focus discoverable through global filter buttons.

Countries using only custom filters are invisible to generic searches. Always include both layers.

Exception: Smaller/simpler trees may use only generic filters with no custom ones, this is fine.

Generic Filters: Full Reference

Political & Governance

FilterWhen to use
FOCUS_FILTER_POLITICALGovernment system changes, ideology shifts, party politics, elections, constitutional reforms, power consolidation
FOCUS_FILTER_STABILITYFocuses that directly raise/lower stability, suppress unrest, or deal with internal order
FOCUS_FILTER_INTERNAL_AFFAIRSDomestic governance, civil service reform, bureaucracy, regional autonomy
FOCUS_FILTER_INTERNAL_FACTIONManaging internal party factions, coalition politics, faction-specific content
FOCUS_FILTER_CORRUPTIONAnti-corruption initiatives, judicial reform aimed at accountability
FOCUS_FILTER_PROPAGANDAInformation control, state media, ideological campaigns
FOCUS_FILTER_RADICALIZATIONPolitical radicalization events, extremist movements
FOCUS_FILTER_SOCIAL_CONSERVATISMSocial policy reforms, cultural legislation, religious law

Military

FilterWhen to use
FOCUS_FILTER_MILITARY_LAWSMilitary doctrine, organisation laws, high command reforms, general military policy
FOCUS_FILTER_ARMYGround forces: infantry equipment, armour, artillery, divisions, ground XP
FOCUS_FILTER_AIRCRAFTAir force: plane procurement, air squadrons, airbase upgrades, air XP, pilot training
FOCUS_FILTER_NAVYNaval: ship construction, submarine programs, naval XP, fleet composition
FOCUS_FILTER_EQUIPMENTWeapons systems and military hardware: missile defence, precision munitions, missile programs, military exports
FOCUS_FILTER_MANPOWERConscription laws, reserve forces, mobilisation capacity, recruitment
FOCUS_FILTER_WAR_SUPPORTFocuses that raise war support or prepare the public for conflict
FOCUS_FILTER_ARMY_XPFocuses whose primary effect is granting army experience
FOCUS_FILTER_AIR_XPFocuses whose primary effect is granting air experience
FOCUS_FILTER_NAVY_XPFocuses whose primary effect is granting navy experience
FOCUS_FILTER_SPACESpace programs, satellite launches, aerospace development
FOCUS_FILTER_INSURGENCYCounter-insurgency, occupation management, conflict with non-state actors, intifada-type mechanics

Economy & Industry

FilterWhen to use
FOCUS_FILTER_INDUSTRYFactory construction, infrastructure investment, industrial capacity, general economic development
FOCUS_FILTER_ECONOMYMacroeconomic policy, fiscal reform, monetary policy, economic restructuring
FOCUS_FILTER_EXPENDITUREBudget spending decisions, costly investment focuses (pair with a factor = 0 / has_active_mission = bankruptcy_incoming_collapse modifier in ai_will_do)
FOCUS_FILTER_RESEARCHTechnology research bonuses, university investments, R&D programs, science institutions
FOCUS_FILTER_RESOURCENatural resource extraction, energy deals, gas/oil agreements, mining
FOCUS_FILTER_TRADETrade agreements, export policy, customs union membership
FOCUS_FILTER_FOREIGN_INVESTMENTSAttracting foreign capital, investment zones, privatisation
FOCUS_FILTER_ENVIRONMENTGreen energy, conservation, environmental policy
FOCUS_FILTER_RENEWABLE_ENERGY_INFRASTRUCTURESpecifically renewable energy (solar, wind, etc.) infrastructure
FOCUS_FILTER_POWER_INFRASTRUCTUREElectrical grid, power station construction
FOCUS_FILTER_ADD_BUILDINGFocuses whose primary effect is directly constructing a specific building type
FOCUS_FILTER_INFRASTRUCTURERoad/rail/port infrastructure projects (not factory slots)

Diplomacy & Foreign Relations

FilterWhen to use
FOCUS_FILTER_FOREIGN_POLICYGeneral diplomatic relations, treaties, improving/worsening relations with specific countries
FOCUS_FILTER_DIPLOMACYDirect diplomatic actions: guarantees, non-aggression pacts, military access
FOCUS_FILTER_INFLUENCESoft power, sphere of influence, puppet relations
FOCUS_FILTER_ANNEXATIONTerritorial expansion, annexing nations, puppet→annex transitions
FOCUS_FILTER_SECTARIANISMReligious or ethnic conflict between communities, sectarian violence mechanics
FOCUS_FILTER_MIGRANT_CRISISRefugee flows, migration pressure, border management

Alliance & Bloc Filters

FilterWhen to use
FOCUS_FILTER_NATONATO membership, NATO-related focuses, Atlantic alliance mechanics
FOCUS_FILTER_EUROPEAN_UNIONEU integration focuses, EU membership mechanics
FOCUS_FILTER_CMWCommonwealth of Nations membership and mechanics
FOCUS_FILTER_TFV_AUTONOMYAutonomy within a faction or overlord relationship

Meta / System Filters

FilterWhen to use
FOCUS_FILTER_COUNTER_DEBUFFFocuses specifically designed to remove a starting negative national spirit

Israel-Specific Filters

Israel uses six custom filters. Every Israel focus needs the ISR custom filter plus the corresponding generic filter below.

ISR FilterPurposePaired Generic Filter
FOCUS_FILTER_ISRPOLITParty politics, government composition, ideology changes, electoral mechanics, constitutional reformsFOCUS_FILTER_POLITICAL
FOCUS_FILTER_ISRMILITARYIDF doctrine, training, military organisation, see subcategory table belowvaries (see below)
FOCUS_FILTER_ISRFOREIGNPOLDiplomacy, treaties, alliances, regional relations (Abraham Accords, Arab states, USA, etc.)FOCUS_FILTER_FOREIGN_POLICY
FOCUS_FILTER_ISRECONIsraeli economic development, fiscal policy, high-tech sector, see subcategory tablevaries (see below)
FOCUS_FILTER_ISRPALSTUFFIsraeli-Palestinian conflict mechanics: intifada, settlements, operations, occupationFOCUS_FILTER_INSURGENCY
FOCUS_FILTER_ISRPOLICEIsraeli law enforcement, Mišmeret Yisraʾel, internal security institutionsFOCUS_FILTER_STABILITY

ISRMILITARY Subcategory Mapping

When a focus has FOCUS_FILTER_ISRMILITARY, choose the generic based on its content:

Content typeGeneric to addExample focuses
Air force doctrine, plane procurement, squadron management, pilot training, airbase upgradesFOCUS_FILTER_AIRCRAFTISR_raam, ISR_sufa, ISR_adir, ISR_focus_air, ISR_lavi, ISR_shuffle_squadrons, ISR_aerospace_industries_focus
Naval: ships, submarines, fleet programsFOCUS_FILTER_NAVYISR_focus_navy, ISR_ships_saar, ISR_dolphin_1, ISR_dakar
Space programs, satellite systemsFOCUS_FILTER_SPACE + FOCUS_FILTER_EQUIPMENTISR_spaceil, ISR_bereshit, ISR_kochav, ISR_ofek_satellites, ISR_ilan_ramon
Missile defence systems, weapons systems, military hardware, armoured vehicle programsFOCUS_FILTER_EQUIPMENTISR_iron_dome, ISR_davids_sling, ISR_arrow, ISR_magic_wand, ISR_merkava_focus, ISR_fab_defense, ISR_mafat
Ground doctrine, training programs, brigade organisation, special forcesFOCUS_FILTER_MILITARY_LAWSISR_war_between_the_wars, ISR_tenufa_project, ISR_gideon_plan, ISR_focus_ground_forces, ISR_urban_warfare

ISRECON Subcategory Mapping

Content typeGeneric to addExample focuses
R&D, universities, tech sector investment, innovationFOCUS_FILTER_RESEARCH + FOCUS_FILTER_INDUSTRYISR_ben_gurion_university, ISR_hightech_fortress, ISR_start_up_nation
Natural resources, gas deals, energy agreementsFOCUS_FILTER_RESOURCE + FOCUS_FILTER_INDUSTRYISR_pass_the_gas_deal, ISR_compromise_gas_deal, ISR_karish
General economic development, factories, fiscal policyFOCUS_FILTER_INDUSTRYISR_middle_class, ISR_israel_green_deal, ISR_diamond_district

Other Country Custom Filters (Quick Reference)

These custom filters exist for other country trees, do not add them to Israel or unrelated trees:

CountryCustom Filters
RussiaFOCUS_FILTER_RUSSIA_ECONOMY, FOCUS_FILTER_RUSSIA_ARMY, party filters (LDPR, CPRF, UNITED, etc.)
UkraineFOCUS_FILTER_UKRAINE_VSU, FOCUS_FILTER_UKRAINE_SECURITY, party/leader filters
ArmeniaFOCUS_FILTER_ARMENIA_POLITIC, FOCUS_FILTER_ARMENIA_DIPLOMACY, FOCUS_FILTER_ARMENIA_ECONOMY, FOCUS_FILTER_ARMENIA_ARMY, FOCUS_FILTER_ARMENIA_POLICE
BrazilFOCUS_FILTER_BRAZILIAN_MERCOSUR, FOCUS_FILTER_UNASUL, FOCUS_FILTER_OPERATION_CAR_WASH, FOCUS_FILTER_AMAZON_CONSERVATION
IranFOCUS_FILTER_IRANIAN_NUCLEAR_DEV, FOCUS_FILTER_COLLAPSE_ISLAMIC_REPUBLIC, FOCUS_FILTER_THOUSAND
KoreaFOCUS_FILTER_KOREAN_PENINSULA, FOCUS_FILTER_KOREAN_NUCLEAR_ISSUE
ItalyFOCUS_FILTER_ITA_MAFIA
UKFOCUS_FILTER_INNER_CIRCLE
Czech Rep.FOCUS_FILTER_SKODA
SpainFOCUS_FILTER_SPR_CULTURE
TransnistriaFOCUS_FILTER_TRANSNISTRIA_* (9 filters)
South OssetiaFOCUS_FILTER_OSSETIA_* (7 filters)
UralFOCUS_FILTER_URAL_* (3 filters)

Common Mistakes

WrongCorrect
Only custom filter, no genericAlways add the paired generic (see tables above)
FOCUS_FILTER_MILITARYUse FOCUS_FILTER_MILITARY_LAWS (MILITARY is a legacy/unused alias)
Using FOCUS_FILTER_DIPLOMACY for all foreign policyUse FOCUS_FILTER_FOREIGN_POLICY for general relations; FOCUS_FILTER_DIPLOMACY for specific diplomatic actions
Tagging economic investment focuses without FOCUS_FILTER_EXPENDITUREAdd FOCUS_FILTER_EXPENDITURE to high-cost industrial/economic focuses, and add a bankruptcy guard in ai_will_do
Missing filter entirelyEvery focus must have at least one filter
Using another country’s custom filterCustom filters (RUSSIA**, UKRAINE**, ISRPOLIT, etc.) are country-specific, never cross-assign

Checklist When Adding a New Focus

  1. Choose the country-specific custom filter matching the focus’s branch.
  2. Choose the generic filter from the tables above (one or two, don’t over-tag).
  3. For high-cost focuses, add a factor = 0 modifier in ai_will_do conditioned on has_active_mission = bankruptcy_incoming_collapse: AI-only, not in available. Thresholds: cost >= 8 for any focus, or cost >= 5 if tagged military / economy / research. Why: at/above these costs the focus commits enough treasury that an AI already in collapse digs deeper; the lower econ/mil/research threshold reflects that those focuses typically chain larger monetary effects alongside the focus cost.
  4. Write search_filters as a single line: search_filters = { CUSTOM_FILTER GENERIC_FILTER }.