Fair Strides 510 Posted July 2, 2017 View File NPC Auto-Leveller ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~» NPC Auto-Leveller 1.0 Read-Me~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~NAME: NPC Auto-LevellerTYPE: Modder's ResourceVERSION: 1.0DATE RELEASED: July 2, 2017 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~» DESCRIPTION~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~A while back, Darth Tyren was asking me about how the KotOR 2 balances the enemies to make them tougher as you go on through the game. We then spent a few hours running some tests and digging through the files, with the end result being that the game seems to just upgrade the enemies' Hit Points and Force Points. I then theorized that one could use the extra functions Obsidian added for modifying your skills, attributes, feats, and force powers to work up a framework for levelling up the NPCs without actually assigning them levels. This is the result of that work. The heart of this modder's resource is the "fs_level.nss" #include file, where I've one main function called LevelUp and several support functions that will randomly assign feats, force powers, skill points (including support for cross-class skills), and attribute points at the appropriate times and in the appropriate amounts. I've scoured the various .2da files and the all of the default values and rules that the player has to obey are obeyed by the script as well. Also, there are 750 .uti files included. There are 50 for each class, and each item handles the defense, saving throw, and attack modifier increases that a given class would get as they level. These items are not accessible or equippable in-game, as they use the hidden creature slots (specifically, slots 14 and 15). I've shown how to use the #include file in the included "k_ai_master.nss" in the source folder. The compiled form is included in the installation. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~» INSTALLATION~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~An installation which involves the TSL Patcher has been made ready for your use and is the simplest and easiest way to carry out installation. You don't have to use the installer if you're just using parts of this or adapting it, but it's an easy way to get it all set up and ready to go. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~» KNOWN BUGS~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Not exactly a bug, but the two slots I used may very well be used by animals like the Kinrath that have special properties to their attacks. There are 2 ways to report bugs:1: Post your issues in the Bug Reporting Thread.2: PM your issues to Fair Strides at Deadlystream. TO REPORT THROUGH PM 1) Go to DeadlyStream ( http://deadlystream.com/ ) and search for the user Fair Strides ( http://deadlystream.com/forum/user/9107-fair-strides/ )2) Send a private message with as much detail as possible of what is occurring in your game. He will likely report back to you within a week. TO REPORT THROUGH THE BUG THREAD:1) Go to the Bug Thread ( http://deadlystream.com/forum/topic/5509-downloadnpc-auto-leveller/ )2) Reply with as much detail as you can provide, and please list (and preferably link to) all the mods you're using. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~» CONTRIBUTORS / CREDITS~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Darth Insidious, Malkior, Markus Ramikin, Darth Tyren, and probably many others who were willing to discuss the topic with me over Skype. Darth Tyren for the initial investigative work and the idea itself. 90SK for some installer help on my Fumble! mod, whose changes.ini file I edited in Notepad for this mod. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~» REDISTRIBUTION~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~This mod may be re-distributed, but may not be re-uploaded. I request that proper credit be given to me for making the mod, even if you use parts of the mod instead of the whole thing. I would also like to be contacted before you release your mod. Submitter Fair Strides Submitted 07/02/2017 Category Modder's Resources 2 Quote Share this post Link to post Share on other sites
jc2 581 Posted July 2, 2017 Well done FS! I'm glad to see this finished. Quote Share this post Link to post Share on other sites
diegodb 28 Posted July 3, 2017 I'm having problem with this mod Fair Strides. My TSL version is from GOG. It didn't installed properly. It appears this log: • Copying file k_ai_master.ncs to the Override folder... • Warning: A file named fs_level.nss already exists in the Override folder. Skipping file... • Copying file autobalance.2da to Override folder... • Updated 2DA file C:\GOG Games\Star Wars - KotOR2\override\autobalance.2da. • Done. Changes have been applied, but 751 warnings were encountered. I tried to put the files from the Source folder before the installation but it didn't work. Please look into this problem. Thank you very much Quote Share this post Link to post Share on other sites
diegodb 28 Posted July 3, 2017 Oh, now I've saw that it is an modder's resource, really sorry for any inconvenience Quote Share this post Link to post Share on other sites
Fair Strides 510 Posted July 4, 2017 I'm having problem with this mod Fair Strides. My TSL version is from GOG. It didn't installed properly. Please attach your installlog.rtf file. It's possible I screwed up the installer, but it should have moved all of the .uti files to a folder in the Override folder and the fs_level.nss would have been moved by the installer itself. Quote Share this post Link to post Share on other sites
diegodb 28 Posted July 4, 2017 Ok Fair Strides, I'll do that installlog.rtf Quote Share this post Link to post Share on other sites
diegodb 28 Posted July 4, 2017 Hope this log may help you in any way. Have a good day sir and thanks for your work in both KOTOR and TSL Quote Share this post Link to post Share on other sites
N-DReW25 1,341 Posted July 4, 2017 Hope this log may help you in any way. Have a good day sir and thanks for your work in both KOTOR and TSL Can you please re-edit your post so it includes an attachment of the "installlog.rtf" file so Fair Strides can just download it to his hard drive and read it. The reason I say this is because that one post is massive and doing what I say can make it cleaner. Quote Share this post Link to post Share on other sites
diegodb 28 Posted July 4, 2017 Sorry about that, I have edited my post Quote Share this post Link to post Share on other sites
DarthParametric 3,795 Posted July 4, 2017 I did a test install of it. The only warning I got was Warning: Unable to copy file "fs_lvl_sas_01.uti", file does not exist!Which does appear to be the case. It isn't present in the archive. I also note that your four 2DA row edits all appear to be the same. The "vanilla" 2DA included in tslpatchdata is actually your modified one, so it's impossible to tell (as I doubt anyone has a pre-existing copy in their override). If you put a copy of the vanilla 2DA in the Override first, it only edits the first row. You need to amend the RowIndex values in config.ini. I would guess diegodb's extensive errors were probably a result of manually moving the UTIs from the tslpatchdata folder. Quote Share this post Link to post Share on other sites
diegodb 28 Posted July 4, 2017 Yes Darth Parametric. In hope of getting the problem solved I did try to put it in the Override folder, but as I am a nothing in modding lol, I solved nothing. Now I will make a fresh install of TSL and try the mod again. Thank you guys Quote Share this post Link to post Share on other sites
DarthParametric 3,795 Posted July 4, 2017 You never want to touch the data files of an installer. Just run the EXE and let it do the work. The readme will tell you if you need to do anything else. Quote Share this post Link to post Share on other sites
diegodb 28 Posted July 4, 2017 Yeh, it's true Darth Parametric. Lesson learned. Well, now it have installed with no issues. The strange thing is that when I encounter an enemy he only attacks me one time and then I can stand in front of him and nothing happen. Maybe it's because it's a modder's resource and not an mod per se, I don't know Quote Share this post Link to post Share on other sites
DarthParametric 3,795 Posted July 4, 2017 I would recommend you test this ideally with a new game, but at the very least starting from a save before you enter a given area for the first time. Quote Share this post Link to post Share on other sites
diegodb 28 Posted July 4, 2017 Darth Parametric, I reinstalled TSL with the TSLRCM 1.8.5, M4-78 EP 1.2 and this mod. These are the only ones that I have. Quote Share this post Link to post Share on other sites
diegodb 28 Posted July 4, 2017 Oh, I found one error in the installer, here it is: • Warning: Unable to copy file "fs_lvl_sas_01.uti", file does not exist! Hope this may help Quote Share this post Link to post Share on other sites
Fair Strides 510 Posted July 4, 2017 Sorry for the issues guys. It's my fault for trying to rush the installer. I'll have them corrected by the end of the day and a new version uploaded. Quote Share this post Link to post Share on other sites
diegodb 28 Posted July 4, 2017 Thanks Fair Strides, sorry for the incovenience and Happy 4th of July to all north-americans from Brazil 1 Quote Share this post Link to post Share on other sites
Fair Strides 510 Posted July 14, 2017 Okay, the reason why the mod (and my Fumble! one) is still not updated is because I'd really like to be able to get ahold of stoffe or anyone that knows her permissions. My understanding is that I have permission to edit her tools willy-nilly and that her mods can be uploaded at least to DS (I forget if she said anywhere KotOR-related or if that was some other modder), so I don't know if I could release an updated version that's compatible with her Improved AI, since I need to use pieces of her mod to do so. Quote Share this post Link to post Share on other sites
DarthTyren 103 Posted July 15, 2017 I know I've stated before that the randomness in how enemies 'level' as a result of this script could potentially break the difficulty of the game, due to the fact that they only truly rely on certain stats. So if all those stats/modifiers are randomly zero, which is possible, then a fight that's supposed to be challenging could end up being way too easy for some, and an absolute nightmare for others. And it takes away some of the power of mod designers, something I'm not a huge fan of. But it's way better than trying to decipher the autobalance.2da (honestly, Obsidian, what were you thinking making this gibberish?!?) Quote Share this post Link to post Share on other sites
N-DReW25 1,341 Posted July 15, 2017 What does this mod do to be exact? But it's way better than trying to decipher the autobalance.2da (honestly, Obsidian, what were you thinking making this gibberish?!?) What's so bad about the autobalance.2da Quote Share this post Link to post Share on other sites
DarthTyren 103 Posted July 15, 2017 What's so bad about the autobalance.2da As I said, deciphering it is a pain, and Fair Strides and I sat down and went through a few hours of trial and error, and after all of it the only explanation I could come up with is that it doesn't follow the rules of the game. None of the values it puts out make any sense. It's the problem that started the idea for this mod. Quote Share this post Link to post Share on other sites
bead-v 251 Posted July 15, 2017 I'm pretty sure all the data in autobalance.2da made sense to me a few years ago when I was playing with the combat mechanics. If I find some notes from that I'll share them with you. Quote Share this post Link to post Share on other sites
bead-v 251 Posted July 15, 2017 Here we go:enemy_level = rounddown(player_level * levelmult)enemy_hp_base = rounddown(player_level * vpmult) - 1 enemy_attack_mod = rounddown(player_level * tohitmult) enemy_ac = rounddown(player_level * armormult) + 2 enemy_save_mod = rounddown(player_level * savemult) enemy_damage = rounddown(player_level * damagemult + 1) I don't seem to have figured out what crmod does though. As far as I can remember, those calculation gave the right results, but you should obviously check those for yourself. Quote Share this post Link to post Share on other sites
Fair Strides 510 Posted July 15, 2017 I know I've stated before that the randomness in how enemies 'level' as a result of this script could potentially break the difficulty of the game, due to the fact that they only truly rely on certain stats. So if all those stats/modifiers are randomly zero, which is possible, then a fight that's supposed to be challenging could end up being way too easy for some, and an absolute nightmare for others. And it takes away some of the power of mod designers, something I'm not a huge fan of. You do me a slight disservice here, DT. Surely I would have planned better than that? The function that resets a creature's stats is coded up and ready (minus the fact that I just realized it doesn't actually take feats, force powers, or skill points away, nor does is grant them like it should), but it is never actually executed. The k_ai_master.nss and fs_level.nss never actually call the function. The function can be called, but it isn't currently. That means that any stats will remain as they are and only get increased from there. Also, it's not like I go "Okay, the Strength score is Random(19) + ( / 4) points." I only ever add onto stats, not take away. It'd be literally impossible to randomly set a stat to 0. Here we go: enemy_level = rounddown(player_level * levelmult) enemy_hp_base = rounddown(player_level * vpmult) - 1 enemy_attack_mod = rounddown(player_level * tohitmult) enemy_ac = rounddown(player_level * armormult) + 2 enemy_save_mod = rounddown(player_level * savemult) enemy_damage = rounddown(player_level * damagemult + 1) I don't seem to have figured out what crmod does though. As far as I can remember, those calculation gave the right results, but you should obviously check those for yourself. While that does indeed seem credible, I have two questions: 1. How long and hard was that to actually figure out? 2. Do you know how the game decides which row a creature should use? Quote Share this post Link to post Share on other sites