Home » MODDING HQ 1.13 » v1.13 General Development Talk » A bug appeared after 4870 version.
A bug appeared after 4870 version.[message #304730] Tue, 15 May 2012 17:04 Go to next message
cnagorneac is currently offline cnagorneac

 
Messages:187
Registered:April 2012
I found a strange bug in the game using ArilkoFoldingStocks.

It appears that Aiming cap modifier makes shots more accurate even if it is has Minus sign. during my tests looks like no matter + or - is the modifier, it gives increase in accuracy.

I checked two weapons.cpp files. One from 4870 (was told that this versions works as intended) and one from 5272 build.

Found that almost all places where ToHit bonuses or penalties are present were changed. For example.

in 4870
// Add percent-based modifier from the gun and its attachments

uiCap += (INT32)(uiCap * GetPercentCapModifier( pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight )) / 100;

in 5272

// Add percent-based modifier from the gun and its attachments
UINT32 uimoda = (UINT32)(uiCap * GetPercentCapModifier( pInHand, stance )) / 100;
UINT32 uimodb = (UINT32)(uiCap * GetPercentCapModifier( pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight )) / 100;
uiCap += (UINT32)((gGameExternalOptions.ubProneModifierPercentage * uimoda + (100 - gGameExternalOptions.ubProneModifierPercentage) * uimodb)/100);

or

in 4870
iGunAimDifficulty += (iGunAimDifficulty * GetPercentHandlingModifier( pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight )) / 100;

in 5272
FLOAT umoda = (iGunAimDifficulty * GetPercentHandlingModifier( pInHand, stance )) / 100;
FLOAT umodb = (iGunAimDifficulty * GetPercentHandlingModifier( pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight )) / 100;
iGunAimDifficulty += (gGameExternalOptions.ubProneModifierPercentage * umoda + (100 - gGameExternalOptions.ubProneModifierPercentage) * umodb)/100;


Hope this info helps.

Report message to a moderator

Staff Sergeant
Re: A bug appeared after 4870 version.[message #304738] Tue, 15 May 2012 20:30 Go to previous messageGo to next message
DepressivesBrot is currently offline DepressivesBrot

 
Messages:3641
Registered:July 2009
The second pair looks like a legit change, the first one is interesting though. The UINT32 part causes the game to treat all negative modifiers as 'insanely high' positives.

Report message to a moderator

Captain

Re: A bug appeared after 4870 version.[message #304739] Tue, 15 May 2012 20:46 Go to previous messageGo to next message
Wil473

 
Messages:2808
Registered:September 2004
Location: Canada
I should have remembered this earlier, there was a bug in NCTH that stopped me from using the Aiming Cap a while ago - I think this was it. It was fixed by ChrisL, but possibly Headrock may have been using an earlier form of the NCTH code which is why it popped up in HAM5 and after HAM5 was reintegrated. There's some discussion between ChrisL and myself in his NCTH thread.

[Updated on: Tue, 15 May 2012 20:46] by Moderator

Report message to a moderator

Lieutenant

Re: A bug appeared after 4870 version.[message #304740] Tue, 15 May 2012 20:46 Go to previous messageGo to next message
cnagorneac is currently offline cnagorneac

 
Messages:187
Registered:April 2012
DepressivesBrot
The second pair looks like a legit change, the first one is interesting though. The UINT32 part causes the game to treat all negative modifiers as 'insanely high' positives.

YAHOO!!!
so looks like bug is found......
It is the reason I posted this as a base example, because I thought that the problem must be within "PercentCap" variable (I found it in XML file).
can any one remove those UINT32, recompile and make it possible to test??? would be really great.

Report message to a moderator

Staff Sergeant
Re: A bug appeared after 4870 version.[message #304741] Tue, 15 May 2012 21:00 Go to previous messageGo to next message
Wil473

 
Messages:2808
Registered:September 2004
Location: Canada
Found it, ChrisL only fixed it recently: http://www.ja-galaxy-forum.com/board/ubbthreads.php?ubb=showflat&Number=290405#Post290405

EDIT: also Percent Tracking needs to be checked as well, ChrisL in September found it was subject to the same bug.

[Updated on: Tue, 15 May 2012 21:02] by Moderator

Report message to a moderator

Lieutenant

Re: A bug appeared after 4870 version.[message #304744] Tue, 15 May 2012 21:19 Go to previous messageGo to next message
cnagorneac is currently offline cnagorneac

 
Messages:187
Registered:April 2012
wil473
Found it, ChrisL only fixed it recently: http://www.ja-galaxy-forum.com/board/ubbthreads.php?ubb=showflat&Number=290405#Post290405

EDIT: also Percent Tracking needs to be checked as well, ChrisL in September found it was subject to the same bug.

It is hard for me to understand what is written in the topic you mentioned, but I do not understand you at all. Found it? fixed? I do not understand. Where is it fixed if the last build has this bug? or you mean that it should be fixed again?
If it should be fixed again, I will pationly wait for the fix, but if there is another workaround, please tell me.

Report message to a moderator

Staff Sergeant
Re: A bug appeared after 4870 version.[message #304746] Tue, 15 May 2012 21:40 Go to previous messageGo to next message
cnagorneac is currently offline cnagorneac

 
Messages:187
Registered:April 2012
So if it is known bug, and even I have a strong idea how to fix it. taking into account that i have no idea in scripting. Can some one edit and recompile 5272 build? I think even I can do it if I would have needed soft. COME ON SOME ONE. I have just some days to relax... if I will not be able to play JA2 this week, most probably I will not be able to return to it for some time.

Report message to a moderator

Staff Sergeant
Re: A bug appeared after 4870 version.[message #304747] Tue, 15 May 2012 21:47 Go to previous messageGo to next message
wanne (aka RoWa21) is currently offline wanne (aka RoWa21)

 
Messages:1949
Registered:October 2005
Location: Austria
If someone sends me the fix per PM, I can included it into official 1.13 source trunk.

Report message to a moderator

Sergeant Major

Re: A bug appeared after 4870 version.[message #304749] Tue, 15 May 2012 22:07 Go to previous messageGo to next message
Wil473

 
Messages:2808
Registered:September 2004
Location: Canada
cnagorneac
wil473
Found it, ChrisL only fixed it recently: http://www.ja-galaxy-forum.com/board/ubbthreads.php?ubb=showflat&Number=290405#Post290405

EDIT: also Percent Tracking needs to be checked as well, ChrisL in September found it was subject to the same bug.

It is hard for me to understand what is written in the topic you mentioned, but I do not understand you at all. Found it? fixed? I do not understand. Where is it fixed if the last build has this bug? or you mean that it should be fixed again?
If it should be fixed again, I will pationly wait for the fix, but if there is another workaround, please tell me.


A time-line may help here:
1)Known - ChrisL found in September of last year that negative Percent Cap values was causing NCTH accuracy to jump (ie. what we're seeing now).

2)Known - He fixed it in September of last year, allowing me to use negative Percent Cap values (ie. the broken FSS system). Not being a programmer, I cannot understand what the fix is either but it was fixed and described as:
ChrisL
after fixing this bug with a simple variable recast, this same test merc ends up with a uiCap of 88 and maxAim of 75 when I set the weapon's PercentCap=-10.
uiCap += (INT32)(uiCap * GetPercentCapModifier( pInHand, gAnimControl[ pSoldier->usAnimState ].ubEndHeight )) / 100;

I'll commit this small fix to the release branch so it's available the next time a build is released.

EDIT: I fixed a similar issue with PercentTargetTrackingSpeed


"simple variable recast" = swapping in INT32 instead UINT32 in the right places?

3)Suspected - HAM5 may have been using a form of NCTH from before the fix, it started within a month or two of ChrisL's post. Hopefully this is the case, because the other possibility is that Headrock needed to "break" Percent Cap for some other feature.

Report message to a moderator

Lieutenant

Re: A bug appeared after 4870 version.[message #304750] Tue, 15 May 2012 22:14 Go to previous messageGo to next message
Flugente

 
Messages:3499
Registered:April 2009
Location: Germany
I'm currently fixing this... I'll post the fix once compiling is finished without error. I've changed the UINT32 to INT32 on the described function, and also a change in LOS.cpp (same problem).

Report message to a moderator

Captain

Re: A bug appeared after 4870 version.[message #304751] Tue, 15 May 2012 22:20 Go to previous messageGo to next message
Strohmann is currently offline Strohmann

 
Messages:280
Registered:August 2011
Location: Division Thought Crimes
i doubt 3), i didn't have the problem with any HAM 5 version and equivalents until the latest sci from Tai. looking at the code line for 5272 in the first post from cnagorneac i suspect the weapon resting feature from flugente.


(Thread Feature: Overheating Weapons, p2)
Toggle Spoiler


Edit: too late^^

Report message to a moderator

Master Sergeant
Re: A bug appeared after 4870 version.[message #304752] Tue, 15 May 2012 22:46 Go to previous messageGo to next message
cnagorneac is currently offline cnagorneac

 
Messages:187
Registered:April 2012
Flugente
I'm currently fixing this... I'll post the fix once compiling is finished without error. I've changed the UINT32 to INT32 on the described function, and also a change in LOS.cpp (same problem).

please post here link to download. hope tomorrow I will be able to spend 2-3 hours enjoying JA2 =)

Report message to a moderator

Staff Sergeant
Re: A bug appeared after 4870 version.[message #304753] Tue, 15 May 2012 22:46 Go to previous messageGo to next message
wanne (aka RoWa21) is currently offline wanne (aka RoWa21)

 
Messages:1949
Registered:October 2005
Location: Austria
I have just committed the fix from Flugente.

Report message to a moderator

Sergeant Major

Re: A bug appeared after 4870 version.[message #304754] Tue, 15 May 2012 23:12 Go to previous messageGo to next message
cnagorneac is currently offline cnagorneac

 
Messages:187
Registered:April 2012
RoWa21
I have just committed the fix from Flugente.

Ido not relly understand where should I download it... can you please post a link?

Report message to a moderator

Staff Sergeant
Re: A bug appeared after 4870 version.[message #304755] Tue, 15 May 2012 23:16 Go to previous messageGo to next message
DepressivesBrot is currently offline DepressivesBrot

 
Messages:3641
Registered:July 2009
Either update your local copy of the source code SVN repository and compile ...
... or just follow the link in my sig that says 'Latest builds'

Report message to a moderator

Captain

Re: A bug appeared after 4870 version.[message #304756] Tue, 15 May 2012 23:18 Go to previous message
cnagorneac is currently offline cnagorneac

 
Messages:187
Registered:April 2012
DepressivesBrot
Either update your local copy of the source code SVN repository and compile ...
... or just follow the link in my sig that says 'Latest builds'

A-HA... Thanks.

Ha, I am in the changelog =))))))

[Updated on: Tue, 15 May 2012 23:23] by Moderator

Report message to a moderator

Staff Sergeant
Previous Topic: Patch to add a new shortcut to Swap Blade
Next Topic: Inventory bug.
Goto Forum:
  


Current Time: Fri Jun 12 00:13:40 GMT+3 2026

Total time taken to generate the page: 0.01327 seconds