Attnam / ivan

Iter Vehemens ad Necem - a continuation of the graphical roguelike by members of http://attnam.com
GNU General Public License v2.0
296 stars 42 forks source link

Floodfill on Pangea #635

Open red-kangaroo opened 2 years ago

red-kangaroo commented 2 years ago

When using Pangea world shape with wrapping edges (see #631), the generator puts all locations on a single "part" of the landmass - eg. if the continent goes north and warps to the south, all locations will only be in the northern part and the southern part will be empty, even though it's easily reachable. This is a limitation of the current location reachability check, which uses floodfill from the UT exit, not taking the wrapping world edges into account.

Floodfill that does take world edge wrapping into account and can place location on the whole continent would be nice.

ryfactor commented 2 years ago

This is a limitation of the current location reachability check, which uses floodfill from the UT exit, not taking the wrapping world edges into account.

Actually it's a limitation of the floodfill used to enumerate continents, e.g. continent number 1, 2, 3... etc. (I think this is done by worldmap::CalculateContinents() ) We need the continent calculator to connect landmasses on the other side of the worldmap by making them the same continent number. Everything else should fall into place :)

EDIT: It should operate this way only in the x-axis when the world shape is cylindrical, and in the x- and y-axes when the world shape is toroidal.