Jump to content

[KSP 1.11.1] LaserDist, a distance measuring laser part (for kOS, kRPC, etc)


Dunbaratu

Recommended Posts

  • 1 month later...

I wonder if @DMagic would mind contributing the lasers used in his mod's ablation laser models, so LaserDist lasers would have the same style? I'm very familiar with Blender and I'd be happy to add some surrounding greeble for each of the laser types.

Link to comment
Share on other sites

  • 2 months later...
  • 3 weeks later...

I've been letting this mod linger for a while and I just noticed it didn't work in KSP 1.2.1.

So I just updated it (all it took was a re-compile) so it will work.  It's on Spacedock and Curse and should appear in CKAN within a day or so (CKAN always takes a bit longer to update).

New Version number: LaserDist 0.9.3

Link to comment
Share on other sites

On 02.12.2016. at 0:42 AM, Steven Mading said:

So I just updated it (all it took was a re-compile) so it will work.  It's on Spacedock and Curse and should appear in CKAN within a day or so (CKAN always takes a bit longer to update).


0.9.3. update is missing on github https://github.com/Dunbaratu/LaserDist/releases

Not sure what is main download source for CKAN, if it use github, it might not be able to pick it up.

Link to comment
Share on other sites

@Steven Mading, seems that you forgot to update version file that is inside archive. Inside 0.9.3. version file is:

{
  "NAME": "LaserDist",
  "URL": "https://raw.githubusercontent.com/Dunbaratu/LaserDist/master/LaserDist.version",
  "DOWNLOAD":"https://github.com/Dunbaratu/LaserDist/releases/download/v0.9/LaserDist.zip",
  "CHANGE_LOG_URL":"https://raw.githubusercontent.com/Dunbaratu/LaserDist/master/ChangeLog.md",
  "GITHUB": {
    "USERNAME":"Dunbaratu",
    "REPOSITORY":"LaserDist",
    "ALLOW_PRE_RELEASE":false
  },
  "VERSION": {
    "MAJOR": 0,
    "MINOR": 9,
    "PATCH": 2
  },
  "KSP_VERSION": {
    "MAJOR": 1,
    "MINOR": 1,
    "PATCH": 2
  },
  "KSP_VERSION_MIN": {
    "MAJOR": 1,
    "MINOR": 1,
    "PATCH": 0
  },
  "KSP_VERSION_MAX": {
    "MAJOR": 99,
    "MINOR": 99,
    "PATCH": 99
  }
}

Probably it confuse AVC and CKAN, not knowing that is updated to 0.9.3. regardless of version number in filename.

Link to comment
Share on other sites

  • 3 months later...

New Release - fixes phantom hits and pulls this out of alpha into 1.0.0 range, since the one bad problem has finally been fixed (I think):

I think I finally solved the strange phantom hits that have been plaguing things since KSP 1.2.2 came out. It turns out KSP moved a few things to new layer numbers, invalidating the old layer mask I was using and causing the laser to "hit" invisible things like cloud effects and UI elements and masked-off planets on the map view even when the game is in flight view.

New 1.0.0 release is out.

 

Edited by Steven Mading
Link to comment
Share on other sites

  • 1 month later...

