Categories
Blog Development

Dev Blog #6: Code, time and patience

A long time coming

Hello everyone! Long time no see. You might or might not know, that we have been very (seriously, very busy). The “Subnautica 2.0” update had a massive update to the code of the game, breaking Nitrox compatibility completely. Very few parts of the code still worked somewhat, but honestly? Barely anything worked and would just instantly crash Nitrox, meaning we had a lot of work to do. We have had to rewrite practically everything to fix this, and that is what we have been doing.

Back to the future

One of the things that have made working on the Nitrox project extra tedious is that UWE (Unknown Worlds Entertainment, developers of Subnautica) have been doing updates sporadically over the 7 or so years the Nitrox project has existed. Every update has broken major things and we have had to redo large portions of code for every single update. This big “Subnautica 2.0” update is however the final update to the game. So now we don’t have to worry about a potential update that will force us to completely rewrite large portions of the Nitrox code again. This should speed things up after we get this next update out, making it easier to fix bugs and sync various things. – You know, actually work on fixing things instead of just making it compatible to the same degree as the previous update.

Now, let’s get to what we have been up to!

The past, the present and the future

Going into this new update we decided to do something big. Go back in time, roughly 7 years, and overhaul the base code of Nitrox to make it more future-proof. A backlog of 7 years of documentation needed to be improved, so we have been working on that for Nitrox.

The main culprit however was and always have been the Subnautica code itself. There is a complete lack of documentation on how the Subnautica code works. Meaning we for most parts have to take educated guesses as to what code does what. Having to guess what is deprecated code or what code is still in use is an extremely slow process as every tiny change must be tested manually. This is what is making the update take so long to do.

So many lines of code

What we decided then was to do a rewrite, how big of a rewrite? Here are some numbers (as of this writing). On our master branch, we have 1330 files for Nitrox, with 60,2000 lines of code. The difference Between 1.7.0.0 and master (open-pr’s included) we have changed 1150 files, with 27,600 lines of code added and 25,100 deletions. This means that 87% of the files have been touched and a whole 65% of the code for Nitrox has been either completely rewritten or adjusted to make it compatible with the new code, that is a massive amount of work to have had to test manually and make sure works again.

Now the big question is, what do these lines of code do exactly? Well, one of the major things we have been working on is squeezing as much performance out of it as possible. Making sure we use less bandwidth where possible while still improving the amount of data sent and making it more reliable.

One of the things we worked on to improve our bandwidth usage was the packet size. In the current version of Nitrox, the packet sizes are always 1kb big. Sure does not sound like a lot in the modern day of gigabit internet, but it does add up rather quickly. So we went through the code and optimized it, by how much do you ask? About 4000% improvement, the packets should now be in the ballpark of 15-25bytes when you get your hands on the new update.

A new beginning

A video showcasing the intro cinematic where the player(s) are now escaping the Aurora in the lifepod with two seats, before the crash and knock the player(s) out

Besides optimizing the code we have been working on quality-of-life improvements is one of them. You see, in the lifepods, there happens to only be one seat for whatever reason. Obviously, it is a design flaw by the Alterra Corporation. So we added another seat to them!

As you also might have noticed, is that you can also see the other player in your lifepod! There are now 2 seats per lifepod, meaning if you join the server at the same time you should be able to see another player. Our end goal with this is that when more players join, they spawn into different lifepods either alone or together. However, this is something that will be worked on at a later date. For now, the world will hopefully feel more alive and you are all finding out that you are not all alone.

A stricter diet

A picture of a Snakecrab (being the correct size) inside of it's mushroom house

As some of you might have noticed, the Crabsnakes seem a bit overfed, so we have given them a strict diet of no more than 1x Cyclops submarine per week. This will hopefully make sure that they are able to fit inside their mushroom houses again.

Some of the other things we have been improving on are syncing objects like the Gravity trap. The gravity trap should now be able to grab small objects like the fish and keep them there. If you log out, and back in again it should be there with all of the fish that it had trapped into its orbit.

If you liked having the posters around in your base, well now is your time to shine as we have worked on the code for them. They should now no longer fall through the floor but stay on the walls (obviously, just gave you better sticky tape!).

What is left?

There are some major things holding back the update, they are dealbreakers at this point.

  • Movement is currently in a worse state than in the currently live version of the mod – For obvious reasons, we can not release until that has been fixed
  • Finishing rework of the base building code, and then running extensive testing on it
  • Fine-tuning the new Entity spawning system
  • Vehicle Bay and Air pipes – Things that can be dropped or deployed into water
  • Reefbacks – Spawning in “lumps”
  • Crash fish – Stuck in their “homes”

These are, of course, some more things left for us to do. But these are the ones that come to mind first.

What we do not know, is how long is left before we can release the update in between work, social life and all the other things that happen. We will let you know as fast as possible when we have a more concrete time or at the very least an idea of when it will be ready.

