11
Spencer Julian

Spencer Julian. Abstract What is "Hackers of Catron"? o Electronic Settlers of Catan® board. Settlers of Catan is a resource gathering and trading board

Embed Size (px)

Citation preview

Page 1: Spencer Julian. Abstract What is "Hackers of Catron"? o Electronic Settlers of Catan® board. Settlers of Catan is a resource gathering and trading board

Spencer Julian

Page 2: Spencer Julian. Abstract What is "Hackers of Catron"? o Electronic Settlers of Catan® board. Settlers of Catan is a resource gathering and trading board

Abstract

• What is "Hackers of Catron"?o Electronic Settlers of Catan® board. Settlers

of Catan is a resource gathering and trading board game in which players compete to build the largest economy.

• What we will improve upon?o The game is really fun, but it takes too long to

set up. We will shorten the setup process.o Make resource gathering and spending

automatic. o This project intends to simplify the execution

of Catan without adding more complexity.

Page 3: Spencer Julian. Abstract What is "Hackers of Catron"? o Electronic Settlers of Catan® board. Settlers of Catan is a resource gathering and trading board

USB

llRaspberry

Pi

Web Server AVR32 UC3 B

Microcontroller

(8) Hall Effect

Sensors

Economy Control Logic

RGB LED Driver

Single Hall Effect Sensor

Game Control Code 7

Segment LED

Display Driver

Wifi Acces

s Point

(8) 7 Segs

5 sets (daisy-chained)

(3) RGB LEDs

7 sets (daisy-chained)

Hall18

2

3

Block Diagram

8:1 MUX

18 Sets

Addr - 3

SPI

2

I2C

Load Enable

Seg 8

Dig 8

RGB 3

Hall

TWI

Page 4: Spencer Julian. Abstract What is "Hackers of Catron"? o Electronic Settlers of Catan® board. Settlers of Catan is a resource gathering and trading board

Software Development Status

• Test modules writteno Basic LED Heartbeat Testo RGB LED Color Testo Hall Effect Selection Testo 7 Segment Crazy 8's (Validity) Testo I2C Micro as EEPROM Testo Raspberry Pi I2C Terminal

• Program Code Writteno Majority of Raspberry Pi Web Interface

• Game Flowchart Completed

Page 5: Spencer Julian. Abstract What is "Hackers of Catron"? o Electronic Settlers of Catan® board. Settlers of Catan is a resource gathering and trading board

Software Design Considerations

• State Machine

• 7 Moduleso I2C

i. Microcontroller Slaveii. Raspberry Pi Masteriii. running at 100 kHz

o SPIi. 7 Segment Displaysii. Running at 2 MHz, 8-bit, SPI Mode 0

o PLLi. Running at 48 MHz

Page 6: Spencer Julian. Abstract What is "Hackers of Catron"? o Electronic Settlers of Catan® board. Settlers of Catan is a resource gathering and trading board

Software Design Considerations

• Modules Continuedo GPIO

i. LEDsii. Hall Effect Sensors

o DSPi. Random Numbers

o Delay Module

Page 7: Spencer Julian. Abstract What is "Hackers of Catron"? o Electronic Settlers of Catan® board. Settlers of Catan is a resource gathering and trading board

Code Design

Power On

Micro Initialization

Initial Piece Placement

Game Loop

Initial Board Generation

Play New Game?

Ready for Power Off

Wait for Pi to Boot

Wait for Pi to Shut

Down

No

Yes

Page 8: Spencer Julian. Abstract What is "Hackers of Catron"? o Electronic Settlers of Catan® board. Settlers of Catan is a resource gathering and trading board

Initial Board Generation

• For each hexagono Assign a Resource from available Resource

Poolo Remove Resource from Resource Pool

• Select random edge hexagono Assign scarcity from list for each resource

hexagon in sequenceo Skip desert

• Go to wait for Pi To Boot

Page 9: Spencer Julian. Abstract What is "Hackers of Catron"? o Electronic Settlers of Catan® board. Settlers of Catan is a resource gathering and trading board

Initial Piece Placement

• Wait for players to join

• Randomly assign player order

• For each player 1-4o Wait for settlement placement and confirmo Wait for road placement and confirm

• For each player 4-1o Wait for settlement placement and confirmo Wait for road placement and confirmo Assign Resources

• Start Game Loop

Page 10: Spencer Julian. Abstract What is "Hackers of Catron"? o Electronic Settlers of Catan® board. Settlers of Catan is a resource gathering and trading board

Main Game Loop

• While turn isn't overo If dice roll pressed

i. Check if 71. If yes, make players with more than 7 resources

discard half and move thief2. If no, assign resources to players as appropriate

ii. Set Dice Rolled Flago If dev card played

i. Check if knight1. If yes, move thief2. If no, place 2 roads

Page 11: Spencer Julian. Abstract What is "Hackers of Catron"? o Electronic Settlers of Catan® board. Settlers of Catan is a resource gathering and trading board

Main Game Loop

o Check if piece purchasedi. If road, place roadii. If city, place cityiii. If settlement, place settlement

o Update Board Stateo Check if Ending Turn

i. If yes, clear dice rolled, move to next player

ii. If no, continue looping