Click here to Skip to main content
15,898,588 members
Home / Discussions / Algorithms
   

Algorithms

 
QuestionFind the centerline of a font glyph boundary Pin
Jason Titcomb22-Jun-09 8:57
Jason Titcomb22-Jun-09 8:57 
AnswerRe: Find the centerline of a font glyph boundary Pin
supercat923-Jun-09 9:13
supercat923-Jun-09 9:13 
QuestionDiagram layout algorithm? Pin
Ashish Kaila20-Jun-09 9:41
Ashish Kaila20-Jun-09 9:41 
AnswerRe: Diagram layout algorithm? Pin
Arash Partow22-Jun-09 12:52
Arash Partow22-Jun-09 12:52 
QuestionDijkstra restriction Pin
TerRO_GirL15-Jun-09 2:07
TerRO_GirL15-Jun-09 2:07 
AnswerRe: Dijkstra restriction Pin
markalter19-Jun-09 1:33
markalter19-Jun-09 1:33 
GeneralAdvertisment Pin
Eddy Vluggen19-Jun-09 3:01
professionalEddy Vluggen19-Jun-09 3:01 
QuestionSwarm Destruction Pin
Daniel P31-May-09 16:26
Daniel P31-May-09 16:26 
Well, this might sound as a weird algorithm discussion, it's a theoretical one, although I wouldn't mind seeing the abstract implementation. Here it is.

In a 2D game, you have a player and enemies in 2D space. A player has ranged attack as PlayerRange and enemies have their own range(s), but let's say they all have the same range of EnemyRange. What I'm interested in is how to separate a cloud of enemies into groups and circle them to death. here is my solution:

First, acquire range between enemies that will be considered as min-max range to be between each other in a group, and separate cloud of enemies into sub-clouds. Once this is done, create convex hull for each of sub-groups and determine closest sub-group player is to. If player is inside any of those, find closest line of the convex hull and follow in direction of normal to it until player is outside the sub-group.

While outside, construct expanded convex hull using PlayerRange and follow it from point to point until convex hull is no more (i.e. has only 2 enemies left). Once it is so, use simple sphere as path to follow around them until they are destroyed.

Now, all this assumes that sub-group and convex hull calculations are done on a per-frame basis, because enemies do move on their own and may merge from one sub-group to another. This raises a question as to which next point to go to. I think a good solution for this would be to choose next counter- or clockwise point around convex hull and go towards it.

What do you think, is this a good way of doing "circling to death" or are there others?

"Do not try. Do"

AnswerRe: Swarm Destruction Pin
Alan Balkany1-Jun-09 5:03
Alan Balkany1-Jun-09 5:03 
GeneralRe: Swarm Destruction Pin
emilioarp21-Jul-09 10:43
emilioarp21-Jul-09 10:43 
QuestionHow to find the boundary of the complex connecting area Pin
anzhiyue31-May-09 15:57
anzhiyue31-May-09 15:57 
Questionhow to know a file just copy to some path in HDD ? [modified] Pin
xingselex29-May-09 0:52
xingselex29-May-09 0:52 
AnswerRe: how to know a file just copy to some path in HDD ? Pin
Eddy Vluggen30-May-09 1:43
professionalEddy Vluggen30-May-09 1:43 
GeneralRe: how to know a file just copy to some path in HDD ? Pin
xingselex30-May-09 5:26
xingselex30-May-09 5:26 
GeneralRe: how to know a file just copy to some path in HDD ? Pin
Eddy Vluggen30-May-09 9:00
professionalEddy Vluggen30-May-09 9:00 
GeneralIraq-born teen cracks maths puzzle Pin
Bassam Abdul-Baki28-May-09 8:02
professionalBassam Abdul-Baki28-May-09 8:02 
GeneralRe: Iraq-born teen cracks maths puzzle Pin
73Zeppelin28-May-09 8:30
73Zeppelin28-May-09 8:30 
GeneralRe: Iraq-born teen cracks maths puzzle Pin
User 171649228-May-09 8:56
professionalUser 171649228-May-09 8:56 
GeneralRe: Iraq-born teen cracks maths puzzle Pin
Bassam Abdul-Baki28-May-09 9:13
professionalBassam Abdul-Baki28-May-09 9:13 
GeneralRe: Iraq-born teen cracks maths puzzle Pin
User 171649228-May-09 11:38
professionalUser 171649228-May-09 11:38 
GeneralRe: Iraq-born teen cracks maths puzzle Pin
Moreno Airoldi29-May-09 8:43
Moreno Airoldi29-May-09 8:43 
QuestionFinding Matches in Two Large Lists of Strings Pin
ggraham41227-May-09 11:14
ggraham41227-May-09 11:14 
AnswerRe: Finding Matches in Two Large Lists of Strings Pin
Alan Balkany28-May-09 10:54
Alan Balkany28-May-09 10:54 
AnswerRe: Finding Matches in Two Large Lists of Strings Pin
supercat928-May-09 12:03
supercat928-May-09 12:03 
AnswerRe: Finding Matches in Two Large Lists of Strings Pin
Moreno Airoldi29-May-09 8:41
Moreno Airoldi29-May-09 8:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.