[HN Gopher] Robocode Tank Royale
       ___________________________________________________________________
        
       Robocode Tank Royale
        
       Author : gioazzi
       Score  : 142 points
       Date   : 2022-06-05 17:06 UTC (5 hours ago)
        
 (HTM) web link (robocode-dev.github.io)
 (TXT) w3m dump (robocode-dev.github.io)
        
       | dragontamer wrote:
       | I was always impressed with Robocode coders. But I always wished
       | that the team meta somehow developed.
       | 
       | One tank is hard enough, but team-games where radar-free drones
       | have more HP seem to provide interesting strategies.
       | 
       | The Radar system is very smart in this game, at most covering
       | 22.5 degrees per tick. Converting one enemy is easy enough, but
       | getting a good view of the battlefield as a whole seems like a
       | different game.
       | 
       | I guess singlebot games and 1v1 is easier to test and make AIs
       | for, and was more fun for larger sets of the community.
        
         | encrux wrote:
         | Maybe checkout gladiabots[1]? I have no affiliation with them,
         | but I did play around with it for a few weeks a couple of years
         | ago. It's not really traditional programming, but I think it is
         | quite fun coming up with strategies.
         | 
         | [1]
         | https://store.steampowered.com/app/871930/GLADIABOTS__AI_Com...
        
       | Cu3PO42 wrote:
       | At my alma mater we, the students, used to organize a one week
       | "Introduction To Programming" course based on Robocode. It was
       | meant to teach freshmen the very basics of Java before they'd
       | have their first classes.
       | 
       | They'd have four days to come up with strategies and develop
       | their robots and on Friday there was a tournament between all the
       | developed robots. The best teams got a non-trivial prize (and
       | bragging rights).
       | 
       | It was really interesting to see which strategies the students
       | came up with and how they changed from year to year. The amount
       | of material provided really made a much larger difference than
       | one might expect.
       | 
       | Among the interesting challenges of Robocode is that the bullets
       | you shoot are so slow that your opponent has ample time to dodge,
       | so you need to predict their movement. On the other hand you
       | can't see where your opponent is shooting so you need to guess
       | and move elsewhere. It's really quite fun.
        
         | mrits wrote:
         | At Baylor ~20 years ago we had to compete with other students
         | in a required freshmen/sophomore comp sci class.
        
           | Cu3PO42 wrote:
           | That's amazing! Competitions in courses have always motivated
           | me to go above and beyond, even though they were never
           | graded.
           | 
           | I'm assuming you had a longer time frame than one week? I
           | realize this is a long shot, but do you happen to remember
           | what strategies performed best when you took that course?
        
       | jherskovic wrote:
       | I remember playing https://en.wikipedia.org/wiki/ChipWits on an
       | original 128kb Mac at school very, very fondly. One of the best
       | programming games I ever had the pleasure of playing with.
        
         | TedDoesntTalk wrote:
         | That looks really cool. I wonder how I missed it.
        
       | buescher wrote:
       | From 1981: https://archive.org/details/Robot_War_alt.nib
        
         | djmips wrote:
         | Very cool. Note that RobotWar was developed first on the Plato
         | system circa 1970s. I don't know the exact year. Loved playing
         | that as a kid on the Apple II
        
       | cortesoft wrote:
       | Oh man, I spent hours and hours on a similar game in the 90s:
       | RoboWar. I learned so much playing that game.
       | 
       | https://en.wikipedia.org/wiki/RoboWar
        
       | tweakimp wrote:
       | Reminds me of sc2ai https://sc2ai.net/ where you can write bots
       | for starcraft2 and let them battle it out vs other bots.
        
       | nlnn wrote:
       | I remember this from years back.
       | 
       | A friend of mine came up with a fantastic strategy based around
       | the fact that shot strength was a float that could be modified.
       | 
       | He used this to have his team fire extremely weak shots at each
       | other, with the value of the float encoding different messages.
       | He then used these to co-ordinate his bots against the enemy as a
       | team, instead of individuals.
        
         | nwiswell wrote:
         | What stops this kind of coordination from being used to smuggle
         | an arbitrary massively parallel workload onto the system? :o)
        
           | zachrip wrote:
           | What stops you from using discord messages as a database? :p
           | I really enjoy this type of stuff though, is there a term for
           | it?
           | 
           | A while back after skype got rid of their sdk I was annoyed
           | that the app didn't unfurl gifs. So I reverse engineered
           | their api for sending/updating messages and I realized you
           | could update a message that contained a file. The only
           | problem was the file had to be on their servers or a client
           | wouldn't display it. So I reverse engineered the ios app as
           | well to find a way to get a file on their servers (I don't
           | recall why I couldn't do it from the web api). After that I
           | had two things: a way to get files on their servers, and an
           | api to update messages. So I took each frame of a gif,
           | uploaded to their servers, and then used the api to update
           | the message at the rate of the gif.
           | 
           | Of course there will be people making discord bots out there
           | laughing at how simple this sounds, but the combination of
           | reverse engineering as well as applying that to affect a new
           | feature in the app I thought was pretty novel.
        
             | gs17 wrote:
             | > What stops you from using discord messages as a database?
             | :p I really enjoy this type of stuff though, is there a
             | term for it?
             | 
             | Potential SIGBOVIK papers? But more seriously, for
             | communications, it would be "covert channels". I met
             | someone at NCSU who was working on something with bots
             | communicating through WoW trade offers (which would be
             | unlikely to be logged, unlike trades or chat messages).
        
             | nwiswell wrote:
             | > What stops you from using discord messages as a database?
             | :p I really enjoy this type of stuff though, is there a
             | term for it?
             | 
             | "Our tech stack is Clojure hosted on the JVM of massively
             | distributed workers running opportunistically on Robocode
             | Tank Royale with homebrew float-encoded protobuf message
             | passing, and using NoSQL Discord messages as a backend."
        
               | heyitsguay wrote:
               | You say it's an ugly hack, but our +0.8% profit margins
               | speak for themselves!
        
         | tra3 wrote:
         | Brilliant. I thought about game of life that had such simple
         | rules but amazing emergent behaviour. No surprise that
         | something as sophisticated as tank wars has strategies never
         | anticipated by the original creators.
        
       | Andrew_nenakhov wrote:
       | I have won an unofficial competition in the university back in
       | the 1990s, we competed using something called PascalRobots. The
       | game was played via rounds of 1v1 matches. My victory came thanks
       | to a simple trick: I noticed that certain algorithms had good
       | success against most algorithms, but were very vulnerable against
       | few others, which, in turn, were very vulnerable to most other
       | ones. Basically a rock-paper-scissors problem. So I did a very
       | simple thing: I've programmed a robot that used first 50% of
       | health using one algorithm, and then switched to another very
       | different one. The second one was simply running along the edges
       | semi-randomly and scanning and shooting backwards - i remember
       | the rules were that every action like scanning took some time so
       | you couldn't build a robot who'd pinpoint the exact location of
       | the enemy in the allotted time, you'd waste too many cycles on
       | that.
        
       | billylo wrote:
       | Maybe we can use it as a self-improvement exercise:
       | 
       | Carve out a day every year to write a brand new bot (no reuse) to
       | see how it fares against older bots. Try to outsmart ourselves.
        
       | shevis wrote:
       | Wow, what a throwback! This game is the reason I got into
       | programming. Thank you for reminding me that this exists!
        
       | matsemann wrote:
       | Someone at work once made a Robocode tournament, and we spent a
       | day paid playing with it.
       | 
       | Most people went for an "if-based" strategy. If close to wall
       | turn, if pointing towards enemy shoot, etc. And when that works
       | apply some more rules and geometric calculations.
       | 
       | I did mine trying using neural nets. One net that would learn the
       | movement patterns of opponents (offline) and predict positions
       | and shoot there (since bullets have move time). That actually
       | worked fairly well with a really simple net.
       | 
       | For movement, however, deep-RL etc wasn't that big yet, so I
       | struggled a bit. What to train on? So I used genetic algorithms
       | to train this part of the net. Not the best results, but it
       | worked. Mind you these were simple homemade nets, not sure deep
       | learning even was a concept then.
       | 
       | Hard to write a good fitness function. I tried to deduct the
       | fitness if it hit a wall. Then it would just stand still. Tried
       | to then increase fitness based on movement, then it would just
       | oscillate at one spot. Etc. Etc. GAs exploit all loopholes,
       | pretty interesting.
       | 
       | Great fun. Great tool to explore programming at all levels.
        
         | mabbo wrote:
         | If you were going to use genetic algorithms, you should have
         | gone all in- seed with a randomized neural network, have them
         | compete, and breed the winners.
         | 
         | Literally survival of the fittest!
        
           | matsemann wrote:
           | Hehe, yeah, I did something similar later, using game score
           | as the fitness score (so still a chance of breeding even
           | though you didn't win) in a kind of tournament selection. The
           | problem is each generation then takes loads of time to
           | simulate, compared to just observing their behavior for a
           | short time.
           | 
           | But that worked much better as a fitness score, yes. It's
           | very true that what you measure is what will be optimized
           | for. Both for employees and robots.
        
       | jordo wrote:
       | Alternative? - Rocket Bot Royale -
       | https://rocketbotroyale.winterpixel.io
        
         | TedDoesntTalk wrote:
         | Thanks. It's a good game, but I don't see a programming aspect
         | to it.
        
       | neoCrimeLabs wrote:
       | This reminds me of Omega [1] from 1989. One of the more fun games
       | I've played. I was thinking about giving it a go again and seeing
       | how well I do.
       | 
       | [1] - https://en.wikipedia.org/wiki/Omega_(video_game) -
       | https://corewar.co.uk/omega/files/misc/omegamanual.pdf
        
       | sixothree wrote:
       | I have fond memories of Color Robot Battle from my childhood.
       | Setting up two robots and heading off to school while they spend
       | hours fighting.
       | 
       | https://corewar.co.uk/colorrobotbattle.htm
        
         | djmips wrote:
         | Wow that's cool. I didn't know that existed. Similar to
         | RobotWar. Doesn't seem to have a cool IDE and source level
         | debugger like RobotWar. Looks very fun though!
        
       | Trasmatta wrote:
       | I loved Robocode, it was one of my first introductions to
       | programming, as we used it in my high school programming class.
       | I've sort of had a pipe dream for awhile to build a browser based
       | Robocode inspired game. Not an exact clone, but a similar idea of
       | programming bots to fight each other.
        
         | culi wrote:
         | you might checkout
         | 
         | https://halite.io/
         | 
         | https://yare.io/
         | 
         | https://play.battlesnake.com/
         | 
         | https://www.codingame.com/start
         | 
         | https://screeps.com/
         | 
         | https://github.com/swarm-game/swarm
         | 
         | https://www.liagame.com/
        
           | Trasmatta wrote:
           | Thank you! I've seen some of those, but some are new to me.
           | Lots of cool stuff.
        
       | 29athrowaway wrote:
       | You can program a tank, or team of tanks, to fight each other.
       | 
       | Each tank can move, scan other tanks and shoot.
       | 
       | Your tank has hit points and shooting a bullet decreases your hit
       | points by the amount of firepower you used.
       | 
       | Bullets are particles that move over time, so you have to shoot
       | not at where other tanks are but where they are going to be at
       | based on their last position seen on radar.
        
       | spicybright wrote:
       | Brings back a lot of good highschool memories :)
        
       ___________________________________________________________________
       (page generated 2022-06-05 23:00 UTC)