強化裝備 墊子玄學

 墊子問題

    如果遊戲強化機制用的是random()函數,那麼多半沒有給定種子,以無參構造函數使用。

    而無參形式便與當前時間有關,也就有網友說的是  某強化時間段 成功率高的原因。

    但系統隨機都是僞隨機。

      例如給定種子(帶參數的):

        Random random = new Random(50);
        System.out.println(random.nextInt(100));
        System.out.println(random.nextInt(100));
        Random random1 = new Random(50);
        System.out.println(random1.nextInt(100));
        System.out.println(random1.nextInt(100));

     輸出:

               17 
               88 
               17 
               88

   而不給定種子的無參構造函數與當前時間有關。

  其源碼:

 public Random() {

   this(seedUniquifier() ^ System.nanoTime());
    }

 System.nanoTime() 可以看出這個就是與系統時間相關的,繼續百度。

 public static long nanoTime():

           Returns the current value of the most precise available system timer, in nanoseconds.
           This method can only be used to measure elapsed time and is not related to any other notion of system or wall-clock time.The value returned represents nanoseconds since some fixed but arbitrary time (perhaps in the future, so values may be negative). This method provides nanosecond precision, but not necessarily nanosecond accuracy. No guarantees are made about how frequently values change. Differences in successive calls that span greater than approximately 292 years (263 nanoseconds) will not accurately compute elapsed time due to numerical overflow.

   Returns:The current value of the system timer, in nanoseconds.
   Since:1.5

   上面說返回當前的系統時間,以毫微秒的方式。

   但中間有段英語,說以何時開始計算起始點並不確定。。。也就是說,初始值不確定。

   於是這個函數一般用於計算中間的時間段。。。

   可是,初始值爲什麼不確定,可以繼續研究。。。

 -----------------------------------------------

11.11日 看主播"擼了22年的右手"強化裝備,各種失敗。。。再次覺得冒險島2強化裝備 墊子沒啥卵用。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章