Spacebase DF-9

Spacebase DF-9

Not enough ratings
LUA File Tweaks, Suggestions Guide (Mac Version) - IN-PROGRESS (Updated Nov. 20th)
By 76561197991858962
Mac users may or may not have ready-made tools to download mods for Spacebase DF-9, or even the proper tools to easily create .lua files without racing to open-source sites and learning some quick Lua scripting, but we CAN find and tweak the .lua files using TextEdit. This guide (a work-in-progress) will help Mac users locate .lua files related to gameplay rules, scripted events and behaviors, and change the gameplay with a few simple tweaks. Start with more matter, have oxygen recyclers support more colonists per unit, gain more matter from mining, and a host of other tweaks.
   
Award
Favorite
Favorited
Unfavorite
Introduction
Hello all,

Usually I adopt the "lone wolf" philosophy regarding gaming, but with the issues surronding the vanilla version of Spacebase DF-9, even reclusive gamers are aiding others regarding gaming tweaks in order to make the game playable. Caesar has a good thread regarding tweaks for the Windows version and is currently attempting to have replacement files posted on a sharing site. For myself, I'm hesitant to post files for sharing until I find an acceptable host, plus I'll have to explain where the users have to place the files...and then help them should they place them in the wrong folders.


Until I figure something out, I'll list each tweak with the correct file paths and values in case tech-savvy Mac users wish to try them. I'll even delete my game and start fresh so that I'll be able to post both the before and after values in addition to testing them to ensure that they'll work.
Searching for the .lua files (the WRONG way and the RIGHT way)
To start: We have to find those .lua files; sure Double Fine released the script files for modding but they sure as crap didn't make them accessible. There's two ways to find them:

Option #1 - THE YE OLDE WAY (aka the STUPID WAY, which I used until I found option #2):

You can find the (well-buried) .lua files by holding down the Option key while click Go in the menu bar and following this path:

Library > Application Support > Steam > SteamApps > common > SpacebaseDF9



In the SpacebaseDF9 folder, you'll see a new icon called Space. Right-click it and select Show Package Contents.



When inside the Space folder, follow the path Contents > MacOS > Data > Scripts



Or...we could do it the FASTER, more CORRECT way... T_T

Option #2 - The "boy I'm a true idiot!" (Quick) Method

In Steam, right-click the game and choose Properties, then choose Browse Local Files; this method brings you all the way up to the SpacebaseDF9 folder mentioned in Option #1. Follow the instructions listed after reaching this folder to finally reach the .lua files.
We found the files, but how can we modify them?
Wow, LOTS of .lua files in the Scripts folder huh? Well, how do we modify them safely without breaking the game worse than it was originally released? Well, the files, while affixed with the .lua suffix and marked as "Unix Executable Files", we can safely modify them using TextEdit. Here's how:

1. Right-click the .lua file you want, then choose Open With > Other...



2. Scroll down the list of applications and choose TextEdit



*NOTE: don't worry about the "always open with" check box, leave it unchecked. Yes, it's a nuisance using this method to open each file, but I tried the "Always Open With" option and it never remembers. Oh well...
Default game setting changes - More Starting Matter (GameRules.lua)
MORE STARTING MATTER

Sick and tired of racing to enclose the SEED, build an Airlock, build a life support room, and still try to save enough matter for building a refinery room so that you can quickly replenish your now-empty supply of matter? Want to get a leg up on building the base in order to keep your citizens as happy as possible? Want to place turrets almost IMMEDIATELY just in case those freaking Raiders show up to crash the New Base party? Well, 2000 matter to start with is STUPID! So let's change it!

Open the GameRules.lua file using TextEdit and you'll see the game rules code:



NOTE: The text font seen here is called Menlo, and the size of the font is 11 (just an FYI).

Scroll down until you see the text "Matter Economy". It'll look like this:



See the "STARTING_MATTER = 2000" line? Well, what if we want, say 10000 matter to start with?

Highlight and change the number so that it'll look like this:



CLOSE THE WINDOW. DO NOT SAVE or ANYTHING. JUST SIMPLY CLOSE THE WINDOW.

