Giter VIP home page Giter VIP logo

redbluegame's Introduction

RedBlueGame

Game for CSCI-4150 at RPI to experiment with artificial intelligence

Game Specifications

n: the number of nodes
R: the number of rounds
T: time limit

Game Dynamics

The platform generates a random graph of n nodes
For each round r =1 to R
    The blue player chooses a node S that has not been colored before. S and all nodes
    adjacent to S becomes blue (including the nodes that are previously red). This
    should be done in T seconds.
    The red player choose a node S' that has not been colored before S' and all nodes
    adjacent to S' becomes blue.
The player with more nodes wins

Notes

Any player who does not answer in time automatically loses. If all nodes are colored, then the game immediately ends and whomever with more nodes wins.

Example Game

game image

Contributing

To create your agent open a pull request and edit the RedBlueGame/agents.py file. Next, set up your own agent class like this:

class MyAgent(Agent):
    def __init__(self):
        super(MyAgent, self).__init__()
        self.name = 'MyAgent'
        
    def get_action(self, state, player):
        pass

Please use a descriptive name for your agent class and make sure it is unique. get_action() is used by the game engine to query the agent class for its next action when its that player's turn. It should return an integer denoting the grey node to color in the graph. See other agents for examples.

You can test the performance of your agent by adding your agent as an option in the RedBlueGame/performance.py file or creating your own file for starting a game.

Please do not add any additional files to the repository if you are only adding or testing an agent.

Other forms of contributing include working on open issues.

redbluegame's People

Contributors

thomashopkins32 avatar

Watchers

 avatar

redbluegame's Issues

MiniMaxAgent is too slow

It takes too long to choose a node to color even at low depth.
There may be some issues with the implementation as well, I have not done much testing with it.

Live updating of graph

Right now the game graph is plotted using matplotlib and networkx.

I tried for about an hour to make it so the updates are live through matplotlib interactive mode (plt.ion()) but couldn't get it to work.

Maybe try different libraries for plotting that have more features.

The game graphics as of right now are very simple and can be improved. I mostly just use plt.show() which is a blocking call so you have to close the popup window to continue the game.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.