Jump to content

[1.12.x] Custom Asteroids 1.9.0 - January 24


Starstrider42

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?

Link to comment
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

Link to comment
Share on other sites

  • 1 month later...
  • 10 months later...

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 

Link to comment
Share on other sites

  • 2 weeks later...
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.

Link to comment
Share on other sites

  • 1 month later...

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

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

Link to comment
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?

 

Link to comment
Share on other sites

  • 2 weeks later...

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.

Link to comment
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!

Link to comment
Share on other sites

  • 1 month later...

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.
Link to comment
Share on other sites

  • 2 weeks later...

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?

Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • 1 month later...
On 7/19/2020 at 10:02 AM, Starstrider42 said:

 

  • Loading a KSP game in which many years have passed no longer causes Custom Asteroids to "churn" through redundant asteroids.

Yay, I can finally get to play with this mod again. Thanks for updating the mod and hope it adds custom comets soon : 3

Link to comment
Share on other sites

  • 3 months later...

Thank you everyone for waiting! Custom Asteroids 1.9 is now available for KSP 1.10 and later. This version adds support for custom comets and makes some long-overdue tweaks to the stock asteroid packs. Unfortunately, I don't have a good way to patch old-style "comets" from existing save games (especially ones you've already visited); they'll still be asteroids.

New Features

  • Asteroid groups can now create comets that behave according to stock rules (e.g., orbit-dependent science classes).

Changes

  • The CaCometActive part and cometSample experiment are now deprecated; use PotatoComet instead. They will be removed in version 2.0.0.
  • Stockalike.cfg now emulates the four stock comet classes. Comets have been removed from Basic Asteroids.cfg and Trans-Jool.cfg.
  • Added a "Main Belt Comet" comet class.
  • Nerfed spawn rates of Drestroids and Jool Trojans.
  • Modernized Kuper belt objects and made them more realistic.
  • Restricted Kuper belt detections to large objects.

Bug Fixes

  • New asteroids/comets now trigger the corresponding game events.
  • Scene changes no longer cause duplicate asteroids.

Known Issues

  • Comets do not show tails in the Tracking Station when they first appear. The problem goes away if you leave the Tracking Station and return.
  • Comets can only be based on the PotatoComet part; this appears to be a stock limitation. As a result, the Icy-Organic objects of the outer solar system won't develop tails should you throw one towards the Sun.
Edited by Starstrider42
Link to comment
Share on other sites

Hey Starstrider, thanks for this mod, and thanks for updating! I have one question though regarding asteroid size classes. I was experimenting with a config of my own that would add an additional group of asteroids to the Main Belt. The basic configs included with CA only call for class A-E rocks in this region, presumably because the larger ones are all comets. Is there no way to use the comet model, and also have comet size classes, without strictly defining the rocks as comet objects? That is, could I use the PotatoRoid, or CA rock models but have them in sizes akin to the stock comets? I tried to make a group of Large Main Belt asteroids in the same orbital parameters as the mainBeltMiddle group included in basic asteroids.cfg but using a comet orbit type definition similar to the way the Kentaurs group was done from the Trans-Neidon.cfg. In an effort to test which models I could use I gave an asteroidTypes{} block containing some of each of PotatoComet, PotatoRoid, CaAsteroidCarbon, and CaAsteroidMetal, but could not seem to get it to work right. I was getting asteroids spawning in the right orbit which said they were comet size classes but when I approached them they were no bigger than E class rocks, unless of course they were actually using the PotatoComet model, in which case they were the correct size as listed in tracking station. It seems that if the rock uses any model besides PotatoComet, that it can't be larger than class E... I don't suppose I can circumvent that somehow that you know of?

In case it's at all relevant, I'm running KSP 1.11.0, with OPM, and Custom asteroids for my testing install.
Thanks again for the mod and for your time!

 

Link to comment
Share on other sites

Thanks for your interest! Yes asteroids (more precisely, any part whose model is generated by ModuleAsteroid) cannot be made larger than size E. I don't know of a way around it, but I've requested support for larger asteroids as Squad#27069. If you have a Squad bugtracker account, feel free to upvote it. :)

