Reportal

From P2SR Wiki

Revision as of 06:51, 1 May 2022 by Mlugg (talk | contribs) (Add technical explanation of reportals)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Reportal

Overview

Example of a Reportal

Reportal is an exploit of mechanics that is intended to prevent the player from standing within one portal while placing the other one somewhere else. It allows you to gain 200 ups of speed when you pass through a portal.

Execution

The main idea behind reportalling is to shoot the portal you're entering right after you pass through it (so, for example, if you enter blue portal, you shoot blue portal once you're on orange portal's side). Depending on a type of a surface the entry portal was previously placed on, the execution of reportal slightly differs.

Note: Because of Peer Review patch, shooting floor surfaces doesn't give you speed boost.

Entry portal on a wall

Aim at the portalable wall you see through a portal you want to enter, and then pass through the portal. Once your view is on the other side, shoot the same color of portal you've just entered on aimed surface. If you did it correctly, you should get a speed boost. No speed boost means you did it too late. If you blocked yourself with a portal, it means you were too early.

Entry portal on a floor

Great floor reportal tutorial by JonnySnapzGaming

Example: Pit Flings old route

Stand close to a floor portal, face a portalable wall, and fall through the portal. Once your vision is about to enter the portal, place the same color of portal you are falling through on the portable surface in front of you. If done correctly, you will get noticeable speed boost. If you want to chain multiple floor reportals, remember to place the portal back on a floor.

Entry portal on a slanted surface

Example: Challenge Mode route of Laser Catapult

Look at the portal on slanted surface and then fly through it. Once your view is about to enter the portal, shoot the same color of portal you are falling through. If you did it correctly, you should get a speed boost.

All of these methods require extremely precise timing of fire that needs to be practiced.

Pre-patch

Before Peer Review DLC, it was possible to gain speed boost by shooting a floor surface, making floor reportals easy to execute - similar to what we do now with reportals from slanted surface.

Super Reportal

Super Reportal refers to any combination of glitches that allows you to gain a lot of speed really quickly from multiple reportals.

Save-Load Super Reportal

Single Segmented Super Reportals

Technical Explanation

Reportals are an intended mechanic, presumably meant to prevent players using portals to access areas they otherwise couldn't reach or getting stuck inside geometry.

When a portal is moved via CPortal_Base2D::NewLocation, provided the moved portal is not a floor portal (this check was added in the Peer Review DLC), it fires CPortal_Base2D::PunchAllPenetratingPlayers on its linked portal. This functions iterates over every player on the server and checks that they are intersecting the portal, and would be stuck in the wall if the portal were removed (this is just a check to confirm that they're actually in the portal hole). If this is the case, the player is "punched" out of the portal with 100 velocity in the direction of the portal normal. This seems wrong, as when we perform a reportal we normally get 200 velocity. It turns out the reason for this is a bug in the portal gun code left over from removing Portal 1's placement delay.

CWeaponPortalgun::FirePortal is the function responsible for firing a portal from the portal gun. It has quite a lot of logic in it, but there are two calls which are interesting to us: CProp_Portal::PlacePortal and CProp_Portal::DelayedPlacementThink. In Portal 1, the latter function was called with a delay as a think function. However, when portal gun fire delay was removed for Portal 2, Valve took this call and placed it directly within FirePortal - this makes sense, but since the code also calls PlacePortal, the portal is effectively placed twice. More specifically, both DelayedPlacementThink and PlacePortal run NewLocation, meaning the reportal effectively happens twice, back to back, giving 200 velocity rather than 100. This can be seen through other means of firing portals (e.g. the portal_place command) only giving the player 100ups of velocity. Amusingly, this means reportals, despite being an intended mechanic, are made much more useful by a bug in their implementation.