Probably heli fix

For general topics about Urban Assault and any Urban Assault-related topic that doesn't fit anywhere else. If you're not sure, it probably goes in here.
User avatar
Zidane
Turantul 1 (Veteran)
Turantul 1 (Veteran)
Posts: 166
Joined: Mon Nov 22, 2010 8:38 pm
Location: Novosibirsk, Russia

Probably heli fix

Post by Zidane » Fri Mar 25, 2016 3:07 am

Who may test this patched game exe?
https://drive.google.com/open?id=0B5H4Z ... TBMR1BtdXM
合体! ライオカイザー

User avatar
CharlotteLabyrinth
Turantul 1 (Veteran)
Turantul 1 (Veteran)
Posts: 357
Joined: Thu Mar 01, 2012 3:00 pm
Location: Schloss Charlottenburg..?

Re: Probably heli fix

Post by CharlotteLabyrinth » Fri Mar 25, 2016 9:08 am

Performed a quick test on several debug levels with only helicopters available to each factions. Every single helicopter is confirmed to be working perfectly with their intact original properties in both Software and Hardware rendering mode! :D

Finally the game behaves properly as it is supposed to be. Truly a marvellous work, nicely done! :awsm:
(Incidentally, care to share which part was the 'exact' lynchpin of the culprit?)
;----------------------------------------------------------
;
; Vielleicht der niedlichste Hubi, Knuddel.
;
;----------------------------------------------------------

Personal Declaration: I always use different usernames across different websites. Hence if you ever see my username is being used outside of Stoudson Corporation, I absolutely have no affiliation whatsoever with that!

User avatar
Zidane
Turantul 1 (Veteran)
Turantul 1 (Veteran)
Posts: 166
Joined: Mon Nov 22, 2010 8:38 pm
Location: Novosibirsk, Russia

Re: Probably heli fix

Post by Zidane » Fri Mar 25, 2016 9:38 am

Simple answer to this issue is: "too fast" :D

Also similar bug may occur for some rockets.

Later I will fix it in another places and give you some details
合体! ライオカイザー

Ormu
Turantul 1 (Veteran)
Turantul 1 (Veteran)
Posts: 840
Joined: Fri Dec 26, 2008 4:59 pm
Location: Finland

Re: Probably heli fix

Post by Ormu » Fri Mar 25, 2016 8:11 pm

Looks really good! I did a very quick test and all helis seem to be working correctly.

Interested in details too. :P
Image
Matthew Lever wrote:Take out Ormus as soon as you see them.
UA community Discord channel: https://discord.gg/7H4dFQH
Not all Ormus are mine. When in doubt, please ask...

User avatar
Zidane
Turantul 1 (Veteran)
Turantul 1 (Veteran)
Posts: 166
Joined: Mon Nov 22, 2010 8:38 pm
Location: Novosibirsk, Russia

Re: Probably heli fix

Post by Zidane » Mon Mar 28, 2016 8:41 am

https://drive.google.com/open?id=0B5H4Z ... XQ1Wk80dDg
Fixed version.
I found three places affected by this issue.
One in AI of helicopters, one in missile code and one in some shared code for all units.

About issue.
Urban Assault uses time periods for update logic for every frame. For fast computer it's small. Minimal period is 1ms.
In places affected by issue is computing needed rotation angle and after compute angle for current update period:

Code: Select all

full_angle = ......;

float_period = update_period / 1000.0;

angle = full_angle;
max_angle = float_period * max_rot;

if (angle > max_angle)
   angle = max_angle;
   
if ( fabs(angle) > 0.02 )
{
    do rotation....;
}
YES, if update period is small then max_angle will be smaller than 0.02 and "if ( fabs(angle) > 0.02 )" will not be passed.

I patched it into 0.0002.

I think it was for filter some noise in computations.
合体! ライオカイザー

User avatar
CharlotteLabyrinth
Turantul 1 (Veteran)
Turantul 1 (Veteran)
Posts: 357
Joined: Thu Mar 01, 2012 3:00 pm
Location: Schloss Charlottenburg..?

Re: Probably heli fix

Post by CharlotteLabyrinth » Mon Mar 28, 2016 12:56 pm

So it was a sequential failure of one outmoded algorithm present in the source code which caused the helicopter problems! It comes as no surprise considering how old UA is now and how technologies evolved fast enough to quickly surpass former developers' considerations in a field of performance... :)
Zidane wrote:I found three places affected by this issue.
One in AI of helicopters, one in missile code and one in some shared code for all units.
This part is rather interesting... Doomfrost had speculated instances where the issue might be shared with ground vehicles long time ago. On the other hand, I'm also curious how weapons would have been affected if the bug was happened on them.

