Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7593981
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T21:18:23+00:00 2026-05-30T21:18:23+00:00

I am using a perlin noise function to generate data for a game I

  • 0

I am using a perlin noise function to generate data for a game I am making, but for some reason it keeps returning the exact same results for different inputs. I spent like 4 hours trying to debug this on my FBM function and couldn’t figure it out so I tried Ken Perlin’s improved noise function and the same thing happens.

Does anyone know why this is? What is a good way to fix it? The only thing I have been able to do is add a decimal value like .6473 to the x and y coordinates, which helped, but introduced other problems such as the values repeating themselves inside the arrays.

Here is some test code. I am trying to create two different 2D arrays filled with noise values. The x and y inputs are coordinates from my game. On the lines with ‘**‘ after them, if I don’t increase those values, both arrays will be filled with all zeros. In the example, the coordinates (0.0, -768.0) and (-1024.0, -768.0) return the exact same noise values. In my game, 9 different coordinates return the same values.

The Perlin Noise function I am using for this test is here

public class TestPerlinMain
{
    public static void main(String[] args) 
    {
        int seed = 532434;

        //create first noise array
        double x = 0.0;    //x-coordinate
        double y = -768.0; //y-coordinate
        float z = 10.0f;

        double[][] test = new double[15][15];

        System.out.println("Noise Array 1: ");

        for(int i = 0; i < test.length; i++)
        {
            for(int j = 0; j < test[i].length; j++)
            {
                test[i][j] = ImprovedNoise.noise(x + (j * 64.0), y + (i * 64.0), 10.0);
                x += .314f;//************

                System.out.print(test[i][j] + " ");
            }
            y += .314f;//***********

        }
        System.out.println();

        //create 2nd noise array
        double x2 = -1024.0; //x coordinate
        double y2 = -768.0;  //y coordinate
        float z2 = 10.0f;    

        System.out.println();

        double[][] test2 = new double[15][15];

        System.out.println("Noise Array 2: ");

        for(int i = 0; i < test2.length; i++)
        {
            for(int j = 0; j < test2[i].length; j++)
            {
                test2[i][j] = ImprovedNoise.noise(x2 + (j * 64.0), y2 + (i * 64.0), 10.0);
                x2 += .314f;//*************

                System.out.print(test2[i][j] + " ");
            }
            y2 += .314f;//************

        }
        System.out.println();
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T21:18:25+00:00Added an answer on May 30, 2026 at 9:18 pm

    Perlin noise is defined to be 0 at all grid locations (integer x, y, z). You can prove this to yourself by hand-simulating it in the code you linked. Since x, y, and z all become 0 when their floors are subtracted, the grad() values are all 0, so the lerp() values are all 0.

    There are several ways to get the noise you want. First, if you use a non-integer value of z, then you should get random values of noise. However, since your grid spacing of 64 is much larger than the noise basis, this will look like static, not Perlin noise. A better approach would be to scale up the noise by doing something like noise(j/4., i/4., z). Sampling 4 points across each noise cell will allow some of the smoothness of the noise to be seen.

    Note also that your noise implementation is designed to repeat with tiles of size 256 in each direction (see the first line of noise(). This is why you get repeating values every 4 in your array.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using libnoise to generate Perlin noise on a 1024x1024 terrain grid. I want
I'm implementing a coherent noise function, and was surprised to find that using gradient
I'm trying to implement 2D Perlin noise generation in C++, and some implementations I
I'm trying to create super simple Perlin noise clouds in a fragment shader, using
I have a game with infinity procedually generated terrain. I'm using 1/f noise for
Using C# .NET 3.5 and WCF, I'm trying to write out some of the
Using C# and System.Data.SqlClient, is there a way to retrieve a list of parameters
Using Android TelephonyManager an application can obtain the state of data activity over the
Using Xcode4.2.1, with a basic PhoneGap template based app. (I say template, but I
I'm working with Perlin Noise for a height map generation algorithm, I would like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.