Run the game as normal. When you select a new base, you'll find that instead of 2000 matter, you now have 10000. DON'T GET CARRIED AWAY WITH YOUR FIRST ROOMS until your first three colonists can breathe. I highly recommend Residence rooms after building the SEED enclosure, Airlock and Life Support rooms so that the silly colonists can put their items on shelves and dressers. Also, if you want to pair up roommates with their friends (if that's your thing), then do that too.
Default game setting changes - More Matter from Mining (GameRules.lua)
MORE MATTER FROM MINING

Notice that when you highlight a group of rocks to be mined for matter, you get a big value, but when the Miner brings the matter fragments to the refinery you get...a somewhat lesser amount? Doesn't seem fair, does it? Well, we can change that too, and it happens to be in the same GameRules.lua file!

1. Open the GameRules.lua file the same way as described in the previous sections.

2. In TextEdit, you'll see the values just below the --matter economy entries; they look like this:



The Miner ONLY gets between 30-50 matter for each piece of rock, EVEN THOUGH WHEN ORIGINALLY SELECTED, THE GAME SHOWS 180 FOR EACH PIECE? And upgraded mining tools only grant +10 more matter? WTH!? Okay, NOW WE HAVE TO CHEAT!

The game has been saying +180 matter for each one we highlight when assigning mining missions, so how about we GET THE MATTER WE DESERVE...AND THEN SOME! Change the values above to read like this:



CLOSE THE WINDOW and run the game. NOW we should get the matter we deserve, which looks to be a bug that we've been suffering through since Day 1. Thanks, Double Fine...
Default game setting changes - More Matter for Vaporizations (GameRules.lua)
MORE MATTER FOR VAPORIZING OBJECTS

By default, the game grants 75% of the matter value for vaporizing objects. It's in the same .lua file (GameRules.lua), just under the --matter yield values. You'll see this:



Personally I think 75% of the original build value is generous enough, except that we'll mostly be tearing down derelicts after we loot them, we require adequate compensation But hey, if you want to change it:



CLOSE THE WINDOW and run the game. Now you get 100% of the matter value. You can make it as high as you want, but just remember that the number MUST show as a two-decimal number (1.25 = 125% and so on).

At least tearing down derelicts will be even MORE worth the time, trouble and risk, especially if your base's location has low remaining areas to mine.
Default game setting changes - Changing Corpse Values (GameRules.lua)
MORE MATTER FROM CORPSES

By default, the game rules only give a range of 130-170 matter for every corpse (killed Raiders or colonists) delivered to a Refinery by a Doctor. The rules are listed right under the vaporizing objects percentage rule in the GameRules.lua file, and looks like this:



Again, I don't see this worth tweaking, but you put a lot of love and care (or contempt and headaches) in these now-dead colonists. Plus you might want just compensation for Raider bodies. I suggest this (if you want):



CLOSE THE WINDOW and run the game. NOTE: In an upcoming section I'll show you where you can tweak values in order to reduce the sadness level the remaining colonists who lost friends or those who are bothered by the bodies lying around...once I remember the proper .lua file.
Default game setting changes - Cycler/Colonist Ratio (GameRules.lua)
OXYGEN RECYCLER CAPACITY (RECYCLER/COLONIST RATIO)

There's one more tweak that's notable in the GameRules.lua file, and that's OXYGEN RECYCLERS (the rest of the file pertains to the tutorial, full-screen options, game rule metadata and mouse functions - LEAVE THOSE ALONE, unless you want to [for example] change the option to begin the game in a full screen or not).

But for those of you who are SICK AND TIRED of the "one recycler for every three colonists" rule, we can tweak those settings, too. Right under the "--matter gained from remains" entries, there's an entry for the default Life Support system behaviors:



Why the code is displayed in this manner I don't know, but what it means is that each oxygen recycler placed in your base supports three colonists. Well, once you finish your starter rooms, you're at capacity - then you'll have wannabe colonists banging on your doors, some of them NOT taking "no" for an answer. So let's raise the recycler/colonist ratio to five, like this:



CLOSE THE WINDOW and run the game.

WARNING: When I tweaked those settings, I had colonists join faster than my recyclers could accommodate them. My oxygen drained VERY QUICKLY, so I would advise either NOT tweaking the recyclers until I find a solution or workaround (or just find out what the heck happened) or accept new colonists GRADUALLY. Space out your recyclers, build bigger rooms (if you enabled the extra starting matter trick), don't let colonists congregate so much in the starting rooms (though that can't be helped).
Delaying Raider breaching events (BreachingEvent.lua)
A. Finding the BreachingEvent.lua file

