Welcome to the thrilling world of NeuralKart, where artificial intelligence meets the beloved game of Mario Kart! In this guide, we’ll walk you through the setup process step by step to get your AI racing against the opponents. Let’s hit the accelerator!
System Requirements
Before we dive in, ensure you’re operating on a Windows system as this project is compatible only with it.
Step 1: Install Python
NeuralKart employs Python 3 to run smoothly. Ensure you download the 64-bit version to meet the TensorFlow specifications.
Step 2: Install Python Dependencies
To make everything work, you’ll need to install the following Python libraries:
- Tensorflow
- Keras
- Pillow
- matplotlib
- mkdir_p
- h5py
Step 3: Download BizHawk Emulator
NeuralKart runs on the BizHawk emulator. Here’s how to set it up:
- Install the prerequisites from this link.
- Download BizHawk version 1.12.2 from this link and unzip it to your preferred directory.
Step 4: Download Pre-trained Weights and Recordings
Next, download the necessary files and unzip them into your project folder:
Step 5: Running a Live Demo
Time to see your AI in action! Follow these steps:
- Run the command
python predict-server.pyin your terminal. This starts a server on port 36296 which runs the model. Use the--cpuoption to force TensorFlow to run on the CPU. - Open BizHawk and load the MarioKart 64 ROM.
- Disable display messages from the menu (View → Display Messages).
- Access the Lua console in BizHawk (Tools → Lua Console) and load
Demo.luato play the tracks. - Use the Esc key to switch tracks and arrow keys for manual steering.
Note: The clipboard transfer for frames is a tad hacky, so refrain from copying or pasting while running the scripts.
Step 6: Playing on Other Tracks
To switch tracks, ensure that weights are available for the track by navigating through the menu or loading states you’ve saved. For gameplay, load Play.lua in the Lua console.
Step 7: Training the AI
Want to improve your AI? You can retrain it using recordings. Execute train.py [track] for this step, with the option to use --cpu for CPU training.
Step 8: Creating New Recordings
If you want to generate recordings via Search AI, load a state and then load SearchAI.lua. This action sets up a series of frames for your AI.
Step 9: Running the Iterative Improvement Loop
By utilizing the iterative improvement loop, you improve the AI with real-time data. Start with a recording from Search AI and run PlayAndSearch.lua. Remember to edit the line in train.py for compatibility with your local setup.
Troubleshooting
If you run into issues during the setup or usage of NeuralKart, consider the following:
- Ensure you are using the correct version of Python (64-bit) and TensorFlow.
- Double-check BizHawk installation and make sure you’re using version 1.12.2.
- Verify that all required library dependencies are installed correctly.
- If the AI is unresponsive, restart the emulator and the prediction server.
- For any unexpected behavior, revisit the Lua scripts to ensure they were loaded properly.
For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.
Conclusion
Now you’re all set to unleash your AI on the challenging tracks of Mario Kart! At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.
