Page 1 of 2

Ofuscating help!!!!!!!!! (I think...)

Posted: Sat Aug 05, 2006 8:57 pm
by Ukio
Well... I download the last version of Ren'Pay.... I make my game... I fight with the engine... and...
I read an article somewere and read about a program to pack the images of my game... well, that tool don´t come with my download... :shock:
I have the DOS tool in the directory but I don't know how to run this...!!!
Yeah... I know... maybe I'm a little stupid but... I NEEDDDD HELLLPPP!!!!
Please come to my rescue Oh! gods of the coding!!!!!!!
Were I can download the especific tool? :?

PD1: Again... sorry about my english.... :oops:
PD2: Sorry... I'm a cartoonist without coding skills...

Posted: Sun Aug 06, 2006 1:12 am
by Sakuya
I think the DOS file is probably the same as the BAT file. And you probably do it the same way as said in the tutorial? Or am I wrong? I haven't gone that far yet.

While on the subject, does the tool obfuscate music and script files too?

Posted: Sun Aug 06, 2006 1:28 am
by PyTom
To archive images, go into the tools/ directory and run game_archive_images.bat. This will archive all of the png, gif, and jpg images in the game directory. You also need to add the lines:

Code: Select all

init:
     $ config.archives = [ 'images' ]
to your game. You can then move the png, gif, and jpg files out of the game directory, run your game, and the game will still work.

To obfuscate script files, just ship the .rpyc files instead of the .rpy files. The .rpyc files are an obfuscated form of the .rpy files. .rpyc files are automatically generated when .rpy files change, but if the .rpy files are not present, Ren'Py will operate fine from just the .rpyc files.

You can add music to the archive by editing game_archive_images.bat, and changing it so that *.mp3, *.ogg, or whatever extensions you use are added to the archive. Once that's done, you can run the batch file, and everything will be archived.

Oh, and make backups. When moving stuff around like this, you could inadvertently delete something. Making backups is a good way to prevent this. Only you can prevent data loss.

Posted: Sun Aug 06, 2006 1:32 am
by Sakuya
Where will the obfuscated file be stored? Is it still in the game folder?

If I typed the code so that it will store both JPG, PNG, MP3, OGG, etc. Will it still work that way? Or must images and music be seperate?

Posted: Sun Aug 06, 2006 1:55 am
by PyTom
The archive file must be in the game folder. You can put any file you want in an archive file, except for script (.rpyc) files. (Those can be put in, but it is a little more difficult, so it is probably not worth it.)

DOS and BATs

