Wednesday, December 5, 2018

Pseudobot - Math and Graphs; How Fair is the Random Stat Generator?

So, last week, and the week before I worked on a tool to randomly generate character attributes in a way that the results would all have the same point values. At first, the algorithm assumed a character would have no decreased attributes and secondary characteristics, which was not satisfying to me, so I adjusted it so that the character could have minimum values based on some numbers I extrapolated from various GURPS sources as the bare minimum ok amount for a character. I think this was a good improvement. However, after making a naive implementation of the algorithm that gave each attribute or secondary characteristic an equal chance of occurring, on a whim, I decided to generate several thousand characters to see what the expected outcomes would be like. The result was that certain things apparently had certain unfair advantages in selecting them that made it so that certain attributes had noticeably lower or higher averages, thus began a complicated process of trying to make the algorithm as balanced as possible.

Basic Algorithm

To give some context, here is the simple naive algorithm, somewhat analogized to make it easier to understand and less technical:
  1. Take a character with attributes and secondary characteristics lowered to the bare "viable" minimum, give them back points for doing this.
  2. In a loop, spend points until we run out doing the following
    1. Taking the ratios of current traits into account, put all the traits that are valid for purchase into a hat.
    2. Choose one from the bag at random.
    3. Give +1 (or +0.25 for basic speed) to that trait, and subtract the point cost from our budget
  3. Return the character

Weighing Results

A few things gave some results different advantages and disadvantages that made them easier to select.
  • Some characteristics have a lower "allowed" minimum than others.
  • Probability of incrementing any
    particular characteristic.
    • For example, Strength can be as low as 10-3; that's 3 decrements; but Basic Speed can go as low as (HT+DX/4)-2.00; that's 8 decrements.
  • Some characteristics are bounded by one or more dependent characteristics.
    • HP should be between 0.7x and 1.3x of ST
    • Will and Per have a lower bound of 70% of IQ
    • Basic Move can be ⌊Basic Speed⌋±3
  • Some characteristics have very different costs. 
    • This causes a problem because traits that have a lower cost, when the remaining point budget gets low enough, get "extra rolls" that the more expensive traits don't get. For example, If there are 10 points left to spend, there is a chance to acquire more increments of Basic Speed, but zero chance to acquire more increments of DX.
    • This also means the range of possible values for cheaper attributes can be potentially higher than for more expensive values.

Reducing Components

After doing some testing, it seemed that having attributes and secondary characteristics reduced as much as possible helped to keep secondary characteristics from hitting the allowed ceiling. By this, I mean that, one can think of a level of HT, for example as also including a free level of FP and Basic Speed. If I added these traits when buying a level of HT, that's like giving FP and Basic Speed a bunch of extra chances of being rolled, which meant that changing the weighted odds of getting higher HT could cause a "butterfly effect" that could cause FP and Basic Speed to increase by a lot, which took away opportunities to buy other things, causing a lot of other attributes and secondary characteristics to lose out, relatively speaking.
The one slightly complicated secondary attribute in the bunch because of all of this was Basic Move, which normally gets a free increment every time Basic Speed x 4 % 4 = 0. I had to hack the algorithm slightly because I couldn't subtract 1/4 of the cost of Basic Move from each level of Basic Speed; I just made it so that every time Basic Speed did hit an even number, it would give back 5 points and decrement Basic Move by 1.

Isn't Weighing Results Cheating?

I got this question while thinking out loud about the problem. If you give favor to one result, is it still really fair or random? Well, obviously, yes, it's still random. The fact of the matter is that some traits have certain properties that give them more opportunities for rolls. By giving the attributes and secondary characteristics a higher probability of being rolled when the opportunity lines up, it makes up for the times when they have absolutely zero opportunity for incrementing.

The "Bare Minimum Viable Character"

The bare minimum viable 0 point character has the following stats:
  • All 4 Attributes are at 7; this gives 180 points worth of disadvantages.
  • Secondary Characteristics
    • HP, FP, Will, and Per are allowed to be 70% of their primary attribute; this means an effective 5 when the controlling attribute is at 7; two decrements each gives 30 points worth of disadvantages.
    • Basic Speed has a minimum adjustment of -2.00; this is 8 decrements for 40 points.
    • Basic Move is already at the floor; HT, DX, and Basic Speed are so low, Basic Move is already 1, so we make no changes for 0 points.
