Tag Archives: Human Resource Machine

Human Ransource Machine – Episode 6 – Zero

YouTube Link

Here we are at the end of the Human Resource Machine. I had a lot of fun with this, especially when I went back to try to get the remaining optimisation achievements. My biggest concern about it is that I am unsure  how much fun someone unfamiliar with programming will have. This is because it can be surprisingly light on hints, especially the basic ones, enough that I never talked to the bosses looking for more detailed cues, such as how you compare two letters, or different sort methods, and I am not sure how well those really work. The game also hints occasionally that you can get more information from Google and/or Wikipedia, but some people will find that kind of outsourcing of help especially annoying.

The other issue the game has is narrative, I mean seriously what is with the robots? The story never actually does anything with them, it just makes for some interesting interstitial cutscenes, there are a couple of levels where you seem to be outputting some kind of message, but there are never any hints as to what that message is for, nor really a purpose for completing the puzzles. It just seems like a bit of a waste to me.

As always you can find the optimised code over on the next page. I should warn you though that floors 38 and 41 beat me. I was unable to find an a fast enough algorithm for each. If you want solutions for those problems I suggest looking into places such as this GitHub repository. I shamelessly used their code for the fast solutions for those problems, I did attempt to understand what they are doing. For the floor 38 solution they cleverly set up the floor so that they can conduct their search by 3s, 30s and 300s. It takes more code but it dramatically speeds up the search. For floor 41 I remain somewhat baffled, I suspect it is simply using a sort technique I am unfamiliar with.

Human Ransource Machine – Episode 5 – Solution Expansion

YouTube Link

Progress slows down pretty drastically in the last 8 floors or so, the problems are much more complex and as a result so are the solutions. This means that it also takes a lot more work to optimise these, a lot of my evening free time during my Portugal trip was occupied with optimising these later levels and now here are a few tips you can use when optimising for size.

  1. Iteration is really useful. Start with a working solution, then tweak it.
  2. Don’t worry too much about edge cases. They take more lines to check for and we don’t care if they are incredibly slow
  3. Try to ensure that your code is as generic as possible, if you can reuse the same code section you also reduce lines
  4. Remember to use what you are holding after a check. Jump Zero means you are holding a 0, you can use that to reset counters and pointers. without an extra copyfrom
  5. Jump statements can take you in the middle of a loop, not just at the start. Consider where you want to enter a section of code the first time around

As always head to Page 2 for the optimised solutions.

Human Ransource Machine – Episode 4 – Programming to Success

YouTube Link

I am not showing any of my optimisation run in this series, which means that you unfortunately miss a lot of staring at and running of code while I ask myself questions like “What am I doing here?” and “Why did I do that?”.

Often my basic solution can be modified to meet at least one of the goals, though sometimes one must rethink your entire approach. Sometime the changes needed for code that meets one goal to meet the other are surprisingly subtle. See the code I have provided for floor 32 for an example.

Here are a couple of tips when going for speed:

  1. Iteration is really useful. Start with a working solution, then tweak it.
  2. It can be worthwhile to check for edge cases which are trivially solved.
  3. Try moving your output steps to the beginning and use a jump statement to skip them the first time. It is the same number of instructions, but fewer of them are used each time.
  4. Remember to use what you are holding after a check. Jump Zero means you are holding a 0, you can use that to reset counters and pointers.
  5. Jump statements can take you in the middle of a loop, not just at the start. Consider where you want to enter a section of code the first time around
  6. While size and speed are generally correlated, often you can speed things up using specific, if slightly redundant code.
  7. You may be able to have a counter or pointer value do double duty, especially towards the end of the program.

What tips for speeding up your apps have you found?

Check Page 2 for the optimised code

Human Ransource Machine – Episode 3 – Lets Get Programmin’

YouTube Link

The labels in this game are interesting, the tape and marker approach is cute and makes them very visually distinct from your code, which is exactly what you want from your comments, but it also makes them a pain to do. It is hard to make anything extensive, so generally you don’t, but when you go back over your code labels do make it much easier to understand what you were doing and why.

Strangely I don’t run into this so much in the floor, probably because the programs Human Resource Machine wants us to write generally are not that long so I can get away with shorter but still fairly representative names. Plus short names are more easily referred to in other comments.

I’m definitely interested to know how heavily others commented their code and tiles when playing through the game.

As always check page 2 for the optimised code

Human Ransource Machine – Episode 2 – Seriously, Programming

YouTube Link

What you do in Human Resource Machine is programming. You are working at a lower level in a kind of restricted version of assembler, but you use all the same techniques. It is also worth noting that there are different forms of assembler, it isn’t a single unified language which means this isn’t necessarily the most restricted version of assembler that exists. I actually consulted my partner who has some experience using real world assembler when I was doing my optimisation run and despite not showing her the game she was really helpful. I did have to get my terminology straight first however.

The key things were how to discuss the storage using the tiles on the floor, and how to discuss what your character is holding.

The tiles on the floor represent registers, where you can store values on a short term basis while you are processing.

The value your character is holding represents the accumulator, basically a register that holds the working value. It is implicitly targeted in most instructions. This is why we never have 2 targets for a single command, SUB N is always SUBtract N from the accumulator. JUMPZ and JUMPN are always based on the value held in the accumulator.

Once I had those terms sorted out discussions about the game were much more productive.

Let’s go over to the next page for the optimised code for these levels.

Human Ransource Machine – Episode 1 – Small Cog, Big Machine

YouTube Link

Much like Jarenth I too was drawn in by the prospect of the Tomorrow Corporation’s latest puzzle game, Human Resource Machine. I will try not to repeat most of his comments, but to give you a little context about my knowledge going into this game I studied programming at University and I can code, but I am not a professional by any means and all of my experience with programming is at a much higher level than the slightly crippled assembler used in Human Resource Machine.

I will also note that while the video series does not spend the time and effort on optimisation, I did go back and do it for nearly every level in the game. I will try to make that (slightly terrible) code available on each post for this game. On this particular episode however I am going to skip the first 7 years as given how simple they are, and how restricted your instruction set is, your code will look pretty much the same as mine.

Given this code is text, hop over to the next page to see it.

Indie Wonderland: Human Resource Machine

Hey, look at this neat surprise I didn’t at all see coming! Human Resource Machine is the latest production by Tomorrow Corporation, the company best known for Little Inferno — a game that Human Resource Machine bears an immediate visual resemblance to — and World of Goo. So that’s one game about innocent, round-headed creatures being ruthlessly exploited by a giant corporation, and one game about innocent, round-headed creatures being… ruthless exploited… And now this new game is called Human Resource Machine. To paraphrase internet nerdfather Shamus Young, it’s hard not to wonder what dark hidden anger lies in Tomorrow Corporation’s past.

Nobody tell them they’re a corporation themselves now, though. Let them have their dissonance.

(Spoiler levels: Narrative, low-medium. Mechanical, medium-high-ish.)

(Game source: Bought it myself.)

After the break: Human Resource Machine. So would that be something like an automated scheduling system? Or more, like, a mother? Either interpretation is valid, but I’m not sure I’d want to play the second game.