BangTheDiceGame

OOP version with primitive GUI and AI simulation of Bang the Dice Game.

View on GitHub

Bang! The Dice Game

This repository is for an OOP project that we had for our OOP course. We had to recreate a GUI Bang! the Dice Game using JAVA. This repository contains our attempt.

Rules: Game rules

Current Status

The program allows the user to play the game on the command line against the AI.

Assignments

Meghan Engert: UML Use Case Diagrams, UML Class Diagrams, CRC Cards, Arrow Pile Class and BangDiceGame class

Cierra Ditmore: Character, Dice, and Game Functions Classes

Sadman Ahmed Shanto: Development of AI logic and gameplay simulation.

Project Presentation Slide

presentation powerpoint

Project Presentation Video

presentation

Gameplay Video

gameplay

AI logic

Each AI upon construction is allocated certain behavior parameters that dictate their playing style.

//Behavior defining parameters
private double willingToTrick;
private double Aggressiveness;
private double Safetiness;
private double Niceness;
private double willingToKeepDice;
private double willingToKeepHealth;
private double willingToKeepShots;
private double willingToKeepArrow;
private double willingToKeepGatling;
private double SkepticProbability;
private double Stubbornness;

When it is not the AI’s turn, it observes the game and records the following in its memory.

Using, the initial distribution of roles and number of players and such information the AI assigns proabilities for certain roles to each player in the form of a probability vector.

ArrayList<Double> ProbabilityVector;
//P Vector has form [P(sheriff), P(renegade), P(outlaw), P(deputy)]
//for example if the game started out with 5 players, the P Vector for any given player before
//role is revealed would be as follows:
// [1./5, 1./5, 2./5, 1./5]
//after role information is revealed, e.g. player is sheriff, the vector is updated
// [1.0, 0.0, 0.0, 0.0]
// the probability vector is always stays normalized
//in general, depending on a certain player's interaction with the sheriff the AI updates the
//ProbabilityVector by an amount corresponding to its SkepticProbability value.
//this approach encapsulates the skeptic nature of a player and their attentiveness to the
//events in the gameplay

When it is the AI’s turn, it rolls the 5 dices and keeps each die with a certain willing to keep probability and a payoff matrix that determines the AI’s strategy and the effectiveness of a certain dice roll. The number of reroll’s is also determined stochastically with some strategy.

To resolve the die, the AI employs the following algorithm.

The AI Logic is discussed in greater details in the AILogic.txt file.

To Do List

Active Issues

Note: All bugs have been taken care of!

Documentation

JavaDoc Html File

javaDoc file

UML Use Case Diagrams

UMLUSD

UML Class Diagrams

UMLUSD1

UMLUSD UMLUSD2

UMLUS2D2

CRC Cards

UMLcc

UMLcrc

UMxLcrc

GUI Plan

We plan to make our program have a GUI over the summer.

UMLgui