Game Dev Studio

Game Dev Studio

Not enough ratings
So you're thinking about modding Game Dev Studio...
By hai
A couple of years after the release of Game Dev Studio, the developer added mod support. Since there haven't been any comprehensive guides on this, this is my attempt to walk you through part of the process, sort of.

(Icon: Burnhouse Lane Introduction scene. Pretty good game if you're into horror and don't mind the subject matter! Included because I was playing it when I first started writing this guide, and the image itself is a lot more subtle than what I originally had lol)
   
Award
Favorite
Favorited
Unfavorite
First and foremost,
DON'T

Seriously, I mean this; it's not worth your time. While the example mods look very promising, unless you have a solid understanding of the particular version of Lua that was made on five years ago, what you're able to accomplish is limited at best. But let's say you're able to side-step that. Bad news: mod support for this hasn't been updated in actual years, and, consequentially, that means there are serious bugs tied to mod support that will never get fixed. For example: you cannot update your mods. The game will not let you. More crucially: aspects of modding that work near flawlessly in the testing environment this game has will cause the game to almost immediately crash when the mod you've made is ported over to the Workshop. I have had to deal with this two times. What's worse is that the official source code needed to understand a lot of the documentation that the developer clearly poured blood, sweat, and tears into has been in a permanent 404 for years at this point and is practically lost to time.

If you're brave, curious, or stupid enough to be undeterred by that wall of text, proceed to the next steps.
Pressing Matter One: The Source Code
While the source code for Game Dev Studio might exist off the border of oblivion, that doesn't mean it's gone forever... sort of.

There are two unofficial repositories for the source code. One includes comments and is hosted on Github, the other is unfinished and comes straight off the Explosive Squat Games Discord server.

Before I link to anything, credit is due. The Github repository comes courtesy of Steam user Aussiemon who, in November of 2023, posted their finding to a desolate, rather unlikely place: the Steam Workshop page on GDS's Steam Discussions. Up until after the publication of this guide, I had completely forgotten about this. But to throw a bone where it's due, you can check out Aussie's finding here: https://github.com/Aussiemon/Game-Dev-Studio-Source-Code

If you're interested in the second option (for some reason), that comes courtesy of Discord user Bullet Barrage Spy. It is more unofficial than Aussie's offering, as it was all created by the user in question. As you might expect from that, and the fact that it's unfinished, you may experience issues while studying this source code. However, as somebody who has built three and a half (technically four) mods with it, it gets the job done. Before I link to this source code, it's worth saying a couple of things: one, the GDS modding section on the Discord has been vacant for a very long time, so don't expect to get much (or any) help there; two, do not harass and/or bombard the users who do show up there (namely Bullet Barrage Spy) with questions. I do not condone that, and neither should you. With that out of the way, you can find Bullet Barrage Spy's work here: https://cdn.discordapp.com/attachments/491266282981949441/1032131159670407230/Incomplete.7z?ex=66287a8c&is=6616058c&hm=6a7e2cf51f9eeebf18cb82d2442255407e0bbfefa40efeb55df2695aee852dec&
Pressing Matter Two: Spritesheet Packer
Should you choose to follow the instructions posted by the developer on the Steam Workshop tab of this game's discussion board, you'll be asked to download a program called Spritesheet Packer in order to get icons up and running.

Much like the source code, the webpage linked has been 404'd to time. Also like the source code, there are alternatives.

There are two alternatives to this:
An updated version by a completely different GitHub user released in 2018[github.com] and a mirror of the original program on Softpedia.[www.softpedia.com]

If you're skeptical or wary of the latter, I can say from personal experience that the download is clean. I have had it on my computer for months, and it's never caused my antivirus any trouble or caused any other issues that would generally impede my usage.

