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.
This is the devlog for my first project on Stardance. This is going to be a game where you click a button to fish, and depending on your timing, your chances of catching a good fish increase. This devlog is a bit delayed since I was trying to figure out how this whole challenge works, so I have added a few features, but nothing too big. I added the button and a gauge that oscillates back and forth. I did this by moving a bar gameObject across another gauge. I have not added anything to control the probability, but I will likely do that by measuring the x-axis position of the bar when it stops. I also made it so that it appears when you are holding the button and disappears when you catch the fish. There is a 2-second delay from when you let go to when you catch the fish to simulate the time spent reeling the fish in (and because I didn’t want it to be a regular idle clicker). I also added some text above that prints the fish that you caught. I added an inventory system that tracks the amount of fish you have (you can open it using the button in the corner). I used prefabs that instantiate depending on the number of fish in your inventory, and I just made them move over each time they spawn in. This is a really janky and probably unreliable system because it gave me a lot of problems. I did learn how to use anchorMax and anchorMin to define the origin on a panel, since the fish icons (right now they are red boxes as placeholders) have x and y positions relative to the position of the panel. But for some reason, the first prefab that is instantiated spawns in a random location, and I don’t know why. This is probably because of the system I use to spawn the prefabs in (which, as I mentioned earlier, just incrementally adds to the x and y depending on the last position). If you have any idea as to why that could be happening, please let me know in the comments. That is basically everything I have done so far. I learned a lot about how Unity positions objects, and I now feel way more confident about TMP elements like buttons and text. I don’t have much experience with programming and Unity, so any help or tips would also be greatly appreciated. I also would love any suggestions for features or gameplay mechs for this game. Thanks!