Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Yarn on March 01, 2015, 02:06:07 pm

Title: [patch] Fix for triple-monitor setups (committed 20150618)
Post by: Yarn on March 01, 2015, 02:06:07 pm
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 (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 (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.
Title: Re: [patch] Fix for triple-monitor setups
Post by: Italianmoose on March 10, 2015, 01:34:15 pm
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
Title: Re: [patch] Fix for triple-monitor setups
Post by: Yarn on March 10, 2015, 03:18:09 pm
It works fine for me. Are you entering it like this, including the initial hyphen?
Code: [Select]
-center_res 1920x1200
Title: Re: [patch] Fix for triple-monitor setups
Post by: Italianmoose on March 10, 2015, 06:19:03 pm
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:
Title: Re: [patch] Fix for triple-monitor setups
Post by: Nightstorm on March 14, 2015, 10:18:59 am
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.
Title: Re: [patch] Fix for triple-monitor setups
Post by: AdmiralRalwood on March 14, 2015, 01:26:06 pm
The Babylon Project does not appear to like anything older than 3.7.0
This build is much newer than 3.7.0... :wtf:
Title: Re: [patch] Fix for triple-monitor setups
Post by: Yarn on March 14, 2015, 02:00:28 pm
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 (http://www.hard-light.net/forums/index.php?board=173.0) and see whether it works there.
Title: Re: [patch] Fix for triple-monitor setups
Post by: Nightstorm on March 14, 2015, 06:05:15 pm
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.
Title: Re: [patch] Fix for triple-monitor setups
Post by: Nightstorm on March 14, 2015, 06:18:41 pm
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 (http://www.hard-light.net/forums/index.php?board=173.0) 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.
Title: Re: [patch] Fix for triple-monitor setups
Post by: Yarn on March 14, 2015, 07:10:05 pm
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.
Title: Re: [patch] Fix for triple-monitor setups
Post by: Nightstorm on March 14, 2015, 07:49:33 pm
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.

Title: Re: [patch] Fix for triple-monitor setups
Post by: Yarn on March 14, 2015, 08:08:51 pm
Does DRADIS work properly in the latest nightly? If it doesn't, then the problem is not caused by my patch.
Title: Re: [patch] Fix for triple-monitor setups
Post by: Nightstorm on March 14, 2015, 08:10:17 pm
Yes, the DRADIS does work properly in r11278.
Title: Re: [patch] Fix for triple-monitor setups
Post by: Yarn on March 14, 2015, 10:49:39 pm
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.
Title: Re: [patch] Fix for triple-monitor setups
Post by: Nightstorm on March 15, 2015, 01:03:32 am
 :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?
Title: Re: [patch] Fix for triple-monitor setups
Post by: AdmiralRalwood on March 15, 2015, 03:06:08 am
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.
Title: Re: [patch] Fix for triple-monitor setups
Post by: totiselles on March 15, 2015, 03:54:09 am
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
Title: Re: [patch] Fix for triple-monitor setups
Post by: Nightstorm on March 15, 2015, 09:28:36 am
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
Title: Re: [patch] Fix for triple-monitor setups
Post by: Nightstorm on March 15, 2015, 09:35:10 am
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
Title: Re: [patch] Fix for triple-monitor setups
Post by: chief1983 on March 16, 2015, 09:27:47 am
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.
Title: Re: [patch] Fix for triple-monitor setups
Post by: Nightstorm on March 16, 2015, 10:54:35 am
Yes I think it is the latest Zath patch.  It works with 3.7.0 but any of the newer builds and it just throws all kinds of errors.

*Confirmed that it's version 2.8 of the Zatharus patch.* The initial errors it throws are all related the weapons.tbl.  Once into the game there's a message about some 42 errors or warnings ect.

I was able to start up a mission and play.  The HUD and video/interface are all centered as this patch intends.  I don't know how stable it will be but it does work.
Title: Re: [patch] Fix for triple-monitor setups
Post by: Nightstorm on March 16, 2015, 05:48:44 pm
Update:

Ok, based on the errors it was generating, I extracted the weapons.tbl file from the Zatharus.vp and located the following section:

;---WEAPONS TO KEEP MULTIPLAYER HAPPY---

; Nothing - a non-missle to fulfill the ships must carry missiles multiplayer requirement

$Name:               Nothing
+Title:               XSTR("Nothing", -1)
+Description:            XSTR("Use this when no other secondaries", -1)
$end_multi_text
+Tech Title:            XSTR("Nothing", -1)
+Tech Anim:            none
+Tech Description:         XSTR("Use this when no other secondaries", -1)
$end_multi_text
$Tech Model:            nothing_tech.pof
$Model File:            nothing.pof
$Mass:               0.0
$Velocity:            0.0
$Fire Wait:            0.0
$Damage:            0
$Blast Force:            0.0
$Inner Radius:            0.0
$Outer Radius:            0.0
$Shockwave Speed:         0
$Armor Factor:            0.0
$Shield Factor:            0.0
$Subsystem Factor:         0.0
$Lifetime:            0.0
$Energy Consumed:         0.0
$Cargo Size:            1.0
$Homing:            NO
$LaunchSnd:            -1
$ImpactSnd:            -1
$FlyBySnd:            -1
$Rearm Rate:            999999.0
+Weapon Range:            0
$Flags:               ( "player allowed" )
$Trail:
   +Start Width:         0.0
   +End Width:         0.0
   +Start Alpha:         0.0
   +End Alpha:         0.0
   +Max Life:         0.0
$Icon:               iconTempest
$Anim:               Tempest
$Impact Explosion Radius:      0.0

The errors began at the last three lines and continued into the next two lines of EA Nemeis LG and it's tech model:

$Name:               EA Nemesis LG
$Tech Model:            nemesis2t.pof


After clicking "ok" to the five errors the game plays the intor movie.  When you finish the movie you get a warning message about 31 warning or errors being generated.

The error indicated it was looking for a +Bitmap line.  I copied the line:     +Bitmap:         ParticleSmoke01
from the entry above the Tempest and placed it above the $Icon: iconTempest line.

That seems to have resolved all errors.  No warning message nada.  It just starts and runs now.
Title: Re: [patch] Fix for triple-monitor setups
Post by: totiselles on March 18, 2015, 04:25:49 pm
Hi all from Spain

How can I get bigger hud elements? Any idea?

Ty in advance
Title: Re: [patch] Fix for triple-monitor setups
Post by: niffiwan on March 18, 2015, 04:36:31 pm
Have a look at my signature (MediaVPs 2014: Bigger HUD gauges)
Title: Re: [patch] Fix for triple-monitor setups
Post by: totiselles on March 19, 2015, 09:42:13 am
Works great

Thank you
Title: Re: [patch] Fix for triple-monitor setups
Post by: snake60 on March 20, 2015, 12:41:13 pm
I was tired of waiting for my graphic card so I made a quick test on only two screens to simulate if the central part would take only 1280x1024.

It works perfectly ! Thanks a lot Yarn !  :) :yes:

edit : just to be clear, I've used the "-center_res 1280x1024" command line for this test, I'll redo it properly with 3 monitors when possible

[attachment deleted by nobody]
Title: Re: [patch] Fix for triple-monitor setups
Post by: totiselles on March 22, 2015, 05:10:27 pm
Hi

Sinth voice in tech room not working
Its normal?
Title: Re: [patch] Fix for triple-monitor setups
Post by: niffiwan on March 22, 2015, 05:18:40 pm
Yes, I believe that the synthetic voice code is usually only enabled in major releases & RC builds.
Title: Re: [patch] Fix for triple-monitor setups
Post by: snake60 on April 24, 2015, 05:09:00 pm
Tested properly with 3 monitors this time. It works perfectly, even without the "-center_res 1280x1024" flag.
I still prefer to use it though, because this way I can make the center screen the perfect size I need (with the flag, the center part is approximately 1200 large I would say).
Again, thanks fot that.
Do you know when this patch will be included in release ? Just tested 3.7.2 and it's not in (I assumed so, so no surprise here). I've not tested the nightly builds, is it included into them ?
Title: Re: [patch] Fix for triple-monitor setups
Post by: AdmiralRalwood on April 24, 2015, 06:14:31 pm
Tested properly with 3 monitors this time. It works perfectly, even without the "-center_res 1280x1024" flag.
I still prefer to use it though, because this way I can make the center screen the perfect size I need (with the flag, the center part is approximately 1200 large I would say).
Again, thanks fot that.
Do you know when this patch will be included in release ? Just tested 3.7.2 and it's not in (I assumed so, so no surprise here). I've not tested the nightly builds, is it included into them ?
No, it isn't in the Nightly builds yet. If you need an up-to-date build with this patch applied, I can compile one for you.
Title: Re: [patch] Fix for triple-monitor setups
Post by: snake60 on April 24, 2015, 07:41:58 pm
No, it isn't in the Nightly builds yet. If you need an up-to-date build with this patch applied, I can compile one for you.

Would be great !  :)

Just a 3.7.2 Final windows version with this patch included would be perfect !
Only the normal one is sufficient, I don't need the SSE or no-SSE version (unless other people here need it)
Title: Re: [patch] Fix for triple-monitor setups
Post by: Yarn on April 24, 2015, 07:44:00 pm
The patch and builds have been updated to r11328.
Title: Re: [patch] Fix for triple-monitor setups
Post by: snake60 on April 24, 2015, 07:47:37 pm
You're too fast !  :lol:

Testing now ! (I seem to remember I add a strange problem with engine trail in the first build)
Title: Re: [patch] Fix for triple-monitor setups
Post by: snake60 on April 24, 2015, 08:04:43 pm
Cookies for you  :D (plenty ^^)

Thanks a lot, again  <3


Edit : if you need some specific test on this kind of setup, tell me, I will gladly help :) (I was just reading the notes in the mantis ticket n°0003140 concerning the aspect lock problem, that's why)

[attachment deleted by nobody]
Title: Re: [patch] Fix for triple-monitor setups
Post by: chief1983 on June 19, 2015, 10:20:55 am
This has finally been committed, and is in today's round of nightlies.
Title: Re: [patch] Fix for triple-monitor setups (committed 20150618)
Post by: snake60 on June 20, 2015, 11:25:21 am
Yeah baby, yeah ! \o/
Title: Re: [patch] Fix for triple-monitor setups (committed 20150618)
Post by: Yarn on June 23, 2015, 11:38:22 pm
I posted a Mantis report regarding the offscreen indicator:

http://scp.indiegames.us/mantis/view.php?id=3167 (http://scp.indiegames.us/mantis/view.php?id=3167)