custom (possibly compressed) resource files
anyone know where i can find some information or code on how to implement your own resource file format with internal directories and such, and possibly some compression algorithms. if i have to, i''ll use LZS compression, but i''m most concerned with putting all of my artwork and sounds into one big file so people can''t modify them (or steal them!) and screw up my game.
thanks for any info...
david
--david@neonstar.netneonstar entertainment
I''ve recently made a really simple VB app to compile files into a data file (I even tried implementing Huffman coding but as the compression ratio was crap I''ve left it out).
All you need to do is append all the files together, then at the very end of the resource file, write a FAT, with the filenames and their positions in the file.
If you''re thinking of using compression simply as a securiy measure then there is an easier way. Simply invert all the bits of the file in some pre-defined way as you write them to the resource, then your re-load code will have to do the opposite. That way, if someone does read the resource file and extract ATEXTURE.BMP, they won''t be able to double click it and see it mspaint .
On the other hand, if you want to use compression to save the users HD space then you deserve an award for being nice! You can try searching for zlib or gzip, freeware zipper''s. (I''ve got them but still scrathing my head over them really - I''ve got better things to do!)
You''re quite welcome to my VB compiler (and code). It''s not nice but it works!
Cheers
Matt
Check out my project at:www.btinternet.com/~Matthew.Bennett
All you need to do is append all the files together, then at the very end of the resource file, write a FAT, with the filenames and their positions in the file.
If you''re thinking of using compression simply as a securiy measure then there is an easier way. Simply invert all the bits of the file in some pre-defined way as you write them to the resource, then your re-load code will have to do the opposite. That way, if someone does read the resource file and extract ATEXTURE.BMP, they won''t be able to double click it and see it mspaint .
On the other hand, if you want to use compression to save the users HD space then you deserve an award for being nice! You can try searching for zlib or gzip, freeware zipper''s. (I''ve got them but still scrathing my head over them really - I''ve got better things to do!)
You''re quite welcome to my VB compiler (and code). It''s not nice but it works!
Cheers
Matt
Check out my project at:www.btinternet.com/~Matthew.Bennett
Hey Matt,
Aside from the resource stuff, i looked at your Joy Rider screenshots first and all i could say is WOW! You do your levels in AutoCAD? does that work well for them? how are you loading the AutoCAD files? Sorry for the barrage of questions, but cool 3D stuff like that always gets my attention because I really haven''t delved into that side of the cookie yet...
Thanks for the info!
David
--david@neonstar.netneonstar entertainment
quote: Original post by neonstar
Hey Matt,
Aside from the resource stuff, i looked at your Joy Rider screenshots first and all i could say is WOW! You do your levels in AutoCAD? does that work well for them? how are you loading the AutoCAD files? Sorry for the barrage of questions, but cool 3D stuff like that always gets my attention because I really haven't delved into that side of the cookie yet...
Thanks for the info!
David
I don't know where Matt found a description of the AutoCAD file format, but there are descriptions of Autocad files at Wotsit.org. And btw Matt, could you fix your homepage so it works in Netscape too? The links on the left won't work because of the java-script.
/. Muzzafarath
Mad House Software
Edited by - Muzzafarath on June 19, 2000 4:52:33 PM
I'm reminded of the day my daughter came in, looked over my shoulder at some Perl 4 code, and said, "What is that, swearing?" - Larry Wall
Dave-
Thanks for the comments. It has taken A LOT of work to get this far, but now the conversion apps are complete I''m in a really strong position to progress even furher.
To answer your question about reading ACAD files, I simply export it as a dxf, which is a text file, then pick out the bits I need and ignore everything else.
I''ve found it works really well for me. It allows me to be quite accurate in setting things like the width of the roads and the heights of the kerbs and stuff, plus it gives me a good visual idea of what I''m creating. Exporting into the game takes less than a minute too.
Like I said in another post, I don''t find Acad very creative so it''ll be difficult to make sure I don''t make really square looking cities. Anyway I''m already toying with the idea of creating some algorithms that modify and tweak the map. I was thinking of implementing a height-shifting algo so that I can model the city flat, and have it put all the hills and valleys in - with a little ''guidance'' from me that is.
Later
Matt
Check out my project at:www.btinternet.com/~Matthew.Bennett
Thanks for the comments. It has taken A LOT of work to get this far, but now the conversion apps are complete I''m in a really strong position to progress even furher.
To answer your question about reading ACAD files, I simply export it as a dxf, which is a text file, then pick out the bits I need and ignore everything else.
I''ve found it works really well for me. It allows me to be quite accurate in setting things like the width of the roads and the heights of the kerbs and stuff, plus it gives me a good visual idea of what I''m creating. Exporting into the game takes less than a minute too.
Like I said in another post, I don''t find Acad very creative so it''ll be difficult to make sure I don''t make really square looking cities. Anyway I''m already toying with the idea of creating some algorithms that modify and tweak the map. I was thinking of implementing a height-shifting algo so that I can model the city flat, and have it put all the hills and valleys in - with a little ''guidance'' from me that is.
Later
Matt
Check out my project at:www.btinternet.com/~Matthew.Bennett
Muzzafarath-
You''re the first person to point this problem out to me!
Thats just me showing my ignorance and just sticking to IE.
I''ll sort it ASAP.
Matt
Check out my project at:www.btinternet.com/~Matthew.Bennett
You''re the first person to point this problem out to me!
Thats just me showing my ignorance and just sticking to IE.
I''ll sort it ASAP.
Matt
Check out my project at:www.btinternet.com/~Matthew.Bennett
good idea matt!
maybe you can write your own level editor and save you the ''picking'' trouble....
;-)
david
maybe you can write your own level editor and save you the ''picking'' trouble....
;-)
david
--david@neonstar.netneonstar entertainment
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement