What was your first thought about the Smart Bots?
Some might have been scared to start, as they immediately thought they could not rank in the Leaderboard. If that's the case, you are not alone; many participants are going through the same phase.
Some people may be confused on how to start or from where to start?
Some participants may still be waiting for the deadline to approach, but building the best bot in a two-days timeline is next to impossible.
So get started now.
Here we decoded 10 steps to help you build and rank your bot in the Leaderboard.
Step 1: Get the Starter Code
Clone the SmartBots starter-code repository
Here's how to do that:
Type this in your terminal.
This is how it will look in your terminal:
Step 2: Setup Python Environment
- Go to python directory inside the repository
- Create an environment using `python -m venv env` in your terminal
- Activate the virtual environment using `source env/bin/activate`
- Install dependencies using `pip install -r requirements.txt`
Step 3: Start the Python Server
Start the server by typing this to the terminal: 'python src/app.py'
Step 4: Interact with the Sandbox
- Login to the dashboard and click “Sandbox”
- Click “New Game” in the sandbox
- Check your server log. You will see HTTP request and response.
Your sample bot is now playing the game.
Note: Your bid is 16 in the default code. Next we will update code to bid 17.
Step 5: Make Changes to your Bot Code
- Open “bot.py” file in the editor of your choice. You will see minimum bid is 16.
- Change 16 to 17 as the minimum bid and save your file.
- Stop the python server and start it again.
- Click “New Game” to see that your bid is now 17. Hurray.
- Similarly, when you come back the second time, make some other changes.
- You can think of applying another algorithm to your bot or just add some basic game rules.
Step 6: Prepare Docker Image for Submission
- Create a docker image
`docker build --platform x86_64 -t my_docker .`
- Save your docker image
docker save my_docker | gzip > my_docker.tar.gz
Step 7: Submit your Docker Image
- Go to “Docker Submission” panel.
- Upload your newly created “my_docker.tar.gz” file
- Once the upload is complete, games will run.
Yay! the bot is playing games.
Step 8: See yourself in the Leaderboard
Step 9: Explore your GamePlay
- Go to “Game Analytics” tab.
- Understand how your bot is playing.
Step 10: Improve. Code. Go to Step 5.
You shall move up the leaderboard now. Good luck.
If videos resonates more with you, here's the beginners' playlist.