Author Topic: Making aspect tracking speed less dependent on screen resolution  (Read 5653 times)

0 Members and 1 Guest are viewing this topic.

Making aspect tracking speed less dependent on screen resolution
I've started looking into my issue with aspect locking with wide resolutions, and I've discovered that the rate of tracking is based upon a fixed number of pixels, which does not depend on the x and y resolutions. A possible solution involves scaling the tracking speed based upon the x and y resolutions (using the original resolutions as a baseline), however I'm not that confident a coder and it would require a fair amount of change to the hudlock.cpp file.

Any help would be hugely appreciated. (IRC keeps hiccuping and losing my train of thought)

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Making aspect tracking speed less dependent on screen resolution
So it's easier to get a lock at 640x480 than 1920x1200?  I thought that it seemed harder to get a lock over time, must have been because my monitor kept getting bigger :P
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 
Re: Making aspect tracking speed less dependent on screen resolution
Bascially, yeah. I can't get a recording, but the locking wotsit for me is impossible to lock onto a moving target if it's moving across the screen in the x-direction at all! It waves all over the place. I'd imagine a higher resolution would also slow down the locking speed.

 

Offline BirdofPrey

  • 28
  • Help! I see GIMP in my sleep
Re: Making aspect tracking speed less dependent on screen resolution
Oh, is that why I have to actually dogfight basilisks when I used to just send a couple pack of hornets their way so I have more time dogfighting the dragons?
The Great War ended 30 years ago.
Our elders tell stories of a glorious civilization; of people with myths of humanity everlasting, who hurled themselves into the void of space with no fear.

In testing: Radar Icons

 

Offline jr2

  • The Mail Man
  • 212
  • It's prounounced jayartoo 0x6A7232
    • Steam
Re: Making aspect tracking speed less dependent on screen resolution
Heh, mayhaps forcing 1600x900 on the 3DFX nGlide as a res in FS1 was the cause of my crummy dogfighting in FS1 instead of my louse controller skills, then.. maybe.  (I think it's just 640x480 stretched with the aspect ratio kept).


/offtopic

 
Re: Making aspect tracking speed less dependent on screen resolution
Well, after spending four hours hammering away at it today, I have succeeded in making the problem worse. Doh!  :banghead:

 
Re: Making aspect tracking speed less dependent on screen resolution
Ouch, higher resolutions really do slow down missile tracking!

Times in seconds
640x480           1920x1080          3840x2160
2.3                    3.1                      5.9
2.3                    3.0                      5.7
2.2                    3.0                      5.8
2.2                    3.1                      5.3
2.3                    3.0                      5.8
2.2                                               5.8

The setup was a fighter at (100,500,0) with the player facing up the y-axis. EDIT: Missile used was a Harpoon.

Looks like there are two issues.
1) Higher Resolutions slow down tracking
2) Wide aspect ratios maul the tracking when the player is yawing his craft
« Last Edit: February 09, 2015, 02:37:54 pm by Italianmoose »

 

