Monday, September 20, 2010

Trees are not barcodes

Yet unfortunately sometimes in DAO they end up looking like them.  There's a strange and inconsistent bug in the toolset that means sometimes trees look terrible from a distance. It appears to be an issue in generating the billboards for different levels of detail. For those that didn't understand that sentence, from a distance, trees are not exactly the same as they are close up (hence they have a reduced level of detail), and are often reduced to being represented by two-dimensional images (sometimes known as billboards). When these billboard images aren't generated correctly for some reason, you can end up with something that looks like the image below.

Trees with barcodes

Some might say "just ignore it" or "it's not that bad", but for anyone who knows me or my modding habits, that's simply not good enough. To have such a blatant error in a level isn't acceptable for me.

Now, with a recent level I was working on (for both The Shattered War and the first DAO community contest), I reached a point where I could not eradicate this problem. No matter how many attempts I made to get the toolset to recreate the billboards, they always ended up corrupted. I wasted hours trying different ways to fix it. However, my stubbornness eventually paid off. I eventually decided to look at what was going on, and found that the process of generating tree information creates two types of files: .spt files (tree locations) and .dds files (texture files).

Loading up an earlier version of the level which had less detail but did not suffer from barcode trees, I used the "Post Trees" mechanism to create the tree information for the level.  I copied the .dds files to a safe directory, and loaded up the latest version of my level. I then used that to recreate the tree information again.  However, once this was done, I was able to copy my saved .dds files from the previous step (specifically the ones containing the billboards) to the relevant directory.  With this done, I started up the game... and voilà! The tree barcodes had disappeared.

People are more fun than trees

While I haven't tested it, I imagine that it's not even necessary to backup your level files at an early stage. This is just a guess, but I imagine it would be possible to create a new empty level and simply add one of each of the vegetation types that you have in your working level. Then generate the tree texture information and copy it to the desired location, simply making sure that the files are named in accordance with the naming scheme of the toolset.

Ideally I wouldn't have to resort to this trick/hack, but it delivered a working level. I'd like to hope that it looks reasonably pretty as well.

4 comments:

  1. I would say it does look reasonably pretty as it won the first place in the contest ;)
    Congrats!
    ...and a very useful tip on the trees. I'll test it out and confirm.

    ReplyDelete
  2. looks great. I must say the dragon age ground texture resolution is weak though. is it possible to increase it?

    ReplyDelete
  3. Huh. So that's how I can fix my trees...

    Time to mod.

    ReplyDelete
  4. Thanks Timelord! Hope the tree tip works for you and jackkel!
    Anonymous: Funny you should mention the texture resolution. I checked some (more) of the various BioWare levels tonight and looking at the degree of texture tiling that they use, and came to the conclusion that I still needed to increase the amount of tiling I use. I still think I'd like higher resolution base textures, but I guess I'll have to work with what I've got. :-)

    ReplyDelete