Now it all makes sense how most observations/workarounds suggested concerning helicopter glitches until this time all refer to something that has to do with the game updating its in-game logics. Thanks for sharing the info! :D

(Time to update Stoudson Corporation wiki to add this new discovery, maybe?)
;----------------------------------------------------------
;
; Vielleicht der niedlichste Hubi, Knuddel.
;
;----------------------------------------------------------

Personal Declaration: I always use different usernames across different websites. Hence if you ever see my username is being used outside of Stoudson Corporation, I absolutely have no affiliation whatsoever with that!

Ormu
Turantul 1 (Veteran)
Turantul 1 (Veteran)
Posts: 840
Joined: Fri Dec 26, 2008 4:59 pm
Location: Finland

Re: Probably heli fix

Post by Ormu » Tue Mar 29, 2016 3:37 pm

Great work Zidane! That also clearly shows how increasing maxrot helps with the problem.

Let's see if the second version shows differences in the general AI unit behavior...


edit: I updated the Wiki page too:
http://wiki.metropolisdawn.com/heli_bug
Image
Matthew Lever wrote:Take out Ormus as soon as you see them.
UA community Discord channel: https://discord.gg/7H4dFQH
Not all Ormus are mine. When in doubt, please ask...

User avatar
MarioSDU6/SDU7
Slime Lord
Slime Lord
Posts: 424
Joined: Sat Oct 09, 2010 3:12 am
Location: Panama City, Latin America

Re: Probably heli fix

Post by MarioSDU6/SDU7 » Tue Apr 05, 2016 5:27 am

Zidane wrote:https://drive.google.com/open?id=0B5H4Z ... XQ1Wk80dDg
Fixed version.
I found three places affected by this issue.
One in AI of helicopters, one in missile code and one in some shared code for all units.

About issue.
Urban Assault uses time periods for update logic for every frame. For fast computer it's small. Minimal period is 1ms.
In places affected by issue is computing needed rotation angle and after compute angle for current update period:

Code: Select all

full_angle = ......;

float_period = update_period / 1000.0;

angle = full_angle;
max_angle = float_period * max_rot;

if (angle > max_angle)
   angle = max_angle;
   
if ( fabs(angle) > 0.02 )
{
    do rotation....;
}
YES, if update period is small then max_angle will be smaller than 0.02 and "if ( fabs(angle) > 0.02 )" will not be passed.

I patched it into 0.0002.

I think it was for filter some noise in computations.
One question, have you already tweaked the UA_xp.exe to also have your fixes? Is that I'm sure both MD original expansions also have separate heli-patches, and their "destinations" go to UA_xp (then to their respective -env folder).
But also, it is possible to copy the UA.exe with your heli-fix and rename it "UA_xp"? Is that I often use those shortcuts for the separate mods I installed, also because I'm testing 1.2.01 Beta on a separate "expansion" I've had to make before porting everything to the original locations when the "Unofficial Beta" is ready.
EDIT: I already tried, and it didn't work, renaming it to UA_xp didn't work because it kept redirecting me back to the main menu using the files from ENV folder and UA.exe, and not the ones from the expansion. There wasn't any errors, though.
Intense Mod progress (it includes tests):
Resistance 100% done
Demo version uncertain fate
New Ghorkov and Taerkasten 100% done

Image
Image
Image

Factions of choice: Resistance, Ghorkovs, Taerkastens

User avatar
Zidane
Turantul 1 (Veteran)
Turantul 1 (Veteran)
Posts: 166
Joined: Mon Nov 22, 2010 8:38 pm
Location: Novosibirsk, Russia

Re: Probably heli fix

Post by Zidane » Tue Apr 05, 2016 2:47 pm

I can try to patch ua_xp if only one version of is
合体! ライオカイザー

User avatar
MarioSDU6/SDU7
Slime Lord
Slime Lord
Posts: 424
Joined: Sat Oct 09, 2010 3:12 am
Location: Panama City, Latin America

Re: Probably heli fix

Post by MarioSDU6/SDU7 » Tue Apr 05, 2016 10:20 pm

Zidane wrote:I can try to patch ua_xp if only one version of is
Okay, you can look into the Easy Install of the MD expansion, to find the UA_xp:
http://files.metropolisdawn.com/persona ... nal%29.rar
It is a bit heavy, 32.5 MB, but I'm sure you'll find it. ;)
Intense Mod progress (it includes tests):
Resistance 100% done
Demo version uncertain fate
New Ghorkov and Taerkasten 100% done

Image
Image
Image

Factions of choice: Resistance, Ghorkovs, Taerkastens

Post Reply