Game - Random numbers based on percent

Hello everyone, starting to create the though process of my game and was wondering if anyone had an idea for this. Just as a warning i prefer to do as much as i can inside of bubble rather than an API or paid service… unless it makes sense.

My game will involve two players fighting eachother. Player 1 will have lets say 30% chance of winning and player 2 will have 65% change of winning and a 5% chance of a draw. When player 1 attacks player 2, how can i comeup with a fair result? Has anyone done this or have background? I would love some help. Same idea goes for a coin flip. a 50/50 change. How can I do that?

The fighting aspect is just one example of how i need this percent calculated but also would be used to get loot. Equipment would have 1% chance of being ultra rare and 10% rare, 30% uncommon etc. something like that.

At first i thought maybe create a range of numbers 1-100. if the random number generator picks anything from 1-30, then player 1 wins or anything from 31-95 then player 2 wins or anything 96-100 its a draw. but i dont feel thats very “random” or fair.

Thoughts? Any input is welcomed Thanks!

PS: If anyone interested the game i am doing is going to be a city builder/PVP/dungeon crawler but all browser based GUI. Users will be able to upgrade their towns and different buildings for increased stats like health, money, power, gold productions and resources. Can attack other players to win gold using power. And can fight in dungeon waves to win loot like equipment or special NPC’s in their city that grant them special abilities. I see this all possible on bubble and I am SUPER excited to try this out. I know its not the first of its kind but I hope players will enjoy it. Coming back to the game day to day to collect their daily rewards and attack players. kind of like castle clash I guess but way way way way way less pay to win. In fact it will be a long long time before I add any microtransactions if at all any.

This topic was automatically closed after 70 days. New replies are no longer allowed.