gta-chaos-mod / ChaosModV

Chaos Mod for Grand Theft Auto V
https://gta5-mods.com/scripts/chaos-mod-v-beta
GNU General Public License v3.0
251 stars 90 forks source link

Effect: Everything goes back in time #240

Open OHSHIET opened 3 years ago

OHSHIET commented 3 years ago

Since probably it's impossible to do just from the start, I suggest the following: while the effect is active, the mod will be writing positions of every ped, vehicle, object and entity that moves. When the effect ends, the written positions will be applied to the entities in reverse order. And that ends when all the positions end. Is it possible? Or will it just simply overload the game?

kolyaventuri commented 3 years ago

There's various concerns I have, but the memory / overloading the game issue can be mitigated by setting an upper limit of entities being recorded... One gotcha would be despawned entities either from natural despawn, or entering missions... Do they get-respawned? Or do they just get ignored, since no object will exist to transform.

The other would be entering missions during a record. Not sure if that would break, or if it would just attempt to move everyone within the confines of the mission. Would probably fail the mission in many cases, but it might work.

Nonetheless, definitely a neat idea to try out!

TheRealAyCe commented 3 years ago

I think it should be fine. Sounds like Lag without the lag effect. :) Maybe not store a position every frame, but only 10 times a second or something like that.

OHSHIET commented 3 years ago

Well, if you make it like Lag, I guess you will be just teleporting every entity to the certain coordinates. What I am thinking is actually remembering and repeating all the animations, not just simply teleporting, if it's possible. So everything'd be smooth.

TheRealAyCe commented 3 years ago

Yes, that's what I meant with 10 times a second.

Number_of_entities (200?) effect_time_seconds (30?) records_per_second (10?) * record_size_bytes (20?) = 1,1 GB.... maybe it IS a little too much? :D

sodiboo commented 3 years ago

if it records at a lower framerate than the game (i.e. 10 times a second), when rewinding it could have a "Rewinding" icon and a distortion effect like rewinding on a VCR tape, and play it at 60fps, so 6x speed, meaning it would also rewind in just 5 seconds - it would maybe be easier on the memory if you record only peds and vehicles, and since it'd take control of the player's vision while rewinding, only recording objects immediately visible, teleporting peds to the next point they were seen as soon as they go out of sight when rewinding - basically it's like Virtual Reality, except the distortion effect is applied when rewinding, and you actually rewind time and don't just get teleported immediately