pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

    <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="00im20w" id='hYRvb'><tfoot id='hYRvb'></tfoot><dl id='hYRvb'><fieldset id='hYRvb'></fieldset></dl></div>

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

        什么是游戲的好的隨機(jī)數(shù)生成器?

        What is a good random number generator for a game?(什么是游戲的好的隨機(jī)數(shù)生成器?)
        <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="0eoyqak" id='TKd4w'><tfoot id='TKd4w'></tfoot><dl id='TKd4w'><fieldset id='TKd4w'></fieldset></dl></div>

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

                  問題描述

                  在 C++ 中用于游戲的好的隨機(jī)數(shù)生成器是什么?

                  我的考慮是:

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

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

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

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

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

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

                  解決方案

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

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

                  對(duì)于我自己的工作,我現(xiàn)在使用 Xoshiro256**,這是對(duì) Marsaglia 的 XorShift 的一種進(jìn)化/更新.

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

                  在 .NET 6(目前為預(yù)覽版)中,System.Random 的實(shí)現(xiàn)已更改為使用 xoshiro256**,但僅適用于無參數(shù)構(gòu)造函數(shù).采用種子的構(gòu)造函數(shù)使用舊的 PRNG 以保持向后兼容性.有關(guān)詳細(xì)信息,請(qǐng)參閱提高隨機(jī)性(性能、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, ...)

                  這篇關(guān)于什么是游戲的好的隨機(jī)數(shù)生成器?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

                  read input files, fastest way possible?(讀取輸入文件,最快的方法?)
                  The easiest way to read formatted input in C++?(在 C++ 中讀取格式化輸入的最簡(jiǎn)單方法?)
                  Reading from .txt file into two dimensional array in c++(從 .txt 文件讀取到 C++ 中的二維數(shù)組)
                  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) 讀取字符串的第一個(gè)字符?)
                  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="c2e0us2" id='TVfXL'><tfoot id='TVfXL'></tfoot><dl id='TVfXL'><fieldset id='TVfXL'></fieldset></dl></div>
                          • 主站蜘蛛池模板: 船用烟火信号弹-CCS防汛救生圈-船用救生抛绳器(海威救生设备) | 上海租奔驰_上海租商务车_上海租车网-矢昂汽车服务公司 | 国产液相色谱仪-超高效液相色谱仪厂家-上海伍丰科学仪器有限公司 | 工控机,嵌入式主板,工业主板,arm主板,图像采集卡,poe网卡,朗锐智科 | 电子天平-华志电子天平厂家 | 开锐教育-学历提升-职称评定-职业资格培训-积分入户 | 艺术涂料_进口艺术涂料_艺术涂料加盟_艺术涂料十大品牌 -英国蒙太奇艺术涂料 | 中药二氧化硫测定仪,食品二氧化硫测定仪|俊腾百科 | 江苏农村商业银行招聘网_2024江苏农商行考试指南_江苏农商行校园招聘 | 深圳货架厂家_金丽声精品货架_广东金丽声展示设备有限公司官网 | 玉米深加工设备-玉米深加工机械-新型玉米工机械生产厂家-河南粮院机械制造有限公司 | Win10系统下载_32位/64位系统/专业版/纯净版下载 | 专业深孔加工_东莞深孔钻加工_东莞深孔钻_东莞深孔加工_模具深孔钻加工厂-东莞市超耀实业有限公司 | 高铝砖-高铝耐火球-高铝耐火砖生产厂家-价格【荣盛耐材】 | 干式磁选机_湿式磁选机_粉体除铁器-潍坊国铭矿山设备有限公司 | 电动高压冲洗车_价格-江苏速利达机车有限公司 | 高空重型升降平台_高空液压举升平台_高空作业平台_移动式升降机-河南华鹰机械设备有限公司 | 土壤墒情监测站_土壤墒情监测仪_土壤墒情监测系统_管式土壤墒情站-山东风途物联网 | 非甲烷总烃分析仪|环控百科 | 氟氨基酮、氯硝柳胺、2-氟苯甲酸、异香兰素-新晨化工 | 中矗模型-深圳中矗模型设计有限公司| 杭州火蝠电商_京东代运营_拼多多全托管代运营【天猫代运营】 | 天津试验仪器-电液伺服万能材料试验机,恒温恒湿标准养护箱,水泥恒应力压力试验机-天津鑫高伟业科技有限公司 | 广东成考网-广东成人高考网| 流水线电子称-钰恒-上下限报警电子秤-上海宿衡实业有限公司 | 钢化玻璃膜|手机钢化膜|钢化膜厂家|手机保护膜-【东莞市大象电子科技有限公司】 | 热处理炉-退火炉-回火炉设备厂家-丹阳市电炉厂有限公司 | 点焊机-缝焊机-闪光对焊机-电阻焊设备生产厂家-上海骏腾发智能设备有限公司 | PO膜_灌浆膜及地膜供应厂家 - 青州市鲁谊塑料厂 | 珠海网站建设_响应网站建设_珠海建站公司_珠海网站设计与制作_珠海网讯互联 | 浙江红酒库-冰雕库-气调库-茶叶库安装-医药疫苗冷库-食品物流恒温恒湿车间-杭州领顺实业有限公司 | 浙江建筑资质代办_二级房建_市政_电力_安许_劳务资质办理公司 | 科威信洗净科技,碳氢清洗机,超声波清洗机,真空碳氢清洗机 | 哈尔滨京科脑康神经内科医院-哈尔滨治疗头痛医院-哈尔滨治疗癫痫康复医院 | 影像测量仪_三坐标测量机_一键式二次元_全自动影像测量仪-广东妙机精密科技股份有限公司 | 胃口福饺子加盟官网_新鲜现包饺子云吞加盟 - 【胃口福唯一官网】 | 北京乾茂兴业科技发展有限公司| 反渗透阻垢剂-缓蚀阻垢剂厂家-循环水处理药剂-山东鲁东环保科技有限公司 | 新能源汽车电池软连接,铜铝复合膜柔性连接,电力母排-容发智能科技(无锡)有限公司 | 无锡网站建设_小程序制作_网站设计公司_无锡网络公司_网站制作 | 培训一点通 - 合肥驾校 - 合肥新亚驾校 - 合肥八一驾校 |