Sign in to follow this  

Help finding front-line?

This topic is 3313 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a 2D map containing mobile objects from red and blue armies. In general, the red army will start in one map area and the blue army in another map area. The current location of each object is given by a coordinate in 2D-space. ie (123500, 73290, 1) representing the X & Y coordinate for the object and the army type (1 or 2). I wish to plot on the map a "front-line" which is an irregular line that represents the border or boundary between the two armies. This line is not straight and can take any form, even one wavy line showing the battle front and perhaps a separate circle indicating an isolated set of objects contained wholly within enemy territory. I can easily find a mid-point between two opposing objects, but how to define this front-line? Can anyone point me to an algorithm? Programming in Perl. [Edited by - Salmo on November 18, 2008 2:02:02 AM]

Share this post


Link to post
Share on other sites
Thanks TonyG, I've been reading about influence maps & this seems to be the technique I'm looking for. It will fit in nicely with individual unit strength & terrain weighting. Now I've encountered another issue.

My game plays online but produces an event text log file that I'm using to build the game environment around. ie. Play one round, parse the log file, update the database of objects/war play, produce another mission & repeat.

The game world map is a representation of a 1,000km x 700km environment, that can be scaled to 1m resolution. If I choose an influence map at this resolution it will have 700,000 x (the number of Z axis parameters) cells. I wish to store the influence map in an MS Access database & use perl script to parse the log file off-line between playing each mission, but I fear that this resolution will be too calculation intensive. Even if I relax the resolution somewhat I could still be left with 100,000 * Z calculations at least. Any suggestions?

Share this post


Link to post
Share on other sites
You can also compute voronoi cells of all your units (by determining the dual Delaunay triangulation) and then use edges between units of different sides to construct the front-line.

Share this post


Link to post
Share on other sites

This topic is 3313 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this