1. Rocket Science
  2. News

Rocket Science News

October Developer Update

Hello, friends!

This month I made a great progress developing the game. I spent it almost exclusively on physics, implementing things I mentioned it the previous update. And everything worked out almost exactly as I planned and I did even more than I could have imagined. So, without further ado, let’s talk about it.

Some rockets were hurt while preparing this update

Rocket physics

The only good way to support timeline and time rewind is by representing the spacecraft with one physics body. But since the spacecraft is made by player and consist from different parts with different shapes and masses, I needed a good way to account for it in the simulation. Otherwise, you will immediately feel, that the physics is not correct. I solved it by calculating the forces that affect every part individually and then applying them at the right positions of rocket's body. So, if you will not balance your rocket right, and there is not enough auto stabilization force, it will eventually start flipping to the side with greater mass.

Aerodynamics

I used USSA equations for the atmosphere model. Since Earth and Solar system are in real scale in the game, the equations was not modified in any way. The only difference is that Earth atmosphere in the game ends at 110 km, where the pressure is so low that it can be neglected. The surface area and dimensionless drag coefficient are pre calculated for each part, which means that the shape of spacecraft will affect it flight characteristics. The approximations I used for calculating drag forces give decent results and have a good performance. But I am open for the better drag models in the future.

Collisions

This was the hard one. All collisions are handled by PhysX. And there is always a tradeoff between accuracy and performance. If the collisions were solved even a bit incorrectly, spacecraft will be immediately launched with 10x speed of light into abyss, because bodies has huge masses and moving with the high speed in the simulation. One small error and the whole experience will be ruined. But if you increase accuracy too high you will receive a poor performance and angry players. While I found a decent settings for collision solver, I will expose some of them in the game settings, so everyone will have chance to tune the game to their computer capabilities. Here are some funny gifs before I tuned the PhysX and fixed tons of bugs.

A simple collision with the ground threw a ten-ton rocket, as it was made of plastic

Here collision between two parts of rocket send both to the orbit of Pluto

What else?

For now the water physics is missing. I wasn't be able to quickly find the good algorithm for that. I could use the same drag model as for atmosphere, but with higher density, but I don’t think this is the only and right solution. So I will continue investigate this topic after release. For now there are two options: every spacecraft will immediately explode on the contact with water. Or it will just ignore the water and fall though it. I like the first option more, because it destroys immersion to a lesser extent.

Also I didn't implemented wings yet, but I will do if I will have time for it.

Not only physics

When I got tired of fixing physics, I switched off to another area of the game. The first one was stars. Initially I used simple texture for it. It was huge (almost 8 Mb with the resolution of 8192 x 4096), but even with that stars looked blurry. Also all of them had the same color which is far from reality.

Old stars

So I implemented own starfield system using the real world star database, which includes more than 110k stars. Every star now uses a color, brightness and position from that database. Even with 65k stars all the data occupied only 2Mb of memory, but you usually don’t need this many. You can see about 6000 stars with your naked eyes. And again I will expose starfield settings, so you can change the stars count. maximum brightness and exposure how you would like. The only thing I am missing now is the Milky Way, But I will make it sooner or later too.

New stars. It is better to compare both images in full-size in the browser

The second one is the orbit rendering. Initially I used builtin Line Renderer, but it was not good, when the orbit was far enough from the camera.



Well, time to implement custom orbit renderer!

It is better to compare full-size images here too

At the end of this month I felt like I created my own game engine for the flight simulation. Almost everything is custom: planet generation, orbital mechanics, drag and gravity, starfield and even my own version of the line renderer. Funny enough, I got around 80 FPS in the flight on my computer (i5-4590 and GeForce 970), where so many different calculations happens. And only 55 FPS in the spaceport, where nothing complicated is going on, just a bunch of objects and light sources.

It’s time to finish this update. I will leave you a gif where you can see the result of all work done in this month. It looks so simple, right? But it was not easy no get there.

Note: the gif was recorded on 5x time warp

September Developer Update

Hi there!

September was a very productive month for me. It is much easier to work, when there is overcast and +5 °C outside. During this month I managed to solve the most difficult task in my life: the rocket physics.

Let me explain. As I have said many times, the ability to plan flights ahead and perform them without direct player control and the Solar System in real scale are the main features of the game. But it also imposes several limitations.

