Fran Sánchez Rodrigo

Quantum Fields

You're trapped in the office you hate so much, with its ugly and sober walls, and you want to escape. Luckily, you find a prototype of the "Quantum Gun" from "Quantum Fields Inc.".

Project Details

  • Type: Game Jam
  • Site: 2023 Epic MegaJam
  • My role: Programmer
  • Team size: 5 Developers
  • Project date: 2023
  • Project length: 1 week
  • Engine: Unreal Engine 5.3
  • External links:

Overview

In Quantum Fields you have to find the exit from the office building to the freedom. For that, you have to use a special gun called the Quantum Gun, which allows you to bring the past to the present in an spheric area. Use this ability to access inaccessible areas or move objects to find yout way!

My role

I was in charge of programming past/present logic tiggered by the sphere, and the generation of the dynamic meshes.

Challenges

Past and present

To achieve the effect of bringing the past to the present, all actors inherit from an QuantumActor that makes them have the present or past status. All actors in the scene are duplicate children from QuantumActor, meaning that for an actor that represents a wall in the past there is another actor that represent a wall in the present.

The created components also inherited from a QuantumComponent component interface, allowing the same kind of manipulation and state change.

Sphere Logic and Dynamic Meshes

We tried implementing the changing of the states with a simple logic of disabling/enabling collisions and meshes depending on their state, and displaying that with a material effect, but it caused multiple problems with the collisions.

For example, if a door is only in the present and you use a sphere to see the past, we can achieve visually the cut effect with the material, but we dind't know how to treat the collisions when they were in between the past and future. Disabling the collisions of the door in the present broke some parts of the puzzle because the player could squeeze through the still visible door as it had no collisions.

With this in mind, we investigated the options Unreal offered, and found the UDynamicMesh class, that allows the modification of meshes in runtime by applying boolean modifiers. This was exactly what we were looking for as cutting the meshes would solve our problem with the collisions. But all that glitters is not gold. Generating meshes in runtime takes time, and it needed a more complex approach when spawning the spheres and how they interacted with the world.

Instead of being just actors generated by the projectil, the Spheres are managed by a DynamicSphereManager. This manager was in charge of spawning the spheres, spawing/getting DynamicMeshes from a pool, processing the boolean modifiers, etc.

This is how the DynamicSphereManager works when a new Sphere is requested:

  • The projectile requests a new Sphere, so the DynamicSphereManager starts spawning it.
  • The DynamicSphereManager spawns the actor representing the Sphere.
  • It generates the boolean modifier of the sphere (using the final size) and stores it.
  • Creates a TaskGraph Task ("sphereTask") to create a Dynamic Mesh that represents the Union of all Sphere boolean modifiers.
  • Then, asks the Sphere with which components collides. For each component that is a mesh:
    • Given mesh, it checks if it's completely inside or outside ALL spheres using the stored booleans.
    • If it is completely inside or outside, it creates one TaskGraph Task ("copyTask") that copies regular Static Mesh to a Dynamic Mesh component, using "sphereTask" as parent.
    • It creates another TaskGraph Task ("booleanTask") that applies the dynamic mesh generated in "sphereTask" to the mesh from "copyTask".
  • And finally, it creates a final TaskGraph Task ("notifyTask") that only serves as a notification when all other Tasks finished.

During all this processing and until the final "notifyTask" is executed, the new spawned Sphere is completely solid so you can't see or enter inside.

Each time a new sphere is generated, the same steps are repeated, recalculating all dynamic meshes with the boolean modifiers of the active spheres. Destroying a sphere has similar steps that regenerate the meshes with the remaining boolean modifiers.

Game Description

Quantum Fields Inc.

"Do you miss when you were just stardust?

Would you like to travel back in time without leaving your couch?

Are you tired of these sober walls of today's time?

Are you reading this with the voice of a telemarketing narrator?

Then you're in the right place!

Introducing the "Quantum Gun"! The new invention of "Quantum Fields Inc."!

With the "Quantum Gun" from "Quantum Fields Inc." you will have the power to bring the nostalgic past to your boring, antiquated future, in the palm of your hand!

For only $99,999,999 ($999,999,999)! Buy now and receive a second unit for free!"

*Turns off the TV and sends it back to the past through a Quantum Field*

The Game

You're trapped in the office you hate so much, with its ugly and sober walls, and you want to escape. Luckily, you find a prototype of the "Quantum Gun" from "Quantum Fields Inc.".

Use it to escape from the office to your freedom, going through closed doors that didn't exist in the past, and bringing to the present elements that will help you to get out. As your gun is a prototype, it can only hold 3 "Quantum Fields" open at a time. Before you can open another one, you must recover the oldest one.

If you take something from the past with you, it will disappear from the future if you close the "Quantum Field" from which you took it. Take that into account when trying to solve the puzzles!

Controls

  • WASD Keys: Move the character
  • Left Mouse Button: Fire the "Quantum Gun"
  • Right Mouse Button: Recover the oldest "Quantum Field"*
  • Hold the 'E' Key: Grab interactable objects

* Keep in mind that you only have 3 quantum fields and you'll need to recover one of them if you want to shoot another one!

Credits

Programming:

  • Fran Sánchez
  • Sergio Ferreras
  • Alberto Calderón
  • Juan José Gómez
  • Adrián Ferrando

Art

ArtSound/Music from We Love Indies:

  • WEAPONS SCIENCE FICTION Electric Blast 01
  • WEAPONS SCIENCE FICTION Electric Blast 02
  • WEAPONS SCIENCE FICTION Hissing Blast 01
  • WEAPONS SCIENCE FICTION Hissing Blast 02
  • WEAPONS SCIENCE FICTION Hissing Blast 03
  • WEAPONS SCI FI Synthetic Repercussion Fire 01
  • UI MENU Generic Button Click 01
  • UI MENU Generic Button Click 02