ppt - Purdue Engineering

Spencer Julian
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.
Block Diagram
Addr - 3
Hall
Single Hall
Effect Sensor
8:1 MUX
Hall
18
Web Server
Raspberry Pi
Economy
Control Logic
USB
Wifi
Access
Point
I2C
AVR32 UC3 B
Microcontroller
(8) Hall Effect
Sensors
18 Sets
TWI
2
2
ll
RGB LED
Driver
RGB 3
(3) RGB
LEDs
7 sets (daisy-chained)
Game
Control Code
SPI
3
Load Enable
7 Segment Dig 8
LED
Seg 8
(8) 7 Segs
Display
Driver
5 sets (daisy-chained)
Software Development Status
•
Test modules written
Basic LED Heartbeat Test
o RGB LED Color Test
o Hall Effect Selection Test
o 7 Segment Crazy 8's (Validity) Test
o I2C Micro as EEPROM Test
o Raspberry Pi I2C Terminal
o
•
Program Code Written
o
•
Majority of Raspberry Pi Web Interface
Game Flowchart Completed
Software Design Considerations
•
•
State Machine
7 Modules
o
I2 C
Microcontroller Slave
ii. Raspberry Pi Master
iii. running at 100 kHz
SPI
i. 7 Segment Displays
ii. Running at 2 MHz, 8-bit, SPI Mode 0
PLL
i. Running at 48 MHz
i.
o
o
Software Design Considerations
•
Modules Continued
GPIO
i. LEDs
ii. Hall Effect Sensors
o DSP
i. Random Numbers
o Delay Module
o
Code Design
Power On
Initial Board
Generation
Micro
Initialization
Initial Piece
Placement
Wait for Pi
to Boot
Game Loop
Play
New
Game?
No
Wait for Pi
to Shut
Down
Ready for
Power Off
Yes
Initial Board Generation
•
For each hexagon
o
o
•
Select random edge hexagon
o
o
•
Assign a Resource from available Resource Pool
Remove Resource from Resource Pool
Assign scarcity from list for each resource hexagon in
sequence
Skip desert
Go to wait for Pi To Boot
Initial Piece Placement
•
•
•
Wait for players to join
Randomly assign player order
For each player 1-4
o
o
•
Wait for settlement placement and confirm
Wait for road placement and confirm
For each player 4-1
Wait for settlement placement and confirm
o Wait for road placement and confirm
o Assign Resources
o
•
Start Game Loop
Main Game Loop
•
While turn isn't over
o
If dice roll pressed
i. Check if 7
1.
2.
If yes, make players with more than 7 resources discard half and
move thief
If no, assign resources to players as appropriate
Set Dice Rolled Flag
If dev card played
i. Check if knight
ii.
o
1.
2.
If yes, move thief
If no, place 2 roads
Main Game Loop
o Check if piece purchased
i. If road, place road
ii. If city, place city
iii. If settlement, place settlement
o Update Board State
o Check if Ending Turn
i. If yes, clear dice rolled, move to next player
ii. If no, continue looping