Announcement

Collapse
No announcement yet.

Gambling

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Gambling

    Does anyone know of a way to make a gambling game in RPGM 3?

    #2
    Re: Gambling

    Well, as you may have read through some of the older posts here, RPG Maker 3 doesn't have a true random number generator.

    You would have to use Variables and Modes to make a "pseudo-random number generator." I'm pretty sure that Perversion has made mention of this several times in his posts because I know that he's incorporated something like it in his games he's created.

    Welcome to the Pavilion, by the way!!

    Search the term pseudo random number generator and it will bring up some good posts from several years ago. There is no need to post in those threads though because some here may look down on that.
    Last edited by Pagerron; 07-01-2010, 01:48 PM.
    " I am the way, the truth, and the life. No one comes to the Father but by me. " - Jesus

    Comment


      #3
      Re: Gambling

      Thanks, I'll do that.

      Comment


        #4
        Re: Gambling

        Just a shout-out to Wavelength as well, as he's the other RPGM3 user here that makes heavy use of a pseudo random number generator.

        You might also look for the "gold tracking" explanation (I think it's in either the "Newbies...read this first" thread, or the "Tips and Tricks" thread). Obright devised a method to track gold even if using random enemy encounters.


        As a heads-up, any use of gambling in an RPGM3 game will force you to not use the default shops. You'll have to make custom shops, and either have enemy encounters placed using events (so you can track gold via variables) or use random encounters, and use Obright's method referenced above.


        Also, welcome, Dirty Idiot!

        Comment


          #5
          Re: Gambling

          Yup, welcome to the forums Dirty!

          It depends what kind of gambling game you want to make. Making something like Blackjack (which requires tracking a couple different things and comparing them with each other) is a lot different than making something like rock-paper-scissors (which can be pretty easily done in one shot), which is again different from something which would require a computer AI to react to random elements.

          So if you tell us what you've got in mind maybe we can give you some better advice!

          But everything Pagerron & Perversion said was entirely correct; the most basic element behind any kind of gambling construct is probably going to be a pseudo-random number generator. The best way I've found to do this (so that as the creator even I have a hard time manipulating my own game's RNG when I play it) is to have two or three variables (that are used solely to track your "random numbers") that change in arbitrary ways when the player does something that they won't always do, and/or change based on timed Auto Events (this is a little trickier), and to have those variables change based on the

          For example, in a standard RPG, you might have a random, unimportant NPC that the player might talk to once, might talk to multiple times, or might not talk to at all. (Imagine you have three random variables, Shared Var 1 that changes between 1 and 10, and Shared Var 2 and 3 that each change between 1 and 4.) Inside that dialogue (and the player would never see this), you might have coding similar to the following:

          Increase Shared Var 2 by 2
          If Shared Var 2 is greater than or equal to 5:
          ....Decrease Shared Var 2 by 4 [this keeps it between 1 and 4 always]
          If Shared Var 2 is less than or equal to 4:
          ....(Do nothing)
          Increase Shared Var 3 by 1
          If Shared Var 3 is greater than or equal to 5:
          ....Decrease Shared Var 3 by 4 [this keeps it between 1 and 4 always]
          If Shared Var 3 is less than or equal to 4:
          ....(Do nothing)
          If Shared Var 2 is equal to 1:
          ....Increase Shared Var 1 by 3 [this is how you can really "randomize" Var 1]
          If Shared Var 2 is equal to 2:
          ....Increase Shared Var 1 by 8
          If Shared Var 2 is equal to 3:
          ....Increase Shared Var 1 by 1
          If Shared Var 2 is equal to 4:
          ....Increase Shared Var 1 by 6
          If Shared Var 1 is greater than or equal to 11:
          ....Decrease Shared Var 1 by 10 [this keeps it between 1 and 10 always]
          If Shared Var 3 is equal to 1:
          ....Increase Shared Var 1 by 6 [this is how you can really "randomize" Var 1]
          If Shared Var 3 is equal to 2:
          ....Increase Shared Var 1 by 2
          If Shared Var 3 is equal to 3:
          ....Increase Shared Var 1 by 9
          If Shared Var 3 is equal to 4:
          ....Increase Shared Var 1 by 4
          If Shared Var 1 is greater than or equal to 11:
          ....Decrease Shared Var 1 by 10 [this keeps it between 1 and 10 always]

          ...Whew! That's a lot of coding! But it's necessary if you really want to get rid of patterns that the player can easily exploit. Obviously, you should add similar coding inside any event that uses your Random Variables as well; otherwise your player could keep playing the gambling game over and over with the same result!

          Now, how do you use these Random Variables? Think about an example where you have to guess whether a NPC has a rock in his left or right hand. For this extremely simple example, let's assume the player has no way of increasing their chances, this is just random guessing. Well, we want a 50% chance of eithe hand, so let's use Shared Variable 1 and say that if it's between 1 and 5, it's in the NPC's left hand, and if it's between 6 and 10, it's in the NPC's right hand.

          Message Display: Which hand do I have the rock in?
          Player Decision Branch:
          ....Your left hand!
          ........If Shared Var 1 is less than or equal to 5:
          ............Message Display: That's absolutely right! Congratulations!
          ............Message Display: I'll give you an Agave Syrup as a reward.
          ............Gain Items: Agave Syrup (choose 'Party Member' as the script option)
          ........If Shared Var 2 is greater than or equal to 6:
          ............Message Display: Sorry, that's not correct. Try again sometime!
          ....Your right hand!
          ........If Shared Var 1 is less than or equal to 5:
          ............Message Display: Sorry, that's not correct. Try again sometime!
          ........If Shared Var 2 is greater than or equal to 6:
          ............Message Display: Sorry, that's not correct. Try again sometime!
          ............Message Display: That's absolutely right! Congratulations!
          ............Message Display: I'll give you an Agave Syrup as a reward.
          ............Gain Items: Agave Syrup (choose 'Party Member' as the script option)

          While this is a lot of coding, there are several places you can copy event commands from one part of the event to another, and then just change a couple of things to make the logic work correctly.

          It's a lot of effort and if you're new to this it's also a lot to wrap your head around. Start out as simply as possible, build on the concept, and it will become second nature eventually!

          One more thing I want to warn you about: unless you're using a custom currency system (not an easy thing to create), if the player has to "pay" gold to play the gambling minigame, there is no way to prevent them from playing if they don't have enough gold. What you could do instead, however, is have "tokens" (tracked by a variable) that the player collects from monsters or elsewhere that the player must spend to play your minigame.


          How Badly Do You Want It? (VX Ace) is now available for download! - no outside software necessary.

          "I live and love in God's peculiar light." - Michelangelo

          Comment

          Working...
          X