Jump to content

george interface with 3 monitors


yeldraw1

Recommended Posts

Weird. But well, I guess ED has to find a proper solution. Maybe letting us define the location like proposed here

You should be able to create a workaround. 

In the line

weap_control_pos = { math.min(total_aspect, aspect) + offsetX - padding, -1 + offsetY * 2 + padding }

change the expression "math.min(total_aspect, aspect) + offsetX - padding" to another value. 0 should place the right element in the middle of your screens. Try -0.5 or sth. else 🙂

weap_control_pos = { -0.5, -1 + offsetY * 2 + padding }

 


Edited by Asto
Link to comment
Share on other sites

Tried both 0 and -0.5 and nothing moved.

--viewports stuff    
    local v = find_viewport("GU_MAIN_VIEWPORT", "CENTER")
    if v ~= nil then
        if v.width ~= total_w or v.height ~= total_h then
            ULX = v.x
            ULY = v.y
            SZX = v.width
            SZY = v.height
            local aspect = SZX/SZY

            local offsetX = (ULX + SZX / 2 - total_w / 2) / total_w * total_aspect * 2
            local offsetY = -(ULY + SZY / 2 - total_h / 2) / total_h * 2
            local padding = math.min(total_aspect, aspect) * 0.2
            compass_pos = { -math.min(total_aspect, aspect) + offsetX + padding, -1 + offsetY * 2 + padding}
            --weap_control_pos = { math.min(total_aspect, aspect) + offsetX - padding, -1 + offsetY * 2 + padding }
            weap_control_pos = { -0.0, -1 + offsetY * 2 + padding }
            compass_size = compass_size * v.height / total_h
            weap_control_size = weap_control_size * v.height / total_h
        end
    end
    --end viewports stuff

Trackir4 using the latest Trackir 5 software, Win10 Pro [Creator Update] updated from Win7Pro Pro 64Bit, Intel® Core™ i5-2500 3.30 GHz 6M Intel Smart Cache LGA115 , GigaByte GA-Z68XP-UD4 Intel Z68 Chipset DDR3 16GB Ram, GTX MSI Gaming 1060 [6 GB] Video Card, Main Monitor 1 on left 1920x1080 Touchscreen Monitor 2 on right 1920x1080 .

Link to comment
Share on other sites

vor einer Stunde schrieb sobe:

Tried both 0 and -0.5 and nothing moved.

Looks good, but it has to move when editing those values. Are both instruments still at the same position the entire time?

I've noted I have the following lines at the end of my monitor setup file. You are missing the last one, but that should change anything, hmm

UIMainView = Viewports.Center
GU_MAIN_VIEWPORT = Viewports.Center
  • Like 1
Link to comment
Share on other sites

Holy cow that was it.  The missing line did it.  We are very close.  George is half on the first screen and half on the second screen so I need to move him over to the left about 6 or 7 inches.   What changes should I make in the "-0.0" numbers to move george to the left as a starting point?

-1.0 puts George for the pilot just to the right of the right MFD.  Perfect.

thanks for your help.


Edited by sobe
-1.0
  • Like 1

Trackir4 using the latest Trackir 5 software, Win10 Pro [Creator Update] updated from Win7Pro Pro 64Bit, Intel® Core™ i5-2500 3.30 GHz 6M Intel Smart Cache LGA115 , GigaByte GA-Z68XP-UD4 Intel Z68 Chipset DDR3 16GB Ram, GTX MSI Gaming 1060 [6 GB] Video Card, Main Monitor 1 on left 1920x1080 Touchscreen Monitor 2 on right 1920x1080 .

Link to comment
Share on other sites

vor 1 Stunde schrieb Asto:

Looks good, but it has to move when editing those values. Are both instruments still at the same position the entire time?

I've noted I have the following lines at the end of my monitor setup file. You are missing the last one, but that should change anything, hmm

UIMainView = Viewports.Center
GU_MAIN_VIEWPORT = Viewports.Center

omg .... i have a 5 monitor setup and that missing line with GU_MAIN_VIEWPORT helped me !! thank you for that 🥰

  • Like 1
Link to comment
Share on other sites

On 4/1/2022 at 9:39 PM, Asto said:

Can you post your resolution and aspect ratio defined in your DCS options? Also the monitor setup lua could be helpful

