Jump to content

[1.12.x] Docking Camera KURS Style Re-Adopted (Fixed in 1.9)


linuxgurugamer

Recommended Posts

3 hours ago, 00ASTRA00 said:

salut @linuxgurugamer, je suis francais tellement désolé pour les erreurs ... J'ai une question: comment activer la vidéo, le clic droit ne fonctionne pas?

[Added Translation]
Hi @linuxgurugamer, I'm French so sorry for the errors ... I have a question: how to activate the video, the right click does not work?

Thank you for translating.

Make sure you have all the dependencies installed, that's usually the problem

Link to comment
Share on other sites

On 10/6/2019 at 10:58 PM, linuxgurugamer said:

Thank you, but not at this time.  It's a matter of building the shaders properly, and I have a procedure for it.  I just need to figure out how to make it work without having multiple versions of the mod

Hi linuxgamer, how's life? Any progress here? I just tried latest version and realised that in GreyScale I can see at lease some details, rest is the same.

Link to comment
Share on other sites

2 hours ago, elGremlin said:

Hi linuxgamer, how's life? Any progress here? I just tried latest version and realised that in GreyScale I can see at lease some details, rest is the same.

The latest is working, there is one issue that if a kerbal is in a command seat, you can see him through the vessel

Link to comment
Share on other sites

1 hour ago, linuxgurugamer said:

The latest is working, there is one issue that if a kerbal is in a command seat, you can see him through the vessel

