Gravity Files Remake Code [2021]

Unlocking the Mystery: The Ultimate Guide to Gravity Files Remake Code

By: DevLog Insider

In the shadowy corners of the internet, where creepypasta meets Lua scripting, lies one of the most intriguing cult classics in the indie horror RPG scene: Gravity Files. Inspired by Alex Hirsch’s Gravity Falls, this fangame took the unsettling atmosphere of Yume Nikki and blended it with the show's cryptic lore. But as the original game aged, compatibility issues arose.

Enter the "Gravity Files Remake Code" —a grassroots movement of developers decompiling, remastering, and rebuilding the game from scratch.

Whether you are a modder looking for the source code, a fan trying to port the game to modern engines, or just curious about the reverse-engineering process, this article provides a deep dive into the code, the tools, and the secrets hidden in the files.

Extras for a Faithful Remake

1. The Core Loop: From 2D Raycasts to 3D Vectors

The original game relied on a simple axis-swapping mechanic. When the player touched a "gravity panel," the world’s down vector changed. In legacy code, this was often a static enum (GravityDirection.Up, GravityDirection.Right).

The Remake Approach: Modern code abandons fixed axes for a quaternion-based system. Instead of teleporting the player to a new wall, the remake code applies continuous rotational physics to the entire world matrix. gravity files remake code

// Pseudocode for Modern Gravity Shift
void ShiftGravity(Vector3 newDown) 
    Quaternion targetRotation = Quaternion.FromToRotation(CurrentDown, newDown);
    foreach (Entity obj in DynamicWorld) 
        obj.Velocity = targetRotation * obj.Velocity;
        obj.GravityDirection = newDown;
Camera.Transform.rotation *= targetRotation;

This "relative rotation" method eliminates the "snapping" feel of the original, creating smooth, disorienting transitions that leverage Unreal Engine 5 or Unity's DOTS (Data-Oriented Technology Stack).

File Rotation

public void rotateFile(int x, int y) 
    // Rotate file at position (x, y)
    File file = grid[x][y];
    file.rotate();
    grid[x][y] = file;

Option 2: The "Quick & Engaging" (Best for Twitter/X or Threads)

Ever wonder why some platformers feel buttery smooth while others feel like sliding on ice? 🧊

It’s all in the physics code. 🧵

I just pushed a major update to the Gravity Files Remake source code. Here is the secret sauce:

🧪 The Gravity Matrix Most games use standard Physics.gravity. The remake uses a variable gravity vector that rotates with the player. Unlocking the Mystery: The Ultimate Guide to Gravity

📉 Damping & Buffering

💻 The Code Structure I moved away from Update() heavy checks and moved logic into ScriptableObjects for easy tuning. Changing gravity strength no longer requires a recompile—just tweak the data asset.

The code is open source and heavily commented. Perfect for anyone looking to learn 2D physics controllers.

Link in bio! 👇

#IndieDev #Gamedev #Unity #Programming


Critical Code: The "Hirsch Cipher" Handler

One element every remake must perfect is the cipher decoder. In the original, the code was spaghetti logic. In the remake, developers use this clean Python function to handle A1Z26, Atbash, and Caesar shifts.

def decode_gravity_message(text, cipher_type="caesar_3"):
    if cipher_type == "caesar_3":
        return ''.join(chr((ord(char) - 65 - 3) % 26 + 65) if char.isalpha() else char for char in text.upper())
    elif cipher_type == "atbash":
        return ''.join(chr(155 - ord(char)) if char.isalpha() else char for char in text.upper())
    # ... Additional ciphers found in the original dll

How to Use This "Gravity Files Remake Code"

  1. Copy the entire block of code above.
  2. Open Notepad (Windows) or TextEdit (Mac).
  3. Paste the code.
  4. Save the file as gravity_files_remake.html.
  5. Double-click the file to open it in your web browser (Chrome, Edge, Firefox).

No server needed. This is pure vanilla JavaScript.

Expanding the Remake

You now have the core. Here is how to take the "gravity files remake code" to a full game:

1. The Flip Function (Lines 77-99)

This is the heart of the "gravity files remake code." Note the line player.velY = -player.velY;. Without this, gravity flipping feels laggy and wrong. The original game had a snappy, momentum-preserving flip.