Lets Talk About Physics


I made a change to the physics simulation and a level build around a weird paradox emerging from moving portals. So I thought this might be a good moment to talk about some aspects of the physics-simulation of moving frames, to illustrate all the weirdness that has to be taken into account during implementation.

There are many scenarios that can result in unresolvable collisions. If, for example, an immovable wall is visible through a moving frame, than the immovable wall is effectively moving. This case can be seen in the picture on the left below:

The picture on the right shows another unresolvable situation, where the frames are placed, such that the cube overlaps with itself. To Resolve such situations I implemented a criteria that detects them and then despawns (destroys) the object. Above pictures are from a new level that introduces this "mechanic" and uses it for some puzzles. I thought about not exposing this mechanic so clearly to the player. However, there are several levels where I cannot prevent the player from forcing such situations, so it seemed important to communicate to the player what is happening if they do that. 

Another, non obvious question is how objects should collide with frames, if they are inside a frame and if they should collide with the incoming or outgoing frame-part. So far, objects inside of a frame could actually push those frames. However, this could lead to very awkward behavior (frames could fly around since they are constantly pushed by a "non-moving" object) and could also lead to glitchy physics. So I reworked part of the physics, such that objects cannot push frames if they are inside that frame. The level "Rinse and Repeat" is a good example where the physics work a lot more stable with that change.

There is also some ambiguity with moving and fixed platforms/cubes. Those are forced towards a fixed point in space. However, looking through a moving frame that "fixed point" actually moves. This implies that, when a fixed platform goes through a frame, the "moving fixed point" has to change its behavior at some point to become an actual non-moving fixed point. So far, this transition happened at one specific point in space. In other words, the transition from moving to not moving happened "instantaneously" in one frame. I generalized the implementation and the "movement" of the fixed point is now averaged based on incoming and outgoing frame and the distance to those frames. With this change the transition is "smeared" over several frames and thus a lot smoother.

In addition to the new level mentioned above there are four more new levels in this update.

This level is build around the fact that fixed objects can be moved by moving a frame.

There is already a level where a carryable frame has to be oriented by the player such that the gravity changes in a desired way. So it was a logical next step to make a level with two carryable, gravity-changing frames.

This level explores the idea that the translation of a frame can result in the rotation of an object if the two connected frames have different orientations.

The gimmick of this level is that it has two carryable (not gravity-changing) frames, that need to be positioned strategically to advance.

Since all the physics-changes took some time to implement the list of bug-fixes is rather short this time:

  • The slide-bar of the hint machine wasn't clipped correctly, resulting in wrong rendering in some cases. 
  • The animation, showing the connection between moving objects and buttons, wasn't visible or went to the wrong place in some cases. 
  • One level contains an explanation that one can click on a movable object to see the button it is activated by.
  • The hints, showing the connections between frames, can be triggered even through transparent fences the paint gun can not shoot through. 
  • Some minor tweaks to several levels to make them more playable.

Get Frame - Portals on Steroids

Buy Now$12.99 USD or more

Leave a comment

Log in with itch.io to leave a comment.