{"id":1951,"date":"2023-01-25T21:39:32","date_gmt":"2023-01-25T21:39:32","guid":{"rendered":"https:\/\/blogs.thecdm.ca\/premdm\/?p=1951"},"modified":"2023-01-30T21:42:39","modified_gmt":"2023-01-30T21:42:39","slug":"randomness-in-video-games","status":"publish","type":"post","link":"https:\/\/blogs.thecdm.ca\/techspeak\/2023\/01\/25\/randomness-in-video-games\/","title":{"rendered":"<strong>Randomness in video games<\/strong><strong><\/strong>"},"content":{"rendered":"\n<p>Written by <em>Timur<\/em><\/p>\n\n\n\n<p>Last semester, after my team\u2019s final presentation about a simple app we developed called \u201crandom choices,\u201d which selected a random item from a list of things the user entered, our professor liked our work and presentation. Still, he had a note that got me thinking the whole break and made me alter many mechanics that a game I\u2019d been developing for months had. He asked us whether the item was randomly selected, which is the case; however, to our surprise, he said that this shouldn\u2019t be the case as it can frustrate users in some cases.<\/p>\n\n\n\n<p>I didn\u2019t pay much attention to it until I tested my game out of boredom and realized that the drops, which are supposed to be an equal mixture of health drops and energy drops, are only energy drops! I set the chances of having either of them to 50%, which was the moment I realized there is more to randomness in games than just putting <em>Random. Value <\/em>(that\u2019s the life of code that generates a float between 0.0 and 1.0.) I did my thorough research and contacted my professor to learn more, and I learned more.<\/p>\n\n\n\n<p>The element of randomness is almost everywhere in video games. Yes, we know that rogue-like games depend on it to create level layouts and enemies, and other games have it for drops (like my game.) But it\u2019s also seen in the miss chances in RTS games like warcraft 3, card games like Hearthstone, RPG games with random encounters, and much more. Additionally, randomness is present in critical hit chances, which practically is supposed to be random, but it\u2019s not.<\/p>\n\n\n\n<p>Turns out that if a game\u2019s randomness is left the way it is supposed to be in theory, the game would eventually be either too hard or too easy, depending on what the console provides. Having it too easy is not often a complaint; however, having it unfairly difficult? This is not good for business.<\/p>\n\n\n\n<p>An ability in Warcraft 3 called \u201cBash\u201d for a character called the Mountain King gives him a 25% chance of stunning the enemy. The way it works is that each time the Bash is missed, the chances of having it in the next hit increases until the stakes are high to a point where a Bash is inevitable. After the Bash lands, the chances of having it next drop down to zero, making it impossible to have two Bashes in a row.<\/p>\n\n\n\n<p>The drops worked like magic after I implemented that in my game. Read Randomness in video games 2 to learn more about this exciting mechanism&#8217;s theory.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Written by Timur Last semester, after my team\u2019s final presentation about a simple app we developed called \u201crandom choices,\u201d which<\/p>\n<p><a href=\"https:\/\/blogs.thecdm.ca\/techspeak\/2023\/01\/25\/randomness-in-video-games\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"><strong>Randomness in video games<\/strong><strong><\/strong><\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":1952,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[12,28],"class_list":["post-1951","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-gamedesign","tag-game-design","tag-video-games"],"_links":{"self":[{"href":"https:\/\/blogs.thecdm.ca\/techspeak\/wp-json\/wp\/v2\/posts\/1951","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.thecdm.ca\/techspeak\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.thecdm.ca\/techspeak\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.thecdm.ca\/techspeak\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.thecdm.ca\/techspeak\/wp-json\/wp\/v2\/comments?post=1951"}],"version-history":[{"count":1,"href":"https:\/\/blogs.thecdm.ca\/techspeak\/wp-json\/wp\/v2\/posts\/1951\/revisions"}],"predecessor-version":[{"id":1953,"href":"https:\/\/blogs.thecdm.ca\/techspeak\/wp-json\/wp\/v2\/posts\/1951\/revisions\/1953"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blogs.thecdm.ca\/techspeak\/wp-json\/wp\/v2\/media\/1952"}],"wp:attachment":[{"href":"https:\/\/blogs.thecdm.ca\/techspeak\/wp-json\/wp\/v2\/media?parent=1951"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.thecdm.ca\/techspeak\/wp-json\/wp\/v2\/categories?post=1951"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.thecdm.ca\/techspeak\/wp-json\/wp\/v2\/tags?post=1951"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}