0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

乱数調整

Posted at

■ 使われる数式の概要と目的

数式記号 意味
F + (Y - 2000) = N フレーム数と年の合計で「ターゲット値」N を合わせるための式
M × D + m + s = T 月×日 + 分 + 秒で時間の特定(ソフト起動時間の設定)
seed消費 = 2A + 1B + 1C A: 冒険ノート消費, B: ぺラップ, C: 配達受取での強制消費

1. フレームと待機時間の計算

フレーム式:

F + (Y - 2000) = N
  • F:起動後からの待機フレーム数(ゲーム内部処理単位)
  • Y:年(2000年以降)
  • N:ターゲット値(seed設定に基づく目標値)

例:2009年にしたい場合

F + 9 = 2547  →  F = 2547 - 9 = 2538

フレームから待機時間へ変換:

wait_seconds = (F + blank_frames) / 60
  • blank_frames: ソフト選択から起動までの空白時間(例: 233F)
  • 1F ≒ 1/60 秒なので、60で割る
(2538 + 233) / 60 = 46.18 秒

2. ソフト選択時刻の計算(分・秒調整)

時刻式:

月 × 日 + 分 + 秒 = T
  • T:目標値(例: 191 or 447)
  • 時(hour)は固定(例: 14時)

例:

11 × 11 + 14 + 56 = 121 + 14 + 56 = 191
  • 時刻は 14:14:56
  • ソフト選択時刻は 46.18 秒前 → 14:14:09.82

3. seed消費数(乱数調整ステップ)

総消費 = 260 を作るための構成:

2 × A + 1 × B + 1 × C = 260
  • A = 129 冒険ノートめくり回数(2消費/回)
  • B = 1 ぺラップステータス閲覧(1消費)
  • C = 1 受取時の強制消費(1消費)
2×129 + 1 + 1 = 260

4. seedズレの補正理論

目的のseedとのズレ補正

  • 例:6Fズレ → 6 / 60 = 0.1秒 待機時間を減らす
wait_seconds -= 0.1

奇数ズレ回避

  • ズレが奇数(+1F, -1Fなど)で補正しても合わない場合:
    を ±1 する(例: 2009 → 2008)

なぜ?
→ 一部のROMや機種(特にDSLite)では、年が奇数か偶数かで処理順序が変わることがあるため


5. コイントスパターンでseed一致確認

  • 受け取ったポケモンが正しいかを判定するには、
    → seedごとの「コイントスパターン(○/✕)」と照合する

  • 照合できない場合:

    • seedがズレている → 待機時間 or 年が間違っている可能性
    • 消費数がズレている → 冒険ノートやぺラップの回数を再確認

6. フロー図的まとめ(数式ベース)

[初期seed, 消費数, 年, 時, 月, 日, 分, 秒, 空白F] →
  計算1:F = N - (Y - 2000)
  計算2:wait = (F + blankF) / 60
  計算3:月×日 + 分 + 秒 = T → t_start = t_target - wait
  実行:
    1. ソフト選択 ← t_start
    2. 続きから ← t_target
    3. 冒険ノートA回、ぺラップ1回 → 乱数260
    4. 配達員受取
    5. 個体値 & コイントス確認 → seed OK?

7. 実装可能なPython形式(時間計算部のみ)

# Program Name: rng_timer_calculator.py
# Creation Date: 20250729
# Overview: Calculate wait and start time for 4th gen Pokémon RNG manipulation
# Usage: Run this script to get frame wait time and soft selection time from target seed timing

# 必要なライブラリなし

# 日本語:目標seedタイミングと空白フレームから待機時間と選択時刻を計算
# English: Calculate wait seconds and soft selection time from seed target frame and blank frame

# --- 設定変数 ---
target_frame_sum = 2547     # フレーム+年-2000 (F + Y - 2000)
target_year = 2009          # 使用する年
blank_frames = 233          # 空白時間フレーム数(ソフト起動まで)
target_hour = 14            # ソフト起動時刻(時)
target_minute = 14          # ソフト起動時刻(分)
target_second = 56          # ソフト起動時刻(秒)

# --- フレームと待機時間計算 ---
wait_frames = target_frame_sum - (target_year - 2000)  # フレームF = N - (Y - 2000)
wait_seconds = (wait_frames + blank_frames) / 60       # 秒に変換

# --- ソフト選択時間を計算(目標時間 - 待機時間) ---
target_total_sec = target_hour * 3600 + target_minute * 60 + target_second
start_total_sec = target_total_sec - wait_seconds

start_hour = int(start_total_sec // 3600)
start_minute = int((start_total_sec % 3600) // 60)
start_second = round(start_total_sec % 60, 2)

# --- 結果出力 ---
print(f"Wait seconds: {round(wait_seconds, 2)}")
print(f"Soft selection time: {start_hour:02}:{start_minute:02}:{start_second:05.2f}")
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?