Jump to content

Hybrid Learn By Use (Action Skills) - A21 XML modlet


JoeSloeMoe

Recommended Posts

 

Hybrid Learn By Use Action Skills. Increase half of all Perk Damage, Stamina, Harvesting etc. values by using tools and weapons. Upgrade the other half of stat increases using the Perk Tree as normal. Allows flexibility in how you progress with tools and weapons - progress with a tool or weapon doesn't need to interfere with a magazine strategy.

Receive a bonus skill point when you max out each Perk Skill (level 50) - can turn this off in the config settings.

 

Special thanks to FranticDan and Hells_Janitor for feedback, debugging and suggestions.

 

Download:  Repository Link: Hybrid Learn By Use (Action Skills)

Recommend starting a new game.

 

Currently applies to the tools and weapons for the following Perks:
Perception: DeadEye, Demolition Expert, SpearMaster, Salvage
Strength: Boomstick, PummelPete, SkullCrusher, Miner69r/Motherload.
Fortitude: Brawler, MachineGunner
Agility: Archery, Gunslinger, DeepCuts, Hidden Strike
Intellect: Electrocutioner, Robotics

 

Config variables:

There are several Global Config variables to control the Learn-By-Use leveling curve for all Perks. Can also turn off the extra Skill Point awarded for maximising each Perk. See buffs.xml, look for the line: "<!--change the values below to change the levelling curve...." for information.

 

The code is free to use license. It is based on the Action Skill levelling algorithm from Khaine in the Darkness Falls mod (//community.7daystodie.com/topic/4941-darkness-falls-they-mostly-come-out-at-night/). Please acknowledge Khaine's coal-face work if you reuse the code.

 

This modlet comes from the Survival No Trader mod.

 

 

Hybrid_lbu1.png

 

 

 

Version 1.0.2 19th Feb 2024 (single bug fix)
- Fixed Learn By Use damage progression bug for Gunslinger.

Version 1.0.3 22th Feb 2024 (single bug fix)

- Fixed: gameevents.xml file was missing from the release package.

 

 

Version 1.0.4 10th March 2024.
- Fixed syntax error in Localisation file.

 

- Added Global Config variables so anyone can easily control the Learn-By-Use leveling curve for all Perks.
  See buffs.xml, look for the line: "<!--change the values below to change the levelling curve...." for information.

 

- Added Demolitions Expert to the Learn By Use tree. Molotovs & Timed Charges are slow at increasing level.
  The best way to increase the Demolitions LBU perk is using grenades/rockets on large groups of zombies.

  Nade should hit a zombie, not land next to it for max level xp.

 

- Fixed Learn By Use progress error after using Grandpa's Fergit'n Elixir.
  After using the Elixir, use any tool or weapon and a buff will restore all Learn By Use Perks' progress over a short period.
  Progress Level will also be restored when there are any other Perk Level changes e.g. infection side effects.
  If you install this version over an existing install/game, you will see a message indicating the progress level is being verified,
  this is just your local variables being updated to the latest version.

 

Version 1.0.5 17th March 2024
   - Optimised the Learn By Use Perks initialisation code. Initialisation now only depends on a single variable
      rather than the synchronisation of 3 different variables.
   - Added Hidden Strike to the Learn By Use Perk Tree.    
   - Fixed issue where the Miner69r/Motherload Perk allowed the harvesting rate to be applied to plants/farming
     (e.g. shovels could get extra food when used on farm plot plants)
   - Slightly reduced Learn By Use Boomstick xp gain per target hit (shotty can hit multiple targets with a single shell).

 

Version 1.0.6 7th April 2024  (Balancing update)

   - Added config setting to turn off giving a free skill point when each Perk's Progress is maxed. (On by default)
   - Changes to perk level progression speeds:
            Increased Hidden Strike progression speed.
            Increased Dead Eye progression speed.
            Slightly increased Archery progression speed.
            Slightly decreased Miner69r progression speed.
            Decreased for Boomstick as each pellet adds experience. 

 

Version 1.0.7 13th April 2024  (Bug fix update)

 - Potential fix for Multiplayer code intialisation.

Version 1.0.8 18th April 2024
   - Linux pathing comparability fix

 

Edited by JoeSloeMoe (see edit history)
Link to comment
Share on other sites

Any chance of getting the Athletics LBD skill back to mix with the modern Cardio perk?
Same with Medical skill and Physician perk. And Pain Resist skill with Pain Tolerance perk.

EDIT again: Here's of a list of other action skills I've thought of that would add feeling of progression:
 

  • Athletics
  • Medical
  • Pain resist
  • Heat resist
  • Cold resist
  • Butchering
  • Bartering
  • Looting
Edited by FranticDan (see edit history)
Link to comment
Share on other sites

I've noticed a potential bug waiting to happen ...

 

<!--if max level then give free Skill Point-->
<triggered_effect trigger="onSelfDamagedOther" action="CallGameEvent" event="lbu_action_give_points">
  <requirement name="ProgressionLevel" progression_name="lbu_Boomstick" operation="EQ" value="50"/>
</triggered_effect>

 

There's no gameevents.xml included with the mod, so there's no game event to call - so the bonus points will either:

a) not be applied, or

