GTAStunting

GTA Series => GTA Modding => Topic started by: Dannye on December 18, 2022, 04:18:22 AM

Title: Replay Longer [VC]
Post by: Dannye on December 18, 2022, 04:18:22 AM
Replay Longer, By Dannye:
The purpose of this mod is to provide support for longer replay files, and thus allow for the reliable capture of stunts which may otherwise be unable to fit completely within one replay.rep file (eg. due to factors such as length, weather, pedestrians, traffic).

Supported Games:
(sorry, no San Andreas support at this time)

Details:

Compatibility:

Usage Notes:

Downloads: (source code included)

Acknowledgements:

Happy (longer) stunting!
Title: Re: Replay Longer [VC]
Post by: AllBeast on December 18, 2022, 04:35:47 AM
cool, nice work, now i can make super long combos

edit:
just checked, it is works with no problem, at least for me

edit2:
i just wondering, why only 8x time longer, from where this limit  come?
Title: Re: Replay Longer [VC]
Post by: Lex on December 18, 2022, 05:04:12 AM
this is like every GTA IV players only dream!  it's sad that game wasn't really pat by stunters  :happy:
Title: Re: Replay Longer [VC]
Post by: DeathCobra on December 18, 2022, 05:31:44 AM
Is there any risk with corrupting reps using this?
Title: Re: Replay Longer [VC]
Post by: khaimyk on December 18, 2022, 05:47:12 AM
All beast vs Jason :  :rolleyes: :cheernutz:
Title: Re: Replay Longer [VC]
Post by: VaNilla on December 18, 2022, 10:07:54 PM
Great job! I would love to see this in SA, I had a couple of stunts that required two replays in the past :euro:.