This is an essential program for modding this game, so don't skip this step.
Limitations and Workarounds, Introduction; B-Side: A Specific Breakdown of an Error
To go back to my prelude, there are three notable limitations when it comes to modding Game Dev Studio:
  • You have to at least know the bare minimum of Lua to proceed, and that's only if you intend to make more basic mods. (I can't reaaaaally help with this, but I can provide some examples)
  • Uploading to the Workshop is far from reliable and prone to errors.
  • You cannot update your mods after they've been published.

If you want to find reliable workarounds to either of those, proceed to the next step. If you're curious about that last bit, stick around.

***

Do you want to know how completely and utterly borked the Workshop support for this game is? Here's what happened to me:


It begins with an innocuous error. A variable that wasn't meant to have any numerical value was assigned a numerical value. Or, perhaps, a variable that supposed to house a numerical value has been fed something that isn't a number. Unless you're experienced with this and can read these errors like the back of your hand (I'm not, and I can't), I wish you the best of you if you ever intend to mod this game. Case and point, there should be an easy solution to this, right?

But in practice, the error is far from innocuous. Reading into it quickly reveals itself as something you have no chance of ever fixing yourself.

The variable totalWork is the variable that assigns the amount of work that has to go into a taskType before the game can register it as completed. To put that into layman's terms, a taskType is each individual task given to your developers in-game during the development of a project, meaning that removing this variable or feeding it junk irrevocably wrecks the game.

Now, you could try your best to figure out what's being fed to the totalWork variable. You can double check—no, triple check—your code, and the result will be the same. Unbeknownst to me when this error was first reported to me, this is something that the Workshop support breaks. I have to assume that the game is pulling a string or unrelated variable from the mod's metadata into this variable, because otherwise, I have no explanation for it. If you put a mod that's giving you this error in the game's mod folder, you don't get this error, period.

Essentially, provide a separate mirror to your mod on its Workshop page (which nobody will use), or a guide explaining the mod migration process (which I guarantee you not many will read through), or get ♥♥♥♥♥♥.

More details ahead.
Limitations and Workarounds: Reliably Uploading Your Mods
The solution to errors like the one found in the last step is simple: bother with the Workshop, but also don't. Alternatively, you could use the more reliable and much faster method of uploading everything to third-party websites, but without Workshop, you're not going to get any visibility for your creations.

The rigamarole goes like this: instruct your users to install the mod through the Workshop, locate where they've installed it on their computer, copy everything found within your mod folder, and then paste it into two completely separate folders to be located in your game's mod directory.

If you want a more detailed breakdown of this, I had to essentially write a guide as a Workshop page so anyone who attempts to install any of my error-prone mods is pointed in the right direction. If you can't be bothered to put any of that into your own words, make it a requirement for your mods as I have. I really don't mind.
Limitations and Workarounds: Updating Your Mod
...through third-party websites.

