• Welcome to Zoo Tycoon Community Download Directory.
 

How does one create a ".pal" file?

Started by johnrn1, August 11, 2010, 11:26:18 PM

0 Members and 1 Guest are viewing this topic.

fern

Quote from: Jeff on May 14, 2015, 05:47:45 AM
I was just thinking that one small feature is missing from the batch conversions from PNG to ZT1, and that is something which technically has nothing to do with it. But I'm considering an option to auto-generate .ani files for folders which either contain only one graphic (think object icon, plaque) or 4 views (NE, SE, NW, SW).

The x0, y0, x1, y1... Any idea what they refer to? I vaguely remember they might be useless; but on the other hand: could this be the coordinate of the most top left pixel; and the most bottom right one?
If I remember rightly they have to do with rotation settings but Jay can explain that better. I know that I use them on a certain setting for some things.

Jay

Quote from: fernIf I remember rightly they have to do with rotation settings but Jay can explain that better. I know that I use them on a certain setting for some things.

You are probably thinking of ZT image offsets, which are inside ZT image files and Zoot shows.


Quote from: JeffI was just thinking that one small feature is missing from the batch conversions from PNG to ZT1, and that is something which technically has nothing to do with it. But I'm considering an option to auto-generate .ani files for folders which either contain only one graphic (think object icon, plaque) or 4 views (NE, SE, NW, SW).

The x0, y0, x1, y1... Any idea what they refer to? I vaguely remember they might be useless; but on the other hand: could this be the coordinate of the most top left pixel; and the most bottom right one?

ZT image files and ".ani" are used for many purposes: objects in zoos (including animals, guests, staff, paths, fences, and terrain in addition to other objects), icons (purchase menus; sold items; research; programs; animal, guest, and staff lists), plaques, maps, UI elements. So I do not know if they work differently for the different purposes. For sold items, before having Zoot, I would change the y0 and y1 values to get the sold items positioned properly in the building and guest inventories. But then I found that only worked in the original ZT and not the ZT expansions. So those values should always be set to specific values for plaques, maps, paths, and most icons:
plaques: x0 = -89; y0 = -97; x1 = 90; y1 = 97
maps: x0 = -183; y0 = -136; x1 = 184; y1 = 140
paths: x0 = -32; y0 = -25; x1 = 32; y1 = 24
purchase menu icons: x0 = -22; y0 = -16; x1 = 22; y1 = 16
sold item icons: x0 = -17; y0 = -17; x1 = 17; y1 = 17

Research have large icons and small icons, since there are 2 locations they are shown.
large research icons: x0 = -22; y0 = -16; x1 = 22; y1 = 16
small research icons: x0 = -17; y0 = -16; x1 = 17; y1 = 16

The values are probably not used for objects in zoos and possibly not used for the animal/guest/staff lists. When APE creates a new animal or object from a ZT animal or object, it copies the values from the animal or object used as a base. When a designer then loads their images into APE, APE does not adjust the original values. So that leads me to believe the values are not used. When I previously looked at what these values represented, they appeared to be the spot on the ground beneath the object's center of gravity. Here are the notes I previously created:

'The x0,y0 in ".ani" files appears to be the location of the center point touching the ground for the largest image, though with minus signs in front of the numbers. When there is a choice, use the point that you get to first along the bottom edge from the left. x1 = image width + x0. y1 = image height + y0. The image width and height might be for the canvas rather than the actual image.'

Zoot does not create or update ".ani" files.

fern

I was thinking about what you described which is why I said I use certain settings which is why I left it to you to use the correct wording.  :tongueout

Jeff

#108
Thanks, seems my assumption was right.

Although I don't see the point yet of those offsets in the .ani-file, since that could be determined by the graphic. Perhaps it has something to do with the way they created these graphics.

I'll see if I can add a basic feature to generate these files. For a 1 view graphic (e.g. icon), it makes sense. But if you consider that there's  1 .ani file per animation, for 4 views... it doesn't make much sense unless it generates the largest required canvas size to render all views, and still...

Jeff

For a very first, a bit unpolished but presumably quite stable build: topic at Zoo Tek Phoenix

I quickly released it as it is, otherwise I'll just keep postponing it, and feedback may be useful. I've also included a very large document, it's definitely not a read-me. It's also a work in progress, but I've tried to write down most information about ZT1 Graphics in basic English. It also contains general instructions on how I've created my Umbrella table with ZT Studio, and what you have to think of when creating such an object.

More polishing to come.

dr rick

Dr Rick<br /><br />How does that work?

Jeff

Working on a small update which will fix some small bugs.

I'm also hoping to introduce the automatic creation of .ani-files, which should be the final step in making sure you never need APE (or Zoot) again for graphic stuff.

I have two questions though. Jay, you listed the types and their image size. I think, for generating the .ani-files, I'll start from the graphics. I'm sort of assuming/hoping users would start from an existing template anyway, rather than completely from scratch.

