1. This forum is obsolete and read-only. Feel free to contact us at support.keenswh.com

How-To: Create Custom Asteroid with Vanilla Ore Generation

Discussion in 'Modding Guides and Tools' started by phoneboi, Aug 4, 2014.

Thread Status:
This last post in this thread was made more than 31 days old.
  1. phoneboi

    phoneboi Trainee Engineer

    Messages:
    6
    I made a discovery while playing around with generating custom asteroids using real-world data.
    A custom scenario can be used to generate ore resources inside custom asteroids using the vanilla worldgen functionality.


    Step 1: Create a Custom Asteroid
    This guide assumes you have already created a custom asteroid file. I will be using a voxelmap of the 67P/Churyumov–Gerasimenko comet. The asteroid is solid and is made up of 100% Stone_01.

    [​IMG]
    <em style="color: #008080;">-Download Example Asteroid-</em>

    For help creating a custom asteroid, see:
    How to make your own Asteroid and how to import it to SE by Balmung
    https://forums.keenswh.com/post/how-to-make-your-own-asteroid-and-how-to-import-it-to-se-with-sculptris-6885151

    SE Toolbox by midspace

    https://forums.keenswh.com/post/?id=6638984


    Step 2: Setup a custom Scenario
    Create a new scenario by modifying*: [FONT= &#39]\Content\Data\Scenarios.sbc
    [/FONT]
    -Download Example Scenario-

    *WARNING: This will modify a stock file, always make a backup!
    Modifying a stock file can result in game crashes or unpredictable behavior.
    Changes may be lost in future updates to Space Engineers.

    Code:
        &lt;ScenarioDefinition>
          &lt;Id>
            &lt;TypeId>ScenarioDefinition&lt;/TypeId>
            &lt;SubtypeId>AsteroidBlues&lt;/SubtypeId>
          &lt;/Id>
          &lt;DisplayName>Asteroid Blues&lt;/DisplayName>
          &lt;Description>ToolTipWorldSettingsScenarioAsteroidBlues&lt;/Description>
          &lt;Icon>Textures\GUI\Icons\scenarios\PreviewAsteroidBlues&lt;/Icon>
          &lt;AsteroidClusters Enabled="false" />
          &lt;WorldGeneratorOperations>
             &lt;Operation xsi:type="AddAsteroidPrefab" PrefabFile="hopebase512" Name="Generated0">
              &lt;Position x="-20" y="-110" z="-60" />
            &lt;/Operation>
          &lt;/WorldGeneratorOperations>
        &lt;/ScenarioDefinition>
    
    For help with custom scenarios, see:
    [Tutorial] How To Make Custom Scenarios by glitchaj
    https://forums.keenswh.com/post/tutorial-how-to-make-custom-scenarios-6855157
    <div>

    Step 3: Replace Stock Asteroid
    The key to this process is the AddAsteroidPrefab world generation option. It does not appear possible to use a custom .vox file yet, but it is possible to rename and replace a stock file* with a custom one.

    Rename your custom .vox file to the corrisponding stock file in the scenario definition:

    [FONT= &#39]&lt;Operation xsi:type="AddAsteroidPrefab" PrefabFile="hopebase512" Name="Generated0">[/FONT]
    • [FONT= &#39]custom_asteroid.vox -> hopebase512.vox[/FONT]
    Now copy and overwrite* the file: \[FONT= &#39]Content\VoxelMaps\hopebase512.vox [/FONT]

    *WARNING: This will modify a stock file, always make a backup!
    Modifying a stock file can result in game crashes or unpredictable behavior.
    Changes may be lost in future updates to Space Engineers.
    • As of 01.041.015, hopebase512.vox does not appear to be used in any vanilla scenarios.



    Step 4: Create Asteroid with Vanilla Ore Generation

    Start a new custom game, selecting the scenario created above.
    Select the desired game options and click OK.
    Wait as the game transforms your boring stone asteroid to an ore-rich, survival-worthy resource!

    After saving, you can copy the ore-generated asteroid file from the saves directory:
    [FONT= &#39]
    %AppData%\Roaming\SpaceEngineers\Saves\&lt;steamid>\&lt;savegamename>\Generated0.vox
    [/FONT]

    [​IMG] [​IMG]
    <div>

    Code:
    [FONT= &#39]Material        Mass            Percent[/FONT]
    [FONT= &#39]Iron_01         6,298,163.22 m³       [/FONT]58.47 %
    [FONT= &#39]Stone_01        1,872,522.60 m³       [/FONT]17.38 %
    [FONT= &#39]Uraninite_01      [/FONT][FONT= &#39]482,312.62 m³[/FONT][FONT= &#39]        [/FONT]4.48 %
    [FONT= &#39]Cobalt_01         448,040.13 m³        [/FONT]4.16 %
    [FONT= &#39]Nickel_01         [/FONT][FONT= &#39]430,022.98 m³[/FONT][FONT= &#39]        [/FONT]3.99 %
    [FONT= &#39]Magnesium_01      [/FONT][FONT= &#39]299,640.93 m³[/FONT][FONT= &#39]        [/FONT]2.78 %
    [FONT= &#39]Gold_01           283,231.65 m³        [/FONT]2.63 %
    [FONT= &#39]Silicon_01        254,979.86 m³        [/FONT]2.37 %
    [FONT= &#39]Silver_01         243,599.40 m³        [/FONT]2.26 %
    [FONT= &#39]Platinum_01       158,879.78 m³        [/FONT]1.48 %
    
    -Download Generated Asteroid-

    Also available in my Steam Workshop
    For help importing a custom asteroid to your game, see:
    How to make your own Asteroid and how to import it to SE by Balmung
    https://forums.keenswh.com/post/how-to-make-your-own-asteroid-and-how-to-import-it-to-se-with-sculptris-6885151

    SE Toolbox by midspace

    https://forums.keenswh.com/post/?id=6638984



    Credits
    </div>67P/Churyumov–Gerasimenko model by:
    Herique, A. Rosetta rendezvous and CONSERT operations
    https://ipag.osug.fr/~heriquea/CHIMERIA_4_V1.obj

    How to make your own Asteroid and how to import it to SE by Balmung
    https://forums.keenswh.com/post/how-to-make-your-own-asteroid-and-how-to-import-it-to-se-with-sculptris-6885151

    SE Toolbox by midspace
    https://forums.keenswh.com/post/?id=6638984

    [Tutorial] How To Make Custom Scenarios by glitchaj
    https://forums.keenswh.com/post/tutorial-how-to-make-custom-scenarios-6855157


    </div>
     
  2. DaePrice

    DaePrice Apprentice Engineer

    Messages:
    134
    Just for clarification; once the custom asteroid is created, you can export it via SE Toolbox into other custom maps, or into an export file.

    -If you had properly backed up your re-defined stock asteroid, can you return the game to its original content without the newly generated asteroid being invalid?
    -Can the newly created custom asteroid be added to your default list of asteroids so that newly generated maps can call on this custom asteroid as part of its map generation?
    -Is the asteroid shared when the map is shared? AKA, if i make a server that contains the custom asteroid, will it propagate to the clients in a reasonable timeframe, if at all?
     
  3. phoneboi

    phoneboi Trainee Engineer

    Messages:
    6
    You can also manually copy the .vox file from the savegame directory.
    I keep a separate folder of custom vox files so I can easily import them into new worlds.

    From my experience, updates do not clear custom files from the Content directory.
    It is still a good idea to keep a backup of custom files outside of SE directories.

    Not at this time. The default list of asteroids used for random generation is internal to the game engine. You could accomplish this by replacing the stock asteroids with your own custom vox files. You could also break your game in the process.

    Yes. Functionally, there is no difference between a custom asteroid and a stock one. Adding custom asteroids to maps is not new. This is just a method of using the game engine's code for ore-generation.
     
  4. MSI

    MSI Junior Engineer

    Messages:
    636
    Very nice!! Excellent share! Thank you!!
     
  5. DaePrice

    DaePrice Apprentice Engineer

    Messages:
    134
    Thanks for the quick clarification phoneboi!
     
  6. mrkarp

    mrkarp Trainee Engineer

    Messages:
    16
    You sir, are a god, this is exactly what I was looking for!
     
  7. aRottenKomquat

    aRottenKomquat Apprentice Engineer

    Messages:
    351
    Could this be used with SEToolbox somehow to generate a scattered asteroid field using default ore generation?
     
  8. roophio

    roophio Trainee Engineer

    Messages:
    24
    magnificent! thank you!
     
Thread Status:
This last post in this thread was made more than 31 days old.