Recording games

Got an idea for OpenTTD? Post it here!

Moderator: OpenTTD Developers

Post Reply
NoMercy
Engineer
Engineer
Posts: 15
Joined: 19 Jun 2004 21:23
Location: The Netherlands

Recording games

Post by NoMercy »

After reading about the world wide openttd day of a few days ago and seeing some screens, I wondered how great it would be to actually see this come to be.

Is it possible to record all the actions made in a game so that the original game can be replayed or played back to show off how a network would come to be. Maybe it can be implemented through a new 'player'/spectator that can 'watch' all the actions of a game and store them in file.

Then you could play back the game and watch the game in every area (the advantage over a video). I think it would be great promotion and would give people to show off their network designs.

- I have no idea how much data will have to be stored for one game. I can imagine it could become a lot if you want to capture all states.
- I also predict a problem in the playback, as cities might evolve differently. There might be more random elements in play.

Let me know if it is even slightly possible. If it has been suggested before, then sorry about this topic.
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Re: Recording games

Post by Rubidium »

OpenTTD can record and play back games, but it is aimed at debugging desyncs and as such it records an enormous amount (i.e. too much for simple replays) and playback only works if you enable it at compile time and only for the dedicated server which then fast forwards, so clients can't keep up with it and you don't see anything as well.
Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

Re: Recording games

Post by Eddi »

the biggest problem with making this a real feature is that it is extremely difficult or impossible to allow loading playbacks from old versions, as the internal gameplay may change drastically. it is basically the same thing that stops people with different versions to join the same multiplayer server.

so essentially playbacks can only be used by the exact same version that created them.
User avatar
Lord Aro
Tycoon
Tycoon
Posts: 2369
Joined: 25 Jun 2009 16:42
Location: Location, Location
Contact:

Re: Recording games

Post by Lord Aro »

Eddi wrote: so essentially playbacks can only be used by the exact same version that created them.
or essentially the same savegame version? (if you get what i mean) :wink:
AroAI - A really feeble attempt at an AI

It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration. --Edsger Dijkstra
Yexo
Tycoon
Tycoon
Posts: 3663
Joined: 20 Dec 2007 12:49

Re: Recording games

Post by Yexo »

No, it really will only work with the exact same version.
Wasila
Tycoon
Tycoon
Posts: 1498
Joined: 15 Mar 2008 07:02

Re: Recording games

Post by Wasila »

How about some feature in the game just recording the screen? Or some part of the screen? It would be severely limited compared to the full record, but it would be something.
User avatar
FooBar
Tycoon
Tycoon
Posts: 6553
Joined: 21 May 2007 11:47
Location: The Netherlands
Contact:

Re: Recording games

Post by FooBar »

There's plenty of third-party software that does just that.
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Recording games

Post by planetmaker »

Or there's the (outdated) time lapse patch at the end of a search in the development sub-forum.
NoMercy
Engineer
Engineer
Posts: 15
Joined: 19 Jun 2004 21:23
Location: The Netherlands

Re: Recording games

Post by NoMercy »

Rubidium wrote:OpenTTD can record and play back games, but it is aimed at debugging desyncs and as such it records an enormous amount (i.e. too much for simple replays) and playback only works if you enable it at compile time and only for the dedicated server which then fast forwards, so clients can't keep up with it and you don't see anything as well.
Thanks for the answer. How much is currently being recorded (MB/s)? And, is it a complete simulation, or are there important parts missing (this might be the big nogo here)? Just looking if it's feasible.

As you say it can be processed fast enough to make clients not keep up. That sounds like a fast program counter which can be slowed down. Playback wouldn't be an issue (and concluding from that, with about max 50MB/s read for a hdd, playing back say, 5x as fast, would give a max 10MB/s of actual data being recorded, not even including game generation speed here). That's 36GB per hour. Ok, steep, but not impossible.

Recording an online game would be the same as playing it, so recording can keep up (or is the game slowed down during recording?).

Knowing the right version is simply a matter of properly tagging the recording (svn number if you really have to).

Just thinking out loud here.
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Recording games

Post by planetmaker »

NoMercy wrote:
Rubidium wrote:OpenTTD can record and play back games, but it is aimed at debugging desyncs and as such it records an enormous amount (i.e. too much for simple replays) and playback only works if you enable it at compile time and only for the dedicated server which then fast forwards, so clients can't keep up with it and you don't see anything as well.
Thanks for the answer. How much is currently being recorded (MB/s)? And, is it a complete simulation, or are there important parts missing (this might be the big nogo here)? Just looking if it's feasible.
That depends upon the debug level which is set. The times we ran desync debugging on our servers we had log files of several 10s of MB for a real-life day and a savegame for every ingame week.
Eddi
Tycoon
Tycoon
Posts: 8289
Joined: 17 Jan 2007 00:14

Re: Recording games

Post by Eddi »

for simple playback, probably only the data sent through the network must be captured, which an initial savegame and "live data" which is probably less than 3KiB/s. most of that is heartbeat data like the random seed, to keep the connection alive and the clients synchronized, the real command data is probably way less.
Henri
Engineer
Engineer
Posts: 2
Joined: 31 Aug 2010 20:29

Re: Recording games

Post by Henri »

Hi.
Lately i wanted to record games with latest third party programs.
I have tried numerous of up to date recording programs like Camtasia Studio 7 or Fraps99. Neither of them works, i have no idea why.
Ingame game recording would suck imo.
Could you just possibly make somehow that third party programs could be able to record OTTD? :)

Edit: I just realized i can record with third party programs when i run the game on 32bpp thingie.
PlayingDude
Engineer
Engineer
Posts: 2
Joined: 19 Feb 2012 09:38

Re: Recording games

Post by PlayingDude »

One way to record games would be with writing function calls in a .nut file, compacted in an .tar archive, as an AI.
Time between clicks can be recorded as a Sleep() call.

This subject has a history since 2004:
http://www.tt-forums.net/viewtopic.php?f=32&t=10097
http://www.tt-forums.net/viewtopic.php?f=32&t=10668
http://www.tt-forums.net/viewtopic.php?f=32&t=26812
http://www.tt-forums.net/viewtopic.php?f=32&t=30379
http://www.tt-forums.net/viewtopic.php?f=32&t=32735
http://www.tt-forums.net/viewtopic.php?f=32&t=34406
PlayingDude
Engineer
Engineer
Posts: 2
Joined: 19 Feb 2012 09:38

Re: Recording games

Post by PlayingDude »

Functions of NoGo could become a tool in recording,
if GSEventWindowWidgetClick() also could detect clicks on unhighlighted widgets, and
if the number of the clicked tile in the main window is passed as a parameter of the function.

I think then, with tools to write to a file, a gamescript could be written for recording a game.

But maybe it would be easier to use parts of the multiplayer code to record and replay.
Post Reply

Return to “OpenTTD Suggestions”

Who is online

Users browsing this forum: No registered users and 2 guests