Software Development of the Board Game Agricola

Similar documents
Components. Wooden playing pieces:

Einfach Genial ( Simply Ingenious ), by Reiner Knizia

The 17th Century: Not an Easy Time for Farming

Chapter 7: DESIGN PATTERNS. Hamzah Asyrani Sulaiman

Card Racer. By Brad Bachelor and Mike Nicholson

Dragon Canyon. Solo / 2-player Variant with AI Revision

IMPROVING TOWER DEFENSE GAME AI (DIFFERENTIAL EVOLUTION VS EVOLUTIONARY PROGRAMMING) CHEAH KEEI YUAN

Learning to Play like an Othello Master CS 229 Project Report. Shir Aharon, Amanda Chang, Kent Koyanagi

The purpose of this document is to help users create their own TimeSplitters Future Perfect maps. It is designed as a brief overview for beginners.

Have you ever been playing a video game and thought, I would have

USING A FUZZY LOGIC CONTROL SYSTEM FOR AN XPILOT COMBAT AGENT ANDREW HUBLEY AND GARY PARKER

Google DeepMind s AlphaGo vs. world Go champion Lee Sedol

Runikend 1st edition Schneider Lab Ltd E. Hampden Ave Unit C-113 Denver CO,

Artificial Intelligence ( CS 365 ) IMPLEMENTATION OF AI SCRIPT GENERATOR USING DYNAMIC SCRIPTING FOR AOE2 GAME

Elicitation, Justification and Negotiation of Requirements

CS Programming Project 1

Introduction to Artificial Intelligence CS 151 Programming Assignment 2 Mancala!! Due (in dropbox) Tuesday, September 23, 9:34am

Run Very Fast. Sam Blake Gabe Grow. February 27, 2017 GIMM 290 Game Design Theory Dr. Ted Apel

Contents. 12 Award cards 4 Player Aid cards 8 Attraction mats 4 Equipment tiles 15 Player markers (tractors) in 5 colors

Intro to Java Programming Project

Queen vs 3 minor pieces

Overview. The Game Idea

MONUMENTAL RULES. COMPONENTS Cards AIM OF THE GAME SETUP Funforge. Matthew Dunstan. 1 4 players l min l Ages 14+ Tokens

SCRABBLE ARTIFICIAL INTELLIGENCE GAME. CS 297 Report. Presented to. Dr. Chris Pollett. Department of Computer Science. San Jose State University

DIVISION II (Grades 2-3) Common Rules

Ore, silver, cloth, wool. Food Corn Wood, stone

For slightly more detailed instructions on how to play, visit:

Appendix Lookout GmbH Hiddigwarder Straße 37, D Berne, Germany. Beginner s Variant without Hand Cards

Informatics 2D: Tutorial 1 (Solutions)

Welcome to Family Dominoes!

Competition Manual. 11 th Annual Oregon Game Project Challenge

Star-Crossed Competitive Analysis

Grade 7/8 Math Circles Game Theory October 27/28, 2015

Star Defender. Section 1

Assignment II: Set. Objective. Materials

GAME PROGRAMMING & DESIGN LAB 1 Egg Catcher - a simple SCRATCH game

LORE WAR A Fantasy War Game

Grade 6 Math Circles Combinatorial Games - Solutions November 3/4, 2015

Grade 6 Math Circles Combinatorial Games November 3/4, 2015

2 Textual Input Language. 1.1 Notation. Project #2 2

Replacing Pool Walls. by Tiko, 25 November Introduction

FRIDAY APRIL 1 ST 8:00AM - 6:00PM

The Modules. Module A - The Contracts. Symbols - What do they mean?

Class 1 Action State Fair Photography Judging. Place the four photos here & size for short dimension to 2

Flood Snakes & Ladders

Federico Forti, Erdi Izgi, Varalika Rathore, Francesco Forti

Using OCAD for training

Real-Time Connect 4 Game Using Artificial Intelligence

Underleague Game Rules

2048: An Autonomous Solver

Deep Green. System for real-time tracking and playing the board game Reversi. Final Project Submitted by: Nadav Erell

The goals for this project are to demonstrate, experience, and explore all aspects of Java Internet Programming.

CS 229 Final Project: Using Reinforcement Learning to Play Othello

an AI for Slither.io

Objective: the student will gain speed and accuracy in letter recognition.

A video game by Nathan Savant

Multiverse: Cosmic Conquest Trading Card Game. Rulebook

Words Mobile Ready Game Documentation

GETTING STARTED CONTENTS. welcome. Getting Started. How to Play. installing the Shanghai software

Scratch for Beginners Workbook

Instruction Cards Sample

Lane Detection in Automotive

Obstacle Dodger. Nick Raptakis James Luther ELE 408/409 Final Project Professor Bin Li. Project Description:

7-1-The_Best_Practices_Course--Week_7--Part_1--Interactive_Legends_Part_1

How To Crush Online No Limit Holdem

