Fair Strides

RESOURCE:NPC Auto-Leveller

Recommended Posts

NPC Auto-Leveller


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
» NPC Auto-Leveller 1.0 Read-Me
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NAME: NPC Auto-Leveller
TYPE: Modder's Resource
VERSION: 1.0
DATE 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. :D

 

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.


 

  • Like 2

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Oh, now I've saw that it is an modder's resource, really sorry for any inconvenience

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Hope this log may help you in any way.

 

Have a good day sir and thanks for your work in both KOTOR and TSL

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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. 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Thanks Fair Strides, sorry for the incovenience and Happy 4th of July to all north-americans from Brazil  :thumbup:

  • Like 1

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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?!?)  :P

Share this post


Link to post
Share on other sites

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?!?)  :P

What's so bad about the autobalance.2da

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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? :P 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?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.