1. Rocket Science
  2. News

Rocket Science News

Dev Update: Improving Procedural Texturing

Hello everyone!

Today I want to talk about a big improvement for “Rocket Science” in upcoming v0.16.0 update and show some progress I’ve made.

Since the release of the game I’ve tried to find a way to improve Earth’s surface texturing. It was based on procedural technique: I can set up and configure up to 32 material layers for the particular planet. For any given point of the rendered planet, the game selects four materials from the provided list, mixes and blends them together and then displays the resulting color on screen. Which four materials will be selected is basically determined by four curves: temperature, humidity, slope and height.

This is how it looks like in the game engine

Each curve represents a frequency of occurrence of this material at a given parameter value. Parameters for the surface are set by planet geometry (it is very easy to calculate slope and height for it) and two grayscale maps: temperature and humidity.

All you need to do is just find or generate temperature and humidity maps, then select 32 materials, then setup 4 frequency curves for each of them and finally you get a good procedural texturing! Sounds easy, right? Well, initially I thought that too, but now I will tell you why I was wrong.

Firstly, how do you even select materials? I am not an artist nor a scientist. I have a very vague idea what colors would be right for Earth (even looking at the accurate surface color map I have). I’ve tried doing it based on eyeballing and gut feelings and the result was pretty poor.

Secondly, I’ve spent several weeks in 2020 searching for good and complete temperature and humidity maps for Earth, processing raw scientific data, which was spreaded between a hundred NASA websites (why the hell it can’t be in one place?). All I got were 8192x4096 temperature map and 4096x2048 precipitation map, which has extremely low resolution for the real planet scale. I am pretty sure, that higher resolution data exists, but I am too dumb to find it.

An example of color map for part of the world. Generated in 2020

The last and the worst thing is how to construct frequency curves for each material. You can, again, eyeball the result, but even a slight change of one curve in one material affects the frequency of appearance of all others! In the case of a small number of materials this is manageable. For example, the Moon has only 8 different materials and it looks okay, because it has a pretty narrow color palette. But 32 colors for Earth is a bare minimum.

Basically it was impossible to do it manually and get good results. That’s why adding a new planet was a great challenge. So, I needed to find a way to somehow automate this process. I thought about this problem in the shower, on a walk, before going to bed every day for several months. Until an idea finally came to me in April. It arose from how the Moon materials were praised by players. That’s funny, because I didn’t find a temperature map for the Moon. Also it has no water, so the humidity map can’t even exist. So I used a color map converted to grayscale and just random noise instead. And results were better that for Earth. The conclusion to this story was that you don’t need scientific data to make something look good.

So the idea was pretty simple and very hard at the same time:
  • get a surface color map (that exists for most planets in a huge resolutions);
  • generate a color palette by selecting 32 most common colors (there are a lot of ways, how it can be done, but I will talk about it some other time);

    The first colors of Earth's palette

  • generate a grayscale frequency map for each selected color from color map, using some color distance metric;

    Frequency map for the first color from the palette

  • use this map as a mask, apply it to the low resolution temperature/humidity and height maps and then generate a frequency curves for each color;

    Temperature frequency curves for each color in the palette

  • get a range with highest values from temperature and humidity curves and then use them to encode a high resolution temperature and humidity map from a color map;
  • grab all the data and apply it as a configuration to the planet.


And this is basically it. All this process is parameterized too and I spent several days tweaking it, but just in two days after the algorithm was implemented, I’ve got much better results for Earth than before.

This colors is actually in the game

This is how it would look like

Before

After. It could be improved even more, but for this stage of the development it is enough

The great thing about this algorithm is that it is universal and can be used for any planet. I don’t know if the new planets will be included in the next update (it is a lot of work even with this huge time saver), but there is a pretty high chance that I will finish all inner planets and some asteroids this year.

Thank you for your attention and see you in the v0.16.0 update!

Patch v0.15.3

Fixed several issues found by @Gigantoherceg and @joshwells17gh. One of the bugs was very serious and some players could lose their progress because of it. Sorry about that.

[h2]Release notes v0.15.3[/h2]

[h3]Fixes:[/h3]
  • game did not save the player's progress when certain conditions were met;
  • engines explode on launch on some laptop configurations;
  • improved planet generation perfomance when rocket is on the launchpad and player quickly turns the camera;
  • missing localizations string and typos in some places.

Patch v0.15.1

Fixed some issues found by @Gigantoherceg, @Pietrus1745 and @olafoertelt,

[h2]Release notes v0.15.1[/h2]

[h3]Features:[/h3]
  • staff cell will be marked if worker is not yet assigned to any building;


[h3]Changes:[/h3]
  • reworked main menu a bit;


[h3]Known issues:[/h3]
  • game stuck when pressing "Continue" button in the Main Menu after all saves were deleted;
  • wrong description for "Turn on lights" contract;
  • missing param in the description for "Put spacecraft into geostationary orbit" contract;
  • improved base tutoril step where you turn on engines after time warp, so engines will explode less frequently;
  • wrong parameter for "Leave Earth's SOI" contract.

Update v0.15.0 "A New Beginning"

