A Weapon Re-balance Mod (Patch 4 OK!)

For community content (fan-art, fanfic, etcetera) for Wasteland 2.

Moderator: Ranger Team Alpha

Halfgeek
Acolyte
Posts: 74
Joined: October 11th, 2014, 5:00 pm

Re: A Weapon Re-balance Mod (Patch 3 OK!)

Post by Halfgeek » November 9th, 2014, 11:04 pm

Mana85 wrote:Any plans on making this work for enemies also?
No. It would seriously screw up encounter balance. ie. lots of enemies with SMG, Pistols or MGs would be extremely dangerous. Devs threw lots of these "weaker" enemies to swarm you with fodder, but if their weapons became decent, it would be unbalanced.

For those who want a challenge, SJ is still fun, especially with a variety of weapons and not many AR Rangers.

Udzi
Initiate
Posts: 19
Joined: February 19th, 2013, 9:23 am

Re: A Weapon Re-balance Mod (Patch 3 OK!)

Post by Udzi » November 19th, 2014, 2:42 am

Just did a test and it seems it's not working with patch 4.

Can someone else check and confirm if I got that right?

EDIT: Just need to copy the file again and it's working. Nevermind the stuff I said earlier :)

ScubaSteve3465
Initiate
Posts: 19
Joined: November 21st, 2014, 11:13 am

Re: A Weapon Re-balance Mod (Patch 4 OK!)

Post by ScubaSteve3465 » November 21st, 2014, 11:14 am

I love this mod and hope you continue working on it until the Developers finally figure out they have a balancing issue. You have any idea's for future updates?

Halfgeek
Acolyte
Posts: 74
Joined: October 11th, 2014, 5:00 pm

Re: A Weapon Re-balance Mod (Patch 4 OK!)

Post by Halfgeek » November 21st, 2014, 4:25 pm

ScubaSteve3465 wrote:I love this mod and hope you continue working on it until the Developers finally figure out they have a balancing issue. You have any idea's for future updates?
Well I was still waiting for some people to suggest a balance fix for blunt weapons, I get the impression blunt isn't that weak currently, but could use a tiny buff.

ScubaSteve3465
Initiate
Posts: 19
Joined: November 21st, 2014, 11:13 am

Re: A Weapon Re-balance Mod (Patch 4 OK!)

Post by ScubaSteve3465 » November 21st, 2014, 10:00 pm

I personally havn't used any of the melee yet, how does it fair with your mod? Im talking about all melee combat. I havn't got past the first mission areas yet(Highpool, AG Center)had a mod bug and needed to restart.

ScubaSteve3465
Initiate
Posts: 19
Joined: November 21st, 2014, 11:13 am

Re: A Weapon Re-balance Mod (Patch 4 OK!)

Post by ScubaSteve3465 » November 24th, 2014, 5:26 pm

With this mod installed the .38 pistol is better than the m1 garand and the m14.... that cant be right...

Chabate Jemhini
Initiate
Posts: 8
Joined: November 25th, 2014, 1:27 am

Re: A Weapon Re-balance Mod (Patch 4 OK!)

Post by Chabate Jemhini » November 25th, 2014, 1:33 am

To my best (i.e. limited) knowledge the best advice is to stop playing WL2 until this mod is really updated to Patch 4. Without this mod WL2 is unbalanced, and thus not very fun (especially if you went for a balanced team with SMGs, shotguns and handguns). However, with this mod WL2 may be broken, because the file that this mod changes contains not only item data, but also animations, particle effects and whatnot. Since currently this mod is only available as applied to Patch 2 version of the datafile, it means that any fixes made by patches 3 and 4 that change anything in this file will be lost if you install this mod.

Which is why i've stopped playing until this mod is updated (or until WL2 devs fix the balance themselves).

ScubaSteve3465
Initiate
Posts: 19
Joined: November 21st, 2014, 11:13 am

Re: A Weapon Re-balance Mod (Patch 4 OK!)

Post by ScubaSteve3465 » November 25th, 2014, 10:47 am