With the current code it is possible to create an asteroid that uses the comet model, but does not have CometVessel (the vessel module that adds support for orbit types and visual effects): simply use ModuleManager to clone PotatoComet into a part with a different name, and you'll get the behavior you asked for. However, this is an exploit of the second "known issue" I mentioned above; I'm reluctant to add any official support for something like this until I know how Squad#27070 will be resolved.

Link to comment
Share on other sites

I thought the case might be such. Thanks for the reply though! It does seem a little weird that the game allows comets to be any size but not so for  asteroids. I've up-voted your bugtracker threads, as I'm definitely in agreement both that there should be support to make comets with non-comet models, and that non comets should be able to use the comet models and sizes.  I'd really like to have large asteroids to build industrial stations on and such. For now, my kinda weird main belt "comets" will have to do. Thanks again for your mod and for your help!

Link to comment
Share on other sites

On 5/18/2014 at 11:07 PM, Starstrider42 said:

Does not interact with Kopernicus -- if you install CA and Kopernicus, you'll have two completely independent asteroid systems.

Next release would be happy to merge in support to shut off stock and Kopernicus Asteroid generators via modulemanager config, if that'd be helpful to you.

Actually, I'm half-considering just making this the project I advise when people ask for "improved control over comets," because I'm having a heck of a time getting them working, and you seem to have done a lot of what people want here.

Thoughts, people?

Edited by R-T-B
Link to comment
Share on other sites

On 1/30/2021 at 10:54 PM, R-T-B said:

Next release would be happy to merge in support to shut off stock and Kopernicus Asteroid generators via modulemanager config, if that'd be helpful to you.

Actually, I'm half-considering just making this the project I advise when people ask for "improved control over comets," because I'm having a heck of a time getting them working, and you seem to have done a lot of what people want here.

Thoughts, people?

Honestly I have mixed feelings about Kopernicus turning comet control over to Custom Asteroids entirely; I said a few words about why on the Kopernicus Unified branch. I'm all in favor of the asteroid generator flag you propose, though, since previously avoiding conflicts between the two mods has involved some awkward MM deletions, and having a sanctioned solution would be much better.

8 hours ago, Wolves_Hero said:

No asteroids on around Beyond Home (planets mods) & random asteroids on Galaxies Unbound: A Stellar Odyssey (stars mods), can't find how edit or add  asteroids

Custom Asteroids defines its asteroids/comets in text files in the KSP directory. The default files in GameData/CustomAsteroids/config are all designed for the stock system, so for a total conversion mod like Beyond Home I'd expect them to produce nothing but error messages. You'll probably want to delete them (or move them somewhere outside the KSP directory if you want to keep them as examples).

I've provided some instructions for what the asteroid config files should look like, so I suggest starting there. I realize the instructions are a bit poorly organized; rewriting them to be clearer and easier to navigate is getting close to the top of my to-do list. I hope they help in the meantime.

Edited by Starstrider42
Link to comment
Share on other sites

In my own upcoming career Im starting soon, I'm using Kopernicus and OPM.  I like the stock game, so my inner system and the asteroids/comets there , I let stock do stock things.. I then have the OPM as the bonus far/long game.  From what I can see, using CA to do asteroids and comets stuff for the OPM regions would be nice, but I'm unclear if they overlap (Stock, OPM/Kopernicus, CA) and I'll end up with stray comets and asteroids all over the place.  Can someone explain how these would work together?

As far as the Kopernicus switch goes, and CA interaction, why not divide what each mod does well, and leave it to the other to do what it does best?  Kopernicus handles stars planets moons, CA handles comets and asteroids?

I'd think it keeps Kopernicus code less entangled and easier to maintain, and do the same for CA -- that way neither of them have to interact with each other nor do much more with stock than they already do.  And that sets the planet pack authors for better maintenance by using 2 well functioning and well known systems to implement the planets and moons (Kopernicus) and comets and asteroids (CA) for their customized systems. 

Planet packs ride on Kopernicus, and comets and asteroids ride on CA.  Is that too overboard?

Edited by Murdabenne
clarification
Link to comment
Share on other sites

21 hours ago, Murdabenne said:

