Start date: 8 Jun 2006
End date: 4 Aug 2006 ( extension possible depending on interest and progress)
Prize: Glory and gloating rights. This is worth far more than money or cool toys.
There will be a weekly sub competition where can submit your AI and see how they work on the demo levels for that week. Results will be posted on the website and you'll have a week of gloating about how great your AI is.
What you need to do... Simply create an AI that can solve any level given to it. All the AI is required to do is move all the boxes into the goal zone. Once all boxes are there then the level is complete.
The player cannot walk into/through/on walls.
The player cannot push more than one box at a time.
The player cannot push a box into/through/onto a wall or other box.
Rules:
Starting tips:
You only need to implement 3 public functions.
solve() - The main function works out all the moves needed to solve the level. Returns once level is solved or after MAX_TIME whichever is sooner.
getMovesNeededToSolveLevel() - Returns the list of moves required to solve the level.
toString() - Please put your name in this string. And try to keep it short eg MayoAI
To test your AI do the following:
In Sokoban.java
Add the following to main()
SokobanAI mayoAI = new MayoAI();
competitorAIs.add(mayoAI);
To add your own levels create a level like the ones already in sokoban.java then add the following:
demoLevels.add(demoLevel1);
I recommend starting with some very simple levels eg:
######
#....#
#.xo/#
#....#
######
or
######
#....#
#.ox/#
#....#
######
There is currently some GUI code included that is commented out. If you wish to test out a level and see if you can solve it then uncomment this code. Note it is currently very crude. It also requires LWJGL. Feel free to improve this and send me the improvements.
Other Tips:
To reduce the number of positions you need to evaluate you should do some sort of testing to ensure that after a move it is still possible to move all boxes to the goal. Eg if a box is pushed into a corner there is no way to push it into the goal so this is an invalid move and can be discarded since it won't solve the level.
I don't care what you do to the LevelMap passed into solve(). It will never be used again outside your function so do whatever you want with it.
End date: 4 Aug 2006 ( extension possible depending on interest and progress)
Prize: Glory and gloating rights. This is worth far more than money or cool toys.
There will be a weekly sub competition where can submit your AI and see how they work on the demo levels for that week. Results will be posted on the website and you'll have a week of gloating about how great your AI is.
What you need to do... Simply create an AI that can solve any level given to it. All the AI is required to do is move all the boxes into the goal zone. Once all boxes are there then the level is complete.
The player cannot walk into/through/on walls.
The player cannot push more than one box at a time.
The player cannot push a box into/through/onto a wall or other box.
Rules:
- Your AI must run on my laptop. 1.4GHz 512MB RAM Java 1.5
- Your AI source files must be less than 10MB in size.
- Your AI must extend SokobanAI.java
- You cannot alter SokobanAI.java, LevelMap.java or Sokoban.java.
- Your AI must return immediately if it takes longer than MAX_TIME (refer to JavaDoc). I'm not having Martin hanging my PC for hours on end.
- Anyone caught cheating by having a database of solved puzzles will be greatly berated. You may not have an AI that just refers to a database of solved puzzles. The AI must solve the puzzle in real time. It may use a database but the database must not contain complete solutions to levels.
- Player ranking will be based on 1) solving the level within the time limit 2) number of box pushes 3) number of player moves. So if two AIs solve a level and both have the same number of box pushes then the one with less player moves will be ranked above the other.
- MAX_TIME will be increased if it proves to be too small. Everyone will be informed via email if this is required.
Starting tips:
You only need to implement 3 public functions.
solve() - The main function works out all the moves needed to solve the level. Returns once level is solved or after MAX_TIME whichever is sooner.
getMovesNeededToSolveLevel() - Returns the list of moves required to solve the level.
toString() - Please put your name in this string. And try to keep it short eg MayoAI
To test your AI do the following:
In Sokoban.java
Add the following to main()
SokobanAI mayoAI = new MayoAI();
competitorAIs.add(mayoAI);
To add your own levels create a level like the ones already in sokoban.java then add the following:
demoLevels.add(demoLevel1);
I recommend starting with some very simple levels eg:
######
#....#
#.xo/#
#....#
######
or
######
#....#
#.ox/#
#....#
######
There is currently some GUI code included that is commented out. If you wish to test out a level and see if you can solve it then uncomment this code. Note it is currently very crude. It also requires LWJGL. Feel free to improve this and send me the improvements.
Other Tips:
To reduce the number of positions you need to evaluate you should do some sort of testing to ensure that after a move it is still possible to move all boxes to the goal. Eg if a box is pushed into a corner there is no way to push it into the goal so this is an invalid move and can be discarded since it won't solve the level.
I don't care what you do to the LevelMap passed into solve(). It will never be used again outside your function so do whatever you want with it.