Cheese Hunter¯\_(ツ)_/¯
Controls:
- Arrow keys to move
- Click an unvisited cell to mark or unmark it
- Click a visited cell to teleport to it
- Hold Enter to explore automatically
- Hold Space to backtrack or advance to the next maze if you've found the cheese
- Escape to return to title screen
Planned features:
1031.237 days ago
Mar 29, 2018 - 1:33 AM
1031.231 days ago
Mar 29, 2018 - 1:41 AM
Nice. >:]
Increased maze size and added blue bread crumbs.
1031.219 days ago
Mar 29, 2018 - 1:58 AM
I finished one but wait- there's more! What is this more? New maze? ohhhhhhhh coool I will spend hours here.
1031.052 days ago
Mar 29, 2018 - 5:59 AM
later, I already finished two
1030.733 days ago
Mar 29, 2018 - 1:39 PM
I think my favorite part is how when you finish it looks like a lighting strike.
1030.249 days ago
Mar 30, 2018 - 1:15 AM
I found that interesting as well. The maze generation is a randomized version of
Prim's algorithm, which is used to construct a tree that touches every node in a graph (this tree is called a spanning tree). The lightning pattern emerges because you're exploring a subset of that tree.
1030.233 days ago
Mar 30, 2018 - 1:38 AM
I feel like a little white lab rat
1030.186 days ago
Mar 30, 2018 - 2:46 AM
Would it be possible to allow you to set markers for key points you want to reach?
Also, could you allow a click on your backtrail to re-start from there? Re-tracing a long wrong branch gets tedious.
1029.192 days ago
Mar 31, 2018 - 2:38 AM
There's a new version in the oven (compiler queue), but mouse events aren't working, so instead you'll be able to hold spacebar to zip back to the start, Oil's Well style.
Blake, I think the Event constructor in the TwoCans SDK is bugged:
class Event {
field type;
field down;
field up;
field button;
field key;
field x;
field y;
constructor(type, key, button, x, y, down) {
this.down = down;
this.up = !down;
this.key = key;
this.button = button;
this.x = x;
this.y = y;
}
}
Missing "this.type = type;"
1029.007 days ago
Mar 31, 2018 - 7:04 AM
Type is indeed missing, although I found it under my couch. I'll put it back where it belongs tonight.
1028.927 days ago
Mar 31, 2018 - 8:58 AM
Fixed. I uploaded a new version of the SDK.
1028.747 days ago
Mar 31, 2018 - 1:18 PM
It looks like events accumulate infinitely now instead of being cleared after each update. I think you need to move
keyEvents = [];
mouseEvents = [];
gamepadEvents = [];
menuEvents = [];
into the infinite loop.
1028.399 days ago
Mar 31, 2018 - 9:39 PM
Blake, how come this don't draw me a mouse?
import Graphics2D;
import ImageResources;
import TwoCansAlpha1;
class MainScene : AbstractScene {
field mainLayer;
field mouseImage;
constructor() : base() {
this.addLayer(new SolidColorLayer(Color.LIGHT_GRAY));
this.mainLayer = this.addLayer(new GraphicsLayer());
imageSheet = ImageSheet.loadFromResources("twocans_everything");
this.mouseImage = GraphicsTexture.load(imageSheet.getImage("mouse.png"));
}
function update(inputManager, events) {
}
function render() {
this.mouseImage.draw(0, 0);
}
}
1028.207 days ago
Apr 1, 2018 - 2:15 AM
Because it's all broken. Brokeeeeeeeen! But I fixed it a couple minutes ago. Redownload the new SDK.
All image sheet stuff is automatically handled by the SDK. Use Images.get(path) for getting a reference to images. Direct Graphics2D access isn't (supposed to be) available yet.
1028.16 days ago
Apr 1, 2018 - 3:23 AM
1027.628 days ago
Apr 1, 2018 - 4:10 PM
Wow, that was a nice solution path. Right along the diagonal!
Update:
- Hold Enter to automatically explore the maze
- Hold Space to scurry home
- Pressing Space while on the cheese restarts with a new maze
- Click somewhere you've been to teleport there
- Click somewhere you haven't been to toggle its marker
- Sick graphics
1027.571 days ago
Apr 1, 2018 - 5:31 PM
Actually, after doing a couple more "perfect" solves in a row I kind of figured out a trick that leveraged the fact that it's a purely randomly generated spanning tree.
Spoiler text below. Highlight to read.
The generation process will always be denser towards the origin. Branches will generally go outward. There are very few correct branches that go towards the origin. Because you're going up and to the right, all branches after a few squares, will tend to go up and to the right (it looks like lightning). This does not help the decision process when moving from the origin to the cheese. However, if you look at the cheese and search for a path to the origin, branch points will either move away from the origin or towards it. Choosing the one that tends towards the origin is correct 95% of the time and you can trace backwards through the whole maze in a matter of about 10 seconds. When you get to a point where you can see the clear path between your current point you're looking and the location of the mouse, move the mouse along the path until you forget the solution path, and then repeat the process. After a couple of tries, I could do this in about 3 passes and solve it in about 30 seconds.
Possible optimization to the generation process to negate this method:
- in a first pass, choose about a dozen points randomly scattered through the screen.
- create the solution path that winds through these points. Very windy. All sorts of directions.
- Create some number of branches off this path using the existing algorithm.
1027.314 days ago
Apr 1, 2018 - 11:41 PM
1027.013 days ago
Apr 2, 2018 - 6:55 AM
I approve.
This was the best I could doFeature requests!
- When encountering a dead end (or when a 3-walled dead end can be seen from the mouse's current position) that tile changes color to dark blue and the route back continues to change to dark blue until you get to the last branch.
- More branches? It felt like there are now longer stretches of decision-free paths.
- Night mode: you can only see within a 10 square radius.
1027.001 days ago
Apr 2, 2018 - 7:12 AM
I was actually already planning this!
When encountering a dead end...
Done (in queue)!
...or when a 3-walled dead end can be seen...
Harder... maybe later. Would be especially useful in night mode.
I've been reading through
this incredible site. There's a whole zoo of maze types and generation algorithms. The first generator I used was simplified Prim's, and the current is a recursive backtracker. There are tradeoffs for every type. I could probably increase the branching of the recursive backtracker by occasionally popping the stack even if a dead end hasn't been reached yet.
I'm planning to add a menu where you choose the maze type and size - and vision radius!
1026.923 days ago
Apr 2, 2018 - 9:05 AM
I think I found a Cheat! IDK tho
- Highlight to read.
Pressenterandholditdown.
1026.223 days ago
Apr 3, 2018 - 1:52 AM
Hold Enter to automatically explore the maze
Feature. It always just takes each branch from left to right.
1026.159 days ago
Apr 3, 2018 - 3:24 AM
New features:
- Title screen with maze type and size options
- New maze type: laboratory (uses recursive subdivision algorithm)
- Dead ends are now marked when they are in your line of sight, instead of only when you visit them
- Can now move by holding arrow keys (nice for corridors)
1013.038 days ago
Apr 16, 2018 - 6:18 AM
Painted the entire large board with blue bread crumbs that for some reason turned orange when I collected the cheese.
1004.696 days ago
Apr 24, 2018 - 2:32 PM
{
"thread_id": "10054",
"posts": [
{
"id": "978522",
"time": "1522287198",
"html": "<a href=\"https://twocansandstring.com/games/cheesehunter\">Cheese Hunter</a><br /><br />\u00af\\_(\u30c4)_/\u00af<br /><br />Controls:<br /><ul><li> Arrow keys to move</li><li> Click an unvisited cell to mark or unmark it</li><li> Click a visited cell to teleport to it</li><li> Hold Enter to explore automatically</li><li> Hold Space to backtrack or advance to the next maze if you've found the cheese</li><li> Escape to return to title screen</li></ul><br />Planned features:<br /><ul><li> Timed mode</li></ul>",
"user": "hydrogen777"
},
{
"id": "978526",
"time": "1522287708",
"html": "Already addicted... >.>",
"user": "apg"
},
{
"id": "978527",
"time": "1522288695",
"html": "Nice. >:]<br /><br />Increased maze size and added blue bread crumbs.",
"user": "hydrogen777"
},
{
"id": "978542",
"time": "1522303180",
"html": "I finished one but wait- there's more! What is this more? New maze? ohhhhhhhh coool I will spend hours here.",
"user": "purplelover"
},
{
"id": "978567",
"time": "1522330742",
"html": "later, I already finished two",
"user": "angusbeef420"
},
{
"id": "978612",
"time": "1522372508",
"html": "I think my favorite part is how when you finish it looks like a lighting strike.",
"user": "ecr674"
},
{
"id": "978615",
"time": "1522373909",
"html": "I found that interesting as well. The maze generation is a randomized version of <a href=\"https://en.wikipedia.org/wiki/Prim%27s_algorithm\">Prim's algorithm</a>, which is used to construct a tree that touches every node in a graph (this tree is called a spanning tree). The lightning pattern emerges because you're exploring a subset of that tree.",
"user": "hydrogen777"
},
{
"id": "978633",
"time": "1522377966",
"html": "I feel like a little white lab rat",
"user": "purplelover"
},
{
"id": "978702",
"time": "1522463884",
"html": "Would it be possible to allow you to set markers for key points you want to reach?<br /><br />Also, could you allow a click on your backtrail to re-start from there? Re-tracing a long wrong branch gets tedious.",
"user": "diav"
},
{
"id": "978714",
"time": "1522479860",
"html": "There's a new version in the oven (compiler queue), but mouse events aren't working, so instead you'll be able to hold spacebar to zip back to the start, Oil's Well style.<br /><br />Blake, I think the Event constructor in the TwoCans SDK is bugged:<br /><br /><div style=\"text-align:left;background-color:#e8e8e8;padding:12px;-moz-border-radius:8px;border-radius:8px;font-family:"Courier New", monospace;overflow:auto;\">class Event {<br />\n field type;<br />\n field down;<br />\n field up;<br />\n field button;<br />\n field key;<br />\n field x;<br />\n field y;<br />\n<br />\n constructor(type, key, button, x, y, down) {<br />\n this.down = down;<br />\n this.up = !down;<br />\n this.key = key;<br />\n this.button = button;<br />\n this.x = x;<br />\n this.y = y;<br />\n }<br />\n}<br />\n</div><br />Missing "this.type = type;"",
"user": "hydrogen777"
},
{
"id": "978718",
"time": "1522486725",
"html": "Type is indeed missing, although I found it under my couch. I'll put it back where it belongs tonight.",
"user": "blake"
},
{
"id": "978722",
"time": "1522502288",
"html": "Fixed. I uploaded a new version of the SDK.",
"user": "blake"
},
{
"id": "978727",
"time": "1522532387",
"html": "It looks like events accumulate infinitely now instead of being cleared after each update. I think you need to move<br /><br /><div style=\"text-align:left;background-color:#e8e8e8;padding:12px;-moz-border-radius:8px;border-radius:8px;font-family:"Courier New", monospace;overflow:auto;\">keyEvents = [];<br />\nmouseEvents = [];<br />\ngamepadEvents = [];<br />\nmenuEvents = [];</div><br />into the infinite loop.",
"user": "hydrogen777"
},
{
"id": "978738",
"time": "1522548912",
"html": "Blake, how come this don't draw me a mouse?<br /><br /><div style=\"text-align:left;background-color:#e8e8e8;padding:12px;-moz-border-radius:8px;border-radius:8px;font-family:"Courier New", monospace;overflow:auto;\">import Graphics2D;<br />\nimport ImageResources;<br />\nimport TwoCansAlpha1;<br />\n<br />\nclass MainScene : AbstractScene {<br />\n field mainLayer;<br />\n<br />\n field mouseImage;<br />\n<br />\n constructor() : base() {<br />\n this.addLayer(new SolidColorLayer(Color.LIGHT_GRAY));<br />\n this.mainLayer = this.addLayer(new GraphicsLayer());<br />\n<br />\n imageSheet = ImageSheet.loadFromResources("twocans_everything");<br />\n this.mouseImage = GraphicsTexture.load(imageSheet.getImage("mouse.png"));<br />\n }<br />\n<br />\n function update(inputManager, events) {<br />\n }<br />\n<br />\n function render() {<br />\n this.mouseImage.draw(0, 0);<br />\n }<br />\n}</div>",
"user": "hydrogen777"
},
{
"id": "978741",
"time": "1522552998",
"html": "Because it's all broken. Brokeeeeeeeen! But I fixed it a couple minutes ago. Redownload the new SDK.<br /><br />All image sheet stuff is automatically handled by the SDK. Use <span style=\"font-weight:bold;\">Images.get(path)</span> for getting a reference to images. Direct Graphics2D access isn't (supposed to be) available yet.",
"user": "blake"
},
{
"id": "978772",
"time": "1522599008",
"html": "<a href=\"https://i.imgur.com/O7sqpXi.png\">I won!</a>",
"user": "blake"
},
{
"id": "978774",
"time": "1522603873",
"html": "Wow, that was a nice solution path. Right along the diagonal!<br /><br />Update:<br /><ul><li> Hold Enter to automatically explore the maze</li><li> Hold Space to scurry home</li><li> Pressing Space while on the cheese restarts with a new maze</li><li> Click somewhere you've been to teleport there</li><li> Click somewhere you haven't been to toggle its marker</li><li> Sick graphics</li></ul>",
"user": "hydrogen777"
},
{
"id": "978782",
"time": "1522626080",
"html": "Actually, after doing a couple more "perfect" solves in a row I kind of figured out a trick that leveraged the fact that it's a purely randomly generated spanning tree.<br /><br /><div style=\"color:#fff;padding:4px;border:1px solid #888;\"><div style=\"font-style:italic;color:#888;\">Spoiler text below. Highlight to read.</div><div style=\"padding:4px;border:1px solid #888;\"><br />The generation process will always be denser towards the origin. Branches will generally go outward. There are very few correct branches that go towards the origin. Because you're going up and to the right, all branches after a few squares, will tend to go up and to the right (it looks like lightning). This does not help the decision process when moving from the origin to the cheese. However, if you look at the cheese and search for a path to the origin, branch points will either move away from the origin or towards it. Choosing the one that tends towards the origin is correct 95% of the time and you can trace backwards through the whole maze in a matter of about 10 seconds. When you get to a point where you can see the clear path between your current point you're looking and the location of the mouse, move the mouse along the path until you forget the solution path, and then repeat the process. After a couple of tries, I could do this in about 3 passes and solve it in about 30 seconds. <br /><br />Possible optimization to the generation process to negate this method:<br /><ul><li> in a first pass, choose about a dozen points randomly scattered through the screen.</li><li> create the solution path that winds through these points. Very windy. All sorts of directions.</li><li> Create some number of branches off this path using the existing algorithm.</li></ul></div></div>",
"user": "blake"
},
{
"id": "978791",
"time": "1522652106",
"html": "Clever, clever...<br /><br /><a href=\"https://i.imgur.com/YBp4vnK.png\">Difficulty increased!</a>",
"user": "hydrogen777"
},
{
"id": "978792",
"time": "1522653170",
"html": "I approve.<br /><br /><a href=\"https://i.imgur.com/R1Lv1Lg.png\">This was the best I could do</a><br /><br />Feature requests!<br /><ul><li> When encountering a dead end (or when a 3-walled dead end can be seen from the mouse's current position) that tile changes color to dark blue and the route back continues to change to dark blue until you get to the last branch. </li><li> More branches? It felt like there are now longer stretches of decision-free paths.</li><li> Night mode: you can only see within a 10 square radius.</li></ul>",
"user": "blake"
},
{
"id": "978793",
"time": "1522659908",
"html": "<div style=\"margin:20px; background-image:url(/images/light.png);\"><div style=\"border:1px solid #888; padding:5px;\"><a href=\"/users/blake\">Blake</a> said:</div><div style=\"border:1px solid #888; padding:20px;\">Night mode</div></div>I was actually already planning this!<br /><div style=\"margin:20px; background-image:url(/images/light.png);\"><div style=\"border:1px solid #888; padding:5px;\"><a href=\"/users/blake\">Blake</a> said:</div><div style=\"border:1px solid #888; padding:20px;\">When encountering a dead end...</div></div>Done (in queue)!<br /><div style=\"margin:20px; background-image:url(/images/light.png);\"><div style=\"border:1px solid #888; padding:5px;\"><a href=\"/users/blake\">Blake</a> said:</div><div style=\"border:1px solid #888; padding:20px;\">...or when a 3-walled dead end can be seen...</div></div>Harder... maybe later. Would be especially useful in night mode.<br /><div style=\"margin:20px; background-image:url(/images/light.png);\"><div style=\"border:1px solid #888; padding:5px;\"><a href=\"/users/blake\">Blake</a> said:</div><div style=\"border:1px solid #888; padding:20px;\">More branches?</div></div>I've been reading through <a href=\"http://www.astrolog.org/labyrnth/algrithm.htm\">this</a> incredible site. There's a whole zoo of maze types and generation algorithms. The first generator I used was simplified Prim's, and the current is a recursive backtracker. There are tradeoffs for every type. I could probably increase the branching of the recursive backtracker by occasionally popping the stack even if a dead end hasn't been reached yet.<br /><br />I'm planning to add a menu where you choose the maze type and size - and vision radius!",
"user": "hydrogen777"
},
{
"id": "978845",
"time": "1522720369",
"html": "I think I found a Cheat! IDK tho<br /> - Highlight to read.<br /><br /><span style=\"text-decoration:line-through;\"><span style=\"color:#fcfcfc;\"><sup><span style=\"color:#f7f7f7;\">Pressenterandholditdown.</span></sup></span></span>",
"user": "purplelover"
},
{
"id": "978846",
"time": "1522725884",
"html": "<div style=\"margin:20px; background-image:url(/images/light.png);\"><div style=\"border:1px solid #888; padding:5px;\"><a href=\"/users/purplelover\">Purplelover</a> said:</div><div style=\"border:1px solid #888; padding:20px;\">Pressenterandholditdown.</div></div><br /><div style=\"margin:20px; background-image:url(/images/light.png);\"><div style=\"border:1px solid #888; padding:5px;\"><a href=\"/users/hydrogen777\">Hydrogen777</a> said:</div><div style=\"border:1px solid #888; padding:20px;\">Hold Enter to automatically explore the maze</div></div><br />Feature. It always just takes each branch from left to right.",
"user": "blake"
},
{
"id": "980126",
"time": "1523859532",
"html": "New features:<br /><ul><li> Title screen with maze type and size options</li><li> New maze type: laboratory (uses recursive subdivision algorithm)</li><li> Dead ends are now marked when they are in your line of sight, instead of only when you visit them</li><li> Can now move by holding arrow keys (nice for corridors)</li></ul>",
"user": "hydrogen777"
},
{
"id": "981097",
"time": "1524580344",
"html": "Painted the entire large board with blue bread crumbs that for some reason turned orange when I collected the cheese.",
"user": "angusbeef420"
}
],
"users": {
"hydrogen777": {
"name": "Hydrogen777",
"key": "hydrogen777",
"url": "/users/hydrogen777",
"avatar": "/uploads/drawn/11933.png",
"rankClass": "admin",
"rankText": "Admin",
"posts": "7435"
},
"apg": {
"name": "APG",
"key": "apg",
"url": "/users/apg",
"avatar": "/uploads/drawn/5447.png",
"rankClass": "civilian",
"rankText": "",
"posts": "3718"
},
"purplelover": {
"name": "Purplelover",
"key": "purplelover",
"url": "/users/purplelover",
"avatar": "/uploads/drawn/18703.png",
"rankClass": "civilian",
"rankText": "",
"posts": "601"
},
"angusbeef420": {
"name": "AngusBeef420",
"key": "angusbeef420",
"url": "/users/angusbeef420",
"avatar": "/uploads/drawn/9461.png",
"rankClass": "civilian",
"rankText": "",
"posts": "2222"
},
"ecr674": {
"name": "ecr674",
"key": "ecr674",
"url": "/users/ecr674",
"avatar": "/uploads/drawn/16118.png",
"rankClass": "civilian",
"rankText": "",
"posts": "2455"
},
"diav": {
"name": "DIAV",
"key": "diav",
"url": "/users/diav",
"avatar": "/uploads/drawn/15553.png",
"rankClass": "civilian",
"rankText": "",
"posts": "15894"
},
"blake": {
"name": "Blake",
"key": "blake",
"url": "/users/blake",
"avatar": "/uploads/drawn/16553.png",
"rankClass": "webmaster",
"rankText": "Webmaster",
"posts": "2821"
}
},
"page_num": 1,
"locked": 0,
"total_pages": 2
}