Skip to main content
added 636 characters in body
Source Link
Thijser
  • 955
  • 10
  • 28
  1. When you want to place such an object you instead place a cluster centre, you then place a given number (random or pre chosen) number of decorator objects around this with a distance determined by any formula (normal distribution works well). The advantage of this is it' s ease to implements and it's speed.

  2. You can create a chance map, this is a map gives the chance of each tile containing an objects. You you make each of these positions into their own object you can put them in an array and shuffle them. When you place an object you can let it affect the chance of similar items appearing (either positively or negatively). The advantage A good example of this method is that you can decide that an object increases the chance of a similar item appearing at a medium range while reducing the chance of a small range. Because you visit each tile in a random order you could even completely remove the chance element and instead use what would otherwise be the chance affect the size, this means that such a pattern has the biggest object in the middle. The advantage of this method is it's flexibility.following code:

  3.  
    float offsetx=nextGaussian()*deviation+basedistance
    float offsety=nextGaussian()*deviation+basedistance 
    
    if (nextRandom()>0.5)
        offsetx*-1
    if (nextRandom()>0.5)
        offsety*-1
    placeitem(x+offsetx,y+offsety)
    

    Pre designed patterns:where deviation determines the most predefined method you give a setspread of patterns and ask the computer to tryitems and place those instead, useful for example when dealing with mushroom circles that have to be perfectly circulair.

  4. complete simulation: by running a simulation of what proces creates the patterns in naturebasedistance how much you can put them naturally in games, for example plants have a given range in which they spread their seeds and they make it harder for other plantswant to growprevent items from being very close to them. These two together will make patches of the same plant grow together but not to close, combine with plants preferring certain climates and you will soon get a very natural spread of plantsone another (note that this does require you to balance nature as well as the game itself or else somecreates a bit of these things can go extincta circle).

An alternative is to call this function again and again from each new object (with a change of it stopping)).

  1. You can create a chance map, this is a map gives the chance of each tile containing an objects. You you make each of these positions into their own object you can put them in an array and shuffle them. When you place an object you can let it affect the chance of similar items appearing (either positively or negatively). The advantage of this method is that you can decide that an object increases the chance of a similar item appearing at a medium range while reducing the chance of a small range. Because you visit each tile in a random order you could even completely remove the chance element and instead use what would otherwise be the chance affect the size, this means that such a pattern has the biggest object in the middle. The advantage of this method is it's flexibility.

  2. Pre designed patterns: the most predefined method you give a set of patterns and ask the computer to try and place those instead, useful for example when dealing with mushroom circles that have to be perfectly circulair.

  3. complete simulation: by running a simulation of what proces creates the patterns in nature you can put them naturally in games, for example plants have a given range in which they spread their seeds and they make it harder for other plants to grow close to them. These two together will make patches of the same plant grow together but not to close, combine with plants preferring certain climates and you will soon get a very natural spread of plants (note that this does require you to balance nature as well as the game itself or else some of these things can go extinct).

  1. When you want to place such an object you instead place a cluster centre, you then place a given number (random or pre chosen) number of decorator objects around this with a distance determined by any formula (normal distribution works well). The advantage of this is it' s ease to implements and it's speed.

  2. You can create a chance map, this is a map gives the chance of each tile containing an objects. You you make each of these positions into their own object you can put them in an array and shuffle them. When you place an object you can let it affect the chance of similar items appearing (either positively or negatively). The advantage of this method is that you can decide that an object increases the chance of a similar item appearing at a medium range while reducing the chance of a small range. Because you visit each tile in a random order you could even completely remove the chance element and instead use what would otherwise be the chance affect the size, this means that such a pattern has the biggest object in the middle. The advantage of this method is it's flexibility.

  3.  

    Pre designed patterns: the most predefined method you give a set of patterns and ask the computer to try and place those instead, useful for example when dealing with mushroom circles that have to be perfectly circulair.

  4. complete simulation: by running a simulation of what proces creates the patterns in nature you can put them naturally in games, for example plants have a given range in which they spread their seeds and they make it harder for other plants to grow close to them. These two together will make patches of the same plant grow together but not to close, combine with plants preferring certain climates and you will soon get a very natural spread of plants (note that this does require you to balance nature as well as the game itself or else some of these things can go extinct).

  1. When you want to place such an object you instead place a cluster centre, you then place a given number (random or pre chosen) number of decorator objects around this with a distance determined by any formula (normal distribution works well). The advantage of this is it' s ease to implements and it's speed. A good example of this is the following code:

    float offsetx=nextGaussian()*deviation+basedistance
    float offsety=nextGaussian()*deviation+basedistance 
    
    if (nextRandom()>0.5)
        offsetx*-1
    if (nextRandom()>0.5)
        offsety*-1
    placeitem(x+offsetx,y+offsety)
    

    where deviation determines the spread of the items and the basedistance how much you want to prevent items from being very close to one another (creates a bit of a circle).

An alternative is to call this function again and again from each new object (with a change of it stopping)).

  1. You can create a chance map, this is a map gives the chance of each tile containing an objects. You you make each of these positions into their own object you can put them in an array and shuffle them. When you place an object you can let it affect the chance of similar items appearing (either positively or negatively). The advantage of this method is that you can decide that an object increases the chance of a similar item appearing at a medium range while reducing the chance of a small range. Because you visit each tile in a random order you could even completely remove the chance element and instead use what would otherwise be the chance affect the size, this means that such a pattern has the biggest object in the middle. The advantage of this method is it's flexibility.

  2. Pre designed patterns: the most predefined method you give a set of patterns and ask the computer to try and place those instead, useful for example when dealing with mushroom circles that have to be perfectly circulair.

  3. complete simulation: by running a simulation of what proces creates the patterns in nature you can put them naturally in games, for example plants have a given range in which they spread their seeds and they make it harder for other plants to grow close to them. These two together will make patches of the same plant grow together but not to close, combine with plants preferring certain climates and you will soon get a very natural spread of plants (note that this does require you to balance nature as well as the game itself or else some of these things can go extinct).

Source Link
Thijser
  • 955
  • 10
  • 28

There are multiple ways to do this:

  1. When you want to place such an object you instead place a cluster centre, you then place a given number (random or pre chosen) number of decorator objects around this with a distance determined by any formula (normal distribution works well). The advantage of this is it' s ease to implements and it's speed.

  2. You can create a chance map, this is a map gives the chance of each tile containing an objects. You you make each of these positions into their own object you can put them in an array and shuffle them. When you place an object you can let it affect the chance of similar items appearing (either positively or negatively). The advantage of this method is that you can decide that an object increases the chance of a similar item appearing at a medium range while reducing the chance of a small range. Because you visit each tile in a random order you could even completely remove the chance element and instead use what would otherwise be the chance affect the size, this means that such a pattern has the biggest object in the middle. The advantage of this method is it's flexibility.

  3. Pre designed patterns: the most predefined method you give a set of patterns and ask the computer to try and place those instead, useful for example when dealing with mushroom circles that have to be perfectly circulair.

  4. complete simulation: by running a simulation of what proces creates the patterns in nature you can put them naturally in games, for example plants have a given range in which they spread their seeds and they make it harder for other plants to grow close to them. These two together will make patches of the same plant grow together but not to close, combine with plants preferring certain climates and you will soon get a very natural spread of plants (note that this does require you to balance nature as well as the game itself or else some of these things can go extinct).