You know, I like to consider myself a savvy internets lady. I hardly ever need to look up basic HTML coding, and I can even script a cutscene or three in WeiDU. (That's right. I'm cutting edge.) Turns out none of that qualifies me at all for Greg Shuflin and Alex Nisnevich's extremely clever puzzle game Untrusted, where you find yourself trapped behind bars with only a computer and must literally code your way out to alter the world around you. Just use [WASD] to move around in each stage, and anywhere in the black areas in the red code box to the right side of the stage window to enter or change scripts. Below that, you'll see a few helpful buttons. API will open a reference window that will detail what some different functions do. Reset, well, resets any current level to its unaltered state, while Execute puts whatever code you've entered or changed into effect. You can access any levels you've already finished by clicking Menu, and if you want to disable audio, just click the speaker icon above the game display window.
SEE ALSO ON JAYISGAMES: A DARK ROOM
Essentially, you're playing by modifying the game's source code, or at least what it lets you modify within each level's design, and yes, you will need to actually write or know how to change some script. Many levels have multiple solutions, so don't be afraid to get creative or experiment, through attempting to brute force something will only get you so far... like the second level. Things get increasingly complex as you go along, throwing more hazards and elements into play to contend with, and you'll have to be smart and sneaky to win. It doesn't offer a lot of help apart from a few nudges here and there, so don't expect it to tutor you... it isn't trying to be a step-by-step tutorial, and if you love the nuts and bolts of what makes games run, chances are you'll love this too. With its simple, stark presentation and well-chosen soundtrack, Untrusted is one devious little game that is hard to pull yourself away from.
Walkthrough Guide
(Please allow page to fully load for spoiler tags to be functional.)
Since I've finished the game (and loved it very much), I've decided to make a hintthrough or something:
Remember, when in doubt, check the API for any functions that may be useful.
Level 1:
Pick up the computer, and you'll be able to look at the level's code. Note that you can only edit the black section. The code resembles something that generates blocks (see placeobject and block?).
So, just delete all the code in the black section. Hit execute.
Level 2:
Hmm, a maze here. Execute the level a few times and observe: note that the exit is always observed. Also, you can only place code directly before and after the code. As the level has tell you, you only need to add 4 characters to win this level. (Some basic programming knowledge needed)
What you need are the commenting characters "/* and */". Put /* in the front and */ in the end, and everything between them are "commented", i.e not executed as code.
Level 3:
Uh oh, this time they've enforced validation, which means you can't execute the level whatever way you want. But after simple investigation, the code only check for how many blocks exist on the screen. If we place exactly that many blocks in another way...
Just place 104 blocks that won't block your way to the exit. The simplest way is to edit any x or y inside placeObject to x+2 or y+2 to offset it, effectively shifting the wall sideways to open a gap for you.
Level 4:
Trick level. You can't do much here: you can't overwrite existing blocks, you can't disable the block-generating code, and you can't place the player outside the cell. Oh, I guess this hints you about something.
You can place multiple exits in this level, so just place another exit inside the cell.
Level 5:
This place is filled with mines! The only place you can add codes is directly after which the mines are being generated. Mines are invisible, but if you can somehow make their position visible... Maybe the API gives us something useful.
See the map.setSquareColor? This will help painting all the mines, so that we can see them directly (and avoid them).
Level 6:
An attack drone! It always follows you, and kills you when it touches you. To outrun the robot, you need some objects to constraint its movement.
Just place some walls to block off the drone as you maneuvers and lures it into the wall, and then outrun it. A long horizontal wall above the drone is already sufficient.
Level 7:
Colors. You're now offered with a phone, which can call any function you write up whenever you press Q or Ctrl+6.
The color lock is designed such that it's impassible if the player's color is not the same as it. You must change yourself, i.e your color.
Set up some if statements to set the player's color (via player.setColor function) depends on the current player's color. An example would be
if green->red, if red->yellow, if yellow-> green.
(Note that this is pseudo-code, and is not what javascript if-statement syntax are. Javascript's if syntax is
if(condition) {
something;
}
)
Level 8:
Chapter 2!
This level is very straightforward. First, note the comment that in this level map.placeObject is allowed to overwrite existing object. And you can only choose the function that exists in the code to call. There isn't that many function that's useful to change the map, is it?
Just choose to call "generateForest". As you keep regenerate the whole forest, you occasionally makes way for you to get closer to the exit.
Level 9:
The water drowns you. The raft doesn't, but it only moves in the direction raftDirection, which has a value of "down". Seems like you can only add some code, but you can't place more rafts or exits.
Sure, changing the raft's direction of movement would work, though, the raft should start moving only when you're on it...
Time to use your phone! (If you forgot how to properly set a phone call function, refer to previous levels' code.) Just make so that calling the phone changes raftDirection to "up". Easy.
Level 10:
You've been ambushed by the drones.
There are three types of drones: Attack drones (red), Reinforcement drones (yellow) and Defense drones (green). Attack drones chases you, Reinforcement drones goes left, Defense drones holds their position.
You can modify their behavior code to make the move the way you want. You can't destroy it, but you can always drive them away to make a path for you...
Hint: Game elements are executed top first.
Reinforcement drones doesn't need to do anything at all. Just clear our their behavior code.
You'd want attack drones and defense drones to move sideways to clear a path, but directly calling them to move up/down won't work as they're blocking each other. And since the drone on the top moves first, you can first move it away, then move the one below it up, and clear out a way. You can do the following:
If the drone can't move up, move left/right. Else, move up.
A simple if statement with the appropriate functions from the API does this well.
Then, a pathway will be cleared out.
Level 11:
Robot AI programming, level 1!
In the next 3 levels, you need to obtain a key by navigate the robots to grab the key and cross the barrier, which then you'll grab the key by touching the robot. You can't edit any of the code except the robot's behavior.
As for the easiest level, there's no obstacles at all. The most straightforward way is to go all the way to the right, and then keep going down. As the code comment had say, only me.move and me.canMove is sufficient.
If the robot can move right, move right. Else, move down.
Level 11:
Robot AI programming, level 2!
This time some basic obstacles are enforced. Our code (brought from the previous level) would still work fine, if we can maneuver the robot at those key locations...
You can obtain the robot's position by me.getX and me.getY. Just define some position that the robot should navigate away from the obstacles (only 5 spot are needed).
Level 12:
Robot AI programming, level 3!
Ehh, we now have a randomly generated maze for the robot. The default random motion code given can solve the maze, just that we need to wait a long time waiting for a miracle. Writing an AI code to hug the left wall is also fine. But it'd be easier if we can just manually control the robot...
You can call player.atLocation inside the behavior function, so you can just use the player's location as the control. It's like putting 4 controller buttons at the map: the robot will move up/down/left/right when the player is pressing the corresponding button.
Level 13:
Puzzle time!
You need to get the Algorithm and get out. Locks requires a key to pass through, and comsumes the key if the player passes through. Now, we can choose any item to be removed by the green gate, even those you don't currently have any, but only defined items can be removed, or an exception will be thrown and we can't enter the gate...
There's only one item you won't possibly have when you pass the green gate: the Algorithm. So, just change it onto "Algorithm".
As for the puzzle itself:
Go top-left, get blue and yellow key, back to the center.
Go top-right, get red and blue key, back to the center.
Go down, get the yellow key and the Algorithm, back to the center.
After all the work, we have the Algorithm and the green key. Exit.
Level 15:
Chapter 3: Betrayal!
You need to cross the river, but the water kills you. You can change whatever it is inside the player.killedBy function in the water's behavior, though.
Hint: the level name is "exceptionalCrossing". Exceptions.
Throwing exceptions with player.killedBy function will stop it from executing, hence saving you from death.
As of how... just put in something that isn't defined and isn't a string (surrounded by quotation marks), since killedBy can accept strings.
Level 16:
Killer lasers that kills you if your color is not the same as them is now deployed!
Note that a new class of functions, canvas, is now available. You can see and edit the lines that draws the laser, as well as some space just before startLevel ends.
...Did he say we can't see the color of the laser? That seems to be an easy fix...
Ah, and changing colors, we've done that before.
To see the color of the laser, change "white" to color, which's defined as the laser's color.
Then, you need to change your color. You can reuse your phone call code from level 7 (colors) for this mission. Just note that only "red", "yellow" and "teal" as color can always save you; RGB codes seems to occasionally kills you.
Level 17:
A basic teleporter maze, except that teleporter may go straightly into life-threatening traps.
The targets for each teleporter are shuffled, and we can't do anything to it. Directly placing object doesn't work either, since the map is using canvas to place objects. (And you can't overwrite the existing canvas map, either)
Not every teleporter maze is solvable, but no matter, we can try to see if it actually is solvable. We want to see which teleporters are connected...
As the code has hinted, map.getCanvasCoords will help you in this job. Look for details in the API.
To see the linkages of the teleporters, loop through teleportersAndTraps again (just copy from the code above :D).
If both are teleporters, obtain their coordinates by map.getCanvasCoords, and use their canvas coordinates to draw a line to each other. You can refer to the canvas code in the killer laser level for a proper line-drawing code.
Also, make sure lineWidth is small, or it'll be hard to see all the linkages...
After that, just keep executing the code until you get a solvable condition.
Level 18:
Classic platformer!
So, in this level, you need to get to the other side, but the gap sure looks large, and falling into it will kill you. There's a "gravity" function which keep pulling you down, and is executed regularly via startTimer function. And you can call the jump function, if the block below you is not empty.
Function name can always be misleading, though. Maybe we can just walk through the gap as if it's solid...
Fill the gap!
In other words, build a bridge by place blocks on the top of the gap, so you can walk straight through. Easy!
Level 19:
Nothing in this level, just use arrow to navigate through the page elements. The level ends when you catch the red guy.
Level 20:
Boss!
Yes, this one is hard.
Looking at the code, the Algorithm can only be dropped by the boss, and you need it to exit the level. You can only kill the boss with projectiles (a dynamic object with 'projectile': true), but you can't put any dynamic objects on the map before the level starts, which means you have to put them in runtime.
If you can get the phone, you can definitely do it, but that bullet curtain looks impossible to pass through! Okay, perhaps we should make the boss generate projectiles themselves...
...Hmm... Math.random? What is it, what does it do?
First, obviously, you should define a new projectile that moves anywhere but down. Just copy from the bullet object code.
Then it comes the cleverest part. Redefine the Math.random function! Since the boss has to trigger Math.random per cycle (to see if it's smaller than 0.3), we can tamper with the Math.random function to make the function lay down bullets that brings forth their doom.
Finally, make sure the function returns a number. Bigger than 0.3 is recommended for obvious reasons.
Level 21:
Uh oh, the exit is not working. And it's not like we can edit the level code either.
Though, when we bring up the menu there's now a new section call scripts/, which is basically the source code of the game itself. We can edit map.js, objects.js and player.js. Since the exit object must be defined somewhere, we can look at how the exit works (and why it isn't working) if we look at the codes.
The exit is an object, so we'll look at objects.js.
From the place where 'exit' is defined, there's some line that translate into "proceed to next level if current map isn't the final level".
So what should you do? Erase the condition, of course.
Posted by: uncopy2002 | April 12, 2014 11:19 AM