R-T-B / Kopernicus

Kopernicus is a mod for Kerbal Space Program which allows users to replace the planetary system used by the game.
GNU Lesser General Public License v3.0
32 stars 11 forks source link

Comets are not defined in the system.cfg along with asteroids #24

Open WhirligigGirl opened 4 years ago

WhirligigGirl commented 4 years ago

Could this be related to how stock asteroids and comets seem to be spawning alongside my intended asteroids? Usually to get rid of stock asteroids you would simply remove the stock asteroid node with:

@Kopernicus
{
    !Asteroid[Stock]{}
}

My assumption is that to make comets work, the stock asteroids and comets were hardcoded somehow rather than their existence being determined by their presence in system.cfg. But I dunno.

But I do have not just extra comets, but extra unwanted asteroids on a collision course with my homeworld's SOI (as in stock, but which I should have removed)

WhirligigGirl commented 4 years ago

"UseStockAsteroidGenerator = true" what exactly does this setting do? My guess is, as it ties into my earlier assumption, that it enables stock asteroids instead of using System.cfg.

drake127 commented 4 years ago

Yes, in "old" Kopernicus, only Kopernicus asteroids were spawned. This broke comets and SENTINEL spawns. As a workaround, Stock spawn is on by default and there's a new option to disable it if necessary.

WhirligigGirl commented 4 years ago

First: I'm pretty sure SENTINEL spawns worked in old kopernicus (I remember using them in Alternis Kerbol Rekerjiggered, but I could be misremembering). Second: comets should be made part of the system.cfg instead of having a semi-hardcoded "on" or "off" for them. Makes more sense to put all of the generic asteroid and comet spawns in system.cfg and have a setting for SENTINEL spawns.

R-T-B commented 4 years ago

Yes, this was always planned. Comets will eventually be controllable. Just a matter of when I get around to it.

Since we are getting doubled spawns though, I should probably set kopernicus asteroids to be ignored if the stock generator is on. The current solution is more of a hack than a serious longterm solution.

R-T-B commented 4 years ago

The doubling of asteroids was dealt with in last release, now just to find out how to make comets spawn, and wrangle control of them.

drake127 commented 4 years ago

First: I'm pretty sure SENTINEL spawns worked in old kopernicus ...

I think that they worked until Kopernicus/Kopernicus turned off stock objects in some version. The game uses DiscoverableObjectsUtil for asteroids, comets and SENTINEL. Kopernicus reimplements asteroids (as seen from KSC) and Dres (I don't know conditions for that - I am yet to seen Dres asteroid).

The SENTINEL uses SentinelMission.ProcessSentinelScan() to spawn asteroids/comets. I am not a KSP modder so I have no idea whether the function can be hooked or redirected. Or maybe directly DiscoverableObjectsUtil.SpawnAsteroid() which would solve all our problems.

R-T-B commented 4 years ago

Over the next week, this'll be the first issue I attempt to tackle in Kopernicus 1.10.1 to get it moving towards a stable release (still a long road full of many things to go, but have to start somewhere).

After that, Jool shaders will probably be the next thing we need fixed. We need control over both these facilities to call it complete.

R-T-B commented 4 years ago

I'm working on this now. The current task is not so much to get a comet generator working (I basically have that in my source here), but figure out what the stock distribution works like, and declare it in a Kopernicus style node.

Working it out is hard, but it's happening.

R-T-B commented 3 years ago

This issue has been put on the backburner for now, but I am leaving the issue open even though it is not high priority with the new external discoverableObjects support to remind me to do it someday.