TreeStumpArmy

For all those games that happen to not be BrikWars

Moderators: Olothontor, Timedude

TreeStumpArmy

Postby Tzan » Wed Apr 20, 2011 12:51 pm

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.

Image
User avatar
Tzan
Blockguy
 
Posts: 5037
Joined: Sun Dec 30, 2007 4:41 pm
Location: Boston

Postby Zahru II » Wed Apr 20, 2011 1:57 pm

a.k.a. White Nuns' treemen warband, after being brutally slain and reanimated by a floramancer.
User avatar
Zahru II
balls just have this nasty tendency to wear out over time
 
Posts: 4515
Joined: Fri Jul 24, 2009 6:22 am
Location: Hüngäry

Postby Tzan » Wed Apr 20, 2011 2:05 pm

:)
User avatar
Tzan
Blockguy
 
Posts: 5037
Joined: Sun Dec 30, 2007 4:41 pm
Location: Boston

Postby Olothontor » Wed Apr 20, 2011 9:34 pm

Tzan wrote:Just to put trees on the screen I had to make 7 new classes and over 30 new methods.


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).
"In a mad world, only the mad are sane." - Akira Kurosawa
-=[ Visage ]=-

Image
User avatar
Olothontor
Clown-Face Bologna
 
Posts: 2484
Joined: Fri Dec 14, 2007 9:29 pm
Location: Lounging in a commercial Starliner of his own design.

Postby Tzan » Wed Apr 20, 2011 10:34 pm

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.
Last edited by Tzan on Wed Apr 20, 2011 10:44 pm, edited 1 time in total.
User avatar
Tzan
Blockguy
 
Posts: 5037
Joined: Sun Dec 30, 2007 4:41 pm
Location: Boston

Postby Olothontor » Wed Apr 20, 2011 10:36 pm

Ah, I see. The Classes and methods that apply to the Tree Stump will also apply to other landscape objects. That makes it much better.

I misunderstood, and was afraid that you would need to create a similar set of classes and methods for each object you wanted to implement.
"In a mad world, only the mad are sane." - Akira Kurosawa
-=[ Visage ]=-

Image
User avatar
Olothontor
Clown-Face Bologna
 
Posts: 2484
Joined: Fri Dec 14, 2007 9:29 pm
Location: Lounging in a commercial Starliner of his own design.

Postby Tzan » Wed Apr 20, 2011 10:48 pm

To add a new element I make 1 class and add a line in 2 existing classes.

I need a way to streamline that though. I was thinking about it for an hour today before I quit for supper :)
User avatar
Tzan
Blockguy
 
Posts: 5037
Joined: Sun Dec 30, 2007 4:41 pm
Location: Boston

Postby White Nun » Wed Apr 20, 2011 10:57 pm

Zahru II wrote:a.k.a. White Nuns' treemen warband, after being brutally slain and reanimated by a floramancer.


A 'Floramancer'?! :shock: Now I know how the weeds get back in my garden so quick......
Image
User avatar
White Nun
Jaw-Jaw
 
Posts: 861
Joined: Sun Apr 03, 2011 8:59 pm
Location: New Zealand


Return to Lesser Games

Who is online

Users browsing this forum: No registered users and 3 guests