Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Creating Adventure Games On Your Computer (atariarchives.org)
15 points by dhotson on July 14, 2008 | hide | past | favorite | 11 comments


If you post an old link like that, can you make it obvious why you did so?


Nostalgia, presumably... The atariarchives.org domain name implies this, at any rate.

I fondly remember typing in Basic programs from books like this one as a kid. I'd consider porting it to Python, except I think it would be a hard sell for kids these days.

Edit: Oh wow... I just looked the atariarchives.org main page. The site author has gotten permission to post many other wonderfully retro books.


Yeah, sometimes I wish I could add some descriptive text to submissions as you suggest. Perhaps I should just add a comment after submitting?

Did you ever have a go at writing text adventure games? I'm kind of curious to see what kind of approach would be used in more modern programming languages. Ideas?


It seems like the program would be overwhelmingly data-driven. Once you decided how to structure your data, most of the rest of the code should come easily. Then, just write a parser and go.

One of these games was one of my first programming projects as a teenager, and I'm sure they have a lot of nostalgia value for other people here too.

This is also worth a look: http://lisperati.com/casting.html :)


Oh thanks for the link, that looks pretty cool.

For some reason it reminds me of _why's mini dungeon in ruby: http://poignantguide.net/dwemthy/

I used to love writing my own adventure games in QBasic. I found that using stuff like GOTO's was actually a pretty good metaphor for moving between rooms.

Now that I think about, an Object Oriented language would make a lot of sense.. these adventure games are basically made up of objects that you interact with.


I don't know what languages you know, but it seems like one could put together something surprisingly quickly in Python. You could go the OO route, or just use dictionaries, e.g.

stairwell = { descr:"You're in a stairwell. There are footsteps echoing from above.", exits=[('up', rooftop), ('down', basement, locked=True)], items=[scrap_of_paper] }

This is not actually very different from the approach taken in the Lisp link.


Ah yep, dictionaries are pretty similar to objects in this sense. Mostly just a matter of notation. I often use dictionaries as a poor man's object.

It could be kind of cool to have proper objects with methods to interact with them. You could use code reflection to figure out what verbs are supported.


Not objects, structs though. The syntax for (and ability to mix types in) Python dictionaries make them really convenient for this sort of thing.

Of course, you can have references to functions in dictionaries and use them for dispatch. I think that's how the OO system is implemented, anyway.

I'm only slightly acquainted with Lua, but it looks like it gets a lot of expressiveness out of having a similarly useful dictionary-like type. I think it calls them 'tables'.


Oh cool, I think that's similar to how JavaScript 'objects' work.

I've heard that it's not that difficult to do object oriented stuff in plain C using nothing but structs and function pointers. I can imagine the syntax would be a pain in the ass and ugly as hell though. :P

I'll have to take a closer look at Lua.. have you used it much before?


Nope. I read about it and played with its interpreter some, but its niche isn't really very relevant to me. It seems designed for when you want something flexible and Python-like to embed in a C program, but you need something minimalistic because memory is really tight.

It looks like a pretty well-designed language, though. It's small and clean enough that one could probably memorize the entire language.


Umm, alright, this is ever so slightly outdated, no?




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

Search: