Hacker News new | past | comments | ask | show | jobs | submit login
“A Dark Room” game open-sourced (github.com/continuities)
212 points by mjn on July 3, 2013 | hide | past | favorite | 117 comments



This game really impressed me.

The scope was amazing, the contrast between where you start and how it ends, the hints of disaster and questioning of your own identity. I found that it brought out the superstitious in me - I never knew why it was important to keep the fire lit and the room warm, but I made sure that it was. I didn't know what charms did, but I tended to take one with me when I went exploring.

The only slight disappointment I had with it was that I was expecting it to be much more story driven, but while there were hints of a story that emerged, I would have liked more.

Did you take builder with you when you left? Were you really part of the alien menace that strip mined the planet? Do you feel different now after having bootstrapped civilization amongst these people? Where did builder learn so much? Did anyone ever catch those creatures in the store room? Will the planet recover? What will you do next?


I too had a bit of a jaw-drop moment after I discovered the space ship and reset the game. I saw each bit of story in the more menacing light you suggest with your last-paragraph questions.

Bravo on the entire game's concept and execution. I'm excited to see what develops from this open-source phase.


> I'm excited to see what develops from this open-source phase.

I don't think he was a plan; in his blog comments, I was the only one who suggested that he put it on Github and I have no intention of making any contributions. If anyone else is moved to, there are a few ideas:

1) the obvious: bug fixes, UX improvements, clearer text.

2) modding.

He's got enough there to be used as an engine for a similar kind of game.


Modding would be fun, could even be refactored as a "minimalist game framework." No particular mods come to mind ATM though. Any ideas?


Adding more locations on the map, procedurally generated minimazes for caves and cities, and either throwing more things/requirements/distance between village and space ship, or even crashing with that spaceship on another planet and exploring that.. until you find another spaceship, and so on :D


Maybe you could have live competition between villages on other worlds? For example, if you and I start at the same time, we can each see the number of villagers of the other person and houses, etc. built so far.


Why on other worlds? You could start on the same world and get Civiliazation. Also, I think there should be some fog of war in a multi-user version.


I had prefered to build up the civilisation more. Rebuilding the ruins. Growing my village into a city.


I was personally really bummed out to find that it capped out at "Raucous Village".


You mean I can't build any more huts...

I almost cried...


I remember an experimental game from years ago that was essentially a dungeon crawler without the er, crawling part. That is, there was no 'space', similar to the beginning phase of this game. It was actually quite fun, and seems like it could impart some ideas for expansion in this game.

(Found link: http://www.ludomancy.com/blog/2007/01/12/an-rpg-without-spac...)


I had a great time trying to figure out whether it was worth carrying 10 rifles on an expedition or just one. Same with steel swords. I think my standard outfit ended up being one rifle (plenty of bullets) and five swords - though I'm still not sure if it makes much of a difference.

I can't imagine how long it would take to complete the game without cheating. I would manipulating the localstorage database from time to time.


Approximately 6 hours, not counting the overnight break while I slept and let it just sit there accumulating resources.

I made a lot of non-optimal decisions the first time through, though, seeing as how I had no idea where it was going. That combined with the sleeping time means I have very little idea of the minimum time required to play it straight through.


If I'm not mistaken, carrying more of the same weapon doesn't give you any benefits, it only means you get to carry less of other items. I looked at the JS code while playing and found the amount of damage each weapon does. In battle, this amount of damage was dealt when carrying multiple of the same weapon or just a single one.

Carrying one of each weapon does make a huge difference though, because you get new attack buttons.


I wandered around with a sword, rifle with bayonet, bola, and grenades. Most of the tougher creatures barely put up a fight with that combination.


I always carried all the melee weapons around, because I don't have to care for amunition that way. An additional rifle or laser for difficult fights.


I put in around 12 hours over two days, interspersed with watching movies while I waited for resources to accumulate.


I think I put in 6-7 hours over a few days.


Honestly, putting the source out in the open is kind of terrifying. The code was written without the expectation of a global code review. I regret so many lazy shortcuts and the general lack of solid architecture now...


Hey it worked. My only gripe was with a few (very minor) aspects of the design, like not being able to stop and eat meat after a fight, or dying of starvation despite carrying a large amount of fresh meat. I noticed a couple of tiny display bugs, but none that interfered with operation. It may have been prototype-level code, but I played through to the end which is something I don't usually bother to do!


Understandable given the HN crowd. Try to focus on the fact that you did an incredible job. At the end of the day, the purpose was to create an entertaining game. Me and a whole bunch of others gave you 6-7 hours last weekend, and I am not easily parted from my hours. I haven't been captivated by a game like that in a decade.

Good job.


It was a white screen with text, and you managed to get a whole lot of picky Hacker News nerds playing it. You deserve kudos just for that :)


