Skip to content

Automated frame by frame comparison of Player with RPG_RT #1474

Open
@mateofio

Description

@mateofio

The save data between RPG_RT and Player is supposed to be the same. We could construct an automated system to run both Player and RPG_RT in parallel. Each instance would send an LSD serialized full copy of its save data to a verifier every frame.

The verifier would compare the 2 save datas to ensure they are an exact match.

If we had this capability, we could quickly resolve the subtle timing bugs and get a nearly perfect emultion of RPG_RT behavior. The kind of bugs such a system could find may be nearly impossible to find by humans looking carefully.

I'm not sure if this is even possible. It sounds like a big project.

This setup would have 3 components all running at the same time. Player, RPG_RT, and a Verifier.

Some of the steps would include:

  • Player for each frame
    • Hook the end of each frame
    • Serialize the save data using liblcf
    • Pause.
  • RPG_RT for each frame
    • Inject some code at the end of the frame to hook.
    • Make RPG_RT save its save data
      • Writing to memory/socket/ipc is better than actually writing to disk.
  • Verifier for each frame
    • Wait for save data from RPG_RT and Player
    • Bitwise compare the serialized streams.
      • Optionally, we can disable comparison for chunks we know are different and we don't want to fix.
    • If the save data matches:
      • Signal both Player and RPG_RT that they may continue to the next frame
    • Else
      • Pause everything and dump debug info. Optionally allow the user to advance to the next frame.

The Verifier could be built into Player. Features such as pausing on specific frames and advancing manually frame by frame are good general features to have.

The next step would be to script a playback of a game in both engines, and then use this framework to ensure they do everything identically.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions