Crushing Minesweeper | Game Dev's Revenge

Поділитися
Вставка

КОМЕНТАРІ • 92

  • @3v1l73ddy
    @3v1l73ddy Рік тому +67

    Are you a duck, turtle, chameleon? Cause that's kinda cool but I can't figure out if I'm right about the duck part at least... Anyway, on topic, great video!

    • @uselessgamedev
      @uselessgamedev  Рік тому +88

      It's an interpretation of the Kappa, a creature from Japanese folklore, it's a turlte-like water dwelling spirit that lives near water and "pranks" people ("pranking" goes from splashing to leading kids to their death drowning them).
      They have a bowl-shaped cavity at the top of their head that holds water, if they lose this water they lose their abilities.
      You can see them in tons of video games, the one that comes to mind is _Sakuna: of rice and ruins_ (great game).
      The art is made by Boskoop (link to their stuff in the description).
      It does look like multiple animals though, with the duck bill and turtle shell

    • @3v1l73ddy
      @3v1l73ddy Рік тому +8

      @@uselessgamedev Oh that's super cool! I've heard of the Kappa before, should've thought of that hahah

    • @psykbryt2096
      @psykbryt2096 Рік тому +3

      @@uselessgamedev Oh wow, I always thought they looked like the ones from Heroes of Might and Magic 6, with a bowl of water for a head.

    • @uselessgamedev
      @uselessgamedev  Рік тому +6

      @@psykbryt2096 yeah I guess it's open for interpretation, I like the ones in Sakuna, the one in Monster Prom (who is also called Leonard) is cute too

    • @threemr01
      @threemr01 Рік тому +1

      @@uselessgamedev now the name of the speakers on the theremin video makes sense!! Thanks for the explanation.

  • @mkks4559
    @mkks4559 Рік тому +7

    After seeing this video, I felt like I finally understood how to play Minesweeper, so I tried playing it, and thanks to you, I lost again! I was given false hope that I may finally win. It's probably because I'm playing very late at night though (it's not but I like to live in denial).

  • @jnjsorr
    @jnjsorr Рік тому +18

    Keep up the good work dude. High quality and interesting content will always get noticed sooner or later.

    • @uselessgamedev
      @uselessgamedev  Рік тому +3

      Thank you very much. The channel does get a lot more notice (views, subs, impressions...) with every video according to the analytics page, so we're getting there!

  • @orad3093
    @orad3093 Рік тому +28

    The revenge series seems quite interesting, keep at it!

    • @uselessgamedev
      @uselessgamedev  Рік тому +5

      Thanks! I have multiple video ideas lined up for this series, so this should be fun

  • @clownkid
    @clownkid Рік тому +17

    Wow, I've seen people lots of people recreate games to create neural networks to solve them - and I had no idea you could use Unity to parse the information on your monitor!
    Awesome channel, I winded up binge watching all of your videos! :P

  • @gabrielaportillo299
    @gabrielaportillo299 Рік тому

    honestly I love the way your videos sound. I love the music and the sound effects.

  • @Pixelarity64
    @Pixelarity64 Рік тому +1

    This is exactly the content I'm looking for! Yours was a very quick subscription. 😊

  • @liambenson5339
    @liambenson5339 Рік тому +1

    Dude, it was so funny when you put the glasses on your character! Your character looks really cool!

    • @uselessgamedev
      @uselessgamedev  Рік тому +1

      Thank you it was designed by my friend Boskoop (@EdwigeStoll on twitter), they chose a kappa because these creatures have a bald spot and so do I

  • @minorseven8134
    @minorseven8134 Рік тому

    I like that idea of getting back to a "problem" that has haunted you for years... now equipped with the skills to beat the hell out of it ^^
    Impressive result and I really like how you design and voice-over your videos, very casual, cool and easy to follow.
    You earned yourself another sub (*1-up noise*)

  • @lemonlordminecraft
    @lemonlordminecraft Рік тому

    This channel appears to be blowing up. As I slowly go through their backlog I am watching as their sub count steadily goes up by significant proportions of what it was an hour ago. Well-deserved!

    • @uselessgamedev
      @uselessgamedev  Рік тому +1

      Thank you! Yeah it's getting significant growth for three days and it seems to be accelerating still. I'm blown away by the awesome response and encouraging comments

  • @nunosantiago6720
    @nunosantiago6720 Рік тому

    Excelent work, as usual. Leonard, you have very cool ideas for game dev videos. Ths is another winner.

  • @teok9964
    @teok9964 Рік тому

    I'm looking forward to more of your videos! Super interesting stuff, and very entertaining. Love it!

  • @awdk7994
    @awdk7994 Рік тому +4

    Bro you are super underated

  • @calvinhirschler5876
    @calvinhirschler5876 Рік тому +1

    Very cool! I know pros on minesweeper always start in the corner. Perhaps making your solver do that would increase the win rate percentage

    • @uselessgamedev
      @uselessgamedev  Рік тому +1

      Good idea I was planning on testing each starting position with say 1000 games each to get stats on the "best" opening moves but never got around to it. Maybe another day

  • @trk.s7570
    @trk.s7570 Рік тому +3

    liked your content man you should be 100k soon , TRUST ME YOU GONNA BE 100K SUBS SOON (i liked eva's content she became a star then violet's , sweetie fox's sameeee im kinda part-time star founder trust me) BUT producing speed should improved

    • @uselessgamedev
      @uselessgamedev  Рік тому +2

      Thank you for putting this channel on the 100K tracks then! Producing speed should improve in 2023 (job change, more free time, etc) and I'm getting the hang of video editing so I hope I can get more videos out soon

  • @konstantinosadamopoulos9918
    @konstantinosadamopoulos9918 Рік тому +4

    I love your avatar!!!

    • @uselessgamedev
      @uselessgamedev  Рік тому +3

      Thanks, the artist is Edwige "Boskoop" Stoll, you can check them out on Instagram a/o Twitter!

  • @KatHarpy
    @KatHarpy Рік тому

    this is giving me the worst flashbacks to when I had to code an entire game of minesweeper with only strings for a project

    • @uselessgamedev
      @uselessgamedev  Рік тому

      With only strings 🤔 can you elaborate? I'm intrigued, this sounds very... "useless" game dev ;)

    • @KatHarpy
      @KatHarpy Рік тому

      @@uselessgamedev Like basically it just ran in the terminal off of recursion and conditionals. the entire board was just printed arrays. it was hell

  • @moadot720
    @moadot720 Рік тому +1

    0:08 You can't be older than me without a fight!

  • @RugnirSvenstarr
    @RugnirSvenstarr Рік тому +1

    Pulling this through unity is a quite unusual approach haha. But hey it works, and not too slow

  • @AndriusKamarauskas
    @AndriusKamarauskas Рік тому +2

    Funny comment for google algorythm

  • @Haguynitzan
    @Haguynitzan Рік тому +1

    I love your content! Remember me when you get famous (:

  • @scorix_
    @scorix_ Рік тому

    I think your probability function assigns undiscovered tiles with surrounding neighbours that are also undiscovered the wrong value.
    In my understanding, it is always better to choose a tile at the edge of discovered tiles rather than somewhere in the mist.
    I would set every tile that is surrounded by neighbours not-discovered to a 100% probability of hitting a mine.

    • @uselessgamedev
      @uselessgamedev  Рік тому

      You might think that but by playing I found myself quite often in a situation where the most appealing tile is not at the border of the discovered area. Especially when the discovered area is approaching the edges of the board.
      Your suggestion might speed up calculation though it still has merits, it's hard to find the good speed/risk balance

    • @scorix_
      @scorix_ Рік тому

      @@uselessgamedev hm, interesting. This might even need more research data.
      I am just thinking out loud here, but maybe considering how many mines are still non-flagged is also a metric you could consider when evaluating tiles in undiscovered areas.
      Great extra loop you took though, not choosing to programm your own game btw!

  • @hexdump8590
    @hexdump8590 Рік тому

    You got a new subscriber and fan :)

  • @SkippyDa
    @SkippyDa Рік тому

    There is a trick in minesweeper, if you place a flag, and then left+right click on a number, and the correct number of flags are present, it will automatically click the ones that it can't be. Doubt it would improve speed a lot

    • @uselessgamedev
      @uselessgamedev  Рік тому +1

      I do this, I implemented it when the time between clicks was about .5s it did help a lot, but as I optimized it and it when to 300 clicks a second, it ended up making a negligible difference

  • @easyBob100
    @easyBob100 Рік тому

    You could simplify the number checker thingie (2:49) by simply checking a single pixel (or two) color values.

    • @uselessgamedev
      @uselessgamedev  Рік тому +1

      I thought about doing that, sampling the few pixels that are determining, probably the center ones, but II was afraid there would be streaming artefacts, like some anti-aliasing stuff, and ended up sampling the whole tile. I tried to keep the kernel as small as possible though!

  • @Yipper64
    @Yipper64 Рік тому +1

    oh I didnt know Unity could do this type of thing... I dont know *how* but now that I know its possible I want to attempt to make my own AI for games. I have a way to get the gameplay of my nintendo switch into my computer, and controller input from my computer into my switch, so... I could?

    • @uselessgamedev
      @uselessgamedev  Рік тому +1

      Yeah, I guess! Go for it, people might be interested. I definitely would be

  • @Ballman404
    @Ballman404 Рік тому +3

    Good vid

  • @yaim0310
    @yaim0310 Рік тому

    I've want to learn how to do something like this as well. Do you think you can give a hint on how you got unity to see the Minesweeper window?

    • @uselessgamedev
      @uselessgamedev  Рік тому

      Sure! I used OBS to stream to Unity via the "virtual webcam" feature. Unity just reads the "webcam" as a texture.
      I wanted to make this video a while ago but had to wait until a bug was fixed in Unity, it couldn't read the virtual webcam properly.

  • @Teemsploit
    @Teemsploit Рік тому +2

    couldn't you use threading to get it to do multiple tasks at once to make it faster?

    • @uselessgamedev
      @uselessgamedev  Рік тому +2

      Yes, no, kinda. The solving strategy could indeed be multithreaded but doesn't take took much time in the end (10%) compared to asking the video stream for an image of the board (50%) and asking Windows to move the mouse and click (25%). And both of these are out of my control (except maybe lowering the resolution of the incoming image, which would drastically improve performance but I'm afraid I'd get parsing errors then)

    • @RyleeFerguson-vx7ti
      @RyleeFerguson-vx7ti Рік тому +3

      @@uselessgamedev Unsure if you're doing it already but what about skipping the identification of cells you've already seen (not hidden), clicked or flagged? Yes you still need to capture the whole image, but after splitting you could skip over certain cells so that you don't need to do any further image processing (padding, removing grey, average color, etc.)

    • @uselessgamedev
      @uselessgamedev  Рік тому +3

      Yes that would be faster, however something I don't mention in the video is that the solver is stateless, meaning it doesn't keep track of previous states of the board, every round is a fresh start. This allows to resume any game from any point, or suggest the next move to a human who asks for help. Both features were implemented but didn't make it in the final video because I didn't deem them interesting enough.
      So yeah in the end the whole board is parsed at every round, might not be optimal tho.

  • @NewbieIndieGameDev
    @NewbieIndieGameDev Рік тому

    Take that, you cocky smiley face... Great video! 🙌

  • @termisher5676
    @termisher5676 Рік тому

    You could make it even faster and more accurate by special formulas to calculate highest chance of it existing

    • @uselessgamedev
      @uselessgamedev  Рік тому

      Can you elaborate on what those special formulas are?

    • @termisher5676
      @termisher5676 Рік тому

      @@uselessgamedev ua-cam.com/video/cGUHehFGqBc/v-deo.html

    • @uselessgamedev
      @uselessgamedev  Рік тому

      Yes this is the same approach I take. I actually looked at their code in detail when I got stuck developing mine, but in the end the video by Merrick Huang in the description is what really unlocked this.
      As stated this doesn't make it faster (more processing is needed) but it does make it more accurate

  • @lucbloom
    @lucbloom Рік тому +1

    I thought Minesweeper was a solvable puzzle, like Solitaire or Sudoku. Apparently it comes down to luck at one point. Shame.
    I wonder what the least invasive rule would be to make it a solvable puzzle. I guess generating “always logically solvable” grids is a cool programming exercise, but maybe also adding a rule like this:
    Add an arrow on a tentative tile, which points in the average direction of all mines. -1 or 1 per grid offset, divided by number of mines. If it’s 0,0 add a dot.
    That might be an interesting game mode. Would it help?

    • @uselessgamedev
      @uselessgamedev  Рік тому

      Yeah I was kinda shocked to learn the top players win about 55/100 games, I didn't think it would be this random. I'm not sure adding rules to make it more deterministic would help. I like the simplicity of it

  • @jordanrozum
    @jordanrozum Рік тому

    Why right click if it's keeping track of where the mines are in the internal representation? It's been a while since I've played this version, but I thought you can still win even if you don't use flags.

    • @uselessgamedev
      @uselessgamedev  Рік тому +1

      Yes, you could keep a state in memory tracking where the mines where.
      What I didn't mention in the video because it was getting too long, is that I wanted this solver to be stateless, as in, able to resume any game from any point.

  • @operator8014
    @operator8014 Рік тому

    Couldn't you check the exact color value of certain pixels in each square to instantly diferentiate between all different square states? A 7 and a bomb may be the same color, but they are not the same shape, so polling a handful of control pixels per square should perfectly identify each squares state. I would expect that to be faster than the process you described. I bet you could optimize that to get it below 1 second.

    • @uselessgamedev
      @uselessgamedev  Рік тому

      In theory I could but I was scared of streaming artifact in the video that would result in slightly different hues so I decided to sample the whole square every time to get an average value which I though to be more reliable

  • @jaumerovirabaurier2119
    @jaumerovirabaurier2119 Рік тому

    did you kow that if you click a number that has all mines marked it auto completes the rest?

    • @jaumerovirabaurier2119
      @jaumerovirabaurier2119 Рік тому

      coud have saved some lines of code

    • @uselessgamedev
      @uselessgamedev  Рік тому +1

      Yes if you click with both buttons. It does that actually, I added the functionality when it was still super slow to save some time, but now it goes so fast that it wouldn't make a difference

  • @chffguy
    @chffguy Рік тому

    What programming language do you write in?
    I code in Python, so I don't know if you write in Javascript, C, C++, C#, or something else.

    • @uselessgamedev
      @uselessgamedev  Рік тому

      This is C#, it's the language used in the Unity engine

    • @chffguy
      @chffguy Рік тому

      @@uselessgamedev Thanks, didn't know unity worked explicitly on C#.

  • @ShadowDrakken
    @ShadowDrakken Рік тому

    Are the top solvers under a time limit? 55% seems really low... I'll have to track my win/loss and times now...

    • @uselessgamedev
      @uselessgamedev  Рік тому

      Top human players* it may be unclear in the video

    • @ShadowDrakken
      @ShadowDrakken Рік тому

      @@uselessgamedev no, I understand that. But I feel like I win a lot more than that; so I need to start logging to eliminate my bias :)

  • @amadimus
    @amadimus Рік тому +1

    Did you know you can click both mouse buttons on a solved cell to reveal all the remaining non-mine neighbours instead of clicking each cell one by one?

    • @uselessgamedev
      @uselessgamedev  Рік тому +1

      Yes, it does that. But at this speed it doesn't make much of a difference. I intended to talk about this (and other details) but it didn't make it into the final cut

  • @quandale8707
    @quandale8707 Рік тому

    cant you check the radius and ignore the stuff we already know arent mines and see if the radius overlaps

    • @uselessgamedev
      @uselessgamedev  Рік тому

      I'm not sure I follow, what radius are you referencing?

    • @quandale8707
      @quandale8707 Рік тому

      @@uselessgamedev i mean the immidiete neighbors

  • @nevernether3368
    @nevernether3368 Рік тому

    My best time is 54 seconds. Im proud XD

    • @uselessgamedev
      @uselessgamedev  Рік тому +1

      Woah that's crazy! After months of playing my best time was like 125s and I felt I was at the top of my abilities.
      Of course now my best time is 7s 😎

    • @nevernether3368
      @nevernether3368 Рік тому

      @@uselessgamedev I got my family playing to. My little brother did like 50s.

  • @HugoBDesigner
    @HugoBDesigner Рік тому

    Microsoft's Minesweeper is a disgrace! Relying on luck to win a game that is otherwise completely logic-driven is terrible, so I've resorted to only ever playing Simon Tatham's Minesweeper. It's 100% reliable and logically solvable, there is never a point where randomly clicking a tile is the _only_ viable option :)

    • @uselessgamedev
      @uselessgamedev  Рік тому +2

      Where's the thrill then? I feel like Minesweeper, even if simple and abstract, is good at making you feel like you're an actual minesweeper risking your life you know what I mean. If I wanted deterministic logic games I'd play something like Sudoku

    • @HugoBDesigner
      @HugoBDesigner Рік тому +1

      @@uselessgamedev That's a fair interpretation! I just really like logic games is all :P
      Btw, great video! Very insightful and entertaining 😁

    • @uselessgamedev
      @uselessgamedev  Рік тому +1

      @@HugoBDesigner thank you!