Skip to content

Hold tiles for an endless world #71

Open
0 of 4 issues completed
Open

Description

@KurbyDoo

Background

The store holds the sum and weight grids that windows are blended into. It was built for one region of known size, generated in one go and read back once. An endless world breaks all three of those assumptions.

Tiles are held from more than one world at a time, so the seed has to stay part of how a tile is named. A tile is asked for again later, so the store has to know whether every window covering it has arrived. And the same area gets requested more than once, so the store has to know not to blend a window into a tile a second time.

Underneath all of it memory has to stay fixed. The store holds a limited number of tiles and drops what it no longer needs.

Description

Change the store from something that holds one region into something that holds part of an endless world.

There are four parts. A tile is named by the global seed together with its coordinate rather than by a single number. Each tile keeps a record of which of the windows covering it have been added. That record is used to skip a window that has already been blended in. And a request needing more tiles than the store can hold is refused rather than left to thrash.

The record is what makes the rest of it work. Once a tile knows which windows it has, it knows when it is finished, and dropping it is safe, because it gets generated again from scratch rather than read back half filled.

Do #59 first, since everything else is held under the tile's name. Do #62 before #63, since skipping a window needs the record to exist.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions