HeroTurrets_Redux


Turrets are built using salvaged self-learning AI tech from your ship allowing them to get deadlier with practice. Extends turrets via ranking system based on kills. Turrets are generated and are not limited to vanilla turrets, identifiable by overlaid rank insignia. Rank buffs individual turrets.

Content
a month ago
2.0
2.07K
Combat

i [Implemented] Alter "Rank Modifier" to be a Multiplier

a month ago
(updated a month ago)

Hi Fortheking55, thanks for reviving this mod!

The Rank Modifier setting is a little confusing, I had to look in the mod files to see the formula to understand what the setting for Rank Modifier did. It is a little convoluted and could be made a little more logical.

Currently it adds a calculated amount to the default kills required per level. This calculation is unspecified in the description and on looking at the code it could be simplified.

Currently, the kills required for level 1 are calculated as:

Default Kills + ( ( ( Default Kills * ( Modifier / 100 ) ) / 10 ) * 100 )

Equivalent to:

Default Kills + (Default Kills * (Modifier / 10))

For example, if the Modifier is set to 10, this takes the default kills for Rank 1 of 50, adds 50 and makes it 100 kills. Set the Modifier to 50 and the kills for Rank 1 becomes 300. The

I propose changing to a straight multiplier. I made the necessary modifications in the code (along with some changes to variable names and the english locale file, the other locales will need to be updated). I have tested for a bit and it seems to work properly. (I have zero knowledge of git)

In prototypes/scripts/defines.lua, change lines 37 to 45 to:

local multiplier = settings.startup["heroturrets-setting-level-up-multiplier"].value
heroturrets.defines.turret_levelup_kills_one = heroturrets.defines.turret_initial_one_kills_value * multiplier
heroturrets.defines.turret_levelup_damage_one = heroturrets.defines.turret_initial_one_damage_value * multiplier
heroturrets.defines.turret_levelup_kills_two = heroturrets.defines.turret_initial_two_kills_value * multiplier
heroturrets.defines.turret_levelup_damage_two = heroturrets.defines.turret_initial_two_damage_value * multiplier
heroturrets.defines.turret_levelup_kills_three = heroturrets.defines.turret_initial_three_kills_value * multiplier
heroturrets.defines.turret_levelup_damage_three = heroturrets.defines.turret_initial_three_damage_value * multiplier
heroturrets.defines.turret_levelup_kills_four = heroturrets.defines.turret_initial_four_kills_value * multiplier
heroturrets.defines.turret_levelup_damage_four = heroturrets.defines.turret_initial_four_damage_value * multiplier

In settings.lua, change line 5 to 8 to:

name = "heroturrets-setting-level-up-multiplier",
setting_type = "startup",
default_value = 1,
minimum_value = 1,

In locale\en\locale.cfg change line 34 to:

heroturrets-setting-level-up-multiplier=Rank Requirement Multiplier

And line 51 to:

heroturrets-setting-level-up-multiplier=Multiplies the default required kills/damage per rank (Default = 1)

That should do it. Note that I have almost no experience modding Factorio.

a month ago
(updated a month ago)

Hello! Thank you for the code, I’ll give it a look over. I totally agree that a some of the code is a bit convoluted ( especially the startup settings… could be explained WAY better).

I was mostly in “let’s just get it running mode” but now I’m going through and refactoring the code to make it easier to maintain in the future! I’m also adding two additional ranks and changing the default kill level curve to balance it out.

If I had to guess ( without looking at the code ATM), the weirdness comes from the original mod having the option to include additional ranks, the option for damage based ranking, or maybe just bad code. 🤷‍♂️ Just spit balling as I don’t have it in front of me.

a month ago

You know what. Scratch what I said. It’s just basic math, the 100s cancel each other out. Good catch! I’ll update and update the tooltips accordingly so they make more sense.

Thanks!

a month ago

Sounds good, thanks for looking at it!

a month ago

Thanks for the update, could there be an option for a simple multiplier? Ex. Base Kills * Multiplier

a month ago
(updated a month ago)

Hey Hraukr!

I think what you are looking for ( until I refactor the code more ) is the individual turret rank modifiers ( the ammo, electric, fluid, and artillery ones ) .Change those all to the same number and that will basically do what you want to do (Take a look at the FAQ tab to see what I'm talking about)

a month ago

A lot of questions as I haven’t had anyone give feedback on the kill requirements :

Do you think the current kill requirements for ranks are too low? I have thought about this as I felt the old ones were a bit too low at the beginning ( 50 kills is stupid easy to get). Thoughts on the new rank requirements?

I was thinking of changing the settings to allow users to set the first rank kills needed (250 default)and then the last rank kills needed (20000 default) in settings and then perform a math operation to set the other ranks kill requirements. Would this be more clear than what is currently available?

a month ago
(updated a month ago)

The individual rank multipliers are what I’ve been using to make artillery require more kills, but they are limited to 20x at most (which I guess that limit could be increased, the largest number is what? 32bits? 4 billion?). My initial hope was to set Rank 1 to 1000 kills for the turrets and 2000 for artillery, and let it calculate from there. When I ran into the limit, that is when I tried playing the Rank Modifier with its odd math.

Personally, I found the rank requirements low, though I do play with many mods that expand the game (BZ, Transplutonic, Dredgeworks, etc.) to make greater pollution, leading to more natives to come visit.

Further thinking regarding kill requirements, how about something like (with ideas for more factorio-esque rank names):

[Tested]    100         [Tested]        10
[Veteran]   1000        [Proven]        100
[Hardened]  10,000      [Veteran]       1000
[Elite]     100,000     [Hardened]      10,000
                        [Elite]         100,000
                        [Legendary]     1,000,000

Each rank would be an order of magnitude more “experience”.
(The 1,000,000 kills for Legendary would also work with the current limits on the Settings text boxes, 100x Kills Multiplier, and a 20x Type Modifier, = 2 billion, wont overflow the integer)

My other thought is to change the bonuses to be +10% each rank - I like round numbers!

The start/end values sounds like a great idea, or possibly a start and per level multiplication value. That would be a good way for people to choose what what they want.

a month ago
(updated a month ago)

Hmm.. okay. Let me cook for a bit.

My main concern currently is I don’t know how many or if anyone is using the custom ranks setting. It just makes the xp and buff distribution so convoluted because of it. I do think it’s a cool setting that should stay though.

On that same line of thinking… I just had an idea for having the best of both worlds. I’ll just add a “custom kills for rank” and “custom damage for rank”. Then you can put whatever the heck you want. I’ll implement tonight. LMK when you pull down the latest build what you think

a month ago

That is a good idea, cook away!

Also, raise the maximum value for the multiplier on the individual turret types in settings to 100, that'd be much appreciated

a month ago
(updated a month ago)

Finished. All suggestions implemented.

In regards to the wanting it to be 10% across all values, I have not done that yet. If you want to do so, just enable the Custom ranks and only put in six values. It distributes the 60 buff across those evenly vs the default of having the 5th and 6th rank being a prestige rank. I will probably implement something similar to what I have done here and allow custom buff values, but that will take a bit more work than what I did already.

a month ago

I see how your idea worked now, just like the Rank names - That's perfect! It is great that you also put in the top-bottom way of doing it as well.

Thanks for the update!

a month ago
(updated a month ago)

No problem!

Edit : I just also added the buffs to the settings. Next implementation is going to be a gui screen in game to see the spread of buffs. Might be awhile. Or could be tomorrow.

New response