Hit/Miss System
Author 
Message 
Archi

Posted: Sun Jul 27, 2003 11:20 pm Post subject: Hit/Miss System 


I need some assistance with part of my game. The current hit/miss system I'm using is a piece of junk because the random integers are never completely random and are more likely to be higher than they are lower.
My current hit/miss system looks this this:
hitchance := round ((acc * 3) + (eqhitrate * 2) div 2.5)
Where Acc=Accuracy and the beginning stats are anywhere from 2040 and the eqhitrate=Equipped Hit Rate which ranges from 2535.
What I do next to determine whether the player hits or misses is gets a random number between 1200( allowing hopefully better chances to hit) and if the hitchance is greater or equal to the random number, than the player hits..if not, he misses.
Now, not only does the lack of true randomization cause a problem but also the fact that I want the original equipment to have roughly a 75% chance to hit while the 2nd best weapon has only a 95%...I've yet to figure out a good way to do this...Maybe you people could assist me?






Sponsor Sponsor



Dan

Posted: Mon Jul 28, 2003 12:06 am Post subject: (No subject) 


well the simple way whoud be to get an random number betwen 1 and x
now you could do it so if it is 1 then it is a hit or if it is not one then it is a hit.
to chage the % of cahce of hit just incres or lower x depending on if you are using 1 as a hit or a miss.
ie. if you use not 1 as a hit then a random number from 1 to 3 whould hav 66.7% chase of hit.
12 = 50%
13 = 66.7%
14 = 75%
15 = 80%
and so on.
doing it the other way:
12 = 50%
13 = 33%
14 = 25%
15 = 20%
and so on.
now if you combiden both of thess using if's you could easy get a wide rang of difren % base on a sats of chater or what ever.

Computer Science Canada
Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more! 




Archi

Posted: Mon Jul 28, 2003 1:14 am Post subject: (No subject) 


The attached picture shows the lvl of the weapon, the total of the accuracy and hit chance of the player (at each lvl for that weapon), the desired % hit chance, what the formula must equal to get the desired % and then just the individual acc (player) and hit chance(weapon).
IF possible, maybe you could assist me in making a formula for this?
Description: 

Filesize: 
29.95 KB 
Viewed: 
2753 Time(s) 







Dan

Posted: Wed Jul 30, 2003 10:47 am Post subject: (No subject) 


if there are only 9 difrent lvls where it gose up why not just use a logic stament like an if.

Computer Science Canada
Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more! 




Archi

Posted: Wed Jul 30, 2003 11:27 am Post subject: (No subject) 


Well I did it a different way. I created a formula for each weapon, which if their ACC is at the top of the list (gets randomly set at beginning of game), then would give them the desired hit rate. Then when the players buy a new weapon I assign a variable a new number which will correlate with that of the formulas. it works out nicely. Only problem I have now is for determining the formula for the workshop items I create.







