This is my second devlog for my fishing clicker game. Since my last log, I have added probabilities to each rarity and have made the actual gauge and bar functional. Starting with the gauge, as you can see, there is a gradient on the actual sprite, with the green being at the center and the red being near the edges. And I wanted to make it so that the chances of catching a rare fish or better increase as the bar gets closer to the green section. But first, I had to actually create the probability of catching each rarity. I created more species of fish and put each into 1 of 4 lists, common, rare, epic, and mythical, with the odds of catching each rarity 500 : 100: 25: 1, respectively. There are 5 fish in common, 3 in rare, 2 in epic, and 1 in mythical. I did this by choosing a random number between 1 and 626 using Random.Range, then selecting a random fish from a list corresponding to the range the selected number fell into. There are likely better systems to use than this, but I had trouble figuring out how to calculate odds, so this is what I came up with. Now, back to the bar, this is how I created a multiplier with the gauge. I took the absolute value of the x value of the bar, subtracted the value from 1.1 (the max value the bar could have traveled in either direction was about 1.1, so having the bar at the very end of the gauge would result in a multiplier of close to 0), multiplying that number by 40, 10, and 1 for rare, epic and mythical, and then subtracting that number from the minimum value of the range. This increased the range for each rarity depending on the x-axis of the bar, with the subtraction being greater the closer to the center the bar was. This system seems to work well, and I feel that this will help me later on when making other ways to multiply my odds, since I can just tweak the range of the rarity I need to multiply. I also created 4 placeholder sprites for the inventory (green for common, blue for rare, red for epic, and yellow for mythical). I may have mentioned earlier, but the actual icons are prefabs of a TMP button. The way I change the sprite depending on the fish in my inventory is by taking each item from a list that contains each fish I caught, checking what list/rarity that fish belongs to, and then changing the sprite of the button to a sprite in a list labeled with the same rarity. The list of skins corresponds to the rarity lists, which allows me to use the same index that I get when using IndexOf() to find the index of the fish. This means that when I eventually make a new icon for each fish, I can just switch out the sprite. I also fixed the inconsistent spawning issue. I noticed that the extra prefab would get back into place if you open the inventory a second time without catching another fish. So what I did was make the button set inventory active, deactivate it, and then reactivate it when I press the button. It all happens too fast to notice, and it seems to work. I will likely stick with this until I find a problem or come up with another solution. One thing I would like to change would be having the fish more organized in the inventory. As of right now, they just line up in order of what you catch, which looks really cluttered. I have yet to change the actual text bar that shows the caught fish, but I’m thinking about deleting that and having a sort of pop-up appear instead.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.