EVEDev talk:Community Portal

From EVEDev

Jump to: navigation, search

racorccaa

[edit] Formula used to Aquire Jumps from a Solar System

I was just wandering has anyone played with the Eve dump files trying to aquire the formula used to calculate the jumps as to say

Eve calculates the jumps from one solar system to the next ex Maiah to Hamse = 1 jump

but how are they geting 1?



I have analyzed all the solar system dump files, and any relative files in conjunction with RegionID,SolarsystemID,ConstalationID, To and From and I can not figure out the formula EVE uses to calculate the jumps from the dump files.


Any help on this matter would be greatly appreciated. Thanks

There is mapSolarSystemJumps table which lists links between solar systems. You can use Dijkstra algorithm to find path from one point to another. I did easier way: created table with columns

  • fromSystemID INTEGER,
  • toSystemID INTEGER,
  • distance INTEGER

and populate it first (startSustemID, startSystemID, 0) and then insert neighbors like this

 insert into MapJumps( fromSystemID, toSystemID, distance )
 select distinct @startSystem, j.toSolarSystemID, @jump+1
 from mapSolarSystemJumps j
 where j.fromSolarSystemID in
    ( select toSystemID from MapJumps where distance=@jump and fromSystemID=@startSystem )
 and
    not exists
    ( select toSystemID from MapJumps jj where jj.toSystemID=j.toSolarSystemID and jj.fromSystemID=@startSystem );

until nothing is inserted (@jump starts with 0 and increments on each loop). I fill this table for different systems when need and eventually it become full inverted index :) --6opoga 03:04, 6 November 2007 (CST)

[edit] Re: Jump Calculation Algorithm

Thanks for responding, however that appears to be what I need but, there is a slight problem I am not using SQL to acecss the dump files, I am using Delphi to open the file from my server, then relating the data that is retrieved into my client.


Basically the client sends a request to the server - requesting how many jumps are required to make a jump from a Pre Assigned Destination by the user. So what I need is the The formula to perform the correct calculation based on the From Destination, to Destination the code does not have to be in Delphi format Im not asking for the Code to perform this action but rather the calculation, etc. As follows

Based on this data from the dump file:

This being the Starting Destination (fromRegionID,fromConstellationID,toConstellationID,toRegionID) VALUES(10000001,20000001,20000004,10000001);


This being the To Destination

(fromRegionID,fromConstellationID,toConstellationID,toRegionID)

VALUES(10000001,20000001,20000005,10000001);

so we can assume:

From: 10000001,20000001,20000004,10000001 To  : 10000001,20000001,20000005,10000001

We know that FromRegionID are the same for both From and To Destinations We Know that FromConstellation are the same for both We Know that ToRegionID are the same for both.

Now all that is left is comparing toConstellationID for both and we see that 20000004 - 20000005 = 1 And according to the game this example indeed is only one jump.

However when everything is the same except toConstellation everything works great even if the return value is 13, so 13 would be 13 jumps.

But now when the FromRegionID, ToRegionID, changes meaning they are not the same regions things get complicated. Thus I need the Rules for the calculation used to compared the jumps required.

for Example: Using the same example as above with a few changes

so we can assume:

From: 10000001,20000001,20000004,10000001 To  : 10000002,20000001,20000005,10000001

Even though we check first that ToRegion and fromRegion are either same or not the same we find that this time, FromRegion is not The same in this case, so

Using the same concept above 20000004 - 20000005 = 1 , but now since the FromRegionID does not match the ToRegionID we have problem at this point.

For this example eve map says it is 13 jumps, so I tryed using 12 as a defualt so I took the 1 and add it to 12 giving me 13, this applied of course works for this example. and simular examples, however does not work 100% for every jump.

So I think now you have more to see what I am doing, and what my problem is. Im thinking that perhaps another programer, no debate on his flavor of code has run onto this problem him or herself. As i said all I need is the calculation routine.

etc,

I will try my best to post in VB example since more VB programmer then Delphi will read this post. so if I mess up i am sorry, but I think you will understand concept


if fromRegionID <> ToRegion then if fromRegion < toRegion then setRule1 = "1" if fromRegion > toRegion then setRule2 = "2"

if setRule1 then setContellation = fromContellation - ToConstelation + 12 totalJump = setConstellation end if

if setRule2 then setContellation = FromConstellation - ToConstellation + 10 totalJump = setConstellation end if print "Total Jumps = " & totalJump end if

[edit] Sad news

You are completely wrong if you think that Region, Constellation and Solar System ID somewhat relate to connectivity between Regions, Constellations or Solar Systems. These IDs are just artificial keys and don't have any other meaning.

So you need either fetch all jumps info into your application and write Dijkstra algorythm there (it's easy, I did it as lab practicum while learning in college) or use technique similar to mine. Dijkstra algorythm is better because it gives you path, not only number of jumps, also you can fine-tune it by discouraging low-sec travel etc.

--6opoga 05:51, 14 November 2007 (CST)

Personal tools