Rolling Journey
A rolling-ball game built with Unity3D, currently featuring 14 levels, along with systems for saving, custom key bindings, multiplayer (based on Photon PUN), replays, and more.
Independent Project
Links
Rolling Journey (abbreviated as RJ) is a Low Poly physics rolling-ball game developed with the Unity engine. The core logic of the game is very simple: the player only needs to roll a ball from the start point to the end point. However, the ball's realistic physical properties and the logical design of the levels bring considerable operational and intellectual difficulty to the game itself, as well as the fun typical of this genre.
The main content of the project was developed by me personally. Testing and modifications to Level 8 were done with the participation of Xie Binyou; Shao Yichen and Lu Mingxuan participated in the design/modification of Level 5 and Level 13, respectively. The project uses Unity 2020.3.48f1c1, the current version is 1.5.7, and it targets Windows and Android.
Game Highlights
Level Physics Logic
Starting from Level 5, levels in RJ gradually introduce "logical mechanisms." To traverse the main path, the player may need to first activate mechanisms on side paths. At the same time, these mechanisms may be interconnected. Take Level 6 as an example: there are two mechanisms in the first section, and the correct solution is to operate the second one first and then return to the first; if the player intuitively touches the nearby first mechanism first, the second mechanism can no longer be returned to an operable state, and the route becomes locked. This "order is the solution" design appears repeatedly in subsequent levels.
In terms of level design, the game also uses a progressive introduction of game mechanics. For example, Level 4 first teaches that boxes can block lasers; Level 7 "Laser Puzzle Array" overlays multiple light paths, and where the box is placed and when it is pushed determine which path is temporarily safe; Level 8 introduces gravity-reversal zones; Level 9's three-dimensional maze folds planar paths into 3D; Level 10 connects levers, lasers, and other components into the same path; and Level 14 "Where Is the Path" is the ultimate practical test of highly complex coupling among various mechanisms. These levels themselves do not rely on any written language to describe things to the player: the ball is a rigid body with mass and inertia, and it can be pushed away by accelerator pads, lifted by fans, pulled in another direction by gravity zones, and held up by water buoyancy; platforms carry the ball as they move, lasers are blocked by boxes, glass shatters progressively under impact or irradiation, and so on. Players cannot rely on mastering just one operational trick; every time they encounter a new combination of mechanisms, they must analyze it together with scene hints and information. Therefore, RJ's difficulty lies in the fact that it requires both precision in operation and a certain level of spatial causal reasoning ability.
Multiplayer
RJ implements multiplayer mode using Photon PUN. However, due to the limitations of the free version of the Photon cloud service, it supports at most 20 players online at the same time. For an experimental and entertainment-oriented personal project, this is already sufficient.
Multiplayer mode is divided into Classic Mode and Creative Mode. The difference between the two is that in Classic Mode, each player's level state is completely independent, and balls do not collide with one another, so the gameplay consists only of seeing who is faster; in Creative Mode, all players can interact with one another, all props in the scene can be synchronized with one another, and players can cooperate to explore the scene.
In Classic Mode, there is no player limit in room design, and the host can set the maximum number of players allowed in the room. In Creative Mode, limited by spawn point settings (different players cannot use the same spawn point), at most 4 players are allowed to enter at the same time (if the room has more than 4 players, this mode cannot be selected).
Room and lobby management supports host level selection, start/end, kicking players, transferring host status, text chat, Photon Voice voice chat (with per-player volume adjustment), latency display, spectating other players, and a leaderboard ranked by completion time.
Other Features
RJ also has some other features that make the game more complete: settings, multilingual support (Simplified Chinese, Traditional Chinese, English), custom key bindings (PC key binding/mobile custom button layout), save export/import, shop, skins, level play history, and replay.
Replays are automatically recorded after each round starts. They record the state of the ball, camera, checkpoints, diamonds, and timeline at fixed intervals; after the round ends, you can drag the timeline and watch the full round at 0.5–2x speed, or watch only the few seconds before your own death. For a game where "retry" is the norm, replays turn failure into content that can be reviewed.
Technical Details of the Project
Prefab-Based Level Loading
Each level in RJ does not have its own independent Scene. Instead, the level content and environment are split into two prefabs, which are then assembled by a LevelData ScriptableObject. LevelData stores the level index, icon, perfect time, checkpoint count, diamond count, multiplayer parameters, result camera, spawn point and orientation, as well as the sky timeline, sun orientation, fog, lens flare, ambient sound, and BGM. During loading, LevelLoadManager instantiates the level prefab and environment prefab, and then injects these rendering and audio parameters into the scene.
The direct benefit of this approach is convenient reuse and "chapter support": the first 10 levels (Chapter 1) share the lake, mountains, and water surface assets of Environment 1, while the last 4 levels (Chapter 2) share the sky islands of Environment 2.
Physics Feel Adjustment
The ball has a Rigidbody attached, and player input generates force in the X/Z directions. However, to prevent users from holding down a direction key and making the ball accelerate indefinitely, while not using forced drag to limit the ball's maximum speed, the force from user input is multiplied by a decay curve according to the ball's velocity component in that direction; the closer the speed is to the maximum limit, the smaller the acceleration.
The scene also contains several types of mechanisms:
- Jump pad: the ball bounces upward upon contact;
- Rising column: after the ball enters, it moves upward at a constant speed;
- Fan: after the ball enters the influence area, force is applied to it; the closer to the fan, the stronger the force;
- Glass: when the ball or other objects are on top of it, it gradually cracks and completely shatters after a certain time;
- Power system: switches are provided, and after the ball presses a switch, certain mechanisms can operate;
- Laser: the ball dies upon contact, but it can be blocked by boxes;
- ...
Multiplayer System
Multiplayer is implemented based on Photon PUN 2 and Photon Voice. The host acts as the MasterClient and is responsible for level selection, starting, ending, kicking players, and transferring host status.
When starting the game, the MasterClient first waits for everyone's Loaded status to be ready, and then player balls are generated using PhotonNetwork.Instantiate; other players' balls are semi-transparent and their name tags are displayed only within view, while one's own ball has full physics and camera. The key difference between the two modes lies in enableBallInteractInMP: in Classic Mode, levels are instantiated locally on each client, props are independent of one another, and balls do not collide; in Creative Mode, the MasterClient uses InstantiateRoomObject to generate a shared level, balls can collide with one another, and prop states and ownership are synchronized. When calculating rankings, RoomSynchronizedProperties is used to synchronize each person's PlayerResult (nickname, time, ActorNumber) in JSON, sorted by local timing.
Saving and Replay
SavingManager is a persistent singleton. It serializes GameSaving into JSON, then writes it to persistentDataPath/player.dat with DES encryption. PrefOutputSystem can also export .rjs to "My Documents/RollingJourney/SavingExport", or import from a file to overwrite.
Disk writes occur only at nodes such as level completion/death settlement, not every frame; the history records save the replay file name, checkpoint progress, diamonds, revival count, time, and whether Developer Mode was used.
The replay system starts recording automatically after level loading is complete. All active objects in the scene add their own state to the write queue at fixed intervals, by default writing one frame every 0.03 seconds (about 33 Hz). Each frame is fixed at 16 bytes: command byte, subcommand, recorderId, timestamp/three floats. The file header is 256 bytes and writes the version, level index, play time, and game version; the suffix is .rjr, stored in persistentDataPath/Replays/. Recording writes on a separate thread + queue, and the main thread only enqueues, avoiding frame drops caused by I/O. The replayer reads the entire file into memory; jumping forward quickly replays events from the beginning to ensure event completeness, while jumping backward only fills in the current segment, with Lerp interpolation between frames.