Posted: Thu Aug 10, 2006 9:03 pm
by Ukio
Sakuya wrote:I think the DOS file is probably the same as the BAT file. And you probably do it the same way as said in the tutorial? Or am I wrong? I haven't gone that far yet.
Yes friend... I do all in the manual but... well... I cannot run the BAT file in the Tools folder.
I get an error... something like "bad folder or file name". And the tool don`t create the files in the game folder... Maybe is a Window problem... (one more... jejje).
Well... I think that this tool is fundamental to make my game... I don't want people stealing my work (it's more common than you think...).

Resuming: I do a double click on the bat file and I get an error message in the DOS prompt. I think i'm doing something wrong... :? well.. I don't know... No one get this error as far as I know...

Well... I think that I have to return to my comics until I have some solutions... but thanx all for the help... I you have more jejje Thanx in advance... :)

Posted: Thu Aug 10, 2006 9:18 pm
by Sakuya
Okay, I just tried it the old DOS way and found the same error you did. But, when I merely double-clicked on the BAT file in the tools, it did everything it was supposed to and outputted a "images.rpa" file in the Game folder. :lol:

The demo game works without all the images in the Game folder. However, because it didn't archive the music, the music does not play.

Problems:
1. I cannot find the so-called "imagse.rpi" that supposedly outputs.

2. The BAT file only archives the images but since I double-clicked on the BAT file, I cannot edit it so that it archives the music too.

Posted: Fri Aug 11, 2006 12:00 am
by PyTom
Ukio >>> Which version of Windows are you using?

Sakuya >>> The .rpi file isn't created any more, just the .rpa one. If the docs mention .rpi, they are in error (please let me know where so we can fix it).

To edit a batch file, right click on it and pick edit.

Posted: Fri Aug 11, 2006 1:13 am
by Sakuya
Ok, thanks. I noticed there's a TTF font file in the demo game's Game folder. Would I have to archive it as well? And I would use that same lind of code again and again for images, music, fonts, etc?

Posted: Fri Aug 11, 2006 8:03 am
by PyTom
Archiving .ttf fonts can lead to problems. So don't archive that, just leave it out in the game directory.

Posted: Sat Aug 12, 2006 8:12 pm
by Ukio
Well... jejje I'ts me again... :oops:
If you are tired just tell me jejejje :)
PyTom wrote:Ukio >>> Which version of Windows are you using?
Well... sometimes Windows XP but I prefer Window 98 second edition with the last actualizations installed... so this is the OS I use to make my game with Ren'Py... All work cool but this... :oops: ( yeah I know... jejje I'm a old fashioned boy... jejje)

------------

In the manual you say:
Images can be archived using the tools/archiver program that ships as part of Ren'Py. To use this, one can change into the game directory and run a command like:

../tools/archiver images *.png *.jpg

Alternatively on Windows, one can run tools/game_archive_images.bat directly, which will do the same thing.
Can you explain me this more in deept?

For example:
If I have in the game folder this images files (C:\renpy-5.5.2b\game):
image001.png
image002.png
image003.jpg
image004.jpg
How can I obfuscate this? Maybe a practical example of use under Window?

If I make double click on game_archive_images.bat I get this error in the DOS screen:

Code: Select all

C:\renpy-5.5.2b\tools>cd ..\game

C:\renpy-5.5.2b\game>call ..\tools\archiver.bat images *.png *.jpg *.gif
Bad command or file name
C:\renpy-5.5.2b\game>pause
Press any key to continue . . .
And nothing is archived in the game folder... :(
Maybe I need to run game_archive_images.bat with command line or something? Or move the Tools folder to the game folder?!

Posted: Sat Aug 12, 2006 8:26 pm
by Ukio
One more...In this site http://www.renaigames.net/dev_renpy5.html, I found this text in a tutorial:
As mentioned earlier in What's What: Files and Folders, you will have to use a file called archiver.exe (for Windows users) or archiver.py (for Unix/Linux and Mac users) found in the same folder as your run_game.exe file. When run, archiver will take all the images you specified and create a single file called images.rpi and images.rpa. These two will be all you need to put into your image folder upon release. Great, huh?
Well... I don't have an "archiver.exe" file in my download of Ren'Py.. :? Why?

Posted: Sat Aug 12, 2006 8:28 pm
by PyTom
That's a little out of date. Archiver.exe became tools/archiver.bat, as part of a cleanup of Ren'Py a little while ago.

Posted: Sun Aug 13, 2006 5:30 am
by monele
Note : I couldn't use any of the .bat files when I was under Windows 98... so that's why it doesn't work. Basically, these files use commands not found in Win98. I had to make my own... Mh... I guess I could post these here if you need it ô_o

Posted: Mon Aug 14, 2006 7:00 pm
by Ukio
monele wrote:Note : I couldn't use any of the .bat files when I was under Windows 98... so that's why it doesn't work. Basically, these files use commands not found in Win98. I had to make my own... Mh... I guess I could post these here if you need it ô_o
YES YES!!! please! Post that!!!! that could be very useful to me!!!!!!!! :P (and other people too...)

PD: well... I think I have a problemmmmm with Windows 98... (one more time... uf!) :cry:
PyTom wrote:That's a little out of date. Archiver.exe became tools/archiver.bat, as part of a cleanup of Ren'Py a little while ago.
OK Sensei... roger that! :) Thanxs for the help...! :) GOD SAVE REN'PAY!!! (and PyTom too.. jjeje)