lets say u have 10 trees and a 5x5 matrix area.
Now one problem that I can think of that pops up straight
away is over lapping of two randomly placed trees.
25 tiles makes up 5x5 so u could say u only wanted to plot one tree per tile space to get around this, and to make it look less rigid then perform a small random offset from the center of that tile position.
so in order to manage this easy we should really create an array of the same size in 2 dimensions.
lets call it DynaTree.
now an array uses space zero as one of the psaces when counting but DB doesnt use a zero to track media objects.
We will skip the zero space for now but keep in mind its there for other arrays.
dim DynaTree(5,5)
for x = 1 to 5
for y = 1 to 5
DynaTree(x,y)=0
next x
next y
this prepaares the array with zeros so we know for sure
its clean before we plot our trees.
now lets plot 1's into the array that represent the tree
locations.
for i = 1 to 10
rndx = rnd(4)+1
rndy = rnd(4)+1
DynaTree(rndx,rndy)=1
next i
from here depending on how big your matrix is then u make another loop to position each tree but using the position of the tile in a magnification.
eg: if your matrix was 5x5 but 100 wide and across u would prolly do it x 10 and if it was 1000 then it would be x 100
once u have plotted them u could then offset them within the space of the known matrix tile size and then this would solve any overlapping problems.
Once u have plotted the trees into those tile spaces, It also allows u to have a flat tile area if your trees look silly on hills due to the trunks not having a bit of model under the center point to allow for this.
Its only one possible method to the approach also.
You will need to adapt the ebst method to your games requirements.
I hoped this helps a bit