Summing all of this up, a zero point character has 250 points floating to reallocate. In any case, Let's take a look at the results in more detail.

The Results

I generated 20,000 random characters with 0 points, assuming that a balanced generator would have all the attributes balanced around 10, and all the secondary characteristics balanced around 5. 

Attributes

Boxplot of 20,000 zero point
characters
The attributes all have similar patterns, so I've only included the histogram for IQ. I never did really well at statistics, but after looking through Wikipedia, I think the histograms conform to a stochastic model referred to as a "counting process." A counting process is where a random number is generated from counting the number of "successes" produced by generating a different random number. To use the IQ histogram as an example, we have 3.7k examples where we counted 0 successes (7 IQ). 4.7k examples with 1 success (8 IQ) 4.8k where we have 2 successes (9 IQ); and 3.6k where we have 3 successes (10 IQ.) An interesting property of this is that even though the median is close to 10 (9.9435 to be exact) the mode is 9. I think the distribution is similar to a Poisson distribution, but slightly different. Looking at the conditions to be considered a poisson distribution, these conditions are met:
  • The values are discrete counts
  • Events occur independently
  • The event can't occur simultaneously
  • Histogram of IQ Values
  • The probability of a success is determined by a binomial distribution
The one typical property of a poisson distribution that is violated is that the rate is not necessarily constant. If, for example, Will and Per are too low, the occurrence of IQ increments drops to 0. If Basic Speed is low enough, the odds of DX or HT incrementing is 0, and this increases the odds of IQ incrementing. Also, I am not sure if this is absolutely required, but I think the counting process needs to occur over a continuous interval; the interval is a discrete set of loops where something increases or it doesn't. Correct me if I'm wrong here though.

Perception

Perception Histogram
Perception and Will have the interesting designation that they have no cap in proportion to any other attribute or characteristic, and their histograms are similar. Highly unlikely, but because they have no maximum capping, this means that a random character could potentially spend all the points on either or both without any other limits. This gives them a longer tail than any other characteristic in the generator. As a secondary attribute that starts relatively low, it also has a higher variance and standard distribution, which you can see by the way it takes much longer to reach the "peak" of the distribution than it did for IQ above.

Hit Points

HP Histogram
Hit points have a relative upper and lower bound compared to ST. HP must be in the range of ST ±30%. Fatigue has a similar but different shape because it is bound by HT, but decomposed HT! very cheap and also depends on Basic Speed, which depends on Basic Move. These interact subtly with the entire graph, but give an overall similar shape. If we don't look at the graph very carefully, it might seem like this is almost a normal or binomial distribution, but it does have a very heavy tail at the end again.

Basic Speed

Basic Speed Histogram
This is the last "interesting" graph in my opinion because of the high relative variance and the extremely low initial value, and the dependence on all of HT, DX, and Basic Move. It is deceptively similar to a bell curve at this point, but there is no mistaking that the right half of the graph is "heavier" than the left side of the graph.




Other Thoughts and Conclusion

I got permission from the guy who wrote Libre Solo Role Playing to write an app that is similar to the GM emulator in the book. I think I'll use this as a stepping stone to produce the framework for an MVC website that I can eventually add the Pseudobot functionality to. I think I'll also be keeping this project mostly open source because Brian seemed a little more forgiving in what I can and can't do with the app than Steve Jackson Games. Basically, as long as I don't wholesale copy text from the book, and don't say that my implementation is literally equal to his book, I'm free to do whatever, so hooray.