b) throw an error when anyone reaches level 50 in action skills.

 

I haven't gotten to that point yet, but I just thought I'd give you a heads up :) 

Link to comment
Share on other sites

2 hours ago, Hells_Janitor said:

I've noticed a potential bug waiting to happen ...

 

<!--if max level then give free Skill Point-->
<triggered_effect trigger="onSelfDamagedOther" action="CallGameEvent" event="lbu_action_give_points">
  <requirement name="ProgressionLevel" progression_name="lbu_Boomstick" operation="EQ" value="50"/>
</triggered_effect>

 

There's no gameevents.xml included with the mod, so there's no game event to call - so the bonus points will either:

a) not be applied, or

b) throw an error when anyone reaches level 50 in action skills.

 

I haven't gotten to that point yet, but I just thought I'd give you a heads up :) 

 

Thanks for that, I missed it when I separated the code from the Survival No Trader mod.

I have now added the appropriate gameevents file to the repository.

File is here: https://github.com/JoeSloeMoe/LBU/blob/main/HybridLearnByUse/config/gameevents.xml

Thanks again.

cheers

 

Link to comment
Share on other sites

11 hours ago, FranticDan said:

Any chance of getting the Athletics LBD skill back to mix with the modern Cardio perk?
Same with Medical skill and Physician perk. And Pain Resist skill with Pain Tolerance perk.

EDIT again: Here's of a list of other action skills I've thought of that would add feeling of progression:
 

  • Athletics
  • Medical
  • Pain resist
  • Heat resist
  • Cold resist
  • Butchering
  • Bartering
  • Looting

 

There are certainly things there that could be added relatively easily. Its the testing that takes time. :)

With weapons and tools it was relatively easy to determine average use stats to approximate the levelling curve (which is basically a compound interest curve). For some things like medical or butcher, I've not given much thought to how many times I use those skills by the time I'm a higher level (eg 60). I'll play around with some of them and get a feel for usage, see what I can do.

cheers

Edited by JoeSloeMoe (see edit history)
Link to comment
Share on other sites

2 hours ago, JoeSloeMoe said:

 

There are certainly things there that could be added relatively easily. Its the testing that takes time. :)

With weapons and tools it was relatively easy to determine average use stats to approximate the levelling curve (which is basically a compound interest curve). For some things like medical or butcher, I've not given much thought to how many times I use those skills by the time I'm a higher level (eg 60). I'll play around with some of them and get a feel for usage, see what I can do.

cheers

Balancing can be tricky, butchering and pain resist come to mind for balance. With butchering, you can harvest animals faster and with less hits if using power attacks. And for pain resist, getting hit from zombies and animals on Insane difficulty deals a lot more damage than on Nomad, so I think the best way to balance pain resist would be to have damage received = xp.
Same for butchering perhaps, damage done using a butchering tool to animal carcass = xp.

Athletics, Heat/cold resist are passive over time. Athletics shouldn't gain xp if on a vehicle except the bicycle of course.

