13 ms·
Analog Chess
- andrewfromx 4y ago"To win, you simply need to capture the opponent's king. This is mainly because stalemate is basically impossible, as the king can always move an infintesimal amount, and also because implementing check/checkmate would destroy the last ounce of sanity I have left."
- timerol 4y ago"Warning: This code is fucking awful. Do not expect the code to be stable under any modifications, but you can try if you want I guess. Also there are barely any comments sorry. I am in Electrical Engineering and I like writing shitty code to piss off my Computer Science friends." I appreciate this README's sense of humor
- remram 4y agoThe fact that he released it is awesome. So many people never released their code because "it's not ready" or "I want to clean it up" or whatever. Fucking awful barely-functioning open source code is better than no code available, every time.
- bunnie 4y agoI can relate to this!
- knodi123 4y agolol, "Run the .py file with the highest number, because I can't figure out version control." Says the guy who posted it to github.
- felixworks 4y agoGitHub becoming Pastebin would be a hilarious turn of events.
- Kamq 4y agoIt's kinda close already. I've gotten several pdfs of books by cloning repos.
- _Algernon_ 4y agoYou can upload files to github with drag and drop. They are not mutually exclusive.
- tluyben2 4y agoMy father (quantum mechanics) would sometimes submit awful but working code to Dijkstra without proofs just to piss him off. Dijkstra didn't like the looseness of the physics students when it came to software development, while physics students didn't like the software proofs for things in physics that were experimental and needed a 'quick' (nothing was 'quick' then compared to now of course) set of calculations/simulations and not waste time on writing formal proofs for them.
- bertil 4y agoThere’s something profound here about how the very natural conventions in Chess (“If you did that, you’d lose, so I’d rather we continue playing”) have redefined “valid” in a way that is surprisingly hard to re-implement with code.
- cmeacham98 4y agoIt is very easy to implement with code. Chess computers are some of the first well-known computer programs (see, for example, Deep Blue). What is difficult is adapting chess's rules to this analog environment. It would be similarly difficult if you played this way with a real chess set in the real world, has nothing to do with code.
- ummonk 4y agoYou don't actually have infinitely many moves available in analog chess since you can only click on a pixel. But while check should be doable in reasonable time, checkmate / stalemate would be expensive to compute since you have to check every possible move of yours (not just with the king, but with other pieces that could interpose as well) and then check every possible opponent's move in response to each of your moves to see if the king will be in check in the resulting positions.
- cmeacham98 4y agoYou'll find that with some applied math you do not need to check every single possible move of the King.
- ummonk 4y agoPlease elaborate.
- AstixAndBelix 4y agoyou can’t represent the real plane on a computer. you can only have a limited amount of precision that effectively results in very dense grid, but a grid nonetheless
- logicallee 4y agoIn chess, you win when you are "about to" capture the opponent's king on your next move, which is called putting them in check, and there's no way for the other side to avoid it (block or move out of check). So I've always found it very bizarre that if it's a player's move, but any possible move would put their own king in check, then it is a draw (rather than a loss). This leads to a situation where one side can have almost no pieces left, perhaps only the king, but still somehow draw since the king can't move anywhere where it wouldn't be captured. I imagine a king all by himself peeping his head out out for a place to move, but everywhere is covered by snipers, so, since he can't move anywhere without getting captured, despite being overwhelmed by enemy forces he yells out a la monte Python "So we'll call it a draw then!"
- hgsgm 4y agoIt's because chess was invented by programmers, and stalemate means "the game is broken because there are no legal moves so it's impossible to continue", so we call it a draw.
- a_cardboard_box 4y agoYou can also tell it's made by programmers because of the en passant "feature", which clearly only exists due to the programmers' incomplete implementation of the 2-square first move.
- barakm 4y agoYour post and air quotes for “feature” are hella snide. In chess code, en passant is an edge case that takes a lot of code to cover, and not just some bug due to incompleteness. Check yourself before you wreck yourself. And yes, check pun intended.
- pbhjpbhj 4y agoMaybe if you think of it in terms of the opposition falling to put you in check despite you only having a king left? Your army chased the opposing king to the forest but failed to defeat him, be gets to live out his days as a hermit. You are denied 'satisfaction'. ? In my family, against my children, it's a running joke that I'll almost always fail to win, and stalemate them.
- bspammer 4y ago> the king can always move an infintesimal amount I don't think this is true, it should be perfectly possible to cover the opponent's king's entire movement area with your pieces. I'd love to see a version of this game that actually implements this :D
- gmoot 4y agoThen it's checkmate, not stalemate. For a stalemate you need a situation where the king is not in check, but there are no legal moves. It seems impossible in practice, if not in theory.
- Someone 4y agoYou can have stalemate with two rooks or two bishops enclosing a square just large enough to contain the king. A queen and a rook or bishop also can enclose a triangular area that is just large enough to contain the king. (Talking of bishops: should this game require bishops to stay on squares of their starting colour?)
- mythas 4y agoHow close to the king are they covering? .0000001 units? The king can move .00000009 units. You can always make a smaller real number.
- deleted 4y ago[deleted]
- NineStarPoint 4y agoIn theory yes. In practice, python uses floating point numbers for decimals so there is actually a minimum possible move and a finite number of allowed decimals.
- ehulinsky 4y agoAlso the game only has a resolution of 640x640 pixels, and you cant move the mouse a half pixel. But anyways, stalemate basically requires very precise positioning by the attacker, so it is VERY unlikely to actually happen, especially since they are trying to avoid stalemate.
- masswerk 4y agoChess meets Tablut / Hnefatafl… (I guess, Vikings would appreciate the constraints arising from infinitesimal granularity movement.)
- panki27 4y agoI love the versioning approach here - use git but still create fileV1.py, fileV2.py...
- FpUser 4y agoI did not look at their particular code but I had files named like this in my projects: api_v1, api_v2. Reason being that the software V2 still supported v1 api so both were present and needed.
- actinium226 4y agoA reasonable approach but from the README: "To run the code you will need to install Python and the PyGame library, and then run the latest .py file because I can't be bothered to actually use version control."
- ChildOfEru 4y agoI'm just reminded of the last line of the README.md "I am in Electrical Engineering and I like writing shitty code to piss off my Computer Science friends." -- https://github.com/ehulinsky/AnalogChess/blob/main/README.md#code https://github.com/ehulinsky/AnalogChess/blob/main/README.md...
- The_Colonel 4y agoIt's a relatively common approach in e.g. web services, but not in standalone games.
- FpUser 4y agoI did not really look at the project, just at the comments so yes sure.
- Kiro 4y agoI do the same. I think it's nice to have the old version readily available as reference instead of hidden in git.
- MaceOutWindu 4y ago"I am in Electrical Engineering and I like writing shitty code to piss off my Computer Science friends." lol
- deleted 4y ago[deleted]
- soperj 4y ago"Do not expect the code to be stable under any modifications, but you can try if you want I guess. Also there are barely any comments sorry. I am in Electrical Engineering and I like writing shitty code to piss off my Computer Science friends." I love this.
- ThisIsTheWay 4y agoThe few comments that are in there are kinda funny too: > #fucking awful global variable that is is changed by the confirm() function of the pieces > #math shit > #i don't know what im doing
- Aaronstotle 4y agoThat and "run the latest .py file because I can't be bothered to actually use version control" made me laugh
- doodpants 4y agoThis makes no sense to me. I mean, it's already on GitHub, which is a version control system. So he's doing more work by committing each version as a separate file, rather than making modifications in place?
- quantaseed 4y agoHe probably bothered to learn "git add" "git commit -am" "git push" and nothing else. Or maybe his CS friends helped put it on github. Or maybe he's just to piss us off :)
- jfoutz 4y agosometimes, especially when I'm trying to figure out something new, I like keeping the old exploratory code so I can grep through it or easily compare different approaches. It's less cognitive load than dealing with tags or branches or versions. usually I end up with old/try1 old/try2 ... old/tryn once I've worked out the way I really want to go, then I nuke old.
- SilasX 4y ago>Sadly en passant (the funny move) is not implemented yet because I have no idea how it would work. That's ... straighforward enough, I think? En passant exists because it feels unfair that a pawn could use its double-move (here, >1.0 move) to bypass another pawn's capture. So, in analog chess, the en passant rule would be "if a pawn move of >1.0 passes through the capture zone of the other side's pawn, that pawn retains the right to capture (on the next move) as if it (the former pawn) had moved to a point within the capture zone". Still don't see why analog chess would be interest rather than just frustratingly complex?
- MaceOutWindu 4y agoyeah in analog chess you could just check if the other pawns near it collide in trajectories when doing the double move and if they do then en passant is in effect.
- AnotherGoodName 4y agoTo make it more concrete: When a pawn moves more than distance 1 it could leave behind a shadow at distance 1. Capturing that shadow with a pawn captures that pawn. It's effectively how you explain en passant to a new player.
- gliptic 4y agoSimilarily, it should not be too hard to implement checkmate. If, on your move, any of the opponent pieces can capture your king and this remains true wherever the king moves, you're mated. Should only require overlap detection between linear and circular swept discs. EDIT: Ok, a bit more complex than that, but still doable I think. Find a point on the king movement lines that are at least one radius away from the union of the capture areas. You would also not be allowed to move the king anywhere where the opponent can capture it.
- deleted 4y ago[deleted]
- deleted 4y ago[deleted]
- somethingAlex 4y agoI don't think the knight should be allowed to move in a full circle. It should be disjointed - four arches. Allowing a knight to move two squares orthogonally kind of makes it a completely different piece.
- hgsgm 4y agoIt's like a completely different game, analog/continuous instead, of digital/discrete.
- a_cardboard_box 4y agoIt's not moving 2 squares orthogonally. It's moving sqrt(5) squares orthogonally. In normal chess, the knight can move to any square which is exactly sqrt(5) units away.
- mikepurvis 4y agoI wondered about this too. I think I resolved it in my mind by seeing the game as granting every piece one degree of freedom that goes from discrete to continuous: for most of the pieces, it's distance from the origin, since they move in straight lines. But knights are already more constrained than that anyway, so for knights, the continuous DoF is axial instead. This also makes sense when you put any given piece in the middle of an empty board and plot all of its potential moves— for every piece but the knight, "joining up" their possible landing sites gives continuous distances from the starting point, but if you join up a knight's landing sites, you get a circle of r=√5. So in short, I agree with the OP's decision on how to handle knights.
- ehulinsky 4y agoYeah, I basically tried to get as close to the normal moves as possible while also keeping it simple. Also all of the pieces in Analog Chess are so overpowered I think it's ok that the knight is buffed a little bit.
- whimsicalism 4y agoIf the knight can move in a full circle, the bishop by the same principle should be able to move anywhere on the board.
- tromp 4y agoThere's no mention of promotion. Is it not available, or when are pawns considered to have reached the final rank?
- rm999 4y agoIf I am reading this correctly, a pawn past row 7 will automatically be replaced by a Queen: https://github.com/ehulinsky/AnalogChess/blob/main/analogchessV4.py#L1187-L1188 https://github.com/ehulinsky/AnalogChess/blob/main/analogche...
- squeaky-clean 4y agoLooking at the code it looks like it supports promotion, a pawn is considered on the final rank when it's entire radius is on that rank.
- luxuryballs 4y agoif it were me I’d make it so the piece has to be touching the far edge of the board, to follow with the theme
- notmysql_ 4y agoCool project! If the pieces don't render for you try installing the SegoeUISymbol font from the internet
- zabzonk 4y agosad to see this was not chess on an analog computer. now, that would be impressive! one of my late mentors, dr mick bazin (university of london, 1980s), used to demonstrate programming bacterial population dynamics on an analog machine - plug-boards, dials and god knows what. as a pretty good digital computing person, i found it all baffling. but nowt to do with the post, i guess.
- korroziya 4y ago"Do not expect the code to be stable under any modifications, but you can try if you want I guess" Challenge accepted.
- TheRealNGenius 4y ago[dead]
- Shared404 4y agoSaw en passant so googled it... holy hell.
- tspike 4y agoIt’s pretty fun surprising someone who is not familiar with it, in a sadistic sort of way.
- Shared404 4y agoThis is true. I've taken to asking players who are unfamiliar with the game if their familiar with it on occasion, at least ones who I expect will be more frustrated than amused.
- ssl-3 4y agoIt used to be a potential invitation for a fist-fight before we had pocket computers with which the aggrieved (and unaware) player could verify the move's legality.
- qsort 4y agoAlso true for some other little rules people often forget, like underpromotion, castling through/out of check, stalemate, perpetual, 50 moves, etc. Plus the general topic of how to use clocks. Chess is so popular that most people first learn to play from parents, relatives, etc., so they might not have learned the full rules if they aren't interested in learning the game more seriously.
- unsafecast 4y agoYou say underpromotion, but something people are surprised by is making a second queen ime. People sometimes assume promotion is actually "taking a captured piece back".
- SamPatt 4y agoVery understandable how this developed in the era of over the board play. You can't have two queens when they don't physically exist! I always use an upside down rook, somehow there's always one available by then.
- jimhi 4y agoIf you want to play in the browser instead of setting this up locally I made a replit: https://replit.com/@jamespsteinberg/AnalogChess-1 https://replit.com/@jamespsteinberg/AnalogChess-1
- hammock 4y agoSweet thanks. The board takes up more space than the window. How do I zoom out?
- jimhi 4y agoThere's a button with two diagonal arrows that lets you enter fullscreen mode although you might have to scroll a bit to get it to show. Otherwise, you might have to fork the replit and make an account. It's free.
- mzs 4y agoAll the pieces are simply labeled with rectangles as if the font is not present for me. Any ideas? Also thanks!
- kofejnik 4y agoNow we need Hikaru to stream it
- luxuryballs 4y agowould prefer to see this without the squares, just one giant square
- dragontamer 4y ago> Pawn: May move 0-2 squares on it's first move, 0-1 otherwise. Can only attack diagonally. Sadly en passant (the funny move) is not implemented yet because I have no idea how it would work. Just "enlarge" the Pawn whenever it moves more than 1 square. Ex: if the pawn moves 2 squares, it is now a 2x1 piece. It will return to size 1x1 after its next move. If you wanna be "only" Pawns participating, ensure that the enlarged region can only be affected by other pawns. Ex2: If the pawn moves 1.5 squares, it is now a 1.5x1 piece.
- rcme 4y agoThat would allow any piece to capture a pawn on the adjacent file after a 2 square move. That would make 2 square moves bad, which would slow the game down.
- dragontamer 4y agoThat's literally the point of en-passant. To "punish" players who do a 2-square move. It shouldn't be too hard to have Pawns only be able to capture in this manner. And if you wanted to "reset the size" at the beginning of each player's turn. (Ex: White's pawns reset from 1.5x1 size into 1x1 size at the start of White's turn), then that basically covers en-passant.
- operator-name 4y agoWhat rcme seems to be pointing out is that in normal chess only pawns can en passant, whereas if you grew the size of the pawn non-pawn prices would also be able to take it.
- dragontamer 4y ago> It shouldn't be too hard to have Pawns only be able to capture in this manner. So you have two regions. The 1x1 region of the pawn, and the 1.5 x 1 "en passant" region of a pawn that moved 1.5 squares as its first thrust. The 1.5x1 region can only be targetted by enemy pawns. If an enemy bishop lands in the 1.5x1 region, it still needs to check if its the 1x1 "original pawn" region to have the pawn captured.
- scarmig 4y agoWith optimal play, is there ever a reason to make a move that's not an integral value? Also, to the extent there is a benefit, does the full set of floating points (presumably) get more advantage than just the positions located midway between regular adjacent positions? And how big an advantage does it offer? Could someone with access to the floats beat someone ranked 500 points higher who doesn't?
- britneybitch 4y agoI imagine it's pretty powerful to put your queen on the corner of 4 squares so it can capture along two ranks and two files.
- fsckboy 4y agogood point for sure, but in terms of relative power it's probably the same, as it could then be captured along two ranks, files, diagonals, and a fair number of knight, and even some pawn positions.
- kvdveer 4y agoYes, for example to capture two pieces at once, or threaten two adjacent pieces.
- Shared404 4y agoIndeed, or to bypass a piece which is threatening a space by moving into a different part of that space.
- qsort 4y agoAny position where you'd be in zugzwang is a good example. A more interesting question is how do you search the infinite state space. Intuitively, many states that are formally different aren't meaningfully different from each other and can be assimilated. Any bisimulation expert on HN? :D
- dtech 4y agoBit weird to call it analog while continuous is meant. Any chess on a physical board is analog.
- actinium226 4y agoI know what you mean, but I guess analog electronics are continuous? The author notes at the end of the README that he's an electrical engineer so maybe that's where it's coming from.
- dragontamer 4y agoAnalog is the study of continuous circuits. Digital is the study of (usually) binary circuits. -------- Ex: an OpAmp is called an analog computer sometimes, because you can do things like Add, Subtract, Multiply, Divide, exponent, differentiate, or integrate voltages. (ex: 0.543V + 1.1V == 1.643V output). This is troublesome in practice because a bit of noise (ex: +.05V error) propagates. This is in contrast to a digital computer, which encodes data into 0 or 1. There are things like PAM4 which encodes data as 0, 1, 2, or 3 (2-bits per signal), or other such "discrete steps". But the overall concept of "snapping" data to specific voltage levels allows you to fix noise issues.
- RaoulP 4y agoAgreed. But I suppose the creator (an electrical engineering student) thinks of continuous vs. discrete in terms of analog vs. digital signals.
- ehulinsky 4y agoYeah I just forgot the word continuous and never changed the name lol. But my thought process is that an analog clock moves smoothly instead of being restricted to minutes, and analog circuits are continuous.
- actinium226 4y agoThis readme is :fire: XD XD XD
- dragontamer 4y agoThere seems to be a whole slew of "analog" games coming out for classic discrete games. For example, "Not Tetris" is an analog-Tetris. https://stabyourself.net/nottetris2/ https://stabyourself.net/nottetris2/ I certainly enjoy these games. So hopefully more people are inspired to find analog-versions of other discrete or turn-based games, lol. I guess a more "serious" version of analog Tetris is perhaps Tricky Towers, which is an excellent party game. https://www.trickytowers.com/ https://www.trickytowers.com/
- Y_Y 4y agoI'm trying to go the other way and discretize golf
- itcrowd 4y ago... so that's what they meant by disc golf in college!
- OisinMoran 4y agoPlease say more! Very interested in this category in general. Would love a version of basketball where the points are a continuous function of distance from the basket rather than discrete 2 & 3 pointers.
- pinguin7 4y agoI think "discretize" is the opposite of using continuous functions, if I understand correctly. They probably meant to play golf in some kind of grid system and using only a few different strengths and angles. But interestingly, most complex games have some kind of mixture of both: basket ball having discrete points, but fouls are remedied with a free shot on a continuous plane. Ice hockey, on the other hand, has only a discrete set of places where the game can continue after a foul.
- naet 4y agoTricky towers was great fun when I played it a while back.
- jtolmar 4y agoHilarious idea, very nice. A dumb thing I found - If you move the knight's pawn, it's just barely possible to, over the course of many moves, slip your rook diagonally through to that pawn's former space.
- ehulinsky 4y agoI think the number of moves approaches infinity as the diameter approaches sqrt(2)/2, as the current diameter is 0.7 squares so that rooks can escape diagonally. Could be interesting to look into.
- percentcer 4y ago[I know this isn't the main feature of the project, but] I think if more chess clients offered the "view squares that are under attack" overlay then the world would be a better place. So many interesting, low-level casual games are destroyed by blunders.
- cauthon 4y agoSeeing attacks and tactics _is_ playing chess. That's like saying more FPS games need to offer aimbots because low-level casual games are destroyed by missing headshots. Both chess.com and lichess allow you to view attacks in the analysis, but I don't think it should be available in-game. Low-level or casual play in any setting is going to be characterized by blunders, that's what makes it low-level and casual.
- mikebenfield 4y agoSince that feature isn’t available on an actual board, it would really hamper your development as a player to use it when playing online.
- franknstein 4y agoMaybe it would actually help to develop internal vision and improve your chess.
- Shared404 4y agoI could see that varying from individual to individual. For me, I'm quite confident it would negatively impact my skills as I would naturally start trying to offload that mental load to the computer and forget how to do it.
- alar44 4y agoNo, it does the exact opposite. It's like spell check. I can't spell for shit anymore.
- ehulinsky 4y agoI didn't have it originally, but because of how much more complex the movement in this game is, it was almost impossible to avoid blundering everything.
- usgroup 4y agoI could imagine myself thinking through what a continuous version of chess might look like, but actually having enough give—a-f__ck to implement it is other worldly to me. What drives you internet stranger?
- ehulinsky 4y agoThe idea of it was driving me mad and I had no way to test it, so I just sat down for 8 hours and made the first version.
- c3534l 4y agoEdit: nevermind. I guess I didn't have enough coffee because I completely misinterpreted this.
- NeoTar 4y agoIn regular chess you can only move discrete distances (1, 2, 3 squares, etc.) - this is analogue in the sense that pieces can move continuous distances.
- deleted 4y ago[deleted]
- nabogh 4y agoI don't see how this is a donut topology. If it were you could move off the sides and end up on the other side of the screen. Like Pac-Man or Asteroids. It's analog because you can move any continuous distance. Not just a discrete number of tiles.
- heystefan 4y agoCan anyone please ELI5 for us with the cheap seats and/or cognitive disabilities. What's exactly different from regular chess?
- deleted 4y ago[deleted]
- aaroninsf 4y agoIn chess, piece locations are defined in terms of squares on the 8x8 grid. In this analog version, locations are defined continuously, the checkerboard they move over is meaningful only to establish starting positions, and then is purely aesthetic.
- mkaic 4y agoRegular chess is played on an 8x8 grid of squares, and pieces occupy one square at a time. They move along grid lines and diagonals and there's no such thing as being "halfway" between two squares. Every piece on the board has an X-coordinate between A and H, and a Y-coordinate between 1 and 8. In this version, the pieces are no longer constrained to having integer coordinates. A pawn can be "halfway" between, say A2 and A3, or a queen could be sitting roughly in-between several squares at once. In regular chess, pieces are captured when an enemy piece moves to the same square as them. In this version, since the grid doesn't exist any more, pieces are captured when an enemy piece physically overlaps them. It's kinda like normal chess is a low-resolution game with only 64 possible locations, and this is a higher resolution version of it where you aren't limited to just those 64 locations and can slide continuously all across the board.
- heystefan 4y agoOh got it, thanks!
- aaroninsf 4y agoI appreciate the humor and tone for sure, but I am perplexed by the assertion that confirming or checking-for `check` (as opposed to mate) is difficult. Why is it not simply checking the attack surface of each piece from its current position? I understand there is occlusion, but that should be well-defined for collision-checking for taking already. I.e. is this not the rule: "if none of the opposing 16 positions has the king's [prospective] position in their range of attack, the position is clear." Where range-of-attack are already defined. If there is a problem with determining if a given range is subset by occlusion, that would seem to make preclude determining capture? I must be missing something...
- kortex 4y agoNo, you are correct, it should be some "fairly straightforward"* 2D linear algebra to check for intersection (knight might need a special case). You just iterate all pieces and check for king collision box overlap with certain lines extended from enemy pieces. But OP states they are an EE and aren't the best at version control, so they probably haven't worked through this yet. * again, straightforward if you have experience with computer rendering, CV, or similar domains, but less so in other domains.
- ehulinsky 4y agoThe problem is that it needs to check every position that the king can move to as well. Doing it based on pixels would be extremely slow, and doing it based on the math seems like a nightmare, unless I am missing something.
- kortex 4y agoYou would not do it by pixels, it's pure math. I'd have to sit down and work through the actual math, but between convolution and affine transformations, I'm pretty sure there should be a way to compute the intersection with a formula for each piece type. Knight is the easiest, that's just checking (lol) the distance to see if 5-r/2 <= d < 5+r/2.
- alanbernstein 4y agoOne thing that seems to be lost here is the color of the bishops. I wonder if there is some constraint you could add for their movement to get a sort of equivalent concept?
- jdlyga 4y agoThis reminds of switching from Disgaea, a grid-based tactical RPG, to Phantom Brave, which ditched the grid and handled combat using distances.
- LoveMortuus 4y agoI love Disgaea, especially the freedom it gives you to grind and build your character (singular, because all the others will betray you :P).
- adrianmonk 4y agoNow somebody make a chess engine to play this. I bet it's possible to use the same approach as chess engines for traditional chess. You might run into problems with the search space being a tiny bit larger, though.
- viridian 4y agobetter to use a neural network than a traditional engine here. Analog chess doesn't benefit from a lot of the stuff traditional engines do, like table bases, centipawn loss weighted depth first search, mathematically solved endgames, etc.
- albertzeyer 4y agoAnd now make it also realtime...
- birracerveza 4y agoWith killstreaks, abilities and ultimates.
- bo1024 4y agoHow much space do pieces take up? I.e. how close do their centers have to be for them to intersect and block or be captured?
- ehulinsky 4y agoThey have a diameter of 0.7 squares but that can be changed in the code. As it is they are just below sqrt(2)/2 so that the bishops can escape diagonally.
- birracerveza 4y agoInteresting! /r/anarchychess will love this. > One interesting side effect of this is that you can capture multiple pieces at once. :) Wouldn't it make more sense if it moved until it touched another piece and thus capture it without overlapping?
- Someone 4y agoEven then, it could simultaneously hit multiple pieces (I think 2 is the maximum for real coordinates. 3 probably is doable with IEEE doubles because you can simultaneously touch 3 if those 3 pieces touch each other at 120-degree angles) Also, knights jump, so for them you definitely need the rules as stated.
- moffkalast 4y ago> en passant is not implemented yet /r/anarchychess will hate this
- sireat 4y agoLot of fun chess variants. Reading about Lloyd Shapley (2nd in Game Theory after von Neumann) I discovered that he was supposed to be master at: https://en.wikipedia.org/wiki/Kriegspiel_(chess) https://en.wikipedia.org/wiki/Kriegspiel_(chess) Basically chess with Fog of War.
- brofallon 4y agoThere's a special place in my heart for any project in which the Readme says "Warning: The code is fucking awful"
- revskill 4y agoThe code is readable, and at the same time, unmaintainable. Good job.
- ehulinsky 4y agothansk
- mdtrooper 4y agoThis remembers me to an oldie web but nice is: https://www.chessvariants.com/ https://www.chessvariants.com/
- based2 4y agohttps://blueorangegames.eu/en/games/volto/ https://blueorangegames.eu/en/games/volto/
- joexner 4y ago> Capturing in this game is a little bit goofy. Basically, if your piece overlaps the opponent's piece it is captured, and you cannot move past the first piece you overlap. > One interesting side effect of this is that you can capture multiple pieces at once. :) Which way is "past"? Can only knights milti-kill, since they can "jump" past the first point of contact?
- cowvin 4y agoHmmm from testing it on the replit site someone posted, you can actually move through the first point of contact. I set up a case where my queen was protected by a pawn and used a bishop to take both pieces.
- ehulinsky 4y agoOnce they intersect a piece they can keep moving, but they can't exit on the other side
- philipwhiuk 4y agoI mean it's barely chess, but interesting idea.
- TheRealPomax 4y agoNot sure that's using the word "analog" correctly at all, but still very cool =)
- rittme 4y agoA lot of people are making fun of his code or versioning skills. It's very cool that he was able to code something interesting enough to be on the top of HN, without mastering the tools he used. People should focus less on code and tools and more on making great stuff, like him.
- andai 4y agoI found this part of the readme amusing: > Warning: This code is fucking awful. > Do not expect the code to be stable under any modifications, but you can try if you want I guess. Also there are barely any comments sorry. I am in Electrical Engineering and I like writing shitty code to piss off my Computer Science friends.
- 8bitsrule 4y agoTeenager Evariste Galois did a lousy job of explaining how his math worked, none of the experts could make sense of it. He'd been dead a decade before Liouville said hey, this shit is alright. It turned out to be sorta useful a century later. A couple of the experts are still remembered, not for much.
- kazinator 4y agoIf he hadn't gotten himself killed at twenty, he might have learned how to explain it. Doesn't the legend have it that he scribbled a lot of his ideas down hastily the day he though he was going to die?
- ehulinsky 4y agowish me luck I have a duel tomorrow
- fnordpiglet 4y agoHe was also just totally insane
- temporalparts 4y agoWhat would people think about doing a tournament for analog chess? I'd be willing to put down $1k for the prize pool. I think it'll be cool to see what creative strategies people come up for this. I made a post to this effect: https://news.ycombinator.com/item?id=34377233 https://news.ycombinator.com/item?id=34377233
- xwdv 4y agoAt first I thought what they meant by not be constrained to an 8x8 grid was that you could basically send pieces off the map to out of bound coordinates, which would be an interesting variant. The chessboard would be an infinite size grid, you just have the start positions set to a particular 8x8 region. This has interesting implications when you start to consider pieces that could move all the way to infinity, such as a rook. Would a rook that is the first to move to infinity be able to consume any other piece that also goes out to infinity by moving horizontally or vertically? So do you have to specify that you are only moving a piece within a certain amount of squares from infinity, to not be placed in a vulnerable spot?
- garfieldnate 4y agoDid anybody else play Mage Knights as a kid? This reminds me of it. The mechanism was pretty ingenious, in my opinion. Each figure has a dial on the base giving it stats for defense, attack, attack range, effects such as poison, etc. The figures move around and attack on the battlefield in units of inches (this may lead to some arguments, so its good to have a moderator who's good at measuring).
- Ruphin 4y agoVery interesting. From playing a single game you immediately notice that traditional chess theory doesn't apply to this game at all. After some testing I found a few things in particular that change the way the game plays out drastically: When having two pawns adjacent one of them can still defend the other by having it only slightly behind. They can also alternate defending each other with a single move. Pawns can also attack/defend things directly in front of them by pushing up against them. These things combined mean that it's almost impossible to have any pawn weaknesses, other than having a singled out pawn with no neighbors. In general pawns are the most improved piece with this ruleset. The ability to move directly forward makes knights significantly stronger. Knights ability to move through other pieces is also particularly strong versus pawns which can now block most pieces from moving around quite easily. Since pawns generally mainly move along one axis, it is easier to control the distance between pieces in the forward-backward axis than in the left-right axis. This makes it harder to utilise Rooks to capture two adjacent pieces. Bishops on the other hand have an easier time capturing two adjacent pieces, if positioned correctly. I'm not sure this compensates for the fact that bishops now have a much harder time penetrating positions, they are the most easily blocked of all the pieces. Overall it is very interesting as a chess variant, it plays so very different from chess. It's hard to even figure out reasonable openers.
- trhr 4y ago> I am in Electrical Engineering and I like writing shitty code to piss off my Computer Science friends. That's cool. I like using 24 gauge wire for everything to piss off my EE friends.
- cassepipe 4y agoSorry, but why "Analog"?
- ogogmad 4y agoAnalog means continuous. The moves are continuous, not discrete.
- ogogmad 4y agoLeela Analog Chess Zero? If they could do StarCraft, I don't see why they can't do this.
- wufufufu 4y agoSince the code is working and the main problems are the lack of documentation & structure, would it be possible to refactor & add comments with AI techniques? Or transpose it to javascript so we can play online?