There will surely be a lot of discussion of your code, but it's still awesome that you put this out there under an open source license.


Thanks for doing this! It'll be a lot of fun for folks to fork.


Best comment: "MICHAEL IS A LAZY BASTARD AND DOES NOT WANT TO REFACTOR" [1]

[1] https://github.com/Continuities/adarkroom/blob/master/script...


I've always been a fan of Shame-Driven Development.


if it's consistent with TDD and RDD it means you start with shame, then go write something to feel ashamed about?


SDD: Write something bad => Surround oneself with reminders that it is bad => Fix it*

*Or, more likely, drink to forget.


Maybe the lazy bastard open sourced his code so someone else would refactor it for him.


The thing that needs to be refactored is called the Observer Pattern, and it's one of GoF patterns that most professional programmers should at least know about.

By "know", I mean the mere fact that it exists. Implementation details depend on the programming language and can always be looked up.


Yup, I'm familiar with it. I just didn't think to use it until it was much too late...


Okay, so I finally get to see what baited traps do: they double the output of the trap. And I finally get to see what traps drop!

So now, I can label the trapper (assuming I have 9 traps and check them regularly (trapper can't make bait for 10)):

    Income/10 sec:
    
    Fur:	0.5	
    Meat:	0.25	
    Scales:	0.1	
    Teeth:	0.05	
    Cloth:	0.065	
    Charm:	0.005	
Which is surprisingly competitive with the hunter. I think I'd rather have the hunter once I have my charm and better sources of teeth, scales, and cloth.


What better sources of teeth and scales are you referring to? Harvesting them from wandering beasts seems extraordinarily tedious and time-consuming. Converting to them from fur requires an incredible amount of fur.


I meant manually hunting. I usually wind up with more teeth and scales than I can use without particularly seeking them out. Though I guess I don't buy things with them a lot.

The one time I did buy alien alloy from the store, I didn't have too much trouble farming 750 scales from big lizards, though. I could bring in 30 or 40 scales per trip. I didn't time myself, but the trips themselves couldn't have been more than a minute or so in duration. It was definitely tedious, but not totally unreasonable.

Traps are a poor source by comparison -- 20x to 40x less efficient per time spent. Admittedly, they're passive. Sort of.


2 minutes per trip. 35 scales per trip. 700 scales needed. That works out to 40 minutes per Alien Alloy.

I guess it depends on what you consider unreasonable. I don't usually play games w/ a large amount of grinding.


HN discussion of the game itself, from a few days ago: https://news.ycombinator.com/item?id=5961205


I added some simple click handling to the world map to hopefully enable continued play on mobile devices. Pull request here[0].

By clicking on the north of the map you move north etc. Might be improved by making it relative to the player, rather than the centre of the map.

You can play through the game with the changes here[1].

EDIT: It was better measuring the click relative to current location, so I changed that in the PR.

[0] https://github.com/Continuities/adarkroom/pull/7

[1] http://cogito.github.io/adarkroom/


Thanks! Yes this is the most important first fix. Never underestimate the volume of iPad only users. ;)


No worries :)

