Do you know how Windows exe files are constructed or LaserTank lvl
files? I don't know how exe files are made, but I do know about the
level file.
Each level goes like this: first the map of the level, then the
title, then the hint, then the author, then the difficulty rating. So
we need to put the number of layers somewhere in there. If the number
of layers is variable, then we need to specify this for each level.
The only place is right at the beginning. But the old files don't
have this feature. So, we can say, "if this byte is $ff, the next
byte holds the number of layers." If it isn't it is the beginning of
the map.
This creates more problems. Each level in the file takes 576 bytes.
So to get to any one level we go to the 576*number byte. Having
layers changes this. So, to go to, say, level 1234, we look at level
1, work out from the layers how long this is, go to level 2, work out
its length, and so on to level 1234. You suggested compression
techniques. RLE or similar will complicate this process farther. Not
that this is wrong, just difficult.
I think the best way would be to have an array at the beginning of
the file storing the starting location of each level. And, layer
limitation is for sure a good thing! Otherwise, we'll likely start
seeing some 1 billion move levels. (This greatly overflows the limit
of 65,535 recording steps, but doesn't matter much , since it would
take months to record anyway.) It also is not at all hard to do.
Now, I am puzzled by the idea of using WinZip to zip up level files.
It would have to be unzipped each time it was used. Might as well
leave it unzipped.
However, remember that Jim is the one that will decide all these
things.
--- In Lasertank@y..., "MrDoomMaster" <mrdoommaster@h...> wrote:
> About compatibility, I doubt that lasertank wouldn't be able to
play old
> levels. Take Microsoft windows for example: If you run a program
made for
> windows 3.x on windows 9x, it would work! no, the program wouldn't
be able
> to use any of windows 9x's features, but it will run just like it
would on
> windows 3.x!
>
> And about the file size... you make it sound as it there is NO way
to make
> the levels any smaller, so here is some idea's I've thought of:
>
> Compression: If this is possible, you might be able to decrease
size of
> level files greatly. Perhaps lasertank could come with a built in
> compression tool? All of this IS possible in my eyes. Even if
lasertank
> couldn't compress level files with layers (which I don't agree
with), people
> can always count on separate compression tools like WinZip to
compress their
> layered levels.
>
> Format: This is almost very similar to compression. Changing format
of the
> level files could also change file size. Take audio files for
example. A
> single audio track on an Audio CD can have up to 40 MB!!! BUT...
when the
> format is converted to MP3, you save approximately 36 MB of file
size,
> making the audio file about 4 MB! This is also VERY possible.
>
> Layer Limitation: If none of the above are agreeable (this doesn't
include
> possibility), then limiting the number of layers in a level to
maybe 2 could
> be a last resort on conserving file space. Although this is very
possible
> also, I disagree with this because of what you said about the over
1000
> levels packed into one level file.
>
> Yes, I realize although all of these are possible, a great deal of
work is
> involved in creating what I have mentioned. But if people get lazy
then
> lasertank will not be able to keep up with technology! Perhaps
minds will
> change.
> _____________________________
> --MrDoomMaster