Skip to content

Agree what a terrain request contains #73

Open

Description

@KurbyDoo

Background

The command line and the 3D Visualizer both ask for terrain. They differ only in how the request travels, so both make the same request.

A request says which world it is asking about, where in that world, and how much. What comes back is a grid of real elevations covering what was asked for.

Description

A request carries three things:

  • The global seed, a 32 bit integer, saying which world
  • The top left corner of what is wanted, a row and a column counted in world cells. Either may be any integer, arbitrarily far from the origin
  • The size wanted, a height and a width counted in cells, each at least one

Create some sort of shared payload structure or interface that both request methods will unpack. A reply carries the seed, the corner and the size it was asked with, and a grid of real elevations that many rows and columns.

The reply repeats the request because the visualizer asks for terrain ahead of the camera and the answers arrive out of order.

Positions are counted in world cells. Anything that thinks in tiles, including the visualizer, multiplies by its own tile size before asking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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