Starbound 1.4.4 Source Code

Starbound has been one of my favorite games of all time, so I’m happy to say that I have the latest Starbound source code, last commit August 7th, 2019. I will not be explaining how I got these files. It is the actual source, not just a decompilation, and as such includes build scripts, unused stuff, old migration code, comments, a stored test player, etc.

Source Screenshots

The source has minimal comments, and the structure is reasonable. I found the code easy to read and understand, but perhaps that’s because I’ve been modding Starbound for years now and am familiar with its behavior.

Languages Breakdown (GitHub)

StarEnvironmentPainter.cpp

StarEnviroment.cpp preview

StarMixer.cpp (audio related)

StarMixer.cpp source preview

StarTools.cpp

StarTools.cpp source preview

Building

And of course, we can build it. I compiled this version without Steam API or the Discord rich presence API, but those are easily included.

Skip to 1:10 to see the game launch

Funny Developer Comments

Here’s a look at some of the best (in my opinion) developer comments in the source. This is not intended to be a mockery, far from it, I’m ecstatic I can take a peek into the minds of the developers. Enjoy.

// message is fullbody encrypted so the response is trust worthyish
// message is fullbody encrypted so the response is trust worthyish

// Meh, padding is hard-coded here
// Meh, padding is hard-coded here

// TODO: I hate these hardcoded values.  Please smite with fire.
// TODO: I hate these hardcoded values. Please smite with fire.

// TODO: Get rid of this stupid fucking bullshit, this is the ugliest
// fragilest pointlessest horseshit code in the codebase.  It wouldn't
// bother me so bad if it weren't so fucking easy to do right.
// TODO: Get rid of this stupid fucking bullshit, this is the ugliest
// fragilest pointlessest horseshit code in the codebase. It wouldn’t
// bother me so bad if it weren’t so fucking easy to do right.

// This was once simple and elegant and made sense but then I made it
// match the actual platform rendering more closely and now it's a big
// shitty pile of special cases again. RIP.
// This was once simple and elegant and made sense but then I made it
// match the actual platform rendering more closely and now it’s a big
// shitty pile of special cases again. RIP.

Example: Simple Re-implementation of Vapor Trail and Sitting Toolbar Usage

At some point during development, Chucklefish had the idea to add a vapor trail when the player was falling fast. I could’ve sworn I saw a post on their news about it back when the game was in beta, but I can’t find it now. Anyway, we can add a small snippet to restore it, as an example of further engine work Starbound can benefit from.

// Vapor trail
if (m_movementController->velocity()[1] < -50) {
  m_vaporTrailTimer += WorldTimestep;
  if (m_vaporTrailTimer > 1)
      m_humanoid->setVaporTrail(true);
  }else{
  m_vaporTrailTimer = 0;
  m_humanoid->setVaporTrail(false);
}

By adding this snippet, we can see what it was roughly meant to look like.


We can also modify Player restrictions such as

bool Player::canUseTool() const {
  return !isDead() && !isTeleporting() && !m_techController->toolUsageSuppressed() && m_state != State::Lounge;
}

to just

return !isDead() && !isTeleporting() && !m_techController->toolUsageSuppressed();

Allowing us to use our inventory while sitting down

Further Thoughts

Future work on the engine can lead to further modding capabilities and engine optimizations. There are many potential client side performance improvements that could be made without touching any network code. This would maintain compatibility with the vanilla client. The netcode could be updated as well, but this would break compatibility once major changes were made. If both (or more) parties are willing to use a modified client, any theoretical modification could be made. The possibilities are endless.

As of 2024, there now exists a few Starbound open source community projects with the aim of enhancing the base game’s experience. : )


It helps me if you share this post

Published 2023-05-27 04:55:45

AI

AI will help developer efficiency, not replace it.

One of the most significant use cases I’ve found for AI in my development work is its ability to automate repetitive tasks, such as using a bunch of similarly named, grouped variables. I recently was creating a ‘Human’ class, and needed all body parts for variables. That was suggested and picked up almost immediately by Copilot after a couple lines, and the whole class was done in mere seconds vs a few minutes. This adds up and means that I can focus on other creative tasks, such as developing new features, creating new UI ideas or focusing on user feedback. The result is increased productivity and faster software development.

I imagine a future where one can describe the architecture of my Android app in as much detail as possible and then go in and clean up the resulting code manually to a specific vision. Developers will be fast tracked to a more active management role.


It helps me if you share this post

Published 2023-05-17 01:05:41

Why does Windows show I have a startup entry named ‘Program’?

Task Manager may display a startup entry with a blank program icon and the name ‘Program’. What is this?

While this can look malicious or suspicious, typically it’s the result of a mistake. When a program registers itself as a startup program, it may not enclose one or more values in double quotes correctly. Thus, if a program path is supposed to be ‘C:\Program Files\Starcheat\starcheat.exe‘, the developer may have mistakenly not enclosed the path correctly. Windows will read a space as the end of the value, therefore it becomes C:\Program.

View Offending File Path

If you want to view the path causing this, simply right click on the header of the task manager startup entries and show the ‘Command line’ option. ‘Startup type’ is useful to show as well.

From here, you will now be able to see the broken path and navigate there yourself.

As you can see, in this instance the value is not enclosed correctly, leading to this error.

You can then potentially remove the startup entry entirely or laugh at the developer’s incompetence.


It helps me if you share this post

Published 2022-05-18 04:00:47