• 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 2 Guests are viewing this topic.

dr rick

Sounds like it is nearly there Jeff!  :eggyes :praise2

I've been thinking about what you said about APE... A couple of things initiated my train of thought. The original software (complete collection) is still widely available (at least in the UK) for example in supermarkets and game shops - it is now branded UBISOFT, but all they have added is a new install front page, everything else installs identically (I know this because I have temporarily lost my original disk and I'm currently using the UBISOFT version bought from my local supermarket a year or so ago). I think that we could actually gain community users and downloaders if we could offer them more exciting downloads. If you were to put in the considerable amount of work required to make an improved APE (able to assimilate larger images, cope with the more complex animation formats, configure buildings, shelters, toys and everything that zoo tycoon can offer, plus maybe pal editing facilities), I would undoubtedly use it for years to come to make some really exciting things that are (at the moment) incredibly difficult to make (toys for example).

It takes so long to configure everything that all of my most ambitious animals remain unreleased - I just can't remember what I have done for long enough to actually get them finished. If a new APE meant I could properly configure (for example) my flying cranes and toy-using macaws (which fly into their nest hole in a tree), then these and many more things I and other active designers such as Devona have half finished could be released, reinvigorating the community and giving us something to 'market' to get new users and encourage former users to have another go.

Anyhow, that's my sales pitch done - I'd love you to think about it, and if the answer is 'yes' I shall be forced to change my default text colour to purple ! (sorry Jay!). If the answer is no, I shall still be a happy bunny  :bunny7 with the capabilities of zt studio!
Dr Rick<br /><br />How does that work?

Jay

Quote from: JeffHave you figured out the two "mystery bytes" yet Jay?

No, I do not know what those mystery bytes represent. But I feel there is no need to know. Whenever graphics are loaded into the official APE, it always sets them to "00 00". You can have the official APE create a new project from something in-game, extract the images, load those same images back in without changes, and those 2 bytes become "00 00". So if the official APE can use "00 00", we can as well.


Quote from: JeffAll are using the "i" (icon.pal?) file.

Yes, any time there is an i.pal file for an in-game object, that file contains the colors for the object's icons.


Quote from: dr rickI would undoubtedly use it for years to come to make some really exciting things that are (at the moment) incredibly difficult to make (toys for example).

It takes so long to configure everything that all of my most ambitious animals remain unreleased - I just can't remember what I have done for long enough to actually get them finished. If a new APE meant I could properly configure (for example) my flying cranes and toy-using macaws (which fly into their nest hole in a tree), then these and many more things I and other active designers such as Devona have half finished could be released

Toy configuration is not much different than shelter configuration. They are easier to configure than most guest buildings. The difficulty is in the graphics of the animal, since all toys have the animal seen using the toy at some point. Even what might seem to be simple animal graphics can be time consuming to work correctly. APE does not do a good job at loading images with the proper offsets. Normally we do not care about that with animals. However, sometimes we do care when it comes to having the animals use toys. For example, Taz's Harp Seal and Ribbon Seal can use 3 toys: a raft and 2 different ice floes. The seals use existing animations when on those objects. But because of APE not loading images with the proper offsets, the seals originally looked like they were mostly off of the objects instead of mostly on the objects. So the positions of those seal animations had to be adjusted. But since those animations were changed and since those animations were used for other purposes as well, that meant the positions of all seal animations had to be adjusted in Zoot, otherwise it would look like the seal was jumping from one animation to another. So it took me a long time to adjust the positions of all animations for those seals. I feel the bigger problem with getting things released is there are not enough people testing things. Animals especially take a long time to test properly. Smarter APE/Zoot/ZT Studio/whatever tools certainly have the potential of helping with that. If tools were smarter at doing the offsets, that might reduce the need to adjust them in most cases. If tools were smarter at pointing out problems, such as pointing out if 1 view of an object or animal has a different number of frames than another view, that would reduce the amount of time checking for those problems. If 1 folder had all of the graphics needed for an animal and the designer just had to click 1 button to load them all in, that could reduce mismatch problems and out of order problems, as well as reduce the amount of time needed to load the animal or object.

fern

Ah Rick you did and had released most of the canids of the world for a start. It was while doing the canids you were experimenting with colours and pal files.
You also did a set of birds - 7 of Dr Rick's birds combined. Dunlin, Eurasian Curlew, Bar Tailed Godwit, Pied Avocet, Scarlet Ibis, Glossy Ibis, Sacred Ibis

