Bank interest System Help

● ARCHIVED · READ-ONLY
Started by jhontitor123 9 posts View original ↗
  1. Hello Guys,

    I want to make a game with bank system, it's work fine till i decide to make an interest system.
    For example, player can choose whatever he want like Deposit, Widthraw, and Interest, all event work fine
    except the interest system. I tried to make interest system which is if player deposit money they will get some little money from how much they spend money on it. The formula i use is (Gold Player +10% interest) , and every 10sec player will get about 10% money they deposit.

    Here's the event picture i make :
    ffbdhg.png

    And interest formula i make with common event :
    2e0u2yo.png


    Any help i'm really appreciate it.
    Thanks
  2. Okay, so you are unclear on how it is not working, does the interest simply not happen? Does it not work the way intended? Also 10% gold increase every 10 seconds is really going to break your game.
    interest_zpscrtlvtgb.png

    This should do it, though it is a bit bulky. I could not get it to set the variable to anything but 0 with a script call.
  3. It's a little hard to follow your Banking event since you've only shown part of it. However, I think what's going wrong is that your Interest event is reducing the amount of gold in the player's bank account instead of increasing it.

    The most direct solution is to multiply the player's account by 110 rather than 10, before dividing by 100. That way, they have 10% more money in their account after the parallel process event runs, rather than having 10% of what they started with.

    The above solution is by far the simplest way to get it done. However, if you are trying to track Interest separately from the "Principal" amount (the amount that the player originally deposited), what you will need to do is create a few new variables: "Interest this Period", and "Total Interest". Each time the event runs, set "Interest this Period" equal to total interest, then divide Interest this Period by 10, then add that amount to the Total Interest sum (Total Interest += Interest This Period). Then, set "Interest this Period" to the Principal amount, then divide Interest this Period by 10, then add that amount, also, to the Total Interest sum. This will allow you to track Principal and Interest as two separate amounts in case you want to display to your player how much Interest they've earned.

    Finally, let me give you one unsolicited piece of game design advice: there are very, very few games where allowing Bank Accounts with Interest is a good idea. In general, it is going to completely throw off any control you have over the balance of your game economy, and allow players to amass enormous sums of wealth that allow them to buy anything and everything instead of needing to make tough decisions. Additionally, you will be rewarding the player for sitting around and doing nothing, meaning that the player will likely sit around and do nothing (perhaps walking away from the game while it runs) in order to boost their bank account. It's unlikely that you want your player to do this, so be really careful about adding a system like this into your game, even if it sounds cool in your head.
  4. RetroExcellent said:
    Okay, so you are unclear on how it is not working, does the interest simply not happen? Does it not work the way intended? Also 10% gold increase every 10 seconds is really going to break your game.
    interest_zpscrtlvtgb.png

    This should do it, though it is a bit bulky. I could not get it to set the variable to anything but 0 with a script call.
    Thanks i found another way to get these done.
    Yeah 10sec it just example... :D

    Wavelength said:
    It's a little hard to follow your Banking event since you've only shown part of it. However, I think what's going wrong is that your Interest event is reducing the amount of gold in the player's bank account instead of increasing it.

    The most direct solution is to multiply the player's account by 110 rather than 10, before dividing by 100. That way, they have 10% more money in their account after the parallel process event runs, rather than having 10% of what they started with.

    The above solution is by far the simplest way to get it done. However, if you are trying to track Interest separately from the "Principal" amount (the amount that the player originally deposited), what you will need to do is create a few new variables: "Interest this Period", and "Total Interest". Each time the event runs, set "Interest this Period" equal to total interest, then divide Interest this Period by 10, then add that amount to the Total Interest sum (Total Interest += Interest This Period). Then, set "Interest this Period" to the Principal amount, then divide Interest this Period by 10, then add that amount, also, to the Total Interest sum. This will allow you to track Principal and Interest as two separate amounts in case you want to display to your player how much Interest they've earned.

    Finally, let me give you one unsolicited piece of game design advice: there are very, very few games where allowing Bank Accounts with Interest is a good idea. In general, it is going to completely throw off any control you have over the balance of your game economy, and allow players to amass enormous sums of wealth that allow them to buy anything and everything instead of needing to make tough decisions. Additionally, you will be rewarding the player for sitting around and doing nothing, meaning that the player will likely sit around and do nothing (perhaps walking away from the game while it runs) in order to boost their bank account. It's unlikely that you want your player to do this, so be really careful about adding a system like this into your game, even if it sounds cool in your head.
    Thanks for the advice yeah i'm aware player can decide to afk and do nothing for getting money..
    but it's fine for me.. though i would set the time interest around an hour to get those interest money.

    btw, i got problem when excuted the event..
    the gold player deposit increased for 10% yeah.. but its not their money
    here's example : player deposit 1000gold and every 10sec player get money 100, total 1100
    but the next one player will get 1210 insted 1200, since my english quite bad XD
    i cant describe what problem is.. but i think the problem lie on variabel.
    is there a way to seperate variabel for interest and amount i get from interest
    and those seperate variabel increase based on interest player pay,
    for example variabel interest 1000
    variabel temp interest 100

    so instead interest + 100, the amount of interest will stored in temp interest?
    i hope you guys understand.. my english really bad so i cant explain the problem really good to you :(



    6e0roz.png
  5. jhontitor123 said:
    btw, i got problem when excuted the event..
    the gold player deposit increased for 10% yeah.. but its not their money
    here's example : player deposit 1000gold and every 10sec player get money 100, total 1100
    but the next one player will get 1210 insted 1200, since my english quite bad XD

    That is called "compound interest" and it is the way that banks (and most other financial institutions) handle interest in the real world. In the first period, you have 1000 gold so you get 1000 * 10% = 100 gold interest. Now your account is worth 1100 gold, so in the second period you get 1100 * 10% = 110 gold interest, for a total of 1210 gold. In the third period you'd get 1210 * 10% = 121 gold for a total of 1331 gold. There is nothing wrong with using this technique since it is how interest works in the real world (and is actually less abusable than simple interest).

    If you want to use "simple interest" instead, where you get the same amount every period after making the deposit (some bonds use this type of interest), then at the moment when the player deposits money in the bank, create a new variable called "Interest-Bearing Amount" and set it equal to the player's deposit. Each time the Interest event runs, create a new variable called "Interest This Period" and set it equal to Interest-Bearing Amount, then divide Interest This Period by 10, then add that amount to Player's Deposit (Player's Deposit += Interest This Period). Because Interest-Bearing Amount never changes, you will end up getting the same amount (in this case 100 gold) each period, even though the total deposit is growing. When the player goes back to the bank to collect, the amount you want to give them is the total Player's Deposit.
  6. Wavelength said:
    That is called "compound interest" and it is the way that banks (and most other financial institutions) handle interest in the real world. In the first period, you have 1000 gold so you get 1000 * 10% = 100 gold interest. Now your account is worth 1100 gold, so in the second period you get 1100 * 10% = 110 gold interest, for a total of 1210 gold. In the third period you'd get 1210 * 10% = 121 gold for a total of 1331 gold. There is nothing wrong with using this technique since it is how interest works in the real world (and is actually less abusable than simple interest).

    If you want to use "simple interest" instead, where you get the same amount every period after making the deposit (some bonds use this type of interest), then at the moment when the player deposits money in the bank, create a new variable called "Interest-Bearing Amount" and set it equal to the player's deposit. Each time the Interest event runs, create a new variable called "Interest This Period" and set it equal to Interest-Bearing Amount, then divide Interest This Period by 10, then add that amount to Player's Deposit (Player's Deposit += Interest This Period). Because Interest-Bearing Amount never changes, you will end up getting the same amount (in this case 100 gold) each period, even though the total deposit is growing. When the player goes back to the bank to collect, the amount you want to give them is the total Player's Deposit.
    I just want player can only get interest from their capital money.
    So theres no compound interest, until your capital released by the system itself.
    I tried using your event, but still not working or i just messing up with the event, since i'm barerly enough understand english.

    Here's my event i use :
    953513113866dcb777fe55f1340d1ade8817316156c92cd0efa5e168216fe060dd5fc1ec.jpg


    Npc Bank:
    79413355684c449191ed7bcd220ba8bc09ff016baa2964475d921a933c4d06e5a517f073.jpg

    i'm sorry to bother you, Hope you not get annoyed from me
    Thanks :)
  7. jhontitor123 said:
    I just want player can only get interest from their capital money.
    So theres no compound interest, until your capital released by the system itself.
    I tried using your event, but still not working or i just messing up with the event, since i'm barerly enough understand english.

    Here's my event i use :

    I think your eventing is incorrect.

    I'll try creating a pseudo-event using Variable #1 (Total amount that the player has available in the bank), Variable #2 (Tracks how much gold will bear interest), and Variable #3 (a "holder" used to calculate the interest each period).

    When the player deposits money in the bank:
    Variable #1 = ((whatever the player decided to deposit))
    Variable #2 = Variable #1

    When the interest event runs:
    Variable #3 = Variable #2
    Variable #3 /= 10
    Variable #1 += Variable #3

    When the player withdraws their money (principal + interest):
    Gain Gold: Variable #1

    Example:
    Player deposits 1000G in the bank. Variable #1 is 1000G. Var #2 is set to 1000G.
    Interest runs. Var #3 is set to Var #2 (1000G), then divided by 10 to 100G. Var #1 is increased by Var #3 (100G), so Var #1 is now 1100G.
    Interest runs again. Var #3 is set to Var #2 (1000G), then divided by 10 to 100G. Var #1 is increased by Var #3 (100G), so Var #1 is now 1200G.
    Interest runs again. Var #3 is set to Var #2 (1000G), then divided by 10 to 100G. Var #1 is increased by Var #3 (100G), so Var #1 is now 1300G.
    Player goes to the bank to withdraw all their money, and receives Gold equal to Var #1, which is 1300G.
  8. I found a simple way to increase the gold using a script call.
    $gameVariables.setValue(1, ($gameVariables.value(1) * 1.10))
    If you want the interest to be based off a flat amount instead of the base simply do
    $gameVariables.setValue(2, ($gameVariables.value(1) * 0.10) + $gamevariables.value(2))