*Argh*: BMP ;-)

Many games only read stuff at startup, and if you arrange the files
in the correct order, compression is easy.

Some games do, but It’s not feasible for games that aren’t able to do
this. Many games don’t do this. Diablo loads them on a per level basis,
Baulders Gate has what? 6 CD’s?, Quake2 doesn’t read everything into
memory at startup either. Most of the more recent big name commercial
games just can’t read it all in on startup.

In any event, it won’t work for my game, which is really what matters
here. :slight_smile:

*dbm files would work but are a severe overkill, at least if you can do
without incremental changes. You could perhaps abuse the symbol table of
ar archives.

Thats what I thought too, but it was the first thing that came to mind
like this.

Another solution is to put everything into your binary. You don’t have to
load anything, just access it. The downside is that you have to relink
each time anything changes.

If it’s in the binary, isn’t the entire binary loaded into memory on
startup? Once again, with hundreds of megabytes of images, this won’t
work.

If it comes down to implementing this from scratch, or using single png
files, I will probably use single png files… :slight_smile:

I bet you and I could have done it in the time we’ve wasted posting to
this silly list :slight_smile:

I’d be happy to see one that allows dynamic access to image files in a
single file. I still haven’t heard of a decent solution that can do that.–
Brian

Robert Linden wrote:

I’m always puzzled at games which use several megabyte worth of
bmps. Perhaps sometimes you don’t even want to accept the tiny
losses incurred by jpg, but why not png ? PNG’s are smaller than
gzip’d bmps, and jpgs are even smaller.

Now here’s someone I can talk with :slight_smile: BTW the SDL_image library works
great. PNG all the way - and if my app should support windows or
whatever (which it shouldn’t :wink: I can convert the images and the
SDL_image lib can still handle them. Great.

And, well, are there any other reasons for compressed
data-formats besides saving space ? None that I’m aware of, yet
they seem very popular :slight_smile:

Sense.

No sensible programmer has ever done something in 2 Mb if he could do
it in 1 Mb with the same (or less) amount of trouble.

Note that as a result I think that the X bitmap stuff, where a picture
is stored in a text string (as I recall), as well as overactive use of
BMP by Windows is not at all sensible.

So if you don’t want to risk loosing your status as a good programmer,
you would make things really compact. And because everyone wants to look
like a good programmer, compressed data files are popular.

Now take the guy who advised to move large amounts of smaller datafiles
in one archive file: he wins status! I wouldn’t have thought of how
much space fs entries and partly allocated blocks would take.

…general reply: SDL_image rules. It’s going to look cool already -
remember this is my first game dev experience, so you’ll understand that
after the dull command-line and GUI-stuff (believe me, buttons and
windows aren’t as amazingly flexible as they make you think :wink: I am
astonished when I see my own cartoon image moving down the screen. So
thanks for the tips!

Greets,

Stefan

LibAsset and the VFS class in crystal space use this code to
handle ZIP archives.

Does this support dynamic access of particular files within
the archive,
without uncompressing the whole thing into memory?

that is correct. the ZIP archive code allows random access
to files within the archive so you can pull out the data
you want in any order you want.

the limitation of compressed data is that, while you can
do partial reads, you cannot easily SEEK to a particular
offset within a specific file. most compressed archives
don’t allow in-file seeks for this reason.

Markus O. has a great LZO library if you want to roll your
own compression archive. I’ve used that on a commerical
game (minigolf deluxe) with great success. LZO is optimized
to unpack VERY VERY FAST if you need to do that in real-time.
we had so much data in minigolf we had to memory map the
archive and LZO unpack it as we needed it.

here are some links:

http://www.sylvantech.com/~talin/projects/libasset.html
ftp://ftp.freesoftware.com/pub/infozip/zlib/zlib.html
http://wildsau.idv.uni-linz.ac.at/mfx/lzo.html

–Dave McClurg

Note that as a result I think that the X bitmap stuff, where a picture
is stored in a text string (as I recall), as well as overactive use of
BMP by Windows is not at all sensible.

Oh, it’s not completely nonsensical… nothing beats being able to edit a
.xpm or .bmp with vi. Thats very conveniant. The xpm library even
supports reading gzipped xpm’s as well. Ok, there are drawbacks to XPM
and other text format image files, but it has some neat advantages as
well. :slight_smile:

— Garrett Banuk wrote:

If you look at the quake games they all use a .pak file. Its not
compressed, probably because as the previous person said, you can’t
load
the while thing in mem. You can only load parts of it, so its faster
to
take stuff out of a non compressed file than a compressed on. Also
putting
all the files into one big file does save space.

At 01:32 PM 3/31/00 -0600, you wrote:

  • create a compressed version of all of the image
    files (eg, ZIP the data directory and uncompress it into memory
    somehow

during startup of the game),

Depending on the game, using .jpg’s,.png’s thrown into a zip file
really isn’t all that slow. Starting a game, opening a .zip, reading a
.jpg or .png into memory then using that as your image is not a big
deal.

Quick Point list:
-Uses less disk space (comparable BMP’s are huge).
-Is faster to read of the disk (a compressed file is smaller, thus
you need to read less).
-No munipulation is required if they are seperate .png’s/.jpg’s in
the .zip.
-Decompression algorithims are quite fast these days.=====
Jason Platt.

“In theory: theory and practice are the same.
In practice: they arn’t.”

ICQ# 1546328


Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.

— hayward at slothmud.org wrote:

LibAsset and the VFS class in crystal space use this code to
handle ZIP archives.

Does this support dynamic access of particular files within the
archive,
without uncompressing the whole thing into memory?

–Brian

Yes it is a load on demand system, you mount the .zip file via the
VFS (which reads the directory information), then you request such and
such file.

Using both zlib and libpng are very useful as they are both
distributable and very fast.=====
Jason Platt.

“In theory: theory and practice are the same.
In practice: they arn’t.”

ICQ# 1546328


Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.

If it’s in the binary, isn’t the entire binary loaded into memory on
startup? Once again, with hundreds of megabytes of images, this won’t
work.

No, only the pages you touch are loaded (I’ve been told that even Windows
does demand paging nowadays), so it should be quite efficient. And the
size doesn’t matter for the same reason. Linking a 100MB binary is another
matter, but then again, building a 100MB package file will take time in
any case.

I’d be happy to see one that allows dynamic access to image files in a
single file. I still haven’t heard of a decent solution that can do that.

In most cases, you’d have to copy the images into allocated memory in some
way (they might be compressed, you want to convert them to your video format,
etc), but if your image library can read from memory and not just from a
file, there should be no problem.

the limitation of compressed data is that, while you can
do partial reads, you cannot easily SEEK to a particular
offset within a specific file. most compressed archives
don’t allow in-file seeks for this reason.

Ok, the zip archive has to be using SEEK to a particular offset within
it’s main archive, or else it’s not really random access. It would just
be chugging along, reading over data earlier in the file, until it gets to
the header for the file you are looking for.

Markus O. has a great LZO library if you want to roll your
own compression archive. I’ve used that on a commerical
game (minigolf deluxe) with great success. LZO is optimized
to unpack VERY VERY FAST if you need to do that in real-time.
we had so much data in minigolf we had to memory map the
archive and LZO unpack it as we needed it.

here are some links:

http://www.sylvantech.com/~talin/projects/libasset.html
ftp://ftp.freesoftware.com/pub/infozip/zlib/zlib.html
http://wildsau.idv.uni-linz.ac.at/mfx/lzo.html

Thanks for the info, I had not heard of LZO, it sounds pretty good.–
Brian

Depending on the game, using .jpg’s,.png’s thrown into a zip file
really isn’t all that slow. Starting a game, opening a .zip, reading a
.jpg or .png into memory then using that as your image is not a big
deal.

Keep in mind, jpgs and pngs are already compressed. So in effect,
throwing them into a zip file you are doing double-compression, which
is twice the work.–
Brian

the limitation of compressed data is that, while you can
do partial reads, you cannot easily SEEK to a particular
offset within a specific file. most compressed archives
don’t allow in-file seeks for this reason.

Ok, the zip archive has to be using SEEK to a particular offset within
it’s main archive, or else it’s not really random access. It
would just be chugging along, reading over data earlier in the file,
until it gets to the header for the file you are looking for.

yes. the zip archive does seeks to find files but the app
cannot do IN-FILE seeks while it is processing a specific
file because each file is compressed. see what i mean?

Depending on the game, using .jpg’s,.png’s thrown into a zip file
really isn’t all that slow. Starting a game, opening a .zip, reading a
.jpg or .png into memory then using that as your image is not a big
deal.

Keep in mind, jpgs and pngs are already compressed. So in effect,
throwing them into a zip file you are doing double-compression, which
is twice the work.

What’s more, you usually only get a compression factor of about 1%, since
you can’t keep compressing compressed data forever, eventually you’ll get a
very unique chunk of information which doesn’t compress worth the damn.

And if you want to see evidence that starting a game, opening a zip, reading
a .tga or something and using that as your image isn’t slow, take a look at
the Aftershock engine. Slow as molasses, although this is largely due to
lousy code.

Brian

Cheers,

Nicholas

Nicholas Vining “While you’re out there struggling
vining at pacificcoast.net with your computer, I’m naked,
icq: 20872003 clueless, and feeling good!”
- Ratbert

----- Original Message -----
From: hayward at slothmud.org (hayward@slothmud.org)
To: sdl at lokigames.com
Date: Friday, March 31, 2000 2:58 PM
Subject: Re: [SDL] Argh: BMP :wink:

I think what he meant was seeking within a compressed file within a
archive. Most compressors that I know of ie: arc, zip, lzh, etc… save
a index of all the archived files such that you can simply seek to that
particular file within the archive without having to read through them
all.

— hayward at slothmud.org wrote:> >the limitation of compressed data is that, while you can

do partial reads, you cannot easily SEEK to a particular
offset within a specific file. most compressed archives
don’t allow in-file seeks for this reason.

Ok, the zip archive has to be using SEEK to a particular offset
within
it’s main archive, or else it’s not really random access. It would
just
be chugging along, reading over data earlier in the file, until it
gets to
the header for the file you are looking for.

Markus O. has a great LZO library if you want to roll your
own compression archive. I’ve used that on a commerical
game (minigolf deluxe) with great success. LZO is optimized
to unpack VERY VERY FAST if you need to do that in real-time.
we had so much data in minigolf we had to memory map the
archive and LZO unpack it as we needed it.

here are some links:

http://www.sylvantech.com/~talin/projects/libasset.html
ftp://ftp.freesoftware.com/pub/infozip/zlib/zlib.html
http://wildsau.idv.uni-linz.ac.at/mfx/lzo.html

Thanks for the info, I had not heard of LZO, it sounds pretty good.

Brian

=====
Jason Platt.

“In theory: theory and practice are the same.
In practice: they arn’t.”

ICQ# 1546328


Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.

— Nicholas Vining wrote:>

-----Original Message-----
From: hayward at slothmud.org
To: sdl at lokigames.com
Date: Friday, March 31, 2000 2:58 PM
Subject: Re: [SDL] Argh: BMP :wink:

Depending on the game, using .jpg’s,.png’s thrown into a zip file
really isn’t all that slow. Starting a game, opening a .zip,
reading a

.jpg or .png into memory then using that as your image is not a big
deal.

Keep in mind, jpgs and pngs are already compressed. So in effect,
throwing them into a zip file you are doing double-compression,
which
is twice the work.

What’s more, you usually only get a compression factor of about 1%,
since
you can’t keep compressing compressed data forever, eventually you’ll
get a
very unique chunk of information which doesn’t compress worth the
damn.

And if you want to see evidence that starting a game, opening a zip,
reading
a .tga or something and using that as your image isn’t slow, take a
look at
the Aftershock engine. Slow as molasses, although this is largely due
to
lousy code.

Brian

Cheers,

Nicholas

I’ve seen others… Namely CrystalSpace that do the above quite
quickly, as a added bonus you can add other data files to the archive
without a mess of individual files or a complex method of seweing them
all together.

=====
Jason Platt.

“In theory: theory and practice are the same.
In practice: they arn’t.”

ICQ# 1546328


Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.

hi there,

could anyone post a step-by-step instruction how to compile the
SDLnetlib with Visual C++ 5.0 ? (and where to copy the netlib.lib and
how to include it in a project to use it …).
it seems I am too newbie to build it on my own ;>

wolfgang

In my project Arianne RPG , I use SDLNetlib with Visual C++.
I think that there should be a compiled version of the library inside,
also the IDE files.

http://come.to/arianne_rpg

See you.

wb at cafecom.de escribi?:> hi there,

could anyone post a step-by-step instruction how to compile the
SDLnetlib with Visual C++ 5.0 ? (and where to copy the netlib.lib and
how to include it in a project to use it …).
it seems I am too newbie to build it on my own ;>

wolfgang

wsock32.lib was missing :wink: thnx!On 3 Apr, x5101920 at fedro.ugr.es wrote:

In my project Arianne RPG , I use SDLNetlib with Visual C++.
I think that there should be a compiled version of the library inside,
also the IDE files.

http://come.to/arianne_rpg

Mensaje citado por: wb at cafecom.de:

It is in the visual C libs directory

In my project Arianne RPG , I use SDLNetlib with Visual C++.
I think that there should be a compiled version of the library
inside,> On 3 Apr, x5101920 at fedro.ugr.es wrote:

also the IDE files.

http://come.to/arianne_rpg

wsock32.lib was missing :wink: thnx!