Starstrider42

[1.9.x] Custom Asteroids 1.8.0 - July 18

Recommended Posts

On 3/30/2019 at 11:32 AM, jonassm said:

I dont know if this has ever been asked, and thus it might be impossible.

But i would ki... do big things to be able to have asteroids appear in a different orbital color. It can get irritating when you zoom out in the tracking station and you cant find your probe because of 50000 white lines.

I think it's possible to alter an asteroid's (or other vessel's) orbit color. But it would be a bit out of scope for Custom Asteroids, and, like @Drew Kerman, I'm a bit confused about the motivation. Do you specifically want to be able to see large numbers of asteroids and spacecraft at the same time, without filters?

Share this post


Link to post
Share on other sites
On 4/2/2019 at 4:58 AM, Starstrider42 said:

I think it's possible to alter an asteroid's (or other vessel's) orbit color. But it would be a bit out of scope for Custom Asteroids, and, like @Drew Kerman, I'm a bit confused about the motivation. Do you specifically want to be able to see large numbers of asteroids and spacecraft at the same time, without filters?

I like having asteroids on all the time personally. And currently, even when they are on, it can be hard to differ between everything, because it's just tons and tons of white lines. Maybe even having asteroids have a different transparency/opacity on their lines, going even further something like belt asteroids having different colors compared to trojans, etc

Share this post


Link to post
Share on other sites

I've just posted a minor update to Custom Asteroids. As usual, it's available from SpaceDock, Curse, Github, or CKAN.

New Features

  • Asteroid groups can now have limits on the number of asteroids that spawn at once.

Bug Fixes

  • Solar day (<planet>.psol in configs) is now correctly calculated for bodies other than Kerbin.

Share this post


Link to post
Share on other sites

Um... I having a trouble that custom astroids are creating ludicrous amount of astroids when loading a save which had a long tim warp session ( from my poor understanding of the log file ) which leads to being stuck in the loading screen.

Currently running version 1.8.1 ksp and here's the log file https://drive.google.com/open?id=1tuL_KNLnJkq1yio4EB9wWgkyetu_WDZr as you can see after line 22xxx it's "discovering" thousands of new astroids 

Share this post


Link to post
Share on other sites
On 3/26/2020 at 8:24 PM, Astatine85 said:

Um... I having a trouble that custom astroids are creating ludicrous amount of astroids when loading a save which had a long tim warp session ( from my poor understanding of the log file ) which leads to being stuck in the loading screen.

Currently running version 1.8.1 ksp and here's the log file https://drive.google.com/open?id=1tuL_KNLnJkq1yio4EB9wWgkyetu_WDZr as you can see after line 22xxx it's "discovering" thousands of new astroids 

If this is what I think it is, then it's not caused by long time warping per se, but by having a late in-game date. My past attempts to fix it ended up making things worse (it involves weird interactions with KSP's setup order and Unity's random number generator), but now that somebody else is running into the problem I'll give it another shot.

Share this post


Link to post
Share on other sites
Posted (edited)

Just found this mod and I love it!

I've created my own config. It is extremely simple to start with:

Spoiler

AsteroidSets
{
        // Handle for hooking MM scripts -- DO NOT use CustomAsteroids_ prefix in your own configs!
        name = KubiAsteroids_stock

        ASTEROIDGROUP
        {
                name = kerbiners
                title = title_here

                spawnRate = 0.5
                spawnMax = 5
                centralBody = Kerbin

                orbitSize
                {
                        dist = Uniform
                        min = Ratio(Mun.sma, 0.55)
                        max = Ratio(Mun.sma, 0.65)
                }

        }
}

 


 

 

The settings config file is untouched:

Spoiler

CustomAsteroidSettings
{
        RenameAsteroids = True
        Spawner = FixedRate
        ErrorsOnScreen = True
        MinUntrackedTime = 1
        MaxUntrackedTime = 20
        VersionNumber = 1.7.0
}

 

I have started a new sandbox save (KSP 1.9.1). Entered the tracking station to have a look at what I've done.

Asteroids start to spawn, reaching the limit of 5 (spawnMax) and disappear slowly as expected according to the parameters.

Now, the strange thing is that if I do not start to track any of the asteroids, then after all 5 disappear, no new will spawn. If I exit the tracking station and enter again, then they start to spawn again (up to 5 spawn-diappear, then 0 forever). This behaviour is a bit strange, but generally OK as I can set MaxUntrackedTime to infinite (or a lot) so they do not disappear..

If I start to track all the 5 no new will spawn regardless if I stay or exit - re-enter the tracking station. Good, I wanted this... However an error message pops up (top right corner, yellow text):

  • [CustomeAsteroids]: Could not create new asteroid. Cause:"Could not select population." Root Cause: "The weights of the options may not be all zero. Parameter name: weightedChoices"

The log snippet that is repeated every time I replicate the fault.

Spoiler

[LOG 23:18:41.638] [FixedRateSpawner]: Asteroid discovered at UT 7287995.53156512.
[EXC 23:18:41.772] ArgumentOutOfRangeException: The weights of the options may not all be zero.
Parameter name: weightedChoices
        Starstrider42.CustomAsteroids.RandomDist.weightedSample[T] (System.Collections.Generic.IList`1[T] weightedChoices) (at <1497dc9bfca8493eb6cc0449773e5f22>:0)
        Starstrider42.CustomAsteroids.PopulationLoader.drawAsteroidSet () (at <1497dc9bfca8493eb6cc0449773e5f22>:0)
        Rethrow as InvalidOperationException: Could not select population.
        Starstrider42.CustomAsteroids.PopulationLoader.drawAsteroidSet () (at <1497dc9bfca8493eb6cc0449773e5f22>:0)
        Starstrider42.CustomAsteroids.AsteroidManager.drawAsteroidSet () (at <1497dc9bfca8493eb6cc0449773e5f22>:0)
        Starstrider42.CustomAsteroids.AbstractSpawner.spawnAsteroid () (at <1497dc9bfca8493eb6cc0449773e5f22>:0)
        UnityEngine.DebugLogHandler:LogException(Exception, Object)
        ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
        UnityEngine.Debug:LogException(Exception)
        Starstrider42.CustomAsteroids.AbstractSpawner:spawnAsteroid()
        Starstrider42.CustomAsteroids.FixedRateSpawner:checkSpawn()
        Starstrider42.CustomAsteroids.AbstractSpawner:asteroidCheck()
        Starstrider42.CustomAsteroids.<Driver>d__8:MoveNext()
        UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

 

 

Edited by kubi
x

Share this post


Link to post
Share on other sites

And now a question :)

Is there an example on how to position asteroids to/ around a lagrange point? Or, to make it simpler, some degrees before/after a planer or a moon.

Share this post


Link to post
Share on other sites

@kubi, thanks for the bug reports. I don't have a better workaround for the too-strict spawn limit. The error messages are harmless (the spawning logic was written before it made sense to have no asteroids spawning on purpose); they will go away if you add an asteroid group that does not have limits, or you can suppress them outright by setting ErrorsOnScreen = False in the settings file.

As for pseudo-Lagrange points, the trick is to set the asteroids' mean longitude based on that of the body they're co-orbiting with. You can look at the Trojan asteroids in Basic Asteroids.cfg for an example. In that file I gave the asteroids big spreads in inclination and mean anomaly to imitate the fairly dispersed Trojan groups in our own solar system, but this is by no means part of the technique.

Share this post


Link to post
Share on other sites

Thanks @Starstrider42!

The trojans near the Mun are perfectly working based on the example configs. Now I have 10-10 of those.

I was checking the code too and it seems to me that the spawning of asteroids depends on the facility level being able to detect them.

Have you been looking into if it would be possible to use the telescope before upgrading the facility?

 

Share this post


Link to post
Share on other sites

If you mean the Sentinel telescope, Custom Asteroids doesn't support it at all at the moment (i.e., if you launch the telescope it should still work, but it won't use any CA features). I did try to integrate it into the mod, but it proved a bit too difficult for me.

I will still try to fix the bugs that have been reported here, but I can't promise when I'll be able to release a new version, sorry.

Share this post


Link to post
Share on other sites
On 6/10/2020 at 4:59 AM, Starstrider42 said:

I will still try to fix the bugs that have been reported here, but I can't promise when I'll be able to release a new version, sorry.

Thank you for the great work!

Share this post


Link to post
Share on other sites

Custom Asteroids 1.8.0 is now available for KSP 1.4 through 1.9. This release is not compatible with KSP 1.10. I'm working on integrating with the new comets system, but I probably won't be able to maintain compatibility with KSP 1.9 and earlier once I do that, so I wanted to get these fixes out first. Thank you for your patience!

New Features

  • Asteroid groups can now have custom size distributions. They are still limited to the asteroid sizes provided by the stock game.

Bug Fixes

  • Loading a KSP game in which many years have passed no longer causes Custom Asteroids to "churn" through redundant asteroids.
  • Resource drills now work when Custom Asteroids is installed but Community Resource Pack is not.
  • Asteroid configs consisting entirely of limited-number or conditionally-spawned asteroids no longer emit error messages.
  • Asteroid configs consisting entirely of limited-number or conditionally-spawned asteroids no longer cause the fixed-rate spawner to get stuck in a zero-asteroid state.

Share this post


Link to post
Share on other sites

First of all, much thanks for this mod!

I'm attempting to make use of the variety of resources you have added to asteroids to spice up a scenario of sorts that I'm building. However, since in-game the space rocks show only a single "Resources" reading when grappled, I thought at first that the mod wasn't working properly, until I looked into the save file and saw all the different resources were clearly there in the "vessel" entry. In the end I used ConfigurableContainers to make space for every resource that can be found in one of your custom asteroids in a single tank, and thus found out that the stock drills mine everything at the same time, at rates according to their abundance.

However there is still one thing I don't think I can easily test, so I thought I'd just ask: what happens if I start mining a custom asteroid and I don't have tanks for every resource on it? Do those other resources still get mined and therefore wasted?

Share this post


Link to post
Share on other sites
Posted (edited)

Thanks for the feedback! Unfortunately, the resource display is a problem on the stock side. While I'm also annoyed by the lack of a good asteroid prospecting option, I'm not sure I want to try to add my own display on top of the stock module, especially since Community Resource Pack (which had varied asteroid resources before I did) doesn't feel the need to do so.

Yes, an asteroid drill will mine everything at once. There's an explanation of the exact mechanics on the Squad bugtracker.

Edited by Starstrider42

Share this post


Link to post
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.