Bay 12 Games Forum

Dwarf Fortress => DF General Discussion => Topic started by: Jifodus on April 12, 2007, 12:06:00 am

Title: .cmv player
Post by: Jifodus on April 12, 2007, 12:06:00 am
It was suggested that the movie recorder that Dwarf Fortress has, could be used for tutorials.  On pages 11 and 12 of the Future of the Fortress thread.  However it was mentioned that there is no way to control the speed/pause or rewind the movies.  So I figured I'd fill in the gap until Toady gets around to adding controls and other advanced features to movies and the movie player.  (There is an added advantage, you can now play the movies without having to load Dwarf Fortress, which takes about 30 seconds from clicking to playing.)

96kB  http://www.geocities.com/jifodus/CMVPlayer.zip  MD5: BFB1E2DCE5378EADEE9CBA5AE2280792 (Version 1.2.0.4)

P.S.  I'd post tutorials myself, except I usually abandon my fortress after the game crashes and I loose a lot of progress.  I've only once had a 5+ year fortress which I killed off by mining to the Adamantium.
P.P.S.  Since I am paranoid, I did run my program through  http://virusscan.jotti.org/  and nothing was found, but you still should be careful and check it yourself anyway.
P.P.P.S.  Please read the ReadMe.txt it has the currrent limitations and issues.  Most of those will go away when I get around to correcting them.  But I have other projects/assignments that I need to take care of first.  It took about 3 days, with about 3 weeks between the second and third day.
P.P.P.P.S.  Also, I only get 4.2MB of transfer an hour from geocities, and I'm too lazy to find some place else.  Another note, geocities might disable hot-linking on it so if it doesn't work, copy and paste the link into the address bar and it should work.

[ April 14, 2007: Message edited by: Jifodus ]

[ April 21, 2007: Message edited by: Jifodus ]

[ April 21, 2007: Message edited by: Jifodus ]

[ April 24, 2007: Message edited by: Jifodus ]

Title: Re: .cmv player
Post by: flap on April 12, 2007, 04:31:00 am
Thank you for that bit of software. Very usefull !

We should definitely set a utils page on the wiki, or a web site...

And is it something for which you would release the source code ? Or you plan to keep developping ?

Also apparently you have decoded the format of the movies... Can you provide some informations ?

Title: Re: .cmv player
Post by: flap on April 12, 2007, 05:12:00 am
I have added your link to this wiki page : http://dwarf.lendemaindeveille.com/index.php/Utils
Title: Re: .cmv player
Post by: TotalPigeon on April 12, 2007, 01:33:00 pm
Nice. The inefficiency is noted  ;)
Title: Re: .cmv player
Post by: JT on April 15, 2007, 05:26:00 pm
We used to have a standalone CMV player which was distributed around before Dwarf Fortress was released in alpha -- I still have the set of introductory videos in my DF folder, but new videos don't work in the old player and the old videos don't work in the new player.

Maybe Toady can re-release his official CMV player, updated to the new file format, when the new version is put out?

Title: Re: .cmv player
Post by: Jifodus on April 15, 2007, 09:42:00 pm
Can you send me the videos? Maybe I can add support to my player.

Btw, flap, do you check your PMs?

Title: Re: .cmv player
Post by: flap on April 16, 2007, 02:23:00 am
No.

If I find how to do that I will.

Title: Re: .cmv player
Post by: Spelguru on April 16, 2007, 02:40:00 am
Click the My Profile button in the upper right corner.
Title: Re: .cmv player
Post by: JT on April 20, 2007, 06:01:00 pm
quote:
Originally posted by Jifodus:
<STRONG>Can you send me the videos? Maybe I can add support to my player.</STRONG>

http://www.jtgibson.ca/df/dwarffortress1-5.zip  (8,097,076 bytes)
http://www.jtgibson.ca/df/dwarffortress6-10.zip  (9,100,832 bytes)
http://www.jtgibson.ca/df/dwarffortress11-15.zip  (13,398,885 bytes)
http://www.jtgibson.ca/df/dwarffortress16-20.zip  (13,243,756 bytes)
http://www.jtgibson.ca/df/dwarffortress21-25.zip  (11,429,529 bytes)
http://www.jtgibson.ca/df/movieview.exe  (122,880 bytes)

[ April 20, 2007: Message edited by: JT ]

Title: Re: .cmv player
Post by: Jifodus on April 21, 2007, 12:18:00 am
I modified my code to handle those old movies.  It wasn't actually much different from the current files.  The old movies didn't have the sound information.

