]> git.pond.sub.org Git - empserver/commit
fairland: Grow islands interleaved
authorMarkus Armbruster <armbru@pond.sub.org>
Tue, 11 Aug 2020 14:16:30 +0000 (16:16 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Tue, 5 Jan 2021 09:41:36 +0000 (10:41 +0100)
commit212c7ddcef479496349c4188a029bb1257e09c6b
treed8c3394bdcc310602492d7403eea738168e3d16e
parentca110e55ed948ac1783bf6e8ba33aae6fa6080db
fairland: Grow islands interleaved

The previous commits changed grow_island() to create islands in
batches consisting of one island per continent, all of the same
planned size.  grow_island() still places and grows one island after
the other.  When an island can't grow to the actual size, the others
in the same batch are not affected.  Island size can therefore differ
a lot within the same batch.

Change grow_island() to interleave the work on a batch's island: first
place them all, then add one sector to each in turn.  Stop after all
reached the planned size, or one or more could not be grown further.

This is similar to how we grow continents: drift() places them all,
and grow_continent() adds one sector to each continent in turn.

Island size within the same batch can now differ at most by one
sector.  The next commit will eliminate that remaining difference.

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-newcap_script
tests/fairland/stunted.out
tests/fairland/stunted.xdump