31.8.05

Corrupted Maps revisited

Recently, I analyzed the subspace comm range issue a bit. Cabman and AlexD pointed out that subspace comm has less range than the manual and online help suggest. I figured out now that this problem is related to the so called "corrupted maps":

The main map is a grid. Let us assume there are two systems with these coordinates:

System A (Xa|Ya)
System B (Xb|Yb)

(Lord Brazen illustrates here the info of the star table. I used mapleveller to read and alter the save game info for the following examples.)

The distance formula d (A, B) of the F9-Parsec-Display is based on the Euclidean distance, this value is divided by 30 and then rounded up:

(I) d (A, B) = round up [ sqrt { (Xa-Xb)^2 + (Ya-Yb)^2 } / 30 ]

(Rounding up makes sense: When the exact value is 4.5 parsecs we just want the info that we need at least 5 parsecs/turn to cover this distance in one turn.)

The same formula d (A, B) is applied to measure the Subspace Comm Range. The manual states:

This upgrade to all your relay stations gives you the ability to issue orders to any friendly ship within 6 parsecs.

Let us assume system A contains a relay station and B reflects the coordinates of the fleet:
d (A, B) = 5 means then that the fleet is in subspace comm range and
d (A, B) = 6 means that the fleet is out of subspace comm range.

With respect to this function d (A, B) there are now two strange results:

1. Why does it happen that a fleet leaving system A with anti-matter drive (and no navi) is out of subspace comm range the next turn?
2. Why does it happen that a fleet with ion drive (and no navi) sometimes just needs one turn to cover a distance of 5parsecs (according to F9-Info on main map)?

Actually, the answer of these both questions is the same: Rounding. The fleets are also attached to (X/Y)-Positions in the save and each turn a rounding occurs to receive a position on the grid. When you move from System A to B the new coordinates of your fleet are calculated by:

(II) (X|Y) = (Xa|Ya) + round up { (Xb-Xa|Yb-Ya) * c }

The factor c is the rounded travel proportion to receive a intersection on the grid:

(III) c = min { 1; parsec per turn * 30 / round down [ sqrt { (Xa-Xb)^2 + (Ya-Yb)^2 } ] }

Combined we receive:

(IV) (X|Y) = (Xa|Ya) + round up { (Xb-Xa|Yb-Ya) * min { 1; parsec per turn * 30 / round down [ sqrt { (Xa-Xb)^2 + (Ya-Yb)^2 } ] } }

A few examples:
System A is (always) at position (505|370) now and a fleet with anti-matter drive (5 parsecs per turn) leaves that system to direction B:

a) System B is at (505|520) and we receive then:
(I) d (A, B) = round up [5] = 5 (is even unrounded exactly 5. System B is exactly below A - same X-Position - and no rounding occurs)
(III) c = 1
and therefore:
(IV) (X|Y) = (505|370) + (0|150) * 1 = (505|520)
The fleet needs 1 turn to move from A to B.

b) Let us change the Y-Position slightly (+1). System B is now at (505|521):
(I) d (A, B) = round up [ 5.03333333] = 6 (6 parsecs is displayed on the main map now - f9)
(III) c = 150/151 = 0.993377
and after 1 turn the fleet is still at:
(IV) (X|Y) = (505|370) + round up [ (0|151) * (150/151) ] = (505|520)
The fleet needs 2 turns to move from A to B.

c) Now same Y-Position like example a) but now a different X-Position (+29). System B is now at (529|520):
(I) d (A, B) = round up [5.06359556] = 6
(III) c = 150/151 = 0.993377
and after 1 turn:
(IV) (X|Y) = (505|370) + round up [ (24|150) * (150/151) ] = (529|520)
The fleet needs just 1 turn to move from A to B. (so called corrupted map because 6 parsecs distance is displayed on main map)

d) Let us change the X-Position a bit further (compared to example c). System B is now at (530|520):
(I) d (A, B) = round up [ 5.06896878] = 6
(III) c = 150/152 = 0.986842
and after 1 turn the fleet is still at:
(IV) (X|Y) = (505|370) + round up [ (25|150) * (150/152) ] = (530|519)
The fleet needs 2 turns to move from A to B.

The SubspaceComm-Issue
Look again at examples b) and d) where the fleet is in hyperspace after the first turn.
In example b) the fleet position (505|520) is exactly 5 parsecs away from system A. And therefore it is in subspace-comm range.
In example d) the euclidean distance is 5.036 parsecs. This value is rounded up to 6 parsecs (see (I)) and the fleet is out of subspace-comm range.
Case b) where no rounding occurs should happen very rarely.

Therefore: A fleet which leaves system A with anti-matter drive (and no navi) is almost always out of subspace comm range the next turn because it is generally a bit faster than 5 parsecs/turn.

Before I figured out the math I thought that the subspace comm issue is just a very late rule change (not mentioned in manual or online help). But it seems now clear that the missing parsec was not intended by the game designers - these rounding issues have been overlooked. Imho it is therefore a bug and should be fixed. There are several options. So far it is only brainstorming, but replacing (IV) with equation (V) looks interesting:

(V) (X|Y) = (Xa|Ya) + round down { (Xb-Xa|Yb-Ya) * min { 1; parsec per turn * 30 / round up [ sqrt { (Xa-Xb)^2 + (Ya-Yb)^2 } ] } }

With this change subspacecomm would work correctly. Also the corrupted maps issue would be affected by this change. It is no longer possible to be faster than expected but slower. (Probably an advantage for the defenders.)

1 comment:

Anonymous said...

Makes my head hurt...