]> git.pond.sub.org Git - empserver/commit
fairland: Distribute islands more fairly among continents
authorMarkus Armbruster <armbru@pond.sub.org>
Mon, 10 Aug 2020 06:22:21 +0000 (08:22 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Tue, 19 Jan 2021 07:27:34 +0000 (08:27 +0100)
commitd434e0cc87aea5afbb956277792898c79d2e4d43
treeca1d31cf8c8ff8f05b3503ae3c813cef5acb39c8
parentd9425bb5da262875ce6d585767a3cabf805ec374
fairland: Distribute islands more fairly among continents

fairland places islands of random size in random places, subject to
minimum distances.  Results are often less than fair, in particular
when the number of islands per continent is low: some continents have
more land nearby than others.  Increasing distances between islands
doesn't help much.  Deities commonly run fairland until they find the
result acceptable.

The next few commits will tackle this issue.  As a first step, this
one places islands closest to continents in turn, so that each
continent is closest to the same number of islands.  A continent is
closest to an island when it is closest to each of its sectors.

The number of islands must be a multiple of the number of continents
now.

Since fairland may be unable to place all islands, a continent may
still get fewer islands than it should.  The next commit will address
that.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
src/util/fairland.c
tests/fairland/no-spike.out
tests/fairland/no-spike.xdump
tests/fairland/plain.out
tests/fairland/plain.xdump
tests/fairland/spike.out
tests/fairland/spike.xdump
tests/fairland/stunted.out
tests/fairland/stunted.xdump