Home>

I will post for the first time.
This is a vague question this time, but I hope I can understand the overall method.

As you can see in the title, I often see social games and other summary sites.
If i know how gacha simulators are made, please let me know.

I have some programming experience and currently run several sites based on WordPress.

I would like to create a gacha simulator if possible. Which language is necessary, PHP or JavaScript?

  • Answer # 1

    Is that all right?

    No, if you want to make your own
    Any language that can use random functions is possible, and the rest is the idea of ​​winning rate, so you should have the information to win somewhere.
    If you want to know the logic, it will come out if you investigate.

    Added.
    The contents are more important than any mechanism

  • Answer # 2

    To create a backend mechanism, PHP and other languages ​​that run on the server will be necessary.
    You may also need a database (MySQL/MariaDB) for data processing.

    I think js cannot be avoided to create a front-end mechanism.

    Rather than js itself
    If you use "front-end framework"
    I think it's easy to do interactive things.

  • Answer # 3

    I think it can be done with JavaScript or PHP.
    For example, JavaScript

    const a = [{path: "<imgPath>", p: 1}, {path: "<imgPath>", p: 1}/* .. . * /];
    function Gacha () {
      let v = Math.Random () * 100;
      let sum = 0;
      for (let i = 0;a.length;i ++) {
        sum + = a [i] .p;
          if (sum<v) {
            return a [i] .path;
        }
      }
    }


    (I don't know if it moves because it has not been verified yet), and if you press the button, you can hit Gacha () with onclick and hit imgPath in the img element.
    The img element can be prepared in HTML, or it can be created dynamically using JS.

    I'm not familiar with WordPress itself, but if you have a gacha function, can I use it? (Laughs)