Link to comment
Share on other sites

8 hours ago, JoeSloeMoe said:

 

Thanks for that, I missed it when I separated the code from the Survival No Trader mod.

I have now added the appropriate gameevents file to the repository.

File is here: https://github.com/JoeSloeMoe/LBU/blob/main/HybridLearnByUse/config/gameevents.xml

Thanks again.

cheers

 

 

Awesome :)

 

I love this version of action skills btw - exactly what I was looking for 😎

Link to comment
Share on other sites

10 hours ago, JoeSloeMoe said:

 

Thanks for that, I missed it when I separated the code from the Survival No Trader mod.

I have now added the appropriate gameevents file to the repository.

File is here: https://github.com/JoeSloeMoe/LBU/blob/main/HybridLearnByUse/config/gameevents.xml

Thanks again.

cheers

 

 

Sorry, found one more bug. You missed the closing</append> on the gameevent. I fixed it for myself, but you might want to update your repo.

 

Oh, and the perk is called "Deep Cuts", not "Deap Cuts". Another thing I fixed for myself. Not a major thing, but it was bugging me :) 

Link to comment
Share on other sites

1 hour ago, Hells_Janitor said:

 

Sorry, found one more bug. You missed the closing</append> on the gameevent. I fixed it for myself, but you might want to update your repo.

 

Oh, and the perk is called "Deep Cuts", not "Deap Cuts". Another thing I fixed for myself. Not a major thing, but it was bugging me :) 

OMG - thanks again - fixed. This is like one of those dreams where you cant run....

Link to comment
Share on other sites

On 2/24/2024 at 8:42 AM, FranticDan said:

Noticed that there's no skill for Demolition expert, is this intentional? Or maybe complicated to get working?

Was planning to add it in a second release. The only challenge is the number of uses of demolition charges over the course of a game. I didnt want that to hold up the release -as you've mentioned, there a few others that could be added as well. It will be added in the future.

Cheers

Link to comment
Share on other sites

  • 2 weeks later...

Greetings Joe,

I really like the idea, and so I've tested the mod just today and it has been working flawlessly so far!

Unfortunately I found that when I use Grandpa's Elixir, it also reset the progress of LBU, so it feels like half of my progression has been lost as well. I'm not sure if that is intended, but is there any way to prevent LBU progression from being reset?

Link to comment
Share on other sites

Hi Adagio,

 

Thats very good to know, thanks! I cant stop the system from removing the progress in xml as they are also Perks, but I figure I can restore the levels by keeping track of the level total (T) and restoring if the ProgressionLevel is less than T. Something like

 

if( level increase) T=ProgressionLevel; 

ProgressionLevel = ProgressionLevel<T  ? T : ProgressionLevel;

....

 

Will update in the next version (have added Demolition Expert into the mix and am testing).

cheers

Link to comment
Share on other sites

On 3/7/2024 at 8:52 AM, Adagio said:

Greetings Joe,

I really like the idea, and so I've tested the mod just today and it has been working flawlessly so far!

Unfortunately I found that when I use Grandpa's Elixir, it also reset the progress of LBU, so it feels like half of my progression has been lost as well. I'm not sure if that is intended, but is there any way to prevent LBU progression from being reset?

Hi again Adagio,

The issue is now fixed along with a couple other changes in the latest version. It will fix any current game but unfortunately it doesn't effect the game if you already drank the Forgetin Elixer.

Cheers

 

Link to comment
Share on other sites

41 minutes ago, JoeSloeMoe said:

Hi again Adagio,

The issue is now fixed along with a couple other changes in the latest version. It will fix any current game but unfortunately it doesn't effect the game if you already drank the Forgetin Elixer.

Cheers

 

 

You fixed this with just xml? I'd love to know how you did it ...

Link to comment
Share on other sites

10 hours ago, FranticDan said:

When increasing max level to 100, miner69r action skill occasionally bugs out and each hit with a miner69r tool levels up the action skill. I've only noticed this bug with miner69r.

Hi FranticDan

