getting filename of replay (to restart replay)

getting filename of replay (to restart replay)

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

getting filename of replay (to restart replay)

Post by knorke »

Is it possible to get the filename of the replay that is currently playing?

If yes it might be possible to make crude rewinding for replays.
Restart spring with commandline_args = replayfilename
Spring.Restart ( string commandline_args, string startscript )
and then /skip to wanted time.
The time could be passed via written it to textfile or maybe via startscript(?)
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: getting filename of replay (to restart replay)

Post by jK »

Code: Select all

#!/bin/sh
CMD1="./spring_mt --benchmark 10 --benchmarkstart 15"
CMD2="./spring --benchmark 10 --benchmarkstart 15"
SCRIPT="script_benchmark2.txt"
...
$CMD "$SCRIPT" &
CPID=$!
sleep 10s
DEMOFILE=`lsof -p $CPID -Fn | grep demos | cut -c2-`
...
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: getting filename of replay (to restart replay)

Post by knorke »

from this strange console text that i dont understand i see there are new parameters to start playback at time X?
https://github.com/spring/spring/commit ... 368e5c82b8

But that does not help with restarting spring with the replay or does it?
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: getting filename of replay (to restart replay)

Post by jK »

No, there is a benchmark mode and benchmarkstart defines the time when to start writing the datafile. So you want to skip the beginning very often, `fast-word` it with speed 15 and then benchmark minutes 15-20 with gamespeed 1.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: getting filename of replay (to restart replay)

Post by knorke »

hm ok, but i think that is not what i want.
There is this widget:
Image
http://zero-k.info/Forum/Thread/3257
and I wanted to add a some buttons like "rewind replay", "go back 1 minute", etc
User avatar
PepeAmpere
Posts: 591
Joined: 03 Jun 2010, 01:28

Re: getting filename of replay (to restart replay)

Post by PepeAmpere »

knorke wrote:hm ok, but i think that is not what i want.
There is this widget:
Image
http://zero-k.info/Forum/Thread/3257
and I wanted to add a some buttons like "rewind replay", "go back 1 minute", etc
With Nota::lobby TV player you dont need rewind ;)

Image

Now really, do you really think restarting the simulation only because you want to give player possibility to go back a bit in time is the cool way?
Last edited by PepeAmpere on 16 Nov 2012, 03:14, edited 1 time in total.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: getting filename of replay (to restart replay)

Post by smoth »

A lobby based solution is not the solution for everyone's needs.

*reworded for clarity*
User avatar
PepeAmpere
Posts: 591
Joined: 03 Jun 2010, 01:28

Re: getting filename of replay (to restart replay)

Post by PepeAmpere »

smoth wrote:Not everyone wants a lobby based solution.
No arguing about that. But if I understood how engine and replays works, do "rewind back" with current replayfiles and engine, especially by this way, seems to a bit unsmo(o)th solution :lol:
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: getting filename of replay (to restart replay)

Post by smoth »

to have to leave the game at all is bad IMO.

it may not be currently possible to rewind a replay. However, that doesn't mean knorke shouldn't try. Maybe an engine patch will be the result of his efforts. You never know. It is bad to stop alternative approaches because you have a specific one. Not all replays you want to rewind to watch dot wars. Sometimes it is super helpful in tracking hard to trigger bugs.
User avatar
PepeAmpere
Posts: 591
Joined: 03 Jun 2010, 01:28

Re: getting filename of replay (to restart replay)

Post by PepeAmpere »

smoth wrote:to have to leave the game at all is bad IMO.

it may not be currently possible to rewind a replay. However, that doesn't mean knorke shouldn't try. Maybe an engine patch will be the result of his efforts. You never know. It is bad to stop alternative approaches because you have a specific one. Not all replays you want to rewind to watch dot wars. Sometimes it is super helpful in tracking hard to trigger bugs.
I agree with you in all points. My suggestion was small trolling of course. I think making different type of replays (bigger, not so compact, but saving moves of things instead of orders... or saving some important values of simulation - for example - making every 2-5 minutes some point where all needed is saved and simulation can start from that point) can be solution - but it will need change in engine, too. I think only lua-widget way cannot do much to get result knorke described.
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: getting filename of replay (to restart replay)

Post by smoth »

Dunno, maybe he will find a way, knorke is damn smart.

You also have to consider the reverse of my statement. I am also saying, nota's replaytv feature is also valid. Just because I won't use it a lot in my game projects, doesn't indicate that I dislike the feature of nota lobby.

both should exist and be developed.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: getting filename of replay (to restart replay)

Post by knorke »

Yes, the main annoyance is ofc waiting for the fastforward to finish, and that will still be there.
But if you are watching the same replay multiple times eg to record movie, you get used to switchting to other stuff while it forwards.
But clicking around to close spring, start replay, type /skip... etc does get on the nerves. Can at least remove that part.

PepeAmpere, what you suggest is basically saving & loading, which is "impossible." (there were some threads)
Post Reply

Return to “Lua Scripts”