EVE Online mapping – region perimeters

Submit to Digg
Blog — Psilocybeing on April 24, 2008

Continuing from my previous post, regarding parsing jump data from CCPs EVE Online, I wanted to make the maps appear a bit more friendly on the eyes, instead of just one large mass of points and spheres. To do this, I would have to generate perimeters for each region, to constrain all solar systems to their parent region. Having no idea how I could go about this, I put my thinking cap on.

Shortly after tightening the straps on old-faithful, I came up with a method that would generate perimeters around a set of 2D nodes. Basically, I would take the center point of a ‘region’, or set of 2D nodes, first of all by normalizing the min/max (in practice min=0, max=max-min), and place a line of detection stretching out 50% of the region width. This I would then shrink down unit by unit until a solar system was found within the specified sphere of detection (approximately 4×4 units on an image scale of 200×200), and then draw a line from the previous point, to this new point. This process would be repeated around a 360 rotation, creating a full outline of the target region.

I’m sure there is a better method than the one I have touched on, and used here, but for the time being this seems to work; and I only need to generate the coordinates for the regions polygon once, after which they can be scaled and reused as needed.

While this method works (as you can see from the attached gallery), it has not really aided in the ability for users to see jump data. Many regions overlap, and as such the map generally becomes a mish-mash of regions, jostling for space. The next step I would like to take before continuing with developing the statistics app (for jump / kill statistics, in an animated map over custom time scales / regions) is to generate each region separately, which in fact I can already do; the difference in my new target is that I would like each region to ‘displace’ its neighbours, so no two region overlaps, giving a nice margin around each region. Now, I’ve got a hunch of how to go about this, but nothing solid right now, so back on goes the thinking cap!

In the mean while, feel free to check out these generated images. The first image is of the entire EVE Online universe, and the others are of individual regions. They have all been created completely automatically using one PHP script, and one large chunk of data.

2 Comments »

  1. That is absolutely amazing what you have done with a php script. I only recently started to try to do the same thing with the eve map and php. I have got no where close to what you have done so far. I have the ccp dumps and I have been playing around with them for the last week, but how did you get it to actually create a picture of a region using it?

    Comment by Ryan Briggs — May 14, 2008 @ 10:22 pm
  2. Hi Ryan, thanks for the comment!

    Regarding rendering regions, the first job is collecting, and scaling of X/Z coordinates (X/Y provides a side-on view of the universe). After these have been scaled to the width/height of your output image (if you are rendering a single region), you would take a center point of the image as a reference, or starting point. From that reference point you would project a ‘line of detection’.

    This ‘line’, is in fact a moving point in X/Y coordinates of the image. The only reason I use the term line is because the point itself moves from the outer constraint of the region (starting point + 50% region width), back to the starting point, looking for nearby Solar Systems as it goes. This is all done using Trigonometry, examples of which I would be happy to give.

    This process is repeated through a 360 degree rotation from the starting point, in 5 degree increments. Once a Solar System is found on an increment, a line is drawn from the previously found Solar System, to the newly found. Increased smoothness can be gained by reducing the increment at the expense of increased CPU time. These coordinates are all stored in an array, for which we will need in a second once the outer border has been completed.

    Once we have our border, we can use the PHP function ‘imagefilledpolygon’ to create a polygon to overlap the region, to make it a bit more distinct. Of course, unless you draw the stars first you would want to assign a color with an alpha value, so as to give transparency.

    When we have got everything together, simply dump to a PNG file or stream. This process can be repeated on all regions, simply by taking the starting point from the area of the MIN/MAX X/Y coordinates of a region, after the entire universe has been scaled down to the size of your destination image, and using them as an offset in your calculations.

    I hope this has helped! If you have any questions, please feel free to post again. I’d be very interested in seeing the progress you make, or different approaches you have to solving the problem of calculating region constraints, as I know there is a faster solution out there..I’ve simply not put the time in to hack it out yet.

    Take it easy!
    Psilocybeing

    Comment by Psilocybeing — May 15, 2008 @ 6:28 am

RSS feed for comments on this post. TrackBack URI

Leave a comment