VK Business Profile - provides IT solutions and Web Development
How to make an artificial intelligence based werewolf agent in C# using Visual Studio
1. How to make an artificial intelligence
based werewolf agent in C#
using Visual Studio
Takashi OTSUKI
Academic Assembly, Yamagata University JAPAN
2. Preparations
1. Install Visual Studio. We use VS Community 2015 here.
2. Download and unzip AIWolf platform.
http://www.aiwolf.org/aiwp/wp-content/uploads/2014/03/aiwolf-ver0.3.2.zip
3. Download and unzip AIWolf.NET.
https://github.com/AIWolfSharp/AIWolf_NET/releases/download/v0.1.0/AIWolf_NET-0.1.0.zip
4. Obtain Json.NET and put Newtonsoft.Json.dll into the same folder
of AIWolf.NET.
7. Making my own RoleAssignPlayer #1
Rename Class1.cs MyRoleAssignPlayer.cs.
8. Making my own RoleAssignPlayer #2
Designate AbstractRoleAssignPlayer as the base class of MyRoleAssignPlayer.
Click the light bulb and select the quick action of adding “using” directive.
9. Making my own RoleAssignPlayer #3
Click the light bulb and select “Implement Abstract Class”.
10. Making my own RoleAssignPlayer #4
1. Modify “Name” property so that it will return string of “MyRoleAssignPlayer”.
2. Remove unnecessary usings.
3. We get the AIWolf agent which uses different sample player classes for different
roles.
11. Play AIWolf game using my own player #1
Project>MyFirstAgent Properties>Debug
1. Check “Start external program” and select ClientStarter.exe of AIWolf.NET.
2. In order to connect port 10000 of localhost and request the game server to assign
role of seer to this player, enter the command line arguments as follows.
-h localhost –p 10000 –c MyFirstAgent.MyRoleAssignPlayer MyFirstAgent.dll SEER
12. Play AIWolf game using my own player #2
Click “Start”
Connection
Completed
Start Game
14. Implementation of seer player #2
1. Designate AbstractSeer as the base
class of MySeerPlayer.
2. Click the light bulb and select the
quick action of adding “using”
directive.
3. Click the light bulb and select
“Implement Abstract Class”.
15. Implementation of seer player #3
Implement the method Divine() so that the seer will divine the player
chosen at random from alive others.
16. Implementation of seer player #4
Implement the method Vote()
so that the seer will
1. Vote the werewolf player
chosen at random from the
known werewolves,
2. Vote the player chosen at
random from the players
of uncertain team if any
werewolves are known.
17. Implementation of seer player #5
Implement the method Talk()
so that the seer will
1. Confess his role if he has
found a werewolf by
divination,
2. Report the result of
divination after the
confession.
18. Implementation of seer player #6
1. Nothing is implemented for the
method Finish() for now.
2. Implement the constructor of
MyRoleAssignPlayer class so that
MySeerPlayer class is used in
acting as seer.
19. Entry for AIWolf competition
1. Build on release configuration.
2. The file to be submitted is MyFirstAgent.dll in binRelease folder.
3. Before the submission, copy MyFirstAgent.dll into the folder of
AIWolf.NET and check that it works on command prompt as
follows.
ClientStarter.exe -h localhost –p 10000 –c MyFirstAgent.MyRoleAssignPlayer
MyFirstAgent.dll SEER