fix: deterministic behaviour for radar by storing the random fractions when generating rd.json (#372)

* Store the random blip positions when generating rd.json

Fixes: https://github.com/AOEpeople/aoe_technology_radar/issues/148

Simple solution to creating stable blips is to store the randomly generated angle and radius in rg.json.

Attempted a few hash functions but found it hard to spread blips 'nicely'
(they tended to clump into groups or sections of the radar).

* distribute points within .1 and .9 of the arc

---------

Co-authored-by: Bastian Ike <bastian.ike@bare.id>
This commit is contained in:
Eddie Whiteside
2023-06-01 11:01:42 +01:00
committed by GitHub
parent 71e397459f
commit 3b272dacb3
4 changed files with 14 additions and 6 deletions

View File

@@ -199,6 +199,8 @@ var addRevisionToItem = function (item, revision) {
quadrant: "",
body: "",
info: "",
angleFraction: Math.random(),
radiusFraction: Math.random()
}; }
var newItem = __assign(__assign(__assign({}, item), revision), { body: ignoreEmptyRevisionBody(revision, item) });
if (revisionCreatesNewHistoryEntry(revision, item)) {