How many different situations do we have when it comes to a "view" or whatever you want to call it? I've spotted these:
* NE, NW, SE, SW  ( most static objects etc )
* NE, N, SE, S, E  ( moving, e.g. staff , guests, animals )
* 1, 2, 3, ... 20 ( paths )
* N  ( icons, plaques etc )
Are there any other?

Jay, you mentioned that the coordinates don't seem to matter that much, especially for the moving creatures.
Any idea what they would be based on? For the icon cases, it's simple, it's only one "view". But for objects and moving creatures, there are 4/5 views to choose from. Would the coordinates simply be determined by the most relevant offsets and height/width from all these views combined?

Jay

For the view names, the ones you listed are certainly the most common ones. Sometimes unique view names are used for a folder with a single view in it. For example, the dust cloud (objects/dustcld/idle in global.ztd) uses the view name "dust". Sometimes an object has more views than are configured in the ".ani". For example, the biplane (animals/biplane/m/idle in animals.ztd) has E, N, NE, NW, S, SE, and SW views, but the idle.ani only lists NE, SE, and SW, and NW. Many of the user interface images (such as those in ui.ztd) use a different set of 4 view names: N, H, S, and G. When a user made object is made that looks the same in all 4 views, sometimes we just create a SE view and list SE 4 times in the ".ani". When a user made object is made that looks the same in the rear views as the front views, sometimes we just create the SE and SW views, and add SE and SW twice in the ".ani". Some user made paths use 01, 02, 03, ... 20 and some user made paths use 0001, 0002, 0003, ... 0020. But those were because they did not have tools like Zoot at the time. Some user made paths use the same image for multiple views. Sometimes in those cases there will be fewer than 20 views and there will be duplicate entries in the ".ani". Of course, APE does not support paths, fences, or user interface elements and it does not look for duplicate images. So we handled these various situations manually in the past.

For the coordinates, I mentioned what the settings should be for icons, paths, plaques, and maps. For other things, they are based on all frames of all views within the folder. So you could look for the widest frame of all views in the folder for the x0/x1 coordinates and the tallest frame of all views in the folder for the y0/y1 coordinates. Technically the coordinates could be slightly more than this, but this would be close enough.

Jeff

#113
Thanks, this should be quite helpful.

I think I'll only have the tool create the .ani-files in those more default cases. One could consider "dust" or the UI elements, but they're so rare in user created downloads. In those cases, I'd still refer to the manual editing. The seagull seems quite strange. Maybe it was simply one of the very first items, and the .ani-file is a leftover from an editor Blue Fang used or something.

You bring up a good point as well about duplicate views. Obviously, unless you ask for user input for each single item (which might be very annoying in batch conversions), the program currently can't detect identical views (*). So in documentation, I'd advise users to stick to the few defaults I mentioned. If not, they'll simply have to create the .ani-files themselves.

The coordinates will be slightly more difficult than I initially assumed, but it can be done. I'll figure out a way for the best optimization.


* : if it gets further developed, I wanted to add some feature anyhow to combine .pal-files - where possible. For identical views/images, this would result in an identical file content. Once this get spotted, it could also adjust the .ani-file (and clean up unnecessary views). It's way too late, but if this had been implemented from the beginning in let's say APE, I think it would have been ideal: certain downloads would be quite less in file size (not only better for users with slow connections, but also for people hosting content) and most likely it would be better for ZT1 performance as well.

Jeff

#114
 
* Still requires Microsoft .NET Framework 4.5

* minor fixes
* new lay-out for the settings window, settings slightly changed (their naming should stay what it is now)
* ZT1 Graphics load lots faster - because I managed to bring down the time it takes to show the color palette on the side bar a lot!
* experimental: creation of .ani file when a ZT1 Graphic is written (if this causes issues, just disable the option. I only did a quick test with "bamboo" so far)
* updated documentation
* ...

dr rick

thank you! I will try and test this during this week! :wub2
Dr Rick<br /><br />How does that work?

Jeff

Fixed a small regression when it comes to displaying things like the restaurant.

ZT Studio, build 2015.0625 @ DropBox

Cricket

I'm looking forward to testing this!  It will have to wait until after Tek's birthday, but then I should have some time to check it out :)

Jeff

Cool!

I've mostly been toying around with the batch conversions, so I'm mainly thinking if there are any issues, it will be small user interface issues. The build yesterday contains a late fix for the previous/next frame button and label.

Jeff

A current experimental build hooks up with GIMP (2.8).

First, there's a more general feature which allows you to import/export a .pal file from/to a .png-file (16x16 = 256 colors, the first one being your transparent color).

Next, I had vague plans in the past to allow some quick actions in GIMP which would greatly help to create one single color palette for all your frames for one graphic. That's still far from us, but for the recolor feature, I did try to integrate some basic GIMP-functionality in ZT Studio - rather than write entire graphic manipulation code like that myself.

Now, in this experimental build, I've got sliders to adjust red/blue/green/brightness/contrast and an option to pick the tones (shadows, midtones, highlights). GIMP adjusts the palette; ZT Studio generates a new preview right away :)