Elf Minder 9000

 Prologue

 Frosty's Beach

Difficulty:

Elf Minder 9000 is a very simple game on the surface, but can get complicated when you get into the nuts and bolts of it. To find it, the terminal is on Frosty's Beach in the Prologue.

Elf Minder 9000

Elf Minder has 12 base levels and one bonus level. Beating the first 12 levels will grant you the silver trophy. The bonus level requires some manipulation of the game mechanics to glitch your way through it.

For silver I will just show how I beat it legit. Click the links below to expand the sections.

Show Sandy Start - Silver

Show Waves and Crates - Silver

Show Tidal Treasures - Silver

Show Dune Dash - Silver

Show Coral Cave - Silver

Show Shell Seekers - Silver

Show Palm Grove Shuffle - Silver

Show Tropical Tangle - Silver

Show Crate Caper - Silver

Show Shoreline Shuffle - Silver

Show Beachy Bounty - Silver

Show Driftwood Dunes - Silver

Looking at the Javascript that controls the game behavior, there is a function that calculates where you land when you use a spring. This function has a comment "fix this" which drew my attention. There is an edge case where if there isn't a valid target for the spring to land on, or the spring is going to land on another spring or portal, you will jump to the first segment added. See below.

   getSpringTarget()
  Javascript
function getSpringTarget(springCell) {
	const journey = this.hero.journey;
	const dy = journey[1][1] - journey[0][1];
	const dx = journey[1][0] - journey[0][0];

	let nextPoint = [ springCell[0], springCell[1] ];
	let entityHere;
	let searchLimit = 15;
	let searchIndex = 0;
	let validTarget;

	do {
		searchIndex += 1;
		nextPoint = [ nextPoint[0] + dx, nextPoint[1] + dy ];
		
		entityHere = this.entities.find(entity => 
			~[
				EntityTypes.PORTAL,
				EntityTypes.SPRING,
			].indexOf(entity[2]) &&
			searchIndex &&
			entity[0] === nextPoint[0] &&
			entity[1] === nextPoint[1]);
		
		if (searchIndex >= searchLimit) {
			break;
		}

		validTarget = this.isPointInAnySegment(nextPoint) || entityHere;
	} while (!validTarget);

	if (this.isPointInAnySegment(nextPoint) || entityHere) {
		if (entityHere) return this.segments[0][0]; // fix this
		return nextPoint;
	} else {
		return;
	}        
}

This is the section that is important.

   getSpringTarget()
  Javascript
if (this.isPointInAnySegment(nextPoint) || entityHere) {
	if (entityHere) return this.segments[0][0]; // fix this
		return nextPoint;
	} else {
		return;
	}        
}

In this code, entityHere is true when there is a portal or spring on the landing spot for the spring. When this is true you will be teleported to this.segments[0][0], which is the first segment you placed.

This can be exploited to beat A Real Pickle. Before I do that I wanted to do one more one more thing. I'm going to use local overrides to change some values in the Javascript. The server side does not validate the two spring limit, so if I comment out the code that removes the oldest spring when there are more than 2, we can add as many springs as we want.

 guide.js
  Javascript
if (!relevantEntities.length && !springsAtPoint.length) {
	const existingSprings = getEntitiesByType(EntityTypes.SPRING);
	if (existingSprings.length === 2) {
		// remove just the oldest spring
		//const oldestSpring = game.entities.findIndex(entity => entity[2] === EntityTypes.SPRING);
		//game.entities.splice(oldestSpring, 1);
	} 
	//comment below
	//game.entities = game.entities.filter(entity => entity[2] !== EntityTypes.SPRING);
	game.entities.push([...cursor, EntityTypes.SPRING]);
}

 

Putting the spring glitches together I can now beat the bonus level "A Real Pickle". Notice all the springs and notice the teleportation spring jump to the end. Just be sure to place the segment you want to teleport to first.

A Real Pickle

With the completion of A Real Pickle I got the Gold Trophy!

Bonus: There is an editor mode that allows you to completely edit the level by removing or adding any path or entity.

 game2.js
  Javascript
const isEditor = !!urlParams.edit;

if (isEditor) {
    adminControls.classList.remove('hidden');
    console.log('⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡');
    console.log('⚡ Hey, I noticed you are in edit mode! Awesome!');
    console.log('⚡ Use the tools to create your own level.');
    console.log('⚡ Level data is saved to a variable called `game.entities`.');
    console.log('⚡ I\'d love to check out your level--');
    console.log('⚡ Email `JSON.stringify(game.entities)` to evan@counterhack.com');
    console.log('⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡⚡');
}
Editor Mode

The game checks to see if a url parameter "edit" is set to a "truthy" value like "edit=1", then the game will be in editor mode. In this mode you can add or remove whatever you want, just know that the server-side will still run some checks and throw an error if you cheated (too much). You can do things like add hot sand to make you run faster or any number of springs as we know the server doesn't validate that. You can also add entities between objections that you are normally prevented from doing. It also looks like Even Booth is interested in seeing your custom levels!

 Elf ConnectWhere to next?Frosty Keypad 

Holiday Hack Challenge 2024 Report - Cody Travis <cody@chillaspect.com>