First of all I want to say some words about recent events. The war that Russian government started in February is a catastrophe, a disgrace and a crime against humanity. Hundreds of innocent people have already died in this war and I see no end of this horror. I had friends from Ukraine and my grandmother was also from there. I know what is happening there and share the pain and grief of Ukrainian people. I'm practically depressed because there's no way It can be stopped by ordinary people right now. But it should be stopped at any cost.

On the other side the people of Russia have no future anymore. The Iron Curtain is almost here. Most foreign companies are leaving the country. All financial transactions with the west have virtually stopped. It is worth noting that the whole IT sector and game development cannot exist without a global market. So my profession is destroyed. The government ignores the voices of the opposition and people, who are against this war. It constantly arrests protesters and passes dozens of repressive laws. Today you can get up to three years in prison for the slogan "Stop the war" or Or if you call the events taking place a "war". And up to 15 years in prison if you will repost any video containing any information about it. Unfortunately, more that 50% of Russians are under heavy propaganda. They don’t know and don’t want to know what is happening, thus supporting this terrible “special operation”. Lastly there is a pretty high chance that Internet access here will be completely banned here in the coming months. It's all so crazy that I feel like it's just a nightmare and I need to wake up. But I should point out that none of these compare to the horrors of war.

So, how will this affect the development of the game? I am pretty sure that the February payment from Steam was the last one, seeing how events are unfolding. Because of this I will need to start looking for a job with the possibility of moving to another country. However I will continue to work on the game part-time to the best of my ability.

This is all I want to say, now let’s talk about changes.

[h2]New features and changes[/h2]

I’ve renamed the game. Initially it was named after a Russian meme and it was a part of the game's marketing strategy and story. But it isn't funny anymore, especially after recent events, and it will only work against the game in the coming years. Also, the Russian space program will certainly come to an end in the near future. There will be no story about it anymore. So I decided to return the original name of the game — “Rocket Science''. The theme of the game will remain the same, but I will revise the concept of the story I had originally planned to make. I hope this will not upset players who have already purchased the game.

As for the update itself, I’ve added several things.

[h3]Contracts[/h3]
Remember you had a non-interactive list of goals in the control center? Now it was replaced with a list of interactive contracts. You can accept up to three contracts and perform them in any order. The goals in this list are almost the same as before, but I will start reworking them and adding a new one in the following updates.

This is a really good starting point and a bit more content, than before

The contracts you've accepted will be displayed at the top of the screen

Note: accepted contracts and statistics collection will be paused if you start a tutorial at the same time.

[h3]Extended tutorial[/h3]
I’ve added a section with extended training. You can perform interactive tutorials from it at any time. There is only one new tutorial right now. It requires a huge amount of work to add them, but it is very important for new players, who have never played KSP or similar games. So I will try to add at least one new tutorial each new update.



[h3]Statistics[/h3]
Per-save stats are available in the control center now. I am tracking the most basic things like the number of launched spacecrafts, planets that were visited by the player and speed and distance records. This will be the basis for the future achievements. If you have any proposals about stats you want to see, please leave them below.



Note, that contracts, extended training and statistics were added into the control center UI.

[h3]Instrument panels[/h3]
I’ve replaced the stats panel under Navball with separate instruments that can be hidden on a per spacecraft basis. All rockets still have all instruments for now, but they will be moved to separate rocket parts in the future update.

I am planning to add more functions to each instrument panel soon

Update includes a bunch of smaller changes and fixes as always. You can find them below. I planned to add more contracts and at least two more new tutorials in this update, but lost two weeks because of recent events. And I don't even know if I will have access to the internet next week. So, here is the update and I hope you will like it. Please report any bugs or issues if you'll find them.

Thank you and see you in the next one.

[h2]Release notes v0.15.0[/h2]
[h3]Features:[/h3]
  • added two new tabs into control center UI: "contracts" and "extended training";
  • added save stats;
  • reworked rocket stats UI during the flight;
  • reworked maneuver panel UI;
  • added target panel when rocket has target;
  • added 13 interactive contracts;
  • added one new extended training tutorial.

[h3]Changes:[/h3]
  • game was renamed, now it called "Rocket Science";
  • vessels and probe cores will be always on top in the spacecraft list in the control center;
  • improved sprite resolution for some UI elements;
  • camera will get spacecraft and its parent body in focus when selecting spacecraft in the control center;
  • you can set spacecraft as target by clicking on it and holding ALT (previously it worked only when clicking on marker);
  • you can interrupt any tutorial at any moment;
  • added several more steps to the base tutorial, updated some steps to match the gane state.

[h3]Fixes:[/h3]
  • when you open the map when inspecting any building in the spaceport, camera transition is bugged, also building UI stays on the screen;
  • sometimes exception appeared when opening and closing ruins UI several times;
  • sometimes navball markers are misaligned;
  • sometimes huge drop in perfomance appears on rocket launch.

Patch v0.14.1

This small patch fixes a critical bug reported by @chrisn44 and a couple of issues, that I've found along the way.

[h2]Release notes v0.14.1[/h2]

[h3]Features:[/h3]
  • "sp.warp" debug command now supports spacecraft name as a target;
  • 2-2.5x improved rendering speed of huge rockets (100+ parts).

[h3]Fixes:[/h3]
  • an exception when trying to dock two spacecrafts;
  • docked spacecraft resets its relative orientation after game reload;
  • when rocket is controlled from docking port and undock from another spacecraft, both spacecrafts start receiving direct RCS commands.