Random generator, my ...

Discussion in 'Card Hunter General Chat' started by RNGFBS, Aug 13, 2015.

  1. RNGFBS

    RNGFBS Kobold

    In which universe can you roll all one for your defense while your enemy roll all six? And not once per blue moon but consistanly. Having my hand filled with either moves or defenses when they make barely a fifth of my deck.

    Lazy devs use the BS Random() and thats the result you get. Do your job and use better random generator.
     
  2. Lucky Dice

    Lucky Dice Thaumaturge

    A bad workman always blames his tools, man.
     
  3. Maniafig

    Maniafig Thaumaturge

    The random number generator IS purely random. Streaks of bad luck can happen and the human mind likes to see patterns where they do not exist when it comes to luck and statistics.

    As for hands getting filled with move cards, you should keep in mind you draw a racial move card each turn regardless of what items you equip and shouldn't take it into consideration when judging your hand to be filled with movement.

    If you get a lot of move cards from your then deck you should re-evaluate the boots and racial skills you're using and choose ones with less move cards, such items can be bought for 5 gold in the store until you get better ones. Alternatively you could add cards to you deck that allow you to cycle through your deck faster so they become more consistent, like traits or cards such as Inspiration.
     
  4. Robauke

    Robauke Guild Leader

    Someone give the RNG a conscience algorythm ("already screwed this guy this much, lets 'adjust' this bad roll").
    But god help us all, dont make it selfaware!
     
    Last edited: Aug 13, 2015
    Pawndawan likes this.
  5. Happenstance

    Happenstance Thaumaturge

    In 1943, a roulette wheel hit red 32 times in a row. There's your RNG. I've never had a problem with it. Sometimes your disorientating block fails four times in a row, sometimes you sneak a killing attack past two parries.
     
    kustaa, timeracers and Scarponi like this.
  6. RNGFBS

    RNGFBS Kobold

    And the fanboys always gets in first. If you would have half a brain you would know there is no such thing as pure random generators. There is cheap crap one, like the one used in most games, like this one, and there is more complex one that return better results. When patterns appear you know its a cheap rng because it use predictable source to "generate" those numbers. And thats why this crap game gives similar hands consistently.

    "In 1943, a roulette wheel hit red 32 times in a row." And how many times such a thing happen, O imbecile? Exactly, once. But with this game it is a regular occurence that such crap happen. And that O imbecile is statistically infinitesimal , unless you use a predictable and cheap rng like this game use.
     
    Last edited: Aug 13, 2015
  7. Happenstance

    Happenstance Thaumaturge

    Guys, if you want me, I'll be starring in my off-off-Broadway musical, 'O, Imbecile'.
     
  8. Scarponi

    Scarponi Moderator

    The first time I see someone complain about how awful the RNG is because they just had too good of a streak of great rolls that helped them win too many games is when I'll start paying attention to RNG complaints, because only then is it clear that they have a problem with the RNG in itself and not just a problem with the fact they're losing.
     
    Maniafig, Merdis, Inkfingers and 9 others like this.
  9. Farbs

    Farbs Blue Manchu Staff Member

    That's roughly equivalent to 12 dice rolls in a row coming up either 1 for you or 6 for the AI. Post an unedited video on youtube of this happening and I'll look into it.
     
    Maniafig, Jayce, Xayrn and 8 others like this.
  10. slowreflex

    slowreflex Goblin Champion

    I think the RNG is fine. The amount of RNG in the game is an issue for me, but that's a different thing. :)
     
    Sentient_Toaster and kustaa like this.
  11. Firaxis did just that for low difficulties in XCOM:EU. If the player missed a few times in a row, his next attack could even be guaranteed to hit no matter the actual hit percentage. Silly and prone to overly rewarding poor tactics, but it placated the player base to a certain degree.

    Yup. Certain things have high variance, such as the reliability of high-tier cards that are theoretically quite strong but that you can't really base a strategy on because you can have only one or two copies in your deck. Or, say radiation-generated random handicaps or laser malfunctions -- the handicaps can range from easily ignorable to crippling to dramatically backfiring (a Festering Guts randomly landing on a fast-moving enemy elf late in a round while you're low on movement might be bad, say).

    But high variance != biased mean.
     
  12. slowreflex

    slowreflex Goblin Champion

    If you are going down that road, you might as well just remove RNG. The thing with RNG is that it is a numbers game (no pun intended). Eventually, it evens out. The issue people have though is that sometimes they don't get long enough for it to even out. If you knew a weapon did between 5-15 dmg on average, then it will be an average of 10 when you do this a large number of times. However, in a specific CH match, the average might be 13 or might be 7. This is simply because the frequency is not high enough to allow the correct average to be obtained. The larger the range of possible outcomes and the lower the frequency of occurrences, the more luck becomes involved. What if instead of 5-15, it was 8-12? Then it becomes much less of an issue for people. In fact, in this game you can get blocked and have armor and buffs, so it ends up being something like 0-20 possible damage.

    What this does is a few interesting things. One thing RNG does is increases the chances of an unpredictable outcome. i.e. A worse player/deck can beat a better player/deck if they have luck on their side. Again, this is because there are not enough occurrences of RNG to get it to its mean. However, I also think this decreases the "who jumps first" mentality. Let me explain that further:

    Imagine CH without RNG (apart from card draws). So no blocks, armor, buffs, etc. In that scenario, I know that if I have a 10dmg card, that if I get in range of them I WILL do 10dmg to them. There's nothing they can do about it. Now imagine my opponent also has the 10dmg card ready to play. In fact, lets imagine both players have 3 10dmg cards and 30hp each. The person that strikes first, will win this battle. This means you get a dance around the board (more than now) of getting close, but always staying out of range. Each player hoping that the other player will screw up and take one step too close. This is why a lot of games like this have "strikeback", i.e. It doesn't matter as much who hits who first because we both damage each other at the same time.

    Now in the current version of CH, you have a lot of variance. This lowers the defensive stances of players. I have that 10dmg card, but I also have a Block and some Armor. So I am more likely to get in range of the other player because there is an increased chance that I could win the outcome due to my defenses and my luck. I'm probably still at a disadvantage if I jump first, but the stakes appear to be less high to me.

    So, while part of me really wants to remove a lot of RNG and Defense from the game to make increase the competitive integrity and speed of the game, I'm actually not sure if that would be a wise decision. If it put the game in a state of constant dancing around, then you'd end up fixing one thing to just break another. Of course, you could go the Strikeback route, but that makes it a very different game. I also think I may be unfairly biased due to playing a lot more campaign than multiplayer, because in the campaign some of the creatures have ridiculous defenses. At first, that's frustrating as hell, but when you realize that it is intentional and part of that particular challenge and adapt to it accordingly, you appreciate it more.

    So, what is all this rambling actually saying? Things may not be perfect, but nothing ever will be. The current solution is actually good.... once you get used to it. :)
     
  13. Xayrn

    Xayrn Hydra

    We're getting somewhat off-topic, but I guess that's not a terrible thing in this case, so...
    Because it's actually a fantasy of mine, I'd like to point out that you can still have blocks and armor without involving randomness in their mechanics. For instance, blocks could simply always block their stated attack types and armor could always reduce a flat amount of damage (with secondary effects added for variety), but there would still be randomness in the cards that each player actually draws. This is how I wish Card Hunter worked, even though the current system is still good enough to keep me coming back. Maybe something to think about for a sequel? :D
     
    Last edited: Aug 14, 2015
    Merdis likes this.
  14. Speaking of variance in card draw, I had a game today where an elven warrior of mine drew a second All-Out-Attack before he'd found a good opportunity to use the first (having seen movement and armor, but no attacks for a while).

    TIL that if you have two AoAs at once, the second one doubles the already-doubled damage. In this case, a modest 6-damage Pressing Bash turned into 24. :confused:
     
  15. j3st3ri

    j3st3ri Thaumaturge

    This game mimics humorously and lightheartedly the early rpg's and those rpg's would be nothing without dice throwing. I hope they never get rid of this.

    I'd play MtG if dice throwing wouldn't be my thing.
     
    Sir Veza likes this.
  16. Sir Veza

    Sir Veza Farming Deity

    Thanks for being someone who knows what a d12 is used for! I wish CH had DnD bell curves.
     
    Xayrn likes this.
  17. Rolling hp for an "Unearthed Arcana" barbarian, or damage from a longsword vs. large monsters? :p
     
    Sir Veza likes this.
  18. Xayrn

    Xayrn Hydra

    Funny, I was just about to ask @j3st3ri why all the dice only had six sides. As much as I am a fan of D&D, it's a totally different beast than our beloved CH.
     
  19. j3st3ri

    j3st3ri Thaumaturge

    There's never been any love for d12 in most of the rpg's for some reason. :(

    I was surprised to see it in a boardgame recently. (that exposure die is the most evil die ever created)
     
  20. To get closer to the original topic, computerized random number generators are pseudorandom number generators (well, there are hardware entropy sources...)... but that's such an extremely explored topic that there are numerous libraries that supply pretty good implementations that are more than sufficient for casual gaming. It is *highly* unlikely that the developers implemented their own, and it is most likely that they choose one included with the platform or framework that has already been reasonably vetted for non-cryptographic or otherwise sensitive use.


    (Fun exercise, if you're bored and nerdy:

    The standard C library declares a method 'rand()'. Let's say that we're using the GNU C Library, where it returns a value of 0 to 2147483647 (2^32-1). Why does the following C-ish code (I'm extremely rusty at C, fwiw) *not* fairly shuffle a standard 52-card poker deck?

    Code:
    int deck[52];
    
    for (int i=0; i < 52; i++) {
      deck[i] = i;  // initialize deck with 52 distinct values
    }
    
    srand(time(0));  // Initialize PRNG based on system clock
    
    for (int i=51; i > 0; i--) {
       int j = rand() % (i+1); // choose random index from 0...i inclusive using modulo arithmetic
    
       if (j != i) {        // Classic XOR-based swap
         deck[i] ^= deck[j];   // C1 = C1_orig xor C2_orig
         deck[j] ^= deck[i];   // C2 = C2_orig xor C1_orig xor C2_orig = C1_orig
         deck[i] ^= deck[j];   // C1 = C1_orig xor C2_orig xor C1_orig = C2_orig
       }
    }
    
    This is a classic Fisher-Yates shuffle ( https://en.wikipedia.org/wiki/Fisher–Yates_shuffle ). The swap routine is correct, and it does generally follow the

    Code:
    To shuffle an array a of n elements (indices 0..n-1):
    for i from n − 1 downto 1 do
    j ← random integer such that 0 ≤ j ≤ i
    exchange a[j] and a[i]


    approach. Yet, off-hand, there are at least one general flaw and one nearly-universal but sort-of-system-dependent flaw that prevent this from working perfectly even if we assume that the GNU C Library implementation of rand is a truly random number generator and not just pseudorandom. If you were building an online casino or programming a video poker machine where real cash was involved, this would matter.).

    (1) Bar fvzcyr cebbs bs havirefny vapbeerpgarff vf gung gur ahzore bs cbffvoyr enaqbz inyhrf (gjb gb gur guvegl-frpbaq cbjre) vf nyzbfg nyjnlf abg tbvat gb or rirayl qvivfvoyr ol gur gur bcrenaq bs gur zbqhyhf shapgvba. N aba-mreb erznvaqre bs A zrnaf gung gur A cbfvgvbaf ng gur ortvaavat bs gur neenl ner fyvtugyl zber yvxryl gb or pubfra guna cbfvgvbaf gbjneqf gur raq bs gur neenl jura vg pbzrf gb qrpvqvat juvpu inyhr gb fjnc.

    Sbe vafgnapr, gjb gb gur guvegl-gjb unf n erznvaqre bs sbegl-rvtug jura qvivqrq ol svsgl-gjb. Gur ynfg fybg va gur neenl vf shyyl svkrq nsgre gur svefg fjnc, naq gur svefg sbegl-rvtug pneqf ner zber yvxryl gb or va gung fybg guna gur ynfg sbhe. Guvf vf na hasnve fuhssyr.

    (2) Gur frpbaq nethzrag vf zber flfgrz-fcrpvsvp... ohg gur ahzore bs cbffvoyr crezhgngvbaf bs svsgl-gjb havdhr pneqf vf... svsgl-gjb snpgbevny. Gung vf nccebkvzngryl rvtug gvzrf gra gb gur fvkgl-friragu cbjre, juvpu vf zber guna gjb gb gur fvkgl-sbegu cbjre. Abj, n frrqrq cfrhqbenaqbz ahzore trarengbe vf qrgrezvavfgvp sbe gur fnzr frrq; fb gur ahzore bs cbffvoyr bhgpbzrf bs gur fuhssyr nytbevguz vf ab terngre guna gur ahzore bs cbffvoyr frrqf. Ba zbfg flfgrzf, na vagrtre glcr vf fvkgl-sbhe ovgf; zbfg bs gur rkprcgvbaf jbhyq or guvegl-gjb. Gjb gb gur fvkgl-sbhe frrqf pnaabg erfhyg va rvtug gvzrf gra gb gur fvkgl-friragu crezhgngvbaf, fb ng yrnfg fbzr erfhygf zhfg or haernpunoyr naq gur fuhssyr vf gurersber abg gehyl snve.
     
    Sir Veza, Xayrn and Jayce like this.

Share This Page