Ways to manage large amounts of trees How to implement this idea?

Started by
8 comments, last by Squirm 18 years, 1 month ago
I'm creating a woodland FPS, and so my levels will be jammed pack with tree's. I was curious which is the most reasonable way to manage them. Right now I'm simply listing them out, as you can see in my last thread. Here's one idea, but I'm not sure how to implement. Create a file, heightmap, text, or something, and split it up sorta in a grid and have it read, and if the square is black, or whatever, place a tree there. [Edited by - Rouge_Raven on March 11, 2006 2:51:52 PM]
Advertisement
Remember one thing: blit polygons, don't store them.
I program in my sleep,but when I sleep I use the partition in my head that doesnt have g++ or the .net library, so im kinda screwed.
Whats blit?
Quote:Original post by Rouge_Raven
Whats blit?

draw.
Anyway, the advice is still pretty obscure. Does supercoder74 tell us to generate the trees on the fly? It seems very difficult to do in this case.

I suggest you to give a try to spedtree. Obviously, you won't buy it (well, maybe, who knows. After all, it's only 9000$ [smile]) but it will give you ideas of how it works:

  • for geometry near you, trees are low poly models (only a bunch of them that are cleverly placed so that you can render them easily)
  • for distant trees, speedtree uses a decreasing quality LOD system, eventually ending to a simple billboard


You can also have a look to Yann L's thread about trees

I must admit that I don't fully understand your question. If these informatiosna re not thoseyou want, can you tell us more preciselly your needs?

Regards,
(Too lazy to login, this is RR)

What I need is a way to place tree's, because my current way is pretty lame.


treeoneone=LoadMesh( "treeone.b3d" )
PositionEntity treeoneone,16,50,41
ScaleMesh treeoneone,0.1,0.1,0.1
EntityType treeoneone,PROPS
EntityRadius treeoneone,0.1


That's pretty much what I have, then times it by 10, and then by 4, thats how much code I have of just tree's, and even then, it only takes up 1/48th of the land, and this is just a beta land, extremely smaller than the final one.

I made a program that outputs random numbers between 1-50, and then I put those in for the posistion and it came out nice, but I cant do that x48.
Sounds like someone needs a file-format and a model editor. Unless you want to do it procedually, in which case, yeah - you're going to need really clever random numbers.

File-format: I have no idea. WorldBuilder is a commerical quality package that would have its own file-format, but it would be very expensive.

Procedual: You're going to have to get into very complex code if you want a halfway-decent procedual terrain-generator.

My suggestion: Find a free world-builder, and write a file-loader. Voila! A world full of trees.
[ search: google ][ programming: msdn | boost | opengl ][ languages: nihongo ]
Tuxracer does what you suggested yourself for positioning trees - a simple bitmap file (it uses TGA), with green pixels on a black map, each pixel being a tree. It also has rocks and bushes and flags entered the same way, so the map editor is basically any paint program.

Don't let them all put you off procedural placement though - procedural stuff is cool if you get it right, and while you can spend endless months adding clever stuff to it, a basic and reasonable algorithm is usually pretty easy, and in your case, it sounds like exactly the route you should be taking.
Quote:I made a program that outputs random numbers between 1-50, and then I put those in for the posistion and it came out nice, but I cant do that x48
;
why not?
Quote:Tuxracer does what you suggested yourself for positioning trees - a simple bitmap file (it uses TGA), with green pixels on a black map, each pixel being a tree. It also has rocks and bushes and flags entered the same way, so the map editor is basically any paint program.


That's exactly it! Is it possible to get ahold of it? I assume to code it, just read it like the terrain heightmap, and if it's in a certain range of color, render a tree there, and move on.

Should the "heightmap" be the same dimensions as the real heightmap? And is it litterally a pixel, does it matter, or what?
tuxracer beta is open source, runs on both windows and linux, and can be downloaded from, erm, sourceforge, I think...

And I'd say it's entirely up to you how many pixels you want to use for what, but tux uses exactly one pixel of exactly one particular colour

This topic is closed to new replies.

Advertisement