compression question,. and a env. shader demo.

All topics about ZGameEditor goes here.

Moderator: Moderators

Post Reply
User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

compression question,. and a env. shader demo.

Post by jph_wacheski »

Here is another little demo,. it uses an environment shader, and some funky techniques to create some interesting visuals. imho. press space to cycle the 3 'modes'. the first on is the most interesting to me,. may become a background for some SHMUP,.

The questions are about the optimal ZGE external bitmap and sound compresion,. here I have imported a 512X512 photo that I indexed at 256 colors in the gimp, then saved as a gif,. the file was 197k I tried a jpeg as well that file was 73k however ZGE uses full size of for a bitmap right? come to 786k here ~512^2*32(?) Then the only compresion it gets is from krunchy, (if that is what is used) and similar for the sound,. .raw is raw so the loop is 438k in the file,. krunchy does a good job of reducing this all to a 280k .exe what I am wondering is if anyone knows what is the most efficent format to use before importing the files. otherwise I will just experiment, but if one of you alread has i can learn from you.

also the decompresion when opening the .exe happens right away,. not sure this is under our control, or just down to krunchy,. but if the file was much larger a progress bar of the decompresion would be a good idea as the appearence is as though the .exe had failed,. due to no actual feedback for good chunk of seconds. I actually ran it twice thinking so!

with the raw 'music' loop (this is basicly another experiment as is this whole thing),. one issue I ran into is that to loop the sample I just put as many seconds as I want,. perhaps to loop endlessly we could use -1 ?? this may require a SoundStop component,. ? I'll do some more hack-testing,. . cheers.
Attachments
photoAnim_006.zip
.exe demo
(280.29 KiB) Downloaded 465 times
iterationGAMES.com
User avatar
VilleK
Site Admin
Posts: 2280
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

Real-life sampled data (photos and sampled audio) is a pain to compress with general loss-less algorithms that the exe-compressors use. The optimal way is to compress photos as jpg and audio as mp3, but then ZGE would need built in mp3/jpg decoders in the runtime engine which requires quite a lot of space. An option would be that the engine call functions in the OS but that would make ZGE more OS-specific. I've tried to keep the OS-dependencies to a minimum, I see no reason why a ZGE-exe would not work on Windows 95/98 for instance.

You are right in that both audio and bitmaps are stored in ZGE-files uncompressed. So it is fully dependent on the performance of the exe-compressor. The only generic advice I can give is to try to reduce colors even more and import as gif or bmp instead of jpg. For audio reduce the quality 8khz or less, disguise the quality loss by playing it back with filtering on.

Btw, the demo looks and sounds real nice!
User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

Post by jph_wacheski »

cool,.thnaks ville that is about what I thought,. I may try to develop my skills with procedural bitmap creation to include some more painterly type tecniques so I can create some 'scene' type stuff for enviro maps,. thereby forgoing the photos,. however I will likely do some form of photo based game soon as photography is something I do enjoy,. and I have loads of macro type shots lying around that I think make great backdrops,. as this one.

Am I correct in my assumption that it is kkrunchy that produces that longish pause on execution and therefor a 'decompression' bar is out of our hands?
iterationGAMES.com
User avatar
VilleK
Site Admin
Posts: 2280
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

Yes, I just came back here because I realized I forgot to answer that part of your question. The pause is the decompressor. To prove it try running a uncompressed exe, there should be no pause. The documentation for kkrunchy does not mention a feature for displaying a progress bar so let's hope that will appear in a later version. Meanwhile you can try compress with less agressive kkrunchy settings, or use upx which generally will decompress faster.
Attachments
a pic of your demo
a pic of your demo
photoanim.jpg (132.06 KiB) Viewed 7409 times
kattle87
Posts: 402
Joined: Wed Sep 26, 2007 9:06 am
Location: Italy

Post by kattle87 »

Man that's COOL :D really nice work JPH! And i suggest you try with UPX since it is able to use a more "general" compression algorithm more suitable for bitmaps.

And yes, expect some tricks for procedural gen of bitmaps ;) I just created this yesterday evening :)
Attachments
Very simple procedural bricks to explain some usefull tricks
Very simple procedural bricks to explain some usefull tricks
bricks.jpg (9.93 KiB) Viewed 7404 times
In the fall of 1972 President Nixon announced that the rate of increase of inflation was decreasing. This was the first time a sitting president used the third derivative to advance his case for reelection.
-=Hugo Rossi=-
User avatar
jph_wacheski
Posts: 1005
Joined: Sat Feb 16, 2008 8:10 pm
Location: Canada
Contact:

Post by jph_wacheski »

very nice kattle,. I was just wundering about finding more ways to do self tileing textures,. brick walls are allways a good idea!
I would really like to see some way to tile noise,. not sure it could be done with the noise we have now,. well I for one have no idea how anyway,. that is one thing that other procedural texture gen. systems have over ZGE,. but I am sure its just a matter of time till some equations emerge. math can't hide forever,. its just logic right.

thanks for the tip,. i indeed will try UPX for my photo game,.
iterationGAMES.com
Post Reply