
“A Dark Room” game open-sourced - mjn
https://github.com/Continuities/adarkroom
======
kybernetikos
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?

~~~
grannyg00se
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.

~~~
reledi
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.

~~~
MisterBastahrd
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.

~~~
qznc
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.

------
Continuities
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...

~~~
anigbrowl
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!

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

[1]
[https://github.com/Continuities/adarkroom/blob/master/script...](https://github.com/Continuities/adarkroom/blob/master/script/engine.js#L3)

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

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

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

*Or, more likely, drink to forget.

------
Dove
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.

~~~
Jd
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.

~~~
Dove
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.

~~~
Jd
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.

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

------
Cogito
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](https://github.com/Continuities/adarkroom/pull/7)

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

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

~~~
Cogito
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.

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

------
willvarfar
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/](http://williame.github.io/ludum_dare_23_tiny_world/)

~~~
mjn
The canonical playable version is already hosted online on his own site:
[http://adarkroom.doublespeakgames.com/](http://adarkroom.doublespeakgames.com/)

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

Bit late now, perhaps.

~~~
starefossen
Or just use the rawgithub url:
[http://rawgithub.com/Continuities/adarkroom/master/index.htm...](http://rawgithub.com/Continuities/adarkroom/master/index.html)

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

~~~
Continuities
Merged, my man.

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

~~~
maxsilver
Dwarf Fortress?

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

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

------
iM8t
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.

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

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

------
Patrick_Devine
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?

~~~
Jd
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.

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

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

------
Aardwolf
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?

~~~
Spittie
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](http://opensource.org/docs/osd)

~~~
PhearTheCeal
>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.

~~~
dragonwriter
> 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](http://www.gnu.org/licenses/gpl-
faq.html#MereAggregation)

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

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

------
Dove
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)

~~~
etjossem
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"!

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

~~~
etjossem
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

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

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

~~~
mAritz
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)

~~~
johnchristopher
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.

~~~
Jd
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.

------
siddboots
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.

~~~
scott_karana
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.

------
Zarkonnen
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.

~~~
Continuities
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.

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

------
synchronise
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.

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

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

[http://beza1e1.tuxen.de/licences/](http://beza1e1.tuxen.de/licences/)

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

------
dakimov
Why is this important?

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

~~~
eru
> 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.

