View unanswered posts | View active topics It is currently Wed May 01, 2024 5:04 pm



Reply to topic  [ 5 posts ] 
 getDistance and getCourse(?) when used with setAvoid 
Author Message
Ensign

Joined: Wed Nov 06, 2002 3:00 am
Posts: 268
Unread post getDistance and getCourse(?) when used with setAvoid
I think this is probably a question for EP, here's the situation. I am doing a bubble checker script, using the TWX Proxy database to get the information. I am using a setAvoid command to put an avoid on the entrance to the bubble. Then, I am using the getDistance command to check for routes to and from each bubble sector and the bubble gate.

In the documentation, it says getDistance will return a value of -1 if there isn't enough data in the database to plot the route. But, after running my script, it appears that if there is an avoid set on the database, getDistance will also return a -1 value. Same thing for getCourse.

I have the entire universe explored in the game. And to test and make sure the data is in the database, I commented out the setAvoid line and added a clearAllAvoids command on the next line. When I ran the script after doing this, I got distances to all the bubble sectors.

So, it would seem that if there is an avoid set on the database it treats this just like no data in the database.

My question is, how hard would it be to change this? It would be very confusing if you weren't sure you had the universe 100% explored, since you get this same value back for courses with an avoid in them or courses with insufficient data to plot the course.

If you are busy adding more important changes and improvements to TWX Proxy I can understand you not being able to make this change, or at least not until some release further into the future. Like courses with an avoid returning 0 or -2 and courses with truly not enough data returning the -1 value. Although I could see how this would be a problem if you accidentally tried to plot a course from a sector to that same sector - that might need to return the 0, or an error code that you can't plot a course to the same sector?

Or would this kind of change be impossible/so complicated that it just wouldn't really be feasible? Thanks, Thor


Fri May 30, 2014 4:33 pm
Profile
Ensign
User avatar

Joined: Mon Dec 26, 2011 8:41 am
Posts: 206
Unread post Re: getDistance and getCourse(?) when used with setAvoid
SteveH_66 wrote:
I think this is probably a question for EP, here's the situation. I am doing a bubble checker script, using the TWX Proxy database to get the information. I am using a setAvoid command to put an avoid on the entrance to the bubble. Then, I am using the getDistance command to check for routes to and from each bubble sector and the bubble gate.

In the documentation, it says getDistance will return a value of -1 if there isn't enough data in the database to plot the route. But, after running my script, it appears that if there is an avoid set on the database, getDistance will also return a -1 value. Same thing for getCourse.

I have the entire universe explored in the game. And to test and make sure the data is in the database, I commented out the setAvoid line and added a clearAllAvoids command on the next line. When I ran the script after doing this, I got distances to all the bubble sectors.

If you want the true distance, I guess you need to clear internal avoids before doing getDistance. Makes sense to me...

So, it would seem that if there is an avoid set on the database it treats this just like no data in the database.

My question is, how hard would it be to change this? It would be very confusing if you weren't sure you had the universe 100% explored, since you get this same value back for courses with an avoid in them or courses with insufficient data to plot the course.

If you are busy adding more important changes and improvements to TWX Proxy I can understand you not being able to make this change, or at least not until some release further into the future. Like courses with an avoid returning 0 or -2 and courses with truly not enough data returning the -1 value. Although I could see how this would be a problem if you accidentally tried to plot a course from a sector to that same sector - that might need to return the 0, or an error code that you can't plot a course to the same sector?

Or would this kind of change be impossible/so complicated that it just wouldn't really be feasible? Thanks, Thor


Are you saying that if there is ANY avoid set in the database, then getDistance returns -1 for ALL courses? If so, then I agree it needs to change.

However, if getDistance returns -1 when you have an avoid set that prevents you from getting to your destination, then I think -1 is the correct value for getDistance, because there is no valid course to that sector when avoids are set.

One thing that's confusing is twx database avoids are not synchronized with trade wars avoids. They are two different things, and if you didn't realize that it would cause confusion.

Quote:
Like courses with an avoid returning 0 or -2 and courses with truly not enough data returning the -1 value. Although I could see how this would be a problem if you accidentally tried to plot a course from a sector to that same sector - that might need to return the 0, or an error code that you can't plot a course to the same sector?


I could see -2 maybe, but not 0. Like you said, if getDistance returns 0 that means the distance is 0 and therefore the destination sector is the same as the current sector.

What you can do is plot a course using trade wars itself. The internal getDistance and getCourse requires warp data, but trade wars course plotting does not.


Sat May 31, 2014 12:42 pm
Profile ICQ
Ensign

Joined: Wed Nov 06, 2002 3:00 am
Posts: 268
Unread post Re: getDistance and getCourse(?) when used with setAvoid
Astrochimp wrote:
SteveH_66 wrote:
I think this is probably a question for EP, here's the situation. I am doing a bubble checker script, using the TWX Proxy database to get the information. I am using a setAvoid command to put an avoid on the entrance to the bubble. Then, I am using the getDistance command to check for routes to and from each bubble sector and the bubble gate.

In the documentation, it says getDistance will return a value of -1 if there isn't enough data in the database to plot the route. But, after running my script, it appears that if there is an avoid set on the database, getDistance will also return a -1 value. Same thing for getCourse.

I have the entire universe explored in the game. And to test and make sure the data is in the database, I commented out the setAvoid line and added a clearAllAvoids command on the next line. When I ran the script after doing this, I got distances to all the bubble sectors.

If you want the true distance, I guess you need to clear internal avoids before doing getDistance. Makes sense to me...

So, it would seem that if there is an avoid set on the database it treats this just like no data in the database.

