Hearts of Iron IV

Hearts of Iron IV

Dynamic Research Slots Reborn
正在显示第 1 - 10 项,共 14 项条目
< 1  2 >
更新于:11 月 30 日 下午 8:39

Version 1.5.3 – Localization Update

Localization:
  • Updated Russian localization (Thanks to verdammtigor)

更新于:11 月 21 日 下午 12:02

Version 1.5.2 – Localization Update

Localization:
  • Updated Simplified Chinese localization (Thanks to AutumnPizazz)

更新于:11 月 20 日 下午 12:16

Just a version Update to 1.17.*

Nothing more to see.. for now

更新于:11 月 20 日 上午 8:26

Version 1.5 – Performance & Code Quality Update

Major performance improvements with Smart Detection System and code quality enhancements!

🚀 Major Changes:

  • Smart Detection System: Intelligent factory change detection reduces unnecessary calculations by 75-85% while maintaining instant responsiveness
  • Unified AI System: AI countries now use the same smart detection as players – immediate updates when factories change (no more 30-day delays)
  • Instant Territory Updates: Research slots update immediately when you gain or lose territory
  • Code Quality: 83% reduction in redundant code, improved maintainability




Performance Improvements:

  • 75-85% reduction in unnecessary calculations for typical gameplay
  • Average daily performance impact reduced by ~70%: typically ~0.3ms (range: 0.2-0.5ms, down from ~1ms)
  • Factory changes are still detected immediately – no delay in responsiveness
  • Weekly fallback ensures custom buildings from submods are still detected within 7 days
  • Smoother gameplay, especially in large mod setups
  • Better compatibility with performance-heavy mods




AI System Improvements:

  • AI countries now use the same Smart Detection System as players
  • AI countries are updated immediately when factories change (no more waiting 30 days)
  • Fixes confusion caused by the previous 30-day interval where AI research slots seemed unresponsive
  • AI countries get an initial calculation at game start to ensure correct research slots from day 1
  • Regular fallback ensures AI research slots stay up to date even without factory changes
  • Configurable update frequency: AI update frequency is now configurable via dr_ai_update_frequency (default: 14 days, can be customized by submods)




New Features:

  • Immediate recalculation when conquering territory: Research slots now update instantly when you conquer new states via on_state_control_changed
  • This ensures research slots reflect increased industrial capacity immediately after conquest
  • Note: Due to HOI4's on_state_control_changed only triggering for the new controller, losing territory updates on the next daily check instead




Code Quality Improvements:

  • Consolidated government type detection logic (83% reduction in redundant code)
  • Refactored peace bonus calculations for better maintainability
  • Improved code structure while maintaining full backward compatibility




For Modders:

New Helper Effects:

  • dr_set_government_popularity – Simplified government type detection
  • dr_map_government_support_to_peace_bonus – Streamlined peace bonus mapping
  • dr_check_for_factory_changes – Factory change detection system
  • dr_recalculate_if_needed – Conditional recalculation wrapper

Usage Examples:

  • For government support calculations: Use dr_set_government_popularity + dr_get_government_support_factor
  • For peace bonus mapping: Use dr_map_government_support_to_peace_bonus
  • For custom recalculation logic: Reference dr_check_for_factory_changes and dr_recalculate_if_needed

See docs/technical_reference.md and docs/submodding_guide.md (in mod folder or on GitHub) for complete documentation and examples.




Bug Fixes:

  • Fixed syntax error in on_actions file that could cause parsing issues
  • Improved defensive programming with better validation checks
  • Fixed Alliance RP Bonus logic: The bonus now correctly checks mutual opinion (average of "they like us" and "we like them") instead of checking the player's opinion of themselves




Documentation:

  • Updated technical_reference.md with new helper effects and Smart Detection System documentation
  • Expanded submodding_guide.md with examples for using new helper effects
  • Extended performance.md with detailed analysis of the Smart Detection System




Save-Game Compatibility:

This update is fully save-game compatible. All changes are backward compatible and existing campaigns will continue to work without issues. The performance improvements will apply automatically when you load your save game, but no variables or progress will be lost.




Gameplay Impact:

No gameplay changes – this is purely a performance and code quality update. All mechanics, game rules, and features work exactly as before, just faster and more efficiently.

更新于:11 月 18 日 上午 10:09

Version 1.4.1 – Thumbnail Format Fix

Updated thumbnail image format from 600x600 to 512x512 pixels to match Paradoxlauncher requirements. The "Reborn" text is now much more readable!

