Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: stuh505 on Tue 19/04/2005 01:23:34

Title: Playing videos in game
Post by: stuh505 on Tue 19/04/2005 01:23:34
If videos arent compiled into the executable, then players will likely view them outside of the game.  I don't want players to be able to view the final ending movie (for instance) just because they felt like it!  This reward must be earned.

Luckily, the PlayVideo command does not have any extension checking on the filename string parameter...so video files which have no extensions (or misleading extensions) can still be played.

However, Media Player does not really care if your video files are misnamed...so any so-inclined user wanted to, they could still play those video files without knowing what format they are in, without playing the game first.

Are there any clever solutions to overcome this?

(Before anyone suggests it, loading the frames as sprites is not a solution, because it would be a royal pain loading all those sprites, and you could not create an animation with more than 320 frames this way anyway, unless you linked together multiple views...it would just be horrible!)
Title: Re: Playing videos in game
Post by: Vince Twelve on Tue 19/04/2005 01:54:58
I'm doing the same thing in my game.  I named the video file to "random string of letters and numbers".dat .  Of course, the players who don't care about fun can open them and watch them as long as they can figure out to open them with a media player, which is quite simple.

To add another layer of masking, create a folder called data or something.  I guess you could even make it a hidden folder.  In this folder, place the game executable, the confguration file, and the videos, and whatever else is needed to play the game, then have the player use a shortcut from a different folder to play the game/use the setup.  Something like:

Supergame (folder)
|-Supergame (shortcut)
|-Setup (shortcut)
|-Manual (txt/html/whatever)
|-Data (hidden folder)
| |-Supergame.exe
| |-Setup (for reals)
| |-01laf.dat (video file)
| |-(more video files and other files)


Of course, the curious and the non-fun-liking people can still break this, but it's their own loss.
Title: Re: Playing videos in game
Post by: strazer on Tue 19/04/2005 02:12:01
What you could do is enable the resource splitting and hide the videos among those files:

game.exe
game.001
game.002
game.003 <- This is the video file
Title: Re: Playing videos in game
Post by: edmundito on Tue 19/04/2005 03:10:13
thisisnotavideoguys.avi
Title: Re: Playing videos in game
Post by: Vince Twelve on Tue 19/04/2005 04:00:03
Strazer and NetMonkey:  Devious and Deviouser.

...erm... let's say... respectively...
Title: Re: Playing videos in game
Post by: stuh505 on Tue 19/04/2005 04:07:50
Good idea, Strazer.  I didn't even know of resource splitting before!
Title: Re: Playing videos in game
Post by: Rui 'Trovatore' Pires on Tue 19/04/2005 06:44:22
Great idea, strazer! Thanks, I've been wondering that myself. Not that I need it, but it sure is handy to keep in mind. :=
Title: Re: Playing videos in game
Post by: Ubel on Tue 19/04/2005 07:39:05
Excuse me strazer for this stupid question, but how do you exactly do it? Cause I have a 16 mb avi file in the game folder and I don't want others to see it. How do I use that recource splitting thing?
Title: Re: Playing videos in game
Post by: strazer on Tue 19/04/2005 07:45:49
In the General settings pane, there's a checkbox called "Resource split every Mb:".
Check that and enter how many megabytes each part should have (16 for example, if your exe is big enough. This way, the users won't get suspicious based on the video's larger file size). Save your game, then rename your video so it looks like the last of the resource files.
Title: Re: Playing videos in game
Post by: on Tue 19/04/2005 07:58:58
Thanks. I'll try that later. :)
Title: Re: Playing videos in game
Post by: ildu on Tue 19/04/2005 09:04:06
Relating to this:
What video compression should I use, so that it's both user-friendly and workable in AGS. I'm wanting to include a hi-res (768x576) vid in my game. Is DivX still too uncommon, or should I just use MPEG-2? How about .bik?

It's just that if I leave it to small compression, the video will take too much space.
Title: Re: Playing videos in game
Post by: strazer on Tue 19/04/2005 09:09:49
For small videos, I would recommend using MPEG-1 actually, since that codec is included in Windows by default, so the user won't have to have any special codec installed.

But for larger videos, I think DivX or XviD are the most common. Just be sure to let the user know (in your game manual) that he has to have that codec installed.
Title: Re: Playing videos in game
Post by: stuh505 on Tue 19/04/2005 14:13:50
You might even just include the codec with the game if you go divx.  A lot of people don't have the divX codec and when you're playing a video and ou dont have it its ok to go download and then try again, but in the game, its only going to pop up once and if they get an error message you just made a video for nothing.
Title: Re: Playing videos in game
Post by: simulacra on Tue 19/04/2005 15:13:09
I'd recommend XVid instead of DivX, because it is open source. (Also, you don't have to distribute spyware with your game.)

I actually use FLC for all video sequences in my game (so far: 6), since the colour depth has less importance in moving pictures than in still images. It depends, of course on how the pictures look. A setting sun wouldn't do good in 256 colours.
Title: Re: Playing videos in game
Post by: ildu on Tue 19/04/2005 16:02:10
Yeah, I do need good resolution and good color depth. Maybe I'll use divx or xvid. Has anyone tried .bik videos?
Title: Re: Playing videos in game
Post by: on Mon 08/05/2006 14:17:42
DivX doesn't have "spyware". Just because you have to pay for the pro features and they pack extra crap in there, doesn't mean they're including spyware.
Title: Re: Playing videos in game
Post by: scotch on Mon 08/05/2006 15:21:16
It used to contain adware, and now it doesn't, I think.
Title: Re: Playing videos in game
Post by: Candle on Mon 08/05/2006 15:30:56
Stay away from the china packs they have the most spyware.
Good place to get them from.
http://www.free-codecs.com/