Author Topic: [patch] Fix for triple-monitor setups (committed 20150618)  (Read 10716 times)

0 Members and 1 Guest are viewing this topic.

Offline Yarn

  • 210
[patch] Fix for triple-monitor setups (committed 20150618)
Anyone who uses a triple-monitor setup with FreeSpace 2 knows that a number of problems arise with such a setup, such as the HUD being spread out too much. I tried to fix it myself and managed to make a patch that's almost complete. Here it is, along with some builds:

(All files here are based on trunk revision 11328 [April 22, 2015].)
Patch: https://dl.dropboxusercontent.com/u/89353583/FreeSpace/Patches/multimonitor_fix.patch
Windows builds: https://dl.dropboxusercontent.com/u/89353583/FreeSpace/Patches/multimonitor_fix_build.zip

With this patch, menus, HUDs, and movies will normally be allowed to utilize the whole screen as before. However, if the aspect ratio is greater than 7:2, then a triple-monitor setup is assumed, in which case only the middle 3/10 of the screen width will normally be used for important stuff. (Why 3/10 and not 1/3? Because triple-monitor setups typically use bezel correction, which usually causes the center monitor to display less than 1/3 of the full width.) If you want to override this behavior (for example, to make things fit the center monitor better), use the -center_res command-line parameter followed by the resolution of your center monitor (e.g., 1600x900).

When trying this out, make sure that you aren't using any HUD tables that are designed for triple-monitor setups, as using such tables can cause the HUD to be very tiny or horribly disorted.

This patch does not affect Lua graphics, but it does provide four new Lua functions: getCenterWidth and getCenterHeight for the dimensions of the center monitor, and getCenterOffsetX and getCenterOffsetY for the offset of the center monitor. Because the "center" monitor is not guaranteed to always be in the center, always use getCenterOffsetX and getCenterOffsetY to get the offsets rather than calculating them yourself.

One thing that still has to be done is getting the offscreen indicator to stay on the center monitor. I haven't yet figured out how to do that, but I think it should be done before this patch is committed.
« Last Edit: June 19, 2015, 11:11:40 am by chief1983 »
"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

 
Re: [patch] Fix for triple-monitor setups
Works a treat with the 2014 mediaVPs, although I can't get the center_res command line to work. (That might just be me though :doubt: )

EDIT: Running at 5760x1200 on Ubuntu 14.10
« Last Edit: March 10, 2015, 03:08:45 pm by Italianmoose »

 

Offline Yarn

  • 210
Re: [patch] Fix for triple-monitor setups
It works fine for me. Are you entering it like this, including the initial hyphen?
Code: [Select]
-center_res 1920x1200
"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

 
Re: [patch] Fix for triple-monitor setups
Facepalm, didn't click that it's asking for the resolution of the central monitor...

Ok, that works fine as well. Colour me very thankful, this will make my life so much easier!  :yes:

 
Re: [patch] Fix for triple-monitor setups
Good day,

This is a great project :)  To be able to eliminate the need for custom tables and such would be awesome.  I've done some basic testing with a few mods and thought you might like to know what I've found.

General Freespace2 open mods it seems to work well.
The Babylon Project does not appear to like anything older than 3.7.0
In Diaspora it causes the rendered DRADIS displays to not function.

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: [patch] Fix for triple-monitor setups
The Babylon Project does not appear to like anything older than 3.7.0
This build is much newer than 3.7.0... :wtf:
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: [patch] Fix for triple-monitor setups
In Diaspora it causes the rendered DRADIS displays to not function.
It looks like there was a change to the DRADIS parsing code since I originally posted the builds, so I uploaded new ones that incorporate this change. See if they fix this problem. If not, then try the most recent nightly build and see whether it works there.
« Last Edit: March 14, 2015, 02:18:38 pm 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

 
Re: [patch] Fix for triple-monitor setups
The Babylon Project does not appear to like anything older than 3.7.0
This build is much newer than 3.7.0... :wtf:

Typo, I meant newer than 3.7.0.  TBP doesn't like anything newer than 3.7.0 it seems.

 
Re: [patch] Fix for triple-monitor setups
In Diaspora it causes the rendered DRADIS displays to not function.
It looks like there was a change to the DRADIS parsing code since I originally posted the builds, so I uploaded new ones that incorporate this change. See if they fix this problem. If not, then try the most recent nightly build and see whether it works there.

I tested the new download and the latest Windows Nightly r11278.  The HUD is centered in both but DRAIDIS is still not rendered.

 

