Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Creating own file?

Author
Message
retardnewb17
13
Years of Service
User Offline
Joined: 6th Oct 2011
Location:
Posted: 28th Nov 2011 18:30
Hi! Would it be possible to create my own "picture file"? I mean like if there is a file called "picture.bmp" would it be possible to convert it like "picture.asd" what can be "used" only in my program?
(Sorry my very bad english, but I hope you understant what I mean xD)
nonZero
13
Years of Service
User Offline
Joined: 10th Jul 2011
Location: Dark Empire HQ, Otherworld, Silent Hill
Posted: 28th Nov 2011 21:28
If you are referring to creating your own file format then yes, you can do that. The MEMBLOCKS commands are useful here. You can also write directly to disk too. But making your own picture format (or any media) isn't a walk in the park. You have to think about your header (the initial bytes that id the file type), any metadata (optional extra info, usually part of the header) and then your data arrangement (your image). Remember it should be both coherent and portable (one of the reasons png is considered the best raster graphics format).

In short: you can. But do you need to?

What it comes down to is more what you want to do this for. If you merely wish to keep users from mucking with your media, you can use a small, homebrew encryption (like a basic 3 rounds) that will keep most people out as anybody with a little cryptology knowledge would not waste their time on messing with an app's images (unless they really are mentally ill).

If you want your own format for effeciency, go crazy! Just make sure you read and write correctly to/from your files.

You should look up Memblocks and File Commands in the DBPro help for more detailed information if you want to make your own formats.

Naphier
14
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 28th Nov 2011 22:16
Also be prepared to do lots of reading on file formats.
http://www.binarymodular.com/main/articles.php?cat_id=30
Chris Tate's site gives you a good foundation for the basics.

For asset protection and simplicity I like WLGfx's ZIP/RAR plugins.
Just rar the file with a password and change the file extension.

Check out our discussion on the topic of proprietary file formats and asset protection here:
http://forum.thegamecreators.com/?m=forum_view&t=191086&b=42



~Napland Games~

Login to post a reply

Server time is: 2024-11-23 23:59:25
Your offset time is: 2024-11-23 23:59:25