Theory of Computer Games (Fall 2018) Final Project
National Taiwan University
Code Due Date: 09:00 (UTC+8), January 17, 2019 Report Due Date: 09:00 (UTC+8), January 18, 2019
Description
In the final project, you have to implement a Chinese Dark Chess (暗棋) agent.
For the rule of Chinese Dark Chess, please refer to http://www.iis.sinica.edu.tw/~tshsu/tcg/2018/
hwks/rules.pdf.
Check your email for the password of the template code and CDC_interface.
Requirements
ImplementNegaScout algorithm.
Implementtransposition table by hashing. You’reNOT allowed to use struct hsearch_data,
std::unordered_map, __gnu_pbds::gp_hash_table, or other hash table libraries.
Specify how to compile your code under Windows or Linux in the report.
Your program is required to play a game normally via the given CDC_interface.
Submission
Directory hierarchy:
[your_id]// e.g. b07902000
source// the directory contains your code report.pdf
Compress your folder into a zip file.
Due to the server limitation, the file size is restricted to2M bytes.
Report
Your report should contain but not limited to how to compile and run your code
what algorithms and heuristics you’ve implemented
You have to give theline numbersof each of your algorithms / heuristics.
the experiments you’ve done
Grading Policy
Final Score = Code Score + Report Score + Bonus (Code Score + Report Score)∈ [0, 40].
You get Bonus if your tournament performance is considered good enough.
Under the following circumstances, you will be graded extremely low.
You claim something you’ve done but actually you didn’t.
Your program doesn’t compile or run.
Your program can’t play a game normally.
You didn’t do anything and just upload the template code.
Swiss-System Tournament
The following shows the procedure of the tournament:
1: randomly match you with an opponent 2: while true do
3: play 2 rounds with your opponent; you two take turns to be the first player
4: if the judge considers it sufficient to distinguish the top AIs then
5: break
6: end if
7: match you with another opponent according to your record 8: end while
If you win/draw/lose in a round, you get 1/0.5/0 point.
Suppose you get S points and your i-th opponent gets si points, then your score is given by std::pair(S, ∑
si).
Basic Rules
一個程式一盤棋可用計算時間為900 秒,超時立刻算輸。
三循環算和。
雙方連續 30 步皆無吃無翻算和。
單局犯規(輸出不合法步、程式不正常結束等)發生第二次 立刻算輸。
裁判擁有所有棋局最終判決權以及犯規時棋局繼續方式的決 定權。
GUI Usage
Refer to “暗棋對弈平台 _ 使用手冊 _windows.pdf” or
“User manual of Chinese dark chess client_linux.pdf”.
思考模式 讀檔模式
讀 board.txt,寫 move.txt。
每下一步程式就會結束。
背景模式
透過 socket 讀寫。
每下一步程式不會結束。
每下完一場介面還是會砍掉你的程式。
目前不支援 local 對戰,必須連 server。
If you want two of your AIs to fight with each other, you have to create another folder that contains the GUI. Use one GUI to create the game room and let the other to join the room.
Template Code
The template contains
main.cc, anqi.cc, anqi.hh
Protocol.h, Protocol.cpp, ClientSocket.h, ClientSocket.cpp
In most cases you only need to modify main.cc, anqi.cc, and anqi.hh.
Compiler options:
The options -static -s should be enabled under all operating systems.
The option -lwsock32 should be enabled under Windows.
Use -D WINDOWS to enable extra Windows-only feature.
The template is encoded in big-5. You may convert it into
Board Index
Frequently Asked Questions
For MAC:
Q: Is there a GUI version for MAC?
A: Currently there is no MAC version.
For Linux:
Q: What does “permission denied” mean?
A: Your “search” file needs to be executable.
Q: Why doesn’t my GUI interface work?
A: Make sure to add LD_LIBRARY_PATH=. to include the GameDLL.so.
Misc:
Q: Any hardware limit?
A: In the tournament, you need to prepare your own hardware.