How can I hide video files from players?

Started by , Fri 10/03/2006 16:27:38

Previous topic - Next topic

Fribbi AGDI joker

Does anyone know if it is possible to hide video files in the directory? I mean I don't want the player see the video files because that could spoil the game if he or she choose to play it without playing the game.

I know I can mark all video files as "hidden files" but that would be too easy for the player to get to know if there is a video file in game directory right?

So do you have any other suggestions what to do else with it.

(Sorry about my bad English).

 

Ishmael

You could rename them to something obscure and have the game play that specific filename...
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

strazer

#2
If you activate the "Resources split every Mb" option in General settings, the game exe will be split up into several parts, like this:
  gamename.exe
  gamename.001
  gamename.002
  gamename.003
and so on. Now you could rename the videos gamename.004 and so on and hide them among the other files.

I think this approach is good enough to avoid casual players finding the videos too easily. If they find them, decide to watch them and get spoiled, it's their loss.

Ishmael

Damn you strazer, stop stealing my refined ideas :=
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

Fribbi AGDI joker

How can I hide it among others file? Some tutorial could be useful here. I can still see the images of the file when I have select "View" "small image" in windows browser even after I have renamed that videofile.

Khris

#5
If Windows displays a preview icon even if the extension isn't recognized, you'd have to alter the file itself. Adding a zero byte at the start of the file should do the trick.

I believe there's a thread somewhere in the depths of the technical archive about how to achieve this using AGS's file commands.
File* hiddenfile=File.Open("hidden.00x", eFileRead);
File* videofile=File.Open("video1.mpg", eFileWrite);
hiddenfile.ReadRawChar(); // read the first byte to advance index
while (!hiddenfile.EOF) {
Ã,  videofile.WriteRawChar(hiddenfile.ReadRawChar());
}
hiddenfile.Close();
videofile.Close();
PlayVideo("video1.mpg", ...);

Another way would be using the encryption module. The relating thread should be there, too.

HeirOfNorton

If you do use the encryption module, bear in mind that it is meant for files accessed with the File* commands, so you would still have to do the whole copy thing like in the example above. (This seems rather much to me, honestly)

On the other hand, it seems unusual that Windows still recognizes the file as a video file even after renaming it. Are you sure that you renamed the whole thing? Go into windows Explorer or My Computer, and open the Tools -> Folder Options menu, go to the View tab and make sure "Hide extensions for known file types" is UNchecked. If it WAS checked, you might have just renamed the file to "gamename.005.mpg" (or whatever), so it would still be recognized that way.

Hope this helps,
HoN

Fribbi AGDI joker

#7
I changed my mind having video included in my game. I mean it was not really necessary for the game, anyway I tried that code and suddenly the video file was just empty. It has no mb inside. And the video file didn't work in the game.

I did what bykhrismuc said and renamed the video file from video1.vmw into "Thewronggame3.003" but the small image of the file could still be displayed. So I think it is still best for me to let it be in hidden files so people will not notice it.

So yes I had no clue why that happened but it destroyed the video file after I tried that code bykhrismuc . (That is very strange username eh! )

Maybe I just wait for it when Chris Jones make something new changes for those video files.Ã,  But as you all know we can store all music in one vox file so I will wait for it if he is ever going to build something new wich can store video files in one file like the vox file.

So yes no videos will be included in my game. It will just be plain and great game.

I have already left a demo in demo page. It is called Vitlausi Leikurinn. Unfortunatly for you all it is still with icelandic language.

Khris

#8
I didn't test that code, but it looks o.k. to me. And it shouldn't have touched the original file, as all it does to it is open, read, close.

Just don't hide them then, I don't look at included videos before playing the game, and there are enough people who don't spoil their gaming experience on purpose.

(btw: my username isn't that strange considering that I'm called Christian and live in Munich -> airport's name: MUC ;))

EDIT: I've tested the code, due to the insane amount of while-iterations, AGS will crash after writing ~146k (=150.000 bytes). Since 2.71 beta 4, this while-check can be disabled, I'll report back when I've successfully tested it.

SMF spam blocked by CleanTalk