# ReAntics
2017-18 University of Portland Capstone Project to develop a tool allowing students to create/debug agents using a variety of artificial intelligence techniques
## Caveats
- Agents with the same name: undefined behavior
# ReAntics Student Manual
## How to Play ReAntics:
### Rules of the Game:
**ReAntics is a turn-based tactics game which revolves around two players competing via two colonies of ants. Each player has his own anthill, queen ant and any other ants or tunnels he has built. The anthills can be used for “building” new ants and both anthills and tunnels can store food collected by ants. Each player begins the game with a single queen ant and loses the game if the queen is killed. The other ants must be bought with food that is gathered by worker ants.**
Victory can be achieved either through military or economic dominance of the map. Specifically, a player will win if his opponent’s queen is killed, his opponent’s anthill is captured, or if the player collects 11 units of food.
The game begins with a 10x10 (grid-based) board where each player places an anthill and tunnel on their side of the board. After placement, the queen ant is placed on the anthill and a worker ant is placed on the tunnel. As depicted by the red and blue boundaries in the game, the board is divided into three parts. The top four rows are Player 1’s side while the bottom four rows are Player 2’s side. The middle two rows belong to neither player.
Player 1 begins the game’s setup phase by placing her anthill, tunnel, and 9 grass pieces on her side of the board.. Lastly, players place two food sources on their enemy’s side of the map. After this last step, the players’ queen ants are placed on their respective ant hills, worker’s on their respective tunnels, and the setup phase is complete.
After setup, the player designated to go first make one or all of these actions: he may move each ant once which opens up the option to attack or build one ant from his anthill. When the player is done with his turn he clicks the “End” button. Only one ant is allowed to occupy a tile at a time.
To move an ant the player will click the ant she wishes to move and its square will be highlighted in green to show its selected. Any tiles the ant is allowed to move to will be highlighted green. Clicking on a highlighted tile will move the ant to that tile and shade it grey to show that it has already moved this turn.
If the move puts the ant in attack range of one or more enemy ants, all the enemy ants in range will be highlighted in red. To attack one of the ants the player may click on it. An attack must be made when available and, strategy-wise, there is no reason not to do so.
To create an ant the player selects his empty anthill. A popup menu will appear listing the four buildable ants. The player may click the ant type he wants to create and it will be created on top of the anthill if they have enough food. Or the player may click elsewhere on the board or press the esc key to cancel building an ant. The ant that is created cannot be moved until the next turn and so is shaded grey upon creation.
Each ant type performs slightly differently in the game according to performance attributes for Movement, Health, Attack, Range, and Build Cost. The performance attributes for the five ant types are summarized in Table 1.
**Table. The Ant Performance Attributes**
| Attribute | Worker | Drone | Soldier | Ranged Soldier | Queen |
| --- | :---: | :---: | :---: | :---: | :---: |
| **Special Characteristics** | Can carry food | Ignores grass, movement cost | | Ignores grass, movement cost | Results in loss if killed, Cannot leave home zone |
| **Movement:** The number of tiles and ant can move in one turn. | 2 | 3 | 2 | 1 | 2 |
| **Health:** The amount of damage an ant can sustain | 4 | 4 | 8 | 2 | 10 |
| **Attack:** The amount of damage the ant does when it attacks | 0 | 2 | 4 | 3 | 4 |
| **Range:** The distance from which this ant can attack | N/A | 1 | 1 | 3 | 1 |
| **Build Cost:** The amount of food it takes to build this ant | 1 | 2 | 2 | 2 | N/A |
The statistics for the four different construction types are show below. Constructions can be buildings, obstacles, or food.
**Table. The Construction Type Statistics**
| Attribute | Anthill | Tunnel | Grass | Food |
| --- | :---: | :---: | :---: | :---: |
| **Movement Cost:** The number of movement points it takes to move an ant onto this tile. | 1 | 1 | 2 | 1 |
| **Capture Health:** The number of turns an ant must be on this construction to capture it. | 3 | N/A | N/A | N/A |
### How to start a game:
#### QuickStart:
Select 1+ Agents:
1: Human v. AI
2: AI v. AI single set
3+: Round Robin between all of the agents selected
Enter a number of games to play (defaults to 1)
Click the Green **Quickstart** Button (top right).
( ** Note: Anything selected in **Additional Settings** will also be applied ** )
Start
Click on the dropdown menu at the top right, currently labeled “QuickStart”.
Select an option:
Two Player: select a player one and a player two (must be distinct, with **different names**)
Play Self: select a single agent to play against itself.
( ** Note: a copy will be created, with “@@” appended to the name,
and its player ID will be the constant COPY (-2) ** )
Round Robin: select 2+ agents to compete in a round robin tournament
(every combo plays the specified number of games)
Play All: select a single agent to play all of the other agents available in the game
Enter the number of games and click the “+” button to add it to the game queue on the left.
Continue to add games util you are satisfied with your queue.
Click the Green Start Button (bottom left).
( ** Note: Anything selected in **Additional Settings** and **Pause Conditions** will also be applied ** )
#### Additional Settings:
(applied to **both** QuickStart and Start)
**Alternate Player Start:** eliminate player 1 advantage by alternating which agent is player one each game
**Verbose:** print the win/loss record to the terminal
**Move Timeout:** Enter a move timeout in seconds (decimals allowed) **AND** check the option to apply
**Auto-Restart:** automatically restart the games queue on finish
**Pause on Start:** start the game in a paused state (to step through moves or get an accurate non-gameboard updating time)
**Pause on Illegal Move:** pause whenever there has been an illegal move submitted
**Layout Option:** Select either Player Invoked or Random Override (overrides the human player)
#### Pause Conditions:
(only applied to the Start Button)
Select a the two players and the joint conditions to pause under. Then add them to the list on the left.
### Human vs AI mode:
**Move ant:** Select the ant by clicking it, valid possible moves will be highlighted in green. Clicking on a highlighted square will move the ant to that location.
**Attack ant:** If an ant’s move takes it within range of an opponent’s ant, then it must make an attack. This is done by simply clicking the ant to attack. (Note: valid attacks options are highlighted in red).
**Capture a building:** End an ant’s turn on an enemy’s building. This will reduce the building capture health by 1 and when it reaches 0; either ownership of the building will swap to the capturing player or result in victory if the anthill is captured.
**Build ant:** Select the anthill when there is no ant currently on it. This will open a menu listing all available ants to build. Ants which the player can afford will be listed in black, ants which the player cannot afford will be listed in red. Selecting an ant from this list will build the ant on the anthill and deduct the food from the player’s food supply.
**End turn:** Simply click the “End” button.
**Undo:** Click the undo button to undo moves. The undo button can revert the state up through the beginning of the player’s turn.
### AI vs. AI mode:
A
没有合适的资源?快使用搜索试试~ 我知道了~
一种多动作、回合制游戏,用作教授人工智能中使用的算法和方法的工具_python_代码_下载
共81个文件
py:45个
gif:26个
json:3个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 197 浏览量
2022-06-22
05:37:27
上传
评论
收藏 288KB ZIP 举报
温馨提示
游戏规则: ReAntics 是一款回合制战术游戏,围绕两个玩家通过两个蚂蚁群进行竞争。每个玩家都有自己的蚁丘、蚁后和他建造的任何其他蚂蚁或隧道。蚁丘可用于“建造”新蚂蚁,蚁丘和隧道都可以储存蚂蚁收集的食物。每个玩家以一只蚁后开始游戏,如果蚁后被杀则输掉游戏。其他蚂蚁必须用工蚁采集的食物购买。 胜利可以通过地图的军事或经济优势来实现。具体来说,如果他的对手的女王被杀死,他的对手的蚁丘被捕获,或者如果玩家收集了 11 个单位的食物,玩家将获胜。 游戏从一个 10x10(基于网格)的棋盘开始,每个玩家在棋盘的一侧放置一个蚁丘和隧道。放置后,蚁后放置在蚁丘上,工蚁放置在隧道上。正如游戏中的红色和蓝色边界所描绘的那样,棋盘分为三个部分。前四行是玩家 1 的一侧,而后四行是玩家 2 的一侧。中间两排不属于任何玩家。 玩家 1 通过将她的蚁丘、隧道和 9 个草块放在棋盘的一侧来开始游戏的设置阶段。最后,玩家在地图的敌人一侧放置两个食物源。在这最后一步之后,玩家的蚁后被放置在各自的蚁丘上,工人的蚁后放置在各自的隧道上,设置阶段就完成了。 更多详情、使用方法,请下载后阅读README.md文件
资源推荐
资源详情
资源评论
收起资源包目录
ReAntics-master.zip (81个子文件)
ReAntics-master
ReAntics Student Manual.docx 28KB
src
Constants.py 2KB
Location.py 945B
Ant.py 2KB
Stress Tests
board.json 323B
SequenceTest.py 762B
sequence.json 90KB
BoardTest.py 729B
SetTest.py 999B
Test_GameSet_Settings.json 330B
GamePane.py 36KB
SettingsPane.py 44KB
Player.py 2KB
Construction.py 1KB
Building.py 1KB
make-distrib-windows.bat 33B
InfoScraper.py 3KB
start-windows.bat 14B
StatsPane.py 10KB
Inventory.py 2KB
MakeDistributable.py 3KB
RedoneWidgets.py 7KB
Textures
healthFull.gif 836B
healthDouble.gif 836B
grass.gif 6KB
queenBlue.gif 6KB
rsoldierBlue.gif 2KB
healthEmpty.gif 836B
anthillRed.gif 3KB
terrain_blue.gif 4KB
king.gif 5KB
terrain_green.gif 4KB
workerRed.gif 2KB
tunnelRed.gif 2KB
workerBlue.gif 2KB
soldierBlue.gif 2KB
terrain_red.gif 4KB
tunnelBlue.gif 2KB
droneRed.gif 2KB
FrameHelper.py 110KB
anthillBlue.gif 3KB
rsoldierRed.gif 2KB
terrain.gif 5KB
carrying.gif 3KB
terrain_grey.gif 4KB
icon.bmp 3KB
droneBlue.gif 2KB
queenRed.gif 3KB
food.gif 6KB
soldierRed.gif 2KB
AI
ErrorHandlingStressTest.py 8KB
Soldier.py 17KB
Random.py 5KB
shapeShifter.py 36KB
anthillAttackAI.py 15KB
FoodGatherer.py 5KB
Complex Food Gatherer.py 13KB
Nibble.py 13KB
Learning.py 30KB
LearningV2.py 32KB
Booger.py 6KB
Starve.py 18KB
DefensiveV1.py 15KB
rangedSoldierTestAI.py 5KB
BoogerTestTimeout.py 6KB
Very Complex Food Gatherer.py 14KB
Game.py 76KB
GUIHandler.py 16KB
Unit Tests
testGame.py 5KB
testAIutils.py 9KB
testStatsPane.py 1KB
testSettings.py 2KB
testGamePane.py 12KB
GameState.py 8KB
AIPlayerUtils.py 28KB
Move.py 1KB
HumanPlayer.py 3KB
.gitignore 275B
README.md 19KB
Hello World.py 2KB
ReAntics Test Plan.txt 3KB
共 81 条
- 1
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9154
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功