Out of curiosity: What's the purpose of the third monitor in DCS?

 

 

@AstoThe third monitor is for the third MFD  IMG_20200410_180734.jpg

There are my specs and my monitorsetup.lua

Sans titre.png

 

Thanks !

 

Samsung Ultra + MFD.lua


Edited by Wawar
Link to comment
Share on other sites

I'm running a two monitor setup. When the Apache launched the George menu was located on my main monitor for both pilots without changing any .lua files. With the recent update my George menus aren't visible on screen. I've tried editing the relevant files as per some suggestions on the forum but so far no luck. Will a future update allow us to reposition George's menu without editing .lua files?

Link to comment
Share on other sites

On 3/26/2022 at 2:47 AM, Asto said:
	--viewports stuff	
	local v = find_viewport("GU_MAIN_VIEWPORT", "CENTER")
	if v ~= nil then
		if v.width ~= total_w or v.height ~= total_h then
			ULX = v.x
			ULY = v.y
			SZX = v.width
			SZY = v.height
			local aspect = SZX/SZY

			local offsetX = (ULX + SZX / 2 - total_w / 2) / total_w * total_aspect * 2
			local offsetY = -(ULY + SZY / 2 - total_h / 2) / total_h * 2
			local padding = math.min(total_aspect, aspect) * 0.2
			compass_pos = { -math.min(total_aspect, aspect) + offsetX + padding, -1 + offsetY * 2 + padding}
			weap_control_pos = { math.min(total_aspect, aspect) + offsetX - padding, -1 + offsetY * 2 + padding }

			compass_size = compass_size * v.height / total_h
			weap_control_size = weap_control_size * v.height / total_h
		end
	end
	--end viewports stuff

 

 


I just wanted to thank you @Asto and confirm that this fix finally works for a 2560x2550 total resolution with my helios profile running on the secondary/second and lower 1920x1080 touch-screen. Below a 2560x1440, windows-primary monitor also correctly setup the way described.

I've told Sobe a couple hours before you that he's missing GU_MAIN_VIEWPORT, but he didn't catch my discord-PM after we briefly looked into this.
Sobe... Sobe... Sobe. Tststs. 😛

Had been manually/fiddling and trying around inside the function and also inside "non-VR only" before. The positioning off center with the X/Y and -1 to 1 grid is clear as well. I could only get things moving when running primary screen only. And IIRC not from directly changing the compass/weap positions from inside the function, but at the "non-VR only". Had suspected some difference potentially between what's called "Additional Viewports" in Helios, and it's (potential) DCS-equivalent. (Possibly) Basically two monitor-setup ways and differences leading through the viewports function, and another one that does not. Maybe also combined vs. "separate" MonitorSetup - In Helios terms. But I wouldn't know, maybe that's just a Helios thing. And has no equivalent in DCS. But ye - Rather hard to "diagnose" with other's descriptions without sight. Or often not seeing the resulting changes/position oneself despite trying. With the second screen covered with the DCS export.


Edited by osram
  • Like 1

 

Link to comment
Share on other sites

@Wawarare you still having trouble seeing the Compass George menu and it not even showing up on your screenshot? I was having the same issue as you, I could see the menu as the pilot but when I was the CP/G, I couldn't see the compass and it never showed up on my screenshots to even begin to troubleshoot where it was. Then I realized that I had only mapped the George/AI button for the pilot and never mapped it for the CP/G. Doh! Not saying that's your issue, but it was why I could never see it on my screenshots...

Link to comment
Share on other sites

vor 52 Minuten schrieb StandingCow:

Hey @Asto you got a shout out from the devs in the file now, that's pretty cool.  This is is implemented in the hotfix.

Yeah but it's still the old code, not the newest one. They didn't update it in the last hotfix 🙂

Link to comment
Share on other sites

@Wawarare you still having trouble seeing the Compass George menu and it not even showing up on your screenshot? I was having the same issue as you, I could see the menu as the pilot but when I was the CP/G, I couldn't see the compass and it never showed up on my screenshots to even begin to troubleshoot where it was. Then I realized that I had only mapped the George/AI button for the pilot and never mapped it for the CP/G. Doh! Not saying that's your issue, but it was why I could never see it on my screenshots...
The binding is correct, it worked before the first Apache hotfix. Now I can't see the George UI in neither seat. If I use the newest @Asto fix, I still can't see the UI from the front and from the back the UI is not on the correct monitor.
Link to comment
Share on other sites

