Replay Mod (Fabric & Forge)

Replay Mod (Fabric & Forge)

1M Downloads

Temporary file grows up when there is no recording & DirectoryNotEmptyException

i0xHeX opened this issue ยท 3 comments

commented

Version: 2.3.0 (MC Fabric 1.15.2)

Settings:

  • Automatic Recording OFF
  • Record Server ON

Steps:

  1. Join the server, load new chunks, teleport through portals etc.
  2. Press Start Recording, wait few seconds
  3. Press Stop Recording
  4. Leave the server

Expected:

  • During step 1 temp file "recording.tmcpr" will not grow up so high (at least chunk data from chunks I left should be purged)
  • After step 4 file should be saved

Actual:

  • During step 1 temp file growed up insanely every time I load new chunks. I even went from one location and back few times, and each time file size was bigger and bigger.
  • After step 4 during saving replay file I got error:
    https://pastebin.com/5caPDxuR

That's the folder with files created during step 1, when the size was ~100 MB, after more chunk loads it became over 260 MB and here I did steps 2-4.
2020_05_08_19_44_07.mcpr.tmp.zip

P.S. I don't know why this didn't happened when I reproduced issue with no chunks rendering. The prev files (raw / mcpr / cache) were already from prev successful record. During steps above only new tmp folder created, and became empty after exception thrown.

commented

For the error on save, I've re-opened #144 since it's apparently not fixed (didn't actually mean to close it, GitHub just picked up on my wording). Please make sure it's not some sort of anti-virus or other third-party application preventing the RM from deleting that file. I myself have never run into it, though that might just be because it's a Windows-only thing.

As for the file growing before you hit the "Start" button: That's expected. I've explained elsewhere (not sure if it was to you, I don't think it was), that those buttons don't actually affect the recording in any significant way when you press them. Due to how the whole replay-thing works, the mod needs to record everything all the time.
It's only after the recording that the recording gets condensed.
Now, we could run the condensing code all the time in the background but that then has at least two disadvantages:

  • the condenser keeps most of the state in memory, so you're looking at MC taking, say 30% more memory all the time, just to keep the condenser around, and that's potentially continuously increasing since there's some stuff the condenser cannot just condense. Atm it's only loaded once you exit the world, so memory should be less of an issue since all the vanilla stuff is already unloaded.
  • debugging any bugs in that code (and there's a good chance that there are many, it's not a trivial thing) becomes quite a lot harder. Atm if one notices an issue, they can just send in the raw recording, which also already includes markers for how stuff should be condensed (that's what the menu buttons do, they just mark the time they were pressed), and anyone trying to debug the issue can just re-run the condenser with two clicks however often they need to.

IMHO either one by itself is already too significant to justify changing the way it works. Therefore I'll be closing this issue.

commented

So that's totally unusable to the things like playing hour on a server and then record something you interested in. The same when you play mini games or something and record cheaters when needed for example. Recording hours of everything just to show like 10 seconds is not logical thing and leaves a huge potential of where mod can be used.

As an example. I joined the server, played around an half on a hour, flying and looking for a good places I can start my building. By the time the temp file became around 1 GB. Then I recorded few seconds (both start & stop button) and left the server. It took around 3 minutes to save, then I tried to look on replay and it started skipping everything from the start. That's took for a few seconds and minecraft just freezed:
image

Let's assume the size taken by the file (1 GB) in 30 min is acceptable.
But time it takes to save (compress all 1 GB huh) is not acceptable for good usage.
Also skipping a huge amount of packets each time you want to go to start recording position?

It's OK and understandable if you will not do anything with that, as it's not paid project or something and no motivation to do that. Just let me know and I will not bother with such kind of issues further.

commented

Recording hours of everything just to show like 10 seconds is not logical thing and leaves a huge potential of where mod can be used.

That's not a way in which the mod can be used. Rather, that's completely impossible with how the whole thing works. You might as well make a different mod for that cause the ReplayMod works in fundamentally incompatible ways and can not do such a thing.

But time it takes to save (compress all 1 GB huh) is not acceptable for good usage.

Then don't use the Start/Stop/Pause/Resume feature (instead you can place markers by pressing M to mark stuff in the replay you want to jump to later). It requires extra processing work to be done and there's no way around it. At least I see no way and no one has shown me one so far.

The same when you play mini games or something and record cheaters when needed for example.

Wouldn't just recording all the time (and using markers) be the simpler option here? Otherwise you'll not have a recording of them until you realize they're cheating, which might already be too late.
Recording all the time is how the RM was originally supposed to be used anyway (and why auto-recording is still on by default), the Start/Stop/Pause/Resume feature is quite a recent thing.

Also skipping a huge amount of packets each time you want to go to start recording position?

Yes, the condensing code is by no means complete, there's certain things it cannot condense and there's certain things it just doesn't yet condense because there's a ton of stuff that could be condensed and diminishing returns required me to stop at some point.

You might enjoy Quick Mode (there's a button to activate it in the arrow in the bottom left). It takes the opposite approach of the whole replay thing:
Instead of tracking everything as it happens, it just tracks a few select things manually. That allows it to basically jump in time any distance and any direction near instantly, at the cost of well, not everything being tracked.