This is probably a Q for Kent:
I might be missing something, but I don't think I am. For my next game, I'm trying to include video. Actually, I'm trying to include a lot of it, so that the entire game animates from room to room. Basically, I can move the camera around through my world model and render to AVI. So, instead of using a still image to illustrate a room, I want to show an AVI which animates from the player's location in the prior room, moving into the new room, and stopping. For it to work, the animation would need to end on the last frame and stay there, until the player opts to turn or move into a new room. Then, a new animation loads, starting there, leading into the next spot, and stops.
So, here's the thing that doesn't seem to work. I can either tell Hugo to loop the AVI, or I can not. If I don't, then it goes away after the last frame, instead of freezing there. I get the feeling it's not currently possible to do that -- but is that a limitation of how Hugo plays the movies? And if so, would it be possible to add the ability? :) If not, I may be able to figure out a work-around. If it was possible to count for say, a couple of seconds (the animiations won't last long), I could replace the animation with a still image at the end. I don't know. Just kind of brainstorming.
If you want to see the AVI I was using to test, just email me. It's pretty cool (at least, I think it is). It's sort of an intro fly-in to the game's map. Once it players, I'd like for it to stop and freeze on the last frame.
Animation
Moderators: Ice Cream Jonsey, joltcountry
-
- Posts: 192
- Joined: Mon Nov 22, 2004 3:19 pm
- Location: Wichita, KS
- Contact:
-
- Posts: 119
- Joined: Fri Jun 27, 2003 12:10 pm
FB does this sort of, but not as extensively as I assume you're proposing. What I think you would do is make a JPEG that is identical to the last frame of your animation, same size, etc., and display it immediately after the movie plays.
Depending on the platform and video playback subsystem, there may be a black blink after the video finishes playing.
Depending on the platform and video playback subsystem, there may be a black blink after the video finishes playing.
-
- Posts: 192
- Joined: Mon Nov 22, 2004 3:19 pm
- Location: Wichita, KS
- Contact:
I could live with a black blink. :) I assume that for it to work correctly, I wouldn't be able to use the "play in background" option, correct? That way, the program would stop until the clip was finished, then I could swap in the still image. That would probably work, although I might want to give users the option of disabling animations. :)
-
- Posts: 119
- Joined: Fri Jun 27, 2003 12:10 pm
Right--the engine will block until the video finishes playing unless the video is playing in the background, but in that case you won't have any indication of when it finishes.
The best balance is probably what you're saying: to allow players to optionally turn off those room-transition animations. (They can also, on any platform that currently supports Hugo video, i.e., my ports, hit Esc to cancel the currently-playing non-background video.)
The best balance is probably what you're saying: to allow players to optionally turn off those room-transition animations. (They can also, on any platform that currently supports Hugo video, i.e., my ports, hit Esc to cancel the currently-playing non-background video.)
-
- Posts: 192
- Joined: Mon Nov 22, 2004 3:19 pm
- Location: Wichita, KS
- Contact:
After I added up how large the files may be, I decided a CD-sized game isn't really a good idea (for an if-comp entry, no less). Plus, I'm not sure what AVI encoding formats (because there seem to be several) would be supported by the most number of people, without going for simple uncompressed. I may use animations in spots, but probably not to the extent that I had originally planned.
-
- Posts: 119
- Joined: Fri Jun 27, 2003 12:10 pm
Yeah, any substantial amount of animation will add quite a lot of size. There's really no way around it. There's also really no way around having to choose a codec, and there's no single right answer. I made a rec.arts.int-fiction post talking a bit about this. FB uses Cinepak; there are probably other better choices you might opt for depending on your target audience.
-
- Posts: 192
- Joined: Mon Nov 22, 2004 3:19 pm
- Location: Wichita, KS
- Contact:
I'll have to see if that's a default option in Bryce. There were several MPEG formats, Uncompressed, Divx 5.something... I'd probably have to ask several people to try demos of several types. I don't know much about, personally. :(
*edit*
It does have an option for "Cinepak Codec by Radius" -- I'll try that one. Thanks! By the way, what compression quality did you use? I'm trying the results at 80% first, but it takes about 8 hours to render the entire 6-second animation, so it'll be a while before I know the results. I guess I could try just three or four frames as a test.
*edit*
It does have an option for "Cinepak Codec by Radius" -- I'll try that one. Thanks! By the way, what compression quality did you use? I'm trying the results at 80% first, but it takes about 8 hours to render the entire 6-second animation, so it'll be a while before I know the results. I guess I could try just three or four frames as a test.
What I did with FB is to render all the animations as uncompressed so that I would have a good master. Then I ran them through an encoder to produce the Cinepak AVIs.
Obviously this requires a great deal of disk space. The storage for everything in FB in uncompressed terms (including images, sound fx, dialogue, and movies) was 4 GB.
Obviously this requires a great deal of disk space. The storage for everything in FB in uncompressed terms (including images, sound fx, dialogue, and movies) was 4 GB.
-
- Posts: 192
- Joined: Mon Nov 22, 2004 3:19 pm
- Location: Wichita, KS
- Contact:
I figured it out! At least.... I figured it out for the Windows interpreter. If anybody is willing to test this with other interpreters that support JPG and AVI, I'd be most appreciative of your feedback. Basically, I'm able to overlap the video and the graphic, and the video seems to appear in front. When it finishes and goes away, the graphic in the background remains. Basically, it's exactly what you suggested to begin with, except that it works even with the animation playing in the background.Kent wrote:Right--the engine will block until the video finishes playing unless the video is playing in the background, but in that case you won't have any indication of when it finishes.
Assuming a window_class has been defined for graphics_window:
Code: Select all
run graphics_window.win_init
window
{
color TEXTCOLOR, BGCOLOR
cls
video "GFXFILE", "avifile", 0, true
LoadPicture("GFXFILE", "jpgfile")
}
run graphics_window.win_end
BTW, thanks for the help!!