What vars did you change to increase the number of levels? The number of levels is kinda hard-coded. For example:

<passive_effect name="EntityDamage" operation="perc_add" value="0.01,0.25" level="1,50" />

For the above, the number 50 at the end for the level has to be a value, it cant be a variable:

<passive_effect name="EntityDamage" operation="perc_add" value="0.01,0.25" level="1,@SOMEVARIABLE" /> <!--doesnt work-->

 

So the level is written out wherever it is used. If you have changed the max level to 100 you would need to make sure that you have changed it everywhere. If the issue only happens with Miner69er, perhaps there is an error in the code for that? The error you've described indicates that the amount of xp required per level is set to 0 or never intialized with the starting xp per level [marked as a) in the list below] , so everytime the person gets xp they level up. This can happen if you didnt start a new game after making changes to the max level.

 

In general the following can be easily changed:

- a) starting amount of xp required per level

- b) percent increase of the xp (point a above) required per level

- c) level cap to stop increasing xp per level (e.g. stop increasing amount of xp required at level 46 so that levels 46-50 have the same amounts needed)

 

Max level is 50 - to change max level you will need to edit every reference to '50' in progression.xml.

Does any of the above help?

Cheers

 

 

Link to comment
Share on other sites

Posted (edited)
On 3/10/2024 at 5:28 PM, Hells_Janitor said:

 

You fixed this with just xml? I'd love to know how you did it ...

Hey Hells_J,

The algorithm is basically the following:

For a given LBU Perk (e.g. lbu_SkullCrusher)

- have a local level variable keep track of the progress level (e.g. lbu_SkullCrusher_Lvl)

- everytime the ProgressLevel is increased for lbu_SkullCrusher the code also increases the corresponding lbu_SkullCrusher_Lvl.

- at the start of the lbu_SkullCrusher Perk code, check that ProgressLevel(lbu_SkullCrusher) is exactly equal to lbu_SkullCrusher_Lvl

- if they are not equal call a buff to review all Perk level variables compared to the Perks'  ProgressLevel

 

We cant assign a variable's value to the ProgressLevel variable and we cant assign the ProgressLevel value directly to a variable either (or at least I couldn't figure out how)

So instead, the buff will iterate over all ProgressLevels and level variables:

    For each Perk: Iterate until (ProgressLevel == level variable) for all Perks

      - if ProgressLevel < level variable  ? then add one to ProgressLevel (something has reset the Perk Level eg Forgettin Elixer)

      - if ProgressLevel > level variable  ? then add one to  level variable (this allows for installing on existing games - this might only be needed for the initial release)

 

So now if you drink a Forgetin Elixer the buff will be engaged as soon as you use any tool/weapon covered by the LBU Perks. The buff will put the Progress Lvl back to where is was for all Perks. Its not instant though, its done over some time in the background as the code increases the progress levels by one once per buff iteration.

 

cheers

Edited by JoeSloeMoe (see edit history)
Link to comment
Share on other sites

On 3/11/2024 at 11:15 PM, JoeSloeMoe said:

Hi FranticDan

What vars did you change to increase the number of levels? The number of levels is kinda hard-coded. For example:

<passive_effect name="EntityDamage" operation="perc_add" value="0.01,0.25" level="1,50" />

For the above, the number 50 at the end for the level has to be a value, it cant be a variable:

<passive_effect name="EntityDamage" operation="perc_add" value="0.01,0.25" level="1,@SOMEVARIABLE" /> <!--doesnt work-->

 

So the level is written out wherever it is used. If you have changed the max level to 100 you would need to make sure that you have changed it everywhere. If the issue only happens with Miner69er, perhaps there is an error in the code for that? The error you've described indicates that the amount of xp required per level is set to 0 or never intialized with the starting xp per level [marked as a) in the list below] , so everytime the person gets xp they level up. This can happen if you didnt start a new game after making changes to the max level.

 

In general the following can be easily changed:

- a) starting amount of xp required per level

- b) percent increase of the xp (point a above) required per level

- c) level cap to stop increasing xp per level (e.g. stop increasing amount of xp required at level 46 so that levels 46-50 have the same amounts needed)

 

