Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Galaxy Map (Galaxy Generation)

Discussion in 'Works In Progress - Archive' started by Simeon, Jan 12, 2015.

Thread Status:
Not open for further replies.
  1. Simeon

    Simeon

    Joined:
    Sep 26, 2012
    Posts:
    50
    Asset Store for Galaxy Generator (Galaxia)
    Demo of my progress on the plugin


    A galaxy map i made a while back (you can tell by the GUI buttons) for a exploration game, that never was.
    I thought it looked cool so i decided to share it.



    I use the shuriken particle system + Density wave theory to generate a spiral galaxy. Then i populate it with procedural generated planetary systems.

    For the star light i use a simple algorithm to convert Kelvins to RGB color depending on the temperature of the star. (don't mind the Borg ship)



    For the planetary atmosphere i use the implementation of O Nell's Atmospheric scattering





    The algorithm is not that complex, i can event modify it and make it a universal galaxy generator for spiral as well as none spiral galaxies I can even put it on the asset store if i see an interest in it.


     
    Last edited: Oct 27, 2015
    etaxi341, kittik, Farelle and 6 others like this.
  2. jason-fisher

    jason-fisher

    Joined:
    Mar 19, 2014
    Posts:
    133
    I need this.
     
  3. code-blep

    code-blep

    Joined:
    Oct 1, 2010
    Posts:
    308
    I like it Simeon! Can think of a few uses already :)
     
  4. Cdngater

    Cdngater

    Joined:
    May 29, 2014
    Posts:
    65
    I would be very interested in purchasing this either though the asset store, or personally. Simeon please PM me if you decide not to put this into the asset store so we can work out a deal.

    Thanks
     
  5. giraffe1

    giraffe1

    Joined:
    Nov 1, 2014
    Posts:
    300
    when you zoom in, do the stars still move in real time or is that a background of stars?
     
  6. Simeon

    Simeon

    Joined:
    Sep 26, 2012
    Posts:
    50
    everything is real time, just some trickery with multiple cameras.
     
  7. moure

    moure

    Joined:
    Aug 18, 2013
    Posts:
    184
    That looks awesome :) brings back memories from mass effect 1 galaxy map. I think it definetely deserves a spot in the asset store!
     
  8. thefinn

    thefinn

    Joined:
    Jan 2, 2015
    Posts:
    16
    That looks fantastic.
     
  9. impheris

    impheris

    Joined:
    Dec 30, 2009
    Posts:
    1,622
    finish the game... looks very nice
     
  10. Simeon

    Simeon

    Joined:
    Sep 26, 2012
    Posts:
    50
    I started working on a plugin. Here is a test, done with GPU particles Web Demo
    It has about 1 million stars, and the animation is in shader.
     
  11. moure

    moure

    Joined:
    Aug 18, 2013
    Posts:
    184
    It looks great ;)
    How do you plan to transform it into a plugin? I guess its a bit tricky to expand something specific into a plugin that could fit various projects.
     
    Johnny-Casual likes this.
  12. Simeon

    Simeon

    Joined:
    Sep 26, 2012
    Posts:
    50
    Indeed! I will mainly do the galaxy generation with modules to change the look and feel of the galaxy. I will do various utility tools like:
    • Building paths between stars, based on criteria.
    • Object loading based on distance, for large scale effects.
    • Noise modules for different kinds of star fields
    If you have suggestions on features, please let me know! I might event do some simple examples for uses, like a galaxy map or a rts.
     
    Johnny-Casual likes this.
  13. moure

    moure

    Joined:
    Aug 18, 2013
    Posts:
    184
    Actually the first thing that came to my mind was an editor window about planet customization. The user could deside across various options to be generated for the planets in his galaxy. For example you could add options like
    • Habited
    • Population
    • Minerals
    • Atmosphere Composition
    • etc.
    which can be affected by varius rules
    like distance from closest star, distance from center of the galaxy, rotation speed, etc.

    Thus someone who wants to create a mineral mining game could add only the options about minerals and create specific rules about them (e.g. if distance from star less than 15 the chance for gold is 40-60%), whereas someone that wants to create a strategy game could add only the population options with its corresponding rules.

    I think modular system like this could make the plugin usefull in multiple occasions ;)
     
  14. SirStompsalot

    SirStompsalot

    Joined:
    Sep 28, 2013
    Posts:
    112
    Expanding on moure's idea, I think the ability to add seeding modifiers to various astronomical objects is the way to go here. Planets are all well and good but we also have things like asteroids, comets, rogue planets and whatnot. Being able to seed the galaxy with a range of stars (1 million is awesome, but smaller as well, say 30,000 or so), range of number of planets (say 0 through 9), moons and so forth.

    I'm also curious to know how you're planning to handle nebula details, volumetric space fog (if at all) and navigating the galaxy map in 3D space?

    Very cool work. Keep us posted!
     
  15. Simeon

    Simeon

    Joined:
    Sep 26, 2012
    Posts:
    50
    The navigation is up to you, i will most likely include simple examples. But the plugin will be mainly for galaxy generation, the population and handling of planets will be up to you. I will just make it a lot easy to integrate into other projects. I might add nebulae and other astronomical objects.
     
  16. Alf203

    Alf203

    Joined:
    Dec 7, 2012
    Posts:
    461
    Sounds amazing !

    Just to let you know the shader in the demo doesn't work on mac, it shows as pink.
     
  17. Johnny-Casual

    Johnny-Casual

    Joined:
    Oct 7, 2014
    Posts:
    20
    I would like to see this in the store. Looks great!!
     
  18. kojiornk

    kojiornk

    Joined:
    Jan 31, 2015
    Posts:
    12
    Really impressive!
     
  19. Simeon

    Simeon

    Joined:
    Sep 26, 2012
    Posts:
    50
    I made a small demo, on my progress. Have a look: Link.
    For now I have just two types of galaxies. One is a spiral and the other is a Star Clusters.
    You can do unlimited layers of particles. And you can adjust size, color, rotation and all sort of stuff trough animation curves and gradients.
    In the future I might even add support for node editor for noise distribution.

    (Note that the particles use a geometry shader which is only available for DirectX 11, so for Mac I use Unity's Shuriken particle system)
     
    kojiornk likes this.
  20. HumbleRugDealer

    HumbleRugDealer

    Joined:
    Jan 31, 2015
    Posts:
    1
    mass effect!!
     
  21. Simeon

    Simeon

    Joined:
    Sep 26, 2012
    Posts:
    50
    Yes that was my main inspiration , and Liara of course :D
     
  22. ElectronicEva

    ElectronicEva

    Joined:
    Feb 2, 2015
    Posts:
    1
    It looks cool, but with more game elements it will be better!
     
  23. Simeon

    Simeon

    Joined:
    Sep 26, 2012
    Posts:
    50
  24. Simeon

    Simeon

    Joined:
    Sep 26, 2012
    Posts:
    50
  25. FreakForFreedom

    FreakForFreedom

    Joined:
    Jan 22, 2013
    Posts:
    156
  26. Simeon

    Simeon

    Joined:
    Sep 26, 2012
    Posts:
    50
    I thought it was a fair price. I might just lower it in the future.
     
  27. thoorne

    thoorne

    Joined:
    Jul 22, 2012
    Posts:
    64
    Is there any chance to make it OpenGL or even DX9 compatible? I'm getting pure black screen in Web Player on Macbook Air.
     
  28. derf

    derf

    Joined:
    Aug 14, 2011
    Posts:
    356
    The first video demonstrates a lot more than just galaxy generation. It shows planets with GUI elements in place to display planet name and some values of that planet, triangulate paths from one system to another again with a GUI implemented in the demo as well as graphics to pin point systems a player can zoom on to see the planets which rotate as well.

    Just how much of that is in this "plugin"?
     
    jason-fisher likes this.
  29. Simeon

    Simeon

    Joined:
    Sep 26, 2012
    Posts:
    50
    Just the Galaxy Generation, with shader optimisations. I've also included helper classes to quickly receive star positions. I also have create a simple example, of a galaxy map. In the future I might add helper algorithms for stat generation. But the plugin is mainly for general purpose, particle distributions.

    In the latest version i use a vertex shader for the particles. So everywhere a vertex shader would work, the plugin should work. But it seems i will have to write a Mac specific GLSL shader. (Update I did :D)
     
    Last edited: Feb 21, 2015
  30. Simeon

    Simeon

    Joined:
    Sep 26, 2012
    Posts:
    50
    I made a GLSL shader for OpenGL, it now should work on mac and ios. Please tell me if the demo isn't working on mac.
     
  31. danreid70

    danreid70

    Joined:
    Aug 28, 2010
    Posts:
    225
    If a stats GUI panel, and path lines between stars was included - as in that first video at top of page - you'll have me as another customer... It looks awesome! I've been hung up with other parts of my game, and have been holding off on this particular element. My own plan would have looked crude compared to this so I'm crossing my fingers that a configurable stats panel per object (star, planet, asteroid field, etc), and star paths (and orbit lines, too cool!) are added. It's exactly what I'm missing right now! :)
    Nice work, Simeon!!!
     
  32. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    demo not working on Mac. Just dark.
     
  33. thoorne

    thoorne

    Joined:
    Jul 22, 2012
    Posts:
    64
    I confirm @wetcircuit words, pure black with GUI only on MBA 2013 with Intel HD5000.
     
  34. Simeon

    Simeon

    Joined:
    Sep 26, 2012
    Posts:
    50
    I've updated the Web Demo, how about now ? Screenshots will be appreciated.
     
    Last edited: Feb 24, 2015
  35. GregMeach

    GregMeach

    Joined:
    Dec 5, 2012
    Posts:
    249
    Still nothing but the corner buttons (iMac w/AMD HD 6970M <- so it's not just Intel graphics). Since under the buttons the scene shows "DirectX 11", if true, it will never run on a Mac since we don't "do" Direct-anything :)
     

    Attached Files:

  36. GregMeach

    GregMeach

    Joined:
    Dec 5, 2012
    Posts:
    249
    Here's the fullscreen image
     

    Attached Files:

  37. Simeon

    Simeon

    Joined:
    Sep 26, 2012
    Posts:
    50
    It seems that even an OpenGL GLSL shader doesn't work. So I added the option to choose witch particles to use. The Unity Particles. Or the GPU particles.
     
  38. thoorne

    thoorne

    Joined:
    Jul 22, 2012
    Posts:
    64
    Works on Macbook Air, looks beautiful.
     
  39. Simeon

    Simeon

    Joined:
    Sep 26, 2012
    Posts:
    50
    I've created a Image Based distribution. And now any Galaxy can be done, from an image. The colors and Height can be controlled with an image.

    Here are some screenshots:


    And most importantly:
     
    FreakForFreedom likes this.
  40. Caedicus

    Caedicus

    Joined:
    Nov 28, 2011
    Posts:
    23
    Hi, I recently purchased this on the asset store. The galaxies look amazing, but I'm confused about a few things. Is this supposed to be a DX11 only asset, or can it older graphics cards with the Brute force shader? I ask because I am getting some errors if I don't have the DX11 check box selected in my player settings.

    Code (CSharp):
    1. [C:/buildslave/unity/build/Runtime/Shaders/Material.cpp line 883]
    2. (Filename: C:/buildslave/unity/build/Editor/Mono/Inspector/MaterialEditor.cs Line: 1022)
    3.  
    4. Material doesn't have a color property '_Color'
    5. UnityEditor.ShaderUtil:GetMaterialProperties(Object[])
    6. UnityEditor.MaterialEditor:GetMaterialProperties(Object[]) (at C:\buildslave\unity\build\Editor\Mono\Inspector\MaterialEditor.cs:1022)
    7. UnityEditor.MaterialEditor:ApplyMaterialPropertyDrawers(Object[]) (at C:\buildslave\unity\build\Editor\Mono\Inspector\MaterialEditor.cs:1228)
    8. UnityEditor.MaterialEditor:ApplyMaterialPropertyDrawers(Material) (at C:\buildslave\unity\build\Editor\Mono\Inspector\MaterialEditor.cs:1216)
    9. UnityEngine.Material:Internal_CreateWithShader(Material, Shader)
    10. UnityEngine.Material:.ctor(Shader) (at C:\buildslave\unity\build\artifacts\generated\common\runtime\ShaderBindings.gen.cs:167)
    11. Galaxia.ParticlesPrefab:CreateMaterial(GalaxyPrefab, Boolean)
    12. Galaxia.Galaxy:GenerateParticles()
    13. GalaxyGeneratorEditor.GalaxyEditor:OnEnable()
    14.  
    15. [C:/buildslave/unity/build/Runtime/Shaders/Material.cpp line 836]
    16. (Filename: C:/buildslave/unity/build/Editor/Mono/Inspector/MaterialEditor.cs Line: 1022)
    17.  
    18. Material doesn't have a texture property '_MainTex'
    19. UnityEditor.ShaderUtil:GetMaterialProperties(Object[])
    20. UnityEditor.MaterialEditor:GetMaterialProperties(Object[]) (at C:\buildslave\unity\build\Editor\Mono\Inspector\MaterialEditor.cs:1022)
    21. UnityEditor.MaterialEditor:ApplyMaterialPropertyDrawers(Object[]) (at C:\buildslave\unity\build\Editor\Mono\Inspector\MaterialEditor.cs:1228)
    22. UnityEditor.MaterialEditor:ApplyMaterialPropertyDrawers(Material) (at C:\buildslave\unity\build\Editor\Mono\Inspector\MaterialEditor.cs:1216)
    23. UnityEngine.Material:Internal_CreateWithShader(Material, Shader)
    24. UnityEngine.Material:.ctor(Shader) (at C:\buildslave\unity\build\artifacts\generated\common\runtime\ShaderBindings.gen.cs:167)
    25. Galaxia.ParticlesPrefab:CreateMaterial(GalaxyPrefab, Boolean)
    26. Galaxia.Galaxy:GenerateParticles()
    27. GalaxyGeneratorEditor.GalaxyEditor:OnEnable()
    28.  
    29. [C:/buildslave/unity/build/Runtime/Shaders/Material.cpp line 1122]
    30. (Filename: C:/buildslave/unity/build/Editor/Mono/Inspector/MaterialEditor.cs Line: 1022)
    31.  
    32. Material doesn't have a texture property '_MainTex'
    33. UnityEditor.ShaderUtil:GetMaterialProperties(Object[])
    34. UnityEditor.MaterialEditor:GetMaterialProperties(Object[]) (at C:\buildslave\unity\build\Editor\Mono\Inspector\MaterialEditor.cs:1022)
    35. UnityEditor.MaterialEditor:ApplyMaterialPropertyDrawers(Object[]) (at C:\buildslave\unity\build\Editor\Mono\Inspector\MaterialEditor.cs:1228)
    36. UnityEditor.MaterialEditor:ApplyMaterialPropertyDrawers(Material) (at C:\buildslave\unity\build\Editor\Mono\Inspector\MaterialEditor.cs:1216)
    37. UnityEngine.Material:Internal_CreateWithShader(Material, Shader)
    38. UnityEngine.Material:.ctor(Shader) (at C:\buildslave\unity\build\artifacts\generated\common\runtime\ShaderBindings.gen.cs:167)
    39. Galaxia.ParticlesPrefab:CreateMaterial(GalaxyPrefab, Boolean)
    40. Galaxia.Galaxy:GenerateParticles()
    41. GalaxyGeneratorEditor.GalaxyEditor:OnEnable()
    42.  
    43. [C:/buildslave/unity/build/Runtime/Shaders/Material.cpp line 1103]
    44. (Filename: C:/buildslave/unity/build/Editor/Mono/Inspector/MaterialEditor.cs Line: 1022)
    45.  
    46. Material doesn't have a texture property '_MainTex'
    47. UnityEditor.ShaderUtil:GetMaterialProperties(Object[])
    48. UnityEditor.MaterialEditor:GetMaterialProperties(Object[]) (at C:\buildslave\unity\build\Editor\Mono\Inspector\MaterialEditor.cs:1022)
    49. UnityEditor.MaterialEditor:ApplyMaterialPropertyDrawers(Object[]) (at C:\buildslave\unity\build\Editor\Mono\Inspector\MaterialEditor.cs:1228)
    50. UnityEditor.MaterialEditor:ApplyMaterialPropertyDrawers(Material) (at C:\buildslave\unity\build\Editor\Mono\Inspector\MaterialEditor.cs:1216)
    51. UnityEngine.Material:Internal_CreateWithShader(Material, Shader)
    52. UnityEngine.Material:.ctor(Shader) (at C:\buildslave\unity\build\artifacts\generated\common\runtime\ShaderBindings.gen.cs:167)
    53. Galaxia.ParticlesPrefab:CreateMaterial(GalaxyPrefab, Boolean)
    54. Galaxia.Galaxy:GenerateParticles()
    55. GalaxyGeneratorEditor.GalaxyEditor:OnEnable()
    56.  
    57. [C:/buildslave/unity/build/Runtime/Shaders/Material.cpp line 1026]
    58. (Filename: C:/buildslave/unity/build/Editor/Mono/Inspector/MaterialEditor.cs Line: 1022)
    59.  
    60. Material doesn't have a float or range property 'MySrcMode'
    61. UnityEditor.ShaderUtil:GetMaterialProperties(Object[])
    62. UnityEditor.MaterialEditor:GetMaterialProperties(Object[]) (at C:\buildslave\unity\build\Editor\Mono\Inspector\MaterialEditor.cs:1022)
    63. UnityEditor.MaterialEditor:ApplyMaterialPropertyDrawers(Object[]) (at C:\buildslave\unity\build\Editor\Mono\Inspector\MaterialEditor.cs:1228)
    64. UnityEditor.MaterialEditor:ApplyMaterialPropertyDrawers(Material) (at C:\buildslave\unity\build\Editor\Mono\Inspector\MaterialEditor.cs:1216)
    65. UnityEngine.Material:Internal_CreateWithShader(Material, Shader)
    66. UnityEngine.Material:.ctor(Shader) (at C:\buildslave\unity\build\artifacts\generated\common\runtime\ShaderBindings.gen.cs:167)
    67. Galaxia.ParticlesPrefab:CreateMaterial(GalaxyPrefab, Boolean)
    68. Galaxia.Galaxy:GenerateParticles()
    69. GalaxyGeneratorEditor.GalaxyEditor:OnEnable()
    70.  
    71. [C:/buildslave/unity/build/Runtime/Shaders/Material.cpp line 883]
    72. (Filename: C:/buildslave/unity/build/Editor/Mono/Inspector/MaterialEditor.cs Line: 1022)
    73.  
    74. Material doesn't have a float or range property 'MyDstMode'
    75. UnityEditor.ShaderUtil:GetMaterialProperties(Object[])
    76. UnityEditor.MaterialEditor:GetMaterialProperties(Object[]) (at C:\buildslave\unity\build\Editor\Mono\Inspector\MaterialEditor.cs:1022)
    77. UnityEditor.MaterialEditor:ApplyMaterialPropertyDrawers(Object[]) (at C:\buildslave\unity\build\Editor\Mono\Inspector\MaterialEditor.cs:1228)
    78. UnityEditor.MaterialEditor:ApplyMaterialPropertyDrawers(Material) (at C:\buildslave\unity\build\Editor\Mono\Inspector\MaterialEditor.cs:1216)
    79. UnityEngine.Material:Internal_CreateWithShader(Material, Shader)
    80. UnityEngine.Material:.ctor(Shader) (at C:\buildslave\unity\build\artifacts\generated\common\runtime\ShaderBindings.gen.cs:167)
    81. Galaxia.ParticlesPrefab:CreateMaterial(GalaxyPrefab, Boolean)
    82. Galaxia.Galaxy:GenerateParticles()
    83. GalaxyGeneratorEditor.GalaxyEditor:OnEnable()
    The galaxies are not generating without DX11 on either. It would be awesome if I could at least have the brute force method working (with maybe some warnings, but not errors) for people with older cards, but then support DX11 on higher cards. Or maybe I am just being dumb, and the complied game will still work on older graphics cards and automatically use brute force method? Either way, a little more information about what to do with these errors would be nice.

    Edit: A little more info. I think there might be a problem in ParticleBillboardBruteForce. It looks like it's targeting 4.0. So when I turn off DX 11 I guess it thinks my card doesn't support the shader, then it doesn't compile the shader and I get a lot of material errors.
     
    Last edited: Mar 24, 2015
  41. Caedicus

    Caedicus

    Joined:
    Nov 28, 2011
    Posts:
    23
    I was able to fix my issue by changing ParticleBillboardBruteForce to target shader version 3.0 instead of 4.0 and then changing sampler_mainTex from a SamplerState to sampler2D.
     
  42. Simeon

    Simeon

    Joined:
    Sep 26, 2012
    Posts:
    50
    Yes, i fixed it in the new versions of the plugin. There are 3 shaders as of now. The first one is for Direct X 11 only, the other is for any version of DirectX and the last one is written in Open GLs' GLSL. And in the latest version I made the shader switching automatic, and even added the ability to use the Shuriken Particles in GPU particles is deselected. It was needed for some Devices :D
     
  43. ivyroxy

    ivyroxy

    Joined:
    Mar 23, 2015
    Posts:
    38
    This... Is... AMAZING!

     
    theANMATOR2b likes this.
  44. Simeon

    Simeon

    Joined:
    Sep 26, 2012
    Posts:
    50
    Just made a Github repository for issues and requests:
     
  45. danreid70

    danreid70

    Joined:
    Aug 28, 2010
    Posts:
    225
    I'd purchase if GUI like first video was included... something like that is exactly what I need for scene/host-server selection/navigation! Any chance of including? Using new Unity GUI, of course...
     
  46. danreid70

    danreid70

    Joined:
    Aug 28, 2010
    Posts:
    225
    PS: are you using an external xml file or something similar to generate the navigatable systems and planets?
     
  47. Simeon

    Simeon

    Joined:
    Sep 26, 2012
    Posts:
    50
    No it's just random.

    I might do something simillar, and add it as an example scene.
     
  48. TheBullet

    TheBullet

    Joined:
    Mar 1, 2016
    Posts:
    28
    Hi Simeon

    I'm very interested in this asset., a few questions:
    -Finally the star map navigation has been added?
    - Does it work well on mobile devices?
    -There is a comment in the asset store that says it doesn't work on unity 5.3. Is it fixed?
     
  49. Simeon

    Simeon

    Joined:
    Sep 26, 2012
    Posts:
    50
    To be clear this is not the thread for the plugin, this is just a showing of a Galaxy Map.
    The plugin is for making galaxies. This hopefully answers your first questions. Although there is an example scene that adds basic galaxy map like navigation.

    It should work on mobile devices. The plugin was designed for desktop use and has a GPU accelerated particles, but I've also added support for Unity's particle system. So it should work anywhere the Unity particle system does. You will most likely need to lower the amount of particles quite significantly.

    It was last updated to work with unity 5.3.1 and I just tested it with the latest version that is 5.3.3 and it still works. I don't know who or why that comment exists on the asset store, but if you do have any problem you can contact me through email or open an Issue at the Issues page on Github
     
  50. Ravenshadow

    Ravenshadow

    Joined:
    May 16, 2013
    Posts:
    11
    Love the asset! Generates really nice looking galaxies.
    I'm looking at generating systems right now and I'm wondering if you know of any way to get "information" about the particles to help generate those systems.

    For example, I'd like to confine most of my planet systems to the arms of a spiral galaxy, larger stars I'd like to generate closer to the core (I suppose that ones easy to do), I'd like to clump stars together near clumps in the particles, calculate where nebulas or globular clusters would be based on where things clump up as well. Any ideas on how to achieve this with your asset?
     
Thread Status:
Not open for further replies.