Could that be as simple as just a layer switch for the Kerbal, or the vessel? ie for IVA, IIRC erbals and anything you DO want to see in the portrait camera, gets layer 16 (Kerbals), and anything you DONT want to see in the portrait camera (ie the top of a dashboard/console between the kerbal and camera), goes on layer 20 (Internal Space)... vOv
I dont know how the camera/space works with command seats tho... (ie are they treated as an IVA, oncea kerbal "boards/sits" in it... vOv

Link to comment
Share on other sites

8 minutes ago, Stone Blue said:

Could that be as simple as just a layer switch for the Kerbal, or the vessel? ie for IVA, IIRC erbals and anything you DO want to see in the portrait camera, gets layer 16 (Kerbals), and anything you DONT want to see in the portrait camera (ie the top of a dashboard/console between the kerbal and camera), goes on layer 20 (Internal Space)... vOv
I dont know how the camera/space works with command seats tho... (ie are they treated as an IVA, oncea kerbal "boards/sits" in it... vOv

This bug has been in it for a long time. I may take a stab at it tomorrow night on my stream.

Link to comment
Share on other sites

Hola! I think I found a bug in camera. If the camera module is on so the second windown is showing and the power is completely drained from batteries, when batteries are recharged the camera can not be turned back on and continues to say it has no power forever.

As a side note, also noticed that camera can't be turned on or off with action groups. Assuming this is just lack of feature and not a bug, but sure would be handy to turn on a camera under a fairing with an actiongroup.

Edited by Atlas Gaming
Link to comment
Share on other sites

G'day, I might as well add to this. I've gotten back into the game and figured I'd help troubleshoot this. 

I've done a fresh 1.10.1 install only with the following installed:

  • both DLC
  • 000_ClickThroughBlocker
  • 001_ToolbarControl
  • DockingCamKURS

Camera functions fine initially, so great job getting it working again.  I plan to go through each of the internal views and stick a camera inside each cockpit to see if the visible kerbal issue is consistent or specific to some parts. I've checked the lander can Mk1 and I don't see a Kerbal at all. I might of stuck the camera a little forward of the seating, but I'll check again tomorrow.

Found three issues initially:

The Greyscale & CRT shaders are about 50%-60% transparent. I can see through those views to the scenery behind the window. All other shaders are not transparent at all. If I use the 'photo' button, the resulting image is fine and not transparent at all.

UdV3zxPm.pngWPo3nKom.png

 

The 'Target Ray' and 'Fire bullet' button (which I assume calls the same bit of code as Target Ray) results in an NE exception. The error only occurs while the ray appears on screen. For the fire bullet button, this appear in the log for a few dozen frames. It's worse with the Target Ray as it'll spam the log file continuously until turned off and the user won't know unless they have Alt-F12 open. Probably not a major issue, as I don't think many people use this aspect of the mod, but still worth reporting.

[ERR 20:11:02.283] Module PartCameraModule threw during OnUpdate: System.ArgumentNullException: Value cannot be null.
Parameter name: shader
  at (wrapper managed-to-native) UnityEngine.Material.CreateWithShader(UnityEngine.Material,UnityEngine.Shader)
  at UnityEngine.Material..ctor (UnityEngine.Shader shader) [0x00007] in <5aeafee3fea24f37abd1315553f2cfa6>:0 
  at OLDD_camera.Camera.PartCamera.DrawScanningRay () [0x00054] in <0fb6c2b8fe8140a6a48a3c778e22312f>:0 
  at OLDD_camera.Camera.PartCamera.Update () [0x0001c] in <0fb6c2b8fe8140a6a48a3c778e22312f>:0 
  at OLDD_camera.Modules.PartCameraModule.OnUpdate () [0x002e3] in <0fb6c2b8fe8140a6a48a3c778e22312f>:0 
  at Part.ModulesOnUpdate () [0x0004a] in <c1858a3f77504bd1aaa946fdccf84670>:0 

 

Last issue found was that there is some kind of weird layer peaking through with numbers showing up in the camera view. I also get the floating Navball, but this seems on the same layer as the navball. The numbers scroll through as I rotate the camera, but disappear once past about 30-45 degrees. The numbers remain of static size regardless of zoom level or shader/filter selected. For the issue to be visible at all, it seems to depend entirely where the camera is pointing. You'll probably miss it if looking at a noisy / black background. From the launch pad, I was looking towards the north towards the flag to see the numbers, the floating navball is seen when looking west to the VAB.

HXh7UiOm.pngeSsin9Lm.png

Next up tonight is to see if anything up with the docking cam / has same issues as base camera.

Edited by cyberKerb
Link to comment
Share on other sites

One other question for @linuxgurugamer is it possible to add a variable to the cfg file to allow a user defined electricity cost for the camera use?

At the moment it's hard-coded to 0.02EC per something. In the game, it looks like it's rapidly flicking between 0.04 * 0.08 per second in the resource UI. Might be indicating it's being updated overly frequently due to when the update is running.
https://github.com/linuxgurugamer/DockingCam/blob/c674936b5ea35c62992de12fad69d1de05ae1757/Source/Camera/BaseCamera.cs#L247

 

Lastly, I've rechecked the camera issue and the floating navball (and the floating text) disappears if you simply remove the 'camera 01' altogether.
ie changing Line 72 of basecamera.cs to:
protected List<string> CameraNames = new List<string> { "GalaxyCamera", "Camera ScaledSpace", "Camera 00"};

It would ruin backwards compatibility for prior to 1.9, but I don't think that's a concern seeing as this release would be specifically for 1.9 and over. Other mods that use this method do an onload switch of having the Camera 01 available only once they check the gameversion the mod is loaded in is less than 1.9. Otherwise they skip the camera completely, hence my suggestion to remove it completely.  The visuals for this test were fine and had no weird extra floating stuff.

Edit: it might be fine for me, but I just read Camera 01 is still used for players on MacOS and Linux. I need someone to be a guinea pig on one of those systems and test a version without the Camera 01 on the compiled DLL?

However, I then had an issue with the Target Marker rendering under 'EntendedDrawWindowL2'. The .tex file for _textureTargetMark isn't loading for some reason and causing an can't render null texture error. I'm sure this is a simpler issue to fix and it might be related to the warning about still using the obsolete WWW and changing the code to use UnityWebRequest

Edited by cyberKerb
More research
Link to comment
Share on other sites

Ok - last update and then I've got to get to bed. (sorry to everyone else for all the coding talk)

Other than removing 'Camera 01',  also remove / comment out any references to 'AllCamerasGameObject[2]' as this would of been referring to 'Camera 01' in the basecamera list array. And that won't be there when removed. 

 

The Target ray / Fire bullet issue is due to the shader reference using an old 2017 path. Forum ref link

Change the path from "Particles/Additive"  and change it to "Legacy Shaders/Particles/Additive" 

https://github.com/linuxgurugamer/DockingCam/blob/c674936b5ea35c62992de12fad69d1de05ae1757/Source/Camera/PartCamera.cs#L541
https://github.com/linuxgurugamer/DockingCam/blob/c674936b5ea35c62992de12fad69d1de05ae1757/Source/Camera/PartCamera.cs#L569

I've tested this one and it does fix the error when using the 'bullets' or target ray. 

 

The transparent views on CRT and Greyscale I can only 'guess' are due to the shaders config themselves. I have no idea on those and will leave that black magic for someone else to scrape through. @linuxgurugamer Your work on that alone is heroic as that is quite dense to even get started to try and understand it.:o

Edited by cyberKerb
Link to comment
Share on other sites

@cyberKerb thanks for going through this pain, I hope it helps LGG. 

If it helps, there is yet another issue. If you use the camera in orbit passing through the dark side, at some angles the body (planet, moon or whatever) will light up as if it was bathing in sunlight. Keep panning the camera and the body eventually goes dark again.

All of this happens too with Tarsier's telescopes, which uses the same plugins (I think), so maybe we are close to zeroing in the problem.

Link to comment
Share on other sites

3 minutes ago, Daniel Prates said:

@cyberKerb thanks for going through this pain, I hope it helps LGG. 

If it helps, there is yet another issue. If you use the camera in orbit passing through the dark side, at some angles the body (planet, moon or whatever) will light up as if it was bathing in sunlight. Keep panning the camera and the body eventually goes dark again.

Without even looking at that problem, it'd be a good guess it is also caused by using that extra camera that's doing it. Can you past a screenshot so I know what to look for?

I'm on the bus now after works network crapped out. I'll see if I can reproduce the issue later today.

I'll also look to add that Action group item and send LGG a pull request if I get time.

Link to comment
Share on other sites

On 11/9/2020 at 8:04 AM, cyberKerb said:

Lastly, I've rechecked the camera issue and the floating navball (and the floating text) disappears if you simply remove the 'camera 01' altogether.
ie changing Line 72 of basecamera.cs to:
protected List<string> CameraNames = new List<string> { "GalaxyCamera", "Camera ScaledSpace", "Camera 00"};

I don't know what source you are looking at, but this was done a while ago.  Based on your comment I did remove the  UIMainCamera from that line, but camera01 was removed a while ago

 

Link to comment
Share on other sites

On 11/9/2020 at 8:04 AM, cyberKerb said:

However, I then had an issue with the Target Marker rendering under 'EntendedDrawWindowL2'. The .tex file for _textureTargetMark isn't loading for some reason and causing an can't render null texture error. I'm sure this is a simpler issue to fix and it might be related to the warning about still using the obsolete WWW and changing the code to use UnityWebRequest

Case problem, the code was looking for "targetPoint", but the actual name of the asset is "targetpoint"

Link to comment
Share on other sites

43 minutes ago, linuxgurugamer said:

I don't know what source you are looking at, but this was done a while ago.  Based on your comment I did remove the  UIMainCamera from that line, but camera01 was removed a while ago

 

I'm looking at this source - it still has the 'UIMainCamera' in the reference. Or is there another set of source in this repository?
https://github.com/linuxgurugamer/DockingCam/blob/c674936b5ea35c62992de12fad69d1de05ae1757/Source/Camera/BaseCamera.cs#L72

 

30 minutes ago, linuxgurugamer said:

Case problem, the code was looking for "targetPoint", but the actual name of the asset is "targetpoint"

I'm not sure how that works, all the png and tex files all have the case with the "targetPoint". Having said that, I'm still going from the github reference code so I might not be looking at the correct code. I'm connfusing on what source I should be using now?
https://github.com/linuxgurugamer/DockingCam/blob/master/Unity/DockingCam/Assets/dockingcameratextures/targetPoint.png
https://github.com/linuxgurugamer/DockingCam/blob/master/GameData/DockingCamKURS/Resources/Unity_Assets_Files/DockingCam/CAB-156ac663a69c7f4d098886aaf52c3743/targetPoint.tex

Maybe it's not related, but the issue fixes itself if you use the '+' button at the bottom right on the window to increase the window size. After that is clicked, the targetmarker button works fine with no error in the console. Seems like something isn't initialised in the right place.

 

 

Edited by cyberKerb
Link to comment
Share on other sites

22 minutes ago, cyberKerb said:

I'm looking at this source - it still has the 'UIMainCamera' in the reference. Or is there another set of source in this repository?

https://github.com/linuxgurugamer/DockingCam/blob/c674936b5ea35c62992de12fad69d1de05ae1757/Source/Camera/BaseCamera.cs#L72

Looks like I may not have pushed the last set of changes.

Just did that, please reload.

Current version (unreleased) fixes the  asset name for targetpoint

23 minutes ago, cyberKerb said:

I'm looking at this source - it still has the 'UIMainCamera' in the reference. Or is there another set of source in this repository?

https://github.com/linuxgurugamer/DockingCam/blob/c674936b5ea35c62992de12fad69d1de05ae1757/Source/Camera/BaseCamera.cs#L72

UIMainCamera was a change made this evening, I reverted it to be sure you had the correct latest.  Removing it didn't seem to do anything

Link to comment
Share on other sites

35 minutes ago, cyberKerb said:

I'm looking at this source - it still has the 'UIMainCamera' in the reference. Or is there another set of source in this repository?
https://github.com/linuxgurugamer/DockingCam/blob/c674936b5ea35c62992de12fad69d1de05ae1757/Source/Camera/BaseCamera.cs#L72

 

I'm not sure how that works, all the png and tex files all have the case with the "targetPoint". Having said that, I'm still going from the github reference code so I might not be looking at the correct code. I'm connfusing on what source I should be using now?
https://github.com/linuxgurugamer/DockingCam/blob/master/Unity/DockingCam/Assets/dockingcameratextures/targetPoint.png
https://github.com/linuxgurugamer/DockingCam/blob/master/GameData/DockingCamKURS/Resources/Unity_Assets_Files/DockingCam/CAB-156ac663a69c7f4d098886aaf52c3743/targetPoint.tex

Maybe it's not related, but the issue fixes itself if you use the '+' button at the bottom right on the window to increase the window size. After that is clicked, the targetmarker button works fine with no error in the console. Seems like something isn't initialised in the right place.

 

 

According to what I dump to the log file, the asset names are:

DockingCameraKURS: assetName: assets/dockingcamera-crt.shader
DockingCameraKURS: assetName: assets/dockingcamera-grayscale.shader
DockingCameraKURS: assetName: assets/dockingcamera-nightvision.shader
DockingCameraKURS: assetName: assets/dockingcamera-nightvisionclear.shader
DockingCameraKURS: assetName: assets/dockingcamera-none.shader
DockingCameraKURS: assetName: assets/dockingcamera-thermalvision.shader
DockingCameraKURS: assetName: assets/dockingcameratextures/dockingcam.png
DockingCameraKURS: assetName: assets/dockingcameratextures/image6.png
DockingCameraKURS: assetName: assets/dockingcameratextures/lampoff.png
DockingCameraKURS: assetName: assets/dockingcameratextures/lampon.png
DockingCameraKURS: assetName: assets/dockingcameratextures/selfrot.png
DockingCameraKURS: assetName: assets/dockingcameratextures/targetpoint.png
DockingCameraKURS: assetName: assets/dockingcameratextures/targetrot.png

I've committed my changes, and am holding off to see what you can come up with, you seem to know more about the cameras than I do

 

Link to comment
Share on other sites

 

23 minutes ago, linuxgurugamer said:

According to what I dump to the log file, the asset names are:I've committed my changes, and am holding off to see what you can come up with, you seem to know more about the cameras than I do

Not at all. I'm just a brute force troubleshooter who understands programming structure. It doesn't hurt that I'm fine trawling through all the code, tracing what calls what to find the issue.

Found a few minor issues, I'll sent a pull request.

Edited by cyberKerb
Link to comment
Share on other sites

@linuxgurugamer Pull request sent. You'll need to recompile for release as I only updated the source files.

  • Reordered PartCamera.cs Activate() function. It was also missing the InitTextures() which was causing the Target marker to not load.
  • Added ActionGroup for camera activation to both part modules (suggestion @Atlas Gaming)
  • Corrected the shader reference path to: 'Legacy Shaders/Particles/Additive '. Was causing NRE errors if bullets or Target ray buttons were used.
  • Added user config option to set EC amount for camera usage. Was hard coded to 0.02. Updated part cfg files to match
  • Found cause of not being able to restore power to camera. (Logic flaw in original coding) Added code to check EC before trying to enable. (suggestion: @Atlas Gaming)

If you have time could you look into why the photo process of this mod (SavePNG function) doesn't apply the Shader to the saved image file? It just takes a render of whatever is in the camera window - but without the filter. :( 

Edited by cyberKerb
Link to comment
Share on other sites

Yay! I think I found a solution to the last issue with this mod.

For the problem where Kerbals are being seen through parts, I found that changing the MarkerCam.cullingMask layer from 17 to 16 works. Ref line on Git
I don't see any other side effects like the navball in the sky or stuff like that. Added another commit to the pull request to include this change.

Link to comment
Share on other sites

3 hours ago, cyberKerb said:

Yay! I think I found a solution to the last issue with this mod.

For the problem where Kerbals are being seen through parts, I found that changing the MarkerCam.cullingMask layer from 17 to 16 works. Ref line on Git
I don't see any other side effects like the navball in the sky or stuff like that. Added another commit to the pull request to include this change.

I've merged the PR, will test and then get it released in a day or so.

Thank you

Link to comment
Share on other sites

New release, 1.3.7.7

  • Fixed typo of asset name for targetpoint
  • Thanks to user @cyberKerb for all of the following:
    • Reordered PartCamera.cs Activate() function. It was also missing the InitTextures() which was causing the Target marker to not load.
    • Added ActionGroup for camera activation to both part modules
    • Corrected the shader reference path to: 'Legacy Shaders/Particles/Additive '. Was causing NRE errors if bullets or Target ray buttons were used.
    • Added user config option to set EC amount for camera usage. Was hard coded to 0.02. Updated part cfg files to match.
    • Found a logic hole in the PartCameraModule. When a camera isEnabled (after being activated()) it does regular checks for electric charge. Once EC gets to zero, the mod will deactivate the camera (docking cameras are unaffected) and set isEnabled & _isPowered to "FALSE".
    • In this state, there is no way to get back to IsEnabled = true due to there being a power state check before allowing a user to enable a camera. No EC checks are ever run again and the camera cannot be used.
    • Added code to do an ECcheck before trying to enable the camera to avoid this issue.
    • Fixed the kerbals being seen through parts by fixing the cullingMaskLayer
Link to comment
Share on other sites

Dammit - I've been doing further testing and found this issue of seeing kerbals through part is now related to the IVA, instead of just the command seat. I'll be working on it / learning the camera system better. Worked out a better solution and set the culling mask to the same as the main Camera 00 is using and avoids hiding other layers that are KSP controlled. (sorry for this miss on this one LGG :()

New Pull request sent to @linuxgurugamer

Ifsn22Um.png

Edited by cyberKerb
Link to comment
Share on other sites

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