Hello to the community

Topics: User Forum
Dec 19, 2006 at 6:46 PM
Hello everyone, this is my first public project in C# and XNA Game Studio.

I am anxious to hear from people about their experiences using or extending the QuadtreeComponent.

Feel free to ask questions, post comments or give feature/change requests.
Dec 20, 2006 at 11:41 PM
very good job, what about octree?
Dec 21, 2006 at 12:29 AM
I do plan on developing an Octree Component in the future.
Right now, I'm working on the newest version of the Quadtree.
I will be uploading it tonight (I hope). It allows for adding static (or dynamic) objects (models) into the terrain. The quadtree will render them.
The example will show adding 1000 rocks to the terrain as well as 100 rolling rocks.
Dec 21, 2006 at 12:38 PM
Hello Clyde,

This is very cool technology. How exciting to see such a great graphics engine emerge so quickly on the XNA scene. I made the following changes in an Xbox 360 project that links to your source:

Consolidate the following two USING lines from QuadTree.cs into one:


using Microsoft.Xna.Framework.Content.Pipeline;
using Microsoft.Xna.Framework.Content.Pipeline.Graphics;

Is Now:

using Microsoft.Xna.Framework.Content;

In Game1.cs:

I changed the movement handlers to use "currentState.ThumbSticks.Left.Y > 0".

X > 0 is right
X < 0 is left
Y > 0 is up
Y < 0 is down

The program builds and deploys to the Xbox 360 and one can wander the environment using the left thumbstick! Very neat, and very encouraging.

What I would like to personally do with such an environment is place a 3D animated figure into it. For instance, two people fighting, or a dune buggy riding over the hills!

Dec 22, 2006 at 1:56 AM
Gary, I am finishing up on a feature that you could for that.
I'm adding DrawableGameComponent support in the Quadtree. I would love to see it in action.
I have created a new class called QuadtreeGameComponent that is derrived from DrawableGameComponent. It has a new Draw method: void Draw(GameTime gameTime, Matrix view, Matrix projection)
You don't add instances of them to the Game.Components collection, instead you insert them into the Quadtree and it manages when to Draw (only when visible). But Initialize, Update, LoadGraphicsContent, UnloadGraphicsContent are all called like normal (Update each frame).
I'll be releasing this code soon (hopefully tonite) as version 0.3.5.

Hey, thanks for participating....and Where's your stuff at?

Unfortunately, I don't have an XBox 360, just the original XBox.
Feb 19, 2007 at 7:26 PM
Hello Clyde,
Nice project. I like it. I am currently written MMO engine and I want use you project like example of MMO game. Can you give me permission to do this?

Best Regards

Feb 20, 2007 at 12:07 AM
You can use the quadtree code freely for any non-comercial use. I'm glad that you find it useful :)
Feb 20, 2007 at 7:27 AM
Edited Feb 20, 2007 at 7:31 AM
Hi Clyde

I'm trying to develop a tanks game based on your Quadtree component.
I modified the code to use only one Vertexbuffer and Indexbuffer to draw the entire terrain. The nodes only store the starts index and the number of primitives to draw.
I added ray collision detection too, using a custom primitive list class and some utility methods. Also I change all the class names (It's a bad habit I have)

I'm planning to open a project here in codeplex but I'm wondering if you could take a look at the code and give me permission to open the project with your code.

If you want I can mail it to you (~900Kb)

Thanks a lot
Feb 20, 2007 at 9:42 AM
Hello Selinux,

I like tanks and also think about MMO tank game.
When you are planning to create this project?

I can help you with mutlyplayer in this game.

Thank you,
Sergey Yuryev
Feb 20, 2007 at 10:37 AM

selinux wrote:
Hello Selinux,

I like tanks and also think about MMO tank game.
When you are planning to create this project?

I can help you with mutlyplayer in this game.

Thank you,
Sergey Yuryev

This week I think. The codeplex project is created but not published. I don't know nothing about multiplayer, so thank you, I accept your help. I will help you too if you want.

See you
Feb 21, 2007 at 8:32 AM
To Selinx: Cool. Currently I also provide refactoring of Quad Tree project and integrate with my MMO engine. Let me know when you project will be published

To ClydeCoulter: Are you planning for new release? If yes what features are you planning to add?

Feb 23, 2007 at 5:31 PM

Yes, I am working on a new release now, hopefully I will release it this weekend.

New Features,
  • Single Index buffer (selinux has done the same I see, I still use seperate vertex buffers, is single vertex better selinux?)).
  • A type of model instancing that is compatible with Windows and XBox 360 (will change it to whatever XNA comes up with later) (I use only 1 effect setup, renderstate changes, index and vertex buffer setup per model, but only set world matrix and call drawindexedprimitive per instance on the viewable geometry (only support single mesh part for now)).
  • Grass model support. renders grass that fades (alpha) to nothing farther from viewer.
  • Trees (with the rocks) in the test program. Used to test the instancing.
  • Added several new classes QuadTreeRootNode (better than static variables) and classes to handle model stores and instances.
  • Simple bitmap font support for debug output. It's a very small class BMFont.
  • Added sky color change (based on view direction to light direction) to reflect sun's position in the test program.

I am currently working on the detail texture stuff. I hope to be done soon :)


I would like to see your code................This is too cool.............I glad to see what people are doing with this stuff..................

email: clydecoulter&@&tds.net (remove the & in both places :)

Hey guys, what kind of games are you planing on writing. I want to do a better BattleZone type game. I didn't like BZ 2, but the original was really cool, just needed better graphics and a better way to make new levels (add-ons).

Do we all need to work together on something?

Feb 23, 2007 at 5:38 PM
By the way, I also have a pretty good path finding engine for terrains based on elevation differences (steepness where a vehicle can or can't go based on the steepness of the terrain).
It is in C++ right now, I need to convert it to C#.
It builds areas of variable sizes in a quadtree fashion from a given heightmap and then uses an enhanced Astar path finding algo to find paths from 2 points. It is reenterable so that it can do the path finding in steps (so much per frame so it doesn't get in the way of rendering speed).
Feb 23, 2007 at 11:27 PM
As far I can see, one vertex buffer is better than many, but I think it depends on size.

If you have many little vertex buffers, you lost some time setting the graphics device each frame, but if you have one big (not too big) vertex buffer, you only have to set the graphics device once per frame.

Actually I use one vertex buffer with 512x512 vertices, and one index buffer with 511x511x2x3 indices. In nodes I store the start index and the number of primitives to draw. I’m sending to you the code now.

My idea is to load all terrain geometry in one vertex buffer, and the indexes in at least three index buffers. Each index buffer will have the indices of a specific level of detail. I have done one little demo of it, and I will work on it tomorrow.

I don’t know if I’m on error. What do you think?

Oh, If you want I can convert this c++ code to c# for you.
Feb 24, 2007 at 12:09 AM
Alien3D: Finally I publish my project. Is in http://www.codeplex.com/tanksgame

See you