Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add batch replay functionality #230

Open
malleoz opened this issue Jan 2, 2025 · 1 comment
Open

Add batch replay functionality #230

malleoz opened this issue Jan 2, 2025 · 1 comment
Labels
engine Code involving engine (C++) improvement Improvement to existing code P1 Priority: High

Comments

@malleoz
Copy link
Contributor

malleoz commented Jan 2, 2025

In KReplaySystem::parseOptions, I propose that we either let the user pass in -ghost followed by a variable number of arguments each being a filepath, or pass in -batch with a directory path. Then we can modify the class as follows:

  • Create a new struct as follows:
struct GhostMetadata {
    const char *m_fileName;
    const u8 *m_data;
    size_t m_size;
};
  • Instead of m_currentXXX, implement a std::queue<GhostMetadata> m_ghosts such that the current ghost is always the ghost at the front of the queue
  • When passing in multiple ghosts or a directory, they are added to this queue
  • Need a lot of changes so that we don't quit out when first ghost is done. i.e. KReplaySystem::run() will need to be re-worked.
  • When a simulation is complete, pop the ghost from the queue, call changeScene or whatever else we need, and start simulating the new ghost.
@malleoz
Copy link
Contributor Author

malleoz commented Jan 2, 2025

On second thought, @vabold it might make more sense to have a new batch class

class KBatchReplaySystem final : public KReplaySystem

This way, the batch class can observe the return of KReplaySystem::run and then re-init the replay system to a new ghost. We could put the std::queue in KBatchReplaySystem, and when we pop from the queue, we put that ghost as the KReplaySystem's current ghost. I also like this approach because we can redefine parseOptions.

@vabold vabold added engine Code involving engine (C++) improvement Improvement to existing code P1 Priority: High labels Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
engine Code involving engine (C++) improvement Improvement to existing code P1 Priority: High
Projects
None yet
Development

No branches or pull requests

2 participants