Come to think of it. You could take my example of the 255 flags into one byte as a methode to compress the flags. For 255 flags you could store 1 flag set in 1 byte, 3 flags set in 2 bytes, 7 flags set in 3 bytes, etc. Of course you'll need some bytes for header information added to this. This would be compression, and compression isn't something that is specific for flags but something that can be done on any kind of data. If the data is small it would be expanded instead of compressed becouse some bytes of header data are needed. For accessing the data it needs to be decompresses and if it's changed it needs to be compressed again after that. The amount of space needed for the compressed data isn't fixed. It could be even longer then the uncompressed data in some cases. Compression methods can be better if they make use off all information you got about the data. Like, mostly only a few bits are set or the bits that are set are mostly on a row and things like that. My conclusion of this is that compression can't be used for the compression of the flags in circle. On the other hand I can think of ideas where it could be used. Like a big bitvector for characters containing flags for every room on the mud which are set when they are explored. Such a bitvector would contain more than 1000 flags and could be succesfuly compressed. (But even then it would be a good idea to keep the data decompressed for the zone the character is in) Jaco
This archive was generated by hypermail 2b30 : 12/07/00 PST