150 likes | 170 Views
Java Carcassonne. Mike Burnham CS 470 Final Presentation. Carcassonne. Tile based table top game. Players take turns placing landscape tiles and claiming features with tokens. Scoring. Points are scored for completing claimed landscape features Cities Roads Cloisters
E N D
Java Carcassonne Mike Burnham CS 470 Final Presentation
Carcassonne • Tile based table top game. • Players take turns placing landscape tiles and claiming features with tokens.
Scoring • Points are scored for completing claimed landscape features • Cities • Roads • Cloisters • Farms scored at end of game based on bordering cities.
Initial Design • Landscape as graph, with tiles as nodes. • Store hash of tiles keyed on coordinates. • Stack of tile objects will be randomized at game start. • List of tokens for each player, referencing the tiles they occupy.
Final Design • TileFeatures as nodes in graph. • Tiles only used in coordinate hash. • Tile stores array of TileFeatures representing its borders, and hash of TileFeatures keyed on color codes.
Data Files • Each tile has two parts • Two Image files • Artistic representation of the tile. • Feature map with unique color for each feature. • Tile description • A single txt file for entire tile set. • Encodes features of each tile for initializing tile objects.
Tile data tileL count 3 farm 24 23 1000000000010 0x000000 road 62 19 0100000000000 0x111111 farm 85 24 0010001000000 0x222222 0x333333 city 112 63 0001110000000 0x333333 road 58 92 0000000100000 0x444444 farm 25 96 0000000011000 0x555555 road 23 63 0000000000100 0x666666
One Turn • Each turn is a three stage process. • Tile placement • Check for legal placement. • Token placement • Check for legal token placement (if attempted). • Score any features completed.
Algorithms • Checking token placement • Scoring • Both fairly simple with final design. • Most feature graphs are small. • Recursively turn graph into list, iterate list.
Schedule • Had planned for three iterations • Game model • Interface • Network play and/or AI • Currently about halfway through interface work.
Conclusion • Created a Java version of Carcassonne. • Largest program I’ve written so far. • More design time might have saved many revisions.