I have a feature request too, but I don't know if it's feasible. I usually save 5-10 replays whenever I land a VC/SA stunt, by saving one replay, alt tabbing to make a copy, and repeating the process until I have multiple replay backups - this helps sidestep the risk of corruption. Perhaps you could add a validation step to the replay write to ensure the data isn't corrupt, while also allowing the user to save multiple replay backups with a single press of F2? The steps would look like this; save replay, validate replay, wait something like 100ms (so every replay is slightly different to reduce the potential of corruption), repeat X number of times (X being customisable in an INI file). If possible, this would effectively nullify the risk of replay corruption in the future :jajaja:.
Title: Re: Replay Longer [VC]
Post by: Dannye on December 19, 2022, 02:23:57 AM
Is there any risk with corrupting reps using this?
Honestly I'd hesitate to say anything more definitive than 'hopefully not'. That's something nice about Freeplay - I can do as many crazy hacks as I want and I know since it is only meant to be used AFTER stunt/replay creation, the worst case scenario on something going wrong is a mild inconvenience. But indeed with the context of this mod being during-stunting, bugs are a big deal. I feel like I have a pretty good understanding of the parts of the game code that I am changing to hopefully know that I have made the correct changes (and I've spent a bunch of time testing it to try and find any issues and everything has seemed fine thus far), but there's that word again. I'd understand anyone not wanting to risk it, and that'd be another reason to consider an approach to using this mod where you only activate it when intending to work on a stunt that truly might need the extra space. That said, I have got the mod setup on each of my copies/mapmods of VC, so that way if there is a problem there's a good chance it's me that'll find it (or at least also get screwed by it).


i just wondering, why only 8x time longer, from where this limit  come?
It mostly comes from the desire to reduce the number of, and complexity of, the game hacks necessary to make the mod work (and thus reduce chance of error). [More detail: the x8 improvement comes from me changing a value that the game usually has set to 8 and instead making it 64. I pick 64 because it is a power of 2 and less than 127, and they are both important factors as otherwise I'd be needing to make many more changes to the game code/logic in addition to what is mainly just swapping numbers around, and that was not an enticing idea (also anything > 255 would require insane amounts of extra work)]


I usually save 5-10 replays whenever I land a VC/SA stunt, by saving one replay, alt tabbing to make a copy, and repeating the process until I have multiple replay backups - this helps sidestep the risk of corruption. Perhaps you could add a validation step to the replay write to ensure the data isn't corrupt, while also allowing the user to save multiple replay backups with a single press of F2?
Regarding corrupted replays in normal/unmodded versions of the games, that is not something I have much knowledge of - other than a vague recollection that there is a chance of it happening in SA (is it really an issue in VC too? or do you also do your multiple-rep approach there just out of habbit of needing it for SA?) - and I certainly don't know why it can happen (nor why multiple rep saves in a row can produce a working one if priors were bugged), so unfortunately I'm not sure if I'd be able to do something like what you've described, though I can understand the desire for it.
Title: Re: Replay Longer [VC]
Post by: VaNilla on December 19, 2022, 01:03:12 PM
Regarding corrupted replays in normal/unmodded versions of the games, that is not something I have much knowledge of - other than a vague recollection that there is a chance of it happening in SA (is it really an issue in VC too? or do you also do your multiple-rep approach there just out of habbit of needing it for SA?) - and I certainly don't know why it can happen (nor why multiple rep saves in a row can produce a working one if priors were bugged), so unfortunately I'm not sure if I'd be able to do something like what you've described, though I can understand the desire for it.

I think I've had it happen in VC too, but with extreme rarity. It happens rarely in SA too, but ever since I lost my original landing of the Memento finisher to corruption, I've been doing this just in case, and I think it's saved me a handful of times since. If I save 10 replays of my landing in SA, usually they're all working, but sometimes 1 replay out of 10 is corrupt, which just goes to show how much risk there is in SA. With the same strategy in VC, I've never seen corruption occur, so it is habitual, but nonetheless a worthy safety measure given how long it can take to land some stunts. The risk seems greater on HDD's too, where some Windows power profiles spin down HDD's after periods of inactivity - this isn't necessary with SSD's, so there's no risk of saving a replay while your HDD isn't spinning.
Title: Re: Replay Longer [VC]
Post by: Simon on December 20, 2022, 06:31:52 AM
I usually save 5-10 replays whenever I land a VC/SA stunt, by saving one replay, alt tabbing to make a copy, and repeating the process until I have multiple replay backups - this helps sidestep the risk of corruption.
I'm a bit curious about this one, have you ever done this and had one of the replays been corrupted but not the others?
From the source code of the game (at least in VC, not super knowledgable about SA) the saving functionality is just writing data directly from a buffer in memory. Any corruption is likely to have happened in this buffer rather than during the writing itself (although not impossible I suppose), so saving multiple of what would ultimately be the same corrupted buffer likely wouldn't fix anything, at least in my head.
Title: Re: Replay Longer [VC]
Post by: MV on December 20, 2022, 09:48:18 AM
To add to Simon's question..

If I save 10 replays of my landing in SA, usually they're all working, but sometimes 1 replay out of 10 is corrupt, which just goes to show how much risk there is in SA.
Is this corrupted one usually the first or last of the batch that you saved, or is it randomly in the middle?
Title: Re: Replay Longer [VC]
Post by: DeathCobra on December 20, 2022, 01:33:09 PM
I usually save 5-10 replays whenever I land a VC/SA stunt, by saving one replay, alt tabbing to make a copy, and repeating the process until I have multiple replay backups - this helps sidestep the risk of corruption.
I'm a bit curious about this one, have you ever done this and had one of the replays been corrupted but not the others?
From the source code of the game (at least in VC, not super knowledgable about SA) the saving functionality is just writing data directly from a buffer in memory. Any corruption is likely to have happened in this buffer rather than during the writing itself (although not impossible I suppose), so saving multiple of what would ultimately be the same corrupted buffer likely wouldn't fix anything, at least in my head.

I've had a couple of cases where corruption seemed to occur when F3ing quickly after F2. Or just fat fingering the keys. I figured it was probably something to do with the game attempting to access the file whilst it's still being written, but not too sure.

The problem for me with the saving multiple reps option is in VC I get crashes fairly regularly when alt-tabbing or maximizing the game again. Seems to be common no matter the executable I use. Having said that, it's no added risk I guess since unless you have the file state viewable on a second screen, you wouldn't know if the rep is corrupted or not until you tab out anyway. Which I've considered doing. But it's kinda a pain in the ass.

Maybe at some point we could have a tool that verifies rep integrity without erasing the replay buffer (i.e. via F3). Would let you resave via F2 if something went wrong.

Would also say my corruption fears stem mostly from my SA days where I lost a handful of reps to it. In VC it doesn't seem as frequent.
Title: Re: Replay Longer [VC]
Post by: VaNilla on December 20, 2022, 08:31:45 PM
Simon and Nerve yup, for instance when I landed my SA Magnetron naval base stunt, all 10 replays saved correctly except 1, and I think it was the 3rd or 4th replay - this was while waiting four seconds after saving each replay to make sure they finished writing from memory to disk, so nothing like pressing F3 too quickly as DC mentioned. My PC did have issues with memory corruption (it was why I started swapping my RAM/SSDs prior to disappearing), but I've had the same thing happen on a perfectly functional PC (hence the Memento finisher first landing loss :cheersad:).

I have a feeling that corruption might not just be down to literal corrupt data, but rather that the game fails to open replays that start in certain locations or animation states - this would explain why a replay saved just four seconds later than a corrupt replay can work when the previous does not. I've literally never seen replay corruption happen in IV/V, it seems like both validate that replays have saved correctly before finishing (good thing since both reset the replay buffer after saving to disk if I remember correctly :ninja:).

What DC said about alt tabbing rings true for me as well. I can alt tab as much as I want in SA within reason, but VC crashes much more often when alt tabbing, meaning that while in SA I can consistently save 10 replays, in VC I occasionally get about 5-6 replays saved before the next alt tab crashes the game :D.

This is why I think having a burst fire of multiple replay saves would be useful, you dont want to spend 20+ hours landing a stunt just to lose it to corruption when you could simply save multiple replays spaced out by some delta and completely solve the problem :euro:.
Title: Re: Replay Longer [VC]
Post by: .Dakar on December 21, 2022, 10:46:05 AM
I wonder if someday Dannye will be able to extend the death screen, for example for stunts using bigbang cheat.
Title: Re: Replay Longer [VC]
Post by: Reynard The Fox on December 31, 2022, 03:22:25 AM
Great work Dannye! This should not be very hard to port to SA as the replay system is nearly identical as most methods seem to be the same. One would just have to identify the mentions of the buffer in these methods. I'm not sure if this is needed in SA at all as replays can be quite long already.
SimplePortal 2.3.7 © 2008-2024, SimplePortal