Skip to content

New extension: <Statistics> #1601

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
3 tasks done
arelaestudio opened this issue Mar 16, 2025 · 1 comment
Open
3 tasks done

New extension: <Statistics> #1601

arelaestudio opened this issue Mar 16, 2025 · 1 comment
Labels
✨ New extension A new extension

Comments

@arelaestudio
Copy link

arelaestudio commented Mar 16, 2025

Description

Its main function is the "normal random number generator" (NormalRNG). This function generates a random number that follows a normal (bell-shaped) distribution. Such distribution has a central tendency value (mean) and a margin of deviation (standard deviation). NormalRNG is bounded so that extreme values (abnormally high or small numbers, called outliers) do not ocurr.

This extension also includes a library of common values to check for probability, be it the chance of being above a certain number (one-tailed, "potxx") or the chance of being inside a range (two-tailed, "pttxx") where xx is the chance of success.

How to use the extension

Normal random number generator is an expression that can be used to create a normalized random number, where not all numbers will be as likely. The numbers will follow a normal distribution in which numbers close to a value (called "mean") are more likely to happen. How close or far the numbers appear to the mean is called "standard deviation". For the expression, the input is one standard deviation (also called "1 sigma"). The numbers will appear up to three standard deviations away from the mean. For example, if mean:5 and standard deviation:1, the expression will give numbers between 2 (5-3x1) and 8 (5+3x1). The "equivalent" expression for a flat distribution would be RandomFloatInRange(2,8). In the normal distribution, 5 is likely while the extreme values (2 and 8) are less likely. In the flat distribution, all numbers are as likely to appear. Use this expression to create numbers around a certain value. Real life examples of normal distributions are people height, IQ and walking speed.

Probability check is an expression that tells you how likely a number is to be. Use the OneTail type to find the probability of being above (or below) a goal. A real life example would be a grade list: the top student will be above 100% of their classmates. If you got 8/10... above how many classmates are you? In games, this can be used to check for the rarity of an item, drop or equipment, etc. Uste the TwoTails type to find if something belongs or not to a group, or is inside a range. In real life this is used to determine differences: 100.1 is bigger than 100... but barely so. A game could use this to check if an attack was critical or not, among others.

Note: Normal distributions and Flat distributions have different statistics, so I do not recommend using one for the other (e.g. making a OneTail check of the throw of one dice).

Checklist

  • I've followed all of the best practices.
  • I confirm that this extension can be integrated to this GitHub repository, distributed and MIT licensed.
  • I am aware that the extension may be updated by anyone, and do not need my explicit consent to do so.

What tier of review do you aim for your extension?

Reviewed

Example file

Statistics Example.zip

Extension file

Statistics.zip

@arelaestudio arelaestudio added the ✨ New extension A new extension label Mar 16, 2025
Copy link
Contributor

👋 Thanks for your submission! Unfortunately, all submitted extensions have to meet some minimal quality standard - the extension best practices - and our system has found that your extension does not fully comply 😔. You can find all of those rules on the GDevelop wiki.

The following issues have been found by the system concerning the respect of those best practices by your extension:

  ⟶ ❌ [Dots in sentences]: Field 'shortDescription' of the extension description misses a dot at the end of the sentence!
  ⟶ ❌ [Dots in sentences]: Field 'description' of the function 'NormalRNG' misses a dot at the end of the sentence!

Please update your original submission post with a new zip file containing your extensions updated to follow those guidelines 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ New extension A new extension
Projects
None yet
Development

No branches or pull requests

1 participant