Compiling grahpics - is it possible
by Karsten "Clocks" Viese · in Torque Game Engine · 09/06/2001 (4:25 am) · 14 replies
Hi.
I was wondering if there is a way to compile the png's (or whatever format used) so that the end user cannot change it.
The gameplay in my project is very dependend upon the user using the same crosshairs, so I'm looking to find a way to make sure they can't just make new ones and use these instead to gain an advantage.
All the graphics in Tribes 2 is available in the zipped .vl2 files and I don't want that.
The reason for all this is that I want to make all my crosshairs black. So if you are in a dark place your crosshair will blend into the background making it harder for you to aim, like it would in real life.
In most games you have bright blue, red, yellow and orange colored crosshairs which I think is too big a help and I want to get rid of this.
This would easily be achieved with compiled gfx's.
Another way could be only to load the alpha channel of the PNG's and then set the color in the code.
Is there some way that I could achieve either of these suggestions?
The compiled gfx's would be the best option since it will also prevent people from using costumized skins to gain an advantage.
Let me know if you have any ideas regarding this.
// Clocks out.
I was wondering if there is a way to compile the png's (or whatever format used) so that the end user cannot change it.
The gameplay in my project is very dependend upon the user using the same crosshairs, so I'm looking to find a way to make sure they can't just make new ones and use these instead to gain an advantage.
All the graphics in Tribes 2 is available in the zipped .vl2 files and I don't want that.
The reason for all this is that I want to make all my crosshairs black. So if you are in a dark place your crosshair will blend into the background making it harder for you to aim, like it would in real life.
In most games you have bright blue, red, yellow and orange colored crosshairs which I think is too big a help and I want to get rid of this.
This would easily be achieved with compiled gfx's.
Another way could be only to load the alpha channel of the PNG's and then set the color in the code.
Is there some way that I could achieve either of these suggestions?
The compiled gfx's would be the best option since it will also prevent people from using costumized skins to gain an advantage.
Let me know if you have any ideas regarding this.
// Clocks out.
About the author
#2
09/06/2001 (4:59 am)
vl2 files are zip files... so you could pass protect them...then amake sure only vl12 are accepted.. and it doesn't load other stuff with the same name saved in the same folder structure. And then perhaps even check the file size every time to make sure everything is original. I think that would be a full proof system.
#4
Other then that it currently looks for files with the extension of .zip
09/06/2001 (10:06 am)
Currently the Zip file support for V12 is broken.Other then that it currently looks for files with the extension of .zip
#5
At any rate it would be simpler to just check the files CRC. You could also just include the data directly into the executable. It still might not stop someone determined enough but what ever will? :-)
Anyway, I'd second the blending option that was mentioned earlier since it would most likley work in any case.
- Brian Chapman (aka: antigrav)
09/06/2001 (12:30 pm)
Even when v12 gets working zip support I doubt it will support encrypted (ie: password protected) zip files as this would require decryption code that may (or may not) have licensing or exportation issues. Even if you went through all the trouble you still have to include the password somewhere in your code and if someone is determined enough they'll find it. I know because I've done just that myself before.At any rate it would be simpler to just check the files CRC. You could also just include the data directly into the executable. It still might not stop someone determined enough but what ever will? :-)
Anyway, I'd second the blending option that was mentioned earlier since it would most likley work in any case.
- Brian Chapman (aka: antigrav)
#6
Then use glTextImage2d()
I would suggest programming out a simple program that opens up a image file and writes all the ints for you into a file. So you just have to open up the file and cut and paste the values into the engine.
BTW! You will want to open up the png into photoshop or whatever and convert it to a non-compressed BMP.
Hope that helps! :)
(Edited in)
Just incase: I have a BMP class floating around if you need it e-mail me
-Arginal
09/06/2001 (5:21 pm)
You could put the image right into the engine if you like. You need to make a struct or an array out of int's (for 32 bit) and put all the color values into that array or structure. (1 byte for RBG and 1 for Alpha)Then use glTextImage2d()
I would suggest programming out a simple program that opens up a image file and writes all the ints for you into a file. So you just have to open up the file and cut and paste the values into the engine.
BTW! You will want to open up the png into photoshop or whatever and convert it to a non-compressed BMP.
Hope that helps! :)
(Edited in)
Just incase: I have a BMP class floating around if you need it e-mail me
-Arginal
#7
As you can guess its not really a problem yet as we are no where near a release but I was just checking out how it could be done.
I imagine this is something others might look into as well. My main concern with the easily available bitmaps is the cheating aspect. I dont want my project ruined by cheaters, so if there something an can do to make it harder, I will.
So I'll get back to this subject later (6-12 month).
// Clocks out
09/07/2001 (12:40 am)
Thx for all you help.As you can guess its not really a problem yet as we are no where near a release but I was just checking out how it could be done.
I imagine this is something others might look into as well. My main concern with the easily available bitmaps is the cheating aspect. I dont want my project ruined by cheaters, so if there something an can do to make it harder, I will.
So I'll get back to this subject later (6-12 month).
// Clocks out
#8
09/07/2001 (8:29 am)
Well, if you really want to make it unmodifyable, you could put it inside the executeable.
#9
// Clocks out.
09/07/2001 (8:39 am)
So basicily I could put 300mb of bitmaps inside the .exe if I wanted?// Clocks out.
#10
I wouldn't recomend it however. Another option could be to render the crosshair with just some GL calls instead of having a bitmap. Basically think with this in mind. Anything you have on a client computer can be modified (including the executable...but it's much less likely). So any bitmap you store, in any format, can be changed. If this crosshair absolutly HAS to stay the same, I would say either:
a) Don't use a bitmap, just use OpenGL calls.
b) Put it in the executable, a bitmap is exactly what the name says...a bit-map, an array of bits.
c) Do something like combine 4 bitmaps into one data file, so every 4th bit was one bitmap, every 3rd bit was another, etc. Do some kind of simple encryption.
09/07/2001 (10:02 am)
Technically you could...I wouldn't recomend it however. Another option could be to render the crosshair with just some GL calls instead of having a bitmap. Basically think with this in mind. Anything you have on a client computer can be modified (including the executable...but it's much less likely). So any bitmap you store, in any format, can be changed. If this crosshair absolutly HAS to stay the same, I would say either:
a) Don't use a bitmap, just use OpenGL calls.
b) Put it in the executable, a bitmap is exactly what the name says...a bit-map, an array of bits.
c) Do something like combine 4 bitmaps into one data file, so every 4th bit was one bitmap, every 3rd bit was another, etc. Do some kind of simple encryption.
#11
09/07/2001 (10:06 am)
Well you COULD if you wanted to. That doesn't make it a good idea =)
#12
09/07/2001 (10:41 am)
Hmm... I kinda like that interleaved bitmap idea.
#13
Of course, you'll still be open to direct hacking of the executable, assuming someone is mad/motivated enough to go to those lengths to cheat. (I'd would have said that nobody would be that crazy, but that was before I saw some of the cheats for counterstrike).
No real way to totally beat executable hacking; "The client is in the hands of the enemy" as Raph Koster said.
-- Bob
09/07/2001 (12:46 pm)
I'd use something like MD5 (see here for several implimentations) to calculate a digest of the bitmap files, then check it as you load the file into memory. You'd have to store the MD5 digest in the executable.Of course, you'll still be open to direct hacking of the executable, assuming someone is mad/motivated enough to go to those lengths to cheat. (I'd would have said that nobody would be that crazy, but that was before I saw some of the cheats for counterstrike).
No real way to totally beat executable hacking; "The client is in the hands of the enemy" as Raph Koster said.
-- Bob
#14
right on their monitor over the crosshair? No hacking
required. :)
09/07/2001 (1:12 pm)
But what will stop someone from putting a little stickerright on their monitor over the crosshair? No hacking
required. :)
Torque 3D Owner Phil Carlisle
take a look in the Opengl redbook for the blend mode you'd need for it.
Phil.