[A16] Melee Skill Rebalance [Updated 3/04/2017]

Started by oreganor, March 23, 2017, 01:54:29 PM

Previous topic - Next topic

Chickenfeed22

Help! Had a Tribal raid and one of the enemies went mental trying to decide whether to attack the nearby door or the nearby colonist. He constantly flicked between "Melee attacking Slate door" and "Watching for targets" while my colonist killed him, and then my FPS plummeted.

I checked the dev log and this error is tallying up into the thousands:

System.NullReferenceException: Object reference not set to an instance of an object
at MeleeRebalance.VerbMeleeTryCastShotPatch.Prefix (RimWorld.Verb_MeleeAttack,bool&) <0x0008d>
at (wrapper dynamic-method) RimWorld.Verb_MeleeAttack.TryCastShot_Patch1 (object) <0x0002b>
at Verse.Verb.TryCastNextBurstShot () <0x0001a>
at Verse.Verb.VerbTick () <0x00028>
at Verse.VerbTracker.VerbsTick () <0x00034>
at Verse.Pawn_EquipmentTracker.EquipmentTrackerTick () <0x00057>
at Verse.Pawn.Tick () <0x001b1>
at RimWorld.Planet.WorldPawns.WorldPawnsTick () <0x00170>
at RimWorld.Planet.World.WorldTick () <0x00017>
at Verse.TickManager.DoSingleTick () <0x001d7>

Verse.Log:Error(String)
Verse.TickManager:DoSingleTick()
Verse.TickManager:TickManagerUpdate()
Verse.Game:Update()
Verse.Root_Play:Update()


I've tried restarting the game, getting rid of the pawn (But the error is that there is no pawn to reference, so that shouldn't have any effect anyway), turning Melee Re-balance off. The error remains and is slowing my game to a crawl.

Any advice?

oreganor

#61
I assume Melee_Rebalance you were using was the last version (1.3.2), right?

QuoteI've tried restarting the game, getting rid of the pawn (But the error is that there is no pawn to reference, so that shouldn't have any effect anyway), turning Melee Re-balance off. The error remains and is slowing my game to a crawl.

Just to clarify... You got into the bugged state playing normally, you saved, turned Melee Rebalance Off, reload and you got the same error? Or the game just halted? (Can you try to do exactly that... But activating Dev Console on the Menu BEFORE loading?. Some errors aren't critical enought to show Dev Console BUT may be leaving your game into a "semifreezing" state). It would rock to have the Dev Console report of were Vanilla is failing even with my Mod off.


It would rock even more :) to have BOTH savegames, the original & the one with MR off still triggering the anomalous state... Can you upload the savegames somewhere (google drive for example) and send me a link so I can take a look at them?


In the meantime, I will try to reproduce the state... It may have to do with the Pawn loosing his weapon unexpectedly on a parry... Just by chance, do you remember seeing a forbidden melee weapon nearby?

UPDATE: After checking multiple scenarios I've isolated 2 possible causes of that error. Both seems to suggest that effectively, Vanilla, somehow "lost" target/attacker data and that's why MeleeRebalance fails and why that savegame keeps failing even WITHOUT the Mod on. But to keep investigating I REALLY need that you confirm me EXACTLY which version of the Mod you were using at the time of the error you posted. The chances that you have met a truly Vanilla bug is high... Because the 2 vulnerabilities on my mod are the same vulnerabilities Vanilla has on the situation you describe. OFC, the interesting part would be to know how your game reached that state in the 1st place... :). But that part of the investigation comes later.
Contributions:
Melee Skill Rebalance

oreganor

#62
= NEW VERSION 1.4.0 =

Changes:

- AI will now use different Attack Modes based on individual pawn's goals & capabilities.
- Tweaked Attack Modes thresholds & chances.
- Reduced Parry counter penalty.



Some comments:

- All pawns with Humanlike intellect (Animals and other primitive entities still default to "Kill" mode) will take now in consideration their own skill and their current target state to select an appropiate Attack Mode with decent chances to trigger the associated special effect. Combined with the tweaks on Attack Modes you will see, generally speaking, that skilled AI fighters will try to minimize the damage an enemy does to them trying to stun, disarm or even trying to incapacitate their targets in a single hit. This means you have to keep an extra eye on mentally unstable Skilled Melee colonists... If they suffer a Major break that puts them into Berserk trance, they will be deadlier than before.

- The next focus will be on the different auditive & visual notifications the Mod uses to bring your attention to what happens on the game. This means it will take more time than the previous features, as I need to explore how the underlaying engine does them and then trying to make my poor artisthical skills to yield something that really comes as an improvement of the current state... So I'm not even sure I can make the whole situation better :).


The mod is STILL savegame friendly. When/If I do something that leaves a trace on the savegame I will clearly announce it.
Contributions:
Melee Skill Rebalance

rdz1122

