Page 1 of 1

Store data in replay to read it at start of replay playback?

Posted: 20 Feb 2014, 13:53
by knorke
Is this somehow* possible:
While the game is being played, somehow store data in the replay.
Then when the replay is played, somehow read all that data at the start of playback?

The idea is that the game could store information about events that happen in the game.
In the replay the viewer could then be informed about what will happen, before it has happend.

Spring already has stats graphs, now image you could see the endgame stats before the replay has ended.
You would be able to see the future because the future has already happend before, in the past when game was played. :shock:
How frohlocking it would be to fast-forward to the interessting points in time!
For example a wupget would tell the viewer "This Commander will explode in a few seconds, watch him."
Or "Nothing interessting will happen in the next 20 minutes."
Image

*(With external files it would already be possible but super inconvient if you download a replay and then have to download a second file and place in some folder etc.)

Maybe if the Lua-VFS could write&read files in the replay?

Re: Store data in replay to read it at start of replay playb

Posted: 20 Feb 2014, 18:14
by muckl
good idea
but to get those *something happened* data, there must be a good algorithm for some stuff what is not easy like an dead com

but a kills / death per 10sec counter for each team or algorithm what detects clouded mass destruction with coordinates would be cool too (imagine u seek to the bigger significant parts of that "battle goes on" in the timeline in a small ingame window and it seeks to that timestamp and to that average position (x,y) via camera repos of the biggest battle position blob)

Re: Store data in replay to read it at start of replay playb

Posted: 20 Feb 2014, 22:17
by dansan
I think that would be possible by adding a feature (maybe just a plugin) to spads. Spads already modifies the "script" at the end of the match. Spads would have to listen to certain messages from a gadget, and append them to the script.

The "script" is the first part in a spring demofile. It is always read before the demo can be replayed. But I'm not sure if the scripts data is available from Lua... what about environmental variables? I guess Lua in spring is very well isolated?

Re: Store data in replay to read it at start of replay playb

Posted: 20 Feb 2014, 22:25
by smoth
Better add it before riot patents it....


Seriously though this is a brilliant idea, some kinda table where we can store data in a replay would be amazing!

Re: Store data in replay to read it at start of replay playb

Posted: 20 Feb 2014, 22:49
by Silentwings
+1, good idea

Re: Store data in replay to read it at start of replay playb

Posted: 20 Feb 2014, 23:57
by zwzsg
dansan wrote:But I'm not sure if the scripts data is available from Lua...
Most of it is. In particular you can use mod/map options to store arbitrary data in a startscript then read them in the Lua of widgets and gadgets.

Re: Store data in replay to read it at start of replay playb

Posted: 21 Feb 2014, 11:29
by bibim
dansan wrote:Spads already modifies the "script" at the end of the match.
Hum no, SPADS doesn't do such thing?

Afaik the start script can only be used to launch Spring server, it can't be modified afterward because Spring server already loaded it in memory and will include this version in the demo file.