60 comments:

  1. Activate amazon mytv login activate by giving the activation link primevideo.com in your tv and enjoy amazon popular shows such as movies & web series.Visit given link primevideo mytv enter code..

    ReplyDelete
  2. Hello there, You’ve done an incredible job. www.amazon.com/mytv I’ll definitely digg it and individually suggest to my friends. I’m sure they will be benefited from this web site.|

    ReplyDelete
  3. Hey! Is there any way to get Pseudobot translated (to brazilian portuguese)? I mean.. I could do it, just dunno if it's possible. In case it is (and you're interested), how could I get in touch with the text strings?

    ReplyDelete
    Replies
    1. I don't know if you know.. we have a somewhat big community in Brazil as we've had offical translations of GURPS books... those little aids could encourage players to keep it alive..

      Delete
  4. superslot Online games that we don't want you to miss because they can actually earn you money in addition to having fun and also getting money to gamble.

    ReplyDelete
  5. In preparation for the journey, we are here to help you make yourself and your success in the game better and if you want to know what crazy things you should know about playing the game. Today we will bring you to read and understand today that it will benefit you and will make yourself successful in playing the game better. entrance joker123 And making money would not be difficult anymore. pgslot

    ReplyDelete
  6. Playing slots games that you are good at will make playing slots more successful because you will understand the game style and how to play the game better. Therefore, trying to play slots is something that will help you to win bets. Slots are easier because slots games are online gambling games that have many types to choose from and each type will have different difficulty as well. superslot

    ReplyDelete
  7. very easy in this era. Fish shooting games. If talking about this game, no one would know for sure. very easy in this era. Fish shooting games. If talking about this game, no one would know for sure. very easy in this era. Fish shooting games. If talking about this game, no one would know for sure. Slotxo

    ReplyDelete
  8. which must be said that this game There is a range of free games similar to Roma slots. But this game is a game that has a pretty high break rate as well as Roma slots. including various multipliers and many differences That makes this game a unique slot game. especially during free games Which is the highlight of this game that has it all. Today we will talk about the free game of this game. joker123

    ReplyDelete
  9. Simple, easy to play and doesn't require much understanding. just play And to experience the real playing just as you will develop your betting skills Most importantly, you will still have full fun through the online website system. that can be played บาคาร่า

    ReplyDelete
  10. that the new theme There will be a lot more ways to pay more than before) as well as a higher payout adjustment rate. All this will tell us with certainty that The time to come in to play doesn't have to be very long, up to hours to have a lot of money out of the game. superslot

    ReplyDelete
  11. There are many other things that we can choose to bet and the opportunity to make money is not difficult, you just have to learn how in บาคาร่า

    ReplyDelete
  12. in every betting website Often comes with promotions to give away free credits that no matter how much you deposit. superslot เครดิตฟรี

    ReplyDelete
  13. Online slots, a slot game that many people must already know. But how do we play for profit? superslot

    ReplyDelete
  14. work of non-white actors. The basis for the charge is that there have been enough nominations and enough awards given to detect a bias. That is, if ambbet

    ReplyDelete
  15. Supermarket Spree Slot Game Supermarket Fun It is a famous supermarket in Washington.
    pgslot

    ReplyDelete

  16. For betting and it will definitely help you have a better fortune so we don't want you to miss out on today's work. pgslot

    ReplyDelete
  17. If you are an avid gambler This probably won't be a problem for you. But if you are a beginner ambbet

    ReplyDelete
  18. distributed to many gamblers who come to play It's the perfect game camp. and in each game there is a rate ambbet

    ReplyDelete
  19. There are more advantages than you think, and the advantages that we have mentioned in this article will give you the courage to make the decision to play more slots! สล็อต

    ReplyDelete
  20. various role models There are also shooting fish and bingo as well. Online slots offer more than 250 games, so players can บาคาร่าออนไลน์

    ReplyDelete
  21. interesting game story In addition to having a pattern of the game that made it Attention from gamblers pgslot

    ReplyDelete
  22. As a member with us, you can also earn a fixed salary. Sports betting system and football betting pgslot เว็บตรง

    ReplyDelete
  23. You will definitely be reminded of the original 777 slot game as it only features 3 reels. amb

    ReplyDelete
  24. Online slots promotions and fish shooting games, both brands pgslot, great promotions, free credit, hot promotion pgslot

    ReplyDelete
  25. Fish shooting game. If talking about this game, no one will know for sure. especially the players slotxo

    ReplyDelete
  26. Notice that a small nodule grows out. After that, the complete morning glory seeds were selected for planting. สมัครสมาชิกสล็อต pg

    ReplyDelete
  27. Online slots promotions and fish shooting games, both SlotXO and Live22 brands, great promotions, free credit, hot promotion สมัครสมาชิกสล็อต pg

    ReplyDelete
  28. wide variety of games to choose from, not monotonous and not boring anymore. This pgslot

    ReplyDelete
  29. Try to play online games pgslot, a direct website where players can come and try to play online games for free. สมัครสมาชิกสล็อต pg

    ReplyDelete
  30. PG website is continuously profitable. Can play in many ways whether mobile or tablet สล็อต

    ReplyDelete
  31. Today will come to recommend Techniques for playing fish shooting games to get money. สล็อต

    ReplyDelete
  32. You can load them in the player anytime and anywhere you want. without taking up space on your phone สล็อตxo

    ReplyDelete
  33. Just press spin for two rounds and hope to get a lot of money. I must say that it doesn't really exist. pgslot เว็บตรง

    ReplyDelete
  34. Players are advised to read the terms and conditions of the game carefully so that you do not make mistakes during the game and we can say that you will understand the game. pgslot เว็บตรง

    ReplyDelete
  35. free credit slots that do not need to deposit, do not have to share, get it easily for JILI camp that is outstanding attractive to those who come to play ambslot

    ReplyDelete
  36. Newbies don't have to be afraid of being cheated! 100% reliable, considered as a direct web slot jili

    ReplyDelete
  37. Have to play only the games that we set or not necessary, you can play games with us, all the games on our web that we have allocated can be played easily in every game. ตารางคะแนนพรีเมียร์ลีก

    ReplyDelete
  38. if you invite friends to join in the fun as a member. will also receive compensation as additional income You will receive a compensation pgslot เว็บตรง

    ReplyDelete
  39. It will help to get the prize money that is more worthwhile. Of course, many people may be impatient. สล็อตxo

    ReplyDelete
  40. Time to play PG slots, the golden minute of making money
    I must say that the selection of tables dooballsod

    ReplyDelete
  41. have chosen to play in a varietyhave chosen to play in a varietyhave chosen to play in a variety ผลบอลสด

    ReplyDelete
  42. to come into play and also distributed in the matter of Capital game play It comes in a form that comes into play, in a free form, pgslot

    ReplyDelete
  43. Is the best of modern gambling games, easy to play, get money fast, apply for membership, get a 100% free bonus and also win many other special prizes that are waiting for you. pgslot

    ReplyDelete
  44. The chief of the Kai Club has come out to interview the media that Dissatisfied with the referee and the VAR system that creates damage pgslot เว็บตรง

    ReplyDelete
  45. to play online games is better than other games Of any type of casino, because no matter who comes to choose to play online games pgslot

    ReplyDelete
  46. easy-to-play game. and play fast Know the results of playing fast games and playing games of ข่าวฟุตบอล

    ReplyDelete
  47. When finished, User is ready to participate in all our activities. Contact admin at Line ID: สล็อต

    ReplyDelete
  48. deposit via bank account or deposit via wallet can choose as convenient We offer a full range of games to choose from, more than 200+ games to choose from. pgslot

    ReplyDelete
  49. You can apply with AMBBET.BAR us to play. American online slots You can get it here. ดูบอลออนไลน์

    ReplyDelete
  50. Free bonus from the start of registration No matter what time you play, you won't get bored. because we are packed with fun games and pgslot

    ReplyDelete
  51. As for together, here we would like to talk about financial planning. for maximum benefit, which is สล็อต

    ReplyDelete
  52. free credit no need to share that can be used every day Eligible for free credit ดูบอลออนไลน์

    ReplyDelete
  53. You will find many rewards. That will make you excited throughout playing online slot games. AMBKING

    ReplyDelete
  54. Online slot games, slots, withdraw money from here, 24-hour automatic service, 100% safe and secure. AMBKING

    ReplyDelete
  55. Each game has its own unique and different risks. But the players can choose to play the game by pgslot

    ReplyDelete