Max level is 50 - to change max level you will need to edit every reference to '50' in progression.xml.

Does any of the above help?

Cheers

 

 

Discovered the reason why it bugs. If you destroy a block on the VERY first hit of the action skill, it will bug. (It wants to add XP from both and it doesn't like it)
I removed the bonus XP on destroy and no more bug :)

Edited by FranticDan (see edit history)
Link to comment
Share on other sites

Posted (edited)
8 hours ago, FranticDan said:

Discovered the reason why it bugs. If you destroy a block on the VERY first hit of the action skill, it will bug. (It wants to add XP from both and it doesn't like it)
I removed the bonus XP on destroy and no more bug :)

Hi Frantic Dan,

Thanks, thats much appreciated. Have added a line to deal with that use case now.

 

Was going to mention that the thought behind a max level of 50 was that for some Perks the range increments

of  'effect over the number of levels' dont scale well up to 100.

 

<passive_effect name="EntityDamage" operation="perc_add" value="0.01,0.25" level="1,50" />

e.g. the value="0.01,0.25" above, increases by 0.005 every level - it would be 0.0025 for 100 levels.

The value 0.005 was the threshold for the level cap at 50 as I'm not sure about rounding or truncating errors at 4 decimal places. I think the code only uses 3 decimal places but am not sure.

It can be thought of as being Instead of 50 levels, its actually 100 levels but we are only counting every 2nd level. It then uses the config settings to determine how long it takes to get max level.

cheers

 

 

Edited by JoeSloeMoe (see edit history)
Link to comment
Share on other sites

Found another potential issue with the mod ...

 

Trap kills (blades, darts, etc.) increase the action skill for whatever weapon you happen to be holding at the time.

 

The fix is to change the requirement `HoldingItemHasTags` to `ItemHasTags`. Just thought I'd give you the heads-up :)

 

Link to comment
Share on other sites

2 hours ago, Hells_Janitor said:

Found another potential issue with the mod ...

 

Trap kills (blades, darts, etc.) increase the action skill for whatever weapon you happen to be holding at the time.

 

The fix is to change the requirement `HoldingItemHasTags` to `ItemHasTags`. Just thought I'd give you the heads-up :)

 

Thank you for noticing this - I've now fixed it and after a bit of regression testing uploaded the change :)

There are so many little details - hopefully it wont all change again in A22.

cheers

Link to comment
Share on other sites

New version 1.0.6 released. 

A balancing update with an additional config option.

 

 

 

 

On 2/22/2024 at 7:04 AM, FranticDan said:

Any chance of getting the Athletics LBD skill back to mix with the modern Cardio perk?
Same with Medical skill and Physician perk. And Pain Resist skill with Pain Tolerance perk.

EDIT again: Here's of a list of other action skills I've thought of that would add feeling of progression:
 

  • Athletics
  • Medical
  • Pain resist
  • Heat resist
  • Cold resist
  • Butchering
  • Bartering
  • Looting

 

Following up on this Frantic Dan. After working through the code for a while, the remaining Perks that are not covered by Learn By Use (LBU) generally fall  into one of the following 3 categories. (in general we are working with code that was abandoned some way through in favour of the current Perk model)

- The Perk action doesnt have a trigger to indicate when the action is taking place. The code cant increase any level xp without a situational trigger.

- The Perk action has a trigger but it never fires - e.g. buying and selling.

- The Perk action has a trigger and it fires but its value is small enough that it would affect the balance if it was used in Learn By Use.

   e.g. Cardio: The Perk tree increases cardio to a max of 30%. Splitting this between the LBU and the Cardio Perk would mean investing 3 Perk Points only gets a total of 15% increase in the Cardio Perk. So there wouldn't be much incentive to invest any points in the Cardio Perk tree, which may change the balance a bit too much.

 

Am open to comments on balance and any feedback on how to add more of the Perks to Learn By Use. Outside of one or two I'm still playing with, I dont know if I should add any more at this time.

Cheers

 

Link to comment
Share on other sites

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...