I should point out that while I thought this fixed the phantom hits, they still occasionally happen and I don't know why.  They definitely happen less often than they did before, but occasionally they do happen and it seems to be a little more consistent now about the effect.  Now when it hits a phantom, it's always a phantom less than 1 meter away (it used to sometimes hit a phantom about 20 to 60 meters away when the real hits should be about 400 meters away, causing some script solutions to see an impending "collision" with an object that's not there.)  I don't know why but I do notice it happens more in Galileo Planet Pack than in stock.  There may be a mod somewhere in GPP that's drawing something on a layer I'm not properly masking off, maybe?

Perhaps I could change the logic of the layer mask to whitelist instead of blacklist.  (mention the layers I want, assuming all layers I don't know about should be turned off.)

 

Link to comment
Share on other sites

  • 3 weeks later...

Downloaded this via CKAN for 1.3 and it causes the game to crash on the load screen.  no logs as I am not at home, but removing this mod did solve the problem.  that being said it may be a conflict with another mod, not this mod specifically.

Link to comment
Share on other sites

  • 4 weeks later...
  • 11 months later...

I doubt that you can have true cone. As much as I was able to understand, it use raycast to get distance from planet surface. It might be possible to use sphere raycast or cube raycast to mimic cone, but not true cone shape.

Link to comment
Share on other sites

  • 3 months later...

UPDATED v1.1.0 for KSP 1.4.5

 

This hasn't been updated in a while but I found the cause of a longstanding bug (I think) so I decided to make a new release.

(The release is in the usual places - see first post for links).

 

There was a longstanding bug with phatom bogus hits that are very short distances when there's nothing there at all the laser should be hitting.  I think I finally found the cause of it and why I couldn't figure it out.  The full explanation is here in this PR (link below).
 

https://github.com/Dunbaratu/LaserDist/pull/24  <-- full explanation of the bug and fix.

But the shorthand version is this:  I had always thought the problem was in the layermask I used with the Unity raycast being wrong, but the layermask was not the cause of it.  It was fine.  The cause was a problem with the fallback routine I wrote that it uses when it can't find a raycast hit and so instead it queries PQS terrain.

When it resorted to the PQS fallback method, it was possible for the laser to emit from the gun at a start position already underneath what the PQS system thinks the "terrain" height is, given how the coarse-grain polygons approximating the PQS function can end up cutting a chord across a "mild hill-top", flattening it.   When the laser emits from a point that is already beneath the PQS terrain curve, the algorithm would detect the nearby spot where the line transitions from under PQS terrain to over PQS terrain, and falsely call that the hit.

The fix  I used is to ignore anything the PQS fallback claims is a hit closer than 2km.  Within that distance the real polygon colliders should exist and it shouldn't be resorting to the PQS fallback.  The PQS fallback is just for finding distant hits on terrain too far away to have colliders.

 

Link to comment
Share on other sites

16 hours ago, HebaruSan said:

Any chance of the .version file getting fixed?

https://github.com/Dunbaratu/LaserDist/pull/23

Already did it as part of release.  The new version is capped at 1.4.5 and I'll be able to change it later to 1.5 if that ends up working, without having to make a new release now that I know CKAN looks at it from the master branch again and again, not just at the moment of release, which is how I thought it worked before.

Link to comment
Share on other sites

6 minutes ago, Steven Mading said:

Already did it as part of release.  The new version is capped at 1.4.5 and I'll be able to change it later to 1.5 if that ends up working, without having to make a new release now that I know CKAN looks at it from the master branch again and again, not just at the moment of release, which is how I thought it worked before.

Hmm, I just re-downloaded the release to make sure, and the included .version file still has the same problems: the VERSION is 1.0.0, and the game versions are listed as 1.1.0 through 99.99.99.

Link to comment
Share on other sites

7 minutes ago, HebaruSan said:

Hmm, I just re-downloaded the release to make sure, and the included .version file still has the same problems: the VERSION is 1.0.0, and the game versions are listed as 1.1.0 through 99.99.99.

What on earth happened to my edit??  It was 1.4.5 before.  I even checked CKAN half a day after the release to confirm it had gotten the change and it *had* - it was displaying a max KSP version of 1.4.5 for LaserDist version v1.1.0.

But now, it's back to 99.99.99 again.  AND it is on github too, and in my local copy.  Literally every place I edited it, it is now reverted with no record of the edit.

 

 

Link to comment
Share on other sites

4 minutes ago, Steven Mading said:

I even checked CKAN half a day after the release to confirm it had gotten the change and it *had* - it was displaying a max KSP version of 1.4.5 for LaserDist version v1.1.0.

Hmm, there's no trace of that having happened in the metadata. v1.1.0 was initially indexed for 1.1.0--99.99.99, and hasn't been changed since:

https://github.com/KSP-CKAN/CKAN-meta/commits/master/LaserDist/LaserDist-v1.1.0.ckan

Link to comment
Share on other sites

2 minutes ago, HebaruSan said:

Hmm, there's no trace of that having happened in the metadata. v1.1.0 was initially indexed for 1.1.0--99.99.99, and hasn't been changed since:

https://github.com/KSP-CKAN/CKAN-meta/commits/master/LaserDist/LaserDist-v1.1.0.ckan

I didn't look at CKAN's metadat - I looked at the CKAN program *itself* in my test installation - and it was showing 1.4.5 as the max version (in the GUI window).

Edited by Steven Mading
Link to comment
Share on other sites

Just now, Steven Mading said:

I didn't look at CKAN's metadat - I looked at the CKAN program *itself* in my test installation - and it was showing 1.4.5 as the max version (in the GUI window).

Oh, that display can't be trusted anymore because it had to be "enhanced" to "clean up" version numbers like 99.99.99:

I didn't like that idea because it causes exactly this kind of confusion (and I said so in https://github.com/KSP-CKAN/CKAN/pull/2432), but sometimes you get overruled.

Link to comment
Share on other sites

Wait, is it possible that CKAN utterly ignores the metadata online if it sees the .version file locally installed in the GameData folder?  That could maybe explain it - my local ZIP install could have had the edit but it didn't end up in GIthub and then CKAN would show me what my local file said, not what the online information said.

If that's how it works then it means NO, you cannot update a .version file without making a release, not really (because people will download the release zip, explode it in GameData, and its .version file will be behind what is in the master branch, and if CKAN obeys that over the metadata, the old 99.99.99 value will be back again in the display.

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