As you might have guessed, this update doesn't break your saves. It's literally just a thumbnail fix ^^

Update: It looks better with the 1px outliner, but in the Paradox launcher it's still not fully shown. I will look into how to fix that.

更新于:11 月 18 日 上午 9:38

Version 1.4.0 – Experimental Facilities Balancing & Nuclear Reactors (plus backend improvements)

Experimental facilities have been rebalanced with diminishing returns, and nuclear reactors now contribute to your research power!

Balancing Changes:

  • Experimental Facilities now use diminishing returns: Each additional facility of the same type provides less RP than the previous one (15% reduction per facility). This prevents excessive RP farming from spamming facilities.

  • RP values have been adjusted:
    • Nuclear Research Facility: 30 RP per facility (with diminishing returns)
    • Naval/Air/Land Facilities: 15 RP per facility each (with diminishing returns)

  • Nuclear Reactors now contribute Research Power:
    • Nuclear Reactor: +20 RP per reactor (with diminishing returns)
    • Heavy Water Reactor: +35 RP per reactor (with diminishing returns)
    • Commercial Reactor: +12 RP per reactor (with diminishing returns)
    • All reactor types use a 15% reduction per additional reactor to maintain balance

Save-Game Compatibility:

This update is fully save-game compatible. All changes are backward compatible and existing campaigns will continue to work without issues. The balancing adjustments will apply when you load your save game, but no variables or progress will be lost.

Config & Script Hooks Refactoring:

  • Refactored `dr_apply_research_config` into modular helper effects (`dr_reset_research_config_defaults`, `dr_apply_research_factory_weight_rules`, `dr_apply_easy_slot_rule_overrides`, `dr_apply_easy_slot_cost_rules`) for better maintainability and extensibility.

  • Split war/peace RP logic into modular helper effects (`dr_calculate_war_penalty_factors`, `dr_calculate_war_phase_factor`, `dr_calculate_peace_bonus`) and added `dr_get_government_support_factor` helper for centralized government support checks. Government support thresholds are now configurable via config variables instead of hardcoded values.

  • Added new hook `dr_apply_research_config_submods` that runs after all vanilla defaults and game rules. Submods can now adjust RP weights, thresholds, Easy Slots, or facility bonuses without copying the entire config file.

  • Introduced three runtime hooks inside `recalculate_dynamic_research_slots`:
    • `dr_collect_facility_counts_submods` – count custom buildings or scripted states that should translate into facility-style RP
    • `dr_apply_facility_rp_submods` – convert custom counters into flat RP, or add extra RP sources
    • `dr_total_rp_modifier_submods` – final tweaks to `total_research_power` after all vanilla modifiers (e.g., faction-wide buffs, ideology bonuses, or penalties)

  • Added new alliance hook `dr_get_opinion_factor_for_ally_submods` that runs during alliance RP calculation for each alliance member. Allows submods to override opinion factor calculation (0.0 to 1.0) for alliance bonuses.

  • Added edge-case validations for improved robustness:
    • Facility count validation – prevents negative facility counts that could cause calculation errors
    • Modifier validation and capping – limits `total_rp_modifier` between -0.5 and 1.0
    • Total RP validation – prevents negative research power values
    • Array validation – automatically re-initializes configuration if threshold arrays are missing

Documentation & Examples:

  • Expanded `submodding_guide.md` and `technical_reference.md` with quick-reference tables that show all 9 hooks at a glance and clearly document their usage.

  • Added new quick-start template (`submod_quick_start_template.md`) with all 9 hooks ready to copy and adjust – ideal for rapid prototyping.

  • Full walkthrough in the submodding guide showing how to add RP from custom buildings using the new hook pipeline (Example 4: "Adding RP from custom buildings").

  • Extended performance documentation with best practices for submod developers to avoid common performance pitfalls.

For Modders:

The new hook structure makes it easier to customize the system:
- For small tweaks: Use `dr_apply_research_config_submods`
- For custom buildings: Use `dr_collect_facility_counts_submods` + `dr_apply_facility_rp_submods`
- For final RP adjustments: Use `dr_total_rp_modifier_submods`
- For alliance opinion overrides: Use `dr_get_opinion_factor_for_ally_submods`
- For extensive changes: Still override the entire config file

Total: 9 hooks available (8 since version 1.0, 1 additional with version 1.4)

See `docs/submodding_guide.md` for complete documentation and examples.

更新于:11 月 17 日 下午 1:33

Version 1.3.0 – Enhanced Submod Support & Documentation... AGAIN ^^
Should be the last time for submods unless it's in demand

