UNH4CK3D – post-mortem

Posted by
December 27th, 2016 9:00 am

I’ve got the idea for my first LD game a little bit before theme was announced. That’s why I’ve decided to take part in Jam and not to think about the theme. My game is a web-based hacker simulator game with realistic terminal commands.

Before LD

Well, as I’ve decided to submit a Jam entry, I wasn’t really restricted with “only in 48 hours” and “do everything alone” rules, so I made a small sketch. It was static HTML page with some CSS and JS for login screen and a desktop page with some icons.

I’ve also asked some of my friends whether hey want to help me, and as they told me that they would, I’ve created a private Github repo for us to use.

The first day

On the first day I had some university lessons to attend to. Lucky for me, it was a lecture about something I already knew, so I could code instead. That’s how console prototype was created: there was no layouts, just JS code, which I’ve been executing through Firefox Developer’s Console. That’s not a real shell, of course, but it could parse the input string into arguments (supporting “quoted string” as a single argument and some escape sequences like \n). It also supported pipe |, because I already had an idea for that.

After those lessons I returned back to my room. First thing to do was to add that prototype to my sketch page and create some nice UI for it. I’ve actually been streaming all that to Twitch (even though noone does watch me), but I wasn’t recording.


Then I’ve started adding more pages into the “internet” of mine: some simple ones like Mailbox (totally static) and browseros system pages like settings, admin and no_internet.

By the end of the day I’ve also added a Play player, which is using YouTube API, and a temporary playlist to check that it works.

The second day

My friends helped me on the day two. One of them is really into web-development, but he was quite busy, so his total impact wasn’t as big as I thought it would be. The other one never worked with all that web stuff before, so I asked him to help me with the story and translation. I had some sketches for dialogs, but was working on the other things, so I explained him the story shortly and returned to my work.

First of all, I had to start working on backend part of the game, because I knew that I want to hide some parts from the player. So I created a lightweight virtual machine and set up some LAMP stack on it, because that’s what I have on my site hosting (where I was planning to release my game on). That’s where PHP was added in. From now on the game wasn’t just a bunch of static HTML pages, and required some server. From the other hand, now I could add login and use database to store player’s progress.

I’ve also made translation on backend: user’s browser sends a cookie to server and depending on its value I’m sending one or another texts in response. I wanted to determine user’s language by IP, but PHP geoip module wasn’t available on my site’s hosting, so I had to remove it later on.

Then some other backend systems were added: search, “networks” and URL handling. Even though it’s possible to implement these on frontend, it would also be possible to look in the JS source code and see which IPs, URLs and sites in search index are available, meaning the players could possibly find something I don’t want them to find yet.

Search gets user’s query, splits it into separate words and then searches for similar keywords in the “index”. Index contains all sites I wanted to be searchable, its title and descriptions and arrays of keywords. To make search a little bit smarter, I’ve decided to use Levenstain distance to find out whether keywords are similar, but that’s why search sometimes returns some funny results.


“Networks” is a special set of objects, which represent a network node. Each node can have an array of hostnames (IPs or actual names) and a set of opened ports with some “services” on it. Using that I could easily add more computers to the network of the game, and add some ssh/web/etc services (only the first two were implemented).

URL handling parses the string player enters in the in-game browser field and searches for a match. It’s basically a hardcoded set of strings (like “search.com” redirects to some “/pages/search/index.html”), but it’s also aware of the networks, so if you’d try <IP>:<port> in URL field, it would check if there is such node and if there is a web service on specified port, and if so, show you the associated page.

Once I finished those, I started working on IRC, which was the key element of story telling in the game. I’ve decided to go with predetermined options for player to select from and a funny SUPERHOT-like button mashing mechanic for players to type these options. I also wanted new messages to appear one by one, so I’ve getting all new unlocked messages with AJAX and them play them in the order with the delay specified. I wasn’t using database to mark which messages were already read, so if player updates the IRC page, it instantly shows all new messages. The nice thing though is that message notification sound plays even if you’d leave the page. The sound was created with sfxr, btw.

By the end of the day I’ve got some dialogs from my friend. He wanted to make the entrance a little bit smoother for the player, so he added some tutorial part where you’re answering some kind of buddy who doesn’t know anything and always asks for help. The idea with different options for that sequence is totally his, and I think it’s quite funny.

The third day

So, in the beginning of the third day I already had some systems working, but there was no story or tasks for player to do. I already knew what tasks I wanted to add, but these were not implemented at all. For example, to run the exploit, player had to connect to the remote server with ssh, but there was no ssh yet. In order to implement that, I actually had to change a lot in that shell emulator of mine.

As this was Monday and had some lectures again, I couldn’t work on something heavy, so I was just implementing dialogs I got from my friend: redacting these a little, thinking of the names for the characters, testing how it shows up in the game.

Then I’ve added the first task: to open a web interface, login using given credentials and see the sticker on the monitor. It’s funny how everybody wanted to zoom the picture in and see what’s on sticker when my idea was that if that’s too small, player would go back to IRC to see what changed in there.

The second task was a bit harder: it requires a terminal, but as I knew hackers wouldn’t explain player how to open it and how to use it, I had to add some hints. That’s why I’ve added a scriptkiddie blog, where he shows a screenshot of open terminal and a browser URL which you could use to open it. There is also where I’ve put hint on how to use curl and curl | dash (that’s browseros shell). I didn’t add any hint on ssh, though.

Then I’ve started some polishing: added playlists (default “player’s” and an electronic “by Tkachov”), added translation everywhere (because the friend of mine couldn’t manage all the PHP I had in the project), drawn icons, renamed some things, etc.

After all that I felt a little bit tired, so I decided not to spend the last hours remaining to add content, and just moved the game to the hosting, created an entry and a short post.


Even though I knew my game is working fine, I thought it could be too short, not interesting or demanding some knowledge players don’t usually have. So I was surprised to see how well it was received by people who commented my entry. I actually ticked a checkbox to allow anonymous comments hoping that would get me more feedback, but I don’t really remember seeing any anonymous comments on this site, so it’s either broken or nobody wants to be anonymous.

What went well: it seems players did like the idea, and a lot of them liked button-mashing =)

What didn’t: not everyone liked button-mashing; there is not enough hints; there was no message to notify user that the game has ended already.

I’ve fixed the latter, but everything else remains the same it was when I created an entry. I do want to make more, but I’m not sure when I’d get time to do it.

TVGS played my game on their stream and uploaded the record to YouTube, so if you want to see it in action, here’s for you:

You can also play it in any modern browser without installing any plugins. I’d really appretiate your feedback, so please let me know what you think of it!


Tags: , , , , ,

Leave a Reply

You must be logged in to post a comment.

[cache: storing page]