#13 tank farm


At the beginning of August I was looking into using an existing simulation software for the tank farm. I mainly looked at Open Modelica. Unfortunately there doesn't seem to exist an easy way to integrate it into Unity. It certainly would have been a lot of extra work. To get it running on every platform might be difficult, if not impossible. Then I also don't know what would be the performance simulating with it several tanks and liquids in real time.

So in the end I decided to make a very simple point-to-point simulation with basic equations of state, so it works like this: mass is removed from one tank and added to another one with some state change on the way. You can find more details in this thread.

With the current implementation I had to run quite some additional updates of the internal states of the tanks in each frame to not get too large pressure spikes from boiling liquids. It's just a fraction of a millisecond typically, but still quite a lot for something like this. It probably can be optimized a lot also. As long as there not a large amount of tanks, it should be fine though for the moment. That's also one reason why you can't use all the tanks in the farm individually. The other is, that it would have needed another UI panel only for this! :D

Getting the simulation done and integrated also with the rockets, took quite some time, also the two new UI panels for the tank farm and propellant control. It took almost two months to publish the tank farm test build. Then followed a lot of bug fixing and improving.

Especially the visualisation stuff was quite a learning experience regarding what can be done with shaders and what not. For the vertical tanks I ended up combining a shader that makes the mesh of the liquid transparent and a plane on top of the liquid that moves with the liquid level. The tricky part with that approach is, that you have to follow the curve of the domes. Luckily they almost follow a simple power function, so I didn't bother adjusting the geometry. You can actually see that the liquid mesh and plane don't quite line up when you look really closely at the dome part when the liquid level changes, but I hope it's not too noticeable.

For the horizontal tanks this approach was not feasible due to the complicated geometry, so I just used the cut-off shader without a plane on top. This works fine also as long as you look into it from the bottom. If you look from the top, the pipe inside is drawn above the liquid mesh.

An alternative solution for when you have to cut a mesh like this, would be to actually recalculate the mesh and add a surface at the cut. But I don't think, it's worth it just for this visualisation effect.

After posting an update video with the visualisation stuff, Zack @CSI_Starbase approached me, that he was working on a video which needed something like that. So I helped him out with a special visulisation to animate the flow of the liquid through the pipes from the tanks, via the subcoolers to the booster. This animation uses Unity's spline extrude feature. It generates a new mesh every couple of frames. This eats up a lot of CPU time quite fast with long splines! So I had to split it up in several parts so that he can record the video himself directly in-game. While it was fine for that purpose, in the current state I don't want to include it in the public release. It needs some more work, also to have it at least somewhat dynamical and not just as an animation.

So there is some stuff which still needs to be done and is missing. Most notably the water tanks and tank pressurisation system. But it would have been too much for this update which has already taken hugely longer than hoped.

Even though, in the end there was suddenly quite a bit of additional time available as I wanted to wait with the full public release until Zack's video was done. But since I didn't know exactly how much time would be avaibalbe, I just used it for fixing quite a few also older issues, and even implemented an actual ship QD arm model - after more than a year! :D

I also got to work on the sounds a little. This made me really wonder how they take care of looping sounds and speed of sound in a proper sound system which isn't based on some random youtube video. I should look it up some time.

In the very end I also upgraded to the latest Unity beta 2022.2.0b13 to see if it fixes the issues I had with Linux builds, but the issue was unrelated. I just had to update/re-install the Linux package manually to the latest version to fix it. Unfortunately with the newer beta version there were some changes on the Input System package which led to some bugs with the key bindings. It mostly seems to work now. Just that you might have to re-assing keys in certain constellations when you had the game running previously is a bit annoying. But I guess that's the live of a beta tester :D