Are you serious.... sigh. That really just killed the game for me. I thought this was updated for the latest patch, it even says patch 4 ok in the name. The fact that its not updated and how unbalanced the weapons are by default maybe I will just wait for an update for the mod or for the game to be fixed. Did the developers say they are planning to fix the balance issues or any information about whats going on with the weapons? Also last question, are there any balance mods out there currently updated for patch 4 so we dont have all the issues you described?

Maravan
Initiate
Posts: 1
Joined: November 28th, 2014, 2:56 am

Re: A Weapon Re-balance Mod (Patch 4 OK!)

Post by Maravan » November 28th, 2014, 3:06 am

I had made wiki page for weapons change (exept half of smg and heavy guns) you may take a look
wasteland.gamepedia.com/Wasteland_2_mods_and_utilities
link to
wasteland.gamepedia.com/Rebalanced_weapons_table

After installing patch game become uninteresing. Weapons become too strong most of fight ends before enemy able to take turn so it's sux.
You need to reduce average damage of all fixed weapons.

Chabate Jemhini
Initiate
Posts: 8
Joined: November 25th, 2014, 1:27 am

Re: A Weapon Re-balance Mod (Patch 4 OK!)

Post by Chabate Jemhini » December 4th, 2014, 3:10 am

I took a liberty of replicating the changes this mod does to Patch2 ItemTemplates on Patch4 ItemTemplates, here's the file - http://www.mediafire.com/download/28w9q ... unity3d.xz (sorry for the crappy file hosting, don't have access to anything nicer). The game works, but i obviously can't make any guarantees (however this variant is vastly less intrusive than the original, so i would expect it to work better).

In case of any funny business on mediafire's part, here's sha512 sum for the .xz archive:
c50e6001134f1af86774a5de1784c576cf5c0d73511327aa23c9e0ab130ced26bcd3716ace454df8236549038541a7302ca1d98b23b326bfb894b8ce396be21d

Garzhad
Novice
Posts: 30
Joined: January 20th, 2014, 1:36 am

Re: A Weapon Re-balance Mod (Patch 4 OK!)

Post by Garzhad » December 4th, 2014, 8:15 pm

How did you make all these edits to the weapons in the first place? I don't understand. I can open up the file in say HxD, even find references to weapon names, but it's all dots and gibberish, don't understand how any of it corresponds to anything with the weapons at all.

Chabate Jemhini
Initiate
Posts: 8
Joined: November 25th, 2014, 1:27 am

Re: A Weapon Re-balance Mod (Patch 4 OK!)

Post by Chabate Jemhini » December 5th, 2014, 12:11 am

Garzhad wrote:How did you make all these edits to the weapons in the first place?.
tl;dr - i'm very modest, awesome and smart, but i can't help you

First, i didn't make these edits, the original author of this mod did. My task was simpler - replicate these same changes on newer version of the file, the one from Patch4.

Obvious solution was to just take the Patch2 version, take the modded version, compare them in a hex editor, then somehow record all the changes and apply them to the Patch4 version. That didn't work out, probably because i've used Patch3 version for comparison (and it had tons of unrelated changes - as i've said, this file contains more than just item stats).

Next obvious solution: unpack the files (assuming that they are like archives and contains individual resource files inside), find the files for weapons and compare *that* between versions. I've tried using Disunity as unpacker, but resulting binary files still sported too much differences, and i just wasn't sure what i'm seeing. Non-binary dumping that Disunity offered turned out to be not very great and missed the relevant files completely.

Then i thought about just finding relevant parts of the big resource file by names and descriptions, then inferring the data layout from that (since weapon stats are known, both for un-modded and for modded versions). Didn't go far in that direction, too much uncertainty there (names and descriptions are easy to find, but i couldn't be sure where one item ends and another begins). I clearly needed to work with unpacked resources after all.

At that point i started to really dislike Disunity. I did remember reading somewhere (on this forum probably) that existing packers/unpackers were incapable of building valid resource bundles, which meant that they are useless for modding. I didn't verify these claims, just decided to write my own unpacker. Thankfully, Disunity source code was descriptive enough. After reading it a bit and writing partial implementation in Python i realized that i can simplify things a lot by going the Unix way, and i did.