My question is, how hard would it be to change this? It would be very confusing if you weren't sure you had the universe 100% explored, since you get this same value back for courses with an avoid in them or courses with insufficient data to plot the course.

If you are busy adding more important changes and improvements to TWX Proxy I can understand you not being able to make this change, or at least not until some release further into the future. Like courses with an avoid returning 0 or -2 and courses with truly not enough data returning the -1 value. Although I could see how this would be a problem if you accidentally tried to plot a course from a sector to that same sector - that might need to return the 0, or an error code that you can't plot a course to the same sector?

Or would this kind of change be impossible/so complicated that it just wouldn't really be feasible? Thanks, Thor


Are you saying that if there is ANY avoid set in the database, then getDistance returns -1 for ALL courses? If so, then I agree it needs to change.

However, if getDistance returns -1 when you have an avoid set that prevents you from getting to your destination, then I think -1 is the correct value for getDistance, because there is no valid course to that sector when avoids are set.

One thing that's confusing is twx database avoids are not synchronized with trade wars avoids. They are two different things, and if you didn't realize that it would cause confusion.

Quote:
Like courses with an avoid returning 0 or -2 and courses with truly not enough data returning the -1 value. Although I could see how this would be a problem if you accidentally tried to plot a course from a sector to that same sector - that might need to return the 0, or an error code that you can't plot a course to the same sector?


I could see -2 maybe, but not 0. Like you said, if getDistance returns 0 that means the distance is 0 and therefore the destination sector is the same as the current sector.

What you can do is plot a course using trade wars itself. The internal getDistance and getCourse requires warp data, but trade wars course plotting does not.



AC, I don't think it gives a -1 for all plots with just one TWX avoid set. And I do have the script done for getting the information directly from Tradewars, using a CIM query. So it's not a big deal to me. But, the script to get the info from Tradewars itself takes at least 20 times as long, probably 100 times as long -- would have to add a timer in each script to see for sure, or time it with a stopwatch. I do know the TWX database routine runs in a matter of a few seconds, the CIM based version of the script takes minutes to run.

As I've said before, I'm not a programmer, so I don't know how trivial/non trivial this change would be for EP in TWX Proxy. It just seems to be a sub-optimal solution using the same variable to indicate 2 different types of conditions - Condition 1, not enough data in the database, and Condition 2, avoid in the route.

I already know how I can do it in the TWX database version of the script too, was just thinking it would be better for new scripters starting out with no programming/scripting experience if they had different values being returned, they wouldn't have to think of work arounds. Maybe I shouldn't have brought it up? Pro scripters might just think it's nitpicking, probably also knowing how to work around it.

Anyway just my 02¢, and as far as I know that won't get you a cup of coffee anywhere in the world for even 01¢ less than asking price :lol: Thor


Tue Jun 03, 2014 6:10 am
Profile
Ensign
User avatar

Joined: Mon Dec 26, 2011 8:41 am
Posts: 206
Unread post Re: getDistance and getCourse(?) when used with setAvoid
Thor wrote:
AC, I don't think it gives a -1 for all plots with just one TWX avoid set. And I do have the script done for getting the information directly from Tradewars, using a CIM query. So it's not a big deal to me. But, the script to get the info from Tradewars itself takes at least 20 times as long, probably 100 times as long -- would have to add a timer in each script to see for sure, or time it with a stopwatch. I do know the TWX database routine runs in a matter of a few seconds, the CIM based version of the script takes minutes to run.


Yeah, there's a tradeoff in speed versus accuracy. The twx database is your local copy of some of the data that's sitting on the server. It's not as up-to-date as the data on the server, but it takes less time to reference it. And sometimes you just have to go to the server because you don't have the data locally at all, as with your warp data. Since warp data doesn't change in a game, most people get a full ztm as soon as possible. For some purposes, I guess you need two different scripts if you want to do it right: one for before you have a full map, and another for after you have a full map. Or you just write one script that detects whether you have a map or not and executes the appropriate code.

Thor wrote:
As I've said before, I'm not a programmer, so I don't know how trivial/non trivial this change would be for EP in TWX Proxy. It just seems to be a sub-optimal solution using the same variable to indicate 2 different types of conditions - Condition 1, not enough data in the database, and Condition 2, avoid in the route.


In the context of the command itself, i.e. getDistance, they both mean the same thing: undefined, so I don't see much wrong with it, considering this is just twx script. If error code behavior is added to this command, it should probably be added to a whack of other commands as well.

It's not that I think your request is unreasonable, but I could think of dozens of things I would improve first.

Thor wrote:
I already know how I can do it in the TWX database version of the script too, was just thinking it would be better for new scripters starting out with no programming/scripting experience if they had different values being returned, they wouldn't have to think of work arounds. Maybe I shouldn't have brought it up? Pro scripters might just think it's nitpicking, probably also knowing how to work around it.


You're not wrong for bringing it up, I just don't personally think it's a big deal.


Last edited by Astrochimp on Thu Jun 19, 2014 7:11 pm, edited 1 time in total.



Thu Jun 05, 2014 6:41 pm
Profile ICQ
Ensign

Joined: Wed Nov 06, 2002 3:00 am
Posts: 268
Unread post Re: getDistance and getCourse(?) when used with setAvoid
That's true AC, I'm sure there are a lot of other things EP needs and wants to work on before he got around to something like this. Just saying it would be a nice change to have sometime in the future.

As I said in my last post, I can already think of a way to work around it and the script using the TWX database will still run much faster than the one using the CIM. Just having to think about it a bit more to figure out the best logic flow or whatever you call it for the commands and such doing it this other way.

Like you said, not a big deal to me personally either.


Sat Jun 07, 2014 1:30 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: No registered users and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware.