Hercules's IF and updated DSL bots accepted and AI'd.I'm thinking about extending signups another week to try and give more people the time to enter. You guys cool with that?
Quote from: Lightning S. on November 06, 2015, 10:37:46 PMHercules's IF and updated DSL bots accepted and AI'd.I'm thinking about extending signups another week to try and give more people the time to enter. You guys cool with that?Sure.Also, I have some pm's from clickbeetle about his ironbot python and ai. I can pm them to you if you want.
Look at the Ironbot arena (cube.py). You'll notice I have a bunch of code commented out, and bracketed by #Ironbot stuff #/Ironbot stuff. This code does a few things:- Reads a couple of txt files (Bot0_comps.txt, Bot1_comps.txt, etc.) which contain a list of component ids, and breaks those components on the corresponding bots. These txt files are located in the main RA2 directory.- Removes the floor under the bots (cubefloorpanel.gmf) during the introduction, so the components that break off can fall out of the arena, then puts it back when the match starts.- Makes immobility warnings not happen by setting plus.practice(1).- Disables the bots after 30 seconds and makes them invincible, so it's like a 30 second time limit. You can leave that part commented out if you want a longer time limit.The second part is in the bot AI. I used custom AI's for all the bots in Ironbot. Here's the modified Omni I used: http://beetlebros.gametechmods.com/files/OmniIB.txt (make sure to save as .py, not .txt)There are two important parts in the AI .py. The first one is at the beginning of def Tick where I say "Import previously broken component IDs". This reads the txt files so the AI knows what components are already lost. The second important part is in def LostComponent. This writes to the txt file whenever a component breaks. Also, self.LostComps = [] and self.DoThisOnce = 0 have to be in def __init__.So to run Ironbot, first I cleared Bot0_comps.txt and Bot1_comps.txt so they are blank. After the battle, DO NOT RUN ANY MORE BATTLES. Immediately quit RA2, open up the txt files, and copy the broken component IDs into a permanent file that will not get overwritten. (You will need to remove some duplicate IDs.) Make sure to keep things organized so you don't forget which broken component IDs go with which bot.To start a battle with fresh bots, clear the txt files before booting up RA2. To start with damaged bots, copy the component IDs from your permanent file into the txt file before booting up RA2. The arena will read these IDs and break them before the match starts. Then, the AI will add any new broken components to the txt file.In Ironbot, I had a rule where bots got a few spare wheels. I used apanx's exporter to find out which IDs were wheels, and then deleted those from the list of broken components.Also, later on in Ironbot, I started having some lag issues when 90% of a bot got broken off all at once. When that happened, I went into the bot lab and manually removed components.It's pretty complicated, but I already did the hard part. You should be able to get an Ironbot-style tourney going just by using OmniIB.py and un-commenting that code in cube.py. Of course, I'd appreciate it if you didn't just rip off Ironbot rule for rule. Put your own twist on it.
Before I left, I tried making an ironbot tournament myself, but I ran into too many problems. I DID manage to get the code to work, but it wasn't easy, and it was very complicated. Here's a quote from click via pm.Quote from: Clickbeetle on May 01, 2014, 11:43:34 PMLook at the Ironbot arena (cube.py). You'll notice I have a bunch of code commented out, and bracketed by #Ironbot stuff #/Ironbot stuff. This code does a few things:- Reads a couple of txt files (Bot0_comps.txt, Bot1_comps.txt, etc.) which contain a list of component ids, and breaks those components on the corresponding bots. These txt files are located in the main RA2 directory.- Removes the floor under the bots (cubefloorpanel.gmf) during the introduction, so the components that break off can fall out of the arena, then puts it back when the match starts.- Makes immobility warnings not happen by setting plus.practice(1).- Disables the bots after 30 seconds and makes them invincible, so it's like a 30 second time limit. You can leave that part commented out if you want a longer time limit.The second part is in the bot AI. I used custom AI's for all the bots in Ironbot. Here's the modified Omni I used: http://beetlebros.gametechmods.com/files/OmniIB.txt (make sure to save as .py, not .txt)There are two important parts in the AI .py. The first one is at the beginning of def Tick where I say "Import previously broken component IDs". This reads the txt files so the AI knows what components are already lost. The second important part is in def LostComponent. This writes to the txt file whenever a component breaks. Also, self.LostComps = [] and self.DoThisOnce = 0 have to be in def __init__.So to run Ironbot, first I cleared Bot0_comps.txt and Bot1_comps.txt so they are blank. After the battle, DO NOT RUN ANY MORE BATTLES. Immediately quit RA2, open up the txt files, and copy the broken component IDs into a permanent file that will not get overwritten. (You will need to remove some duplicate IDs.) Make sure to keep things organized so you don't forget which broken component IDs go with which bot.To start a battle with fresh bots, clear the txt files before booting up RA2. To start with damaged bots, copy the component IDs from your permanent file into the txt file before booting up RA2. The arena will read these IDs and break them before the match starts. Then, the AI will add any new broken components to the txt file.In Ironbot, I had a rule where bots got a few spare wheels. I used apanx's exporter to find out which IDs were wheels, and then deleted those from the list of broken components.Also, later on in Ironbot, I started having some lag issues when 90% of a bot got broken off all at once. When that happened, I went into the bot lab and manually removed components.It's pretty complicated, but I already did the hard part. You should be able to get an Ironbot-style tourney going just by using OmniIB.py and un-commenting that code in cube.py. Of course, I'd appreciate it if you didn't just rip off Ironbot rule for rule. Put your own twist on it. Good luck with it, it's a bit complicated, but with this, you should be able to do it the same way click did it.If anyone wants to post this someplace where others who may want to see it can see it, feel free.Edit 1: I see you're using a custom arena. Hopefully you can just copy/paste the ironbot code into your arena.Edit 2: Got my entries here. This is literally my first ironforge bot, and I suck at dsl realistic, but I tried my best. Here it is. https://gametechmods.com/uploads/files/0298wolf_entry.rar