@Wawar your settings don't look too bad either. The only thing I can see is that your aspect ratio in the DCS options could be a little bit off. It should be the same as your center view, so "3.55555556", not the ratio from the total resolution. But that wouldn't make a big difference.

I'm wondering which offset is off. Could you try the following?

weap_control_pos = { math.min(total_aspect, aspect) + offsetX - padding, 0 }

The weapon control should be visible in the center on the y axis. If it's still hidden, try the other way around

weap_control_pos = { 0, -1 + offsetY * 2 + padding }

And the x axis should be in the center of your monitors (total resolution).

By using {0, 0} it should be in the center of the total resolution. You could play with those numbers and place the UI on your own. The y-axis is from 1 to -1 and the x-axis from -aspect_ratio to +aspect_ratio


Edited by Asto
Link to comment
Share on other sites

On 3/26/2022 at 8:47 AM, Asto said:

I've spent a few more hours into this problem... It's really hard to understand what's going on there. The following code should fix it for both of our setups.

The file you need to edit is the following one: *InstallPath*\DCSWorld\Mods\aircraft\AH-64D\Cockpit\Scripts\AI\PrestonAI_page_common.lua
The changes are multiplayer compatible. You have to replace the entire part between "--viewports stuff" and "--end viewports stuff":

	--viewports stuff	
	local v = find_viewport("GU_MAIN_VIEWPORT", "CENTER")
	if v ~= nil then
		if v.width ~= total_w or v.height ~= total_h then
			ULX = v.x
			ULY = v.y
			SZX = v.width
			SZY = v.height
			local aspect = SZX/SZY

			local offsetX = (ULX + SZX / 2 - total_w / 2) / total_w * total_aspect * 2
			local offsetY = -(ULY + SZY / 2 - total_h / 2) / total_h * 2
			local padding = math.min(total_aspect, aspect) * 0.2
			compass_pos = { -math.min(total_aspect, aspect) + offsetX + padding, -1 + offsetY * 2 + padding}
			weap_control_pos = { math.min(total_aspect, aspect) + offsetX - padding, -1 + offsetY * 2 + padding }

			compass_size = compass_size * v.height / total_h
			weap_control_size = weap_control_size * v.height / total_h
		end
	end
	--end viewports stuff

 

 

 

Thanks alot, this really saved me.

  • Like 1
Link to comment
Share on other sites

On 4/7/2022 at 6:48 PM, Asto said:

@Wawar your settings don't look too bad either. The only thing I can see is that your aspect ratio in the DCS options could be a little bit off. It should be the same as your center view, so "3.55555556", not the ratio from the total resolution. But that wouldn't make a big difference.

I'm wondering which offset is off. Could you try the following?

weap_control_pos = { math.min(total_aspect, aspect) + offsetX - padding, 0 }

The weapon control should be visible in the center on the y axis. If it's still hidden, try the other way around

weap_control_pos = { 0, -1 + offsetY * 2 + padding }

And the x axis should be in the center of your monitors (total resolution).

By using {0, 0} it should be in the center of the total resolution. You could play with those numbers and place the UI on your own. The y-axis is from 1 to -1 and the x-axis from -aspect_ratio to +aspect_ratio

 

@AstoThank you for your answer. 

I tried both of your fixes above. With the first, the George UI as Pilot is still on one of my other monitors. George UI as CPG not visible.

With the second one, the George UI as pilot is back on the main screen, but far on the right side. George UI as CPG not visible.

lol.png

If I try to use the UI, the "Unit List" does not appear at all. With George UI as CPG, still not visible neither.

EDIT : If I put the "correct" aspect ratio, so if I don't round the number to 3.56, the picture is "flattened", distorded. I never understood why, I have been running with this setup for a few years. But rounding up to 3.56, the image is no longer "flattened". And that doesn't fix my George UI issue.


Edited by Wawar
Link to comment
Share on other sites

vor 3 Stunden schrieb Wawar:

@AstoThank you for your answer. 

I tried both of your fixes above. With the first, the George UI as Pilot is still on one of my other monitors. George UI as CPG not visible.

