NHacker Next
  • new
  • past
  • show
  • ask
  • show
  • jobs
  • submit
How Did Rogue Generate Its Random Dungeons? (howtomakeanrpg.com)
throwlifeaway 17 hours ago [-]
Once every few years I find myself dumping many many hours into Nethack (the open source successor to rogue). Never once have I beaten it, despite playing usually with several tabs open to various wikis and guides. Eventually I die while on a super long run (by my standards) and totally give up in frustration, beginning the next several-year dormant period until the next time I play.

To any game developer planning to call their game with random upgrades a "rogueli[tk]e": play Nethack. Your favorite roguelike was almost certainly created by someone who did.

chuckadams 4 hours ago [-]
I'm thinking of making a mobile game that's a clicker or something completely not roguelike, naming it "Roguelike Roguelike", and ensuring that the word "roguelike" appears in every sentence of the description. I'll make tens.
ButlerianJihad 1 hours ago [-]
https://en.wikipedia.org/wiki/Rogue_(video_game)#At_UC_Berke...

Rogue has been under a BSD license since 1986, so Nethack’s predecessor is also F/OSS.

hosel 16 hours ago [-]
I never got into Rogue, though I did love Nethack. If you’re into these actual rogue-likes, I picked up Caves of Qud recently, highly recommend.
explodes 2 hours ago [-]
Qud is legit incredible. Compared to nethack and ADOM, it might be considered "easy", as I've never beaten those two, but have finished Qud a few times. It is still a really deep game.
red-iron-pine 2 hours ago [-]
won a Hugo Award recently IIRC.

fun game. Book of the New Sun meets Nethack meets Gamma World.

avadodin 18 hours ago [-]
I missed a definition for "random".

Did it have a specific PRNG and seed?

Was it platform–dependent?

McGlockenshire 14 hours ago [-]
Literally the second line of the article addresses your questions by linking to the source code repo under discussion. Every single one of the sidebars about the topics being discussed links directly to the relevant code.

The article even tells you it's C. The copyright dates on the code are 1980ish. It's talking about rogue, not rogue.exe, so this is going to be on Unix, real Unix. So, it'll be using rand(), the bad one, surely, just by what it is and where it is. That completely answers all your questions.

All you had to do was click links.

edit2: lmao okay so I read the code myself and you'll never, ever guess what it does. It does NOT use rand().

suprjami 11 hours ago [-]
Spoiler: Rogue just implements its own Linear Congruential Generator.

    #define RN (((seed = seed*11109+13849) & 0x7fff) >> 1)
I've poked around in a couple of libraries from this time. At least QuickBasic and QuickC also implemented an LCG (not the same one either). So a 1980s PRNG from Microsoft just gave you an LCG with different constants.

I would not be surprised if other contemporaries like glibc, Borland, Watcom, Lattice, etc all did the same. Or did they do something else/better?

avadodin 8 hours ago [-]
Thank you.

I think the algorithm used and the seeding method are very relevant in procedurally generated games like Rogue, Elite and Minecraft so I was disappointed when the author just used Random().

And yes I could have read the code or remembered a previous time whence I might have learnt the same bit of information but instead I read the article.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact
Rendered at 17:35:12 GMT+0000 (UTC) with Wasmer Edge.