Offline Yarn

  • 210
Re: [patch] Fix for triple-monitor setups
I tested the new download and the latest Windows Nightly r11278.  The HUD is centered in both but DRAIDIS is still not rendered.
Wait, so the nightly build also keeps all the HUD gauges on the center montior? That shouldn't happen unless you're using a custom HUD table that's designed for triple-monitor setups.

Using Diaspora, can you post a screenshot from my build, another from the latest nightly, and yet another from the standard Diaspora build? While making the screenshots, do not use any special table files, and do not change the resolution. This should help me understand what you're seeing.
"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

 
Re: [patch] Fix for triple-monitor setups
Sorry if I was unclear I meant that in both of your releases the HUD was centered without a custom table. :)

Ok...with r11278 and no custom hud table the HUD is NOT centered.  It's spanned across the full 5760x1200.

With your updated build and no custom hud table the HUD is centered but the DRAIDIS is not rendered to cockpit model.


 

Offline Yarn

  • 210
Re: [patch] Fix for triple-monitor setups
Does DRADIS work properly in the latest nightly? If it doesn't, then the problem is not caused by my patch.
"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

 
Re: [patch] Fix for triple-monitor setups
Yes, the DRADIS does work properly in r11278.

 

Offline Yarn

  • 210
Re: [patch] Fix for triple-monitor setups
I think I found the problem: The adjustments that are made to HUD gauges when a multimonitor setup is in use were also being applied to gauges that are rendered to cockpit textures (such as the DRADIS radar, at least in the first mission). I updated the patch and builds to fix this.
"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

 
Re: [patch] Fix for triple-monitor setups
 :yes:

That's got it :D

Thanks!

Works perfectly as intended.  The override flags work great too.  This'll save heaps of time going forward.  No more hud table editing.

I presume this will get committed to a Nightly build at some point in the near future?

 

Offline AdmiralRalwood

  • 211
  • The Cthulhu programmer himself!
    • Skype
    • Steam
    • Twitter
Re: [patch] Fix for triple-monitor setups
I presume this will get committed to a Nightly build at some point in the near future?
One thing that still has to be done is getting the offscreen indicator to stay on the center monitor. I haven't yet figured out how to do that, but I think it should be done before this patch is committed.
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.

 
Re: [patch] Fix for triple-monitor setups
Hello all

how I do apply the patch?

or its included in the executable?

where include the line of res to center hud correctly?

Thank you in advance

 
Re: [patch] Fix for triple-monitor setups
Just drop the exe into your games root folder along with the other exe builds that are already there.  Use WXLauncher and select the name of the new exe file on the "Basic Settings" tab.

On the "Advanced Settings" tab there is a line labeled "custom flags:"  Add the command there "-center_res 1920x1200" adjusting for your center monitors actual resolution.  The point of that extra command is to remove the bezel correction from the center monitor yet still keep the hud centered.

From my testing, I'm running at 5760x1200 with no bezel correction, without that command line parameter its all on the center display but things are squished inward a little which is exactly what the patch intended.  He had said that it would use 30% of the center display and not 33%.  When I add that parameter it looks EXACTLY like it did with my custom hud gauge table.  Everything is on the center monitor and at the extents of it's four corners.

The off screen target indicator he mentioned worked the same with a custom hud table too.  It was always visible anywhere on the three screens.  Having it isolated to just the center display would be cool.

Hope this helps.... :D

 
Re: [patch] Fix for triple-monitor setups
Oh, and I just wanted to take a second to thank all of you folks that do this kind of coding and bug fixing just to improve the game engine and it's capabilities.  I've been a long time sci-fi fan and space flight sim junkie.  Ever since the early days of X-Wing and Wing Commander.

Having a game based off of Battlestar Galactica, Wing Commander, Babylon 5, and Star Wars that can run on modern equipment with modern effects is fantastic.  Not to mention all of the other mods for Freespace 2 that well, I didn't mention heh.

This is all great :D

 

Offline chief1983

  • Still lacks a custom title
  • Moderator
  • 212
  • ⬇️⬆️⬅️⬅️🅰➡️⬇️
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • Fate of the Galaxy
Re: [patch] Fix for triple-monitor setups
Nightstorm, are you using TBP with the latest Zathras patch, and still having issues with newer than 3.7.0 builds?  If so I guess we need to get some energy towards another Zathras update, FUBAR might just be waiting for 3.7.2 final to be done though.
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