Server Help Forum Index Server Help
Community forums for Subgame, ASSS, and bots
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   StatisticsStatistics   RegisterRegister 
 ProfileProfile   Login to check your private messagesLogin to check your private messages   LoginLogin (SSL) 

Server Help | ASSS Wiki (0) | Shanky.com
Quadtree C# fun!

 
Post new topic   Reply to topic Printable version
 View previous topic  strcmpi failing? Post :: Post win32/winsock (part 2)  View next topic  
Author Message
Doc Flabby
Server Help Squatter


Joined: Feb 26 2006
Posts: 636
Offline

PostPosted: Thu Sep 11, 2008 11:56 am    Post subject: Quadtree C# fun! Reply to topic Reply with quote

Working on a Quadtree implementation to help with fast collison detection for STF. Its pretty cool and took me ages to understand so i thought i would share.
Left Click = Place Point
Right Click + Drag = define test area.

The points that are included in the collision test color red.

I now just need to improve it so it handles tilesof variable size instead of points...
This program is just a test driver for the quadtree class (src included)


_________________
Rediscover online gaming. Get Subspace | STF The future...prehaps




Screenshot

quadtree.jpg - 23.85 KB
File downloaded or viewed 82 time(s)

Source + Bin

QuadTreeTest.zip - 900.94 KB
File downloaded or viewed 231 time(s)
Back to top
View users profile Send private message Add User to Ignore List
Bak
?ls -s
0 in


Age:24
Gender:Gender:Male
Joined: Jun 11 2004
Posts: 1826
Location: USA
Offline

PostPosted: Sat Sep 13, 2008 4:23 am    Post subject: Reply to topic Reply with quote

i remember doing that for solar system simulation gravity simulation for a class project (turns out you can approximate gravity O(N*logN) instead of O(N^2)).

Anyways, if three points are on the same exact spot does it create a tree of infinite depth until my computer runs out of memory?
_________________
SubSpace Discretion: A Third Generation SubSpace Client
Back to top
View users profile Send private message Add User to Ignore List AIM Address
Doc Flabby
Server Help Squatter


Joined: Feb 26 2006
Posts: 636
Offline

PostPosted: Sat Sep 13, 2008 9:15 am    Post subject: Reply to topic Reply with quote

Bak wrote:

Anyways, if three points are on the same exact spot does it create a tree of infinite depth until my computer runs out of memory?

Nope. You'd just create 3 more levels to the tree I think.

Its a variation on a Binary Tree Structure..
Back to top
View users profile Send private message Add User to Ignore List
Display posts from previous:   
Post new topic   Reply to topic    Server Help Forum Index -> Non-Subspace Related Coding All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum
View online users | View Statistics | View Ignored List


Software by php BB © php BB Group
Server Load: 676 page(s) served in previous 5 minutes.

phpBB Created this page in 0.499324 seconds : 30 queries executed (82.8%): GZIP compression disabled