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
StarMixer.cpp (audio related)
StarTools.cpp
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// Meh, padding is hard-coded here// 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.// 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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
It helps me if you share this post with anyone who might be interested.
Quick Links to My Stuff
This is a guide for virus removal for Windows PCs. If you have a computer/computers that you believe have a virus or have been hacked, here are the steps you must take to protect yourself.
Isolate from the internet
This is the most important step. A lot of functionality is limited if they don’t have a connection.
Make sure the device you believe has been compromised is disconnected from all forms of connectivity. Bluetooth should be off, airplane mode should be on, Ethernet should be unplugged. WiFi should be turned off, and device should be powered down until ready to perform other necessary recovery steps. This will prevent any malware from getting worse, ransomware from progressing, or hackers from sending remote instructions to your computer.
Additionally, immediately boot your computer into Safe Mode (as fast as possible), to prevent malware processes like ransomware from progressing further.
Booting into safe mode (with networking)
Safe Mode is a diagnostic operating mode, used mainly to troubleshoot problems affecting the normal operation of Windows. Such problems range from conflicting drivers to viruses preventing Windows from starting normally. In Safe Mode, only a few applications work and Windows loads just the basic drivers and a minimum of operating system components. This is why most viruses are inactive when using Windows in Safe Mode, and they can be easily removed.
bitdefender.com
From Settings app
Press the Windows logo key windows key + I on your keyboard to open Settings. If that doesn’t work, click the Start windows key button in the lower-left corner of your screen, then select Settings Settings icon.
Select Update & security Update and security icon, then click on Recovery Recovery icon.
Under Advanced startup, select Restart now.
After your PC restarts to the Choose an option screen, go to Troubleshoot > Advanced options > Startup Settings > Restart.
After your PC restarts, you’ll see a list of options. Press 4 or F4 to start your PC in Safe Mode. Or if you’ll need to use the Internet, select 5 or F5 for Safe Mode with Networking.
From sign in screen
1. Restart your PC. When you get to the Windows sign-in (login) screen, hold the Shift key down while you click the Power icon in the lower-right corner of the screen then select Restart. 2. After your PC restarts to the Choose an option screen, go to Troubleshoot > Advanced options > Startup Settings > Restart. 3. After your PC restarts, you’ll see a list of options. Press 4 or F4 to start your PC in Safe Mode. Or if you’ll need to use the Internet, select 5 or F5 for Safe Mode with Networking.
From system configuration
1. Launch System Configuration in Windows by simultaneously pressing the Windows + R keys on your keyboard. Then write msconfig in the text field and press OK. 2. Switch to Boot tab and, in the Boot options section, select the Safe Boot with Network. Then click OK.
If you have an Ethernet cable, plug the computer in directly.
NOTE: After you finished your work in Safe Mode, please open System Configuration again (step 1) and uncheck the Safe Boot option (step 2). Click OK and restart your machine. Your computer will now boot normally.
3. Windows will tell you that you need to reboot your computer in order for the new setting to take effect. After the reboot, your computer will automatically boot into Safe Mode.
IMPORTANT: You may not have internet because of drivers and Safe Mode
Safe Mode doesn’t load most third party drivers as a precaution. This could lead to the scenario where you can’t access the internet. In this instance, you can use another computer to download the .exe setup file and transfer it with a USB drive. You could even use your phone to download and transfer from your phone with a hard wire.
Use Virus removal tools
AFTER YOU HAVE REBOOTED INTO SAFE MODE I recommend:
Download Malwarebytes FREE, install and run (they will push you to buy the premium version, it is unneeded for our usage)
Download Sophos on demand Scan & Clean. If you want a faster download I’ve mirrored it, but this may be an out of date (3/9/2022) version. This is a ‘second opinion’ scanner that should be run after Malwarebytes.
If you prefer, you can use your own antivirus removal tools.
If you are sure the virus is removed off the device, you can start recovery steps
After removing all traces of Malware
Okay, you’ve restarted your machine. You’ve run Malwarebytes. You’ve run Adwcleaner. You’ve turned off safe mode and now you’re back on the desktop. What now?
Run another virus scan
Seriously, you want to be 100% sure your device is at ground 0 again, especially after a breach. It’s better to be safe than sorry. Now that your device is at a “normal” state, it’s best to be sure some sneaky process isn’t running in the background again somehow.
Change your passwords
Depending on the type of virus, it may be prudent to update the passwords you use for online sites that are important to you. Especially any financial accounts or important email passwords. Trojans frequently exfiltrate passwords as one of the first actions taken upon an infected system.
Check your files
Double check that none of your important files were affected. If they were, this is a great reminder to do a backup! Or at least backup the files that are important to you.
Check antivirus settings
Make sure everything is functioning again and there aren’t any settings turned off from the attack.
Monitor site logins
Watch for site logins (via email or sms) over the next few weeks. If you’ve changed your passwords this shouldn’t be an issue but you can never be too careful.
It helps me if you share this post with anyone who might be interested.
Quick Links to My Stuff
I like Windows, but the new update is terrible. They broke my favorite programs and the new interface is confusing.
But that’s not the only thing they broke.
They also broke the Start menu. Back in my Windows 7 days, the Start menu was a thing of wonder. With the Aero theme (which I miss so much), it was an amazing thing to look at. And it was simple to use. You wanted to start a new program? You clicked “All Programs”. You wanted to find a program? You clicked “All Programs”. You wanted to change a setting? You clicked “All Programs”, then “Control Panel”. You wanted to shut down your computer? You clicked “All Programs”, then “Shut Down”. You wanted to turn off your computer? You clicked “All Programs”, then “Turn Off Computer”. And it was fast. You didn’t have to wait for the Start menu to load, it was just there.
When Windows 8 came out, they tried to change this by introducing the Metro interface and the Start screen. The Metro interface was not the best choice for a desktop interface, but it was still better than the Start screen. The Start screen was a mess. It was hard to find anything and it was slow. They tried to fix this in Windows 8.1 by adding the Start button, but it was still a mess. In Windows 10, they tried to fix it again by adding the Start menu, but it was still a mess. And they tried to fix it again in the Creators Update, but it was still a mess. I don’t know what they’re going to try to do in the Fall Creators Update, but I’m sure it will be a mess.
This is what I was trying to say. I don’t know if it will be a deal breaker for me. I’m considering it, but I’m not sure. I’m not a big fan of the interface or the lock-in, but I like that it’s a good deal and the hardware is good. I’m thinking of getting the 128GB version, though.
The new release of Microsoft’s major operating system has lots of bugs. This sentence is correct.
As for Windows, I’ve used it for years and it’s still not ready for the desktop yet. It’s much better than it was in the past, and it’s getting better, but it’s not quite there yet. I’ll be keeping an eye on it, and when it’s more polished I’ll give it a go.
There is no longer the option to move a box to the front or back. Instead, the option is to change the order in the stack, which may not be as intuitive. The design of the interface has been greatly simplified. The panels have fewer tabs and the options have been moved to a separate popout menu. The search bar has also been removed. The position of the panels and the zoom level are no longer stored with the document. It may be annoying to have to zoom out and rearrange the panels for every new document you open. The new interface may be less friendly for new users. The interface was already quite simple, but the new interface is even simpler.
Wondering wtf you just read? Everything above was generated with GPT-3 with my posts as a base.
It helps me if you share this post with anyone who might be interested.
Quick Links to My Stuff
When typing, it’s always disconcerting to realize THAT CAPS LOCK IS ON. Caps Lock is useful (sometimes), but more often than not I find myself accidentally engaging it. However, you can change things around in your preferred OS (this guide is for Windows) to allow disabling Caps Lock with Shift. This simple setting changes things for the better, and makes more logical sense.
We’ve Been Doing It Wrong
The logical argument for disabling Caps Lock with Shift boils down to states, and being aware of the key’s current state with the least amount of information possible.
If Caps Lock is a toggle, it’s possible to accidentally hit the key an unknown number of times, or lose track of whether it’s on or off. In order to discover the ‘state’ of the key, you must begin typing. The other way to discover the ‘state’ would be to glance down at your keys, or have some other sort of ‘indicator’ like a keyboard implements visually or graphically. Both of these are wasted efforts and time.
When typing, you shouldn’t look at the keys as much as possible. The cleaner way to handle our problem then is to make Shift disable Caps Lock. When you start typing your sentence, if caps lock is on, it’s naturally disabled. It works naturally with how you type and I no longer encountered any errors with Caps Lock at all upon integrating this. When you need to use it, turn it on. Then, go back to typing as before. It’s no longer a separate mechanism to keep track of, but integrated into the typing experience and bows out quickly after usage without any extra key press. As an added bonus, you don’t have to wonder if Caps Lock is ON either. You simply click it, and type. If it was on, no effect!
From there you will see the very last image’s menu
Windows 11
Navigate to Time and Language > Typing > Advanced keyboard settings
Find Input language hot keys
You will see the very last image’s menu
You will then want to change this option:
Now I can’t go back, and I never wonder or think about caps lock accidentally being on. Been using this as default for around five years now. It surprises me this isn’t the de facto setting.
It helps me if you share this post with anyone who might be interested.
Quick Links to My Stuff
On July 19th 2022, Google introduced Carbon Language. What exactly is Carbon, and what does it aim to achieve? Note that the Carbon coding language is experimental.
To understand Carbon, we first need to take a look at the language it’s attempting to augment. That is, C++. It remains the dominant programming language for performance critical software, and has been a stable foundation for massive codebases. However, improving C++ is extremely difficult. This is due to a few reasons:
Decades of technical debt
Prioritizing backwards compatibility over new features
C++, ideally, is about standardization rather than design
Uses a committee process that takes multiple years to make changes, and sometimes can’t at all
Carbon, as Google puts it, is okay with “exploring significant backwards incompatible changes”. This has pros for those wanting to work with a language developing with the mindset of “move fast and break things”.
Carbon promises a few things in their readme:
Carbon is fundamentally a successor language approach, rather than an attempt to incrementally evolve C++. It is designed around interoperability with C++ as well as large-scale adoption and migration for existing C++ codebases and developers. A successor language for C++ requires:
Performance matching C++, an essential property for our developers.
Seamless, bidirectional interoperability with C++, such that a library anywhere in an existing C++ stack can adopt Carbon without porting the rest.
A gentle learning curve with reasonable familiarity for C++ developers.
Comparable expressivity and support for existing software’s design and architecture.
Scalable migration, with some level of source-to-source translation for idiomatic C++ code.
Google wants Carbon to fill an analogous role for C++ in the future, much like TypeScript or Kotlin does for their respective languages.
JavaScript → TypeScript Java → Kotlin C++ → Carbon?
Talk is cheap, show me the code
Okay, so what does Carbon look like then?
First, let’s see how to calculate the area of a circle in C++.
C++ coding example
Compared to Carbon:
Carbon coding example
My initial thoughts are that the syntax looks mixed between C#, JavaScript, and C++. Prepending “var” before each variable seems redundant. Why not a type name followed by a declaration? One might argue that it leads to easy variable identification without memorization of variable types but that makes little sense as you put the type anyway. The way variables are initialized with “:” instead of =, reminds me of Javascript. Not sure if that’s a good thing, it looks less like C++ than I expected. Oddly, they chose “import” for the system packages it seems which is also shared with Python. I do like the shortening of function to fn. You could argue shorthand is the point because it’s cleaner and smaller, but again why is it defined as a function and then an ‘i32’? Seems redundant. unless they decided fn FunctionName() -> i32 is shorter than int FunctionName(). It could be their goal is simply to separate the syntax from other known languages enough to recognize at a glance. Maybe I’m missing something.
One neat feature they’ve shown is the interoperability between Carbon and C++. You can call C++ from Carbon and vice versa. You can rewrite or replace as little or as much of your libraries as you want without fear of breaking anything. Well, at least without breaking anything more than normal when dealing with C++.
C++ code used in both Carbon and C++
And better memory safety is also promised
Safety, and especially memory safety, remains a key challenge for C++ and something a successor language needs to address. Our initial priority and focus is on immediately addressing important, low-hanging fruit in the safety space:
Tracking uninitialized states better, increased enforcement of initialization, and systematically providing hardening against initialization bugs when desired.
Designing fundamental APIs and idioms to support dynamic bounds checks in debug and hardened builds.
Having a default debug build mode that is both cheaper and more comprehensive than existing C++ build modes even when combined with Address Sanitizer.
Time will tell if the language develops into a developer favorite or fades into obscurity like Dlang. What, you haven’t heard of D?
It helps me if you share this post with anyone who might be interested.
Quick Links to My Stuff
Typically, browser vendors force default button styles onto the program. This can be troublesome when you use something like SecureUxTheme to change your Windows styles, and you care about the cohesiveness. There is a hacky solution, even if the Firefox forums told me there wasn’t. ?
DEFAULT: Custom themed Notepad next to standard browsers
For Google Chrome, Edge, Brave, and some other Chromium-based browsers
For Chromium based browsers you can simply change the shortcut target to allow launching with your custom changes.
Open start menu.
Search and find your browser shortcut
Right-click, and open file location
Right click > open Properties of the browser shortcut (The shortcut for Chrome in the Start Menu may be found in C:\ProgramData\Microsoft\Windows\Start Menu\Programs)
Add this line --disable-windows10-custom-titlebar to the end of the Target field after a space. (For Chrome, “C:\Program Files\Google\Chrome\Application\chrome.exe” becomes “C:\Program Files\Google\Chrome\Application\chrome.exe” –disable-windows10-custom-titlebar )
In order for your changes to show up you may need to use Task Manager (ctrl + shift + esc) and kill all background processes of that browser
Repeat for each browser shortcut you use.
Changing the Registry Launch settings
This is all well and good but what if you click on a link and the browser opens automatically? Now we aren’t using the custom launch option anymore. We can edit the registry to fix this.
This is the “I’m not responsible if you break your computer” warning: BE SURE TO ALWAYS MAKE A BACKUP OF THE REGISTRY BEFORE PERFORMING ANY CHANGES.
Launch the Registry Editor (Win + R, regedit)
Navigate to Computer\HKEY_CLASSES_ROOT\ChromeHTML\shell\open\command
Change the (Default) value from "C:\Program Files\Google\Chrome\Application\chrome.exe" --single-argument %1 to "C:\Program Files\Google\Chrome\Application\chrome.exe" --disable-windows10-custom-titlebar --single-argument %1
We are essentially just adding that custom launch argument onto the default launch arguments Windows calls when it opens the program
Starting the browser now use your themed settings. Older versions Chromium may have a different startup option. Try --disable-features=Windows10CustomTitlebar if it doesn’t work for you
Firefox
Firefox needs CSS and changing an internal flag in order to work.
Open your Firefox profile. You can find it in %appdata%\Mozilla\Firefox\Profiles, try looking at the one most recently modified.
If the folder doesn’t exist already, create a folder called ‘chrome‘. Yes, this is the tutorial for Firefox.
Inside the ‘chrome‘ folder in your profile, create or edit the file ‘userChrome.css‘.
Put these contents (or embedded down below) into the css file, either on its own or adding to what is already there. You can modify anything you want, such as the ‘titlebar-button:hover’ alpha value to your liking.
Open a new Firefox window
Enter about:config into the URL bar, and bypass the warning
Change the toolkit.legacyUserProfileCustomizations.stylesheets option to true by double clicking.
Restart Firefox
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
At some point when looking through Task Manager you may notice the ‘priority’ setting in Task Manager and decide that you want your favorite game (example: Minecraft) to run faster. You right click the process in Task Manager and set the priority to ‘realtime’, the highest setting.
However, upon clicking that option, a scary looking dialogue option pops up informing you that this is probably a bad move.
Changing the priority in this instance causes our laptop mouse to lag across the screen and explorer.exe to stop responding. Fun! Why is this the case? What’s going on here?
Realtime priority is the absolute highest priority you can set a program. This tells Windows you want to dedicate as much CPU time as possible to that process, so basic process like mouse input and Windows UI start competing for CPU cycles.
Realtime is the highest process class
OPTIONAL: Process Table Explanation and Further Information
The “Base priority” column in Task Manager is showing you the process class (called “process priority class” in some docs). Note that Task Manager (at least in Windows 10) labels the “Idle” priority class as “Low” (probably to avoid confusion with the idle process, etc.).
The process class is used only to initialize the priority of threads created within the process. Every thread is created with the “normal” thread priority. If the process is of the “normal” process class, then that means the thread has a base priority of 8.
Programs can change the priorities of their own threads within their process class. In a “normal” process, setting a thread to THREAD_PRIORITY_HIGHEST sets that thread’s base priority to 10. If you change the priority class of a process (say with Task Manager) then every thread’s base priority changes according to the table.
There are a lot of “name anomalies” in this table. “Highest” is not the highest thread priority, “lowest” is not the lowest, “idle” does not mean you are not or will not be doing anything, and “realtime” does not guarantee scheduling behavior suitable for real-time work (it’s just more predictable than the non-realtime classes, partly because it’s above them all, and partly because automatic priority adjustment is turned off in the “realtime” class).
For processes, one is supposed to use the process classes to indicate how important – or not – it is for each process to get CPU time, relative to a “normal” process. And within each process, the developer is supposed to set the thread priorities similarly, relative to a “normal” thread within the process. In practice, very few developers ever bother. (And they should. For example, a compute-bound task like video rendering should be set to a lower-than-normal priority, to avoid interfering with interactive use of the system.)
And the “idle” process class, and the “idle” thread priority within a process, does not mean nothing will be done by that process or that thread. It just means the thread or the process is willing to live with CPU cycles that nobody else wants.
You’ll notice that there is no “0” on the table. Ordinary applications cannot request running at priority 0 through the normal APIs. Only kernel mode threads can run at priority zero. As you’ve found, that is reserved for the zero page thread – or threads; there may be more than one on a NUMA machine.
This doesn’t lead to locking the system entirely because most programs don’t actually use 100% of the CPU regardless of their priority. Most threads do wait for things sometimes, and that could include waiting for a read/write to complete, or some other thread to indicate that they don’t have to wait any more. Additionally, “real-time priority” as a term actually consists of a range of priorities, as indicated by the table above. It’s possible for one “real-time” process to have higher priorities than those of another “real-time” process.
Most of the time, there’s no real reason to change process priority, although a few times it has been personally helpful in situations where two programs are working on a CPU intensive task, and they are slowing each other down. It’s possible to set the program’s process priority to “Above normal” pretty safely, allowing the CPU to dedicate more time to it.
It helps me if you share this post with anyone who might be interested.
Quick Links to My Stuff