Rover: Cheryl Engine 4 Port
An observable pathfinding application with explicit search frames, bounded simulation steps, a map editor, and compatibility with the original packed maps.
- Version
- Cheryl Engine 4 port
- Status
- Completed
- Built with
- C++, Cheryl Engine 4
- My work
- C++ application, search model, and map editor

Project overview
This version brings Rover’s maps and pathfinding demonstration to Cheryl Engine 4. It keeps the original packed map files while rebuilding the application around a search that can be paused, inspected, and advanced one operation at a time. A map editor makes it possible to change the terrain and try the search again.
Making progress explicit
The original Rover split recursive traversal into segments. The port keeps traversal frames in an explicit stack. Each frame contains a tile position, an ordered set of directions, and the index of the next direction to try.
Visiting a tile adds a frame. Exhausting its directions removes the frame and returns to the previous position. Reaching the destination turns the stack into the resulting route; exhausting the stack marks the goal as unreachable. The search still prioritizes directions using the horizontal and vertical distances to the goal. It remains depth-first search, with a route that depends on that ordering.
The application gives the model a bounded number of operations per simulation tick. Search state survives between those calls, so the application can keep drawing and responding to input. Space pauses, N advances one operation, R restarts, and +/− changes the search rate. The operation budget controls how much search work happens in a tick; it is not a frame-time guarantee.
Keeping the files, changing the working map
The three original maps remain usable. Their file format groups sixteen two-bit tiles into each 32-bit region. Loading expands those regions into a byte-per-tile array; saving packs the values back into the original layout.
That separates file compatibility from the representation used by search and editing. Tile lookup, painting, and clearing visited ground operate on the array, while the loader and writer handle bit offsets. Input checks reject missing regions, out-of-range values, and unexpected trailing data.
The editor paints rock, holes, or dirt with either a single-tile brush or a larger spray brush. Its viewport scrolls across the map, clips painting at the boundaries, and converts pointer positions into map coordinates. Edited maps can be saved for another run.
Separating the model from the display
Cheryl supplies startup, action contexts, simulation hooks, retained render frames, and the TGUI integration. Rover’s search, map, editor, and viewport remain separate model components. The application connects them to input and submits the tiles, rover, and counters for display.
The model suite compares reachability with an independent breadth-first search on the original maps and smaller fixtures. It checks route endpoints and adjacent steps, operation budgets, unreachable goals, restart and cancellation, packed-file round trips, and editor boundaries. The port is complete.


