Show HN: The classic Minesweeper on an irregular grid (polyreplay.com)
I'm experimenting game mechanics that are usually seen on a typical grid, but transposed on an irregular one.
This is a first game based on Minesweeper.
The changes an irregular grid brings are that cells don't all have 8 neighbors. Some can have less, some can have more. So when you try and deduce if a tile has a mine, you have to pay closer attention at the number clues and which tiles neighbors it.
My intention is to make a very classic game a bit more challenging & fun.
I've also released a first version of Checkers/Draughts, and plan to test similar variants for Chess, Othello and Go.
142 comments
[ 2.8 ms ] story [ 177 ms ] threadAlso "undo" is cool, but "lose 60s" seems backwards, considering one would get 60 seconds added to one's time.
And you're right for "lose 60s", It's not the ideal wording. I was thinking it in terms of the less time you end up with, the better your score is. But "gain 60s" wouldn't work either. I'll have a think, but curious to hear if anyone has suggestions for this.
Left-clicking the number is an option, and works for touchpads where chording and middle-click just don't.
Disabling left+right click brings us a lot closer to that mode. Maybe you could formalize it and call it an option?
A much bigger problem with right click (and left+right click) is that it's bringing up the browser context menu. That shouldn't happen.
If we're trying to be authentic to original Minesweeper, I see that you've implemented the sunglasses face that appears once you've won the game. The original also uses an ":o" face (circular mouth) when revealing a hidden square. Maybe U+1F62E?
And I believe that the context menu appearing is only on MacOS? The closest I have is a mac book, and I can't reproduce the problem on it unfortunately. But it looks like I can reproduce it on linux/chrome, with the browser dev tools set to mobile, so hopefully that fix will also solve the problem on MacOS. I'll report back when that's deployed.
For the emoji, at the moment, you can see a scared face when you click on an uncovered tile, and take about 1sec to release the mouse. So when you're hesitating for instance. And I think I'm happy with how it is at the moment, I'll take care of all the other bugs mentioned here as a higher priority.
Two points:
- In Windows 3.1, Minesweeper had the convention of left+right clicking to uncover every non-flagged square around a number that was full.
- At that time, three-button mice were not so common; the mouse to my Windows 3.1 machine had only two buttons.
Middle click might have worked then, but it was not the primary way to get the effect.
Although the number I show is actually a bit sneaky, as I subtract the number of flags placed to the total number of mines. So if you were to place more flags than mines, you'd see a negative number. (which I realise as I type that your version is similar, as the number can also go above the total).
I'm more leaning toward not adding more options, as I'd like to keep the game as simple as possible, but nevertheless I'll have a think, it might be worth it.
I might be overlooking something tho.
The 1 SouthEast of the bottom 2 touches two tiles, and the 1 immediately West touches a superset of those two. The difference between the larger and smaller set must be clear. And you can go further off of that.
The 1s on the little concave bit mean you know where the nearest 2's second flag should go, even though you don't know yet where the 1 is. Then that gives you some to clear.
As a notorious Minesweeper speedrunner I find the animation uncover animation when middle clicking to be a little slow as I find myself waiting it for it to finish for a second or so.
I've done quite a few iterations of the speed at which they get uncovered, and it's definitely tricky to nail down. I've tried to find a middle ground between something that's rewarding/satisfying (so should take 1-2 seconds, long enough to be enjoyed), but also doesn't block you (so should be instant). And that animation would need to very different if it's revealing 10 tiles or less, or 500+. I realize this still isn't quite right.
So thank you for saying that, I'll try and improve it.
But in short, when you uncover the first tile of this wave, at each frame I uncover only 1/60 of the total. So if you've uncovered 600 tiles, 10 should be uncovered on each frame, and it should be done in 1 second if your display is at 60FPS.
But if you uncover 60 tiles only, it will uncover 1 per frame, and that can look pretty bland. Could it be what you see? If that's the case, I believe (with a good 60% certainty!) that I mostly need to revisit the method when it's for a small number of tiles.
Been awhile since I played actual minesweeper, but shouldn't revealing a tile with a number on it which otherwise has empty neighbors also uncover those neighbors? I could swear that's how the original works.
I've tested on an iphone mini, and even though the dialog is quite big on it, so I should indeed try and shrink it, it doesn't prevent completing the tutorial. But it looks like I wrongly assumed this would be the smallest phone I could test it on.
And as far as I know, the empty tiles only gets uncovered if you uncover another empty one, so I followed this principle. If that was also the case when you uncover a number, this would reveal too much.
iPhone SE, Safari
And if you're able to send a screenshot, that'll be super useful. As at the moment, when testing in chrome dev tools, with iphone SE selected, it looks like it doesn't display the right size of the phone (or maybe I've misconfigured the dev tools), as the dialog box doesn't prevent from completing the tutorial.
The generation is inspired by what Oskar Stålberg has done for his game Townscaper. It is done with those steps: - start with triangles (ideally in an hexagonal pattern). - merge pairs of triangles into quads, randomly leaving some as triangles. - we subdivide both quads and triangles, and end up with quads only. - smooth the whole to get nicer shapes
It can be a bit abstract with just this list, so you can see some videos in my tweet: https://twitter.com/fradingue/status/1712218108826460428
I've also created a webgl engine to solve this type of procedural modeling for the web, and you can see 2 examples scenes where you can play with parameters that affect the shape of the irregular grid: - https://polygonjs.com/gui/irregular_quads/edit - https://polygonjs.com/gui/irregular_quad_relaxation/edit
I played a bunch of minesweeper earlier and looked at the records, and still don't get how it's possible lol
And that score is indeed suspicious, although there are some protections to prevent cheating. Someone would have to be quite motivated to go around them. But it might be possible, as you don't need to flag all the mines in order to win, you can wind by just uncovering the non-mines. I felt this could be allowed as this is really the same outcome. But I can see that if you're really lucky, the mines are placed in a very convenient way, a quick win could happen. But I assume this can only happen on the beginner grid, not on the larger ones.
In any case, I'll reconsider this, and may force all mines to be flagged in order to win, that might be safer.
That would make it less fun though, because an interesting variant is when you play without using flags.
Q: Would it be possible to make the grids… even more random? What’s your gridding approach? I was almost a bit "disappointed" that the grids still looked like, well, grids.
And I explain the generation method in another comment, but here it is as well:
-------------------- The generation is inspired by what Oskar Stålberg has done for his game Townscaper. It is done with those steps: - start with triangles (ideally in an hexagonal pattern). - merge pairs of triangles into quads, randomly leaving some as triangles. - we subdivide both quads and triangles, and end up with quads only. - smooth the whole to get nicer shapes
It can be a bit abstract with just this list, so you can see some videos in my tweet: https://twitter.com/fradingue/status/1712218108826460428
I've also created a webgl engine to solve this type of procedural modeling for the web, and you can see 2 examples scenes where you can play with parameters that affect the shape of the irregular grid:
- https://polygonjs.com/gui/irregular_quads/edit
- https://polygonjs.com/gui/irregular_quad_relaxation/edit --------------------
So even though you're currently seeing a flat grid, it's all 3D under the hood. So I'm also considering having those grids on a sphere, a torus, or even a custom 3D model. I had done some earlier test: https://polygonjs.com/gui/minesweeper_torus_sphere/edit So it's technically possible, but there's more work to have this easy to navigate around, and to still look visually minimalist while still being pleasant.
If the steam version becomes profitable, I'll definitely explore those directions. I agree this can be stretched further.
Hoping my number 1 ranking on Intermediate stays up a while.
I’ll need to see if I can crack that Expert high list.
Cheers
https://ibb.co/Db44nWp
The orange arrows point to a cell that should show "2" but shows "1."
EDIT: Nevermind :-)
But my assumption can certainly be wrong! To be sure, could you take a screenshot of a loosing screen? as all the mines will be revealed then, and we can see if the number is indeed correct or not.
I will say though that it seems like the map ends up a bit empty, reducing the difficulty. Managed to get through the expert setting without encountering a single 5, for instance.
And a question: Does this generate maps where guessing is necessary, like the original? I didn't come across any, and I was curious whether that was by accident or design. I hate those situations in what is supposed to be a logic game.
Great work!
But I'd love to remove guessing ultimately. I just haven't found a reliable way to make it work yet, and would need to dedicate a fair amount of hours to it, which I've preferred allocating to the other games on my roadmap. Nevertheless, it still may happen.
Could you maybe try the custom settings? You can change the ratio of mines. I'd be curious to know what quantity of mines you find works best.
The basic idea is he generates a grid, runs it through a deductive solver, and if it fails, heuristically changes the grid a little where it failed and tries again.
I'll try some different ratios and get back to you!
edit: I tried some runs with size 3 and 20% mines, that felt a lot more like expert difficulty Minesweeper too in terms of the sizes of the empty patches you uncover by uncovering a 0.
Although the reason I haven't set 20% as the default, is because I'm concerned this may create too many situations where guessing would be required. So I'd need to have the solver in place. So thank you for the link as well.
Although now, I'm wondering if the solver can be smart enough to allow situations like this, where finding how to progress isn't quite obvious, like this one: https://news.ycombinator.com/item?id=39234686
I also spotted a bug I think, where when you fail and undo, some of the mines are rendered similar to an empty cell, thereby spoiling where they are. This was on Firefox.
Would you be able to take a screenshot?
I'm testing for the iPhone SE using chrome dev tools, and the display seems fine there, so what I see it most likely not accurate.
https://ibb.co/t4KjqtK
But playing this version, my intuition is all wrong! I lost my first 2 games, and now I'm going to have to force myself to slow down and think through things more carefully, rather than trying to rely on my now-incorrect intuitions.
You know what would be fun, side scrolling mine sweeper - the field just keeps clicking several spots to the left each N seconds revealing new tiles to click - and maybe things like "Bomb Squad" perks that let you survive bomb damage when youre wrong. and whatever other mechanics could be layered into that - if you can get some tower defence mechanism where a shooting tower comes at you and you have to enclose it in toggle spots to kill it.... but it hops a few spots every time the field clicks to the next step... making him hard to catch.
Get bomb squad points every time you get a correct answer, answer so many in a row, get a bomb suit (outlive one bomb). Get more point for the least number of unclicked tiles that expire to the scrolling of the field to the left... if you dont have any un-marked tiles moving through the filed moving click, then you get bomb squad points to next bomb suit.
That'll make me think, certainly.
If you have a Fantasy city which is these weird polygons - you could make some great themes on cities - What if you will have creeps coming from Your Occupied side of the map, and you have to identify the snipers in the buildings in order to create a safe pathway throgh the city for your creeps... (tower defense style) as you reveal in a click-through fog-of-war manner, when you reveal swaths of "streets" as you click, it will allw creeps to have a safe or not path - and you have to be able to click a safe path fast enough before youre creeps get sniped...
(now, if you want to make it super controversial with a viral hope; They are refugees attempting to escape a war torn sci-fi city as they are caught in the crossfire of to warring factions... the snipers dont shoot at the refugees, per se, they shoot across the path at eachother, and if the refugees have only that revealed path to run through - they wil get shot, so as long as you keep revealing safe routes, they will follow that, but if they reach fog or a revealed sniper alley, they will still take the sniper alley unless you safely de-fog a safe passage. Sometimes tanks roll down an alley and they will be turned to Student Burgers if they get caught by the tanks...
---
You could do a multi-player version, which could be similar to https://GENERALS.io [0]
https://i.imgur.com/cUZ3kW1.png
https://i.imgur.com/k08X89r.png
Edit: Oh shoot, I completely forgot regular minesweeper does this too! It's definitely the acute angles that threw me off!
I found it much harder to register two acute angles as "adjacent" than two right angles are.
opening a shared url like this doesn't seem to work. i just get the beginner view.
also i noticed that sometimes a tile is empty or white even though it should have bevels because there is actually a bomb under it. it's a cosmetic issue maybe caused by the algorithm to automatically uncover empty tiles.
For the tile not having bevels when it should, would you be able to take a screenshot? That will help me understand when this happens. I haven't seen this yet, so I'm not entirely sure what could cause this.
the tiles with missing bevels are marked with bombs
I really like these kind of games. They are so meditating.
MacOS, Firefox: Tutorial halfway breaks when I am asked to right click a cell, I get the right click menu over a flag being dropped.
MacOS, Chrome: what the fuck the OS popped up a note when I launched this piece of surveillance capitalism adware that it just force-added a bunch of shit that runs in the background to my Login Items, fuck Chrome, anyway the right click actually works