Progress Update #6
Small Improvements
The past few days I've ben working on extras 2 and 3 from the last blog post: making the planet settings save as they should, and making the water look better.
Planet Settings:
Before now, the planet settings were instanced meaning that they couldn't be saved to disk. They were only instanced because the UI in Unreal lets you edit the instance of the data asset directly from the details panel of the actor that it is applied to. However, this had the side-effect that the instances would reset every time the launcher was reopened. This became very time consuming to reinput all of the settings every time I wanted to test something. Because of this I decided to make them non-instanced and spend some time making sure that the assets would save/load to/from disk.
This process was not too difficult, just time consuming. I removed all of the "DefaultToInstanced" and "EditInlineNew" specifiers from the UCLASS of all of the data assets. After that I just had to create all of the assets through my CreateSettingsAsset function. You can see every asset being created in my shortcut function CreateSettingsAssets() in Planet.cpp which goes through all of the data assets that could exist on the planet and if they don't already exist then it calls CreateSettingsAsset and assigns it.
This is a super handy feature and it even organizes the assets in the asset explorer according to what planet they belong to.
While I was working on all of this stuff involving packages I revisited the problem with saving the static mesh from the last blog post. When I was creating all of the packages for the data assets I realized that I hadn't done the same for the static mesh or more importantly the new material that I was creating for the mesh. I realized the reason I got that error dialogue last time was because it defaulted the package for the material to be the scene package. Making the material it's own package makes it save without any further manual intervention.
Water Shader:
As I mentioned last time, the water shader that I am trying to emulate is one that I found from a reddit post that turns one noise texture into a water shader. I did end up making my own version of it with some minor tweaks that made it look better on a spherical planet than a flat plane. Though when I did this I thought it looked kind of weird because the water would all flow in the same direction which would break the illusion because you could see the water hitting shore on one side of land and then coming out the other side at the same angle. So I decided to look into a way to have the water all go towards shore and look more natural.
I stumbled across this solution which was cool for two reasons. It worked (more or less), and the site it was hosted on is like a pastebin for blueprints! I will definitely use the site to show off my finished result when it's ready.
Now, the reason I don't say it worked perfectly is because while the noise version of water worked on its own and the shore panning worked on it's own, they didn't really want to work when I put them together. This resulted in some strange things happening:
Current "working" state:
I still have a lot of kinks to iron out here but I will say that when it decides to play nice it looks a lot better than just flat colors.
More:
This is where I plan to leave this project for the week. For the rest of the week I plan to start work on a game-jam I'm doing with some friends with the theme 'Jade' (currently thinking of something where jade stone is broken into little pieces as Wikipedia lists its fracture as splintery but I'll see where that idea goes). Then when that's done I plan to return to the space game and finally try my hand at an orbit spline.
Comments
Post a Comment