These forums have been archived and are now read-only.

The new forums are live and can be found at https://forums.eveonline.com/

EVE Technology Lab

 
  • Topic is locked indefinitely.
 

HELP REQUEST : algorithm to draw 2D eve maps !!!

Author
Princess Honneamise
#1 - 2015-12-28 15:49:17 UTC  |  Edited by: Princess Honneamise
Hi guys,

in my limited freetime im trying to add a "map" feature to my website ( main thread here : https://forums.eveonline.com/default.aspx?g=posts&t=354560 )

At the moment im using the SDE to retrieve the data and draw a simple SVG image .

SEE EXAMPLE HERE : http://localhost/EVE_MOONS/map_preview.php

The map correctly show the regions of the eve universe and im quite happy :-)

The problem is that x,y coordinates are the same of the in-game map ( re-scaled of course ).

Of consequence some of the text is overlapping, making it impossible to read .

MY QUESTION IS :

"wich algoritm can i use to generate correct x,y coordinates to create nice eye candy maps ?"

Can you give some advice ?
(pseudo-code is welcome)

Thx in advance for help.


PS : i googled for stuff like ( "undirected graph drawing", etc...) but i dont have found nothing appropriate to my case.

EVE MOONS PROJECT

http://eve-moons.com

The EVE MOONS PROJECT is the most complete and accurate moons database for Eve Online

Louis Vitton
Viziam
Amarr Empire
#2 - 2015-12-31 06:00:23 UTC
Do you want to create 3d maps? Eye candy maps doesn't really say much.
Zad Murrard
Frozen Dawn Inc
Frozen Dawn Alliance
#3 - 2015-12-31 12:17:24 UTC  |  Edited by: Zad Murrard
Something simple would be

For all texts
compare to all other texts
if text.collideDirection with another text is not null
Take all points
to the direction of collideDirection from the origin of the comparison text and move them
ABC amount to collideDirection.

repeat for from the start until nothing collides.

You can eg. keep ABC as some constant, have it as collision amount + some padding
or increase ABC gradually until that particular text in that round collides with nothing.

edit: if you don't have text dimensions, you can make some approximate box with the assumed origin of the text and the length of the text and use that for comparison.

Of course one could try to do something fancy and try to move only minimum amount of points, but not worth the effort if the results from the simple method are good enough.
Princess Honneamise
#4 - 2016-01-01 16:58:06 UTC  |  Edited by: Princess Honneamise
HI, first of all : Happy new year and thanks for answering in this thread !!!

@Louis Vitton : you have reason, i think i could better explain "eye candy " as "easy to read 2d maps" (i wll update the thread title !!! )

this mean to satisfy some requirements :

-avoid node labels overlay
-reduced edge crossing
-fullfill the space available to draw
-low computation time
-dont be too different from original current EVE map

@Zad Murrard :
well i have tried some experiments.

i have exported some regions from SDE to a DOT file ( my own script )
i have converted the DOT file to PLAIN TEXT using algs like dot,neato,fdp,sfdp, circo( http://graphviz.org/ )
i have re-inserted the PLAIN TEXT to the SDE ( my own script )

also testing different paramenters to generate the PLAIN TEXT ( es : overlap="scalexy" ratio="fill" size= etc...) there is ALWAYS some node that need manual coordinates adjustement.... :-(


@ALL : the "current" idea is :

1)
- copy from the SDE "mapRegions" and "mapSolarSystems" to two separates NEW sql tables named "mapRegionCoords2d" and "mapSolarSystemsCoords2d"
- the only fields to copy will be : ID - X - Z ( YES, Z !!! Blink )
- in the new tables the field names will be : ID - X - Y
- the new X,Y values will be "normalized" with parameters MAX_WIDTH, MAX_HEIGHT, MARGIN
(ex: 800, 600, 10 mean : all X,Y coordinates will stay inside an image of 800*600 pixels with a frame border of 10 pixels )

2)
-create a standalone program the interacts with NEW sql tables to :
a) display the maps
b) if some overlay occur or too many edge crossing or what the hell you want... manually correct it with a simple DRAG-AND-DROP !

TO REALIZE PREVIOUS 2 POINTS :

1) this can be a simple .php script that act on the sql database
2) this can be any program able to manage 2d graphic
I already have a framework from my old project , VIDEO HERE : https://www.youtube.com/watch?v=Dbt_YXPnBQ4
It was pure C ( yes im an old person ) + SDL + SQLITE



Thanks in advance for your comments.

EVE MOONS PROJECT

http://eve-moons.com

The EVE MOONS PROJECT is the most complete and accurate moons database for Eve Online