Sick and tired of raiders showing up just when you're starting to expand your base? Wish you could hold them off for just a while until you have a chance to build up proper defenses? Well, with some tweaks, you can!

The scripts containing Raider breaches is buried in a subfolder in the Scripts directory; find the GameEvents folder and then choose BreachingEvent.lua:



Just like the GameRules.lua folder, open it by right-clicking it, choose Open With, then Other... and scroll to select TextEdit.

Opening the .lua file via TextEdit reveals the code:



B. Tweaking the rate of breaches by Raider parties

Now to understand and modify the code regarding unwelcome guests. Not far from the top of the wall of code, you'll notice this section:



The highlighted rules state that Raiders show up in groups between one and three hostiles, and that they adopt hostile behavior instructions from a separate .lua script (Hostility). The more worrysome is the data in the final two highlighted lines; the code allows Raiders to attack your base either after six colonists or more have joined your base (nPolpulation > 6) or after 10 minutes of gameplay (GameRules.elapsedTime > 60 * 10). NOTE: the GameRules.lua has a line of code stating that time is measured in increments of 60, meaning a full game minute.

Personally, this is CRAP! We (the Steam gamers) truly ticked off Double Fine with our rants and complaints in order for them to send Space Pirates after us when we still have less than ten colonists or after ten minutes of gameplay! It's time to make things a little more fair, but how fair depends on your gaming preference. Too little excitement means a dull game, but losing five crew members (the sixth ran out of oxygen) to a single Raider when trying to expand your base during the first fifteen minutes (which happened to me one hour before starting this guide!) and earning a Game Over is even less fair.

Let's have some wiggle room regarding the number of colonists. Knowing that we need a decent-sized force to hold off Raiders while allowing for cowering colonists, Soldiers or incapacited Doctors who tried to punch two hostiles at once...and failed...let's set the number of colonists at about 30. As for time, two hours should be a fair amount of time before the first marauders show up, or 720 seconds (12 minutes) x 10 = 120 minutes.



CLOSE THE FILE and run the game. I haven't tested this yet myself, but I felt that before taking a break from this in-progress guide I should leave this info with you since the AI of the colonists is...very bad...and the Raider AI tends to be...VERY GOOD...


Delaying meteor showers (MeteorEvent.lua)
A. Finding the MeteorEvent.lua file

One thing players dread about the game besides the Raiders, Parasites and oxygen levels is the constant meteor showers. Until just recently, there's a good chance that a meteor shower would knock out a floor tile and open a vacuum, causing any innocents to be sucked into space unless you had the foresight to place alarms in the rooms and seal the doors once the affected rooms are empty. And if that hull breach happens to be your bar, a main hallway, or blocking your colonists from reaching essential rooms or a lone airlock, your colonists = screwed.

Recently though, Double Fine added lines of text in the script files stating that due to programming issues, they would hold off on hull breaches for a limited time, though I can't determine exactly when or in what version this development guideline applies to (if you're experiencing hull breaches from meteor showers, please leave a comment). Still, having to deal with fires and damaged equipment once you have 4+ (yes, four colonists and above!) is a pain in the neck, so we have to go in and fix that.

First we need to find the specific file. The script for meteor events isn't shown in the default list in the Scripts folder itself - it's in the GameEvents folder:



B. Editing the meteor event script

Opening the MeteorEvent.lua file with TextEdit shows this:



Now to scroll down to here:



What the highlight text here means is that when the number of colonists (nPopulation) reaches more than four, or after the first ten minutes of gameplay (GameRules.elapsedTime > 60*10), the meteor strikes will start. But we want to focus on building the base and ensuring multiple paths just in case Double Fine reinstitutes hull breachs by meteor showers, so let's change it to something easy. I set the meteor strikes to begin after the population reaches above 30 or after the first two hours of play:



