A tour of the breedfile in LNZ Pro
Many beginner hexers are intimidated by LNZ Pro. But it's an easier program to work with than it looks; it was designed to be an easy alternative to the old style of hexing with a hex editor (which is where we get the term 'hexing' from). Here's a breedfile in a hex editor and the same file in LNZ Pro - see how much easier it is to see how the file is laid out in the latter:
Yes, there are lots of numbers, but it's easy to learn what the numbers do, and you do not need to be a mathematician to work with them.
I won't be going into every aspect of LNZ Pro or the breedfile in this article, but I will be taking you on a quick tour of the file to hopefully demystify the program and help you become more comfortable with it.
Note: The tutorial covers breedfiles from Petz 3, 4, and 5. Petz 2 breedfiles are similar but may not have the same sections, whilst Petz 1 files run off a different game engine and are laid out very differently. If you wish to hex Petz 1 files, you may be able to find some information on Carolyn's site. I do not play Oddballz or Babyz so this tutorial likewise does not cover them, though I understand they too can be edited in LNZ Pro. Again, refer to Carolyn's site for help with editing these games.
- The parts of a breedfile
- Understanding the LNZ file
The parts of a breedfile
The part of the file you normally hex with, the LNZ ("linez") file, is only part of the whole. A .cat or .dog breedfile is a collection of several files (it's actually a .dll in disguse) including images, sounds, and behaviours. LNZ Pro lets us see these as individual parts. Here's what you see when you open up a breedfile. I'm using the Dachshund.
Not very interesting so far, but you can see a list of file types - BMP, LNZ, etc. These are a bit like folders; you can click on them to see what files of that type the breedfile contains. You can also export, replace, and swap around these files, although I won't go into how to do that here. Let's take a look at them in order.
All breeds contain a bitmap image that is used when selecting the breed in the Adoption Center. It's always named after the breed's default name, so here it's called OSCAR. You can of course export, edit, and replace the file if you're making a new breed. You could also put other files here, for example textures for your breed, but the AC image must always be present.
The LNZ files
This is the meat of the file and where you'll be spending the most of your time. The LNZ file dictates what the pet looks like. Most breedfiles contain two - the adult LNZ (here called "DH" for "dachshund"), and the puppy/kitten LNZ (here called "DHPUP"). The adult LNZ is the main one, whilst the puppy/kitten is like a set of overrides that tell the game to make the pet smaller or alter the side of certain ballz such as giving them bigger eyes or paws.
There are some exceptions to the two LNZ file rule. The alley cat and poodle contain four LNZ each, which appear to contain extra variations. Likewise the bunny in Petz 4 has different LNZ for its colour variations, but in its cause only the white one in the main LNZ ever appears. I'm not sure why they're laid out that way - I don't use any of those breeds as hexing bases most of the time, so I have limited understanding of how they work. But for most breeds, including your own creations, the two files should suffice.
When you open up a LNZ file you will also see a helpfile at the bottom of the screen. This helpfile is your friend, we'll talk about it later.
You'll notice that this section is laid out like a hex editor. For a long time this file was thought to dictate a breed's personality. It's now known that it's an animation script. As of 2020 much of the SCP's format has been decoded, but easy editing is still in the future. However it is possible to swap SCPs between breeds to give them the animations associated with that breed.
The SCP is always named after the same two letter code as the LNZ file, so here it's called DH.
The text files
There are two of these, the BEvent file and the sounds list.
The BEvent file contains the text string that appears when you take a pet out of the adoption center or carry case in your game. If you're making a new breed you can change this to something else - useful if you don't want your game talking about great danes if you take a bear out of the AC. Following that there are a series of numbers. I am not sure what these do (possibly some sort of settings?), so it's probably best not to touch them.
The BEvent file is named after the species (dog or cat) and the two letter code we have seen before.
The sound list is much longer but should be self explanatory. Each line points to a different sound file that the game plays at a certain time, for example when the pet barks, meows, walks around, plays with a toy, etc. These files may be inside the breedfile itself, as we'll see in a minute, or within one of the Petz shared resource files. Again this file is named using the two letter breed code.
The WAV files
These are the unique sound files for each breed - barks, growls, meows etc. Like the SCP files they open in LNZ Pro like a hex editor, but they can be exported and edited with a sound editor if you should wish to do so, so you have a little more flexibility there. Again I won't go into how to do that; this tutorial is just about showing you what and where everything is.
There are two of these, 1 and 64, and I'm not sure what they do, but 64 does contain the breed's name, default adoption name, and two letter code. Aside from that it seems to be mostly unused space.
Another set of data, this contains some useful things if you want the breed to show up separately in the adoption center, mainly the offset number (here called the Breed ID). However LNZ Pro will set this up for you if you save your breed under a different name, so you should not need to edit it directly.
Extra files in the pig and bunny breeds
The above should cover most breedfiles. However the pig and bunny, released in Petz 4, have some extra files hidden inside that you can see if you open them in LNZ Pro. These seem to be custom animation and personality files, as well as the star icon that appears in place of the regular cat or dog icon when you select the pet.
Understanding the LNZ file
Now that we've had a look at the contents of the breedfile, let's go back to the most important part, the LNZ.
This tutorial will not be covering every part of this breedfile as it's just an intro to the program, and because Carolyn's LNZ breakdowns are the best resource out there, so you may we well read those. As shown on the main page, you can read them on her archived site, or you can find them in the LNZ Pro helpfile. The helpfile will load in the bottom part of the screen when you have a LNZ file open, so you always have a reference on hand.
For now, let's take a look at what a LNZ file really is, and what's the deal with all those headers and numbers. A LNZ file is essentially just a text file that the game refers to so it can know what the pet should look like.
You'll notice that the LNZ file is split up into sections full of numbers, each one with a header set inside square brackets: [Default Linez File], [Sounds], etc. Each of these sections is something that the game will look for when making a pet, and it's the contents of them that we can edit to make whatever we want. You can even insert new sections if they're not in the breedfile already. For example, my Eyeamese breed uses the [Eyes] section, not normally defined inside a breedfile, to redefine what ballz are the pet's eyes.
To view the helpfile for a section, click so that your text cursor is inside the section, and press F1 on your keyboard. The relevant helpfile will appear in the helpfile panel and tell you all about what all the numbers mean and what you can do with them. The main helpfile and Carolyn's breakdowns contain a list of all the available sections so you can read about the ones you may want to use that are not already inside the file.
Note: the sections are usually laid out in the same order between breedfiles, but it does not matter what order you put them in. The game will pick up on them all the same.
You may notice that different parts of the file have different colours. This is not a property of the actual file (remember, it's just a text file) but something called "syntax highlighting", where LNZ Pro gives different colours to parts of the file to make it easier for us to see what's going on. (If you write code elsewhere you of course know what I mean!)
You can see that some lines are in grey - these are comments. The game will ignore anything in a comment; it's just for us to read. Comments are handy for notes to ourselves so we can remember what we were doing, and the original game programmers did the same. For example, the top of the Ballz Info section includes comments that state what each column does, as well as comments at the end of each line to state what ball it is. The programmers would have used these as reference so they weren't just looking at a list of numbers, and now it's useful for us.
You can add new comments as you see fit, wherever you need to make a note to yourself. All you need to do is preface your comment with a semicolon, and the game will ignore it and move on to the next line.
We've already seen how to use the helpfile, but LNZ Pro also includes some other handy features. At the top left of the window you will see menus labelled "Insert" and "Tools". These contain:
- Ball number: look up and insert the number of any main body ball. Contains number lists for Dogz, Catz, and Babyz.
- Ball colour: view the colour palettes for each game and insert the selected colour number into the file. Contains palettes for Petz 2-5, Babyz, Oddballz, Catz 1, and Dogz 1
- Check for errors: scans the file for things like mispelled header names, and returns anything it finds in the bottom panel.
- Reformat lines: makes all columns the same width so they're easier to read.
- Find and Replace: self explanatory!