Would love feedback on the interface if you are able. The interface feels pretty good with mouse, and seems like it would translate well to iPad, but I won't be able to test myself for a few more hours.

I thought about adding separate buttons that could be clicked, but decided that clicking on the map was more intuitive and fit with the game better.


Ah great, so I can add keyboard shortcuts instead of fast clicking of ever shifting button locations and obscuring description labels.


It runs entirely in the browser? Then why not put it in a gh-pages branch so it can be played too?

I did this for my ludum dare text adventure:

http://williame.github.io/ludum_dare_23_tiny_world/


The canonical playable version is already hosted online on his own site: http://adarkroom.doublespeakgames.com/


But if he puts it on gh-pages then the forks are also playable online.

Bit late now, perhaps.



Ok, so I just played through your game since you put the link here.

Qs:

(1) are you supposed to interact w/ the NPCs? Only substantial interaction I noticed is when you turn on the lighthouse and the pirates run away

(2) Looks like you don't need to solve any of the puzzles to win the game?

(3) Seem to be a lot of unneeded items also?

In general, a bit confused. I never did anything w/ the brick, the rake, the racket, the music, or moby dick, and yet managed to win the game it seems.


Thank you for playing!

We made it for a Ludum Dare contest http://www.ludumdare.com/compo/ludum-dare-23/?action=preview... which has a 72 hour deadline and we simply didn't have time to finish it, basically. So theres lots of started plot twists which don't get used or go anywhere, e.g. we added the NPCs but didn't get a working conversation system in there.

There are plenty of surprising problems in making this game; here's a write-up: http://williamedwardscoder.tumblr.com/post/21865366869/how-t...

Thx again for playing! You might like some of our other LD entries: http://www.ludumdare.com/compo/author/william_edwards/


Very cool, thanks for your response.

Btw, do you know any other online sources for good minimalist games (text adventures or otherwise) ?

I'm trying to use some as a way to teach programming.


playing them or programming them? These days text adventures are called "interactive fiction" and if you google that, suddenly you find a lot of stuff, including http://www.theescapist.com/

But programming games? GameMaker might be a good bet.


Proud owner of pull request #1. Hoping people will make really cool contributions to the game.https://github.com/Continuities/adarkroom/pull/1


Merged, my man.


"A Minimalist Text Adventure"-- What would a maximalist text adventure look like?


Dunno, but if you are a frequent online gamer you probably know that 'minimialism' is a frequently used tag over at Kongregate and that there many other minimalist games that are not text adventures.

Notable examples:

