Giter Club home page Giter Club logo

Comments (7)

Varriount avatar Varriount commented on August 19, 2024

Huh? What's world wrapping?

from bravo.

MostAwesomeDude avatar MostAwesomeDude commented on August 19, 2024

Basically, forcing worlds to be smaller than 2**32 chunks in either direction. I'm sure you can imagine how it might work. It's been a wishlist feature for a while.

from bravo.

Varriount avatar Varriount commented on August 19, 2024

Hm.. Might be cool if you made it so that, while a player could walk in a straight line indefinately, chunks would repeat (Not teleporting the player to the other side of the world, instead looping the generated chunks)

from bravo.

MostAwesomeDude avatar MostAwesomeDude commented on August 19, 2024

That was, in fact, the plan.

from bravo.

mattbasta avatar mattbasta commented on August 19, 2024

To prevent sharp edges, it might be best to mirror the world along the edge that the player is crossing. For instance, consider these chunks:

1 2
3 4

When a player in 2 heads north, they would be given the equivalent of this:

3 4
1 2
1 2
3 4

The pattern could also repeat horizontally:

3 4 4 3
1 2 2 1
1 2 2 1
3 4 4 3

This can continue indefinitely in either direction. The upside is that it's easy to compute. If you assume that the left-most, bottom-most unmirrored chunk has an X,Y position of (0, 0) and the world's width and height are W and H respectively, then you can use a formula along these lines:

C_x(x) = X % W if X / W % 2 == 0
         W - (X % W) if X / W % 2 == 1
C_y(y) = ...

from bravo.

MostAwesomeDude avatar MostAwesomeDude commented on August 19, 2024

The generators could also be modified to wrap their output appropriately, which would be cheaper than mirroring the chunks. OTOH, if they're only mirrored on the wire, that wouldn't be too bad, but then we'd have to wrap and unwrap all coordinate accesses. Hm, what to do...

from bravo.

YellowOnion avatar YellowOnion commented on August 19, 2024

could you fit it on a Klein Bottle or a Torus?

from bravo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.