Jump to content

[1.2.2] SideView Alpha 0.9 - Expand your horizon (or crash the game)


sarbian

Recommended Posts

First : This is an early alpha than I want to get out to see how it works on other computer and OS to see if further work is justified. It lacks a lot of planned features and may (will) crash your game. Do not complain here if it crashed your precious save, this is  alpha code.

A couple of weeks ago I was a bit tired of working on the same problems of my old mods. I needed something fresh to work on and I stumbled upon an old note from back in KSP 1.1 that ended with: "Check again when KSP uses Unity 5.4+". As it happens this is the case now so I unearthed that old idea to see where it could go. A few coding session later here is the result (and as I said this is an early alpha).

I am not explaining the mod purpose here for a day or two, see for yourself :) 

To use this mod you need at least 2 monitors. If Unity detects only one it will not work. You may have to run the game in DX11 or OpenGL if both monitor are not on the same resolution and refresh rate. To activate it press the numpad 0 key. To switch the control focus press the same key again.

So I need your feedback to know how it works on your KSP install : 

  • Does it crash the game ? If it does please share your config info (OS; DX9 or DX11 or OpenGL...) & logs
  • When you move the mouse around does the "display id" text (top left of your monitor) ever changes to something other than 0 or is the mouse position negative when your mouse is not on your main screen ? 
  • Comment & Bugs ? (Obviously the mod is not finished)

Download : SideView-0.9.0.0.zip

Licence : MIT

Source

 

Link to comment
Share on other sites

So far, no crashes for me.

I have two screens of different sizes & resolutions. I use borderless window, full screen when I run KSP generally. When I move the mouse offscreen the mouse position data shows the last position when the mouse was on the active KSP screen. I'll test in a different display mode and/or DX11 shortly.

Worked well in DX11 for me, looks cool! I also saw display id 0 all the time, even when actively using the second screen. After a launch to orbit, I could no longer click the buildings around the KSC campus, so that is an annoying glitch. Great behaviour so far though, I'll have to try it out with an RSS/RO launch like Saturn V now. :)

Edited by stratochief66
Link to comment
Share on other sites

Thanks for this feature, @sarbian.

Just did a couple tests, KSP 1.2.2 (1622), first on DX9 then on DX11 mode. I have two monitors, different max resolution (1920x1080 + 1280x1024). After enabling sideview (Numpad 0) KSP switches from window to fullscreen (or rather, borderless windowed mode at full resolution, as I'm able to alt-tab have another window on top), cursor position and monitor ID is shown top-left of the main monitor, the second monitor also switches fullscreen/windowed-fullresolution but is currently completely black apart for the cursor when moved in there.

Moving the cursor around, the correct coordinates are shown; however display id is always shown as 0 with both monitors. Another thing, if I move the cursor while on the second (blank) monitor to the same coordinate it would be over some object in KSP (e.g., buildings in space center) if it was on the first, dialogs appropriate appear over the object; same for left or right-clicks.

No crashes this far.

Link to comment
Share on other sites

I did a quick test with a new install.

My setup: Linux (Ubuntu 15.10), with nvidia driver; 2 screens (2560x1440), with display 0 on the right. By default, I play with fullscreen on (even though fullscreen is not selected in the settings - selecting it does not change anything afterwards anyway).

Works fine, no crash (see end of report though).

When I press 0 on the numpad, a bordered (untitled) window appears on top of the existing window, with a map view (view of Kerbin, but not showing the KSC, rather west of it). I can move the window to the other display, but cannot act on it (the mouse coordinates on the top left corner only change if I stay on the main display, labelled as display 0).

I tried a dummy mission. During the whole mission, the additional window did not display anything useful (just the view of Kerbin, but "from behind").

When I finished the mission, I quit to main menu. Then I couldn't interact with the main window any more. The only thing I could do is to close the second window, which killed the game altogether.

Some relevant excerpts from KSP.log:

Spoiler

[LOG 10:51:37.375] ******* Log Initiated for Kerbal Space Program - 1.2.2.1622 (
LinuxPlayer) *******
Kerbal Space Program - 1.2.2.1622 (LinuxPlayer)


OS: Linux 4.2 Ubuntu 15.10 64bit
CPU: Intel(R) Core(TM) i5-3450 CPU @ 3.10GHz (4)
RAM: 24007
GPU: GeForce GTX 970/PCIe/SSE2 (4096MB)
SM: 30 (OpenGL 4.5 [4.5.0 NVIDIA 364.19])
RT Formats: ARGB32, Depth, ARGBHalf, Shadowmap, RGB565, ARGB4444, ARGB1555, Defa
ult, ARGB2101010, DefaultHDR, ARGBFloat, RGFloat, RGHalf, RFloat, RHalf, R8


(...)

[LOG 10:51:39.212] [AddonLoader]: Instantiating addon 'SideView' from assembly 'SideView'
[LOG 10:51:39.213] [AddonLoader]: Instantiating addon 'KSPSteamController' from assembly 'KSPSteamCtrlr'
[ERR 10:51:39.244] <color=orange><b>[KSPSteamController]:</b> Failed to initialize Steam API!</color>

[LOG 10:51:39.494] Load(Audio): Squad/Sounds/editorLoop01
[LOG 10:51:39.499] [SideView] Found 2 displays

(...)

[LOG 10:56:43.614] [SideView] Display 1 2560x1440 2560x1440
[LOG 10:56:43.614] [SideView] Display Setting Activate
[LOG 10:56:43.846] [SideView] Fixing the launchpad watertower spotlight

(...)

[LOG 11:06:57.981] [HighLogic]: =========================== Scene Change : From SPACECENTER to MAINMENU (Async) =====================
[LOG 11:06:57.981] [UIMasterController]: ShowUI
[LOG 11:06:57.981] Game Unpaused!
[LOG 11:06:58.288] [UIApp] OnDestroy: KSPedia
[LOG 11:06:58.301] [UIMasterController]: HideUI
[LOG 11:06:58.578] [Progress Tracking]: Posted anonymous data to server successfully. Server Reply: KSP PROGRESS DATA OBTAINED
[LOG 11:06:59.713] [UIMasterController]: ShowUI
[LOG 11:07:00.054] [ApplicationLauncher] OnSceneLoadedGUIReady: scene MAINMENU ShouldBeVisible() True ShouldBeOnTop() True iIsPositionedAtTop False
[LOG 11:07:00.054] [ApplicationLauncher] SpawnSimpleLayout: VerticalTopDown

End of log file

Output statements on the terminal from running KSP:

displaymanager : xrandr version warning. 1.4
client has 4 screens
displaymanager screen (0)(DP-0): 2560 x 1440
displaymanager screen (1)(DP-4): 2560 x 1440
Using libudev for joystick management

 

Hope this helps!

Link to comment
Share on other sites

First off, I'm really glad to see this, it is a feature I'd actually wanted to request from Squad for a while but figured they had enough to do already. :)

Observations:

Win10, DX9, x64, 2560x1600 & 1920x1080 displays, -popupwindow
0 key causes game to go fullscreen on both windows
0 key toggles between which window accepts input
Graphical glitch that may have to do with mods where kerbin is blacked out completely
Exiting to the menu disables input for both windows (have to hard-close out)

D3D11, x64, disparate displays
Same as DX9, but circular blackout is shifted vs actual planet, resulting in a crescent appearance.

OpenGL: secondary window doesn't display when hitting 0

I'll test matching 3-wide displays later today if I have time (2560x1600). PM me if you have any specific things to verify with these configs.

Link to comment
Share on other sites

Thanks for the feedback so far. 

I am more or less stuck with the mouse issue since I can not know on which screen the mouse currently is. I did a few test with Unity and it works in 5.5. Now it all depends on the version of Unity in the next KSP.

I will still try to add a few things that could make people happy like the basic components required for mods to display some UI on an other screen, and maybe test with muti monitor space view. But without proper mouse code I don't see what else I could add.

Link to comment
Share on other sites