For example, due to floating point precision of PhysX all physics calculations for rockets with running engines should be performed no further than 10km from the world's origin. Otherwise, the accumulated errors during calculations will lead to huge jittering and in the worst cases the Kraken will appear and destroy your ship. This is usually solved by constantly moving the world around the ship, so it stays near the origin all the time.

Imagine this sphere is actually Earth. Then the size of the area, where spacecraft could flight before shifting the whole world will be less than one pixel!

But here is the problem. Imagine two ships, one orbiting Mars and one near the Earth. The average distance between them will be around 225 000 000 km. And it happens that both turn on engines at the same time. What to do in this case? It is impossible to move the world in such way so both ships were simultaneously in the world origin. Well then we must sacrifice one of the ships, by moving another to the origin, because the error would be so huge, that first ship will instantly crash into the planet. Or the game should not allow that situation. But this ruins the whole point of the flight planning.

Initially I tried to implement simple flight physics in double precision on my own. It worked good for small rockets with one engine and gave extremely precise results. But the were much more cases that I needed to handle:
  • Several engines with different positions and angular forces they cause to the rocket.
  • Basic aerodynamics, where shape of the spacecraft will affect its movement in the atmosphere.
  • Collisions with the surface and other ships.

There were no way that I could ever handle all these cases in reasonable time and develop them without going crazy. And I could not release the game without these basic things.

So I started to search solutions. And after three months the solution came from the unexpected side. Less than a year ago Unity released the Multi-Scene Physics (or Multi-Word Physics) support. It means, that I could run several invisible physics simulations at the same time and they will not interact with each other. So in the case of two ships above I just needed to create two Physics Worlds, place physics representation of rockets into them, move the world in each simulation so that the ships are in the origin, perform calculations and then synchronize the results of the simulations with the visible world. Sounds simple, right? Of course it is hard as hell! But it was much simpler than reinventing the physics engine.

Here spacecrafts are far from each other and both simulated in separeted Physics Worlds (big green spheres)

But how ships will interact with each other, if they placed in separate simulations? This an interesting question. If the two or more ships are approaching each other and the distance between them become less than 6 km I will put them all in one Physics World. If the distance exceeds this number, I’ll move them back to separate simulations. And because I perform all calculations for whole rocket and not to its parts it works pretty good even on my 5-year PC. Obviously, there is a big room for performance improvements. Which will be one of the main tasks in the Early Access.

Now they are close and we are moving second spacecraft in the simulation of the first one

There are still a lot of work with this system. For example. I’ve solved different engine configurations and partially atmospheric drag at this moment. The collisions need to be implemented, but now I see the way and feel confident, that it would work. And, of course, there are tons of physics bugs waiting for the fix. Maybe I will prepare some funny gifs with them next time.

Thanks for attention and don’t forget to join our Discord community!

P.S. Valve have changed Steam algorithms two weeks ago and game’s store page traffic went almost to 0 after that. So, if you have friends, who love space and rockets, please send them link to the “How do you like it, Elon Musk” page. You are my only hope.

August Developer Update

Greetings!

Today will be a short update, because I am at small vacation right now, visiting my grandparents. They happen to live in such place of Russia where stable Internet connection is rare than a good indie game on Steam these days. But I found a base station deep in the fields and managed to write and publish this update.

This is also the place to draw inspiration from and get good references for the development

The first thing I am excited of is recent announcement, that High Definition Render Pipeline (HDRP) will be out of preview this autumn. HDRP is a high-fidelity next-gen render pipeline built by Unity to target modern (Compute Shader compatible) platforms. It provides great new tools to author content, like a Shader and Visual Effect Graph, solid API for high performance custom rendering systems, and a lot of features from volumetric lightning to subsurface scattering. I started to use it a year ago, when it was in alpha stage. Even in that early stage it gave good results. And now Unity Technologies promises, that HDRP will become stable just before the HDYLIEM release! So I started updating the game to the latest version of Unity to get the stable HDRP as soon as it will be ready.

Example of volumetric lightning in HDRP

Secondly, I’ve added the Moon heightmap into the game. It was easier than I thought, so the next in line is Mars. I have also rewritten the planetary configuration system, so every planet will be present in the Solar System even there is no heightmap or textures for it yet. Such celestial body will look like a white sphere, but you will be able to land on it anyway.

