How does a game detect outside file alteration and connect it to in game events?

91 views

I’m talking about those games, where you manipulate things outside the game to achieve objectives within a game. I hope I worded this correctly?

For example, moving a file labelled “pickaxe” to a certain folder to open a door in the game, deleting a file corresponding to a character to “kill” them in the game, or having a certain file in your folder influencing the story and ending you get. How does the game itself detect this kind of alteration?

In: 0

2 Answers

Anonymous 0 Comments

While some simple programs can function with just a single executable. For most programs, and especially games, the executable is sort of a launcher loads and coordinates many different components of the game. Programs having the ability to do this is important. Think about your 50GB games, how can you load it all if you only have 16 GB of ram? So, programs need some way to load and unload things as they needed to fit into available RAM.

Normally, if a game wants to load a file that it expect to find, but couldn’t find it, it will just crash without even showing an error. It crashes this way precisely because not finding the file is unexpected, so the dev didn’t program in a way to keep the game running or to tell the user what’s going on if the file is not found.

However, you can write a “fail-safe” of sorts that tell the user what’s happening when the file is not found. For example, when you see error codes when bad things happen to a program, it’s developer expecting some bad thing to happen. They might not know exactly what it is, but they can sprinkle in checks at various steps of the programs logic to tell at which step something bad happened. The error code is a way to label that step.

Knowing that, you can use the same method to do creative things. You can tell a user to delete a file. And when the file fails to load when requested, instead of showing an error code like some other program might do, you can just have it run some other code and continue the game down a different path.

You are viewing 1 out of 2 answers, click here to view all answers.