Offline Spoon

  • 212
  • ヾ(´︶`♡)ノ
Re: Making aspect tracking speed less dependent on screen resolution
I have suspected something like this was going on for a while now, good to see it being confirmed here.
Urutorahappī!!

[02:42] <@Axem> spoon somethings wrong
[02:42] <@Axem> critically wrong
[02:42] <@Axem> im happy with these missions now
[02:44] <@Axem> well
[02:44] <@Axem> with 2 of them

 

Offline Herra Tohtori

  • The Academic
  • 211
  • Bad command or file name
Re: Making aspect tracking speed less dependent on screen resolution
Well, sounds like the speed of the tracking cursor needs to be measured in angles rather than pixels.

This should also be done taking into account the FOV setting used by the player.


Measure the tracking speed with stock FOV and the highest stock resolution (1024x768 I believe) and calculate the intended angular velocity from that.
There are three things that last forever: Abort, Retry, Fail - and the greatest of these is Fail.

 

Offline jr2

  • The Mail Man
  • 212
  • It's prounounced jayartoo 0x6A7232
    • Steam
Re: Making aspect tracking speed less dependent on screen resolution
What if the high resolution (1024x768) had that bug, too?  The original FS1 was 640x480, tracking speed set and accounted for.  Then with 1024x768, because of the bug, the tracking speed decreased (it took longer) but it wasn't enough to notice?


In other words, should the baseline be 1024x768 or should it actually be 640x480?

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Making aspect tracking speed less dependent on screen resolution
Just FYI, MageKing17 proposed a patch that looks promising in Mantis #3140.
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline Herra Tohtori

  • The Academic
  • 211
  • Bad command or file name
Re: Making aspect tracking speed less dependent on screen resolution
What if the high resolution (1024x768) had that bug, too?  The original FS1 was 640x480, tracking speed set and accounted for.  Then with 1024x768, because of the bug, the tracking speed decreased (it took longer) but it wasn't enough to notice?


In other words, should the baseline be 1024x768 or should it actually be 640x480?


I would say it depends on which game we're talking about, FS1 or FS2.

It's entirely possible that the "bug", or questionable coding decision, was there right from the beginning, but the games are different enough that both had their own balancing and testing done to them.

You would need to pick something to use as a reference point. And I think the tracking speeds were originally balanced for the highest possible resolution for each game. 1024x768 for FS2 and... 640x480 for FS1, I guess.
There are three things that last forever: Abort, Retry, Fail - and the greatest of these is Fail.

 
Re: Making aspect tracking speed less dependent on screen resolution
You could set it so it loads the lower res corrections for FS1-based mods, but defaults to the higher-res corrections?
It's a bit more complicated, but it could keep the "feel" of the original FS1 missiles.

As it happens, thanks to MageKing17   's fix, the aspect ratio issue basically eliminated. Though it's probably worth checking to see if it's altered normal-ratio tracking in any way.
I can definitely feel the difference with tracking speeds though, especially trying to take out the Sathanas beam turrets (as an example). I used to be able to take out all four, now I struggle to get two as I spend so much time trying to get Helios torpedoes to lock after the initial pass.

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: Making aspect tracking speed less dependent on screen resolution
Though it's probably worth checking to see if it's altered normal-ratio tracking in any way.
It will have, but the difference should be insignificant (going from a 4:3 ratio to perfectly square). The difference might be slightly more noticeable on 16:9 and 16:10, but the old behavior was clearly wrong anyway.
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Making aspect tracking speed less dependent on screen resolution
So is there no easy way to make 4:3 the baseline and the other ratios behave like it, instead of it being 1:1?
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline Herra Tohtori

  • The Academic
  • 211
  • Bad command or file name
Re: Making aspect tracking speed less dependent on screen resolution
Easiest solution would be to limit the starting position of the tracking cursor to a 1024x768 area in the center of the image.

Or 640x480 in the case of FS1 era weapons.

Technically it should be also possible to scale this to any resolution or aspect ratio, but if you want the cursor to appear in the edge of screen then it would have to move faster in the horizontal than in the vertical direction.
There are three things that last forever: Abort, Retry, Fail - and the greatest of these is Fail.

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: Making aspect tracking speed less dependent on screen resolution
So is there no easy way to make 4:3 the baseline and the other ratios behave like it, instead of it being 1:1?
The math is more complicated (i.e. I wouldn't know how to write it), and I'm not sure there's really a massive need for yawing to result in 1-and-a-third times the movement of the tracking gauge as pitching.

Easiest solution would be to limit the starting position of the tracking cursor to a 1024x768 area in the center of the image.

Or 640x480 in the case of FS1 era weapons.

Technically it should be also possible to scale this to any resolution or aspect ratio, but if you want the cursor to appear in the edge of screen then it would have to move faster in the horizontal than in the vertical direction.
The starting position of the tracking cursor is tied to a circular radius around the target's screen position, equal to the weapon's pixels-per-second multiplied by the weapon's minimum lock time. There's an exception for if the target's screen position is >= that distance from the center of the clipping area; in that case, it just uses that location as the starting location. This is no doubt the cause for the different lock times in Italianmoose's earlier test; if the target were dead-center in middle of the screen, I think the tracking times should be identical regardless of resolution.
Ph'nglui mglw'nafh Codethulhu GitHub wgah'nagl fhtagn.

schrödinbug (noun) - a bug that manifests itself in running software after a programmer notices that the code should never have worked in the first place.

When you gaze long into BMPMAN, BMPMAN also gazes into you.

"I am one of the best FREDders on Earth" -General Battuta

<Aesaar> literary criticism is vladimir putin

<MageKing17> "There's probably a reason the code is the way it is" is a very dangerous line of thought. :P
<MageKing17> Because the "reason" often turns out to be "nobody noticed it was wrong".
(the very next day)
<MageKing17> this ****ing code did it to me again
<MageKing17> "That doesn't really make sense to me, but I'll assume it was being done for a reason."
<MageKing17> **** ME
<MageKing17> THE REASON IS PEOPLE ARE STUPID
<MageKing17> ESPECIALLY ME

<MageKing17> God damn, I do not understand how this is breaking.
<MageKing17> Everything points to "this should work fine", and yet it's clearly not working.
<MjnMixael> 2 hours later... "God damn, how did this ever work at all?!"
(...)
<MageKing17> so
<MageKing17> more than two hours
<MageKing17> but once again we have reached the inevitable conclusion
<MageKing17> How did this code ever work in the first place!?

<@The_E> Welcome to OpenGL, where standards compliance is optional, and error reporting inconsistent

<MageKing17> It was all working perfectly until I actually tried it on an actual mission.

<IronWorks> I am useful for FSO stuff again. This is a red-letter day!
* z64555 erases "Thursday" and rewrites it in red ink

<MageKing17> TIL the entire homing code is held up by shoestrings and duct tape, basically.

 

Offline Yarn

  • 210
Re: Making aspect tracking speed less dependent on screen resolution
I made a test mission (link is at the end of this post) to see whether there's really a difference in lock time between 640x480 and 1024x768 and whether retail worked differently. I also tested 1366x768 as well as MageKing17's patch. Here are my results, using my phone's stopwatch:

Retail 640x480
3.09
3.09
3.07
3.06
3.13

Retail 1024x768
5.00
4.89
4.87
4.92
4.89

FSO r11242 640x480
2.30
2.31
2.29
2.27
2.29

FSO r11242 1024x768
3.64
3.63
3.66
3.64
3.70

FSO r11242, 1366x768
4.87
4.88
4.90
4.84
4.92

FSO r11242 w/ MageKing17's patch, 640x480
1.94
1.95
1.99
2.03
1.98

FSO r11242 w/ MageKing17's patch, 1024x768
2.73
2.75
2.72
2.79
2.80

FSO r11242 w/ MageKing17's patch, 1366x768
2.72
2.80
2.75
2.78
2.70


Here's what I notice from the results:
  • In both retail and FSO, lock time is about 1.58 times faster in 640x480 than in 1024x768.
  • Lock time in FSO is about 1.34 times faster than in retail.
  • MageKing17's patch does indeed make aspect ratio have no effect on lock time, but it does make lock time in 4:3 resolutions about 1.17 times faster than FSO r11242.

If you ask me, I would try to match the retail 640x480 times. Why? Because it's probably how FS1 worked, and I doubt that the developers of FS2 would deliberately slow down the lock times in the code rather than the tables.


Here is the mission that I used: https://dl.dropboxusercontent.com/u/89353583/FreeSpace/LockTest.zip
« Last Edit: April 19, 2015, 12:03:24 am by Yarn »
"Your fighter is running out of oil.  Please check under the hood and add more if necessary"
--strings.tbl, entry 177

"Freespace is very tired.  It is shutting down to get some rest."
--strings.tbl, entry 178

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: Making aspect tracking speed less dependent on screen resolution
how did we screw up the 640x480 lock time compared to retail?
Fate of the Galaxy - Now Hiring!  Apply within | Diaspora | SCP Home | Collada Importer for PCS2
Karajorma's 'How to report bugs' | Mantis
#freespace | #scp-swc | #diaspora | #SCP | #hard-light on EsperNet

"You may not sell or otherwise commercially exploit the source or things you created based on the source." -- Excerpt from FSO license, for reference

Nuclear1:  Jesus Christ zack you're a little too hamyurger for HLP right now...
iamzack:  i dont have hamynerge i just want ptatoc hips D:
redsniper:  Platonic hips?!
iamzack:  lays

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: Making aspect tracking speed less dependent on screen resolution
I'm guessing that resolutions only gradually became larger so we just assumed we were getting old. :p
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]