Unlike Disunity, which aims to work with bundles and assets in one go (author plans to release a version with a GUI next, this approach will definitely work for that purpose), my unpacker is split into parts, each part does one thing, but does it right.

First part unpacks bundles, and gives you a directory with assets files, much like Disunity. Then i wrote its counterpart that *packs* these files back (toyed with the idea about adding extra files, but eventually discarded it - difficult to do when all you have to work with are file/directory structure and pickled objects). After some tinkering and fixes my bundle packer/unpacker was able to unpack the bundle in question and then pack it back together the way it was, bit-identical.

Then i wrote unpacker for assets files (turned out, the WL2 bundle that i was interested in contained just one big file, so getting was not a big achievement). All assets are identified by an ID (a number), and have class and type metadata known about them. Assets file may also contain information about classes in its header (Disunity source seems to indicate that this is not a rule, and provides functionality for getting class info from various sources and assembling it in a separate database that is later consulted with) - WL2 one certainly does. Anyway, the unpacker creates a directory structure, where first level directories are class IDs (later i updated it to include class IDs *and* class names), their child directories are type IDs, and inside them are objects of that class and type. Initially objects were just named by their ID, i thought it to be enough. After that i wrote a packer that reversed the process, and verified that it creates bit-identical assets file.

Well, that was that - i had separate small binary files, each describing just one object. Just needed to find which ones described weapons, then see what changed in *these* files between versions - and then i'd be able to just patch these files only in unpacked Patch4 version (or even simpler - just put them as-is into unpacked Patch4 version), then pack it back, and voila!

Sadly, that didn't work either. Turns out, object IDs change between versions, and while ID changes were small (say, 12576 instead of 12580), i couldn't rely on them. Grepping files for identifying strings was a dead-end too, since, as it turned out, the game has, like, 10 different weapons described as "Claws", for example.