In my own upcoming career Im starting soon, I'm using Kopernicus and OPM.  I like the stock game, so my inner system and the asteroids/comets there , I let stock do stock things.. I then have the OPM as the bonus far/long game.  From what I can see, using CA to do asteroids and comets stuff for the OPM regions would be nice, but I'm unclear if they overlap (Stock, OPM/Kopernicus, CA) and I'll end up with stray comets and asteroids all over the place.  Can someone explain how these would work together?

That's a complicated question because there's multiple options on either side, so bear with me. Though you're at least in little danger of getting "stray" objects no matter what you do.

I should start by pointing out that there are actually two stock asteroid systems: the basic one that produces Kerbin intercept asteroids, Drestroids, and most comets, and the one associated with the Sentinel telescope. Depending on how you set the new Kopernicus switch:

  • if UseKopernicusAsteroidSystem = true, you will have neither the basic nor the Sentinel spawner. If you also have Custom Asteroids installed, both the Kopernicus and CA spawners would run. Whether they overlap would depend on which asteroids each is configured with (see below).
  • if UseKopernicusAsteroidSystem = false, you will also have neither stock spawner. If you have Custom Asteroids installed, it will work alone.
  • if UseKopernicusAsteroidSystem = stock but Custom Asteroids is installed, you will not have the basic spawner (which CA turns off), but will still have the Sentinel spawner. Sentinel will behave exactly like it does in stock, without using Custom Asteroids configs.

None of these options let you use the basic spawner for some asteroids and Custom Asteroids for others, but both Kopernicus and Custom Asteroids can emulate stock behavior with their own systems.

In the case of Custom Asteroids + OPM, there are five asteroid packs involved:

  • Stockalike.cfg ("stockalike config" in CKAN) -- this one produces Kerbin intercept asteroids, Drestroids, and comets. To be more (but not perfectly) stock-like, it avoids some Custom Asteroids features, such as composition classes. It's installed by default if you download Custom Asteroids as a zip, and automatically recommended if you install from CKAN.
  • Basic Asteroids.cfg ("inner stock system") -- this one produces asteroids at Jool's orbit and inward, including Jool Trojans and an asteroid belt. It's included in a separate directory in the zip file, but it sounds like you don't want it.
  • Trans-Jool.cfg ("outer stock system") -- this one produces a Kuiper belt just outside Jool's orbit. It is not compatible with OPM, and CKAN won't let you install them together. If you're downloading Custom Asteroids directly, it's in the same place as Basic Asteroids.
  • OPM-Reconfig.cfg ("alternative OPM config") -- this one adds moonlets to Jool through Neidon, emulating OPM's Kopernicus config. It turns off the Kopernicus configs it duplicates, so there should be no conflict. This one's not included in the zip file, but you can download it from a link in the OP, or through CKAN.
  • Trans-Neidon.cfg ("Kuiper belt analog for OPM") -- this one produces Kentaurs and a Kuiper belt outside Neidon's orbit, and also rescales the Stockalike.cfg comet orbits to fit the larger solar system. It's available from the same places as OPM-Reconfig.

So the main danger of overlap is between my Stockalike.cfg and the corresponding Kopernicus asteroids, if you've set UseKopernicusAsteroidSystem = true. You can avoid it either by setting UseKopernicusAsteroidSystem = false, or by not installing Stockalike.cfg. In the latter case, I assume OPM will rescale the stock comets itself once it officially supports KSP 1.10, but I don't think it does yet.

Sorry if that's a bit long-winded, but hopefully you see a combination that does what you want.

Edited by Starstrider42
Link to comment
Share on other sites

On 2/3/2021 at 4:58 AM, Starstrider42 said:

 

Custom Asteroids defines its asteroids/comets in text files in the KSP directory. The default files in GameData/CustomAsteroids/config are all designed for the stock system, so for a total conversion mod like Beyond Home I'd expect them to produce nothing but error messages. You'll probably want to delete them (or move them somewhere outside the KSP directory if you want to keep them as examples).

I've provided some instructions for what the asteroid config files should look like, so I suggest starting there. I realize the instructions are a bit poorly organized; rewriting them to be clearer and easier to navigate is getting close to the top of my to-do list. I hope they help in the meantime.

Worked now just spawn, but look huge asteroids on size A tiny is weird how change size.

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