Archived

This topic is now archived and is closed to further replies.

pasman

Unit selection in RTS

Recommended Posts

Hi there, I''m working on a 2D RTS game written in Delphi and i got into a little optimisation problem. I keep my units in an array, containg a lot of things, including the world coordinates(i don''t use tile related coordinates) anyway when i''m trying to select a group of units and the player controls at the moment say 100 units, it takes some time to select the group because i search the entire list of units for those who are inside the selection rectangle. What i''m asking is how should i store the units or how can i usee a faster search algorithm. Hope i''m not very confusing. Thanks in advance.

Share this post


Link to post
Share on other sites