This one's fairly simple:
  • Use your screenshots to inform any passing users to check the description for updates, and to subscribe to the thread if they would like to be aware of when you've updated any of your mods.
  • Using a separate directory, repackage your mod using only the necessary folders and files for modified content (e.g., if you're only updating a file for initialization, only include the folder you used for initialization purposes and the file modified).
  • Archive the content of that folder. While formats like .rar are pretty standardized these days, it's still a good practice to archive everything in .zip format if you want it to be more accessible.
  • Upload your archive to a trusted website, such as Google Drive or MEGA. Alternatively, you could use a shell Discord server to upload all of your files to. This is what I've done so far, and it's been working out pretty well.
  • Copy and paste the download link to your mod in the description. Optionally include a changelog.

There are two issues with this approach:
  • If someone is wary of third party links like these, you will not change their minds.
  • You have to be careful about what sites you choose to use because the links you post always have the potential to be removed by moderators.

This is the only workaround available.
Modding 101: Folder Structure
There are two mod folders located directly inside of Game Dev Studio's root folder:
  • mods removes the middleman of Workshop support and allows you to use mods directly
  • mods_staging is used to upload your mods to the Workshop.

Regardless of the folder you're using, all mods for Game Dev Studio must be formatted in this style:
  • FOLDER ONE: The title of your mod
  • FOLDER TWO, located directly inside of FOLDER ONE: files

Deviating from this will cause the game to outright ignore your mod.

If you intend to upload your mod to the Steam Workshop, bear in mind that your mod's icon must be placed in FOLDER ONE, but outside of FOLDER TWO.
Modding 101: Enabling the Console
The Console is an essential tool for debugging your mods. While the errors given out are seldom as specific as I would like them to be, printing information to the console smartly is a great debugging tool and a perfect way of circumventing this.

To access the console, either:
Open up Modding menu on the main menu and check "Open Console"


Or put --console in your game's Launch Options under Properties > General

For an example of how I personally use the console, each and every file I put in a mod prints a line of text to the console so I can tell if it's been loaded in or not. This has a minor use to me (if I forget what a file does and need to edit a feature, I use it for reference), but what makes it a necessity is that it's a great tool for knowing if you have a problem file. Say a line of code in one file is breaking the game and you have about six to seven to worry about, knowing which one the game spats out clues you into the issue far quicker than if you had to brute force it.

If you don't know how print anything to the console, it's as simple as including this line of code:
print("your text goes here")

Additionally, if you have a set of strings that you repeat frequently and can't be bothered to keep typing them out, you can also store those strings in variables, which you combine with new text. Here's how that works:

local variableExample = "Local variables are limited to one file, or one section of a file's code"

variableExample = "This is a global variable, which can be used in any of the files in your mod, so long as it's created before the game loads in the file that needs it"


For an additional example, this is how I implement the feature I discussed.

--In your main.lua file (don't worry if you don't know what this is, I discuss it later)
iT = "INTERNAL MOD TITLE: " --Internal Title
fS = "File: " --File selected
fSe = " Loaded." --File selected end
pS = " PURPOSE: " --Purpose of file loaded

--In any file that main loads in
print(iT+fS+"cpk_1/EXAMPLE_FILE"+fSe+pS+"This is an example")
Modding 101: Sprite Sheets
Spritesheet Packer is a program used to automate the process of building sprite sheets. If you wish to add custom icons to your mod, compile them into a folder and then import them into Spritesheet Packer. To import your sprites, you can either drag them into the program or manually import them. Be aware that the order in which you add the sprites affects the order they're placed in. For example: if you drag your sprites into the program going from right to left, the last sprite in your folder will be the first one on the left.

Export your sprite sheet into a location of your choice. Typically, for the sake of organization, I do this in a mod initialization folder typically named something like "modInit" found within FOLDER TWO. What you'll get exported is a png file that's packed all of the images you added into one and a .txt file with data that correlates to where each sprite is. This .txt file also contains the names of each image in case you forget them.
Modding 101: Initialization, or How I Learned to Stop Worrying and Love main.lua
In order for Game Dev Studio to recognize your mod, your mod must also contain the necessary steps for initialization. All of these steps are to be included in a file placed directly within FOLDER TWO called main.lua. While you are free to add as many as directories as your heart sees fit, do not place main in any one of these.

main Can be used for general coding purposes. If you want to add new genres or themes through main, nothing is stopping you, and a few of the smaller mods found on the Workshop (e.g. Real Manufacturers and Platforms) actually do this.

The other two important, can't-do-without uses for main are as follows:
  • Loading in your Sprite Sheet(s)
  • Loading in other directories and scripts

To load in Sprite Sheets, simply put this in your main file:
spritesheetParser:parse("LOCATION_AND_NAME_OF_YOUR_SPRITESHEET")

For the sake of clarity, "LOCATION_AND_NAME_OF_YOUR_SPRITESHEET" is a template to be replaced with wherever your sprite sheet is located and whatever it's called.

To load in files, simply put this in your main file:
require("NAME_OF_YOUR_FILE")

Once again, that's a template.

If any of the files you're loading in are in separate directories, you can load them in by doing this:
require("DIRECTORY_NAME/FILE_NAME")

This example also extends to sprite sheets. It's worth noting that, while other coding languages may use a backslash to indicate a directory being loaded in, this specific version of Lua uses a regular slash.

If you have multiple files within the same directory and don't want to spend a lot of time writing and rewriting it, consider using a Local variable as a shorthand. In Lua, variables are global (i.e., they carry across all files of an application) by default. By declaring a variable as Local, it is confined solely to the file that declared it.

In this case, here's a real example I use in one of my mods:

--CONTENT PACK 1 (-- Establishes comments, --[[ and ]]-- turn them into blocks)
local cpk_1 = "RSA_1_CONTENT/"

require(cpk_1+"t_Aud1")
require(cpk_1+"t_Gen1")
require(cpk_1+"t_Prs1")
require(cpk_1+"t_Thm1")
Adding New Features
The best way to learn how to add new features is to take a look at the source code before prodding at anything and referencing it with the documentation found at http://gamedevstudiogame.com/ .

For this process, I highly recommend having a program like Notepad++ installed. With Notepad++, you can search entire directories worth of files to see if any of them contain a single variable. In cases where a variable can be hard to track down, this proves beneficial. Notepad++ can be found here[notepad-plus-plus.org], although if you have an alternative that works for you, installing it is not necessary.

It's worth noting that the developer also has a couple of neat example mods that, unlike the original version of the source code, are still up to this day. They have a good number of comments on them.

Here are links to those example mods:
https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=1513099299
(ID: 1513099299)

https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=1883205305&searchtext=
(ID: 1883205305)

https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=1514451532&searchtext=
(ID: 1514451532)

https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=1459294221&searchtext=
(ID: 1459294221)

https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=1458169976&searchtext=
(ID: 1458169976)

https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=1507866458&searchtext=
(ID: 1507866458)

In order to find where these mods are, remember to pay attention to the ID in their links. The AppID for Game Dev Studio is 773580. Find your directory for Steam, go to Steamapps, workshop, and then content. Find the AppID first, and then the IDs of the mods you want to analyze.

To close this guide out, I will spend the next few chapters giving examples of my own.
First Project: Adding a New Theme, Then Genre
The following takes its ques from the example mod Mod and Theme Example (ID: 1507866458). If you would rather learn from that mod yourself, you can skip this.

For your first project, I recommend adding a new theme. For your second, a new genre.

For your new theme, the only thing you're required to have is follow-through and a text editor. Genres require that, and an icon. You can do this in any order you like, but seeing as themes are a bit easier, I thought it'd be nice to start there.

Adding a new Theme

When it comes to registering new items to an existing category, it's important to remember what the adjective for said action is: registerNew. One thing to note for beginners is that capitalization matters a lot. If you type that out in any way that deviates from the way the developer intended, the game will not recognize it. Unlike most adjectives, adjectives in this case come after nouns. In this case, themes. To bridge the gap between the two, add a colon (:).

Your first line of code should look like this: themes:registerNew.

From there, add a new table with an opening parenthesis and bracket ( ( and { ). This is where all of your work will go.

Each item in your parenthesis and bracket is information the game will read and add to the game. For themes, the three necessary items are the ID of your theme, your theme's Display Input/Output, the genres your theme is going to Match with, and the genres your theme is going to Match with Critically.

The ID (id = "") of your theme is the nametag the game sticks on your theme. If you want to access information relating to your theme through another file, for example, you would do so by addressing it by its ID.

The Display Input/Output (display = _T("","")) registers both the nametag that the game will identify the name of your theme with and the name itself. The primary function of this is for translation; if you were to make a version of your mod that translates it to another language, or include that translation into the mod itself, you would do so by accessing the Display Input. Whether or not it affects the Output, the Display Output is the name of your theme as shown to the user.

Match (match = { }) determines the profitability of a theme when crossed with a genre. Match is, itself, a table. Inside of it are the IDs of established genres, which are paired with either a statement or a number to determine how well they match. Statements range from themes.MATCH_VERY_BAD to themes.MATCH_VERY_GOOD and themes.MATCH_PERFECT. Numerically, a good rule of thumb is that anything below a 1 is considered a poor match, while anything above a 1 is considered great. It's worth noting that Game Dev Studio is very stingy about how you use numbers. If the numbers you use fall outside of the range established by the developer, the game will crash. This is not hyperbole, this is not an exaggeration. The numbers at your disposal are as follows:
  • 0.5
  • 0.25
  • 0.75
  • 1
  • 1.25
  • 1.75
Consider anything that falls out of this range to be unsafe.

Critical Matches (reviewAffector = { }) determine how well a theme does when crossed with a genre in reviews. Similar to Match, this is a table. However, Critical Matches take statements only. The statements are as follows:
  • themes.REVIEW_MATCH_VERY_BAD
  • themes.REVIEW_MATCH_BAD
  • themes.REVIEW_MATCH_NORMAL
  • themes.REVIEW_MATCH_GOOD
  • themes.REVIEW_MATCH_VERY_GOOD

Close your table, and you're done with your first theme.

The fruit of your labor should look something like this:

Pastebin Variant[pastebin.com]

(Post-mortem edit: Hi! I totally forgot to mention that the critical error of going outside of the bounds the developer placed on variables is shown as part of this example screenshot. Please do not copy this screenshot verbatim!)

Adding a New Genre

Now, copy over your code from Themes, hollow out its contents, and replace themes:registerNew with genres:registerNew

From Themes, Genres carry over: ID and Display I/O. Unique to Genres is an icon, a score impact table, and outside of the table's contents, how well your genre matches with the audience a user chose.

Since the icon is the simplest, I'll start there. If you don't already have a sprite to use, create one. You can find a matching imagine online, make a new one if you want, whatever floats your boat. The game will adjust the size of your sprite, anyway, but my personal recommendation is 32x32 and smaller. If you have any detail that you want carried over, it will get lost if the image is too large. Load your spritesheet in through main.lua, and pay close attention to the name of the image itself in the accompanying text file. Under icon, put that image name in quotation marks (icon = "test_icon"). You only need the name of the image itself, as the game does not need to be reminded of where it's stored once you load the sprite sheet in.

Like match, scoreImpact is also a table. Going from graphics all the way down to world design (or, if your heart is set to it, whatever is particularly relevant for the genre you're making. Be forewarned, though, that excluding any field here will force the game to assign it a default value), this table informs the game of how important each factor is.

As for audience matching, that will require you to work just under the table you've created for this genre. Type in audience:addGenreMatching to start. Then, in parenthesis, include the audience you're trying to match a genre with, the genre itself, and a numerical value within the range established before this representing how well the audience match is.

When you're done, it should look like this:

Pastebin variant.[pastebin.com]

Good job! That's your first mod complete.

Now, for a more personal example...
How I added a new category to Game Dev Studio
My crowning jewel, the one reason I wanted to mod Game Dev Studio, is the Progression category. It gives you two options: Zoned progression, and Open progression. Following in the apparent design philosophy of this game, both are vague enough for the user to put their own interpretations on them. This is how I added that to the game.

I created a simple 32x32 (or smaller, I don't recall) icon for the genre, put that in a sprite sheet which was saved to my modInit folder, and then loaded into the game through main.lua.

Inside my folder for initialization, I have a file that sets the category up. Something you'll occasionally find while modding Game Dev Studio is that any code iterating on already existing systems needs to have those systems duplicated, line by line. While I have no answer for why this is the case, the simplest assumption I can think of is that mods in Game Dev Studio cannot iterate on those systems. In order to overwrite them, you have to provide the game with the same logic it's used to, otherwise it blanks out. This filtered me for the longest time, since the game gave me no clear answers. Thanks to trial-and-error on my part, now you know. In my category setup file, this means copy-pasting the code that sets up all of the available categories and then only altering it when it concerns the new category. The order in which you place your new category mirrors itself in the final product. In this case, Progression is the fifth category on the rung, so it appears as the fifth box to check off. I then mirrored this for the MMO categories, this time, putting it first.

The end result looked like this:


I then forgot to add the rest of the code that makes MMOs work. It is important that you're intuitive and notice this, unlike me, because otherwise MMOs simply do not work.

To ensure I can impart my knowledge of this error to you, here's what I forgot at first:


The next step was to add functionality to this tree. This is where things start to get a bit hacky. As I note right off the bat in the respective file for this, the functionality that makes it so features like Expert World Design block off Advanced and Simple World Design is a bit limited. I'll elaborate on that shortly.

First, I registered the category. Using the internal category title, as set up in the initialization file, a Data I/O, and a string, I got it down. I then gave the category its description, set the font size for the description, and the spacing between each line (in this case, 5). I gave the category its icon, and then proceeded to the next step.

Next were the taskTypes. First, I made the two that the player can choose from. I set everything, from the id to the workAmount, up, and then dealt with the optionCategory. optionCategory is the exact thing I was referencing earlier. If you're attempting to do what I've done, you can't really create a new one specific to your category. Or at least, not that I know of. As I said, this is all hardly intuitive stuff. In my case, I went with Gameplay, since that fit the closest description to what I was working with. I finished up the rest of the work, gave both a knowledge boost, and then added additional taskTypes that the game forces the game to use whenever one of the two optional ones are chosen. For those, I repeated the same process. There is a bit of jank here, in that I don't know how to tell the game to prioritize one sub-task over the other. What this, inevitably, results in is that the developers will do the finishing touches on an area before they block it out. Whoops!

Something worth noting here is that you have to be VERY careful when adding quality points through taskTypes. If you add too much, the game will go over a set cap and crash as soon as your developers are done with a project. This, unfortunately, has the side-effect of making a lot of taskTypes you'll add feel superfluous. Given the nature of the game, I'm not certain if that's to be celebrated, but if it's an illusion that works on you, fair enough.

And that about wraps it up.

If you're interested at all in the code I used for the second part of this, I unfortunately cannot reasonably put that into an image here. But if you're good with pastebin, so am I.[pastebin.com]
In conclusion...
I still don't recommend wasting your time with this ♥♥♥♥, but it's cool.

PEACE OUT.
9 Comments
hai  [author] 12 Jun @ 2:54pm 
OHHHHH, I'M STUPID

ahahaha, yes it is :)
bingKilling 12 Jun @ 8:46am 
Modding 101: Initialization, or How I Learned to Stop Worrying and Love main.lua

-> This is a Dr. Strangelove reference, right?
hai  [author] 11 Jun @ 7:57pm 
I'm not exactly sure what you mean by that, but I'm sure it's in good humor

Thanks for stopping by
bingKilling 11 Jun @ 5:49am 
Wow, I've heard of a zip bomb, but not a lua bomb
hai  [author] 15 Jan @ 5:56pm 
I honestly have no idea.

If I had to guess, maaaaaaaaaaaaaybe? I mention in this guide somewhere that what these mods essentially do is overwrite parts of the code. Unfortunately, I cannot tell you what the limitations on that are. I haven't tested them 🤷‍♀️

I'm no expert on this stuff and only really made this guide because there wasn't already one written.
KickedPrism1 15 Jan @ 12:43pm 
I'm new to modding in general, (Probably will start with a different game after reading this.) But would it be possible to fix the mod updating issues with a mod? Or is that an issue with steam?
WarCriminal 18 Nov, 2024 @ 10:19am 
thanks anyway
hai  [author] 17 Nov, 2024 @ 7:10pm 
"I'll find out"

(I don't, sorry).
WarCriminal 17 Nov, 2024 @ 12:34pm 
i know im coming very late but is it possible for you tu make a mod in order to fix the bug in engine features