A small thing to note, we are now on Bluesky! If you happen to be there feel free to say hello! https://bsky.app/profile/nitroxmod.bsky.social

Thank you for your patience!

– The Nitrox Team

Avatar photo

By Shalix

Community Manager of the Nitrox Project

46 replies on “Dev Blog #6: Code, time and patience”

Did you guys also fix that bug where if you hold the thermo blade inside a habitat the bubbles remain there and will be in the middle of your screen for the rest of the game? It’s very annoying but bearable, maybe that’s because my friend and I are playing the legacy version? Not sure. Anyways thanks for the update and take your guys’ time on this. Your mental health and daily lives should take priority!

Yeah the big packets where problem as I had very low upload speed 8 Mbps it was realy bad experience as after sometime the server stop working for only one player (from two) in meaning nothing was loading and out off sync.
Now I got more consistant 25 Mbps and this update could made my future experience better and finnaly finish this game with a friend!
Hope for the best and keep the great work up!!!

This is very nice!! I’m Portuguese and started playing with my friends along time ago… but the things started to get out of sync very fast. So the version on GitHub, have already increased the upload speed?

hi, I found a bug with energy from reactors, I was playing with a friend and installed a nuclear reactor and powered it up, but he did not get energy from the reactor, but when he installed the same reactor and activated it, he got energy, but I did not

As we have stated in the past, and still do. Use Solar power, it is the most stable power source in the game. There are issues with the other power generating sources at this time. #GoGreen

thank you all for your dedication. Your work brought happiness to me and my friends, and so much more diver out there! Stay safe and sound <3

Whoop!!! Can’t wait for this to be complete 🙂 My friends and I have been coming back here every week or so waiting for some sort of update XD

@Vladarus, both nuclear and bio reactors have the same issue. You need to place reactors without turning their input port. I mean, place those reactors as is, do not use your mouse wheel to rotate those. Then you both will get energy.
If you rotate a reactor even once, not only your friend won’t get energy, after a server reloads you won’t be able to input rods / biomass inside it, so you will have to deconstruct a reactor. And if you deconstruct that buggy reactor, the energy pull will stay intact (it won’t decrease).

So, again: place reactors as is, do not rotate those.

Just want to say, Thank you for being so Dedicated to bring Coop to this Awesome Game, So that people like me and others can experience it with friends. Really excited to play when done.

You can already host the server on linux. I don’t remember the exact requirements, but it definitely requires dotnet and mono. I simply downloaded legacy subnautica to my linux machine, then put Nitrox inside the Subnautica directory, then it can be run with “mono Nitrox/NitroxServer-Subnautica.exe” (make sure you are in the Subnautica directory).

hi i buy subnautica on steam and download these mod but cant work it say not valid subnautica game installation or the games platform in unsuported but why ?? i have steam i run mod as admin i check folder with subnautica but nothink

If you got banned on Discord, you should have gotten a DM from us with a link to an appeal form. If you however did not get one, you may send an email to nitroxmodteam (at) gmail.com remember to add your Discord ID, so we can check the case against you in our logs.

Very thankful for the hard work and dedication you guys have been putting in to make coop a reality and I know it takes time to accomplish such feats. Last time I played, entities are not spawning especially the leviathans for guest users and there are also some other syncing issues. Nevertheless, I await for more great news and the final output. Can’t wait to play the complete and stable version with the boys.

Thank you guys for all the hard work! I am anxiously awaiting the release, can’t wait to get some stable coop going! Thanks again guys, you rock!

Have ya’ll looked into the thing where if someone jumps while someone else is moving the cyclops, the one jumping/losing contact with the ground pinballs around the cyclops destroying things then violently dies? it’s hilarious but not good in situations deep under water.

I thought I’d never see the day that the devs would come out with an update. I would check back every several weeks or month for updates. I’m happy to hear the project is still alive and well. Looking forward to seeing what comes from this 😀

Really excited for this… my wife and I have been waiting to play this game together for sooooo long! LOL

Thank you so much for the hard work!

I´m so glad and impressed by all the work you are doing on this project. Don’t give up and thank you so much

Yes! We greatly improved the building experience and fixed nearly all of the bugs we know of (except power related issues)

This is so great, and I can only imagine the work that goes into making a mod that will let us play this game we all love so much with SOMEONE ELSE! I can’t wait to get this, as my best friend and I ADORE this game, and are looking very forward to getting to play this together. Thanks for all your hard work. Oh, and would any of you developers working on this be up for a quick interview with me for my youtube channel? I know many people out there would love to hear about the work you’re doing, and I would love to help people in the gaming world to realize the work modders like you are going through. Thanks much, and keep up the amazing work!

Leave a Reply

Your email address will not be published. Required fields are marked *