Yeah, that makes it more complicated. Just being able to display MechJeb (and any other mods that chose to support SideView) windows/telemetry (non-interactive, even) on secondary displays would actually make it worthwhile enough for me to use. Having the 3D view over there is gravy.

Edited by WarrenSchultz
Link to comment
Share on other sites

  • 3 weeks later...

Stupid question, how do I force (or discover which) KSP to use DX11 or OpenGL? My first attempt with this resulted in a black screen on my secondary monitor, coords were detected properly, but Id was always 0. 

Edited by Djohaal
Link to comment
Share on other sites

I was trying with an old 17" CRT display as the secondary monitor, I had pressed "0" while the game was loading and it crashed with a message of

 

Switching to resolution 1920x1080 failed, trying lower one
All resolution switches have failed
Screen: could not switch resolution (1920x1080 fs=0 hz=60)

 

Here's the log file

http://www.mediafire.com/file/4robt6zrwy4nsmc/output_log.7z

Link to comment
Share on other sites

This is really cool! To answer your questions:

1. Works with 2x 1080p monitors, running DX11 on Windows 10

2. Display ID remains 0 at all times. Mouse coords are always positive. This might be due to my setup, where second monitor(1) is on the right of primary(0). I noticed that (0,0) is on the bottom.

It's running fine so far. I'll try to break it :)

*Quitting to main menu, cannot click any options.

Edited by symmeclept
More input!
Link to comment
Share on other sites

  • 2 weeks later...

Hey I'm gonna try this with my chink 3 monitor setup- I have a 1280x1024+1920x1080+1440x900 setup, so that's gonna be a fun time :D Hope it works, that'd be lit. 

 

edit. I tried it; it doesn't crash, but the secondary window that I get is filled with garbage: 

znoi.jpg

I know this is with the texture mods, so I tried on a clean install but to no avail, I still get the garbage and the window doesn't do anything. I'm at work right now, if you need logs please hit me up on IRC PM (aeTIos) and I'll try to debug this with you. Running ArchLinux.

Edited by aeTIos
additional info
Link to comment
Share on other sites

Monitor 1 is 1920x1080 @ 144hz, Monitor 2 and 3 are 1024x1280 @ 60hz.

I'm on windows 7 x64, running 1.2.2 x64 DX9 in windowed 1768x992 which when activated changes to windowed fullscreen.

If I activate it while loading/in menu monitor 3 turns black and it tracks the cursor but if I activate it or try to load a vessel in flight the game locks up.

Unfortunately, ksp doesn't generate a crash log.

Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...
  • 1 year later...
41 minutes ago, Rime Pendragon said:

So.. did this experiment ever lead to anything functional ? I would really like to use my second monitor for mechjeb  :-)

Nope. Each Unity version seems to bring new bugs related to multiple displays. The current one crashes if the display resolution are different which is the case for me...

Link to comment
Share on other sites

  • 2 years later...
On 12/30/2018 at 6:06 PM, sarbian said:

Nope. Each Unity version seems to bring new bugs related to multiple displays. The current one crashes if the display resolution are different which is the case for me...

A year later KSP switched to Unity 2019.2.2f1 https://wiki.kerbalspaceprogram.com/wiki/Version_history#v1.8 and has been using it for more than a year now.

Do you think it might be worth giving it another look? Thanks in advance

Edited by ronillon
english
Link to comment
Share on other sites

15 hours ago, ronillon said:

Do you think it might be worth giving it another look? Thanks in advance

I have and there are other bugs. I don't remember the exact details but I think it is related to the UI events that register only on the main screen. This is fixed in a later Unity but I doubt KSP will upgrade their version again.

Link to comment
Share on other sites

On 4/9/2021 at 4:04 PM, sarbian said:

I have and there are other bugs. I don't remember the exact details but I think it is related to the UI events that register only on the main screen. This is fixed in a later Unity but I doubt KSP will upgrade their version again.

I see, and there might be other bugs in the newer versions of Unity as well.

Maybe they will update if there is enough incentive. With the new features comming in 1.11 and possibly next versions, the might be some reason to update.

Can you tell me which version fixes the UI events issue? Maybe there are some interesting changes in the versions after that.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...