Keep in mind I've mentioned this only because I've spent ages debugging it, but it is a not an issue for me from now on. As I hear there is at least one other commander who had the same experience.
It caused maybe 5 minutes of confusion for me. I just chalk it up to the normal debugging/troubleshooting when trying to use a new api. There's always some quirks and what-not, especially when dealing with a web api.
Tornsoul: One thing I might suggest, would be to open source your server code. This way others could contribute if they were so inclined. For example, to implement the streaming data thing. (Not saying that I volunteer.. just that others might.. )
I assume we'll eventually need to migrate it to a hosted service as well, although we probably don't need to worry about that for a while.
Well ^^ GetDistances should give some distances and the return in JSFiddle is "distances: []".
Before i try to experiment in Python, which i haven't coded yet, it would be nice to know that the underlying API is working and that any mistake is on my side.
So what should the example look like to actually produce a list with results? I would also assume that the result is not only numbers but some 2-dimensional array/ tuple [systemName, distance].
If you're starting with the GetDistances example in the API docs then, yes, it will return nothing as there'll be nothing matching the 'AND' of all the filters. This one works: http://jsfiddle.net/5grjpe57/15/
To be honest "JSFiddle (will pull all data)" for that link is misleading, as it'll simply never pull all data. Copy/paste error from the GetSystems one/an earlier version of the docs ?
Tornsoul: One thing I might suggest, would be to open source your server code. This way others could contribute if they were so inclined. For example, to implement the streaming data thing. (Not saying that I volunteer.. just that others might.. )
I got about 75mbit upload (and the server CPU isn't breaking a sweat) - So we should be good for quite some time I'd think, considering the activity I see currently (which could ofc explode come release)
To be honest "JSFiddle (will pull all data)" for that link is misleading, as it'll simply never pull all data. Copy/paste error from the GetSystems one/an earlier version of the docs ?
If you're starting with the GetDistances example in the API docs then, yes, it will return nothing as there'll be nothing matching the 'AND' of all the filters. This one works: http://jsfiddle.net/5grjpe57/15/
To be honest "JSFiddle (will pull all data)" for that link is misleading, as it'll simply never pull all data. Copy/paste error from the GetSystems one/an earlier version of the docs ?
What should i set for filter in GetDistances to get all systems around Sol in a radius of 20 LY around Sol? (That would be the main use case in my plan.)
I tried:
What should i set for filter in GetDistances to get all systems around Sol in a radius of 20 LY around Sol? (That would be the main use case in my plan.)
The clever thing would be to only download the data you need by limiting with sphere/cube at the time that you need it. Or download a static dump, then do updates based on timestamps if you really need everything.
I'm just modelling an SQL database and wonder if this couldn't be made as a public framework since every tool will need the same more or less.
Or is there already something like that?
Code:
CREATE DATABASE edb
CREATE TABLE ships(
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(50) NOT NULL UNIQUE
)
CREATE TABLE modules(
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(50) NOT NULL UNIQUE,
clazz INT
)
CREATE TABLE com_categories(
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(50)
)
CREATE TABLE commodities(
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
ref_category INT NOT NULL,
name VARCHAR(50) NOT NULL UNIQUE,
average INT,
ref_note INT
)
CREATE TABLE prices(
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
ref_station INT NOT NULL,
ref_commodity INT NOT NULL,
....
I don't need the ship model in detail but another tool could need it so why not model everything out as a collaborative work?
I'm also not quite sure how to model the 'modules' and someone might know it better.
FD have confirmed no wipe for release. That probably means no change to the procedural generation. Wolverine, do you want to PM Michael and see if he can confirm?
FD have confirmed no wipe for release. That probably means no change to the procedural generation. Wolverine, do you want to PM Michael and see if he can confirm?
The wipe info came from Community Manager Edward Lewis so it should be correct. But I think you meant to the Stellar Forge stuff. Will PM Michael brookes to get official confirmation/denial.
If indeed no wipe, I got burned twice. With SB2 "no planned wipe", last weekend grinded till my fingers bled to be ready for an ASP and exploration. Then they wiped. Now with Gamma "assume a wipe", didn't play at all and NOW "no wipe". They are pretty consistent in ruining my day.....
So I think I've found a system from the FD Gamma list that doesn't exist. It certainly isn't where it is s'posed to be and the name doesn't work in the GM.
Cool. But you commanders are giving me a headache wrt updating my 3rd party tools thread. I can't keep up ;-)
I will add it to the list, just a bit of patience please.
Recap of a couple of problems found recently with how FD calculates distances ingame - and the solution.
It was spread over many posts, with unrelated posts in between.
I thought it would be useful to have it all collected for future reference, if someone drops by that needs a pointer on how to do things.
The Problem
Two distances turned up, where our calculations didn't match the ingame reported distances, and as such coords to a system involving that distance got rejected.
And apparently that's how FD somehow do their distance calculation weirdly enough...
The Solution
rw then gave a JavaScript solution in post #1739 which was completely unreadable (I think he forgot to use CODE tags - and instead used QUOTE tags - or something...)
I cleaned that up (CODE tags) in post #1749 and furthermore failed at the same conversion feat in C#.
Turns out a bit more is needed in C#, as demonstrated by rw in post #1751
I've played around with that a bit, and eliminated most of all the conversions and parentheses (making it hard to read/understand)
Notice that input/output are floats - as that saves a bit on parentheses in the actual methods. The cast from double to float of the actual values can happen outside the method.
The above (slightly adjusted - as rounding precision isn't hardcoded, and length isn't a static) is what goes into TGC in a few minutes.
The above code works for both the previous troublesome distances/lengths.
Here is a full test program that can be copy/pasted to http://rextester.com/runcode if you want to muck around with it.
A/B/C is rw's example
A2/B2/C2 is my example
Code:
//Title of this code
//Rextester.Program.Main is the entry point for your code. Don't change it.
using System;
namespace Rextester
{
public class Program
{
static float length(float x, float y, float z){
return
(float)Math.Sqrt(
(float)(x*x+y*y) + (z*z)
);
}
static float lengthRounded(float x, float y, float z){
double p = 100;
return (float)(Math.Round(length(x,y,z)*p)/p);
}
public static void Main(string[] args)
{
float A = 63.8125F;
float B = -120.46875F;
float C = 42.59375F;
float A2 = -3.625F;
float B2 = 1.96875F;
float C2 = 10.375F;
Console.Write(length(A,B,C) );
Console.Write(" => ");
Console.WriteLine((double)length(A,B,C));
Console.Write(lengthRounded(A,B,C));
Console.Write(" => ");
Console.WriteLine((double)lengthRounded(A,B,C));
Console.Write(length(A2,B2,C2));
Console.Write(" => ");
Console.WriteLine((double)length(A2,B2,C2));
Console.Write(lengthRounded(A2,B2,C2));
Console.Write(" => ");
Console.WriteLine((double)lengthRounded(A2,B2,C2));
}
}
}
output:
142.825 => 142.824996948242
[COLOR="#FFD700"]142.82[/COLOR] => 142.820007324219
11.165 => 11.164999961853
[COLOR="#FFD700"]11.16[/COLOR] => 11.1599998474121
API doc have been updated:
- Now mentions that dates are UTC dates
- The "will pull all data" note after the Fiddle links have been removed. As that is no longer true and caused confusion.