Screwing Things Together?
Published May 5th
Author Josh Gibson
For the past three to four months, I have been working with my capstone team on Screwed, a puzzle-based game where the player controls a sentient screw that can attach itself to objects in the environment. Once attached, the player can manipulate and move these objects to solve puzzles. While the core concept appears simple, implementing this mechanic required addressing a number of subtle technical challenges and edge cases.
The first, and arguably most critical, system was the script that allows the player to control objects. This was initially straightforward: applying torque to the object based on player input. After standardizing object mass and tuning the applied force, we achieved a control system that felt responsive and consistent.
One of the earliest design questions we faced was how to handle the object’s center of mass. Initially, we considered shifting the center of mass to the screw’s point of attachment. This approach introduced a layer of strategy, as players would need to think carefully about where they attach to objects. However, in practice, this caused unstable and unintuitive movement. For example, when attached to a cube, the object would “bounce” as the opposite face repeatedly collided with the ground during rotation, disrupting momentum.
Due to these issues, we reverted the center of mass to the object’s geometric center. While this reduced the strategic depth slightly, it significantly improved movement stability and player control, which ultimately proved more important for gameplay feel.
Although object control was implemented early, defining how the screw interacts with these objects became a much more complex challenge. We designed multiple interaction methods: the player can fling themselves into objects, use an aiming system to attach at a distance, or directly take control of an object they are standing on. Managing these interactions required a robust state machine, which became essential for handling transitions between movement, attachment, and control states.
During early implementation, one major issue emerged: the system did not properly account for environmental constraints. This allowed players to exploit the mechanic by attaching to an object, rotating toward the floor, and unscrewing in a way that pushed them out of bounds.
This issue required additional validation checks within the state machine and interaction logic. We implemented constraints to ensure that detaching from objects respects collision boundaries and prevents invalid positioning. This not only fixed the out-of-bounds exploit but also improved overall system reliability.
Read More…