Amazon Bush Dog
Arabian Oryx
Arabian Wolf
Asiatic Wolf
Atlas Bear
Australian Kelpie
Australian Terrier
Barbary Jackal
Barbary Lion
Black Backed Jackal
British Wolf
Cascades Mountains Wolves
Caspian Sea Wolf
Dark Colored Dingo
Desert Coyote
Dhole
Dingo
Eastern Wolves
Egyptian Jackal
European Canids
Great Plains Wolf
Himalayan Wolf
Hungarian Reed Wolf
Iberian Wolf by Dr. Rick
Indian Jackal
Indian Wolf
Italian Wolf
Mackenzie Valley Wolf
Marsupial Lions 1 by Dr. Rick
Marsupial Lions 2 by Dr. Rick
New Guinea Singing Dog
Nile Crocodile
Northern Coyote
Queensland Heeler
Red Wolf
Russian Wolf
Senegal Jackal
Side Striped Jackal
Steppe Wolf
Tibetan Wolf
Toto
Transylvanian Wolves
Tundra Wolf
Vancouver Island Wolf
Warrah or Falklands Islands/Malvinas Wolf
ZTUF Dingo

Jeff

#63
Actually, there only is one main problem in my humble opinion. In the original development, developers overlooked that the game would be so popular. I do have a very concrete plan on how it would allow users to extract an existing item, then give it a proper name of their own [perhaps, if the community c/would agree, check against a list of known used object IDs], better information on each characteristic and all, but currently I don't see the point (anymore) of such a time investment. With ZT Studio, I want to eliminate all possible graphic problems, and as for configuration... with basic knowledge you can just extract and alter the files. I never used APE to create something besides graphics. Also not the "improved" versions.

So for each new toy or nice attraction for an existing animal or guests, you need to update those files.
This could partially have been resolved if the most recent official versions of content were extracted to let's say the dlupdate-folder (not the graphics, just the .AI-files) and mods were applied differently (only adding lines to things). It would also have complicated cleaning up after an install  more complicated though.

I currently have a personal expansion pack I'm working on. Don't get too excited. What I've merely done so far, is updated the latest versions of Taz's animals, added some beta stuff etc, and configured everything as it  would have been done by Blue Fang. I was also hoping to get more familiar with Blender and create animals from there, but honestly: Vondell (check his posts at Zoo Tek Phoenix) had exactly the same idea, and he was faster and more successful at figuring out everything already. He's quite brilliant at it, and I've been discussing a few things with him.

Jay, you made some good suggestions too. I was already thinking of some sort of validations, mainly when it comes to an individual file, but it might indeed be good to have an easy overview and perhaps validation of number of frames in each graphic.

As for the mystery bytes, I'm not sure. I hope they are unrelated to the frames with an extra animation (but the good thing: the orang utan does not have an extra animation and has values anyhow). I was also thinking they might be just a signature for the graphic artist, but that would make no sense. One would expect it to be on the graphic, and what would the point be....

With some future  updates in mind, I can already tell you that the minimum requirement will be .NET Framework 4.5.


Jeff

I'm willing to provide an early version, but:

* I just implemented rotation fixing and haven't tested it properly yet.
* The batch conversion seems to work from the command line, but the interface still needs to be added.
* still need to add the feature in which you actually have a ZT1 grid (regular and maybe slope) as in ZT1.


dr rick

i'm looking forward to playing with it... :fireworks
Dr Rick<br /><br />How does that work?

Jeff

Any idea if the mystery bytes are  exclusive to the ZTAF format? (including the ZTAF-format with only 1 frame)

dr rick

an idle question - will this be able to create anything other than the simplest animation format (like ape and zoot) or will it facilitate the creation of animations with one additional frame containing the common material?

