English Amiga Board

Go Back   English Amiga Board > Coders > Coders. General

Thread Tools
Old 01 August 2010, 01:20   #1

Djay's Avatar
Join Date: May 2001
Location: Founders System
Age: 43
Posts: 3,089
Send a message via MSN to Djay
Would this save disk space?

if i were to design a program that reads in the colours of an iff and then store it as a data file, another program decodes the data file and displays the image again

i could draw the image to a back buffer, grab sprites (because i know the grid co-ords etc) and then use them

the second program and the data file is all that is stored on the disk

i hope this makes sense to someone
Djay is offline  
Old 01 August 2010, 01:34   #2
Global Moderator

prowler's Avatar
Join Date: Aug 2008
Location: Sidcup, England
Posts: 10,300
Would this save disk space?

I'm not sure that it would.

I'm no coder, but I am in the process of recovering Glen Cumming's Amiga coding history for preservation from floppy disks (Glen is one of the programmers of the Alien Bash games), and there is a program on those disks which they wrote called an iff converter, which does much the same thing as you describe, but the data files it produces (Define Constant Word statements) are larger than the .iff files!

Or did you have something else in mind for the data format?

Edit: I've just realized that this iff converter was probably designed to produce source code to fully define the original .iff file and allow it to be recreated. That's probably a lot more data than you would require.

Last edited by prowler; 01 August 2010 at 01:59.
prowler is offline  
Old 01 August 2010, 02:36   #3

Djay's Avatar
Join Date: May 2001
Location: Founders System
Age: 43
Posts: 3,089
Send a message via MSN to Djay
my thinking is to draw an iff in dpaint, mainly sprites
then write a program which will read in the colours of the pixels in a grid
allow one colour for a mask
write the pixel colours to a text string (define an array), along with size
write all the data for each sprite to one text file

then write another program, which reads in the text strings from the text file
draw the data to a back buffer
grab the sprites, using the grid co-ords
use the sprites


i get exactly what your saying prowler, and to be honest i am not so sure how much data saving this will actually give... i am sure that this procedure would of be used already if it had been successful.. probably by demo groups as they need to squeeze every last kb out of a disk
Djay is offline  
Old 01 August 2010, 04:44   #4
Join Date: Jul 2008
Location: Sweden
Posts: 2,248
I'm not sure I understand you correctly, but if you're looking for an efficient way of storing your graphics data and saving disk space at the same time, then you want to store it in raw format for immediate use and then use some file compression, either for the graphics files or just include the graphics in your executable if you know it will all fit in the RAM of your target machine, and then compress the whole executable.

I can write up a simple example if this is what you want, or maybe you can clarify what it is you want to do.
Leffmann is offline  
Old 03 August 2010, 00:00   #5

Photon's Avatar
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 4,651
DJay, you;re looking for a way to 'pluck' sprites/bobs/blocks from a DPaint pic, spacing them out to a regular grid independent of sprite-size, I think? To save conversion to raw and cutting them out by hand, I guess. And then the dpaint pic would be a little larger. But it could be automatically cut out by the game and you could update the graphics and see how they look immediately. Is that about right?

But the iff format has compression, so that wouldn't be super-bad.

It always pays off to prepare raw-gfx and crunch with something better than RLE (iff).

If you want it automated the simplest way is to reserve 1 color for "pseudo background" which you set to the same color as the first color in the palette. That way the gfx artist doesn't have to make masks manually and fill in holes where it should use "color00" but still mask - for example 1px outlines or pupils of eyes etc. He just draws outlines using another color and the maskgenerator makes correct masks and replaces the other color with color00.

Then you just cut out the sprites and make a tall pic which is as wide as the widest sprite and put them in one column with 1px space between them - then it can find width (by shrinkwrapping),height, and centerpoint if you need such adjustments instead of topleft corner. (By centering the sprites in the column.)

But if the sprites are tall (I think they are... ) then you won't fit many in 1024 height. If you make an intelligent search-algorithm you can still cut them out and maybe number them correctly even if they are randomly put out, as long as there is 1px+ space between them. But you can't auto-generate "shrinkwrapped sprites with offset from center".

Anyway, "interpreting" an iff pic and generating raw shrinkwrapped sprites+spritedata saves more time than typing text files and go the other way... seems quicker to cut out each sprite->raw than to write down coordinates or so.

Maskgenerator+color-replace-to-color00 could be done after the sprites are loaded, then you would save 1 bitplane on each sprite.

Replace sprite with bob where applicable. :P

Maybe throw all sprites and stuff them tightly together in dpaint+iffconverter+maskgenerator in the game? Then a file with cut-out coordinates would work, and the file would be pretty small... you have to change the coords if you move a sprite to make room, of course.

rantalainen... but anyway hope one of the ideas looks attractive.
Photon is online now  

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Space Crusade and expansion disk HonoredShadow support.Games 7 26 August 2013 00:30
Space Quest III - save game issue - WHDLoad dJOS support.Games 7 18 October 2012 02:45
Balkanski Konflikt, Save the Earth & Space Checkers tomcat666 request.Old Rare Games 10 04 March 2009 10:46
Trained save game or kick-butt RPG party save disk for Pool of Raidiance 7-Zark-7 request.Old Rare Games 1 16 June 2003 01:51

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +2. The time now is 17:20.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Page generated in 0.11418 seconds with 13 queries