The "Latest" file link downloads an invalid .ZIP

Melee_Rebalance_1.4.0.zip shows as invalid.

oreganor

Another user got a similar problem and we traced the issue to the unpacker tool he was using on his W10 machine... The .zip itself is a regular zip file made with Winrar 5.21. Can you check that the tool you are using to access it can deal with it? For example, you can try to download the source code .zip files on the repository to see if you have the same problems. Those are generated automatically by Github using specific widely known "standard" zip tools.
Contributions:
Melee Skill Rebalance

AngleWyrm


I've noticed that a lot of ranged weapons list a rating for the range Touch, which I'm guessing is melee range.

But they don't sound like they're firing shots, and the animations look like they're basically attempting to bayonet or bludgeon their opponent with a ranged weapon.

Does this mod make changes to what happens when a guy with a pistol meets a guy with a club?
My 5-point rating system: Yay, Kay, Meh, Erm, Bleh

oreganor

#66
QuoteDoes this mod make changes to what happens when a guy with a pistol meets a guy with a club?

Not specifically... When you are armed with a weapon that's not classified as a melee weapon Pawns melee with their unarmed melee stats (You can check them on their Descriptions) This is vanilla behaviour, I don't go as high in the code as to change anything related to that... I just work ONCE a Pawn decides to use a melee attack.

ATM a high skilled pawn in melee will be able to use Attack Modes with or without a melee weapon equiped... The only "drawback" they have is that they can't "shield" themselves on a parry completely by letting their melee weapon eat the damage, they always take some damage. Obviously most Pawns do less damage unarmed than armed (But with the repertory of Bionics some mods give... This may not hold true in all cases :) ).

AFAIK nothing prevents a ranged weapon to be ALSO labeled as a potential melee weapon... My code just checks for that flag to distinguish which ones can be used to parry.

I can investigate to see if ranged weapons used as makeshift melee weapons are somekind of tag I can detect from inside melee resolution so they can be used to parry... But ATM I can't force pawns to use a given weapon, that's decided by the AI modules.
Contributions:
Melee Skill Rebalance

Canute

oreganor,
I think it is realy time to rename the mod archive from .zip to .7z or .rar.
Or use .zip compress methode that is compactible with windows explorer ! :-)

oreganor

#68
I use .rar myself but... For some reasson packing binaries on Github in zip format has become somehow a "standard". I suppose that as Github compresses sources using it, most modders prefer to use the same format on all associated files (We don't have to... When uploading binaries you can select a lot of compressed formats, at least I tried .rar, .7z and they all are accepted) but I see the logic behind, and been new to this, I prefered to follow the "common etiquette" most mods published on Github show.
Contributions:
Melee Skill Rebalance

Canute

At first i want honor you, you give us gamer/downloader a straight link to the download archiv. Not like other they just point to github !

But, it can't be github, when i use the the github function to clone/download the master i am geting a .zip file that works with windows explorer.
When i download the Source code (zip) i am geting a working zip archive either.

I am sorry i have no clue how you upload these things on github i just thought you generate the release file by yourself and put there.
But currently you are the only one, from many other github project i encounter this problem, you should maybe take a another closer look into this.
Don't forget the dump steam workshop windows user ! :-)

oreganor

Thanks for the report... So far all ppl having problems with the .zip file I link (The one I generate using winrar) also got problems with the zip files generated by github.

I will investigate if I can spot the problem on the packaging phase.
Contributions:
Melee Skill Rebalance

Canute

On Winrar, when you add files to an archive you can select
Archivformat "Rar , Rar5, Zip".
When i select Zip, then winrar normaly generates a filename with zip, and that archive works with win explorer.
Maybe you setup your winrar to use Rar/rar5 methode but keep the zip ending.

oreganor

Not at home ATM... But that could be perfectly possible. I don't remember the exact command line I used on the autopack script, but thanks to your point it's the 1st thing I will check when I arrive.
Contributions:
Melee Skill Rebalance

oreganor

#73
QuoteOn Winrar, when you add files to an archive you can select
Archivformat "Rar , Rar5, Zip".
When i select Zip, then winrar normaly generates a filename with zip, and that archive works with win explorer.
Maybe you setup your winrar to use Rar/rar5 methode but keep the zip ending.

Absolutely spot on!... My scripts were using rar.exe, which DO NOT generate zip format (even if you try the option). Meanwhile, the UI, relays on Winrar, which generates valid zip files. That's why I was been puzzled on why "sometimes" it did work and sometimes it didn't (I was mixing zip file creation methods).

Now EVERYTHING uses Winrar executable and generates appropiate .zip files. I've replaced the last release "zip" file with a true zip, not a rar in disguise. Thanks a lot for pointing this out... Probably I have been making this mistake YEARS without realizing it until now.

If it's not much of a hassle, can you check that it's working now on your side as it should?
Contributions:
Melee Skill Rebalance