6 ms·
This reminds me of a project idea I had... I was thinking of setting up a small server that can emulate some up multiplayer games, such as battleship, connect
by drekipus 5y ago
This reminds me of a project idea I had...
I was thinking of setting up a small server that can emulate some up multiplayer games, such as battleship, connect 4, even perhaps monopoly.
Then people submit code, or connect their machines to it, and it becomes "battle of the algorithms".
You'd have to register an algorithm name / version, and compete a few times against other algorithms, to be placed on the leaderboard for that game*.
Each game could just be stored as plaintext, so it would be easy to replay each move and visualise it on the website.
I haven't yet begun creating it, but it'd be great to see how your algorithm would work against another; You'd also have to consider how to place your ships as well. (probably sticking them in the corners could be easily dealt with, right?
Looking at this algorithm it seems like it's pretty optimal, I don't think there's much else that could be done with Battleships. Playing with other human players would be a different outcome..
* I would only really expect algorithms work per game, not across games.
- hntcz 5y agoAbout 20 years ago when I was a teenager Microsoft did this in my country with rock-paper-scissors. XML-RPC-based web services were new at the time and they promoted it this way. You hosted your own web service and they called it to play, I think 10 or 20 games against each opponent in your group. Obviously you can't get an edge against someone playing completely randomly but they placed a bunch of simpler bots in the groups that you could detect (e.g, always playing a pattern). Group winners made it to the final. It was awesome, thanks for reminding me of that memory!
- mormegil 5y ago> you can't get an edge against someone playing completely randomly Sure, random choice is not only a Nash equilibrium, it even has a fixed expected value without regard to the other player's strategy, _but_ that is only in the basic two-player game. If you have a tournament and some players use other strategies, you can get better score against them by a non-random strategy, meaning you can beat the random strategy in the global tournament. But it also means someone can defeat you! Which means RPS tournaments are interesting even if the game seemed almost trivial!
- onionisafruit 5y agoI worked on something like that for a while that I never finished. One of the stumbling blocks was executing untrusted code. I settled on having players either connect via websocket or receiving webhooks and having to respond in a given time frame.
- tomcam 5y agoI don’t understand the executing of entrusted code part. If the instructions are plain text, how could it even be a problem? The instruction FIRE(5,7) isn’t going to turn into a zero day exploit, right?
- Carbocarde 5y agoI actually started working on that with some of my friends, here's a link: https://github.com/Carbocarde/games https://github.com/Carbocarde/games We were planning on eventually making it into a website and doing a leaderboard. The program works by having agents that write to stdout and a game that reads from stdin. That way we can kinda avoid some of the security issues around running untrusted code. Still has a lot of work to be done before it's ready to simulate battleship :)
- aleksiy123 5y agoThere is a snake version of this called Battlesnake https://play.battlesnake.com/ https://play.battlesnake.com/ Did it while I was in university. I even won one of the categories one year.
- debbiedowner 5y agoI participated in a "ruby fight club" like this a few years ago hosted by grouper: https://github.com/Grouper/battleship https://github.com/Grouper/battleship
- gusgus01 5y agoStarCraft 2 has a pretty active version of this! I've always wanted to play around with it but I lost a lot of steam when I wanted to upstream some changes to the various libraries involved and my employer vetoed the idea. https://sc2ai.net/ https://sc2ai.net/
- Aeolun 5y agoYour employer vetoed the idea?How are they related to that?
- gusgus01 5y agoI work in America, so my employer owns my entire being. Specifically, in order to commit to open source, do any independent project, etc, I need to get permission from my employer that it doesn't compete with them and that they are willing to relinquish the copyright/IP rights.
- Delgan 5y agoIt reminds me of the multiplayer section from CodinGame website: https://www.codingame.com/multiplayer/bot-programming https://www.codingame.com/multiplayer/bot-programming Although there is no specific implementation for Battleship, but I believe that some users sometimes have the possibility to create and submit their own games.
- evil-olive 5y agonot exactly the same because it's not playing an established human vs. human game such as Battleship, but Core War [0] from 1984 is the earliest example of this idea that I'm aware of. > At the beginning of a game, each battle program is loaded into memory at a random location, after which each program executes one instruction in turn. The goal of the game is to cause the processes of opposing programs to terminate (which happens if they execute an invalid instruction), leaving the victorious program in sole possession of the machine. Battlecode [1] from MIT seems to be along similar lines as well 0: https://en.wikipedia.org/wiki/Core_War https://en.wikipedia.org/wiki/Core_War 1: https://battlecode.org/ https://battlecode.org/
- jhbadger 5y agoCorewar may be the first example of the game in its purest form, but earlier than that was Robotwar (first on the PLATO system in the 1970s then on the Apple ][ in 1981) which involved players writing simple programs to control robots in a BASIC like language. You could either compete against a friend or compete against a series of programs included with the game. https://en.wikipedia.org/wiki/RobotWar https://en.wikipedia.org/wiki/RobotWar
- gnopgnip 5y agoScreeps is similar
- bckr 5y agoMight want to chat with this user: https://news.ycombinator.com/user?id=mathgladiator https://news.ycombinator.com/user?id=mathgladiator Who has a SaaS prototype for creating board game servers
- aaron695 5y ago
- flir 5y agoI think there's only two possible outcomes - either a best solution emerges, or a rock-paper-scissors scenario emerges with a number of solutions. If there's another outcome I'm missing, I'd like to hear about it (stalemate?)
- kayamon 5y agoI wanna say the Metropolis-Hastings algorithm is probably the best way to explore any probability distribution like this. The core algorithm is pretty similar to battleships -- pick a random point from a map, then explore neighbouring points, use the difference between predicted and measured results to update the map, and when bored do random restarts.
- IIAOPSW 5y agoI think you are teetering on the edge of the rabbit hole of a domain specific language for the representation of board game rules. Unless you want to write a new emulator for each new multiplayer game, that's the hole you'll dive down. But once down there, you'll realize you're basically making a programming language with a board game theme, as any language sophisticated enough to represent most board games is destined to become a Turing tarpit. At that point the project has become self defeating, as you are now coding each new game in a programming language you invented to avoid coding each new game.
- dawidloubser 5y agoOne of the first incantations of this idea that I encountered, when I had just started working at my first corporate job back in the day, was Robocode ( https://robocode.sourceforge.io/ https://robocode.sourceforge.io/ ) - it was great fun, and I see it's still going.
- captn3m0 5y agoWant to build the same, but using boardgame.io. Search for Gym here: https://github.com/captn3m0/ideas https://github.com/captn3m0/ideas
- pr0gramm 5y agoWe (http://pr0gramm.com http://pr0gramm.com) had a multiplayer battleship[1] for our april's fools two days ago. All users were divided into a red and blue team and then voted for the next shot. For our april's fools in 2018 we did the same with connect 4[2]. The games itself are not that interesting (altough OP certainly disagrees), but the social dynamics, shitposts and memes that came out of this were fascinating. [1] https://vid.pr0gramm.com/2022/04/02/e9c168457179b582.mp4 https://vid.pr0gramm.com/2022/04/02/e9c168457179b582.mp4 [2] https://vid.pr0gramm.com/2018/04/01/fa0b52dacd80da53.mp4 https://vid.pr0gramm.com/2018/04/01/fa0b52dacd80da53.mp4
- kevinwang 5y agoTo add on to the list of bot competitions: there's a really great one with a nice interface for a version of blind chess: https://rbc.jhuapl.edu/ https://rbc.jhuapl.edu/
- kwhitefoot 5y agoReminds me of Robert Axelrod's computer tournament, won by Anatol Rapoport's Tit for Tat. See https://lps.library.cmu.edu/NCMR/article/351/galley/355/view/ https://lps.library.cmu.edu/NCMR/article/351/galley/355/view...
- dpflug 5y agoThere's some effort in that direction here: http://ggp.stanford.edu/ http://ggp.stanford.edu/