More than Just Lines on a Map: Best Practices for U.S Bike Routes
How to create AIWolf agent in C#
1. How to create AIWolf agent in C#
C#版人狼知能エージェントの作り方
version 2.0.0
Takashi OTSUKI
大槻 恭士
2. Prerequisits / 事前準備
• [EN] Install .NET Core SDK 2.2.
[JP] .NET Core SDK 2.2.をインストールしておく.
• [EN] Download ClientStarter with runtime, and extract it in the
directory you like.
[JP] ランタイム付きClientStarterをダウンロードして,任意のディレクト
リに展開しておく.
• [EN] Download AIWolf platform, and extract it in the directory you like.
[JP]人狼知能プラットフォームをダウンロードして,任意のディレクトリ
に展開しておく.
• [EN] Install JRE. This is necessary for AIWolf platform.
[JP] 人狼知能プラットフォームに必要なので,JREをインストールして
おく.
3. Example of preparations #1 / 準備例 #1
Supposing Linux here. / ここではLinuxを想定
• [EN] Confirmation of installed .NET Core SDK.
[JP] インストール済みの.NET Core SDKの確認
• [EN] Creation of working directory, extraction
and validation of ClientStarter.
[JP] 作業用ディレクトリの作成,ClientStarterの
展開と動作確認
4. Example of preparations #2 / 準備例 #2
• [EN] Confirmation of installed JRE.
[JP] インストール済みのJREの確認
• [EN] Extraction of AIWolf
platform.
[JP] 人狼知能プラットフォーム
の展開
• [EN] Validation of AIWolf platform.
[JP] 人狼知能プラットフォーム
の動作確認
5. Playing with the dummy / ダミープレイヤーで対戦
• [EN] Edit AutoStarter.ini in AIWolf-ver0.5.2 directory.
[JP] AIWolf-ver0.5.2ディレクトリ内のAutoStarter.iniを編集.
[EN] Uncomment
[JP] コメントを外す
[EN] Comment out
[JP] コメントアウト
• [EN] Run AutoStarter, then run ClientStarter with –d in another shell.
[JP] AutoStarter起動後,別シェルでClientStarterを-dを付けて起動
[EN] You can see that Dummy is running.
[JP] ダミープレイヤーが参加している
6. Making my own agent #1 / 独自エージェント作成 #1
• [EN] Create the project directory for your own agent, and
initialize it as class library project.
[JP] 独自エージェントプロジェクト用のディレクトリを作成し,
クラスライブラリプロジェクトとして初期化
7. Making my own agent #2 / 独自エージェント作成 #2
• [EN] Add AIWolfLib package to this project.
[JP] プロジェクトにAIWolfLibパッケージを追加
• [EN] Rename Class1.cs MyAgent.cs.
[JP] Class1.csをMyAgent.csにファイル名変更
8. Making my own agent #3 / 独自エージェント作成 #3
• [EN] Edit MyAgent.cs as
right figure using your
favorite editor.
[JP] お好みのエディタで
MyAgent.csを右図のように
編集
• [EN] Build this project.
[JP] プロジェクトをビルド
9. Making my own agent #4 / 独自エージェント作成 #4
• [EN] The dll file of this agent is located in the following directory.
[JP] エージェントのdllファイルは以下のディレクトリ内にある
bin/Debug/netstandard2.0
• [EN] Make this agent join the game.
[JP] 作成したエージェントをゲームに参加させてみる
(Suppose ClientStarter in search path / ClientStarterにパスが通っているとする)
[EN] You can see that MyAgent joins
the game with no problem.
[JP] MyAgentが無事にゲームに参
加できていることがわかる