With the second one, the George UI as pilot is back on the main screen, but far on the right side. George UI as CPG not visible.

If I try to use the UI, the "Unit List" does not appear at all. With George UI as CPG, still not visible neither.

 

 

The unit list spawns on the left position, where the UI as CPG spawns, as far as I remember. That's why it shouldn't be visible too.

I've calculated the following values for your layout with the current code:

Offsets: X(-1.562500), Y(0.437500), Padding: 0.711111,
Compass: (-4.406944, 0.586111),
Weapons: (1.281944, 0.586111)

Since your x-axis reaches from -3.56 to +3.56, the compass is far too left.

I don't have a fix for the formula for now, since it currently works for most users, but you could tweak your values as a workaround like this:

compass_pos = { -3.0 , -0.5 }
weap_control_pos = { 0.0 , -0.5 }

I guess the problem is calculating everything based on the aspect-ratio and yours is very big for that screen height (ultra ultra wide layout), but that's how it works in DCS for now. I don't have the time to play with the formula right now, but I hope ED has some full time devs looking into it 🙂

I would prefer the additional option to position those elements on our self via monitors layout lua file, as proposed here: https://forum.dcs.world/topic/295236-george-interface-with-3-monitors/?do=findComment&comment=4936161 (April 2nd)

 


Edited by Asto
Link to comment
Share on other sites

Hi Folks,
I have 2 monitors of different sizes and none of this was helping (weapons control was "appearing" on the lower right of the 2nd monitor offscreen (could be seen in tiny alt-tab view)).

Fortunately the compass was always appearing in the right location regardless of the "viewport stuff" code (lower LHS of main monitor) so I edited the lines above the "viewports stuff" to make the compass and weapons control appear in the same place:
Pre Edit
--not for VR!
compass_pos = {-0.82 * total_aspect, -0.7} --relative to screen center, 1 means half screen height ~~afaik~~
weap_control_pos = {0.8 * total_aspect, -0.75}

Edited to
--not for VR!
compass_pos = {-0.82 * total_aspect, -0.7} --relative to screen center, 1 means half screen height ~~afaik~~
weap_control_pos = {-0.82 * total_aspect, -0.7} --relative to screen center, 1 means half screen height ~~afaik~~

This change puts the weapons control in the same LL mainscreen position as the compass and seems to work with the default current code and with the updated "viewports stuff" discussed above.

I'm not entirely sure why this works at all as the "viewports stuff" code block straight after seems to recalculate these variables?
But its working for me and I thought I'd pass it on in case it helps someone else.
Edited by whatever
a word
Link to comment
Share on other sites

The original code didn't scale the offset. This will cause the AI interface to not be displayed correctly in the bottom left/right corner of GU_MAIN_VIEWPORT in some view ports layouts.

For example:

The screen resolution:  2560*2520

image.png

Monitor setup is as follows:

_  = function(p) return p end
name = _('Helios')
description = 'Generated from compatible Helios Profiles'
A_10C_2_CDU_SCREEN = { x = 1222.5, y = 2082.5, width = 221.25, height = 162.5 }
A_10C_2_LEFT_MFCD = { x = 61.25, y = 1583.75, width = 430, height = 430 }
A_10C_2_RIGHT_MFCD = { x = 1425, y = 1583.75, width = 430, height = 430 }
A_10C_2_RWR_SCREEN = { x = 590, y = 1601.25, width = 185, height = 185 }
F_16C_DED = { x = 1212.5, y = 1441.25, width = 316.25, height = 107.5 }
F_16C_EHSI = { x = 858.75, y = 2280, width = 206.25, height = 206.25 }
F_16C_LEFT_MFCD = { x = 282.5, y = 1823.75, width = 375, height = 375 }
F_16C_RIGHT_MFCD = { x = 1278.75, y = 1823.75, width = 375, height = 375 }
F_16C_RWR = { x = 461.25, y = 1515, width = 225, height = 225 }
FA_18C_CENTER_MFCD = { x = 783.75, y = 2131.25, width = 350, height = 350 }
FA_18C_IFEI = { x = 152.5, y = 2193.75, width = 525, height = 205 }
FA_18C_LEFT_MFCD = { x = 287.5, y = 1637.5, width = 375, height = 375 }
FA_18C_RIGHT_MFCD = { x = 1263.75, y = 1637.5, width = 375, height = 375 }
FA_18C_RWR = { x = 1491.25, y = 2160, width = 181.25, height = 181.25 }
FA_18C_UFC = { x = 741.25, y = 1470, width = 456.25, height = 258.75 }
Viewports = {
  Center = {
    x = 0,
    y = 0,
    width = 2560,
    height = 1440,
    aspect = 1.77777777777778,
    dx = 0,
    dy = 0
  }
}
UIMainView = Viewports.Center
GU_MAIN_VIEWPORT = Viewports.Center

