Mathematica, 80 bytes
d[n_]:=If[#=={},0,1/Det@LatticeReduce@#]&@Select[Tuples[Range[-n,n],2],#.#==n&];
This code basically takes advantage of the LatticeReduce command to answeris mostly reliant on a mathematical theorem. The basic idea is that the question by processingcode asks for the setdensity of possible moves directlya lattice given some generating set.
It first generates the possible displacementsMore precisely, we are given some collection of the movements byvectors - namely, those whose length equalsquared is N - and asked to compute the square rootdensity of n; it does this by testing every possible vector in a 2n+1 x 2n+1 square around the origin. Then, the code outputs 0 if this empty. Otherwise, it feedsset of possible sums of these vectors to LatticeReduce, which outputs a pair ofcompared to all integer vectors such. The math at play is that moves by those vectors and their oppositeswe can reach the exact same positionsalways find two vectors (latticeand their opposite) that "generate" (i.e. whose sums are) the same set as the original moves can reachcollection. OneLatticeReduce does exactly that.
If you have just two vectors, you can imagine tiling the whole plane with rhombidrawing an identical parallelogram centered at each reachable point, but whose sidesedge lengths are representedthe given vectors, such that the plane is completely tiled by these two vectorsparallelograms. - and in each rhombus(Imagine, there must be exactly one reachable pointfor instance, a lattice of "diamond" shapes for n=2). The area of this rhombuseach parallelogram is the determinant of the pair oftwo generating vectors. The desired proportion of the plane is the reciprocal of this area, since each parallelogram has just one reachable point in it.
The code is a fairly straightforward implementation: Generate the vectors, use LatticeReduce, take the determinant, then take the reciprocal. (It can probably be better golfed, though)