Giter Site home page Giter Site logo

zorpastaman / random-generators Goto Github PK

View Code? Open in Web Editor NEW
32.0 3.0 2.0 1.17 MB

Random generators for Unity is a collection of random generators, different distributions, modificators and filters.

License: MIT License

C# 100.00%
unity random-generator random-distributions random-modificators random-distribution random-generators random-modificator

random-generators's People

Contributors

zorpastaman 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

Watchers

 avatar  avatar  avatar

random-generators's Issues

[Feature] Document some possible uses of each distribution or other feature (especially for those who don't know the math too well)

Is your feature request related to a problem? Please describe.
I find probability and statistics confusing and unintuitive; This library is easy, it's just a thin wrapper over ideas that mostly aren't. I'm already getting a lot out of some of the simpler concepts (like weighted distributions), but I bet that someone with a deep understanding of the math would get a lot out of this library.

I assume you have this deep understanding, since you wrote the thing. In college I got a C in probability.

Describe the solution you'd like
Documentation for each distribution (or other interesting aspect of this library) that outlines some game-related scenarios in which it would be useful. Doesn't need to be exhaustive, a couple of sentences would suffice.

Describe alternatives you've considered
A probability textbook.

Additional context
I'm assuming that you're developing this library for use in your own projects? In that case, simply writing about the things you're using this library for would go a long way.

The main impetus for me opening this issue is that I'm trying to model a particular event in my game but don't know which distribution to use. (The details probably deserve a separate thread.)

Here's my use case, how would you suggest I apply your library to it?

I opened #1 with a clear idea of my needs, but not of how they relate to this package. So I'll describe what I'm trying to do, and I'd appreciate your insight in how your library can be used for it.

I'm making a falling-block puzzle game (think Tetris or Puyo Puyo or Columns) with multiplayer. Each block has a different shape, and each shape in turn is made of pieces from a fixed set of colors. These shapes and colors are represented in my game as ScriptableObjects.

The set of possible shapes and colors expands at fixed intervals; this is currently done by replacing the active probability distribution with a new preset one (as opposed to modifying it in-place).

The shapes and colors are determined randomly, but in multiplayer mode both players must get the same sequence of pieces (including color and shape). It's still random, but both players get the same seed at the start of the game and both RNGs are running at the same rate.

It's okay if colors and shapes use different RNGs, or even different seeds; however, both players must get the same set of seeds at the start of the game.

I have a gut feeling that Random-Generators will better fit this use case than my current implementation, but I don't know what that would look like in practice. What would you suggest?

Ability to set a seed (or maybe a System.Random instance)?

Hi there. I'm strongly considering using this library for probability distributions in my own game. However, I need to be able to set the initial seed for all distributions; I can't rely on UnityEngine.Random except for that initial seed. Is it possible to explicitly provide a seed (or a System.Random instance) for each generator to use?

[Bug] WeightedGeneratorProvider and WeightedGeneratorDependentProvider don't show their weights and values when Naughty Attributes is installed

Describe the bug
When NaughtyAttributes and Random-Generators are both installed in a project, the inspector for WeightedGeneratorProvider<T>s and WeightedGeneratorDependentProvider<T>s do not draw the weights and values of the provider's distribution.

To Reproduce

  1. Install Random-Generators.
  2. Create a WeightedGeneratorProvider<T> or WeightedGeneratorDependentProvider<T> from the Assets menu. In my case, I used IntWeightedGeneratorDependentProvider, available through Assets/Create/Random Generator Providers/Discrete Distributions/Weighted Distribution/Int Weighted Generator Dependent Provider.
  3. Populate the created distribution provider with your favorite values.
  4. Ensure it's saved.
  5. Install NaughtyAttributes.
  6. Open the previously-created distribution in the inspector.
  7. The values will not be visible or editable, so you won't be able to adjust them. (They will still be serialized.)

Expected behavior
This:

Screenshot 2021-07-21 165600

Actual behavior
This:

Screenshot 2021-07-21 165801

Unity Editor:

  • OS: Windows 10
  • Unity version: 2021.1.15f1
  • Package version: Random-Generators 1.3.0, Naughty Attributes 2.1.0

Additional context

  • This issue occurs with the built-in weighted generator providers and with subclasses.
  • Other generator providers are not affected.
  • I don't know if this is a bug in Random-Generators or in NaughtyAttributes, so I'm reporting the issue in both projects.
  • I initially believed that Odin Inspector was the culprit, but I was able to reproduce this issue in a blank project that did not have Odin installed.
  • Nothing is logged and no exceptions are thrown. The custom editor simply fails silently.

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.