===============================================================

The soluation is:

Modify file : DCS World OpenBeta\Mods\aircraft\AH-64D\Cockpit\Scripts\AI\PrestonAI_page_common.lua

--viewports stuff	
	local v = find_viewport("GU_MAIN_VIEWPORT", "CENTER")
	if v ~= nil then
		if v.width ~= total_w or v.height ~= total_h then
			ULX = v.x
			ULY = v.y
			SZX = v.width
			SZY = v.height
			local aspect = SZX/SZY
			-- Thanks Asto (https://forum.dcs.world/profile/127293-asto/)
			local control_pos_offset = {(ULX + SZX / 2 - total_w / 2) / total_w * total_aspect * 2, -(ULY + SZY / 2 - total_h / 2) / total_h * 2}
			weap_control_pos = {0.8 * aspect * (SZY / total_h) + control_pos_offset[1], -0.75 * (SZY / total_h) + control_pos_offset[2]}
			compass_pos = {-0.82 * aspect * (SZY / total_h) + control_pos_offset[1], -0.7 * (SZY / total_h) + control_pos_offset[2]}
			-- Kudos to you (https://forum.dcs.world/topic/295236-george-interface-with-3-monitors/?do=findComment&comment=4922420)
			weap_control_size = weap_control_size * v.height / total_h
			compass_size = compass_size * v.height / total_h
		end
	end
	--end viewports stuff

The key is:

weap_control_pos = {0.8 * aspect * (SZY / total_h) + control_pos_offset[1], -0.75 * (SZY / total_h) + control_pos_offset[2]}
 compass_pos = {-0.82 * aspect * (SZY / total_h) + control_pos_offset[1], -0.7 * (SZY / total_h) + control_pos_offset[2]}

Edited by Fsea
  • Like 1
Link to comment
Share on other sites

Maybe anybody can help me getting the George interface "back".

I´m running a two Monitor-Setup with 2x 2560x1440 resolution. The left monitor is the main-monitor, running the game. The mfds are exported to the left one.
This is my config:
 

_ = function(p) return p; end;
name = _('MySetup');
Description = 'Two monitor configuration';
Viewports = {
Center = {
x = 0;
y = 0;
width = 2560;
height = 1440;
viewDx = 0;
viewDy = 0;
aspect = 2560/1440;
}
}

LEFT_MFCD = {
x = 2560;
y = 60;
width = 850;
height = 850;
}

RIGHT_MFCD = {
x = 3410;
y = 60;
width = 850;
height = 850;
}

CENTER_MFCD = {
x = 4260;
y = 60;
width = 850;
height = 850;
}

UIMainView = Viewports.Center

 

I tried to change the lines, @Fsea mentioned above, but I cant find / see the interface for george.

Thank you in advance.

Link to comment
Share on other sites

The solution you mentioned from @Fsea did the trick for me. 

Were you able to find and edit those lines mentioned in the DCS World OpenBeta\Mods\aircraft\AH-64D\Cockpit\Scripts\AI\PrestonAI_page_common.lua file?

On 4/16/2022 at 3:31 PM, Fsea said:

The key is:

weap_control_pos = {0.8 * aspect * (SZY / total_h) + control_pos_offset[1], -0.75 * (SZY / total_h) + control_pos_offset[2]}
 compass_pos = {-0.82 * aspect * (SZY / total_h) + control_pos_offset[1], -0.7 * (SZY / total_h) + control_pos_offset[2]}

Also, try adding to the end of your monitor config:

GU_MAIN_VIEWPORT = Viewports.Center

Edited by Floyd1212
  • Like 1
Link to comment
Share on other sites

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...