are there any other more complex animation formats (for example for objects containing a non-animated portion, a portion (such as a repeated flashing light) that has only a few animation frames and a portion with many animation frames (for example an aquarium with swimming fishes in it)? or any other animation formats about which I don't yet know?
Dr Rick<br /><br />How does that work?

Jay

Quote from: JeffAny idea if the mystery bytes are exclusive to the ZTAF format? (including the ZTAF-format with only 1 frame)

In Reply #23 of this topic, I gave an example of the in-game crocodile. That example shows that it does not use the ZTAF format but has mystery bytes of "01 00".


Quote from: dr rickare there any other more complex animation formats (for example for objects containing a non-animated portion, a portion (such as a repeated flashing light) that has only a few animation frames and a portion with many animation frames (for example an aquarium with swimming fishes in it)? or any other animation formats about which I don't yet know?

No, we do not know of any other animation related formats.

Jeff

I think 01 00 is actually a sort of default. I'd like to see if other things than 00 00 and 01 00 are found in non-ZTAF files or not.

dr rick

makes sense...

dumb question time... what is a ZTAF format file?
Dr Rick<br /><br />How does that work?

Jeff

#71
There are a few variations in the file format. With ZTAF, Jay and me are referring to files which start with the letters 'FATZ'. But a lot of the file's "content" has to be read in reverse, so it becomes ZTAF, and we're just guessing it probably stands for Zoo Tycoon Animation File or something like that.

Current status: nearly fully troubleshooted the output of a graphic file after reading it.
I'm going for the restaurant, which covers some special issues (large image, extra frame)
My output is identical except for 2 things:
- each pair of mystery bytes per frame is 01 00 in my version (I actually contacted a former Blue Fang member but no reply so far, if I'll ever get one);
- a lot of instances of 'F9' are 'ED' in my version - I'll check that out, but I think it will be the same color in the color palette (with ZT Studio taking the first occurrence and the original restaurant taking the last occurrence (not an issue at this point);

Update: fixed some issues, and made sure even the largest ZT graphics are supported. Footprint going up to 18!

Jeff

#72
A small update. After a few days off, I mostly tweaked the program so it's faster now.

I managed to read and write complicated graphics like the restaurant, but I'm currently stuck with some graphics. I tried to open an old graphic of my own from very long time ago, and found out it didn't work. Next, I tried to open the United States Flag, and it seems to have a similar problem.

I'm currently investing the  issue based on the SE view of the US Flag. This is supposedly the end of the first frame, and then you see the width/height and offset for the next frame.
...
01 ff 00 01 ff 00 01 ff 00 01 ff 00 01 ff 00 01
ff 00 01 ff 00 01 ff 00 01 ff 00 01 ff 00 01 ff
00 01 ff 00 01 ff 00 01 ff 00 01 ff 00 01 ff 00
01 ff 00 01 ff 00 01 ff 00 01 ff 00 01 ff 00

Somehow we also end up with these bytes, added to the frame:
02 06 00 98 00 07 00 1a 02 06

Now, this is the next frame, starting with the number of bytes:
1f 10 00 00 ff 00 ff
00 cc 00 7f
...

What's sure: those last 10 bytes are counted for in the number indicating the number of bytes in this frame.

I'm currently assuming that there's a whole bunch of 1 pixel sets per line (01), offset 255 pixels (FF),  draw 0 colors (00).

The problem starts here:
02 - two blocks in this line.
06 00 - offset 06, 00 would be very unusual here: no colors. This usually means end of line.
98 00 - again, very unusual, and this would mean that the 07 would refer to 7 blocks in one line.

If I look at the image I can export with Zoot, the 01 FF 00 patterns at the end are just the transparent lines under the flag pole, until the image has a size of 255 x 255 pixels.
So that leaves us with  another set of currently mysterious bytes.

If I make sure the program just renders all bytes before those 10 bytes, it renders fine.

This is the case for the US Flag and the personal graphic.
The graphics have nothing in common. One is small, the other is big. One only has 1 frame, the US flag consists of multiple frames (but no "extra" frame).
The only thing my small graphic and the large US Flag have in common, is that they were probably both made by APE.

I'm not sure what they represent. Maybe a date/creation time?
Or maybe, something else those images have in common: neither are cropped, like ZT1 graphics usually are, to a rectangle which only contains relevant pixels.
Both of these graphics have a few border lines which are fully transparent.
If I decide to just skip them, the image seems to render perfectly.
Zoot can also perfectly render the same version of the US Flag.

* 58 00 95 05 3a 00 e4 00 50 is the series of bytes for my graphic (a version of an umbrella table, a couple of years ago).
For this set, I can guarantee that the image is rendered perfectly at first sight. The bottom contains 4 pixels, and it definitely wouldn't widen up to (05) colored pixels again after an offset of (95).



Any clue, am I overlooking something?

dr rick

intriguing, but I'm afraid I'm not much help... Jay will have some thoughts I'm sure :wub2
Dr Rick<br /><br />How does that work?

Jeff

#74
I did some quick experimenting, I think it will be related to time.

I fired up APE 1.1, and I used the same .PNG for both SE and NE view.   In the same graphic, they're identical (except for referring to a different .PAL file).

When I added a second object (based on something different, but I'm sure that it makes no difference), there were small differences.

* 15 B0 64 00 0D CF 5F 4B 12 B0     ( created close to 18:38 GMT+1 time, 16th of February, 2015)
* 15 B0 63 00 8C CF 5F CA 12 B0     ( created close to 18:38 GMT+1 time, 16th of February, 2015)

And a third one, based just like one of the above on the zoomap:
* 37 FF 5A 00 01 16 FA 1C 30 FF     ( created close to 18:52  GMT+1 time, 16th of February, 2015)

Shortly after each other, so only minutes and seconds should be different. I think we're close to finding out the mystery.


Perhaps something which is related: has anyone ever found out whether the 8 character HEX string APE generates, is that random? I mean, I tried 4 objects within 5 minutes, and each object starts with "23......" .