Config & Script Hooks:

  • Refactored `dr_apply_research_config` into modular helper effects (`dr_reset_research_config_defaults`, `dr_apply_research_factory_weight_rules`, `dr_apply_easy_slot_rule_overrides`, `dr_apply_easy_slot_cost_rules`) for better maintainability and extensibility.

  • Added new hook `dr_apply_research_config_submods` that runs after all vanilla defaults and game rules. Submods can now adjust RP weights, thresholds, Easy Slots, or facility bonuses without copying the entire config file.

  • Introduced three runtime hooks inside `recalculate_dynamic_research_slots`:
    • `dr_collect_facility_counts_submods` – count custom buildings or scripted states that should translate into facility-style RP
    • `dr_apply_facility_rp_submods` – convert custom counters into flat RP, or add extra RP sources
    • `dr_total_rp_modifier_submods` – final tweaks to `total_research_power` after all vanilla modifiers (e.g., faction-wide buffs, ideology bonuses, or penalties)

Documentation & Examples:

  • Expanded `submodding_guide.md` and `technical_reference.md` with quick-reference tables that show all 8 hooks at a glance and clearly document their usage.

  • Added new quick-start template (`submod_quick_start_template.md`) with all 8 hooks ready to copy and adjust – ideal for rapid prototyping.

  • Full walkthrough in the submodding guide showing how to add RP from custom buildings using the new hook pipeline (Example 4: "Adding RP from custom buildings").

  • Extended performance documentation with best practices for submod developers to avoid common performance pitfalls.

Save-Game Compatibility:

This update is fully save-game compatible. All hooks are empty by default and have no impact unless overridden. The refactoring only affects the internal structure of config application but does not change behavior. Existing campaigns will continue to work without issues. Submods that override the newly introduced hooks can layer their changes without editing the main mod files.

For Modders:

The new hook structure makes it easier to customize the system:
- For small tweaks: Use `dr_apply_research_config_submods`
- For custom buildings: Use `dr_collect_facility_counts_submods` + `dr_apply_facility_rp_submods`
- For final RP adjustments: Use `dr_total_rp_modifier_submods`
- For extensive changes: Still override the entire config file

See `docs/submodding_guide.md` for complete documentation and examples.

更新于:11 月 17 日 上午 9:28

Update – Version 1.2.0 Restored

  • Version 1.2.0 has been re-enabled.
  • The issues I ran into were caused by my own HOI4 installation (I had reinstalled the game onto the wrong drive), not by the mod itself.
  • There are no known problems with 1.2.0; campaigns started on 1.1.1 or 1.2.0 remain save-game compatible.

The temporary rollback to 1.1.1 was just a safety measure – better safe than sorry. Thanks for your patience and sorry for the confusion!

更新于:11 月 17 日 上午 8:59

Hotfix – Temporary rollback to Version 1.1.1

  • Temporarily reverted the workshop item back to Version 1.1.1 while I investigate possible performance issues with Version 1.2.0.
  • New subscribers will receive Version 1.1.1 by default for now, so their campaigns should not be affected by the experimental changes in 1.2.0.
  • Once I’m confident that the new hooks and scripts are stable, I’ll re-enable 1.2.0 (or release a fixed 1.2.1) for everyone.

Sorry for the inconvenience to anyone who ran into issues.

更新于:11 月 17 日 上午 8:36

Version 1.2.0 – Submod Hooks & Documentation Update (Only interesting for modders)

Config & Script Hooks:
  • Refactored `dr_apply_research_config` into modular helpers and added the new `dr_apply_research_config_submods` hook so submods can change RP weights, thresholds, Easy Slots, or facility bonuses without touching the core script.
  • Introduced three runtime hooks inside `recalculate_dynamic_research_slots` (`dr_collect_facility_counts_submods`, `dr_apply_facility_rp_submods`, `dr_total_rp_modifier_submods`) to let submods count custom buildings, add new RP sources, or tweak final RP totals safely.

Documentation & Examples:
  • Expanded `SUBMODDING_DYNAMIC_RESEARCH_SLOTS.md` and `DYNAMIC_RESEARCH_SLOTS.md` with a quick-reference table plus ready-to-copy snippets for the new hooks.
  • Added a full walkthrough showing how to add RP from custom buildings using the new hook pipeline, making submod integration clearer.

This update is save-game compatible. Existing campaigns will keep working, and submods that override the newly introduced hooks can layer their changes without editing the main mod files.