CMS.608 / CMS.864 Game Design Spring 2008

Number Addition and subtraction

Newton Mining Co. A Teacher s Guide for the MinecraftEdu World Created by Joey Glatt All Rights Reserved Page 1

COMPONENTS GAME SETUP GAME SEQUENCE

CS 251 Intermediate Programming Space Invaders Project: Part 3 Complete Game

The game of Paco Ŝako

CS221 Project Final Report Automatic Flappy Bird Player

Outline. Introduction to AI. Artificial Intelligence. What is an AI? What is an AI? Agents Environments

Interactive 1 Player Checkers. Harrison Okun December 9, 2015

DESIGN A SHOOTING STYLE GAME IN FLASH 8

playing game next game

Lightseekers Trading Card Game Rules

The Buildings. Place the turquoise house-shaped building marker onto the production wheel space in front of card pile A.

Hierarchical Controller for Robotic Soccer

CS151 - Assignment 2 Mancala Due: Tuesday March 5 at the beginning of class

Comprehensive Rules Document v1.1

Game Artificial Intelligence ( CS 4731/7632 )

By Laurie Pessetto. Instructions:

Opponent Modelling In World Of Warcraft

Pangolin: A Look at the Conceptual Architecture of SuperTuxKart. Caleb Aikens Russell Dawes Mohammed Gasmallah Leonard Ha Vincent Hung Joseph Landy

Programming an Othello AI Michael An (man4), Evan Liang (liange)

League of Legends: Dynamic Team Builder

An easy user guide AN EASY USER GUIDE

Lightseekers Trading Card Game Rules

Is muddled about the correspondence between multiplication and division facts, recording, for example: 3 5 = 15, so 5 15 = 3

Probability and Statistics

Developing Frogger Player Intelligence Using NEAT and a Score Driven Fitness Function

The WURDE Robotics Middleware and RIDE Multi-Robot Tele-Operation Interface

CS Project 1 Fall 2017

Mobile and web games Development

Lucky Leprechaun. 1. Overview. Game Rules (v1.2-28/06/2016) The goal is to obtain a winning combination on a winning line spread across the reels.

Bible Battles Trading Card Game OFFICIAL RULES. Copyright 2009 Bible Battles Trading Card Game

G51PGP: Software Paradigms. Object Oriented Coursework 4

SATURDAY APRIL :30AM 5:00PM

Ornamental Pro 2004 Instruction Manual (Drawing Basics)

Transcription:

CARLETON UNIVERSITY Software Development of the Board Game Agricola COMP4905 Computer Science Honours Project Robert Souter Jean-Pierre Corriveau Ph.D., Associate Professor, School of Computer Science 4/19/2013

Abstract Agricola is a popular board game based around players expanding their farms to their maximum potential using pastures, fields, and a growing family. This report details the coding of the farm based game in Java for easy to use gaming of Agricola. Featuring 1-5 players, this code uses a model-viewcontroller approach for organization and a grid bag layout for farmyard display. My program features a simplified game interface that eases users into the normally cluttered board and abstract pieces of Agricola. The incorporated AI uses a utility-based agent approach to make decision on their actions to enhance their farm over their opponents. The game plays for 14 turns, and the winner is decided based on the quality of everyone s farms. Table of Contents Introduction.3 Design..3 Results....5 References...6 1

List of Figures FIGURE 1 [BoardGameGeek, 2013] FIGURE 2 2

Introduction Agricola is a strategy board game created by German game designer Uwe Rosenberg, and published in 2007 [BoardGameGeek, 2013]. The game involves taking the role of a farmer building their farm, but this is much more interesting than it sounds using resource management and strategic decision making. Agricola can be played solo, or with up to five players. Each player starts with two family members, and every turn each family member performs an action, which can include collecting resources, expanding the family, building rooms, and much more. After any player takes an action, that particular action cannot be played by anyone for the remainder of the turn. Over the course of the game s 14 turns, there are 6 harvests where each player must feed their family using primarily accumulated livestock or grains and vegetables. At the end of 14 turns, each player s farms are given point values based on a pre-determined scoring system as to how developed their farms are. So, the game s goal is to end with the most impressive farm while feeding your family through harvests. My honours project goal was to code Agricola in Java, where a player can play in a solo game or play against computer AIs or fellow players. I feel Java was a good choice to use a point and click interface for the game in a Java applet window. I chose Agricola because I m a fan of board games, and the strategy involved intrigued me. Even though the goal is straight forward, there are many ways to build your farm, and even though there isn t direct competition in the game, there is competition for optimal actions. These complications also made it intriguing to develop a working AI to play this game. It is also relatively new game, and there are very few ways to play Agricola online, and the one instance I found uses a much different interface and code language [Deotte, 2013]. Design Agricola is a board game, so translating an entire board onto a single user interface can be a challenge. As seen in a complete two player game in figure 1, Agricola in particular can make for a cluttered screen if 5 farms need to be on screen at once. As seen in figure 2, I decided to have only one large farm on the screen at a time. The viewed farm can be changed using a drop down in the top left hand corner. I chose to only view one farm at a time because having 5 farms on one screen, with all the required buttons, would be far too cluttered. Since competition is indirect, opponent s farms don t normally have to be seen at all, only when actions and resources may be in dispute. Player resource totals are also directly underneath the farm in plain view, and available actions take up the right side of 3

