JoeSloeMoe Posted February 13 Share Posted February 13 (edited) 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. 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 Mod Functionality: (Configurable in buffs.xml) Receive a bonus skill point when you max out each Perk Skill (level 50) Each Point invested in the game's Perk Tree gives 20% more Learn-By-Use (lbu) skill progression xp on kills. e.g The default for the lbu_archery skill is each archery kill gives 24 lbu progression xp. With 2 points in the Archery Perk (perkArchery) the lbu_archery skill progression xp is 28.8 (40% increase) per kill. The more Experience you have using a tool or weapon, the more you know how to maintain it. Each level of a Learn-By-Use skill decreases associated tool/weapon degradation rate by 1% (total 50%). Doesnt apply to the Hidden Strike or Demolition perks. WHY ARE THERE ONLY 50 LEVELS? The mod is using 100 levels, it only calculates and displays every second level to avoid possible rounding errors. So there are only 50 levels displayed in the UI. For a detailed explanation, see the line "<!--NOTES on the level cap of 50--> in buffs.xml. (see also: Spinal Tap 1979 - My amp goes to 11. ) Config Options: There are several Global Config Variables used to control the Learn-By-Use functionality and progression curve. See buffs.xml, look for the line: "<!--PLAYER CONFIG VARIABLES..." for the options and further information. License: 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 (currently being reworked for 1.0). 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 initialisation. Version 1.0.8 18th April 2024 - Linux pathing comparability fix Version 1.0.9 4th May 2024 - Full review of DemolitionExpert levelling code. Fixed levelling discrepancies between Molotovs, Grenades, Timed Charges, Explosive Arrows and Bolts. - Slightly reduced Boomstick levelling progression. Version 1.1.0 7th July 2024 - Points invested in the default Perk give 20% more lbu_perk progression xp for each point. e.g Default for lbu_archery is each archery kill gives 24 progression xp. With 2 points in the Archery Perk (perkArchery) the progression xp is 28.8 (40% increase). - Config additions: >lbu_Kill_Bonus: when true, points in a default Perk will give extra progression xp per level. >lbu_Kill_Bonus_Percent: the amount of additional xp given per level invested in the Perk. >lbu_XP_Multiplier: A multiplier for ALL progression xp gained. Increase or decrease if overall progression for Learn By Use skills is too slow/fast Version 1.1.1 3rd Aug 2024 - Fixed bug that affected Perk Tree bonuses for Harvest/Damage amounts. - Each level of a LBU perk decreases associated tool/weapon degradation rate by 1% (total 50%). Doesn't apply to the Hidden Strike or Demolition perks. - Changed the layout of the Perk List Window. Moved the Search Field above the Perk Tabs. The tabs row now holds up to 6 additional tabs for compatibility with other mods that add tabs. Edited August 5 by JoeSloeMoe (see edit history) 3 Link to comment Share on other sites More sharing options...
FranticDan Posted February 22 Share Posted February 22 (edited) 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 February 22 by FranticDan (see edit history) Link to comment Share on other sites More sharing options...
Hells_Janitor Posted February 22 Share Posted February 22 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 More sharing options...
JoeSloeMoe Posted February 23 Author Share Posted February 23 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 1 Link to comment Share on other sites More sharing options...
JoeSloeMoe Posted February 23 Author Share Posted February 23 (edited) 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 February 23 by JoeSloeMoe (see edit history) Link to comment Share on other sites More sharing options...
FranticDan Posted February 23 Share Posted February 23 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 More sharing options...
Hells_Janitor Posted February 23 Share Posted February 23 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 More sharing options...
Hells_Janitor Posted February 23 Share Posted February 23 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 More sharing options...
JoeSloeMoe Posted February 23 Author Share Posted February 23 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 More sharing options...
Hells_Janitor Posted February 23 Share Posted February 23 33 minutes ago, JoeSloeMoe said: OMG - thanks again - fixed. This is like one of those dreams where you cant run.... No problem - happy to help Link to comment Share on other sites More sharing options...
FranticDan Posted February 24 Share Posted February 24 Noticed that there's no skill for Demolition expert, is this intentional? Or maybe complicated to get working? Link to comment Share on other sites More sharing options...
JoeSloeMoe Posted February 25 Author Share Posted February 25 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 More sharing options...
Adagio Posted March 7 Share Posted March 7 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 More sharing options...
JoeSloeMoe Posted March 9 Author Share Posted March 9 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 More sharing options...
JoeSloeMoe Posted March 10 Author Share Posted March 10 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 More sharing options...
Hells_Janitor Posted March 11 Share Posted March 11 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 More sharing options...
FranticDan Posted March 11 Share Posted March 11 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. Link to comment Share on other sites More sharing options...
JoeSloeMoe Posted March 11 Author Share Posted March 11 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 More sharing options...
JoeSloeMoe Posted March 12 Author Share Posted March 12 (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 March 12 by JoeSloeMoe (see edit history) 1 Link to comment Share on other sites More sharing options...
FranticDan Posted March 12 Share Posted March 12 (edited) 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 March 12 by FranticDan (see edit history) Link to comment Share on other sites More sharing options...
JoeSloeMoe Posted March 13 Author Share Posted March 13 (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 March 13 by JoeSloeMoe (see edit history) Link to comment Share on other sites More sharing options...
Hells_Janitor Posted March 13 Share Posted March 13 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 More sharing options...
JoeSloeMoe Posted March 13 Author Share Posted March 13 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 1 Link to comment Share on other sites More sharing options...
JoeSloeMoe Posted March 18 Author Share Posted March 18 New version 1.0.5 released. 1 Link to comment Share on other sites More sharing options...
JoeSloeMoe Posted April 7 Author Share Posted April 7 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now