5 ms·
Creating Adventure Games On Your Computer
- swombat 18y agoUmm, alright, this is ever so slightly outdated, no?
- bprater 18y agoIf you post an old link like that, can you make it obvious why you did so?
- jcl 18y agoNostalgia, 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.
- dhotson 18y agoYeah, 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?
- silentbicycle 18y agoIt 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 http://lisperati.com/casting.html :)
- dhotson 18y agoOh 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/ 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.
- silentbicycle 18y agoI 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.
- dhotson 18y agoAh 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.
- silentbicycle 18y agoNot 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'.