Giter Club home page Giter Club logo

ooss's Introduction

Out of Sight Snow

OOSS Logo

This mod aims to add snow fall and ice generation to unloaded chunks efficiently. It accomplishes this with the following process:

  1. Every tick, iterate over cached chunks and check the TickOfLastRandomTick.
  2. Get the difference. If the difference is one or less, stop.
  3. Otherwise, we know that ice or snow could have been generated. Simulate ice and snow fall.

Further work in the future may be done to make this process m

The simulation has the following process:

  1. We generate a random number from a binomial distribution of "ices/snows tried". We use Colt's implementation of a binomial random variable generator. Minecraft has a 1/16 chance of trying to ice some water/place snow every tick.
  2. We turn that number of ices/snows into an array representing the number of times that block was chosen for snow/ice. This is done with a clever method I found off stack overflow. More info here
  3. We generate an array of integers from 0 to 255 representing our "interpretation" of the array. For instance, if an ice block tries generating in the middle of a pond, it can't. But if a block of ice generated on the wall beforehand, it can be placed. Randomly generating the "interpretation" helps let ice feel more random and closer to vanilla generation.
  4. We use the interpretation to place the ice and snow. This is the most straightforward part.

What I neglected to mention was that we actually generate separate arrays for ice+snow and just ice. This is because ice can always form, but snow can only form during the ticks that it rains.

The comments in the code also offer some insight.

ooss's People

Watchers

 avatar

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.