(Same Link As In First Post)

Title: Re: .cmv player
Post by: JT on April 21, 2007, 01:48:00 am
I just gave this a whirl.  As soon as any movie hits the 10,000th frame, the frame counter on top turns into garbage characters and the movies stop playing... =)
Title: Re: .cmv player
Post by: Jifodus on April 21, 2007, 03:31:00 pm
Thanks, fixed. It was a... um... a Windows problem, because of a memory leak involving GDI objects. I didn't catch this because, it would only show up if you didn't fast-forward the clip (as I tended to do during normal testing).

(Same Link As In First Post)

Title: Re: .cmv player
Post by: JT on April 21, 2007, 06:41:00 pm
Looking good so far!  Is there any way to make the player save the playback speed I last used (both for when you load the program and hit play as well as for when you hit pause and then hit play again)?  On my overclocked Athlon 3200+ I have to reduce it to near 1/12 to get things flowing at a normal speed, and it's a lot of right-clicking on the Next Frame button to get it down to there every time I pause the movie.

[edit]Also, the CMV Player seems to use as much CPU as possible, especially when paused.  When paused, is the program actually just looping through a do-nothing loop infinitely until the player makes a command, or does it make use of an event timer?  I notice that whenever I pause the movie, my CPU fan (ordinarily quite quiet) starts spinning faster and faster in response to the perceived load.

[ April 21, 2007: Message edited by: JT ]

Title: Re: .cmv player
Post by: Jifodus on April 21, 2007, 08:16:00 pm
quote:
Originally posted by JT:
<STRONG>[edit]Also, the CMV Player seems to use as much CPU as possible, especially when paused.  When paused, is the program actually just looping through a do-nothing loop infinitely until the player makes a command, or does it make use of an event timer?  I notice that whenever I pause the movie, my CPU fan (ordinarily quite quiet) starts spinning faster and faster in response to the perceived load.</STRONG>

Yes. I do use a do nothing loop. Though I'm eventually gonna use timers to do the partial speed playback, and use GetMessage instead of PeekMessage when it's paused (zero/near zero usage then).  But first I have to time the frame rate so the partial speed actually makes sense.  I also find that-needing-to-get-down-to-1/8-to-actually-be-able-to-see-what-is-going-on annoying too.  ;)

Title: Re: .cmv player
Post by: flap on May 16, 2007, 03:14:00 am
You can easilly reduce that "do nothing" loop CPU usage. Just include a "sleep(100);" in the loop. Your application will pause 100 ms between each loop. (you will need to include "time.h" if you use C/C++)

EDIT : The latest version seem older than your last post. So you might have solved that issue already. If so, sorry for the inaccurate advice.

With the new movie released by Toady, I have a suggestion ! (But I don't thnik that it would be new...) :
-Go forwars/backward 10 by 10, 100 by 100, 1000 by 1000 frames.

[ May 16, 2007: Message edited by: flap ]

Title: Re: .cmv player
Post by: Jaqie Fox on May 16, 2007, 11:01:00 am
DF crashes for you? Ive only had this once over hundreds of game-years of playing...

Something may be wrong with your PC...

Title: Re: .cmv player
Post by: Jifodus on May 17, 2007, 01:43:00 pm
Yeah, I did make a quick change to use GetMessage when paused, it still uses maximum CPU usage for slow playing though.  Though I guess I did follow up with a bigger change related to adding more ways to play a movie (which was really a kludge).  I just didn't feel like making another post about it.

And I still need to improve the user interface before I can get more advanced playback options.  The good news is that I've been partially working on that (through another DF utility/application I'm working on), and most of the interface code can be rewritten with that.

Jaqie:
DF tends to crash because:
1) I tend to keep my laptop unstable.
2) I do unstablizing things to the game.
Not really my computer, just some habits I have.

Title: Re: .cmv player
Post by: Dotto on October 08, 2009, 02:25:02 am
I donīt know what happens, but the player stops in frame 78. I noticed that a guy had a similar problem in the 10000 frame and it was solved. Any workaround?
Title: Re: .cmv player
Post by: IndonesiaWarMinister on October 08, 2009, 02:54:31 am
First I was like : Ooh... Spelguru is here again?

Then I noticed the year of the posts.
Dur dur dur.

But yeah, we need this util!
Title: Re: .cmv player
Post by: Danarca on October 08, 2009, 04:15:40 am
Oh wow, now that's a necrobump...