*PLEASE NOTE: I can't remember how soon I changed the settings after starting my current base, because I DID have a meteor shower either immediately before I changed the settings or immediately afterward when I reloaded the game (perhaps it was a scripted event that was scheduled before I exited the game and changed the file). However, it was a long while before meteors came again, so at least I know that this one DOES work.

In any case, more time to work on your base's design and anemities, and less time putting out fires and treating foolish burn victims. Just use the time wisely and plan alternate routes, place fire extinguishers and alarms everywhere, and definitely have excess reactors and oxygen recyclers on hand should on or even a few of them get taken out.
Delaying derelict ship appearances (DerelictEvent.lua)
This may sound wierd for some of you reading this guide. Why would someone want to delay the start of the appearance of derelicts? Derelicts can mean more colonists, Raiders, Killbots, and or the big prize, a Datacube! However, everyone knows that in order for a rescue/seek-and-destroy/datacube retrieval mission to be successful, you need a good fully armed and armored three-man Security team to take out the trash, rescue the hostages, and/or clear each room for your weak Researcher so he/she can pick up that datacube before the ship vanishes. And hey, if the ship's still there that's more matter for your colonists...if you can free some men to start vaporizing the old ship.

However, just like the meteor shower settings, derelicts follow the same default script guidelines; they appear after four-plus colonists or within the first ten minutes. Under these guidelines, derelicts with potential datacubes could appear but you'll be too busy worrying about your six-person crew to spare your lone security officer to be killed before he reaches the derelict's damaged door. And what we don't want are wasted datacubes!

The DerelictEvent.lua file is located in the same folder as the MeteorEvent.lua file that we uncovered in the previous section (in the GameEvents subfolder in the Scripts directory, see the previous section if you need to find the location). Opening this script with TextEdit will reveal this:



Now to scroll down until we see the default values:



Same ruleset as the meteor strikes, except the development team reversed the values in the elapsed time settings (instead of seconds x number, this value is listed as number x seconds), which deviates from the formatting of other lines of code in previous .lua scripts. That's no biggie, because it calculates equally (ten minutes of gameplay before derelicts show unless colonists equal 4+).

We need just a little more time. I set it to 30+ colonists, or one hour before derelicts begin to appear.



NOTE: If you want to build up a stronger security team first before storming derelicts for loot and colonists, I suggest setting the GameRules.elapsedTime value to > 10*720 (two hours) or 10*1080 (three hours). The later you delay the derelicts, the greater chance you may have at least better body armors or plasma rifles researched to equip your security team, as well as replacement security should the derelicts contain Raiders and Killbots that'll headshot your n00b team.
Delaying the all-dreaded FINAL SIEGE! (EventController.lua)
Do you know that Double Fine placed an "end" to the game? In addition to the tutorials and the goal list, an "end" has been programmed. Well, two actually.