Test scene with the Moon heightmap applied

The last thing is the planet texturing system. The old system supported only 16 materials (which is nothing for real scale planet), produced poor results and have no room for configuration and future improvement. So I had to develop a system that would procedurally select materials based on set of easily configurable parameters. I researched how it was done in other space games and in the popular libraries on the market and came up with my own solution.

I’ve developed procedural texturing module for planets that includes a configuration file which supports 32 layers of materials (and I can increase this number up to 64 in the future). These layers work like in Photoshop, but they have a bunch of parameters, which controls if the material will be placed on top of the previous one or not.

Inspector that I use to configure procedural texturing

As you can see, there are four main parameters for each layer now: height, slope, temperature and humidity. Each of them is a curve which specifies the probability of material selection depending on the parameter value. There are more parameters in the config for granular tweaking of each material such as weight, tint and blending contrast. This config then encoded into texture and passed to the shader. And finally, the shader decides which material to use at this particular point on the planet's surface. Combination of all parameters with the addition of some noise function give the results I like. Moreover all these configs were built with the mods support in mind, which I will add into the game as soon as API and feature set are stabilized.

Another test scene with the procedural texturing. Here only three materials are blended together, and there is already no tiling and repetition


That’s all for now, I'll try to get out of the field, and I wish you a productive autumn!

July Developer Update

Hello friends!

On August 1st, 2018 I decided to leave the prototype of the isometric shooter I was working on and make something small in one or two months. I started with a 2.5D arcade about launching rockets into space, where you were able to collect resources, bonuses and boosters during the flight and then spend it to upgrade your spaceship or buy new parts for it. And I don’t know how it has happened, but here I am, a year later, working on one of the biggest and ambitious games in my live. The great news is that the game vision has not changed since January, when the first Dev Update was also published. And I am slowly but steady getting closer to the goal.

Prototype of the game that I abandoned for HDYLIEM

As for development, I need to work on three main areas. First of all is the game sequence, which is important not only for the release, but for early playtests too. It is the hardest task I have ever had, because the first three hours of the game in Early Access will determine the future of the game in store. This includes compilation of all game systems into solid gameplay and making content for it as well as creating tutorial and hints for all of that. And I can’t even send the game to my friends to try it out before the tutorial will be developed. And it is hard to make the tutorial, when you not sure if some particular parts of the game is working as intended. But sooner or later, I will figure it out.

The second one is to brining all game systems to the “ready for Early Access” state. For example, I am happy with the planet generation system, but I am not satisfied with the planet’s rendering. There is an annoying tiling on the surface and lack of different materials. I need to develop a texture layering system to remove tiling and give the biomes more natural look. Another example is the water, that looks like this in the game right now:

Not great, not terrible

I found a several good water shaders, but they work only on planes and need to be rewritten to work with planets. This is very interesting task and it will be really exciting if the water in HDYLIEM will look like this:

Good water is usually 1/3 of the success

Another thing about planet generation is that I found the way to increase the heightmap resolution from 8192 x 4096 (the max allowed by Unity) to pretty much unlimited. The only limitation is the memory and disk space. For example, I found and will use 43200 x 21600 heightmap for Earth, which means that instead of 4x4 km area, one pixel of heightmap will cover 0.7x0.7 km! If you know, where I can find heightmap with the higher resolution, please let me know in the comments.

This is the part of heightmap with the Himalayas. You can even see rivers here.

Every other game system has some things that need to be finished too. For example, I need to implement patched conics for orbits, to show the spaceship trajectory, when it is leaves or enters the sphere of influence of the celestial body. Direct controls for flights without flight plans need to be done too. And there are a whole bunch of spaceport building, flight planning and rocket assembling tasks waiting for my attention. But the great thing about this is that I can switch between them every time I tired of the previous one. They all are completely different and each of them brings an unique set of problems and challenges.

The last one is the polishing pass that includes sounds, effects, optimization and quality of life features, like game settings. Unfortunately I haven't even touched this yet, but I finally started to think about this it, which is a good sign.

Every day the game is one step closer to what I imagine in my head. Not only this, but my passion for space, as well as your constant support, helped me to overcome this year-long journey and keeps me going. Thank you and see you next time.

