Jump to content

Asteroid generation


qzgy

Recommended Posts

So I have a question - how are asteroids persistence file? Its not like its a separate part, so how is the surface geometry and so on defined?

Adding on to that, is there anyway to reliably make a magic boulder asteroid or change it to one? Thanks.

 

I don't know if this is the right place. Mods, feel free to move

Link to comment
Share on other sites

From what I understand, asteroids have a random, procedurally generated shape.  That lets the game store the asteroid in very little data space, hence be able to simultaneously track dozens (or potentially hundreds, depending how persistent you are in hunting for them) and display the same rock the same way if (as you might do after capturing one for fuel mining) you visit it more than once.

I have no genuine information, but I'd bet the only way to make an ordinary asteroid into a magic boulder would be to edit the save file after "discovering" the rock -- though it might be possible to edit the save file or change a setting to alter the frequency of occurrence of magic boulders.

Link to comment
Share on other sites

@Zeiss Ikon is correct -- asteroid properties are encoded as a random seed and a size class in the save file. You can find this info by searching a save file for "ModuleAsteroid" (note: these numbers are not generated or stored for unvisited asteroids). AFAIK magic boulder status is derived from the seed, so you'd have to try values and get lucky.

If you want to change the *probability* of an asteroid becoming a magic boulder, use e.g. ModuleManager to change the secondaryRate field in the asteroid's part config.

Link to comment
Share on other sites

  • 4 years later...
On 5/17/2017 at 4:49 AM, Starstrider42 said:

@Zeiss Ikon is correct -- asteroid properties are encoded as a random seed and a size class in the save file. You can find this info by searching a save file for "ModuleAsteroid" (note: these numbers are not generated or stored for unvisited asteroids). AFAIK magic boulder status is derived from the seed, so you'd have to try values and get lucky.

If you want to change the *probability* of an asteroid becoming a magic boulder, use e.g. ModuleManager to change the secondaryRate field in the asteroid's part config.

Hi, I'm pretty new to ksp, could you explain in more detail how to change the probability of an asteroid becoming a magic boulder please?

Link to comment
Share on other sites

Assuming you have ModuleManager installed (if you use any mods, you probably do), you can create a script like the following and put it somewhere in your KSP/GameData/ directory (e.g., GameData/Matteoksp/magicboulder.cfg):

@PART[PotatoRoid]:FINAL {
    @MODULE[ModuleAsteroid] {
        %secondaryRate = 0.05
    }
}
@PART[PotatoComet]:FINAL {
    @MODULE[ModuleComet] {
        %secondaryRate = 0.05
    }
}

This will change both asteroids and comets to whatever probability you give.

Link to comment
Share on other sites

On 11/21/2021 at 9:25 PM, Starstrider42 said:

Assuming you have ModuleManager installed (if you use any mods, you probably do), you can create a script like the following and put it somewhere in your KSP/GameData/ directory (e.g., GameData/Matteoksp/magicboulder.cfg):

@PART[PotatoRoid]:FINAL {
    @MODULE[ModuleAsteroid] {
        %secondaryRate = 0.05
    }
}
@PART[PotatoComet]:FINAL {
    @MODULE[ModuleComet] {
        %secondaryRate = 0.05
    }
}

This will change both asteroids and comets to whatever probability you give.

Thanks I discovered you can also modify it directly from ModuleManager.ConfigCache or from the save file if u already entered physics range

 

Link to comment
Share on other sites

  • 1 month later...

Oh gosh JADE OF MAAR!

On 5/17/2017 at 10:49 AM, Starstrider42 said:

@Zeiss Ikon is correct -- asteroid properties are encoded as a random seed and a size class in the save file. You can find this info by searching a save file for "ModuleAsteroid" (note: these numbers are not generated or stored for unvisited asteroids). AFAIK magic boulder status is derived from the seed, so you'd have to try values and get lucky.

If you want to change the *probability* of an asteroid becoming a magic boulder, use e.g. ModuleManager to change the secondaryRate field in the asteroid's part config.

The chance of a magic asteroid is 1 in 20, and you cn change it.  What happens it you set secondary rate to >1?

Will it have 100% magic bolders, or none?

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