Problems to my RTS engine with RB Tree
I got a big trouble in my engine recently. I develop my Real-Time Strategy game engine with Red-Black Tree to control all unit. I sort the RB Tree with the y value of every unit that could be shown on screen corrently . ( Note: If it based in Link-List , then it might be shows that a building was stand on a tank because the showing serial wasn''t correctly !! )
Isomatric Engine on RB Tree:
(Building 1)
____
|\___\
|| _|____
|| |\_____\
\|_|| | . <-- correct showing
. || | .
. \|_____| . .
. . . . .
. .(Building 2)
Isomatric Engine on Link-list:
(Building 1)
____
|\___\
|| |____
|| |____\
\|___| | <-- wrong showing
. || | .
. \|_____| . .
. . . . .
. .(Building 2)
MY QUESTION IS :
Is it the best way to solve the problem above with Red-Black Tree ?
Could it make the speed of my game slow down?
BESIDE:
Now I''m developing the Red-Black tree. My unit might always modify the y value becuse it might move. so I have to remove the node then insert again the node to the Red-Black Tree every rountine. it spent lots of time. Is there a better way to solve my problem ?
Thanks anyway and sorry for my poor English.
____
|\___\
|| _|___
|| |\____\
\|_|| |
|| |
\|____|
____
|\___\
|| |___
|| |___\
\|___| |
|| |
\|____|
|\___\
|| _|___
|| |\____\
\|_|| |
|| |
\|____|
____
|\___\
|| |___
|| |___\
\|___| |
|| |
\|____|
My god....I cannot draw the building correctly.
____
|\___\
|| _|___
|| |\____\
\|_|| |
|| |
\|____|
____
|\___\
|| |___
|| |___\
\|___| |
|| |
\|____|
December 20, 2000 11:39 AM
My god....I cannot draw the building correctly.
____
|\___\
|| _|___
|| |\____\
\|_|| |
|| |
\|____|
____
|\___\
|| |___
|| |___\
\|___| |
|| |
\|____|
Nobody seems to be responding...
Perhaps you could include more information on how you are using the tree, and are your buildings on the same linked list as your units? If your buildings aren''t on the same list then it would always be drawn underneathe or above everything else.
Perhaps you could include more information on how you are using the tree, and are your buildings on the same linked list as your units? If your buildings aren''t on the same list then it would always be drawn underneathe or above everything else.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement