Progress Update #30
Improving Visuals
During this week's sprint I fixed lighting on the asteroids, fixed a rendering bug with the orbit visualization, and made the store page look a little nicer.
Asteroid Lighting
Refresher for asteroids: All asteroids in game are part of Niagara particle systems. They use a mesh renderer with a standard cube mesh. The shader applied to the mesh applies tessellation and noise based world displacement which shifts the tessellated vertices to give the illusion of detail. This approach was great because the mesh only had to be rendered with 6 faces but you were still able to get a detailed looking result.
The problem that I soon ran into with this approach is that lighting is calculated by the faces of the base mesh, not the tessellated faces. This then resulted in very harsh lighting which was very distracting.
I spent lots of time trying to figure out a way to apply the lighting to tessellated faces but it jus wasn't happening. This is when I reverted to the tried and true way of optimizing meshes; LODs.
I whipped up three quick asteroid meshes in blender and imported them into Unreal. I then used this guide to add a few LODs based on the "SmallProp" preset. This reduced the meshes from 768 tris to 16. Then I set these meshes in the mesh renderer in the Niagara system and realized that there was no way to use LODs in a Niagara system (or at least that I could find). It isn't really the end of the world though as I was still able to run at near 120fps in the editor so it will stay for now but it's really bugging me that the game will always use the "high-poly" LOD even if the asteroid is on the other side of the solar system.
I also couldn't figure out how to get Niagara to spawn one of a selection of meshes in the mesh renderer even though the renderer takes an array of meshes it would always spawn the first one, so problem for another time I guess.
Orbit Visualization
This again has to do with the Niagara ribbon method of rendering the orbits. To sum it up, occasionally, but not always, when the orbits were drawn using the ribbon method the ribbon would loop back on itself and make the visualization pretty useless:
Here's an exaggerated example with some sample data |
Through the attribute spreadsheet and Copy For Excel features I was able to take this particle data into Excel and find that some particles that were representing points later in the orbit were being spawned too soon. My theories (which I have not tested) are that 1) the spawning of the ribbons was multithreaded and it was a race condition (this one is less probable) or 2) that because I was spawning the ribbons so fast that there was some compute error which caused the ribbons to e spawned out of order.
I ended up fixing the issue by addressing theory 2 and making the spawn-rate base itself off the number of points in the orbit. I tested it and it works perfectly fine until ~50k points. This is functionally OK as 50k points at full accuracy gives ~7min prediction of the orbit but I am puzzled as to why it's happening again.
Store Page
For the store page I looked at some other games on itch.io and made a list of things I wanted the page to have:
- Custom Banner
- Custom Background Image
- Font
- Screenshots (3-5)
- Dev-blogs
- Tags
- Trailer
- Description
- Tagline
- Paragraph introduction
- Interesting gif
- Bullet point feature list
Writing the description was fine but putting in the gif was a massive headache. My plan was to make a short little video spinning a camera around a few planets then export it as a gif. When I went to upload the gif though I realized that they only accepted a maximum of 3MB... mine was over 10. I spent the next like half hour trying different render and compression settings until I finally made one that was 2.9MB. The color sucks, it's small, it's low framerate, but it works:
Here's a link for the store page as it is currently. Note that the downloadable version of the game is old, this is just a showcase of the store front.
Still in the production mindset I finished off this sprint with a credits menu and nod to one of my favorite games.
The credits were pretty simple to write as I am the only person who has worked on the game, but I did need to credit a few other people like Sebastian Lague who came up with the original terrestrial planet generation algorithm and Dimas Leenman who wrote the atmosphere shader. As well as I need somewhere to thank the play-testers that will help me polish the game before release. I spent most of the rest of the time making aminations for opening and closing the credits as well as scrolling automatically or manually.
The other thing that I did was place some angled bobbing yellow text next to the title that reads a random line from a file any time the game is opened ;)
Comments
Post a Comment