Regarding all of the various difficulty ramp-ups (meteor strikes, raiders and so on), they stop after about eight hours of play (you'll see for yourself in a minute). But MUCH MORE IMPORTANT is the Final Siege, composed of multiple Raider Breaches at once (called by gamers as the "Megafleet"). This "end" to your base is set to start after a mere four hours (WTH?) of play.

I have yet to see this Megafleet as when Spacebase DF-9 was released as version 1.0, none of my bases lasted under one hour when using the default settings. Now that I have a base with turrets all over the place and well-armored security, I'm almost ready for "The End". But I would like more time until I have better weapons and turrets researched.

That's where this trick comes in. Double Fine's default rules have been unfair to such an extent that we SHOULDN'T play by the rules. In order to delay your base's apocalypse, we need to find that event and change it.

Unlike the two previous script files, the EventController.lua isn't hidden; it's in the Scripts folder directory and all you need to do is scroll down until you see it:



Opening the file with TextEdit presents the script:



And now to find the game's equivalent of "Doomsday":



What the frick, man!? "final siege after 4 hours"!? Many gamers won't even have the FREAKING PUB set up after four hours in the default settings! And ending playtime after eight hours? Is this for stopping the random event constants like the meteors and raiders (good) or is this really a "game over, you win" scenario where the game just "ends" (bad)?

Correct me if I'm wrong, but I thought sandbox games were known for not having a sort of "end"; the story of the game (if there is one) can end, but the world is ongoing (Grand Theft Auto, Minecraft, Cities in Motion in Sandbox mode). I can understand the Megafleet appearing (though not after only four hours, seriously Schafer and LeBreton, what the frick?) because it's a test of craftsmanship. Smart players should easily withstand a Megafleet, though they need more reasonable time to prepare.

With this in mind, I more than doubled the settings for each:



There, MUCH more reasonable. With enough time, your base should have upgraded turrets and your Security officers should have upgraded Armor and weapons. So when the Megafleet comes your whole community shouldn't see their lives flashing before their eyes; your Security officers should be cocking their new laser rifles and saying "Come at me, bro!" behind new Heavy Doors.

*NOTE: I won't know about the increased frequencies of the meteors and Raider breaches having an effect on the base until after the Megafleet event. I'll update this if I come across an issue.
UPDATE: Ending guide support of Spacebase DF-9
There's more tweaks that I wanted to list for Mac users who happen to own (or were gifted) copies of Spacebase DF-9, but life outside of gaming calls (work and school). Also, there have been numerous apologists from the Double Fine forums constantly coming onto Steam threaads to downplay the development history of this title, as well as others continuously making new threads in order to post non-constructively.

My stance is this: Double Fine used Early Access to the detriment of themselves and to the gaming community, and yes, they're suffering for it and will continue to suffer. Saying this, I see no reason for either party (the apologists/DF fandom and the "haters"/disgruntled gamers) to continue to raise the issue. Because of the overwhelming negativity, I'm ceasing support of this guide, and due to the negativity of the Steam gaming community in general will be moving on from Steam.

Thank you for reading.



You three can do what you please. You're someone else's problem now.

Jay

*Release notes:
Guide released November 16th, 2014
- Updated November 21st: added meteor shower event, derelict ship appearance and final siege script changes; changed title regarding oxygen cycler/colonist ratios from "Game default setting changes" to "Default game setting changes" to match previous sections of the guide; added release notes; changed title of the guide; added contributor.
- Updated January 12th: changed final section to reflect the end of support.
13 Comments
Joloc 15 Apr, 2017 @ 6:17am 
nvm
Joloc 15 Apr, 2017 @ 6:16am 
i found it but itcan not be edited by Notepad
Joloc 15 Apr, 2017 @ 6:12am 
whqat file has gameRules in it?
Joloc 15 Apr, 2017 @ 6:04am 
I Cant find it
76561197991858962  [author] 19 Mar, 2017 @ 10:16am 
@A Random Arstotzkan Man: I was checking out my aging Steam account and was about to uninstall when I found your message.

For Windows 10, see if Notepad will work. Also, unlike TextEdit, you may have to save your changes before closing. If your .lua changes don't work after saving and restarting, then repair the game file via Steam and try again.

On my iMac I had Windows 10 and Mac OS Sierra installed simultaneously and had separate Steam libraries, but when W10 started shutting down Firefox and sending messages demanding that I use Edge, that was it for me. Hopefully my advice above helps.
Joloc 15 Mar, 2017 @ 4:06pm 
TextEdit
Joloc 15 Mar, 2017 @ 4:05pm 
I use Windows 10, so i dont think i can use
Joloc 15 Mar, 2017 @ 4:04pm 
how do you use TextEdit?
76561197991858962  [author] 12 Jan, 2015 @ 2:43am 
Just an update: now ending support for this guide due to constant negativity from both the DF fans and the Steam gaming community. There will be no more updates, as well as very little presence from me on Steam from now on. Thanks for reading.
76561197991858962  [author] 21 Dec, 2014 @ 12:50pm 
@.C7.TainInfernus : Yes, that's one of the tricks that I omitted. Since I'm now on Winter Break I have the time to add that section after testing. By this I mean the drops in morale regarding corpses, but regarding jobs, I think the defaults are fair enough to leave as-is.

Let me know if there's anything else I can do. Also, if this guide is helpful in any way, please rate the guide so that I can receive more visibility and honest feedback.