June Developer Update



Hello everyone!

First of all, I have updated some screenshots on the store page, so you can go and check it out. It is still a work in progress, but I think, they better represent the current state of the game and show more gameplay, than the old ones. Also I am often asked about game trailer and I agree that it will describe the game better, than the thousands words. But good trailer requires well established gameplay, a lot of game polishing, and enough content to not disappoint anyone (and I still changing a lot of things in the game on a daily basis). So, I think I will be able to publish the trailer three weeks before the release in Early Access. And I hope it will happen in the 2019.

Now it’s time to talk about spaceport building in “How do you like it, Elon Musk?”. As I always said, this will be the main focus of the game. While this game mechanic is pretty easy to implement from the coding perspective, it is hard from the game design point of view, because there are too many ways of how you can approach this problem. You can also pretty easily stuck infinitely iterating over it and keep adding new systems to the point, when the game becomes unplayable complex mess of mechanics, numbers and buttons.



I should have come up with a set of rules and restrictions to avoid falling into this trap. And set them in stone after that, no matter how it will be difficult to follow this restrictions, because it is only way to find your way. So I will outline the set of found restrictions in the following paragraphs and we will deep dive into them in the next developer updates.

The story begins, when you get under control the ruins of the old Soviet spaceport. All you need is to transform it into the space center of the future. Unfortunately, the building permit was not given and you are not allowed to build anything on the surface. The only way to expand is to build deep into the Earth. Each building opens up new opportunities, complements existing ones or makes life easier. For example, laboratories allow researching new rocket parts and buildings more quickly, storages and workshops - to store and process items into resources, and generators - to produce electricity on your own.

Sounds familiar, right? The next step was to make this gameplay unique in its own way. I spent a lot of time thinking about it and came up with the first rule:

Nothing works without people.


Every building requires staff to operate. There are workers, engineers and scientists you can hire and assign to buildings. The more staff requirements fulfilled the more features the building have.



For example, each worker unlock more space to store items in the storage and when you will assign all four of them to the building, you will receive the ability to automate collecting or delivering resources to other production buildings. But don’t forget, you should pay every employee at the end of the month. And if you don’t, they will quit and will never return.

The second rule almost immediately arose from the staff system:

Every action takes time.


The game will be in real time. And the time will become the second main resource after money. Do you want deconstruct the Soviet ruins? It requires four days. Do you want to build a coal generator? The workers will finish it in a week. Of course you will be able to speed up time up to one day in a second. But you should think twice about this, because the end of the month is coming and you should not only pay salary, but taxes and bills too.

The third rule is the matter of my own taste. I hate routine and monotonous tasks in games if they lasts for entire game and not required by narrative. But in the right proportions they can set the tone of the game or make you feel current situation. It is just another tool that you should use carefully. So, the third rule is:

Every routine and monotonous task should be automatable.


For example, in the beginning of the game you will have few resources and money. And you should do some tasks manually such as moving resources from building to building, or throwing coal into the furnace of the coal generator. But when you’ll make some money you will be able to hire more staff to make it for you. But the option to do something manually will always exist, for example, if the hard times come, you can save some money by performing all this work by yourself. By the way, the flight plans system was born because of this rule.

The last rule is my preference too. I’m not a fan of linear upgrades systems in the games. Sometimes it’s ok, like in Action/RPG, where the upgrade trees exist just to make you feel the growth of your character. Or in Civilisation you feel how is you nation developing, thriving and moving from one era to the another. But I think that in some games it is a waste of content and potential. Why you should build, for example, the tower and then upgrade it ten times to do something useful with it? And very often there is even no situation, where you actually need the tower of level 5, so there are no interesting choices to make. The actual fun is delayed by meaningless actions to increase the playtime and create an illusion of depth.

So the fourth rule:

Avoid linear upgrades system as much as possible.


This the the hard one, because every game needs the progression system and linear progression is the easiest one and you almost instinctively want to add it into the game. But I think I solved it in theory and came up with nonlinear system with interesting choices and room for sinergy. And it called “Mechanisms system”. I hope I will tell you more about it in the next updates after I actually try to implement and play with it.

Now you know the four main pillars of the spaceport building. As always tell me what do you think and see you next time.