Anyway, here is a list of all changes:

  • added tank farm
  • rockets use same cryo tank technology as tank farm
  • revamped ship QD arm a little, removed claw for the moment, but added work platforms
  • ship QD arm and catcher can now be positioned with a target setpoint; destruction of both has also been added/improved slightly
  • catcher is now positioned more favorable after loading the full stack
  • added possibility to block player rotation with default 'B' (also adjusted Menu behaviour with Esc or Tab)
  • the non-UI VR interactables (doors, levers, etc.) can now also be used with the interactor  
  • more settings like camera panel state or prop loading god mode are now saved between reloads
  • temperature units can be changed now from control panel 'Misc' menu
  • added landing target position indicator and made it and trajectory line glow a little
  • made explosions scale with liquid mass
  • some looping sounds like engine noise now also take into account speed of sound
  • ambient sounds got a bit more variety
  • 'load stack' now takes into account your starting position choice with 'default' loading you in at the tower in this case
  • added test stand prop toggle to additional menu


  • fixed floating panel movement issues
  • fixed cloud toggle
  • fixed input fields with decimal points
  • fixed mouse sensitivity not being loaded from ini at game start
  • fixed starting position switching to default sometimes (more like an ugly workaround as I haven't figured out yet why Unity changes the transform position sometimes after all my scripts are loaded and even waiting for an update as well. Pretty odd. Now I set the position after two updates, which briefly flashes the default starting position always, which sucks.)
  • lots of small bug fixes and adjustments which I did quickly and forgot about

Files

StarbaseSim-2022-11-10-Windows.zip 541 MB
Nov 12, 2022
StarbaseSim-2022-11-10-Mac.zip 496 MB
Nov 12, 2022
StarbaseSim-2022-11-10-Linux.zip 571 MB
Nov 12, 2022

Get Starbase Simulator

Download NowName your own price

Comments

Log in with itch.io to leave a comment.

(2 edits)

I finally got my code signing certificate! (That's why there is a Windows zip file with today's upload date - it contains a signed .exe. Else, nothing has changed.)

Unfortunately, it doesn't really do much yet. There is just appearing my name in the Windows Defender / Smart Screen warning message now. But you still have to do the two clicks to get it out of the way for the time being :(

This warning message can be removed only when you have earned "reputation". It just seems like nobody really knows what that means and Microsoft doesn't tell us. It looks like you need to have your program executed on a few thousand PCs or so. But google gave mixed results. So, let's hope that's not the case, otherwise it will be difficult to reach these numbers with the current amount of downloads per version.

So I payed €85.74 for this for a one-year license, but actually it was 0.05450902 ETH. That was the only good thing with all of this. I could finally use my own mined ETH in a useful way! :D

If only the process of getting the certificate wouldn't have been so horrible. Let's recollect it step-by-step:

  • I signed up on SSLDragon (found through google)
  • They redirected me to sign up with Sectigo (the company who actually issues the certificate) with Internet Explorer (!)
  • Then I had to create a ticket with SSLDragon to tell them what name I used for the Sectigo sign up
  • Now I got two mails, one from SSLDragon, that I signed up successfully, and one from Sectigo that they couldn't verify my address. There was a small typing error in the city name. It must have been introduced by SSLDragon. But I could not prove it afterwards.
  • So I had to submit the correct address with the Sectigo ticket system.
  • After this was verified, I could upload my ID and a photo holding it. But erroneously through the Sectigo ticket system. Wrong system!
  • I uploaded again the pictures through yet another system by Sectigo called "validation manager" - great!
  • After another couple of days, I got a message that I had to redo the photo, because the ID should show the front side (I read somewhere that it should show the address in the photo (which is on the back side), but ok - maybe I got it from the SSLDragon website. They have incorrect info in there FAQs about the validation process!)
  • Finally I could create the certificate with Internet Explorer. 

Horrible experience! And if the warning message doesn't even go away in the end, it would have been quite a waste of time. I hope we can build the necessary reputation. 

The only alternative is to get a so called "Extended Validation Certificate" which requires much more money and has a more complicated verification and issuing process. Seems a bit excessive for a simple game. 

In any case, I cannot recommend SSLDragon, at least not for Code Signing. Their website can be misleading/confusing and just has straight up wrong info sometimes. Is this the price you have to pay to be able to pay with crypto? :D