I got Landscape items working. Just finished sorting out the last bug. *shakes fist at math*
I used a proper quad tree this time.
Just to put trees on the screen I had to make 7 new classes and over 30 new methods.
TreeStumpArmy
Moderators: Timedude, Olothontor
- Olothontor
- Clown-Face Bologna
- Posts: 2193
- Joined: Fri Dec 14, 2007 9:29 pm
- Location: Lounging in a commercial Starliner of his own design.
- Contact:
Jesus Christ. That is absolutely ludicrous... is this a streamlining setup issue, or are you really just going to run with it like that? Doesn't seem terribly convenient, although I guess some things just can't be helped (especially in terms of Java).Tzan wrote:Just to put trees on the screen I had to make 7 new classes and over 30 new methods.
- Tzan
- Has anyone ever used those holes before?
- Posts: 4799
- Joined: Sun Dec 30, 2007 4:41 pm
- Location: Boston
Well its not to just put one item on the screen.
I need to load the 3d art using a list of stuff.
I needed to make a head LandscapeElement class for all the actual classes like trees and rocks etc. I made a LandscapeTools class to instantiate items, colorize them, combine the meshes of the parts that make a tree. Allowances for elements to centered on one of the 9 stud spaces, instead of just centered.
I made a new type of Space that can hold landscape items, SpaceLandscape. In the future I may do a Space3D for tunneling.
Then a LandscapeQuadTree class that holds a combined mesh of all the trees in a baseplate. Then limit how many vertexes can be in one mesh before a new set of quadtree children are created and those meshes combined, or destroyed when the number of elements decreases.
If each tree was its own mesh on the screen it would grind to a halt after about 1000 on my machine. Right now with 5x5 baseplates half full of tree stumps (several thousand treestumps) I'm at 2 million verts, 150 meshes @ 80 FPS, rather good I think.
If this was a static game environment it would have been much easier of course. In Unity we program in C#, which it pretty much the same as Java.
I need to load the 3d art using a list of stuff.
I needed to make a head LandscapeElement class for all the actual classes like trees and rocks etc. I made a LandscapeTools class to instantiate items, colorize them, combine the meshes of the parts that make a tree. Allowances for elements to centered on one of the 9 stud spaces, instead of just centered.
I made a new type of Space that can hold landscape items, SpaceLandscape. In the future I may do a Space3D for tunneling.
Then a LandscapeQuadTree class that holds a combined mesh of all the trees in a baseplate. Then limit how many vertexes can be in one mesh before a new set of quadtree children are created and those meshes combined, or destroyed when the number of elements decreases.
If each tree was its own mesh on the screen it would grind to a halt after about 1000 on my machine. Right now with 5x5 baseplates half full of tree stumps (several thousand treestumps) I'm at 2 million verts, 150 meshes @ 80 FPS, rather good I think.
If this was a static game environment it would have been much easier of course. In Unity we program in C#, which it pretty much the same as Java.
Last edited by Tzan on Wed Apr 20, 2011 10:44 pm, edited 1 time in total.
- Olothontor
- Clown-Face Bologna
- Posts: 2193
- Joined: Fri Dec 14, 2007 9:29 pm
- Location: Lounging in a commercial Starliner of his own design.
- Contact: