Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Games Asteroid / Mini World Generator for Sci Fi Shooter

Discussion in 'Projects In Progress' started by DA-PaoPao, Aug 15, 2023.

  1. DA-PaoPao

    DA-PaoPao

    Joined:
    Aug 13, 2021
    Posts:
    10
    I have been working for the past year on a project to generate asteroid worlds for use in a sci-fi shooter game. The asteroids revolve around a red dwarf star and have been colonized by the local alien life for mining purposes and subsequently abandoned.

    The generator

    I first generate a spheroid mesh and use a (heavily) modified version of Map Magic to apply craters and general noise to the shape.

    Around the large craters a road network is created plus an electrical grid. I have added some buildings, but these are still mainly placeholders.

    Between the craters, patches of vegetation are added.

    I have also added an atmosphere and some basic clouds.

    the average radius of the asteroid is between 150 and 200 meters, which means a surface area of between 0,25 and 0,5 km2.

    Here are some examples of a few generated asteroid.







    Current Features

    The asteroids are part of an active star system, which means the location in relation to the star is always different and therefore the lighting on the asteroid is always different and changes during the game. And because the star is a red dwarf, the light is a dimmer with an orange hue, which creates a nice “alien” atmosphere.








    I have also created/added some tools to add random variations to meshes.

    Such as a tool to bend meshes to simulate (car) impacts,




    A tool that generates breakpoints in meshes to add some random damage,





    And an ivy generator, that curls around meshes, which can be seen in some of the pictures above already.


    Roadmap for the project

    Now I want to focus on creating more buildings, such as living spaces, bars, hospitals, warehouses etc. And I want to create more tools to signify that the asteroids worlds have been abandoned for some time.

    I am also working on a simple weather system to simulate weather conditions based on distance from the sun, asteroid rotation speed, etc.

    After the generated maps are of sufficient quality, I will work on turning it into an actual game.

    Any feedback is welcome.
     
    adamgolden, PolyMad and idunlop_oefun like this.
  2. DA-PaoPao

    DA-PaoPao

    Joined:
    Aug 13, 2021
    Posts:
    10
    Little Update

    I worked on a road sign system, which are generated at intersections.

    The writing is in an “alien” language I am working on for the game. As the game takes place in a different star system, it would be weird if “they” were using English .

    The road signs give directions to neighboring areas. Areas are based on the circular roads around large craters.

    The top section shows the distance, and the bottom section shows what type of buildings can be found in that area (restaurants, bars, medical center, etc.).

    The words that are painted on top of the signs are usually profanity .




    In the game I am planning to make, the road signs can help the player get some direction and find important buildings (such as medical centers), although you do have to know the language before you will be able to read the signs.
     
  3. PolyMad

    PolyMad

    Joined:
    Mar 19, 2009
    Posts:
    2,350
    Hi, interesting project, I only contest the vegetation that looks far too Earthly... but I guess that as it's a WIP, those are placeholders.
    I would also change a bit the colors and make the whole lighting a bit more... alive.
     
  4. DA-PaoPao

    DA-PaoPao

    Joined:
    Aug 13, 2021
    Posts:
    10
    Thanks for your comments.
    Regarding the vegetation. I use plants and trees from Manufactura K4 - Alien Fantasy Forest asset. So, the plants and trees are non-earth like. I read on a worldbuilding forum that vegetation around red dwarf stars might be purple. So, I will probably change the colors on the textures to get purple vegetation.

    Here I added a purple color to the materials, gives you some idea. the ground texture is still green, so it is not complete.


    Regarding the lighting, I want to make the lightning somewhat scientifically accurate.
    I use Luyten's Star as the template for my star system. It has a color temperature of 3150K, which means there is not much blue in the light (it more or less corresponds to RGB 255, 184, 114), so blue skies etc. are out of the question.

    I chose Luyten's star because I found some papers that state that there could be an asteroid belt between the 2nd and 3rd planet with Semi Mayor axis starting around 0.1 AU. In the above image I move the asteroid slightly closer to the sun at 0.11 AU. Luyten's Star has a luminosity of 0.0088 L☉. The intensity of the light at 0.11 AU = 1/ (0.11 * 0.11) * 0.0088 = 0.7272.

    I did have a problem finding what the intensity of (earth) sunlight should be in Unity. I went with 1.5. So, for the above example the unity light intensity is 1.09. If anybody has a better value for earth sunlight, I can change that in the formula.

    I am planning on adding more artificial lighting, mainly in the form of advertising signs, neon-style lighting, etc to liven things up a little.
     
  5. PolyMad

    PolyMad

    Joined:
    Mar 19, 2009
    Posts:
    2,350
    Cool. But unless you are creating a flat out SIMULATION, I suggest you to pump a bit the lighting to make it more interesting. Otherwise people will just get bored of it...
     
  6. DA-PaoPao

    DA-PaoPao

    Joined:
    Aug 13, 2021
    Posts:
    10
    I will definitely add more artificial lighting, only problem is that the map is generated, so I cannot "bake" lights. So shadows and performance might become problem. But I think there are some assets available that don't require baking.

    I will also see if I can find some more info on what the intensity of a light in Unity should be to mimic sunlight (at 12:00 at the equator), maybe should be more then 1.5.

    I also just had a thought that I should research if solar panels work around red dwarf stars, else would be a bit silly to place them in the map :).

    Thanks for your comments
     
  7. DA-PaoPao

    DA-PaoPao

    Joined:
    Aug 13, 2021
    Posts:
    10
    I have some more updates.

    I looked some more into vegetation colors around red dwarf stars. not everybody agrees on this subject. But purple came up a few times, and I think that will probably look best. (Others said it should be black, which would make everything even more dark )

    So I wrote a small script to change the green colors in my vegetation textures to purple.




    I think it looks quite okay.


    The asset I use for the star Background stopped working for some reason. And since it was a placeholder anyway, I started working on a new star-map Background first. My plan was to use actual star location data to generate the star-map. For this I used the HYG database, available at The Astronomy Nexus (astronexus.com).

    Compared to earth Luyten's Star has a more interesting star sky. On earth the brightest star is Sirius, with an apparent magnitude of −1.46. But Luyten' Star is only 1,2 lightyears away from Procyon, which gives it an apparent magnitude of -4,5, which makes it 16.44 time brighter. And Sirus itself has an apparent magnitude of -2.3 from Luyten's Star. So, all in all I think it would be a shame to not use that fact and use a generic star background instead.
    Sol (our sun) has an apparent magnitude of 2.75 from Luyten's Star, so it is visible, but not distinguishable, I'm afraid .





    I still want to add some nebulas etc., but that is for later.


    I also added upon my meshbender Program, to bend meshes in 3d. So now I can add crashed cars to the damaged signposts. I also added some lights to the signs.




    Thats it for now