the interface. Since Agricola isn t a straight forward game, the more complicated actions have a brief description which results in the buttons taking up a lot of space. I feel the layout still looks nice though, and the blank spaces open up since more actions are available later in the game. The time until harvests is very clear however, so players can adequately plan ahead. I kept the farm and display colors unique and consistent to enforce clarity, for example representing a wooden room simply as a red space, which is consistent to the color of the wood counter displayed on screen. For the design of the code, I decided to use a model-view-controller approach [Reenskaug and Coplien, 2009]. Because a lot of information had to be stored, and this game was best viewed within a window, it was important to have a specific layout for easy organization of code. The controller does the most work in the single class, interpreting user commands and altering the state of the view and model. The view has two parts, since I wanted to have the displayed farm a separate class apart from the numerous buttons and displays, but the farm it is still displayed with the view. The model is all the information stored within the Player, Space, and Farm class. The Player class stores resources, family members, and whether the player is human or not. The Space class represents a space on the farm layout, whether it is a fence space, a main farm space, or a blank button, and the current state (empty or used fence, room space, field space, etc.). The Farm class is just a 2d array of the Space classes to easily represent the farm. This farm is displayed using a grid bag layout to keep the farm within one table, but with varying button sizes because the main farm spaces need to be bigger than the fence spaces. Overall, the MVC approach successfully kept my code organized properly. The AI present uses a utility-based agent approach [Oommen, 2012], where the end goal of the AI is to reach the best farm in the end, and each action s intent is to improve the farm as much as possible. Some improvements, like building rooms, are only possible with the accumulation of resources, so the AI both looks at resources needed and available, improvements possible, and immediate need for food (especially if a harvest is imminent). The AI s environment while evaluating is static and discrete. The environment does change between turns however, and taking actions before another player can use these actions can also be considered. On the highest AI difficulty setting, the AI considers the next player s farm, and if there is a high potential action that the next player is likely to make, the current player s turn is more likely to pick this action. This allows for a competitive game against artificial opponents, which are aware of the game s goals to build the best possible farm while consistently feeding their family members. 4

Results I am pleased with the usability of my program to play the game of Agricola. It is easy to pick up and play, a stark contrast to the actual board game s set up time of 10-15 minutes in my experience. The game itself can be difficult to learn, with the original board game using abstract wooden pieces for all the resources, which are only different in color and shape (animals are square, resources are circular). My program application actually makes the representations easier, having a constant reminder of how much of each resource you possess and which resource is which color. The learning curve can still be high though, but that is within the game itself as well. I was only able to implement hot seat multiplayer play, but the game can be expanded through networking successfully. I was also only able to implement a basic game rule set, while the actual game gives the option to play an advanced game. This mode incorporates over 300 cards to be used throughout the game as farm improvement and occupations given to family members. These 300 cards happen to be all unique, and usually involve simple improvements like bonus food on certain turns and easier construction of rooms for family members. The advanced game does not change gameplay drastically, but it gives successive plays of the game a more unique feel. Agricola also has multiple expansion sets with the potential to be coded, but many just add more cards to gameplay [Z-Man Games, 2013]. I was able to successfully program the board game Agricola in Java using a model-viewcontroller design to neatly organize my code. Despite the game s inherent cluttered game board, my program simplifies the layout and allows the user a point and click interface to deploy their actions. Anywhere from one to five players are supported, and the AI players use a utility-based agent approach to determine actions to better build the farm. My program allows users for easy access to the basic game of Agricola, with the potential to expand through the advanced version and the many expansions of the game. My program successfully lets users play Agricola both with the friends and with challenging enemy computer players within a neat and tidy user interface. 5

References BoardGameGeek (2013) Agricola, boardgamegeek.com/boardgame/31260/agricola. BoardGameGeek (2013) Agricola Images, http://boardgamegeek.com/image/1580741/agricola. Deotte, Chris (2013) Play Agricola Board Game Online, http://playagricola.com/agricola/board1/agricola.html. Oommen, J (2012) Arficial Intelligence Agents and Environments, http://people.scs.carleton.ca/~oommen/courses/comp4106fall12/ai_ch2agents.pdf. Reenskaug, T., Coplien, J.O., (2009) The DCI Architecture: A New Vision of Object-Oriented Programming, http://www.artima.com/articles/dci_vision.html. Z-Man Games (2013) Agricola Overview, http://www.zmangames.com/boardgames/agricola.htm. 6