Momiga (http://www.kongregate.com/games/Rogerup/momiga) - one button, one dot

Midas (http://www.kongregate.com/games/wanderlands/midas)

This is not a minimalist game (http://stormalligator.com/this-is-not/)

Pretentious game (http://www.kongregate.com/games/keybol/pretentious-game)


Dwarf Fortress?

I guess it's not really a text adventure, but still...


Dwarf Fortress is probably a textbook example of anti-minimalism.


Any of the later (or heck, even the earlier) Infocom text adventures are far from minimalistic. And contemporary interactive fiction written with Inform quite complex. Far more so than this.



ed?


Zork?


The Matrix? ("Blonde, brunette, redhead...")


Nowadays, I imagine Cypher playing Dwarf Fortress in that scene. "Blonde, brunette, redhead dwarfs..."


This is great news. Now we will be able to implement our own ideas and make the game even more awesome.

Why not implement another planet after the UFO? Heck, lets build a whole star system with many possiblities to choose from.


We'll end up with an ASCII version of Spore, won't we?


I'm okay with so long as we leave DRM at the door--or make it the boss to beat.


I hear a challenge.


Sweet. Although, frankly, I can't believe how much time I've sunk into this game since seeing it on HN the other day.

It would be nice to fix the end game and add better ways of fighting the infernal Ferral Beast. Maybe a laser rifle factory?


The Ferral beast is more easily defeated than you think, simply an iron sword plus a steel sword fairly easily does the trick. Add in a rifle and/or laser rifle and you can finish him off quickly every time.


You can hold two swords?! I always just used a spear and a steel sword. Feral beasts weren't much trouble.


Yes, ironically I didn't figure this out until I had already beat the game.


You know, I thought that, but they seem to get stronger over time. Maybe I'm just imagining that, but without bolas they often seem to be able to take me down. That's even with a spear, both swords and a rifle.

I never use the laser rifle since it's a pain to get energy packs.


Maybe you just don't have the health upgrade. Once you get 20 health per cured meat the ferral beasts are much easier to keep at bay.


Where did you get the laser rifle? I beat the game, went to every square on the map, conquered every suburb. Never saw a laser rifle.


Grepping through the source turns up that there's a chance of getting a laser rifle as loot when you clear a city, or when you clear a battlefield.


there is an end game?

I took off in a spaceship and dodged asteroids then it took me back to the start of the game. Did I die and miss something?


You didn't miss anything. There is no cool end, just a reset (sadly IMO).

However, "End game" usually refers to the gameplay at the end of the game, specifically in chess where you try to force mate with only a few pieces.


In RPG-style games, which this is... sort of..., "end game" generally refers to the point where you've built up your character to the maximum, or very close to it, and are now concerned with other things. It used to be known as the "elder game" in MMORPGs.


I somehow interpreted as if the character in the dark room had dreamed everything, and just woke up. And then the cycle start again. Seems fitting for the game.

Comment from the source file in the endGame function : // Restart everything! Play FOREVER!


>where you try to force mate

There is a word for that.



I don't think that's what he meant.


It doesn't have a ranged attack (as far as I can remember), so bolas should really help.


It already was open source by looking at the js code in the browser when I played it this weekend, at least I remember looking in the source code to find the chance of the Wandering Master appearing (which is, btw, around 1/Nth chance every 3-6 minutes while you're in the firelit room where N is amount of event types, 6 or so iirc)

Does uncompiled JS count as open source or not? Seems to fit the definition to me at least. Or is change history required as well to really call it open source?


Just because you're able to see the source, it doesn't mean that it is open source.

An example is the recent release of the Adobe Photoshop 1 source code. You can see it, but it's not released under an OSS license.

To be considerate Open Source, code has to respect those criteria: http://opensource.org/docs/osd


>9. License Must Not Restrict Other Software The license must not place restrictions on other software that is distributed along with the licensed software. For example, the license must not insist that all other programs distributed on the same medium must be open-source software.

So, under this definition, the GPL isn't an open-source license.


> So, under this definition, the GPL isn't an open-source license.

Untrue. The GPL does not "insist that all other programs distributed on the same medium must be" licensed in any particular way. [1] And the GPL has been reviewed and is an OSi approved license, which means its been found to be consistent with the definition by the people that wrote the definition. [2]

[1] http://www.gnu.org/licenses/gpl-faq.html#MereAggregation

[2] http://opensource.org/licenses/gpl-license


I stand corrected. Thank you. I guess I shouldn't assume I understand any document that is complex enough to warrant a preamble.


"software distributed along with the licensed software" is to handle the case of distributing a CD with multiple software packages (shareware CD, or your typical linux install disc).

The GPL says nothing about other software.


Which is why rms and the FSF are careful to distinguish between "free" and "open".


>Does uncompiled JS count as open source or not?

No, it doesn't. The license indicates if it meets the requirements to be Free Software and/or Open Source Software. Was there a license header in the JS files?


Change history is not required.


Though highly appreciated nowadays, if you want to comply with the spirit of the open source licences and not just the letter.


There's either a bug or an easter egg with the Mysterious Wanderer / 100 furs.

The rest of the mysterious wanderer encounters have expectation zero. Give 100 wood, 1/3 chance of 300 wood, 2/3 chance of nothing. Same with 500 wood -- 1/3 of getting 1500 back. And 500 furs.

But 100 furs has a 1/2 chance of giving 300 back, making it a good investment.

(events/room.js:361)


I'm pretty sure it's intentional, and in the source we can see that the mechanics are the same for wood and furs. Both mysterious wanderers will accept 100 units and have a 50% chance of returning with 300. Average marginal return per event: +50 units. You learn over time that this is generally a good deal, and you begin to trust the NPC.

Eventually, the player may get greedy. You'll try giving a mysterious wanderer 500 units of a resource in order to speed up the process, under the assumption that the odds are the same. At this point, there is a 70% chance that the wanderer will be tempted to abscond with your (relatively large) investment. Average marginal return per event? −50 units.

And that's why "builder thinks he isn't to be trusted"!


I played the game through and never realised the wanderers could be trusted at all - I gave them resources a few times, but never got a return!


Oh, I see. I misread the "100wood" one. You're right.


It would have been a neat twist if one of the traders was more trustworthy than the other.

I almost wish I hadn't read the source ;D


This seems like a good, small modification to make and send in a pull request for.


It was written in neatly written javascript. It was already open source. :P


True, it was already source-available. That was already quite nice, especially because it meant I could fulfill my completionist urge by reading the source code to see everything that could've happened.

The change here is that it's been GPL'd, so you could (legally) build another game using parts of it if you wanted.

edit: see also http://blog.doublespeakgames.com/?p=21


That's not what "open source" means.


It was however minified for at least some time. Which made me sad because it greatly limited my abilities to easily cheat.

(I did beat it without cheats but that took quite some time)


I was wondering if all the people that finished the game in less than 4 hours in the other thread were cheating or if I missed something.


I'm not sure if this is cheating, but I set auto-clicking on the buttons with the console and left it open in its own tab so that I could do other things while my minions created steel. Certainly my time spent was considerably less than 4 hours.


You couldn't send a pull request before this.


If you die of starvation or thirst more 10 times, you learn to survive twice as long without food and water respectively.

Now, someone tell me how to rid the village of thieves.


If you wait long enough on the Village screen, they catch the thief. You can either execute him, and get a lot (or all?) of your goods back, or you can learn from him, and get "Stealth", which makes for less wilderness encounters.


This is really cool - Continuities: how interested are you in merging in additions to the game? I'd quite like to add raiders and medicine.


I'm all for expansion, so long as the general atmosphere is maintained. Also, while I intend to maintain control over what gets published to adarkroom.doublespeakgames.com, I have absolutely no problems with other people publishing their own forks with different artistic visions.


Ugh, I knew I shouldn't have looked at these comments. You guys totally spoiled the surprise. =P


It's a great game, but I wonder why the GPLv3 was chosen, since it's incompatible with GPLv2 only code and various other licenses.


Honesty: I know nothing about open source, and obsessively take the newest version of everything.


You should reconsider. GPLv3 has much stricter "copyleft" requirements that make it difficult to use GPLv3 code with code under less radical licenses.


I made this wizard for choosing a licence. Might help you.

http://beza1e1.tuxen.de/licences/


According to the wizard, MPL 2.0 is the right license. Anyone have any more informed opinions?


Why is this important?


I'm not sure I'd say it's important, in the way that Blender getting open-sourced was important or anything like that. But it's a game that a lot of HN readers liked when it was posted a few days ago, and now the source is available under the GPL, so I thought people might be interested. Not so much a major news story; more of an FYI kind of submission.


Reading code is a much better way for a developer to learn than reading articles IMO. Of course writing is even better...


> Of course writing is even better...

I don't think you can compare. There are things you can only pick up from learning from other people (or re-inventing everything yourself), and there are other skills you have to develop yourself.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: