Se ha denunciado esta presentación.
Utilizamos tu perfil de LinkedIn y tus datos de actividad para personalizar los anuncios y mostrarte publicidad más relevante. Puedes cambiar tus preferencias de publicidad en cualquier momento.

How to make an artificial intelligence based werewolf agent in C# using Visual Studio

654 visualizaciones

Publicado el

How to make an artificial intelligence based werewolf agent in C# using Visual Studio.

Publicado en: Software
  • Sé el primero en comentar

  • Sé el primero en recomendar esto

How to make an artificial intelligence based werewolf agent in C# using Visual Studio

  1. 1. How to make an artificial intelligence based werewolf agent in C# using Visual Studio Takashi OTSUKI Academic Assembly, Yamagata University JAPAN
  2. 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.
  3. 3. Creating new project #1 File>New>Project
  4. 4. Creating new project #2 1. Select “Class Library”. 2. Enter the name of this project. (We name “MyFirstAgent” here.)
  5. 5. Creating new project #3 Source code of Class1 is automatically created.
  6. 6. Adding references Add references to AIWolfLibCommon.dll, AIWolfLibClient.dll of AIWolf.NET.
  7. 7. Making my own RoleAssignPlayer #1 Rename Class1.cs MyRoleAssignPlayer.cs.
  8. 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. 9. Making my own RoleAssignPlayer #3 Click the light bulb and select “Implement Abstract Class”.
  10. 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. 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. 12. Play AIWolf game using my own player #2 Click “Start” Connection Completed Start Game
  13. 13. Implementation of seer player #1 Project>Add Class Add MySeerPlayer.cs.
  14. 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. 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. 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. 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. 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. 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

×