Page 1 of 1

getting filename of replay (to restart replay)

Posted: 16 Nov 2012, 01:36
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(?)

Re: getting filename of replay (to restart replay)

Posted: 16 Nov 2012, 01:54
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-`
...

Re: getting filename of replay (to restart replay)

Posted: 16 Nov 2012, 02:13
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?

Re: getting filename of replay (to restart replay)

Posted: 16 Nov 2012, 02:33
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.

Re: getting filename of replay (to restart replay)

Posted: 16 Nov 2012, 02:49
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

Re: getting filename of replay (to restart replay)

Posted: 16 Nov 2012, 03:11
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?

Re: getting filename of replay (to restart replay)

Posted: 16 Nov 2012, 03:13
by smoth
A lobby based solution is not the solution for everyone's needs.

*reworded for clarity*

Re: getting filename of replay (to restart replay)

Posted: 16 Nov 2012, 03:18
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:

Re: getting filename of replay (to restart replay)

Posted: 16 Nov 2012, 03:22
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.

Re: getting filename of replay (to restart replay)

Posted: 16 Nov 2012, 03:28
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.

Re: getting filename of replay (to restart replay)

Posted: 16 Nov 2012, 03:37
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.

Re: getting filename of replay (to restart replay)

Posted: 16 Nov 2012, 03:52
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)