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

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

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

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

Post 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?
muckl
Posts: 151
Joined: 30 Aug 2010, 07:18

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

Post 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)
dansan
Server Owner & Developer
Posts: 1203
Joined: 29 May 2010, 23:40

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

Post 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?
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

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

Post 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!
User avatar
Silentwings
Posts: 3720
Joined: 25 Oct 2008, 00:23

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

Post by Silentwings »

+1, good idea
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

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

Post 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.
User avatar
bibim
Lobby Developer
Posts: 959
Joined: 06 Dec 2007, 11:12

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

Post 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.
Post Reply

Return to “Lua Scripts”