Jump to content
Game-Labs Forum

[1.5.1.6] [Code] Tweaks and Fixes v1.3.0: Better Shared Design handling, fixed sub range checks, per-shiptype component weights, tunable conquest, more to come.


NathanKell

Recommended Posts

As a break from my larger efforts to rewrite significant chunks of the game around ship design, I decided to make some small tweaks and fixes to deal with some major pain points from players and modders alike. The first two I've done are:

  • Better Shared Design selection. The year range for shared designs is much wider now, and only techs that are actually relevant to the design are required for the AI to select the design. For example, techs that give higher marks of torpedoes are irrelevant to a ship that doesn't carry torpedoes, so if the country lacks a torpedo tech that was used on the ship that won't prevent the design from being selected. The selection of design is weighted towards the most recent designs. Later I might do something where if there aren't any very-recent designs, some minor upgrading gets done, i.e. using the shared design like a template.
  • [Modder feature] Per-shiptype component weights. In the params column of the component data, you can add weight_per(bb;5;ca;10;dd;0...). Components with weight 0 or less won't be available at all for that ship type. Any shiptypes not covered by that param will use the component's normal weight. Note that the syntax is important, it's a series of pairs of <shiptype>;<weight>. Also, note that the availability affects the player as well as the AI, so you can for example add a special early turbine that is only available to TB and DD (to represent how they were used on light craft much earlier than on larger ships). Indeed you can have completely disjoint sets of components for each ship type if you really want to put in the work. Example: main_engine_4_early,,engine,$component_name_short_main_engine_4,1,$technology_name_engine_engine_5,$technology_desc_engine_engine_5,weight_per(tb;24;dd;24;bb;0;bc;0;ca;0;cl;0;ic;0;tr;0;amc;0;xx;0),
  • Fixed submarine movement range (cheers to @o Barão for pointing out this bug). The stock game doesn't use a wrapping distance check when seeing whether a submarine can move to a position on the world map. This is fixed here.
  • Fixed and improve conquest chance logic (cheers to @brothermunro for this request). Make the chance for conquest/naval invasion/etc tunable, and in the process flip attacker/defender kill ratio effect being flipped. This adds 4 new parameters that can be added to the params file: conquest_event_chance_mult_starting_duration controls the multiplier to chance when the total duration is 0% of the max duration; its default is 0.01. conquest_event_chance_mult_full_duration controls the multiplier to chance when the total duration equals the max duration; its default is 0.5. Note that this is total duration, not current duration; in the "4/7" you might see ingame for duration, the 7 is the total duration and the savegame will say what the max duration is (probably 10 or 12). conquest_event_add_chance controls the offset to (attacker tonnage / (defender tonnage + required tonnage)) used; its default is 0.66. conquest_event_kill_factor controls how much impact the ratio of attacker kills to defender kills in land combat has; its default is 1 (i.e. the normal 100% value). Set this to 0 to remove the random influence of battle progress on conquest chance.

 

Installation:

  1. Download MelonLoader and install it, either manually or via its installer. 
  2. Download the TweaksAndFixes.dll and place it in (your UAD directory)\Mods. Create that folder if it doesn't already exist.
  3. Run the game. Note the first launch will take a little while to read the game's assemblies, but subsequent launches will be very fast.

Source on GitHub

 

Changelog

  • 1.3.0 - When 1890 is selected in the Shared Designs constructor, only 'start' techs will be available, not techs that, while dated 1890, must be unlocked in campaign. This makes it so that the player can create shared designs the AI will use when starting an 1890 campaign.
  • 1.2.2 - Fixed a bug with shared designs where ships would not be properly erased during selection
  • 1.2.1 - Make shared design selection outside of campaign depend only on year, since tech matching is less reliable here (the game doesn't do it at all, for example).
  • 1.2.0 - Added tunable conquest (with bugfix)
  • 1.1.0 - Added submarine movement range fix
  • 1.0.0 - Initial release. Better shared design handling, per-shiptype component weights
Edited by NathanKell
  • Thanks 2
Link to comment
Share on other sites

  • NathanKell changed the title to [1.5.1.6] [Code] Tweaks and Fixes v1.1.0: Better Shared Design handling, fixed sub range checks, per-shiptype component weights, tunable conquest, more to come.

Hi can you check if something is wrong with AI? I noticed since 1.5.1.5 that some ships are totally braindead.

For example if you have DD as non flagship divisions they will sail straight forward past the enemy and wont ever do anything. This happens for Player AI and Enemy divisions when set to Battle Line/Sail mode.

Workaround is ofc to use Screen/Scout but once the flagship division is gone you get the same problem.

Link to comment
Share on other sites

  • NathanKell changed the title to [1.5.1.6] [Code] Tweaks and Fixes v1.2.1: Better Shared Design handling, fixed sub range checks, per-shiptype component weights, tunable conquest, more to come.

Not letting me upload. Just design some shared designs and start a campaign using shared designs always and auto-build fleet. Note what ship count each country has including player fleet. Quit game and reload campaign. Happens every time no matter what country

Link to comment
Share on other sites

10 hours ago, Astor said:

Hi can you check if something is wrong with AI? I noticed since 1.5.1.5 that some ships are totally braindead.

For example if you have DD as non flagship divisions they will sail straight forward past the enemy and wont ever do anything. This happens for Player AI and Enemy divisions when set to Battle Line/Sail mode.

Workaround is ofc to use Screen/Scout but once the flagship division is gone you get the same problem.

At some point I can look into the AI but that's going to be an awful lot of work.

Link to comment
Share on other sites

On 6/29/2024 at 8:11 AM, huntsc said:

This has made 1890 champion go from not using shared design to now using them. Just does load some that it can't build. Is that to use them when it gets the techs? Thanks for your work.

I believe this is a symptom of the other issue you described, since I have not been able to repro this either now.

Link to comment
Share on other sites

  • NathanKell changed the title to [1.5.1.6] [Code] Tweaks and Fixes v1.3.0: Better Shared Design handling, fixed sub range checks, per-shiptype component weights, tunable conquest, more to come.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...