I want ideas for extensions to make

Exactly that kind of thing.
I’ll search again, but there are some formula online which give a bigger range of number and with a good repartition

Online searches gave me this:

var seed = 15847; //This is the seed, change it to any number

function random() {
  var x;
  var num;
  do {
    x = Math.sin(seed) * 10000;
    seed = (seed * 1103515245 + 12345) % 0x80000000;
    num = Math.floor(Math.pow((x - Math.floor(x)) * 5, 2)) + 1;
  } while (num > 7);

  return num;
}

const array = [];

//2000 is the number of elements in the array, change it to any number
for (i = 0; i < 2000; i++) {
  array.push(random(seed));
}

Array.prototype.findS = function(x) {
  const returnArray = [];
  for (i = 0; i < this.length; i++) {
    this[i] === x && returnArray.push(x);
  }

  return returnArray.length;
};

console.log(array);
console.log("One: "+array.findS(1)+" Two: "+array.findS(2)+" Three: 
"+array.findS(3)+" Four: "+array.findS(4)+" Five: "+array.findS(5)+" 
Six: "+array.findS(6)+" Seven: "+array.findS(7));

It results an array with 2000 random numbers, the rarity is from 1 to 7, greater the number, rarer it is.

It is always the same sequence for the same seed.
I will convert this to GDevelop events and create an extension

Edit: fixed a problem in the code

Hmm. Yeah ! That’s the idea :+1:
However, usually with a random number generator we seek uniformity in the numbers repartition, no ? So that sin() is a bit of an issue.

That discussion has many other ideas (but I suspect that it is the one you read ?)

This one looks promising too :

var m_w = 123456789;
var m_z = 987654321;
var mask = 0xffffffff;

// Takes any integer
function seed(i) {
    m_w = (123456789 + i) & mask;
    m_z = (987654321 - i) & mask;
}

// Returns number between 0 (inclusive) and 1.0 (exclusive),
// just like Math.random().
function random()
{
    m_z = (36969 * (m_z & 65535) + (m_z >> 16)) & mask;
    m_w = (18000 * (m_w & 65535) + (m_w >> 16)) & mask;
    var result = ((m_z << 16) + (m_w & 65535)) >>> 0;
    result /= 4294967296;
    return result;
}

What do I have to log on the console there to check the result?

eerh. I did not understand your question :sweat_smile:
You mean, “how to test the quality of this pseudo random generator” ?

No, I mean how can I see the number generated with it?

It always point out 0.703 when I try to log things in the console or something like that

An extension to make Yarn dialogue trees easier to use would be nice.

An extension that adds parent/child behavior and object tags similar to in Unity, where if an object is set as child it will match the position and rotation relative to the parent object as if it is one object, and tags where you can set an object to a tag and check if an object is in collision with an object matching the tag.

I’m pretty sure you are describing “Object1 variable tag is equal to Object2.Variable(tag)” + collision check

We have this it is called Sticker extension

Well I cant because I dont use Yarn

Does this work with checking if one object is in collision with any object that has that variable?

Thanks, I’ll check that out.

Thats simple make an object group and add every object you want to test against to it

Ah okay, thank you for telling us.

There are few things that I would like to see:

  • Wind shader effect (to make 2D plants and trees move as waves).
    +Interactive grass (When entity touch it, grass opens path from the point of collision without open it completely unless entity step outside grass. Similar to 3D Foliage).
  • Water shader effect (water acts like it’s real. doesn’t need to be realistic graph, though).
  • Shop, buy and sell system (add economy system).
  • reflection (water and mirror effect)
  • Rig and Bones for 2D Sprites (Will help a lot with game size).
  • 2D Shader pixel animation (SS program that makes 2D looks 3D).
  • Tile transform (like minecraft, block/tile transform into another block/tile when tool hit block).
  • Online chat (been able to chat with other players worldwide).
  • Day cycle (Day and night cycle).
  • Weather (Rain, cloudy, snow, storm, or just the first one).

I’ll stop. I found some of them on youtube, made posible in unity or blender.
Hope you can make some of them.

“Dynamic water” (Community extension)

“Make it rain” (Community extension)

There is already a layer effect for that.

You can’t add a shop without also adding a inventory system, and there is already many inventory extensions in GDevelop.

Thats just too easy to do with timers and variables, not worth an extension

This is not something a GDevelop extension can do.

This is not something a GDevelop extension can do.

This is not something a GDevelop extension can do.

Thats something the game developer should implement.

No idea what you meant there.

1 Like

Sway extension is probably similar

https://wiki.gdevelop.io/gdevelop5/extensions/sway/

Example: when “pickaxe click dirt”, then “dirt is deleted”.
Replace “dirt” with “farmland”.

Makes it able to transform tiles to other tiles, like automatic.

Thats just too game specific (and simple) to make an extension around it. & you dont need to delete the block, just change its animation.

Ha ok. I believe that m_v and m_z are “incremented” every use. So in Gdevelop, they should probably be declared as global variables.
Or if the seed generator is a behaviour attached to an object, m_v and m_z should be properties. So each object with this behaviour can have its own seed, and number sequence.

Can it generate an array of pseudo-random numbers?