Any way of loading from a bank?

Blitz3D Forums/Blitz3D Programming/Any way of loading from a bank?

Skitchy(Posted 2003) [#1]
I would like to stick all my media files into one big (encoded) file and then load them from that. Unfortunately, the only way this seems to be do-able is by writing the file in its original form to the hard disk for a short period of time (if the program was stopped at that point, the file would still be there for people to find). I was wondering if there's a way of loading stuff like 3d objects from a 'bank' or an area of memory (virtual disk or something).

I know there's that Pak program (which looks very good BTW) but it seems to have the same problem I outlined above.


Beaker(Posted 2003) [#2]
Thats a big NO, unfortunately.

The trick is to save-load-delete each file one at a time, so even if the program was stopped there would only be one file.


Synchronist(Posted 2003) [#3]
Can we explore this a bit? I've got a similar need.

So, it would not be possible to allocate a chuck of memory the size of the file, read the file into it and provide a pointer?

Would this not be similar to a RAM disk kind of operation?

Excuse my naivete, but I'm still learning how to do things like this in Blitz... thx...


Graythe(Posted 2003) [#4]
It is possible with the ReadBytes (paired with writebytes) to read and write user defined frames of memory to and from banks. Is that what is wanted?

[Edit]Ah. No it isn't. You want to load from a bank to a model and similar.[/edit]


Warren(Posted 2003) [#5]
For a sub thread, I'd like to discuss the reasons why people are so obsessed with encoding/hiding their assets. Is theft of assets REALLY that big of a problem? How many times have you take graphics from a game to use as placeholders in your own until you got real ones? Why deny someone else that same courtesy?

Or are we talking about this for some other reason?

I'm not attacking, I'm honestly curious why this interests people so much. The Blitz community seems very open and sharing to me - except when it comes to assets.


SopiSoft(Posted 2003) [#6]
i dont care when people use my media....they're only getting theirselves into trouble by using copyrighted ones...


Skitchy(Posted 2003) [#7]
It worries me because all the contracts / copyrights in the world mean abosolutely NOTHING unless you have the money to take people to court AND WIN (ie. more money than the person / company you are up against).

Better to be safe in the first place.
;)


Warren(Posted 2003) [#8]
Yes, but is there a track record of this happening or something? Is it pure paranoia or is there an actual problem here that you're trying to solve?

It just seems weird to me that amateur games are more concerned about it than big companies. You can easily get textures and other assets from Unreal Tournament 2003, Quake3, and other games.

Yes, these companies have money to sue, but do they ever do it? Not that I've seen.

So I have to wonder if it's a problem worth worrying about.


Skitchy(Posted 2003) [#9]
Well, we seem to be using the same points to argue both sides of the same thing !!

- Everybody is scared of big companies, so they're not going to openly rip off their media. There's more to lose than gain.
- The big companies ALWAYS seem to use their own formats for stuff, esp. 3D objects. The fact that they then release the file format and convertors is up to them, but if they didn't this in itself would protect them.
- The little guy has to look out for himself because he doesn't have a team of lawyers / financial backers.
- There's ALWAYS a track record for corruption. There was a thread somewhere on this board about a PUBLISHING COMPANY that stole the media from a game that they were supposed to be publishing. If only it had been encrypted...


Warren(Posted 2003) [#10]
I still don't see evidence of a problem here. It still sounds like unfounded paranoia over something that COULD or MIGHT happen.

FYI, the reason some companies create their own file formats is because it suits their games purposes - not to hide the data.

I dunno, do what you like. I personally won't be obfuscating my file formats (and complicating my code) for the sole purpose of hiding assets.


Skitchy(Posted 2003) [#11]
I realise the file format thing is not for protection only, but it does serve that purpose as well.

There must be a good reason for protecting your stuff because a lot of other compilers can do it (even DB).

I admit though that I am a paranoid person by nature. :)

I don't want to push this on everybody - I like sharing stuff sometimes, but I'd like to have the choice not to as well.


Hotcakes(Posted 2003) [#12]
I find it hard to believe that after all this time with DLLs being at least semi supported up until lately that no one has gone about hacking Mark's pointers and figuring out what exactly is stored where - and producing commands to modify those values.

Do the structures change dramatically from release to release, therefore demoting any such work to 'useless'? Or is Blitz Research likely to kick up a fuss?

Some Bank<->Object switching commands would go down a treat. Insights anyone?


jhocking(Posted 2003) [#13]
This is paranoia to the point of being counter-productive. Not only is it easy to get at the media files of most PC games, in most cases players are actively encouraged to do so. Why? Because game companies have found that fostering communities surrounding their game (for mods, etc.) attracts a LOT of players.

Furthermore, what difference does it make if someone uses your art assets in their game? That is of course illegal but what difference does it make to YOU? Except for really unique art (in which case the theft is so blatantly obvious you could probably win without any lawyer at all) their use of your art assets does not hurt the sales of your game.

Morover, there is no significant chance of theft even when files are temporarily being decrypted to the hard drive. It is much more likely that a hacker will crack your game and distribute a warez version. Done correctly (eg. terabit's DataPak) the file will only ever exist for a couple milliseconds; the horrible thieves you envision would have to know down to a fraction of a second when to grab your files, and then they would have to know where to look (since you can write to any old temp directory you want.) If someone is skilled enough to figure out that level of protection they would have no trouble grabbing the data from the memory bank you are proposing.

**********

I saw a recent thread about a publishing company failing to pay the developer for their game's royalties but have never heard of a publisher stealing specific game assets. Stealing art assets would be pretty pointless when it is so much easier and more profitable to steal the entire game.


Beaker(Posted 2003) [#14]
I can think of other reasons to hide your media:

Not wanting to spoil later parts of the game.
Not wanting to ruin the 'magic' of the game.
Wanting everything in one easy simple file.

The argument about games being open for modding is irrelevant. It suits certain game types (and game publishers) to do this. Most games do not necessarily need or benefit from modding.


Ice9(Posted 2003) [#15]
Epicboy
I've had resources stolen before
A wizard model stolen and used in someone elses game.
Graphics stolen and included in some texture packs.
Graphics stolen and used in a game.
Graphics I did for a game someone else was writing, Graphics stolen Game duplicated. I contacted the programmer on that one and he sent the cease and desist.
I did some some UT levels that were reworked and posted as someone else work.
All of these had readme's that clearly stated not to separate or change and not to be used without authorization as well as copyright notice.

People think if something is posted on the net and they can download it then they can use it.

Hiding media imparitive in the Indigame world. If another Indigamer takes your hardwork and uses it in their game most Indi's don't have the resources to pursue it so hiding is a good method if you don't want it to walk away.

There is also a lot of sharing in Indigaming. I've offered textures and resouces and code for free as have many others and that's a good thing for the community at large.


Skitchy(Posted 2003) [#16]
That's the thing that REALLY gets to me - the idea of somebody else passing my hard work off as their own.

And somebody making money from my work just f**ks me off completely.

If you don't want to encrypt your media - fine. But I would like the option to do so, and I think a lot of others would too. And I think that loading from banks would be a good way of allowing developers to do it in their own way.
:)


Synchronist(Posted 2003) [#17]
"Is theft of assets REALLY that big of a problem?" YES.

I'm developing an application for a client that accesses data from a CD. As the programmer, it's imcumbent upon me to try and satisfy my clients needs for data security as best I can. This technique may be one way of addressing the issue...

"Is it pure paranoia or is there an actual problem here that you're trying to solve?"

Not paranoia. If you were a large company who had spent years in gathering data, would you want to hand it over to your competitor? Probably not.

Not trying to be brusque. I've worked in the business sector for many years and you wouldn't believe the things clients want when it comes to security...

It's one thing to lose data or work that is your own (which sucks big time), but it's another to lose a clients. And that my friend, is not a good thing when it comes to referrals...


Skitchy(Posted 2003) [#18]
This COULD be addressed if somebody re-wrote the 'loader' functions in Blitz, but it's a really long-winded way of doing it. I for one do not relish the thought of writing an animated .3ds loader
;)


Warren(Posted 2003) [#19]
CodeMeister

I was talking more from the point of view of guys making hobbyist games and such.

If you're working on contract and your customer demands security, well, there's not much choice now is there?


cyberseth(Posted 2003) [#20]
Personally I couldn't really care about the security of my "assets" as most of them get sold along with the IP rights when I sell my game to a publisher. No, but I still think it's very important to be able to load a resource from a bank. And the reason for this is simple:

During any LoadImage, LoadSound, LoadMesh commands, program execution is HALTED!! That mounds you cannot have a mouse cursor, any kind of animation playing, and when loading large files you cannot have any kind of progress bar stating the percentage of loading within that file. It's horrible.

Nobody likes waiting while games are loading. They like to be able to see something interesting to keep them happy, but there's no way of doing animations while resources are being loaded, because program execution is HALTED!!


Warren(Posted 2003) [#21]
Oh God, no! :)

You guys worry about the funniest things sometimes ...


Peer(Posted 2003) [#22]
Skitchy, what kind of media do you want to hide?

Normal or animated 3D objects. I have an Idea how to encrypt the media but it seems only to work with unanimated Objects.


Synchronist(Posted 2003) [#23]
@EpicBoy, no prob... I'm a game developer myself... 8^)


Miracle(Posted 2003) [#24]
Bank <-> Asset capability would be wonderful for many reasons other than security. Dynamically generated sounds, for instance. That's more of a feature request, though.


Ice9(Posted 2003) [#25]
I don't think people mind much on load times before playing a game or transition between levels. You can think of them as commercials in a television show. A chance to run to the fridge or stretch or pick your nose or something. But if a game takes long to load and then sucks monkey nipples then that's another story.


Beaker(Posted 2003) [#26]
But if a game takes long to load and then sucks monkey nipples


/me runs off to add this feature to his game.


Ice9(Posted 2003) [#27]
ROFLOL


Skitchy(Posted 2003) [#28]
"Skitchy, what kind of media do you want to hide? "

Pretty much everything, but post your idea anyway and maybe somebody can get it working (possibly me)
:)


Sir Gak(Posted 2003) [#29]
One game I played years ago, had a couple of "special" graphics that were secret, and only were revealed if you did certain things in the game. The program's graphics, however, were stored in a ordinary directory, and you could just go there to view the "special" graphics at your leisure. So, encoding graphics, etc., makes a lot of sense, even if it's only to "reward" a player for doing the song-and-dance to get to it.

Then, too, theft is a reality of human nature. That's why we put locks on our doors and windows, and install security systems in marketplace stores (and some homes). In an ideal world, we would need only a simple toggle switch to start our cars, not a key, and the doors to our homes would not need locks (unless to keep small children from running out into the street, etc). But, we don't live in an ideal world. Such is life.


Warren(Posted 2003) [#30]
/*
Then, too, theft is a reality of human nature. That's why we put locks on our doors and windows, and install security systems in marketplace stores (and some homes). In an ideal world, we would need only a simple toggle switch to start our cars, not a key, and the doors to our homes would not need locks (unless to keep small children from running out into the street, etc). But, we don't live in an ideal world. Such is life.
*/

There's also the issue of scale. Stealing your car is a far cry from someone rooting through your games directory and sneaking a peak at a special reward graphic.

Ultimately it comes down to, "does it really matter?" Is the coding effort offset by the need to keep that graphic locked up? In most cases, you'll probably find the answer is "no" if you're really being honest with yourself.


DH(Posted 2003) [#31]
Personally, I have had this same idea a while back. It wasn't really intended to protect hard work from theft, but more to solve what cyberseth was talking about, where during a load, and some levels take 18 seconds, i would like to re-assure the user that the machine hasn't locked:)

Also, there is tons of config data i keep inside of files, configs for levels, characters, etc.. This allows me to maintain portability to other programs that i create. Some of this info is sensitive in nature (as in, if someone were to alter it, they could alter the way the game is played IE Cheating).


Eric Shefferman(Posted 2003) [#32]
The flip side of this protection issue is that other asset of yours -- your game itself.

Someone could just replace your graphics and use your code as their game. Quick. Simple. Saves a lot of programming effort.

This would obviously be easier for a 2D game than a 3D game. (Though from reading these boards there seem to be enough 3D programmers who understand what they are doing enough to do this on a 3D game.)

Simple Example: Make a copy of Mario Bros. side-scroller type game with the character graphics and background tiles replaced. If you looked at each graphic in a separate file (as Blitz intends you to put them) it would be fairly easy to redraw each differently while still having the graphic work exactly the same in the game (a floor piece would still be a floor, just drawn differently). Now you'd have a new game for the effort of redrawing some sprites -- and it would not be very obvious that the program itself was swiped.
Simpler Example: Replace the checker, checkerboard, and title screen graphics from a checkers game and you've made a "new" game.

Would that really matter? I think it might.

The graphics need some protection from being separated from the software and the software needs some protection from being separated from the graphics. Both program and art are your assets. Both took time and effort to create.


Warren(Posted 2003) [#33]
Have you guys ever modded a game? Hacked around with Doom, replacing textures? Made Quake levels?

Where would some of us be today if id had decided to encrpyt/hide everything from us?

Think it over ...


Michael Reitzenstein(Posted 2003) [#34]
And where would Half Life be today if Valve had not encouraged modders? Half Life alone would have never become the #1 multiplayer game played on the net currently.


popcade(Posted 2003) [#35]
Uh....There's a post-compile-exe-packer called MoleBox can pack the files into sigle package, it works with Blitz.

I remember it's called MoleBox at http://www.molebox.com
But it modifies the exe so it's not a perfect solution either....


Skitchy(Posted 2003) [#36]
Not everybody here is trying to write Half-Life. ;)

Why is there so much resistance to the idea of protected data? No offence, but it's my business if I want to encrypt my data, and my choice not to want other people to get their grubby hands on my hard work.

That MoleBox thing looks good - I'm gonna give it a try


Sir Gak(Posted 2003) [#37]
I'm with you, Skitchy. If I put effort to creating my data, why should somebody else just waltz in and steal it?


Eric Shefferman(Posted 2003) [#38]
"Where would some of us be today if id had decided to encrpyt/hide everything from us? "

id also has pretty specific licensing details on their web site as to what & how you are allowed to use/license their technology. They make it very clear what they are giving away and what they aren't giving away.

It is also fairly clear (based on their commercial success) that they have plenty of money & lawyers to prevent anyone from swiping their intellectual property. See their license info (copied below).

In real life, I can't afford a security guard, cameras, dogs, etc. to protect my house. So I do the prudent thing -- I lock my front door when I go out.

Similarly: since I can't really afford to protect my game from poachers by hiring lawyers -- I'd like to at least do the programming equivalent of locking the door. While that may not stop everyone, it does let the honest folks know what their boundaries are.

That's why I think it is important to protect both art and code assets.

I've read posts on other boards from programmers who've submitted their game to unscrupulous publishers who took the game and published it with different art assets. While I don't think the correct attitude is to blame the victim, for myself I'd rather take some simple basic steps to protect myself.

One final thought as an example: One of my current programming tasks is writing promotional screensavers for other products I produce. While I want the artwork to appear on the user's screen, I don't want them to be able to access it directly. I also don't want to be fillng their hard drive with tons of files just for a single screensaver.

Thanks for the molebox suggestion! It looks like it is worth trying -- the author seems to fully understand the nature of the problem. There's a downloadable demo to try for anyone interested.

---

Example license text from id's website. I'm confident that they are well able to enforce it.:

LIMITED USE SOFTWARE LICENSE AGREEMENT or What You Can and Cannot Do With the Full Version of Quake III Arena.

CAN DO:
-- Play & enjoy the single player game;
-- Setup a full version based server on a not-for-profit basis;
-- Develop new levels and/or level creation utilities; and
-- Play the game and/or setup a full version based server using
a user-developed level.

CANNOT DO:
-- Commercially exploit the full version of Quake III Arena in any way;
see Commercial Exploitation License info below;
-- Commercially exploit any id copyrighted, trademarked or other property
Example: Game names, logos, game graphics, etc.; or
-- Sell user-developed levels and/or tools.


Skitchy(Posted 2003) [#39]
Molebox is good if a little pricey (~£50).

A little tip for anybody trying it :- it doesn't seem to like it if your code changes the directory to load something. Its easily work-aroundable by specifying the path instead of switching the dir eg. LoadMesh("meshes\thing.x") is okay but ChangeDir(meshes) isn't. Bit annoying, but I think this also allows you to access external media NOT wrapped up in the exe (so you could give the user access to some things and not others). ChangeDir() essentially breaks out of the encrypted exe back to the working directory. Good stuff.


_PJ_(Posted 2003) [#40]
Isnt there a Packer utility in code archives just for this sort of thing?

--------

I steal models and textures all the time to make sure my games work before I spend the time and effort on the media. Its not such a bad thing.


maverick(Posted 2003) [#41]
There`s one use for bank to res i can think of that i need.

I have ID3V2 tags with image data in the from of a PNG embeded into the MP3 ,, I would like to be able to copy the PNG data chunk from outta the tag into a bank and the just say ,, right the contents of that bank are an image something like

albumpic=Createbank(datasize)

***
bit of code to copy the PNG data to the bank here
***

actualpic=loadimage(albumpic)


Nowt to do with hiding any assets ,, mainly gettin assests that are already there embeded into a file, then i`ll be able to display my pretty embeded album covers :-)

Only other way i can thing of is to copy the data to a file named albumpic.PNG then load it back ,, but thats messy ,, plus it might cause glitches in playback due to disk access.




ALLLSOOOOO
What if you want to bundle different data types together just for neatness sakes ,,, say a JPG of a charicter ,, all the charicters attributes ,, a little story about him ,, maybe a set of samples applicable only to him ,, all in one file

Sure would be a lot easier having all the graphivs sounds and whatnot of a char bundled together ,, extraspecially if there`s a lot of charicters in a game , instaed of goin SH1T where did i put that sample (as always happens while developin) :-)

Just thoughts if anyone comes up with a way ,, post it up ,, as it would make my player complete


Pepsi(Posted 2003) [#42]
I love threads like this! I had "restarted" a thread to "load media from memory" not to long ago when we still had the feature request forum. I should dredge it up. So far, I hadn't heard anything to convice me that blitz should not have this needed functionality. I would seriously love to have my own zipped up game pack and load in needed media "directly" into memory without going the "save-to-harddisk-load-from-harddisk-delete-from-harddisk-for-each-media" way.


maverick(Posted 2003) [#43]
Yup ,, Do you remember AMOS on the amiga by frechie lionett
Now that was a great way to do it. if you wanted the rescourses embeded you could just load them to a bank ,, if you wanted them as a file ,, you could load them from a file at runtime .. he he great stuff
single file demos and games ,, none of this zipping and install sheild malarkie.

Seems to me a lot of things that the amiga had right have gone t1ts up on the pc

It`s like these COMM components ,, all this CLSID stuff complicating things. The idea being as far as i can gather is so you don`t call the wrong version of the same DLL ,,, why not just change it`s bloody name ,, problem solved call premium search ,, sheesh

I was looking on how to call COMMponents in C ((not that i`m any good at C) but it takes about 3 pages of code where it`ll only take one with a standard DLL

Register this fudge that ,,, no wonder half the software out there is bugged up to foosh :-)

Mind all this ranting don`t solve mt ID3V2 APIC tag problem *cry`s* suppose i`ll just have to fudge it PC style *wink*


Perturbatio(Posted 2003) [#44]

Do you remember AMOS on the amiga by frechie lionett



That would be Francois Lionet. :)


Mustang(Posted 2003) [#45]
Have you guys ever modded a game? Hacked around with Doom, replacing textures? Made Quake levels?


Of course.. that's the reason I want to protect my game media - there are LOADS of ppl out there who like to mod other ppl games... and I don't like that idea. My game is my game, and it should stay the way I "meant it to be played" ;)