Original Post
Hello,
I'm building a space mmorts where fleets can be send to any place but when flying fleets come in eachothers area the players can choose to intercept if they are online.
To avoid to have to perform a series calculations on all fleet in movement i devised a method where a flightpath is broken up into overlapping cubes. when a new flightpath is added it just checks the cubes in other flightpaths and if found performs accurate calculations.
a flightpath looks like this: [-35;-0;-30][-35;-5;-30][-30;-10;-30][-25;-15;-30][-25;-15;-30][-20;-20;-25] and is stored in a mysql blob cell.
now my problem is how do i construct a decent query to search for the cubes. the only way i can think of is a huge query with a stagering amount of OR's. this might work for short flightpaths but for longer ones i'm in doubt.
the cubes would also be used to prefilter scanner data.
maybe there is a better way to do this?
thanks
I'm building a space mmorts where fleets can be send to any place but when flying fleets come in eachothers area the players can choose to intercept if they are online.
To avoid to have to perform a series calculations on all fleet in movement i devised a method where a flightpath is broken up into overlapping cubes. when a new flightpath is added it just checks the cubes in other flightpaths and if found performs accurate calculations.
a flightpath looks like this: [-35;-0;-30][-35;-5;-30][-30;-10;-30][-25;-15;-30][-25;-15;-30][-20;-20;-25] and is stored in a mysql blob cell.
now my problem is how do i construct a decent query to search for the cubes. the only way i can think of is a huge query with a stagering amount of OR's. this might work for short flightpaths but for longer ones i'm in doubt.
the cubes would also be used to prefilter scanner data.
maybe there is a better way to do this?
thanks