Official Gacha Plugin Edit

Discussion in 'Javascript/Plugin Support' started by Sissel Cabanela, Dec 5, 2017.

  1. Sissel Cabanela

    Sissel Cabanela Veteran Veteran

    Messages:
    91
    Likes Received:
    17
    First Language:
    English
    Hello, I am currently attempting to use the official Gacha plugin included with the 1.1 Update which can be found here. Unfortunately, I seem to be even more inexperienced at JS than I thought, because after looking through the script I can't even seem to how it manages to randomly pull the items in the gacha at different rates for each level of rarity, as it seems to just randomly draw an item from the array based on length rather than rarity. Is there anyone who can help me learn to do the following:

    -Edit the rate of each pull(Example: A 3 Star Item is more common than a 3 Star Weapon, which is in turn obviously more common than a 4 Star Weapon)
    -Change what currency is used for the gacha, such as using an item in exchange instead of gold

    I also have another question, but that one is of less importance compared to these two.
     
    #1
    Joy Diamond likes this.
  2. Joy Diamond

    Joy Diamond Talkative Veteran

    Messages:
    135
    Likes Received:
    172
    First Language:
    English
    Primarily Uses:
    RMMV
    Sissel Cabenala,
    Can you please be more specific with your link please?
    • Your link leads to a thread with 12 pages responses ....
    • You can link to a specific response like this:
    upload_2017-12-6_17-10-9.png

    I looked in my RPG Maker MV 1.5.1 js/plugins, and did not find any Gacha plugin there ...​

    Thanks,

    Joy Diamond
     
    #2
  3. Sissel Cabanela

    Sissel Cabanela Veteran Veteran

    Messages:
    91
    Likes Received:
    17
    First Language:
    English
    @Joy Diamond
    My apologies, still very green to the forums. On that note, it turns out the link to the plugin is a huge 170MB file so I simply uploaded it to a pastebin temporarily instead, if that's alright.



    Sorry about that.
     
    #3
    Joy Diamond likes this.
  4. Joy Diamond

    Joy Diamond Talkative Veteran

    Messages:
    135
    Likes Received:
    172
    First Language:
    English
    Primarily Uses:
    RMMV
    Sissel Cabanela,

    We are all very new to the forums -- I've used them less than a month myself.

    Can you still please give me a link to where you found Gacha links.
    • Please see my message above as to how to find the link.
    • If that is too confusing, please just say which thread # of the original message you linked above you found this in.
    I'll want to see the original message for all sorts of extra details, like:
    • if it is linked to github;
    • what it's license is;
    • etc.
    Thanks,

    Joy Diamond
     
    #4
  5. Sissel Cabanela

    Sissel Cabanela Veteran Veteran

    Messages:
    91
    Likes Received:
    17
    First Language:
    English
    #5
    Joy Diamond likes this.
  6. Joy Diamond

    Joy Diamond Talkative Veteran

    Messages:
    135
    Likes Received:
    172
    First Language:
    English
    Primarily Uses:
    RMMV
    Sissel Cabanela,


    Thanks, I found it :) ... so I have a few concerns:
    • This is from RPG Maker version 1.1 from May, 2016 (one and a half years ago).
    • Gacha is not part of the current RPG Maker version 1.5.1.
    There is this message which is interesting:

    It's from May, 2017 (this year). So not clear if best to look at the Gacha from 1.1, or if the Kadokawa plugin's are using it. Have to research that.

    Meanwhile that big 170 MB update is downloading on my computer ....
    • I'll post an update once I read the code.
    Joy Diamond.

    Updates:
    First problem, this is a zip file & I have no window tool to extract zip files since winzip trial expired & wants way too much money for such a simple tool:
    • Removing Winzip;
    • Replacing with 7-Zip.
    upload_2017-12-6_18-21-46.png
     
    Last edited: Dec 7, 2017
    #6
  7. Sissel Cabanela

    Sissel Cabanela Veteran Veteran

    Messages:
    91
    Likes Received:
    17
    First Language:
    English
    @Joy Diamond
    The Plugin I posted/linked is the one from Kadokawa, I believe. At the top of the header it reads "(c)2016 KADOKAWA CORPORATION./YOJI OJIMA" and to my knowledge they have not released any variant nor update of this plugin, though the download does come with a 'demo' of sorts, I believe. I know I have a demo on my computer somewhere, so I'm gonna go on memory and say it was from that plugin zip.

    Currently it seems to run fine as is on my current version of RPG Maker (1.5.1) so I think it should be fine as far as standard compatibility goes, non?
     
    #7
    Joy Diamond likes this.
  8. Joy Diamond

    Joy Diamond Talkative Veteran

    Messages:
    135
    Likes Received:
    172
    First Language:
    English
    Primarily Uses:
    RMMV
    Ok, so I found the sample game:

    upload_2017-12-6_18-32-51.png

    upload_2017-12-6_18-28-16.png

    upload_2017-12-6_18-28-52.png

    upload_2017-12-6_18-29-43.png

    upload_2017-12-6_18-30-19.png

    She looks like my long lost sister! Woot!
     
    Last edited: Dec 7, 2017
    #8
  9. Sissel Cabanela

    Sissel Cabanela Veteran Veteran

    Messages:
    91
    Likes Received:
    17
    First Language:
    English
    @Joy Diamond
    Quite! So what you drew there was a 2 Star card, as you can tell by the indicator at the bottom of the card. There are a total of 5 stars corresponding to rarity, with 5 Star being the rarest and 1 Star being the most common. However- at the very least to my knowledge, the plugin currently does not differentiate 'rarity' in terms of rate. By that I mean you're just as likely to pull a 2 Star like you just got as often as you would pull a 5 Star card, which should not be the case.

    Let's say we have 5 items we can pull from the gacha, each with a unique Tier of rarity(1,2,3,4,5). As it stands, you have a 20% chance to pull any of those cards, regardless of rarity. What I want is something akin to: A Rank 1 item has a 50% chance of being pulled, whereas a 5 Star Item has merely a 1% chance due to the rarity. Does that make sense?
     
    #9
    Joy Diamond likes this.
  10. Joy Diamond

    Joy Diamond Talkative Veteran

    Messages:
    135
    Likes Received:
    172
    First Language:
    English
    Primarily Uses:
    RMMV
    Sissel Cabanela,
    Well, we've clearly found the first defect in this code:

    Seriously, look carefully:
    [​IMG]

    I mean that should definitely be a 5 star not a 2 star card!!!
    • I mean anyone that looks like my long lost sister has to be a 5 star card!
    • (I wonder what horrible fate befell her, that she was demoted to a 2 star card :confused:)
    Don't you agree she has to be a five star card?
    Playfully,

    Joy Diamond.

    P.S.: Ok, back to being serious, reading the code now ... (and yes, what you want makes sense).

    UPDATES:
    upload_2017-12-6_18-50-27.png
    upload_2017-12-6_18-54-45.png
    upload_2017-12-6_18-57-17.png
    upload_2017-12-6_19-0-45.png
    upload_2017-12-6_19-5-53.png
     
    Last edited: Dec 7, 2017
    #10
  11. Sissel Cabanela

    Sissel Cabanela Veteran Veteran

    Messages:
    91
    Likes Received:
    17
    First Language:
    English
    @Joy Diamond
    Sometimes I wonder what happened to Trinity...SOMETIMES I WONDER WHAT HAPPENED TO JOEY WHEELER........

    Anyway, I agree, but I've honestly never touched the Gachabook, which is probably a major oversight on my part if that has anything to do with pull rate, but at a glance it wasn't correlated. And I've seen said parameters, but they don't actually seem to affect the pull rate. They do make it so that you can distinguish what you pull with a different animation based on the Rank of the card, but don't change the pull rate. It seems to just push all the Gacha Items added with 'gacha add item x' into an array and pull 1 at random with no regard for rarity until AFTER the pull.
     
    #11
  12. Joy Diamond

    Joy Diamond Talkative Veteran

    Messages:
    135
    Likes Received:
    172
    First Language:
    English
    Primarily Uses:
    RMMV
    A real life friend just came over to visit, so we are going to work together on a plugin we are writing.
    • I'll look at this more tomorrow, and figure out how it is drawing items.
    • For an experiment, I'll make the chance to draw "my sister" at 50%.
    • That should then give you guidance on changing the rest of the code, so it does proper % that you want.
     
    #12
  13. Sissel Cabanela

    Sissel Cabanela Veteran Veteran

    Messages:
    91
    Likes Received:
    17
    First Language:
    English
    @Joy Diamond
    Whenever you have the time that would be greatly appreciated, thank you very much!
     
    #13
  14. Joy Diamond

    Joy Diamond Talkative Veteran

    Messages:
    135
    Likes Received:
    172
    First Language:
    English
    Primarily Uses:
    RMMV
    Ok, my friend & I just found the code you want changed in Gacha.js:

    upload_2017-12-6_19-18-54.png

    This will be pretty easy to change:
    • As I wrote above, I can easily do this tomorrow.
    • I'll post a response or update this message once I do that.
     
    #14
  15. Sissel Cabanela

    Sissel Cabanela Veteran Veteran

    Messages:
    91
    Likes Received:
    17
    First Language:
    English
    @Joy Diamond
    Ah yes, that is the line that I was looking over but I couldn't for the life of me deduce the rarity. Thank you very much, I can certainly wait until you are free as I had some more questions and strongly appreciate your time and help.
     
    #15
  16. Joy Diamond

    Joy Diamond Talkative Veteran

    Messages:
    135
    Likes Received:
    172
    First Language:
    English
    Primarily Uses:
    RMMV
    Ok, so this seems pretty simple to understand the code now.

    Going through it, there are a bunch of events on the main map:

    upload_2017-12-6_22-2-2.png

    Clicking on each of the events shows what they do:

    upload_2017-12-6_22-3-24.png
    upload_2017-12-6_22-4-41.png
    upload_2017-12-6_22-6-3.png
    upload_2017-12-6_22-7-25.png
    upload_2017-12-6_22-8-13.png

    Moving along, we clearly want to look at items 5-9:

    upload_2017-12-6_22-11-14.png

    The question then arises what is GachaRank & what does it affect?
    • For that we need to look at the code ...
    Reading the code, the ranks having nothing to do with the value of the card, but are all about animations:

    upload_2017-12-6_22-16-21.png

    So at this point, we have determined how the system works & it doesn't have a way to do rarities ...
    • Obviously, the next step is to add rarities
    Reading the code it already has rarities, which it calls gachaNumLot:

    upload_2017-12-6_22-26-26.png

    This seems to be the solution to your issues, just use gachaNumLot
    upload_2017-12-6_22-41-55.png

    And the result is quite clear:

    upload_2017-12-6_22-44-32.png
    This matches the items in game, it shows item #5 has a gachaNumLot of 5, and item #9 has a gachaNumLot of 1.
    • Problem solved :cool:
    • Do I get a gold star?
     
    Last edited: Dec 7, 2017
    #16
  17. Sissel Cabanela

    Sissel Cabanela Veteran Veteran

    Messages:
    91
    Likes Received:
    17
    First Language:
    English
    @Joy Diamond
    You get 5, Ms. Joey Wheeler's Sister's actual Twin Sister. Let me also just say thank you for adding these images to help properly convey your points, they help out quite a lot(I'm actually curious as to what program you use for such).

    If I can bother you for a bit more, while this does help modify the rarities immensely- is there a way to make it more precious? Unless my math is wrong, and it usually is, this current methods makes rare items become even more difficult to get as other items of lesser 'rarity' are added it, no? For instance, lets say I had 2 items in the gacha, Items A and B. Item A has numlot 1 and B has numlot 5. The odds of getting A are 1 in 6. If I add Item C with numlot 4, Item A now drops to a 1/10 chance, yeah?

    Is there a way I can make it so that it rolls the rank/rarity of the Pull first, then the item? To elaborate, let's say I want 5 Star items to have 1% of being pulled. So in the gacha, if you manage to roll that 1%, it pulls a random 5 Star Item from the list of 5 Star Items in the gacha. Sorta like a double gacha, I guess, but all of the 5 Stars would have the same pull rate in this scenario. I understand I may have explained that poorly, however.
     
    #17
  18. Joy Diamond

    Joy Diamond Talkative Veteran

    Messages:
    135
    Likes Received:
    172
    First Language:
    English
    Primarily Uses:
    RMMV
    Sissel Cabenala,

    I'm gone for a few days:

    Yes, you can do all that (the rarity questions) -- though would require programming it in JavaScript.
    • I'm gone for a few days (traveling to my niece's wedding :cool:)
    Hopefully others can help you.
    Gacha plugin & Licensing:

    From what I can tell the Gacha plugin's are very nicely written, it would be great to get them support again:
    • One very important thing you might want to do, if you plan to use Gacha, is find out about the license.
    • They did not come with a license.
    • The copyright says:
      • (c)2016 KADOKAWA CORPORATION./YOJI OJIM
    • So, you could guess they are either licensed same as RPG Maker MV, or they are licensed same as RPG Maker MV Corescript (these are two different things):
    • The UI we purchased: RPG Maker MV is, appropriatly, closed source. This is what creates games.
    • Part of the core game: RPG Maker MV CoreScript is MIT licensed.
    • You can read this: RPG Maker MV Corescript for an explanation of what 'RPG Maker MV CoreScript' is.
    • However, he is, obviously, very busy -- and it might take a while to research this question.
    If you just plan to use Gacha, then finding out the license is not critical; however, if you plan to modify it, then it becomes pretty important to find out the license.
    • Since, apparently, you do plan to modify it (or have someone modify it for you), then it would see to me, finding out the license is pretty important.
    And as I wrote above "From what I can tell the Gacha plugin's are very nicely written" so this would probably be a worthwhile endeavor, to find out the licensing, get modifications done & see about having them supported more ...
    About 1% probabilities:

    Just one small point, giving something 1% probability is probably too low a probability for this kind of game:
    • It means a user could easily have to try 200 times (if they have bad luck) to try to get a five star card.
    • I suggest 5% as the lowest probability that is reasonable to give the user a challenge, but not make it too frustrating (if they have bad luck).
    Also it's generally a good idea, when they fail to get the 5 star card, each time they try again the probability increases; so that eventually, say after 20 tries, they are guaranteed to get a 5 star card.
    Best wishes,

    Joy Diamond.

     
    #18
  19. Archeia

    Archeia Level 99 Demi-fiend Staff Member Developer

    Messages:
    14,652
    Likes Received:
    14,413
    Location:
    Game Dev Salt Mines
    First Language:
    Filipino
    Primarily Uses:
    VNM
    You can use it commercially or modify it. It's part of RPG Maker MV's default.
    Also she*
     
    #19
    Joy Diamond likes this.
  20. Sissel Cabanela

    Sissel Cabanela Veteran Veteran

    Messages:
    91
    Likes Received:
    17
    First Language:
    English
    @Archeia
    Ah, that is what I thought I had read as well. You are the Plugin Creator then? Do you know why this plugin is not included with updated versions with RMMV? I had not noticed due to already having the plugin.
     
    #20

Share This Page