Search code examples
processmachine-learningagentsimulate

simulate game controlling as if it is being played


I'm trying to develop a machine learning system for playing Super Mario.
The application should decide which key(game control key) is to be pressed according to the current game state.Therefore,

  1. How to simulate key strokes ? ( i.e press arrow keys , Ctrl key etc as if a user plays the game)
  2. How to read game states ? ( i.e enemy collide , power up etc..)

Is this possible or should I need to implement my own game for this ?


Solution

  • Given that you don't have access to the Super Mario Brothers source code, I'd say your best bet is to find an open source game platform game which is in a similar vein. Doing so would allow you to replace the user input portion of the code with your AI code, and you'd be able to expose any game state information you wanted to it.

    There are other projects out there for AI competitions which are designed specifically for this kind of challenge - I did something similar myself in university for TORCS. TORCS is a racing car simulator for which you write an AI plugin, it provides certain state information about your car and it's position on the track and you then process that to provide input to the car controls.