AI INFLUENCE — CHANGELOG v3.2.4
Added: AI prompt now includes information about active diplomatic events relevant to the NPC (events involving NPC's kingdom or major world events).
Added: Quirks (speech patterns) are now automatically generated by AI when a character is first created, similar to personality and backstory. AI creates 1-3 unique speech patterns based on character's personality, culture, role, and age.
Added: Added new character_speech_quirks field to JSON structure (REQUIRED on first interaction). AI independently determines unique speech mannerisms for the character.
Added: Added NPC captives information to the prompt. NPCs now know about their prisoners (relatives, friends, and other lords) through a new "Your Captives" section and can mention them in conversation.
Added: When a forced marriage involves the player, the vanilla wedding scene (scn_cutscene_wedding) is shown, bypassing vanilla compatibility checks.
Added: NPC contexts now log player-led prison break rescues (ReleasedAfterEscape) into RecentEvents with settlement/faction/culture/owner details so it surfaces in prompts.
Fixed: Kingdoms can no longer attempt to expel a clan from themselves. The expel_clan action now automatically clears target_kingdom_id, as it is an internal kingdom action, not a diplomatic action directed at another kingdom.
Fixed: Updated AI prompt to explicitly state that expel_clan action requires target_kingdom_id = null. Added example usage of expel_clan with correct JSON format.
Fixed: Added validation after parsing AI response that automatically clears target_kingdom_id for expel_clan action if AI incorrectly specified it.
Fixed: Kingdoms can no longer make multiple diplomatic statements in a single round of one event. Added check to ensure each kingdom can only respond once per round.
Fixed: Fixed issue with parallel generation of ruler statements for different events. Added lock system (_isGeneratingStatements) for sequential event processing. Events are now processed one at a time per cycle, preventing conflicting statements from one kingdom for different events.
Fixed: Fixed logic for displaying diplomatic parameters in prompt. Parameters (settlement_id, tribute_amount, etc.) are now only shown when both player and NPC are kingdom leaders (changed condition from OR to AND).
Fixed: Fixed critical bug in War Fatigue system where war fatigue would decrease when capturing enemy settlements. Capturing settlements no longer affects fatigue (it cannot become negative).
Fixed: Fixed issue where war statistics were deleted when war ended, causing fatigue to reset to 0%. Statistics are now preserved, and fatigue gradually decreases during peacetime according to MCM settings.
Fixed: Fixed issue with DaysAtWar calculation that continued to grow even after war ended. Now only active wars are counted.
Fixed: Fixed issue with InitialSettlements that could change when capturing settlements. Base value is now fixed at initialization and does not change.
Fixed: Fixed critical war synchronization bug where the synchronization system would override AI decisions about peace/war. Added IsActive field to WarStatsAgainstKingdom to track war status (active/ended). When peace is made, wars are now marked as inactive, and synchronization no longer overrides AI decisions. This fixes the issue where after deleting JSON files and loading the game, AI could not properly declare wars/peace.
Fixed: Fixed syntax in `,then:return` modifier string - replaced incorrect quotes with escaped quotes to prevent compilation errors.
Fixed: Before sending messenger/initiative prompts we now force-update and persist NPC context (location, tasks, time, etc.) so data stays fresh, matching normal dialogue prompts.
Optimized: Restructured AI prompt - static parts (instructions, behavior rules, technical requirements) moved to the beginning of the prompt, while dynamic context (world state, events, conversation history) moved to the end. This improves AI cache utilization, as static parts remain unchanged between requests.
Optimized: Significantly reduced AI prompt size - removed duplicate rules and redundant information. Simplified sections and headers for better readability. Condensed repetitive instructions on romance, conflict, information sharing, and trading while preserving all key logic.
Optimized: Removed Validation Rules block that duplicated information from Core Directives and JSON field sections.
Optimized: Condensed backstoryInstruction from 6 lines to 1 line without losing functionality.
Optimized: Simplified JSON field descriptions (romance_intent, decision) - removed repeated rule listings, added references to corresponding sections.
Optimized: Reduced personality generation block - removed lengthy philosophical text, replaced with concise instruction, saving ~300-400 tokens on first encounter.
Optimized: Condensed and simplified item exchange section (item_transfers) in prompt. Added support for barter (item-for-item exchange without money). Improved instructions for buying, selling, and trading items.
Optimized: JSON structure is now divided into REQUIRED fields (mandatory) and OPTIONAL fields (included only if relevant). This significantly reduces AI response size.
Optimized: Character creation fields (character_personality, character_backstory, character_speech_quirks) are now completely absent from the prompt after initial character creation, instead of returning null values.
Optimized: Kingdom actions section is completely absent from the prompt if NPC is not a kingdom leader/vassal and cannot join the player. Saves ~200-400 tokens for regular NPCs.
Optimized: romance_intent field is completely absent from the prompt and response if romance is unavailable (relatives, married characters, prisoners). Saves ~10-15 tokens.
Optimized: Workshop fields (workshop_action, workshop_string_id, workshop_price) are only shown if NPC owns workshops.
Optimized: Reworked GetExampleJsonStructure function to generate minimal JSON examples with only relevant fields depending on context (romance, kingdom actions, workshops, character creation).
Optimized: Significantly reduced diplomatic event prompts (DynamicEventsAnalyzer, KingdomStatementGenerator, DynamicEventsGenerator) - removed ~220 lines of duplicate instructions and redundant information. Simplified LOGIC GUIDELINES, EVENT UPDATE STRUCTURE, DIALOGUE DEVELOPMENT, ACTIONS, FIELD SPECIFICATIONS sections while preserving all key logic.
Improved: Messenger prompt now shows the last 5 letters (with how many days ago they were sent) to help the AI avoid repeating itself in new letters.
Improved: Simplified JSON field descriptions and technical instructions while preserving all necessary rules for using commands and actions.
Improved: Added explicit instruction for AI to include only relevant fields and omit optional fields if they don't apply (e.g., no money_transfer if not exchanging money).
Improved: Added data priority understanding for AI - clear distinction between GROUND TRUTH (technical data = current reality) and CONTEXT (statement history = what was said). AI now correctly interprets when technical data conflicts with historical events.
Improved: Enhanced string_id usage instructions in diplomacy prompts - added detailed examples of extracting ID from "Kingdom Name (string_id:value)" format and clear separation of name usage (in descriptions) vs ID usage (in JSON fields).
Improved: Reworked relation descriptions (GetRelationDescription) in all three files - added more informative descriptions with diplomatic context (e.g., "Close Allies - Strong trust, easy agreements" instead of just "Very High"). Removed distracting range numbers, kept only meaningful descriptions for better AI understanding.
Improved: TimeContext update now occurs immediately before prompt generation. This ensures that time of day, season, and hour are always accurate at the moment of sending the AI request, instead of updating once every 2 in-game hours.
Improved: Completely reworked technical actions display system in prompts. Actions are now shown dynamically based on their status:
- Active actions are marked as (CURRENTLY ACTIVE) and show stop instructions
- Inactive actions show start instructions
- Added clear contextual hints on when NPCs should stop actions (e.g., during farewells, plan changes)
Improved: Updated ACTION SYSTEM general rules in prompt - added clear instructions on action start/stop format, improved structure with active action markers.
Improved: All technical actions (follow_player, go_to_settlement, return_to_player, attack_party, patrol_settlement, wait_near_settlement, siege_settlement, raid_village) now have two display modes with contextual instructions.
Removed: Removed predefined quirks system. Deleted DefaultQuirks, LoadQuirks(), GetRandomQuirks(), and GetAllQuirks(). The quirks.json file is no longer used.
Removed: The restriction on the use of Player2 has been removed.
Download:
Steam: https://steamcommunity.com/sharedfiles/filedetails/?id=3584621421