
FPSとは「farames per second」のこと。1秒間に処理できるフレーム数を表し、PCゲーム等では、いかに滑らかにゲームを遊ぶことができるかを示す重要なヒントとなります。
例えば、人気ゲーム「Minecraft」の従来バージョン(Java版)には、F3キーによって現在のFPSを画面上に表示することができる機能が内蔵されていました。
残念ながら、Windows Storeからダウンロードできる「Minecraft Windows 10 Edition」にはこの機能が搭載されておらず、また一般にUWPアプリでは、従来のデスクトップアプリでFPSを表示できた「Fraps」というようなツールも利用できなくなっています。
今回はこのようなUWPアプリでFPSを調査する方法を説明します。
PresentMonを使用する
UWPアプリのFPSを測定したい場合「PresentMon」と呼ばれるコマンドラインツールを使用します。GitHubのリリースページから、最新のEXEファイルをダウンロードしてコマンドプロンプトから実行します。
以下のような書式です。
PresentMon64-1.2.1.exe -process_id [プロセスID]
プロセスID(PID)はタスクマネージャから調べます。タスクマネージャの列のヘッダーを右クリックして「PID」にチェックを入れ、目的のアプリのPIDを確認します。

▲上の場合MinecraftのPIDは19264なので以下のように打ち込みます
PresentMon64-1.2.1.exe -process_id 19264
実行すると新たな画面が表示され、FPSが刻々と変化していく様子が確認できます。表示したまま最適なFPSになるようゲームの設定を調節することが可能です。

実行後は、実データがCSVファイルとして出力されます。より詳細な調査が必要な場合、そのファイルを分析することもできます。
PresentMonには以下のようなコマンドラインオプションが準備されています。詳細はGitHubページでご確認ください。
Capture target options:
-captureall Record all processes (default).
-process_name [exe name] Record specific process specified by name.
-process_id [integer] Record specific process specified by ID.
Output options:
-no_csv Do not create any output file.
-output_file [path] Write CSV output to specified path. Otherwise, the default is
PresentMon-PROCESSNAME-TIME.csv.
Control and filtering options:
-etl_file [path] Consume events from an ETL file instead of a running process.
-scroll_toggle Only record events while scroll lock is enabled.
-scroll_indicator Set scroll lock while recording events.
-hotkey [key] Use specified key to start and stop recording, writing to a
unique file each time (default is F11).
-delay [seconds] Wait for specified time before starting to record. When using
-hotkey, delay occurs each time recording is started.
-timed [seconds] Stop recording after the specified amount of time. PresentMon will exit
timer expires.
-exclude_dropped Exclude dropped presents from the csv output.
-terminate_on_proc_exit Terminate PresentMon when all instances of the specified process exit.
-terminate_after_timed Terminate PresentMon after the timed trace, specified using -timed, completes.
-simple Disable advanced tracking (try this if you encounter crashes).
-verbose Adds additional data to output not relevant to normal usage.
-dont_restart_as_admin Don't try to elevate privilege.
-no_top Don't display active swap chains in the console window.
まとめ
PresentMonを利用すれば、(少し面倒ですが)UWPアプリのFPSを調査することができます。最適なゲームの設定を探してる方は利用してみてはいかがでしょうか。
なおPresentMonを使いやすくする「PresentMonLauncherや、有料の「Dxtory」と呼ばれるツールを使うことも可能です。場合によってはこれらを試しても良いかもしれません。
