Great game, I love it! I hope the author is collecting juicy analytics. They would be useful if they ever want to bundle 100 levels in order of difficulty and release this as a Steam game (which I would absolutely buy!)
I don’t think the gates should animate up into the air. It breaks the visual logic of 2D for no benefit. It’s subconsciously confusing to see a gate I place in one cell move to occupy pixels in the cell “above” it.
I look forward to future days introducing new mechanics as well. Can I suggest a few, based on dynamics?
- Food! The horse moves on every turn towards an attractor. Have a hay bale / giant sugar cube in one corner fall off the back of a truck / helicopter :) Horses start out dumb and move directly towards the goal before backtracking. Smarter horses path find the shortest route to the goal.
- Goals! Now that the horse is moving, get the horse into a static horse box / cattle pen cell by strategically placing fences so that the path it takes towards the food involves walking onto the goal square.
- Floods! Water encroaches from the edges on a turn by turn basis. Not only do you have to contain the horse, you also have to hold back the flood.
There is definitely a turn-based minigame here - get the most "distance" travelled by the horse, every turn the horse moves one block towards it's closest escape and you can drop walls to cause it to find a new path - in this one you actually lose when the horse can't get out but the goal is to get the horse to move as many blocks as possible using your limited number of walls (or apples which can attract it).
> I don’t think the gates should animate up into the air. It breaks the visual logic of 2D for no benefit. It’s subconsciously confusing to see a gate I place in one cell move to occupy pixels in the cell “above” it.
I interpreted it as standard "top-down" RPG graphics, where the Y axis always doubles as the Z axis. As such, I didn't find it visually confusing - but it did made playing on mobile annoying, because you often end up targeting the wrong field.
> I don’t think the gates should animate up into the air.
I think it should go up, otherwise it doesn't look like a wall. It would look like something the horse can step on and run over. For the water it makes sense to be flat flat and that the horse doesn't want to touch it: it is water-shy.
Sometimes simple things are best. I really like the game as-is.
This is a rather simple game to program. IMO, if you can program, take a few weekends to make your own game based on your ideas. If you can't program, your ideas will lead you to a wonderful learning project.
I would have responded earlier, but I wanted to actually implement something you suggested: different walls. Alternative wall sprites, which don't occlude other tiles so much, are now live and can be adjusted in the settings.
Re: analytics, the only serious plans I had were to use the daily level histograms to adjust difficulty. The idea of taking some levels and releasing them as a standalone game is tempting, but I wonder if doing this type of puzzle over and over again might get tedious? That's one of the reasons I thought it would work better as a daily game. Let's see how it's doing in a few months.
I love the mechanic ideas. I think there are two big constraints on what kind of cool new features/gimmicks can be implemented though. First: if this is going to be a daily game, the new mechanics have to be intuitive enough to where somebody could figure them out their first time playing. I like the idea of cherries being misleading, and it's a fun troll-ish idea for a single player game, but it would be a mean trick if it were someone's first daily. (Then again, there's someone who's first Wordle game was probably MYRRH.) The other constraint is I have a solver that can guarantee the optimal solution is actually optimal. Some game mechanics might make this a lot harder, or even impossible.
Another thing to try could be to rank people in realtime instead of the one-off submission approach. I do this in https://spaceword.org (create tight crosswords using 21 letters), and I think it's quite motivating to see how you compare to others as you improve your solution. On the other hand, its a bit more taxing on the server, and then you also could not show the optimal solution.
IMO, the game is great to keep simple, but I’d like to play more levels than just daily, so could see people paying for the ability to play more, like NYT games, and could be part of a suite of game if curated daily by expert vs social curation. The blocks are small though for a small phone with big fingers.
I also wonder if making it GPL and submitting to various *NIX distros would be best. Then it may need to be standalone with random maps created by ML or similar.
> I don’t think the gates should animate up into the air. It breaks the visual logic of 2D for no benefit.
I also feel it would make more sense either for everything to be 2.5D or pure top down. Having appear / disappear animation is nice feedback to user though.
Other thing is that maybe the hitbox should change when the wall comes up. Now to remove it you need to press the grid, essentially the root of the wall. Unintuitive to me.
Thanks for the game, looking forward to when there is multiple horses or sheep to enclose.
I found the optimal solution for day 8 by hand, that was fun!
My algorithm, by hand, was as such:
1. Start with the smallest possible valid solution (1)
2. Expand slowly, and each "step" (like, moving a wall or two around to "obvious" spaces) must be a valid solution (this brings you to 40-60 score, depending on your choices, on day 8). Continue to step 3 once you can't see anything obvious.
3. Look at possible places where you could expand, but need 1 more block. You'll find one eventually.
4. See if you can spare any walls anywhere, using diagonals for example. If so, place the solution from 3 and go to 3 (repeat). If not, go to 5.
5. Count or estimate the squares gained by doing your improvement from 3. See if you can reduce your score by less than that, pessimizing your solution, to gain 1 wall. Once you've found one, go to 3.
That got me to the optimal score within 15 mins or so.
This is nice, I enjoyed it. Was a couple points off the optimal score for day 8 but when I clicked "Show optimal" I couldn't then go back to see mine to compare. Either way, stretched the brain a bit.
Only nit: fix the walls. They take up one and a half spaces so are confusing, and they're sci-fi steel with flashing red lights. Turn them into one-square-only fences. You use fences to enclose horses, not raptor walls from Jurassic Park.
This is my feedback too. Turn “show optimal” into a toggle that persists on the page and toggles between yours and the optimal.
And same about the walls. Especially on mobile it’s hard enough to tap the right square, and having a wall poking up from the square below just makes things worse.
I am curious on how you would algorithmically find the optimal solution for this kind of problem for much bigger grids.
I wanted to do some seed finding in Factorio for the same exact problem using the generated map images, but never found a good solution that was fast enough.
The site uses Answer Set Programming with the Clingo engine to compute the optimal solutions for smaller grids. Maximizing grids like this is probably NP-hard.
Note that traditional SAT and SMT solvers are quite inefficient at computing flood-fills.
The ASP specifications it uses to compute optimal solutions are surprisingly short and readable, and look like:
#const budget=11.
horse(4,4).
cell(0,0).
boundary(0,0).
cell(0,1).
boundary(0,1).
% ...truncated for brevity...
cell(3,1).
water(3,1).
% ...
% Adjacent cells (4-way connectivity)
adj(R,C, R+1,C) :- cell(R,C), cell(R+1,C).
adj(R,C, R-1,C) :- cell(R,C), cell(R-1,C).
adj(R,C, R,C+1) :- cell(R,C), cell(R,C+1).
adj(R,C, R,C-1) :- cell(R,C), cell(R,C-1).
% Walkable = not water
walkable(R,C) :- cell(R,C), not water(R,C).
% Choice: place wall on any walkable cell except horse and cherries
{ wall(R,C) } :- walkable(R,C), not horse(R,C), not cherry(R,C).
% Budget constraint (native counting - no bit-blasting!)
:- #count { R,C : wall(R,C) } > budget.
% Reachability from horse (z = enclosed/reachable cells)
z(R,C) :- horse(R,C).
z(R2,C2) :- z(R1,C1), adj(R1,C1, R2,C2), walkable(R2,C2), not wall( R2,C2).
% Horse cannot reach boundary (would escape)
:- z(R,C), boundary(R,C).
% Maximize enclosed area (cherries worth +3 bonus = 4 total)
#maximize { 4,R,C : z(R,C), cherry(R,C) ; 1,R,C : z(R,C), not cherry( R,C) }.
% Only output wall positions
#show wall/2.
> algorithmically find the optimal solution for this kind of problem for much bigger grids.
Great, now I've been double nerd-sniped - once for the thing itself and another for 'What would an optimiser for this look like? Graph cuts? SAT/SMT? [AC]SP?'
I think it's NP hard, maybe from Sparsest Cut. But you could probably find the min-cut and then iterate by adding capacity on edges in the min cut until you find a cut of the right size. (if the desired cut-size is close to the min cut size at least).
Constraint programming seems to be a fitting approach. Input would be number of walls, and the location of lakes.
The decision variables would be the positions of walls.
In order to encode the horse being enclosed, additional variables for whether horse can reach a given square can be given. Finally, constraints for reachability and that edges cannot be reached should ensure correctness.
There is a level editor with the ability to show the optimal result for a custom level. In theory, one could recreate any official level and reveal the best solution that way. However, I haven't tried this to verify any intentional roadblocks by the developer.
Hi,
I only made an account to comment on this.
First and foremost I love it, thank you!
Second, I would love to know the maximum achievable score each day!
so I don’t feel like I have to spend an infinite amount of time with it, just to make sure that my solution is the ideal. Sometimes I might already have the optimal solutions, but I still have to make sure to find the other worse ideas, just to be sure.
Hi,
First and foremost I love it, thank you!
Second, I would love to know the maximum achievable score each day!
so I don’t feel like I have to spend an infinite amount of time with it, jut to make sure that my solution is the ideal. Sometimes I might already have the optimal solutions, but I still have to make sure to find the other worse ideas, just to be sure.
I imagine you went searching for domain names and came up with this? I resisted clicking on this top story all day because I thought "how good could that be? "enclose horse" what is that?" Yet, the experience was genuine-slow-forming-smile-of-understanding. This is really good.
Cool game, but I don't like how you get only one chance. Even returning to the page, you can't try again to beat your previous score. No replayability value at all.
The one shot per day provides a reason to sink your teeth into one board.
I love Wordle but I found it unplayable when I used that Wordle archive site to play infinite games since there was no reason to think deeply about the 10th+ round I was playing in one sitting.
It shows you what the exit routes are, what your score will be, and you can move the gates around as long as you want, so the means of finding the maximum area are entirely within your grasp.
IMO they should have a (second) pop-up that warns you that you only get one submit. Not sure if it should let you know if you've made an optimal solution or not, but since it's not timed there's no cost in slowing people down. I've seen similar daily puzzles where you get to see the leaderboard and then can go back and optimize further. Yes, it says it at the beginning, but it's still easy to forget.
Nice game! Out of curiosity, are the daily levels built by hand or algorithmically? Is there some way to measure their difficulty computationally, other than just trying to do it yourself or seeing how many people get a perfect score? I'm also working on a grid-based browser game and both those questions have come up for me, I'm keen to see how other people tackle it.
All the daily levels are built by hand. I struggled to come up with a good random level generator. You can see my feeble attempts in the Edit page (via the hamburger menu) by giving the dice button a few sad clicks.
I did originally try to measure the difficulty computationally by running the solver and timing it, but it didn't really line up with what humans would find difficult. Now I'm just eyeballing it.
lots of fun! the fact that the walls spill over the square boundaries is very annoying though, i would love to have an option to just make a wall a filled in square without the 3d effect.
This is a very cool and enjoyable game. I'd be really interested in knowing what framework/library was used to make it. I inspected the source and can see the game is done on canvas, but can't work out more than that.
Looks like some people have discovered the first "accidental" game mechanic: The horse can walk over cherry fields, but the player cannot place walls on them - so if a level designer places cherries strategically, they can create unblockable paths.
Right now, this is only used for troll levels, but I wonder if you could also use it for some actual puzzles.
My 10 year old loves this game. He started playing it Wednesday or Thursday of last week and basically all of his screen time. Both trying to optimize and the level design scratch an itch that few games do
I think this problem is called the maximum-weight closure and can be solved as max flow. You want to find a cut between source (horse) so they were no out-going edges not in the cut (escape routes).
Ton of fun! Was interesting to see how my strategy evolved as well. I started out trying to make a large pen, but quickly realized that wouldn't work, so I made a small pen and then started moving it out. This allowed me to see individual optimizations and try alternatives. Even at the end, about to hit submit, I wasn't sure my solution was optimal, but ended up with the optimal sizse-86 solution for today's challenge. Will try again tomorrow!
This is surprisingly similar to a subset of the ARC II puzzles.
The collected answered could probably be used to teach an AI to approach this type of problem thereby gaining some of the cognitive biases that humans have, which is exactly what you want in some cases: An AI that generates human like solutions to hard problems .
Usability, i'd like either a 'save/restore state' button, or a 'restore current best'. Right now, experimenting after finding a solution seems like a punishment if I can't recall exactly what I did to hit my rolling 'best'. Good game though!
just vibe-coded an optimizer for this game that takes in the screenshot of the grid and the number of walls as input, and spits out the optimal wall configuration (supports cherries too!)
algorithm:
1. infer grid dimensions
2. color histogram analysis to designate grasses, water, cherries and horse
3. apply mixed-integer linear programming to determine optimized wall placements
A very fun game - it took quite a bit of fiddling to get an optimal solution using an LLM. Interesting as I haven't tried using them for 'unique' algo problems much. And then the day 9 puzzle broke my original solver (I had bounded areas that were unreachable to the horse so didn't actually score). Will be interesting to see whether the solver works on day 10.
It would be interesting to be able to change the wall budget for each puzzle to add some variation (with a max limit).
I expected the horse to move one tile for each block you placed. I had an elaborate plan to lure it towards one exit and then close it at the last minute... Nope!
Does each day's challenge come out at a certain time in your local timezone? I have a friend who is seeing day 9 when I can only see day 8. I'd request having new daily maps come out at a consistent global time for the purpose of competing with friends who live in different timezones.
I love this! Would you consider adding a settle to toggle the animations off? When I'm staring at it to figure it out the animations are a bit distracting!
Nice puzzle! But I'd like a button to go back to your most optimal solution so far: it's tedious to try other options but then have to convert it back to your better solution again...
I didn't realize level 1 gave me 11 (eleven) walls at first. I thought it stood for II = roman 2. Maybe use a font that makes the difference between 1 and I clearer.
gorgoiler|1 month ago
I don’t think the gates should animate up into the air. It breaks the visual logic of 2D for no benefit. It’s subconsciously confusing to see a gate I place in one cell move to occupy pixels in the cell “above” it.
I look forward to future days introducing new mechanics as well. Can I suggest a few, based on dynamics?
- Food! The horse moves on every turn towards an attractor. Have a hay bale / giant sugar cube in one corner fall off the back of a truck / helicopter :) Horses start out dumb and move directly towards the goal before backtracking. Smarter horses path find the shortest route to the goal.
- Goals! Now that the horse is moving, get the horse into a static horse box / cattle pen cell by strategically placing fences so that the path it takes towards the food involves walking onto the goal square.
- Floods! Water encroaches from the edges on a turn by turn basis. Not only do you have to contain the horse, you also have to hold back the flood.
anticorporate|1 month ago
I hope they're not. Can't we have a few things in this world that are just fun without going and sticking surveillance on them?
emregucerr|1 month ago
I agree! It feels off compared to the overall aesthetic of the game.
Awesome game though! Loved it.
tgtweak|1 month ago
xg15|1 month ago
I interpreted it as standard "top-down" RPG graphics, where the Y axis always doubles as the Z axis. As such, I didn't find it visually confusing - but it did made playing on mobile annoying, because you often end up targeting the wrong field.
cubefox|1 month ago
I think it should go up, otherwise it doesn't look like a wall. It would look like something the horse can step on and run over. For the water it makes sense to be flat flat and that the horse doesn't want to touch it: it is water-shy.
gwbas1c|1 month ago
This is a rather simple game to program. IMO, if you can program, take a few weekends to make your own game based on your ideas. If you can't program, your ideas will lead you to a wonderful learning project.
the_shivers|1 month ago
I would have responded earlier, but I wanted to actually implement something you suggested: different walls. Alternative wall sprites, which don't occlude other tiles so much, are now live and can be adjusted in the settings.
Re: analytics, the only serious plans I had were to use the daily level histograms to adjust difficulty. The idea of taking some levels and releasing them as a standalone game is tempting, but I wonder if doing this type of puzzle over and over again might get tedious? That's one of the reasons I thought it would work better as a daily game. Let's see how it's doing in a few months.
I love the mechanic ideas. I think there are two big constraints on what kind of cool new features/gimmicks can be implemented though. First: if this is going to be a daily game, the new mechanics have to be intuitive enough to where somebody could figure them out their first time playing. I like the idea of cherries being misleading, and it's a fun troll-ish idea for a single player game, but it would be a mean trick if it were someone's first daily. (Then again, there's someone who's first Wordle game was probably MYRRH.) The other constraint is I have a solver that can guarantee the optimal solution is actually optimal. Some game mechanics might make this a lot harder, or even impossible.
oliwary|1 month ago
doctordoctor2|1 month ago
I also wonder if making it GPL and submitting to various *NIX distros would be best. Then it may need to be standalone with random maps created by ML or similar.
banannaise|1 month ago
1. lure the horse to an optimal point on the map.
2. trap it in a small circle of fences.
3. build part of your final wall with the remaining fences.
4. one by one, move the fences trapping the horse in place into position.
plastic3169|1 month ago
> I don’t think the gates should animate up into the air. It breaks the visual logic of 2D for no benefit.
I also feel it would make more sense either for everything to be 2.5D or pure top down. Having appear / disappear animation is nice feedback to user though.
Other thing is that maybe the hitbox should change when the wall comes up. Now to remove it you need to press the grid, essentially the root of the wall. Unintuitive to me.
Thanks for the game, looking forward to when there is multiple horses or sheep to enclose.
xg15|1 month ago
(jk)
lionkor|1 month ago
My algorithm, by hand, was as such:
1. Start with the smallest possible valid solution (1)
2. Expand slowly, and each "step" (like, moving a wall or two around to "obvious" spaces) must be a valid solution (this brings you to 40-60 score, depending on your choices, on day 8). Continue to step 3 once you can't see anything obvious.
3. Look at possible places where you could expand, but need 1 more block. You'll find one eventually.
4. See if you can spare any walls anywhere, using diagonals for example. If so, place the solution from 3 and go to 3 (repeat). If not, go to 5.
5. Count or estimate the squares gained by doing your improvement from 3. See if you can reduce your score by less than that, pessimizing your solution, to gain 1 wall. Once you've found one, go to 3.
That got me to the optimal score within 15 mins or so.
sambuccid|1 month ago
ChrisbyMe|1 month ago
Very fun game
adonovan|1 month ago
gwern|1 month ago
layer8|1 month ago
tetris11|1 month ago
MildlySerious|1 month ago
Reference[1] for anyone wondering.
[1] https://xkcd.com/936/
scrumper|1 month ago
Only nit: fix the walls. They take up one and a half spaces so are confusing, and they're sci-fi steel with flashing red lights. Turn them into one-square-only fences. You use fences to enclose horses, not raptor walls from Jurassic Park.
xp84|1 month ago
And same about the walls. Especially on mobile it’s hard enough to tap the right square, and having a wall poking up from the square below just makes things worse.
But overall I love the game!
Groxx|1 month ago
I did figure out that you can get back to yours by going through the past-days menu though.
the_shivers|1 month ago
xg15|1 month ago
rhymemini|1 month ago
ronbenton|1 month ago
snackdex|1 month ago
kanemcgrath|1 month ago
Scaevolus|1 month ago
Note that traditional SAT and SMT solvers are quite inefficient at computing flood-fills.
The ASP specifications it uses to compute optimal solutions are surprisingly short and readable, and look like:
sunrunner|1 month ago
Great, now I've been double nerd-sniped - once for the thing itself and another for 'What would an optimiser for this look like? Graph cuts? SAT/SMT? [AC]SP?'
johanvts|1 month ago
Zobody|1 month ago
emil-lp|1 month ago
https://cs.stackexchange.com/questions/176005/how-to-remove-...
unknown|1 month ago
[deleted]
qwertyforce|1 month ago
emil-lp|1 month ago
unknown|1 month ago
[deleted]
savolai|1 month ago
zimpenfish|1 month ago
the_shivers|1 month ago
merelysounds|1 month ago
I took a screenshot of my solution and the optimal one - and then I could compare like this.
langarus|1 month ago
1. Do a screenshot of the grid (try to include walls as well)
2. Open https://enclosure-horse-solution.onrender.com/
3. Make sure the number of walls are correct in the input (bottom left)
4. Press "Solve"
PS: It might crash as it's on the free version of render. I've added a caching layer.
Here's the github so you can run it locally:
https://github.com/langarus/enclosure.horse-solution
clone it and run
make init // make web
g4zj|1 month ago
ronbenton|1 month ago
langarus|1 month ago
Arubis|1 month ago
ZeWaka|1 month ago
blablabla555|1 month ago
roskelld|1 month ago
https://enclose.horse Day 8 PERFECT! 100%
zimpenfish|1 month ago
[0] I'm assuming, possibly quite wrongly, that there's only one optimal solution per day.
blablabla555|1 month ago
lukebechtel|1 month ago
hk__2|1 month ago
sneak|1 month ago
keepamovin|1 month ago
ryandrake|1 month ago
hombre_fatal|1 month ago
I love Wordle but I found it unplayable when I used that Wordle archive site to play infinite games since there was no reason to think deeply about the 10th+ round I was playing in one sitting.
anigbrowl|1 month ago
MrGilbert|1 month ago
gs17|1 month ago
geoffschmidt|1 month ago
matsemann|1 month ago
QuantumNomad_|1 month ago
zwnow|1 month ago
goodmatt|1 month ago
klohto|1 month ago
n4r9|1 month ago
the_shivers|1 month ago
I did originally try to measure the difficulty computationally by running the solver and timing it, but it didn't really line up with what humans would find difficult. Now I'm just eyeballing it.
pests|1 month ago
zem|1 month ago
rob001|1 month ago
Retr0id|1 month ago
daneel_w|1 month ago
the_shivers|1 month ago
xg15|1 month ago
Right now, this is only used for troll levels, but I wonder if you could also use it for some actual puzzles.
Majromax|1 month ago
arthurjj|1 month ago
nickponline|1 month ago
emil-lp|1 month ago
zachallaun|1 month ago
dvh|1 month ago
Ah the famous spherical horse in vacuum
niemandhier|1 month ago
The collected answered could probably be used to teach an AI to approach this type of problem thereby gaining some of the cognitive biases that humans have, which is exactly what you want in some cases: An AI that generates human like solutions to hard problems .
DonThomasitos|1 month ago
komodo99|1 month ago
abetusk|1 month ago
xg15|1 month ago
dyigitpolat|1 month ago
algorithm:
1. infer grid dimensions
2. color histogram analysis to designate grasses, water, cherries and horse
3. apply mixed-integer linear programming to determine optimized wall placements
4. profit!
try: https://dyigitpolat.github.io/enclose-horse-solver
source: https://github.com/dyigitpolat/enclose-horse-solver
grugdev42|1 month ago
Doesn't feel outrageously difficult to put inside a webview?
naedish|1 month ago
It would be interesting to be able to change the wall budget for each puzzle to add some variation (with a max limit).
DuncanCoffee|1 month ago
https://enclose.horse Day 8 PERFECT! 100%
roskelld|1 month ago
Removing a block was a bit fiddly on FireFox (Floorp) due to the right click menu appearing when I tried to click on a tile.
Looking forward to tomorrows!
porphyra|1 month ago
fwipsy|1 month ago
Biganon|1 month ago
https://en.wikipedia.org/wiki/Angel_problem
zimpenfish|1 month ago
divbzero|1 month ago
hotsalad|1 month ago
the_shivers|1 month ago
genekwame|1 month ago
unknown|1 month ago
[deleted]
sublinear|1 month ago
I didn't initially expect it would be a problem, but the constant squiggly movement gets very annoying.
milperks|1 month ago
unknown|1 month ago
[deleted]
Aardwolf|1 month ago
xp84|1 month ago
alexjplant|1 month ago
[1] https://enclose.horse/play/44wCCO
athrowaway3z|1 month ago
I'd even go so far as to deny any submission with more than sqrt(size) walls.
croemer|1 month ago
DougN7|1 month ago
SteveJS|1 month ago
atticus_|1 month ago
nirolo|1 month ago
sandyarmstrong|1 month ago
the_shivers|1 month ago
29athrowaway|1 month ago
abhi555shek|1 month ago
wseqyrku|1 month ago
g0ran|1 month ago
omgmajk|1 month ago
Great stuff :)
MagicMoonlight|1 month ago
eithed|1 month ago
wirtzdan|1 month ago
I wonder how the wiggle animation is implemented in for the buttons and modal.
Lammy|1 month ago
curioussquirrel|1 month ago
godisdad|1 month ago
sambuccid|1 month ago
theo1996|1 month ago
pests|1 month ago
valleyer|1 month ago
posed|1 month ago
Narushia|1 month ago
menzoic|1 month ago
falloutx|1 month ago
jerbearito|1 month ago
genekwame|1 month ago
soccercerer|1 month ago
[deleted]
maximgeorge|1 month ago
[deleted]
zwaps|1 month ago