Archived

This topic is now archived and is closed to further replies.

AK47

How to bind graphics files to my game?

Recommended Posts

Hi guys! How do I bind graphic files such as bitmaps to my c++ game so nobody can screw around with them? Static library or dll or some special binding method? Thanks!

Share this post


Link to post
Share on other sites
I''m sure it can be done in all but i''ve only experienced it in visual studio. Add a resource like you would add a source file. Then just browse for you bitmap and it will be tacked onto the end( or begining or where ever) of your executable. Your gona have to search on a tutorial on how to use it thought.

This one seems to be geared for .net, but is the extent of my search.


This will add the size of your image files to your executable, don''t be surprised if you have a big game and your executable is 100 mb.

Share this post


Link to post
Share on other sites
You might want to consider packing all your resources into one file like Quake. There was an article about that on Gamedev a while ago - PAK file tutorial.

If you don't want to go that far, you could develop using standard bitmaps. Then, before release, change the information in the header section (i.e. exchange the location of with and height). Now no one can edit the bitmaps via Paint/PSP.

[edited by - Onemind on April 6, 2004 12:13:09 PM]

Share this post


Link to post
Share on other sites
Im not completely sure...

but i think that using an in-exe resource file is a bad idea, since AFAIK, when you load the exe, the resource file is loaded into RAM, if you have like 200 MB of resources, as most games do these days, it''s going to cause major paging problems. best to use multiple encrypted files, or multiple smaller pack files(catagorized by level or somthing).

I use induvidual files which can optionaly be encrypted, also since my image format is proprietary, noone except another programer could open it, and even then it would take some tinkering.

and also, what is the big deal? if somone steals your images for thier own game then sue them, just that simple =) when they install/download your game have them agree to a EULA which states that all materials therein are subject to international copyright laws.

Raymond Jacobs,

www.EDIGames.com

www.EtherealDarkness.com

Share this post


Link to post
Share on other sites
Hi guys!

Thanks for the fast and helpful hints.

Yeah, loading the resources one shot into ram is a problem. I will weight this option with my graphics size.

Copyright is a quick solution hehehehehe.

Share this post


Link to post
Share on other sites
hehe yeah, i tried the resource thing a long time ago, and ran into slow exe loading problems *due to paging all the data for the 100 MB exe ;-)*

As for copyright, if your working on a comercial game, you obviously want to protect your resources, and thats the whole point of copyright.

if you game is just a hobby of yours, then do you really care if other people get the images?

i used to care alot about this, but then i realized it was dumb spending so much time worrying about people seeing the resources, if they ''hack'' your game so be it, they bought it, let them hack the hell out of it=D

Raymond Jacobs,

www.EDIGames.com

www.EtherealDarkness.com

Share this post


Link to post
Share on other sites
Simpliest variant
Just copy your bmps to one file xor''ing them or some crypting method.

Then unpack them to memory xor''ing (smth else) and you get original files

sorry, too drunk for tutorials

Share this post


Link to post
Share on other sites
Hey Honayboyz
U didnt misread my question. I was wanting to bind my graphics to exe and didnt know about resource file .

Hahaha Archi no worries man, I am too drunk to read tutorial.

Thanks guys!

Share this post


Link to post
Share on other sites