Jump to content

george interface with 3 monitors


yeldraw1

Recommended Posts

I just noticed you use the variables, padding and offsetX , but I neglected to add them because I was focussed on the ' highliughted lines' I saw early in this thread. When I included the entire fix in your post from Friday at 9:47, it works. Please forgive my sloppiness. This is what I now seeScreen_220328_212622.jpg

 

Screen_220328_212612.jpg

4930K @ 4.5, 32g ram, TitanPascal

Link to comment
Share on other sites

yup, their code does not work with my monitor config.

 

ED says:

	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 + control_pos_offset[1], -0.75 + control_pos_offset[2]}
			compass_pos = {-0.82 * aspect + control_pos_offset[1], -0.7 + control_pos_offset[2] * 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

but for me this is needed:

    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

 

4930K @ 4.5, 32g ram, TitanPascal

Link to comment
Share on other sites

2 hours ago, Bluegrass said:

I still cant figure mine out, completely off screen somewhere.  Monitors 1 and 3 are the only ones in use by DCS.

8720a528f8b36ac0834d6a567cfeefc6.pngb6b0901af3a07672d217b35710409ff4.png

 

Same for me Bluegrass. My George interfaces are nowhere to be found now. At least before I had the George pilot interface when in the CPG seat. Don't even have that now.

Link to comment
Share on other sites

Hi MatveyTsivinyuk

Curious why the Pilot (seat 1) has the George controller on the right hand side, where it conflicts with the Kneeboard?

The CPG (seat 2) has it on the left hand side which seems to be the best position?

Why don't both seats have the George controller in the same position?

Thanks

Pimax Crystal VR & Simpit User | Ryzen CPU & Nvidia RTX GPU | Some of my mods

Link to comment
Share on other sites

3 hours ago, DanDegen said:

Hi MatveyTsivinyuk

Curious why the Pilot (seat 1) has the George controller on the right hand side, where it conflicts with the Kneeboard?

The CPG (seat 2) has it on the left hand side which seems to be the best position?

Why don't both seats have the George controller in the same position?

Thanks

On the left , there is Target List.

  • Like 2

MSI Z97 Gaming 5 - Intel I7 4790K - Artic cooling freezer 7 pro rev 2 - GSKILL 32 Go - SSD Crucial M5 120 go - SSD Crucial 2To - HDD western digital caviar blue 1 TO - Gigabyte GTX 1070 Gaming G1 - Windows 10 home 64 bits

Link to comment
Share on other sites

1 hour ago, clanitho said:

On the left , there is Target List.

Thanks, I didn't actually know because mine is overlayed over the top of the George control after I moved it. I thought that's how it came 😂 actually looks OK because it's transparent.

I might try and offset a bit though now, I have an ultrawide anyway.


Edited by DanDegen

Pimax Crystal VR & Simpit User | Ryzen CPU & Nvidia RTX GPU | Some of my mods

Link to comment
Share on other sites

@Asto My sincere gratitude to you for sorting this out. 

I have a vertical setup, so was worried that it wouldn't work, but I copied your code and it works! haven't manged to see if the target list will work, but optimistic.

 

I was worried as I am using display tables in my monitor config file, which i havent seen many people use.

 

cheers again, great stuff!!!!

Link to comment
Share on other sites

 @AstoHi,

Thanks for your work on that code. I copy pasted the code that you posted March 26, but I still have the issue with it. I can see the George GUI as Pilot, but it's not on the right spot. 

In CPG I can't see it at all. 

There is my setup :

Sans titre.png

Ingame with George UI summoned 

1.png

2.png

Any idea? 


Edited by Wawar
Link to comment
Share on other sites

vor 5 Stunden schrieb Wawar:

 @AstoHi,

Thanks for your work on that code. I copy pasted the code that you posted March 26, but I still have the issue with it. I can see the George GUI as Pilot, but it's not on the right spot. 

In CPG I can't see it at all. 
Any idea? 

 

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?

vor 10 Stunden schrieb SparrowHawk003:

@Asto My sincere gratitude to you for sorting this out. 

I have a vertical setup, so was worried that it wouldn't work, but I copied your code and it works! haven't manged to see if the target list will work, but optimistic.

 

I was worried as I am using display tables in my monitor config file, which i havent seen many people use.

 

cheers again, great stuff!!!!

Thanks for giving it a try and that it works for you ❤️

But it seems that this only works for horizontal or vertical setups, but not mixed ones 😞

The target list should spawn on the left location, the overlay you see when you are the gunner. So that should be fine, too


Edited by Asto
Link to comment
Share on other sites

My monitor setup is two 1920x1080 monitors side by side with the main monitor on the left and the aspect ratio is 16/9.  See attached monitor config file.

RO_AH64D PLT.lua

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 5 Stunden schrieb sobe:

My monitor setup is two 1920x1080 monitors side by side with the main monitor on the left and the aspect ratio is 16/9.  See attached monitor config file.

RO_AH64D PLT.lua 739 B · 2 Downloads

Hmm looks good to me. Did you already try the newest version of my fix? That should work for that layout 🤔

Are those overlays visible anywhere, if you create a screenshot?

What are your resolution and aspect ratio settings in the DCS options?

 


Edited by Asto
Link to comment
Share on other sites

I have the latest patch.  The George overlay is fine in  the cpg seat and is located on the bottom left of the first monitor.   But in the pilot seat George is located on the bottom right of the second monitor.   In game the resolution is 3840x1080.  Screen shot in the morning. 

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

On 3/25/2022 at 9:47 PM, 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

But I didn't test it with monitor setups where the center viewport is in the middle or other special setups. I bet this is even far from perfect, but could work for the most setups for now. 😞

@MatveyTsivinyuk you (ED) have some serious issues there regarding the positioning of UI elements, as it seems. The behaviour is totally counterintuitive. You should always place those UI elements based on the center of the main / center-view and not based on the total center of the selected resolution when you support multi-monitor setups. This makes it way too complicated and explains why it is broken so often and why the kneeboard spawns on the MPDs etc... That makes no sense, at least to me.

The other weird thing is the grid you guys & girls have created there:

  • The center is [0, 0]
  • The y-axis always reaches from [0, 1] (top) to [0, -1] (bottom)
  • And now the x-axis behaves really weird: Its from [-total_aspect_ratio, 0] to [total_aspect_ratio, 0]
    This creates multiple problems when positioning UI elements:
    • When I'm using a total resolution of 4240x1440 (MPDs horizontal), the total_aspect_ratio is about 2.94
    • When using a total resolution of 3440x2040 (MPDs vertical), the total aspect_ratio is about 1.69
    • The consequence: Every used relative value behaves totally different for each total resolution. You've used 0.8 and 0.82 as an example, but that is always another position on the screen. And when applying proper offsets. That's why I had to add math.min(), because normally the aspect ratio of the center view would in both cases be the same. But using the total_aspect_ratios makes this weird.

Another hint from one software dev to another: I would recommend structuring the code in smaller pieces / objects and functions as far as LUA can handle it. This makes it easier to maintain and understand. And you could use automatic tools to clean your files from trailing whitespaces, since they are "useless". Even most IDEs should support that, maybe even with an .editorconfig file for the entire team 🙂

If this works, you owe me a beer 😉 

@Deezle If this still doesn't work for you, could you send me screenshots where those elements are placed, if visible?

Screen_220326_021442-min.jpeg

Screen_220326_021243-min.jpeg

Screen_220326_021240-min.jpeg

Screen_220326_021445-min.jpeg

 

Thanks VERY much for this.  Pretty much just a plug and play in the code for me.  


Edited by StandingCow
  • Like 1

5900X - 32 GB 3600 RAM - 1080TI

My Twitch Channel

~Moo

Link to comment
Share on other sites

vor 3 Stunden schrieb Calwpower:

so I've been working on the Lua for a long time and found a solution for me.

for OvGME I also have files like PrestonAI_page_common
and screenshot.

Now everything is displayed on the main monitor and works with Helios

 

 

 

 

Thanks for your update. Could you give the new solution a try?

Does this work for you too? I would guess not, since you have two monitors below your primary one, but I am curious 🙂

Link to comment
Share on other sites

I've looked into this a bit more but can't find a universal solution. My last fix should work for most setups with a similar screen besides or below the main screen (note it's not in the last patch, you have to update the code on your own). But all other more complex layouts need another solution.

I've thought of adding a possibility to the monitor setup lua file to overwrite the position of the George AI compass and weapon controls, but couldn't get it working. Something like

GEORGE_AI_COMPASS =
{
     xOffset = -0.82;
     yOffset = -0.7;
};

GEORGE_AI_WEAPON_CONTROL =
{
     xOffset = 0.85;
     yOffset = -0.75;
}

So people using a monitor setup file could place it where they want, if the default (my newest solution) doesn't work. Maybe this is even a solution for the VR users that aren't happy with their default location of the elements. Seems to be the best compromise for everyone.

What are your thoughts on this? @MatveyTsivinyuk @BIGNEWY

The best solution would be, in my opinion, and maybe additionally, placing those elements based on the center of the main / center view and not of the total view, as I've stated before. But I can't find that code, maybe it's inside the engine itself.

(And the same for the Petrovich UI, I don't own that module, so I can't test that)


Edited by Asto
Link to comment
Share on other sites

I have tried various numbers and most of the time, nothing moves.  I am running two 1920x1080 monitors side by side.  In the game, under options>system, the resolution is 3840x1080 and the aspect ration is 3.55..

The attached screenshot shows George in the lower right of monitor #2(IT MAY BE HARD TO SEE BUT GEORGE IS IN YELLOW A FEW INCHES FROM THE RIGHT LOWER CORNER OF SCREEN #2) and I would like it to be somewhere in monitor #1 (the left monitor) preferably, in the lower right corner of monitor #1.   When in the CPG seat, George is located in the lower left of screen #1 and it is fine.  I am running the latest patch.

George.png


Edited by sobe

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 17 Minuten schrieb sobe:

I have tried various numbers and most of the time, nothing moves.  I am running two 1920x1080 monitors side by side.  In the game, under options>system, the resolution is 3840x1080 and the aspect ration is 3.55..

The attached screenshot shows George in the lower right of monitor #2(IT MAY BE HARD TO SEE BUT GEORGE IS IN YELLOW A FEW INCHES FROM THE RIGHT LOWER CORNER OF SCREEN #2) and I would like it to be somewhere in monitor #1 (the left monitor) preferably, in the lower right corner of monitor #1.   When in the CPG seat, George is located in the lower left of screen #1 and it is fine.  I am running the latest patch.

I see. But what do you mean with "latest patch"? The official DCS patch or my updated code posted here?

Link to comment
Share on other sites

I thought DCS just adopted your updated code.  Will try your code.

 

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

Just tried your change and George is still in the lower right of the second monitor.

 

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

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...