久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    <bdo id='hYRvb'></bdo><ul id='hYRvb'></ul>
  • <tfoot id='hYRvb'></tfoot>

      1. <legend id='hYRvb'><style id='hYRvb'><dir id='hYRvb'><q id='hYRvb'></q></dir></style></legend>

        <i id='hYRvb'><tr id='hYRvb'><dt id='hYRvb'><q id='hYRvb'><span id='hYRvb'><b id='hYRvb'><form id='hYRvb'><ins id='hYRvb'></ins><ul id='hYRvb'></ul><sub id='hYRvb'></sub></form><legend id='hYRvb'></legend><bdo id='hYRvb'><pre id='hYRvb'><center id='hYRvb'></center></pre></bdo></b><th id='hYRvb'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='hYRvb'><tfoot id='hYRvb'></tfoot><dl id='hYRvb'><fieldset id='hYRvb'></fieldset></dl></div>

        <small id='hYRvb'></small><noframes id='hYRvb'>

        什么是游戲的好的隨機數生成器?

        What is a good random number generator for a game?(什么是游戲的好的隨機數生成器?)
        <legend id='TKd4w'><style id='TKd4w'><dir id='TKd4w'><q id='TKd4w'></q></dir></style></legend>

          <small id='TKd4w'></small><noframes id='TKd4w'>

          <tfoot id='TKd4w'></tfoot>
            <bdo id='TKd4w'></bdo><ul id='TKd4w'></ul>
              <tbody id='TKd4w'></tbody>

              • <i id='TKd4w'><tr id='TKd4w'><dt id='TKd4w'><q id='TKd4w'><span id='TKd4w'><b id='TKd4w'><form id='TKd4w'><ins id='TKd4w'></ins><ul id='TKd4w'></ul><sub id='TKd4w'></sub></form><legend id='TKd4w'></legend><bdo id='TKd4w'><pre id='TKd4w'><center id='TKd4w'></center></pre></bdo></b><th id='TKd4w'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='TKd4w'><tfoot id='TKd4w'></tfoot><dl id='TKd4w'><fieldset id='TKd4w'></fieldset></dl></div>

                1. 本文介紹了什么是游戲的好的隨機數生成器?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  在 C++ 中用于游戲的好的隨機數生成器是什么?

                  我的考慮是:

                  1. 需要大量隨機數,所以速度不錯.
                  2. 玩家總是會抱怨隨機數,但我希望能夠向他們指出一個參考資料,說明我確實做到了我的工作.
                  3. 由于這是一個我沒有太多時間參與的商業項目,如果算法 a) 相對容易實現或 b) 有一個很好的非 GPL 實現可用,那就太好了.
                  4. 我已經在很多地方使用了 rand(),所以任何其他生成器最好能證明它需要的所有更改是合理的.

                  我對這個主題不太了解,所以我能想到的唯一選擇是 Mersenne捻線機;它是否滿足所有這些要求?還有什么更好的嗎?

                  Mersenne Twister 似乎是共識選擇.但是第 4 點呢?它真的比 rand() 好很多嗎?

                  編輯 2: 讓我更清楚地說明第 2 點:玩家無法通過知道隨機數來作弊.時期.我希望它足夠隨機,以至于人們(至少那些了解隨機性的人)不會抱怨它,但我并不擔心預測.這就是為什么我把速度作為首要考慮因素.

                  編輯 3:我現在傾向于 Marsaglia RNG,但我仍然希望獲得更多的輸入.因此,我正在設置賞金.

                  編輯 4: 請注意:我打算在今天 UTC 午夜之前接受一個答案(以避免弄亂某人的代表上限).因此,如果您正在考慮回答,請不要等到最后一刻!
                  另外,我喜歡 Marsaglia 的 XORshift 生成器的外觀.有人對他們有任何意見嗎?

                  解決方案

                  George Marsaglia 有開發了一些目前可用的最好和最快的 RNGMultiply-with-carry 是一個值得注意的均勻分布.>

                  === 更新 2018-09-12 ===

                  對于我自己的工作,我現在使用 Xoshiro256**,這是對 Marsaglia 的 XorShift 的一種進化/更新.

                  === 更新 2021-02-23 ===

                  在 .NET 6(目前為預覽版)中,System.Random 的實現已更改為使用 xoshiro256**,但僅適用于無參數構造函數.采用種子的構造函數使用舊的 PRNG 以保持向后兼容性.有關詳細信息,請參閱提高隨機性(性能、API 等)

                  What is a good random number generator to use for a game in C++?

                  My considerations are:

                  1. Lots of random numbers are needed, so speed is good.
                  2. Players will always complain about random numbers, but I'd like to be able to point them to a reference that explains that I really did my job.
                  3. Since this is a commercial project which I don't have much time for, it would be nice if the algorithm either a) was relatively easy to implement or b) had a good non-GPL implementation available.
                  4. I'm already using rand() in quite a lot of places, so any other generator had better be good to justify all the changes it would require.

                  I don't know much about this subject, so the only alternative I could come up with is the Mersenne Twister; does it satisfy all these requirements? Is there anything else that's better?

                  Edit: Mersenne Twister seems to be the consensus choice. But what about point #4? Is it really that much better than rand()?

                  Edit 2: Let me be a little clearer on point 2: There is no way for players to cheat by knowing the random numbers. Period. I want it random enough that people (at least those who understand randomness) can't complain about it, but I'm not worried about predictions. That's why I put speed as the top consideration.

                  Edit 3: I'm leaning toward the Marsaglia RNGs now, but I'd still like more input. Therefore, I'm setting up a bounty.

                  Edit 4: Just a note: I intend to accept an answer just before midnight UTC today (to avoid messing with someone's rep cap). So if you're thinking of answering, don't wait until the last minute!
                  Also, I like the looks of Marsaglia's XORshift generators. Does anyone have any input about them?

                  解決方案

                  George Marsaglia has developed some of the best and fastest RNGs currently available Multiply-with-carry being a notable one for a uniform distribution.

                  === Update 2018-09-12 ===

                  For my own work I'm now using Xoshiro256**, which is a sort of evolution/update on Marsaglia's XorShift.

                  === Update 2021-02-23 ===

                  In .NET 6 (currently in preview) the implementation of System.Random has been changed to use xoshiro256**, but only for the parameterless constructor. The constructor that takes a seed uses the old PRNG in order to maintain backwards compatibility. For more info see Improve Random (performance, APIs, ...)

                  這篇關于什么是游戲的好的隨機數生成器?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  read input files, fastest way possible?(讀取輸入文件,最快的方法?)
                  The easiest way to read formatted input in C++?(在 C++ 中讀取格式化輸入的最簡單方法?)
                  Reading from .txt file into two dimensional array in c++(從 .txt 文件讀取到 C++ 中的二維數組)
                  How to simulate a key press in C++(如何在 C++ 中模擬按鍵按下)
                  Why doesn#39;t getline(cin, var) after cin.ignore() read the first character of the string?(為什么在 cin.ignore() 之后沒有 getline(cin, var) 讀取字符串的第一個字符?)
                  What is the cin analougus of scanf formatted input?(scanf 格式輸入的 cin 類比是什么?)
                2. <legend id='TVfXL'><style id='TVfXL'><dir id='TVfXL'><q id='TVfXL'></q></dir></style></legend>
                    <tbody id='TVfXL'></tbody>
                      <bdo id='TVfXL'></bdo><ul id='TVfXL'></ul>
                      <tfoot id='TVfXL'></tfoot>

                          • <small id='TVfXL'></small><noframes id='TVfXL'>

                          • <i id='TVfXL'><tr id='TVfXL'><dt id='TVfXL'><q id='TVfXL'><span id='TVfXL'><b id='TVfXL'><form id='TVfXL'><ins id='TVfXL'></ins><ul id='TVfXL'></ul><sub id='TVfXL'></sub></form><legend id='TVfXL'></legend><bdo id='TVfXL'><pre id='TVfXL'><center id='TVfXL'></center></pre></bdo></b><th id='TVfXL'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='TVfXL'><tfoot id='TVfXL'></tfoot><dl id='TVfXL'><fieldset id='TVfXL'></fieldset></dl></div>
                          • 主站蜘蛛池模板: 免费观看成人鲁鲁鲁鲁鲁视频 | 91新视频| 亚洲精品视频二区 | 黄免费观看视频 | 国产精品爱久久久久久久 | 成人国产精品免费观看 | 欧美成人a | 精品91av | 亚洲人成人一区二区在线观看 | 精品电影| 在线中文字幕视频 | 精品国产乱码久久久久久蜜退臀 | 日本久久网 | 欧美一级大片免费看 | zzzwww在线看片免费 | 国产视频观看 | 国产精品久久久久aaaa九色 | 久久香焦 | 亚洲精品一区二区 | 午夜精品久久久久久久久久久久 | 久久综合一区 | 国内精品久久久久久影视8 最新黄色在线观看 | 精品在线播放 | 国产免费黄网 | 综合二区| 自拍中文字幕 | 在线观看日本网站 | 天天影视亚洲综合网 | 久久国产精品久久久久 | 国产一区二区不卡 | 日韩免费在线观看视频 | 狠狠ri | 51ⅴ精品国产91久久久久久 | 欧美一级网站 | 99日韩 | 中文字幕一区在线观看视频 | 国产高清一区二区 | 国产精品久久久久久久久久久免费看 | 有码一区 | 亚洲国产精品一区二区三区 | 天天曰夜夜操 |