Tree Planting tool

Ask questions, discuss ideas, get answers
Post Reply
takiwa
Posts: 134
Joined: Mon Dec 30, 2013 4:29 pm
Location: The Great State of Georgia

Tree Planting tool

Post by takiwa »

Back in the day, there was a tool I used on a few maps to plant trees. You made an 8-bit image, and whatever was colored black got planted, whatever was colored white did not (or the other way around, I forget). Does anyone remember this tool, or what it's name was? Or possibly have a copy of it somewhere deep in a forgotten folder?
Image
Grabbi
Posts: 42
Joined: Wed Aug 03, 2011 3:37 pm
Location: Germany
Contact:

Re: Tree Planting tool

Post by Grabbi »

TreeGen 1.0001
**************

You need to copy the "windows/system32/*.*" files into the windows\system32 directory. Once this is done you can run
the program. The sourcefiles are just a bmpfile in order
for you too view what type of tree to be created.

You must do the following to generate trees:

1. Create one BMP file 8bit from the rawfile. Resize the
image to Battlefields worldsize.
EX..
Image = 1024x1024
Bf Worldsize = 4096x4096
The image then needs to be resized to a 4096x4096 8bit imagefile.

2. Create a BMP file 8bit that will contain black and white areas.
The white (255) will contain trees. The black (0) is No trees :-)
MAKE SURE TO MAKE A COPY OF BOTH THE HEIGHTMAP AND THE OBJECTFILE.

3. Enter the number of objects (trees) to be generated.

4. Enter the worldsize in the box that says so. THIS MUST OBVIOUSLY
BE THE SAME SIZE AS THE IMAGE. Dont enter 1024x1024 if the image
is that size, jsut type 1024. Nothn else.

Press the generate button. The first thing that will be done is that
the program counts the number of white pixels, then check if the number
of pixels is more than the number of objects to be created. If not you
will be notified. If the image is large this make take some time.

Also if you try to generate a small amout of trees on a large map it may take some time. But you will see the coordinates tested in the box below the genbutton. So if that ticks you will no the program runs. Also the progressbar should rise.

If you have any questions or so check the forum. If something aint working there will be a new release soon where I have checked out the
bugs and crap with the program. This is just a ALPHA so bare with me.
Attachments
Treegen.rar
TreeGen 1.0001
(1.04 MiB) Downloaded 1072 times
[url=bf1942://85.214.226.169:14567]Image[/url]
takiwa
Posts: 134
Joined: Mon Dec 30, 2013 4:29 pm
Location: The Great State of Georgia

Re: Tree Planting tool

Post by takiwa »

I think I love you :)

I have been looking for this for MONTHS!!!

thank you so much :)
Image
Crash

Re: Tree Planting tool

Post by Crash »

:shock: nice
takiwa
Posts: 134
Joined: Mon Dec 30, 2013 4:29 pm
Location: The Great State of Georgia

Re: Tree Planting tool

Post by takiwa »

I re-wrote the readme so that it makes a little more sense to English-speaking people, as well as adding a few of my own tips...
TreeGen 1.0001 (Instructions re-written by takiwa, 2019)
**************

You need to copy the "windows/system32/*.*" files into the windows\system32 directory. Once this is done you can run
the program.

The sourcefiles are just a bmpfile in order for you to view what type of tree is to be created.

You must do the following to generate trees:

1. Open your heightmap.raw in a photo editor. Resize the heightmap to your map's worldsize (the worldsize can be found in your map's Terrain.con file), and then FLIP THE IMAGE VERTICALLY!. Save this file as an 8bit .bmp file (heightmap).

2. Open the .bmp heightmap you created in step 1 in a photo editor. Create a new layer, and paint white everywhere you want trees. Then select the non-white areas on that layer and fill them in black. Compress the layers and save this file as a separate 8bit .bmp file (objectplacementmap).

3. Open TreeGen, and choose the vegetation in the Object box.

4. Choose the number of objects you want placed on the map.

5. The first filename you select will be the file you created in step 2 (objectplacementmap)

6. The second filename you select will be the heightmap you converted and resized in step 1 (heightmap)

6a. Once you choose your images, make sure the sizes shown below them in the Preview Box are the same. If not, go back to steps 1 & 2 and make sure you are resizing your images correctly. Otherwise you will not get correct object placement.

7. The worldsize will be your map's worldsize found in your map's Terrain.con

8. The scale will be the yScale found in your map's Terrain.con (typically 0.6)

9. Click generate. When the generating is complete, right click in the text box, select all, copy, and paste into your StaticObjects.con.

10. To generate different foliage on the same map, click Clear Gen Obj, select a new object, and click Generate again. This will place new object on the same map, bypassing the locations of the last placed objects.

TIPS:

You can have several different objectplacementmap files (the file you created in step 2), to create a layering effect of bushes to small trees to large trees, or to pinpoint the exact areas you want certain vegetation. Just select the new objectplacementmap before regenerating in step 10.

If you choose to have only one objectplacementmap file, generate your small plants and bushes first. Then generate you medium sized plants/trees, followed by your largest. This will progressively "lock out" the location of the smaller bushes, which will be placed over a larger area, helping to clump the larger objects as you generate newer objects.

You can use this app for any static object in BF1942 (including custom objects), not just vegetation. Just type the name of the object into the Object Selection box. You will see a "No Preview" picture, but the file will be written with the correct object name and placement. As long as that object has the correct files in your BF1942 .rfa's, it will load in game. Some great examples would be rocks, barrels, and crates :)

Remember to open your map in an editor after the generation process, and check your locations. Some objects will be placed right next to one another, which may not look good on the map. You will need to move these objects away from each other by hand.

CONS:

There is only one con with this program, and that is that every object you place will have the same rotation. There is no ability to choose a random rotation, so all your trees, bushes, rocks, etc. will all face the same direction. Keep this in mind when placing obects. You may need to open the map up with an editor and manually rotate some obects to achieve a better look for your map.
Image
Post Reply