Then i whipped up a program that dumps aforementioned class info in text form, and tried to use that info to parse object files to figure out if they contain any persistent identifiers that i could use. That took longer than i thought - Unity objects combine primitive types in a tree-like structure to create complex datatypes (kind of like Matroska tag system), so a 'string' is actually an 'Array', which is actually a 'size' (length) and a "length" number of 'char's. Dictionaries are even weirder. Also, you have to respect the alignment. Luckily, Disunity source code does have descriptive commends about that, so i was able to figure it out, and discovered that these files do not contain any identifying information. Bummer (they do have an m_Name string field, it's consistently empty).

Then i scoured the whole assets file for that info, correctly inferring that object id must also be recorded *somewhere* and paired with some identifying information, otherwise the game wouldn't know what to look for. That part i was able to solve only partially. First, there's a single (and relatively large) object of class 142 (called AssetBundle) type 142, and it contains, among other things, a field named m_Container of type "map", which is an array of pairs, each pair contists of a string and an AssetInfo. AssetInfo is a struct with some preload indices and, most importantly, a PPtr<Object>, which, it seems, contains an object ID. The aforementioned string seems to be a name of some sort. I wrote a program that loads up this map and then goes through the unpacked objects and renames them, so that instead of raw and changing-between-versions numbers i'd have names, at which point i'd be able to go back to my original plan.

That didn't exactly work out. First, because these "names" turned out to be highly non-unique (there are, like, 300 objects of various classes and types with the name "human"). Obviously, you can't have 300 files with the same name...Second - because that map was *really* incomplete, missing info on *lot* of objects.

I dug further. There was a big swath of objects of class 1 (GameObject) type 1 (by the way, Unity has this weird system where positive class IDs and type IDs are the same, but for class 114 (MonoBehaviour; Unity authors must have been brits) type ids are not the same - in fact, they are negative, and identify extra classes) - they are small and contain very conspicuous strings that *could* be the names i wanted, and they seem to contain IDs of objects too. So i wrote extra code that reads first few fields of an object and, if it had a m_GameObject field, uses the ID from that field to read *another* object (if it exists) in that big list of GameObject objects, and reads the name of the object there. That worked much better: first, all names that i've got from this seemed to have been unique; second, they did identify all the objects that i needed identified - objects of class 114 (MonoBehaviour) and types -38, -39, -40 and -41 (melee weapons, guns, shotguns and energy weapons, it seems; h-m-m-m...i probably should have labeled types as well). Since some names were still from that map i found first, and thus non-unique, i decided to keep object IDs in the names.

At this point i was able to write a simple program that just walked through one directory tree (unpacked original Patch2 resource), took each file and compared it to its counterpart in another directory tree (unpacked modded Patch2 resource) and checked if the file changed. If it did, the program would write change info (kind of like 'diff' does - offsets and bytes to change, but without context) into stdout.

Then i wrote a program (kind of like 'patch') that applies that reads this change info and re-produces the changes on a different directory tree (unpacked original Patch4 resource).

At which point i just packed the now-patched Patch4 resource back into an assets file, then packed that into a bundle, and this is what you can download now. Took me a few days, but now i can re-produce the same changes on a Patch5, if (when?) it ever comes out, and it will only take a few commands (though some of them do run for minutes, especially the one that renames object files).

Hopefully, that answered your question and any other questions you might have had.

Before you ask for the programs, i must warn you that they all have command line interface only, the code is gnarly, the diff-patch program pair only works for byte tweaks (if object file size is different (which will happen if you edit strings or add/remove firing modes or tags), the diff program refuses to consider it - changed object size means re-calculating offsets for assets file header, which i might have gotten wrong), ignores new objects (you can't add objects - again, that requires header modifications that i haven't coded in, and i would have liked to preserve the order in which objects are stored - to make clean and minimal diffs, which means that object list must be stored in human-editable form, and you need to put objects into it and ...well, you see where it's going) and is baffled by deleted objects (same reason). Also, nothing here helps you *make* new changes (as i only worked with already modded files) - again, i haven't coded any user interface, nor am i going to; parsing an object file into human-editable text form is complicated, because of the complex type system that needs to be folded into things like lists, strings and dictionaries, and then *unfolded* when you write the object back; besides, for weapon balancing you'd probably want to put multiple items into some kind of table, which is not doable with simple text files (you'd need CSV at the least, but then how are you going to represent arrays of different length...?). And my object-reading code is imperfect (it crashes on some objects; this is why the labeling program only reads first few fields of an object - to avoid reading field trees it can't handle).

User avatar
Raestloz
Explorer
Posts: 479
Joined: October 8th, 2014, 8:33 pm

Re: A Weapon Re-balance Mod (Patch 4 OK!)

Post by Raestloz » December 5th, 2014, 12:34 am

That's some dedicated programming you did there my friend.

No, seriously
My leadership Ranger is my medic

Garzhad
Novice
Posts: 30
Joined: January 20th, 2014, 1:36 am

Re: A Weapon Re-balance Mod (Patch 4 OK!)

Post by Garzhad » December 5th, 2014, 1:26 pm

Chabate Jemhini wrote:
Garzhad wrote:How did you make all these edits to the weapons in the first place?.
tl;dr - i'm very modest, awesome and smart, but i can't help you
Heh, thanks for the effort anyway. I did follow quite a bit of it. And yeah, the programs you created sound cool, but while awesome for making older mods compatible with newer patches, well, said yourself basically you cant add/remove new things with it really XD

I also had went through most of the steps you did. Compared the files via hex... but there were thousands of descrepancies due to all the patch changes and all. Disunity was no help whatsoever, didn't seem to extract any files resembling item data. Also, like you said, names and items were easy to Find in hex, but outside of Trinkets/mods where it was blatantly obvious where each item ended and another began, couldn't make heads or tails of it. Editting most trinkets was actually simple, like the above poster with the monocle changes. Most of those were easy to understand and alter, but could never Add anything without breaking it it seemed, and trying to increase the monocles max range either filled the item with gibberish text or resulted in game crash on load; couldn't figure that one out..

Past that is beyond me though, hah. I'm no programmer. I know enough about how various scripts work from NV,skyrim,oblivion ect to reverse engineer them somewhat and make various changes, thats about it. FC3's patch.fat and patch.dat system was easier to work with XD

Thanks for helping keep the older mods working at any rate =D

Edit: I've figured out various other things from reverse engineering other peoples mods. It's helped me make every weapon support full weapon mods like the AR's do, for instance. I've also figured out the weapon damage and AP finding, and can utilize the patcher from said mod to essentially make changes unbreakable by future updates.
It's still suboptimal, but hey, least things can be changed to an extent until official tools come out.

Chabate Jemhini
Initiate
Posts: 8
Joined: November 25th, 2014, 1:27 am

Re: A Weapon Re-balance Mod (Patch 4 OK!)

Post by Chabate Jemhini » December 6th, 2014, 5:09 am

Found a bug in my patcher - it didn't check that the file size matches before applying a patch. Because of that it incorrectly patched the following objects:
15302=Handgun_Tier_6_1_KymrisWarrior
15311=MachineGun_Tier_5_1
15362=SMG_Tier_5_1_HK

Found it in-game, when i discovered that Death Sifter (MachineGun_Tier_5_1) being sold is just broken (inventory description window doesn't disappear and its contents are weird).
I'll fix up the patcher, re-apply the patch and upload a new version soon.

Chabate Jemhini
Initiate
Posts: 8
Joined: November 25th, 2014, 1:27 am

Re: A Weapon Re-balance Mod (Patch 4 OK!)

Post by Chabate Jemhini » December 6th, 2014, 6:22 am

Fixed version - http://www.mediafire.com/download/hvfb7 ... unity3d.xz
Sha512 sum is:
c9b2a253b83637bdc002f5edbc6eeca3e09386f120a115176c74f95274b7c8650a02ac2fef8c25f8321a3f2fd181b761a11466a19795201784f3ea09bcf412dd

Atchodas
Scholar
Posts: 190
Joined: October 14th, 2014, 4:26 am

Re: A Weapon Re-balance Mod (Patch 4 OK!)

Post by Atchodas » December 31st, 2014, 9:09 am

is this project going to be updated ?
STOP INTRODUCING NEW BUGS TO THIS GAME THAT IS ALREADY VERY BUGGY

Halfgeek
Acolyte
Posts: 74
Joined: October 11th, 2014, 5:00 pm

Re: A Weapon Re-balance Mod (Patch 4 OK!)

Post by Halfgeek » January 19th, 2015, 7:45 pm

Thanks for updating it for me Chabate Jemhini.

Since I was last here posting, I saw a thread from InXile devs who wanted to release a weapon balance patch based on feedback.. I thought the problem would be solved officially so I hadn't work on releasing updates for the recent patch.

Its disappointing to see nothing has been done and weapon balance is out of wack.. and we still don't have proper modding tools.

Atchodas
Scholar
Posts: 190
Joined: October 14th, 2014, 4:26 am

Re: A Weapon Re-balance Mod (Patch 4 OK!)

Post by Atchodas » January 20th, 2015, 8:16 am

I wish you continued your work with this mod , we wont see "major" balance patch any time soon all we going to get is some Patch 6 with few changes to some bugs or few nerfs to assault rifles , i dont imagine inxile fixing all the weapons just yet .

Also i heard they are releasing another patch soon so maybe dev's could tell what they gona have in the update ...
STOP INTRODUCING NEW BUGS TO THIS GAME THAT IS ALREADY VERY BUGGY

Godspeed
Initiate
Posts: 2
Joined: October 16th, 2014, 1:40 am

Re: A Weapon Re-balance Mod (Patch 4 OK!)

Post by Godspeed » January 22nd, 2015, 1:31 pm

Would it be OK if I apply this ItemTemplates.unity3d (afaik Patch 4) to my patch 5?
Or was the lots of stuff changed within the file as such from P4 to P5, other than the weapons?

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest