During my bachelor's had an AI class where our final project was Robocode, where you make an AI for a little tank that fights other tanks.
I went whole-hog with my first attempt. Pattern matching, probabilistic dodging, logically deducing power of enemy shots etc... Was going ok, but was struggling against some of the harder example bots.
So, I made a second version that just ran around and oscillated back and forth in a Sin pattern.
That sounds exactly like a game I used to play in the 90s/early 2000s called Robot Battle. It was version 1.3 and IIRC 1.4 was a big revamp with flashy graphics.
isnt that the game where going ultra light with huge batteries meant you won cause the other bot couldnt catch you and ran out of battery so you pushed it into a pit and won?
There was a PS 1 game called Carnage Heart where you built mechs, upgraded their hardware and could write their AI with a sort of connected blocks UI thing where each block was a conditional based on on of their sensors or some action like move or shoot one of their gun types. Ton of fun, would recommend. I've played it on emulator in the past so it's out there
Oh yeah, that's how I decided the constants for the 2nd bot. I basically just moved in a Sin wave at an amplitude that 'tended to' avoid most of the shots from 'smarter' bots at least for a little while, and constant shooting while moving in a Sin wave also produces a shot pattern that's very difficult to dodge.
Oh, so it's not simple like you made it sound in the original comment. You did actually ensure the sine pattern was more effective at solving the problem.
True, but the entire code was something like <10 lines. It was just a few minutes of tweaking numbers. I spent weeks on bot one, hundreds of lines of dense code. Bot 2 I knocked out in like 45minutes of number tweaking.
I had a similar assignment in my embedded systems class. My friend who eventually gave up and just made his tank spin like a helicopter and fire as fast as it could placed higher than all the rest of our group.
I did an AI asteroids competition and destroyed all other bots solely because I made a replacement for the canned moveToPoint function that would get me to a location slightly faster. Had nothing to do with AI and was entirely based on me going down a rabbit hole of vector math
I remember in high school I added completely random swaps of the orbiting direction and that got the bot to the point where it could put dodge the completely tricked out probabilistic dodging bots, tho the gun tracking was pretty basic so that side wasn't amazing
My friend had a similar project. He noticed that the messaging protocol used was not fully secure: it was vulnerable to replay attack as all messages were broadcasted (encrypted but not tagged for at-most-once delivery).
So he submitted an average AI but his tanks would rebroadcast all messages received making all other tanks unable to do anything...
When I built a game in C in high school, this is how the computer opponent worked. It was surprisingly challenging to defeat that moves around randomly and attacks.
Reminds me of Axelrod's 1980 prisoner's dilemma algorithm tournament. He asked for folk to submit programs to play an iterated prisoner's dilemma game against each other. Tit for tat outperformed just about every other algorithm tried.
View all comments
2.5k
u/Xanthus730 Jun 10 '23
During my bachelor's had an AI class where our final project was Robocode, where you make an AI for a little tank that fights other tanks.
I went whole-hog with my first attempt. Pattern matching, probabilistic dodging, logically deducing power of enemy shots etc... Was going ok, but was struggling against some of the harder example bots.
So, I made a second version that just ran around and oscillated back and forth in a Sin pattern.
I turned in both. The wiggle-bot won. :(