Giter Site home page Giter Site logo

joise's Introduction

joise's People

Contributors

arcnor avatar benmclean avatar codetaylor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

joise's Issues

GWT incompatibility

I'm trying to use Joise with the GWT backend for libGDX and apparently it has some incompatibilities. I forked to work on the problem, so hopefully there will be a PR from me to fix this issue soon.

I have listed the build errors I am getting which I believe indicate incompatibilities with GWT in this comment here.

upload to maven central

Could we upload to maven central so it's easy to add to a project, so i can just do in my gradle dependencies { compile "com.blah..".. }

I'm not very familiar with gradle, maven, or maven central, perhaps you are though :)

Modules registered and serialized using simple class name may produce unwanted collisions

For example, if someone wanted to use their own version of ModuleCos, named as such, without overriding overwriting Joise's internal ModuleCos, it couldn't be done without renaming the custom module.

If we use the fully qualified class name, however, it could be done: com.sudoplay.joise.module.ModuleCos is distinct from something like com.custom.ModuleCos, and the system would be able to tell the two apart when serializing / deserializing.

Platformer Terrain

How do you make platformer terrain like in the Minecraft worlds example on the ANL site? Your example just makes noise but I don't know how to take it a step further and make a terraria-like game.

Multi-threaded?

The library needs some proper multi-threading tests to identify which classes are thread safe and which are not. I suspect that the PRNGs are not thread safe; the ModuleCache class is also possibly not thread safe.

eval6D

where is the eval6D function?

generating infinite terrain

Hello, I am not sure if this is the right place to ask, but I found your library just amazing and I would like to tell you about.

I am facing a problem while using the library, I have made a few test with the different modules, and my comprehension is that I must now the final dimensions of my map before generating it. Let me explain:

the get function of the modules look this way

get(x, y) // x and t are value between 0 and 1

so I need to call

get(x / map_witdh, y / map_heigh)

in order to obtain the point value.

I would like to use it in an inifinite map, so that if the player is at coord (1000, 400), I just need to generate the surrounding blocks etc...

Is there a way to achieve that? I am quite sure I have missed something. A documentation or a wiki would be very helpful.

Thank you

ModuleFractal#calcWeights(FractalType) is only called when the FractalType is set

ModuleFractal#calcWeights(FractalType) is only ever called when ModuleFractal#setType(FractalType) is called. The calcWeights method uses the following mutable fields: lacunarity, H, offset, and gain. If a user calls any of the setters for the aforementioned fields, the scale and bias for each octave will not be recalculated with the new field value.

Additionally, when reconstructing the ModuleFractal from a ModuleMap, the setType(FractalType) method is called before any other setter method preventing proper scale and bias calculation.

1.0.4 fails to compile on GWT.

1.0.3 works fine on GWT, but 1.0.4 produces the following errors:

ModuleFactoryRegistry.java
         [ERROR] Line 68: The method format(String, String) is undefined for the type String
         [ERROR] Line 79: The method format(String, String) is undefined for the type String

multithreaded?

is this library multithreaded/thread safe, and which parts? the original library, accidental noise is threadable afaik.

Platformer Terrain Help

I recently got the platformer terrain generation working, and it looks amazing. I'm extremely happy with the result but I just have a few questions. I'm trying to generate worlds as big as Terraria which is a few million blocks. My blocks are 32x32 and when I start to scale the numbers up to make my world bigger it starts taking WAY longer to generate. It takes me about 14 seconds to generate 1.3 million blocks and my PC has a fast processor as well. It's not the rendering, it's the actual generation. I'll post a part of my generation code and I'm wondering how to speed up the performance? I haven't even gotten to the part where I generate ores, dirt, grass, trees, etc. so I'm hoping that I'm just using something wrong. Here's the code:

long start = System.currentTimeMillis();
/*
* WIDTH is 37760 pixels, I multiply a number by my block width which is 32. HEIGHT uses the same formula but a different number and it is 37440
*/
System.out.println("Starting world generation of world with dimensions " + WIDTH + " x " + HEIGHT + " estimated block count: " + ((WIDTH * HEIGHT) / (Block.WIDTH * Block.HEIGHT)));

    /*
     * This will be later to split up the rendering. I've tried generating individual chunks but the noise doesn't work well, it needs to be generated all at once
     */
    List<Chunk> world = new ArrayList<>();
    List<Block> blocks = new ArrayList<>();

    Module gen = Noise.getNoiseMod();
    float px, py, raw;

    // Carve basic world shape with air and stone

    for (int x = 0; x < WIDTH; x += Block.WIDTH)
    {
        for (int y = 0; y < HEIGHT; y += Block.HEIGHT)
        {
            px = x / (float) WIDTH;
            py = y / (float) HEIGHT;

            raw = (float) gen.get(px, py);

            raw = Math.max(0, Math.min(1, raw));

            if (raw == 1)
            {
                blocks.add(new Block(BlockType.STONE, x, y));
            }
            else
            {
                blocks.add(new Block(BlockType.AIR, x, y));
            }
        }
    }

    Chunk c = new Chunk(blocks); // For use with generating ores, etc.

    // Add ores - Here's where I need the most performance because I'll be looping through the world and checking for certain conditions

    /*for (int x = 0; x < WIDTH; x += Block.WIDTH)
    {
        for (int y = 0; y < HEIGHT; y += Block.HEIGHT)
        {

        }
    }*/

    float end = (System.currentTimeMillis() - start) / 1000;

    System.out.println("Finished generating world (" + blocks.size() + " blocks) in " + end + " seconds");

    world.add(c);

    return world;

Library should allow registration of custom module factories

Right now, the module factory is hardcoded to support only the modules defined in the library. This precludes support for custom modules. Custom modules can still be created, chained and sampled, but not serialized into from the ModuleMap data structure.

Example

Hi there, would it be possible for you to create a simple example of how to use your library. The included example is using includes that are not included.

Just a simple sample from start to finish would be great.

Thanks

Code cleanup

The code style for this project needs to be brought in-line with the style that I use in all my other projects. Once finished, the code style should be exported and maintained as part of the repository.

Code cleanup:

  • Make consistent code style
  • Export code style and keep in repository
  • Remove redundant modifiers (ie. public static enum..)

Cache working as intended?

I'm currently porting the C++ code myself to use in a C# project, since I sometimes don't understand the quirks of C++ I use this as a reference.

In the cache module, to me it seems it has to store the results for a given x,y pair so that when the cache is called again, the value is returned. Unless I miss something, your code ports the C++ version correctly, but they both just seem to cache the last value & only will work if the next call is the same coordinate.

Method calculate() in ModuleAutoCorrect forces 2D, 3D, 4D and 6D calculations.

ModuleAutoCorrect#calculate()

This poses a bit of a performance problem if, for example, the user is only going to sample the module chain for a single type of dimensional noise (ie. 2D, 3D, 4D or 6D) and uses a high sample rate large number of samples in the auto-correct module. The extra calculations, the extra time spent, is unnecessary.

I propose the following:

  • Split the calculate() method into multiple methods: calculate2D(), calculate3D(), calculate4D(), and calculate6D()
  • Deprecate the calculate() method
  • Provide a new method calculateAll() that is equivalent to the calculate() method

This would allow the user to perform only the calculations necessary for the type of dimensional noise they are going to sample.

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.