This tech tip examines the BallPaths specific to the Portal module.
The information here was verified against module driver version 1.0.3.2
The documentation for the Portal module API is substantially improved compared with that of previous modules. You can find it in %HOMEDRIVE%%HOMEPATH%\.multimorphic\P3\ModuleDrivers\Portal\1.0.3.2\UsageInstructions.md
To view the formatted version of this markdown file, open it in Visual Studio 2026. If the preview does not open automatically, click “Split Preview” or “Open Preview” to display it.
There is some interesting information on the Portal Extended wiki page.
This tech tip assumes the reader is familiar with the material referenced above and avoids repeating it unnecessarily.
For the list of BallPaths, see the module definition file in %HOMEDRIVE%%HOMEPATH%\.multimorphic\P3\ModuleDrivers\Portal\1.0.3.2\Portal.json
The Portal module uses some abbreviations in its API.
Name | Definition |
L2 | Level 2 (i.e. the module extension) |
LOFT | Mezzanine upper playfield |
PC | Personality Core (i.e. Reggie) |
LLZ | Lower Landing Zone |
ULZ | Upper Landing Zone |
TL | Top Left (i.e. the LOFT) |
VUK | Vertical Up Kicker |
The left ramp, faith plate, and center ramp can lift to expose a hole underneath each one. These mechs are controlled by dual-wound coils to lift and hold.
The right cube can move down to let the balls roll on top to exit the grating plate. The left cube can move backward to expose a hole. The right ramp can lift to expose some shots on the Portal Standard module. The kickback diverter lifts to let the ball enter the kickback, but only for a few moments after the ball climbs the right ramp or is launched with Vuk7ToKickback or Vuk7ToKickbackAndHold TroughLaunchers. These mech motors are controlled by a single color element of the SpecialFeatures0, SpecialFeatures1 or SpecialFeatures2 RGB LEDs.
The application must explicitly request to use the right ramp, otherwise it is disabled by default. This is surprising since it is not mentioned in UsageInstructions.md
The application needs to set the value of the GameAttribute "Right Ramp API Enabled" to true to enable the right ramp. This must be done very early to make sure the device is initialized correctly. The easiest way to do this is to customize the GameAttribute when it is created.
In <AppCode>SettingsMode, add this code to the CustomizeGameAttribute method:
protected override GameAttribute CustomizeGameAttribute(GameAttribute attr) { attr = base.CustomizeGameAttribute(attr); if (attr.item == "Right Ramp API Enabled") { attr.value.Set(true); } else if … return attr; } |
The first time the application runs, the GameAttribute is created and stored in the database. Thereafter, the value in the database takes precedence over whatever value the application assigns.
If you ran the application for the first time without this code, the value stored in the database is false and the right ramp will remain stubbornly disabled. To make matters worse, you cannot change this manually using the Service Menu, since the GameAttribute is read-only.
To repair the GameAttribute in the simulator, you can simply delete the application Data directory:
rmdir /s /q %HOMEDRIVE%%HOMEPATH%\.multimorphic\P3\Data\<AppCode>
where <AppCode> could be P3SA for example.
If you ran the application for the first time without this code on the P3 machine, it is much harder to remove the application Data directory. One solution is to use this code to overwrite the value with a new default value:
protected override GameAttribute CustomizeGameAttribute(GameAttribute attr) { attr = base.CustomizeGameAttribute(attr); if (attr.item == "Right Ramp API Enabled") { attr.defaultValue.Set(true); attr.compareOptions = GameAttributeCompareOptions.UpdateValueIfDefaultChanged; } else if … return attr; } |
The first execution of this code will repair the GameAttribute. Although it will continue to work correctly afterwards, it is cleaner to switch back to the implementation presented earlier.
The module driver defines some PlayfieldModuleSettings under "Service Menu/Settings/Mechs/…" which are shared by all applications. These settings control whether some mechs are available. The default is to allow access to the mech. The application should not modify these settings. These are mentioned here because they might explain why a mech is not working.
Note: The extra spaces in some GameAttribute names are not typos.
GameAttribute | Path | Default |
DisableKickback | …/Coils/Kickback | false |
GlobalLeft CubeEnabled | …/Motors | true |
GlobalRight CubeEnabled | …/Motors | true |
GlobalRight RampEnabled | …/Motors | true |
In addition, the module driver defines some per-application settings for the same purpose.
GameAttribute | Path | Default |
Left Cube Enabled | …/Motors | true |
Right Cube Enabled | …/Motors | true |
Right Ramp Enabled | …/Motors | true |
There is no per-application setting to enable the kickback.
Again, the application should probably not modify any of these settings.
The table below describes all BallPaths in Portal. The BallPath implementation is better executed and behaves more predictably than in earlier titles.
To save space, the BallPath name is implicit in the table.
When the EntranceName and ExitName differ, the BallPath name is <EntranceName>To<ExitName>.
When the EntranceName is the same as the ExitName, the BallPath name is <EntranceName>.
This is indicated by leaving the ExitName blank in the table.
A * in the first column indicates a BallPath that behaves unexpectedly. See the comments below.
EntranceName | ExitName | L2 Only | Comment | |
OuterLeft | OuterRight | Left to right outer loop | ||
OuterRight | OuterLeft | Right to left outer loop | ||
LeftRampLane | LaneDiverter | Up the left ramp to left inlane. Shot completes near the LOFT bottom, so for L2, the shot is made even if the player redirects the ball with the mid-playfield flipper. | ||
LeftRampHole | Under the left ramp to left ramp hole | |||
CenterLane | OuterRight | Center lane to right outer loop | ||
Throw | Faith plate throw, the shot is completed whether the throw is successful or not | |||
TrapDoorHole | Center lane to trap door hole under faith plate | |||
CenterRampLane | RightInlane | Up the center ramp to right inlane | ||
CenterRampHole | Under the center ramp to center ramp hole | |||
* | Kickback | Yes | Up the center ramp to kickback on L2. | |
* | KickbackAndHold | Yes | Up the center ramp to kickback hold on L2. | |
RightRamp | RightInlane | Yes | Up the right ramp to the right inlane | |
Kickback | Yes | Up the right ramp to the kickback on the module extension, ball will be kicked back | ||
KickbackAndHold | Yes | Up the right ramp to the kickback on the module extension, ball will be held in the kickback | ||
* | Nowhere | Yes | Establishing this BallPath raises the right ramp making the shot inaccessible | |
* | CaptiveBall | CaptiveBallHole | Captive ball hit and the free captive ball fell into the captive ball hole | |
* | CaptiveBall | Captive ball hit but the free captive ball returned to its original position behind the Newton ball | ||
* | Spinner | Yes | One spinner spin, as determined by the Spinner settings | |
LowerTarget1 | Yes | Standup target left of spinner lane | ||
SpinnerLaneTarget | Yes | Standup target right of spinner lane | ||
RightRampTarget1 | Yes | Standup target attached to the front left of the right ramp, not accessible when right ramp is up | ||
RightRampTarget2 | Yes | Standup target attached to the front right of the right ramp, not accessible when right ramp is up | ||
PCTarget1 | Left standup target below the Reggie Personality Core | |||
PCTarget2 | Right standup target below the Reggie Personality Core | |||
FaithPlateTarget | Standup target left of center lane | |||
DropLane | DropLaneHole | Ball falls in drop lane hole | ||
TopLeftDrainHole | Ball falls through the bottom of the LOFT | |||
* | TopLoopLeft | TopLoopRight | LOFT loop in either direction | |
TLTarget1 | Lower standup target in the LOFT | |||
TLTarget2 | Upper standup target in the LOFT | |||
* | TopLeft | TopLeftCubeTarget | Front of LOFT cube | |
* | TopLeftHole | Ball falls in the hole in front of the LOFT cube | ||
* | VUK1Entry | For module driver use only. | ||
* | VUK3Entry | For module driver use only. | ||
* | VUK7Entry | For module driver use only. | ||
* | Grating | Cube | Establish this BallPath to raise the right cube | |
* | OuterRight | Establish this BallPath to lower the right cube | ||
MoatJump | Pit | Successful moat jump landed in the pit | ||
LLZ | Successful moat jump landed in the lower landing zone | |||
ULZ | Successful moat jump landed in the upper landing zone | |||
* | MoatJumpExit | Ball entered the moat jump from the exit | ||
* | MoatPitHole | Ball fell in the pit hole when the moat jump was inactive |
The declared EntranceName for CaptiveBallTooSoft is CaptiveBall. This is conveyed in the table with the CaptiveBall strikethrough.
CaptiveBallToCaptiveBallHole and CaptiveBallTooSoft are only available when there is a free captive ball loaded behind the fixed Newton ball. Hitting the Newton ball without a free captive ball present does not trigger any switches and is invisible to the game. The module driver loads a free captive ball when the application is initialized. Afterwards, the application must explicitly load the free captive ball when needed.
CaptiveBallToCaptiveBallHole appears to be a dynamic BallPath that shares its Entrance with CaptiveBallTooSoft, but is instead a Target BallPath. The BallPath does not need to be established, even though it is not marked Static. This is because the free captive ball must be loaded before the shot becomes possible. It is not a Hole BallPath because the ball that strikes the Newton ball remains in play.
The design of the CaptiveBall BallPaths works, but It is worth considering whether module-agnostic games would have benefited more if the free captive ball were loaded by establishing one of the BallPaths.
In Heist, FR, and TPB, the spinner is just a regular switch target. In Portal, the Spinner is configured with these PlayfieldModuleSettings under "Service Menu/Settings/Mechs/Spinner" which control how spinner spins are recognized:
Settings | Type | Default | Min | Max | Incr | Description |
SpinnerSpinsPerSpin | int | 1 | 1 | 20 | 1 | Spinner switch hits required per spin, from 1 to 20 in 1 incr |
SpinnerMinSwitchTime | float | 0.01 | 0 | 3.0 | 0.01 | Min time between spins to be counted |
SpinnerMaxSwitchTime | float | 0.3 | 0 | 5.0 | 0.01 | Max time between spins to be counted |
The Spinner BallPath is tagged with "Spinner". This indicates to a module-agnostic game that the BallPath may complete multiple times for a single shot. The application might choose to implement a cooldown period to ignore the subsequent events if it wants to count the shot only once.
DropLaneToDropLaneHole could have been named DropLaneHole similar to TopLeftDrainHole. The DropLane entrance is not shared by any other BallPath and there is no diverter involved.
There is only one switch in the loop at the back of the LOFT. Since the module driver cannot determine the direction, the same TopLoopLeftToTopLoopRight BallPath is reported in either direction. This BallPath could have been named TopLoop and marked as a Target.
Establishing TopLeftToTopLeftCubeTarget moves the cube forward, covering the top left hole. The module driver moves the top left cube forward after calibration, making this BallPath the default when the application starts.
Notice TopLeftToTopLeftCubeTarget, RightRampTarget1 and RightRampTarget2 are rare Target BallPaths that are not Static, meaning they are not always accessible.
Establishing TopLeftToTopLeftHole moves the top left cube backward, exposing the top left hole.
The TLCubeHit switch that triggers TopLeftToTopLeftCubeTarget is not intuitive. First, the cube needs to rotate backward. Only then can the bottom of the cube be pushed a little further to activate the switch.
The cube target is enabled regardless of the established path. A ball entering the top left hole will likely complete TopLeftToTopLeftCubeTarget once (or twice!) before completing TopLeftToTopLeftHole.
These BallPaths are used by the module driver to handle failed launches. Portal does not have switches at the apex where the ball is guaranteed not to come back into the tube. Applications should ignore the VUK{N}Entry BallPaths.
Establishing the GratingToCube BallPath raises the right cube to enable locking the balls.
Establishing the GratingToOuterRight BallPath lowers the right cube, releasing the locked balls if present.
These BallPaths exist exclusively to control the cube position. The module driver will never post the corresponding Started and Completed events. When a ball enters or leaves the grating, the module driver posts the Evt_Grates_UpdatedBallCountResponse event instead.
The MoatJumpExit and MoatPitHole BallPaths have a typo in their StartedEvent. The event is named Evt_StartStarted_<EntranceName> instead of Evt_ShotStarted_<EntranceName>. The module driver posts the event with the typo, so the module definition file is technically correct.
Evt_StartStarted_MoatJumpExit
Evt_StartStarted_MoatPitHole
The player can never make the MoatJumpToPit, MoatJumpToLLZ and MoatJumpToULZ shots directly. This might confuse truly module-agnostic games. The application must ensure a ball is staged in the mech, then it can launch the ball by posting Evt_MoatJumpEject with the desired strength. The shot is completed only for a successful launch.
A weak launch dropping in front of the pit completes MoatJumpToLLZ even though it did not reach the platform with the painted red button.
A moat jump during multiball might confuse the module driver, causing it to report the wrong completed shot.
MoatPitHole is suppressed when an ejection is in progress. A moat jump launch dropping in the pit completes MoatJumpToPit. It neither starts nor completes MoatPitHole.
MoatJumpExit is suppressed when staging or ejection is in progress. This BallPath does not mean the ball exited the moat jump. On the contrary, it means a ball accidentally entered the moat jump through the exit. This is another shot the player cannot make intentionally.
A weak shot can enter the left or right outer loop and fall through the center lane.
Neither has a defined BallPath or generates a CompletedEvent—probably rightly so, since they are very hard to hit intentionally.
The toy has the turret on one side and the Reggie Personality Core on the other side. The toy can be rotated to expose the desired side by establishing the corresponding BallPath:
PostModeEventToModes("Evt_EstablishBallPath", "RotateToyToTurret");
PostModeEventToModes("Evt_EstablishBallPath", "RotateToyToPC");
The toy does not affect the ball trajectory. It would have been better to use dedicated events instead. Luckily, these artificial BallPaths are not defined in the module definition file. Module-agnostic games cannot confuse them with regular shots.
VUK7 is far to the right of the trough. Assuming 18 balls in the machine, with one ball loaded in the moat jump and another behind the captive ball, that leaves just enough balls to feed VUK7 when all the other balls are in the trough. VUK7 can very easily be starved during play. For example, when a ball has just drained, it will take some time for this same ball to position itself under VUK7. Whenever the app is using Vuk7ToInlane, Vuk7ToKickback or Vuk7ToKickbackAndHold, make sure to define backup TroughLaunchers or code the app to handle launch failures gracefully. For example, P3SampleApp in P3_SDK_V0.9 does not handle this properly, which can easily hang the game.