Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: Daft text adventure project

by mbond (Beadle)
on May 29, 2001 at 18:27 UTC ( #83942=note: print w/replies, xml ) Need Help??

in reply to Daft text adventure project

Okay ... I did this once, then began converting what i had done to work as a MUD. It is still a work in progress, but this is what i have learned.

1) use strict; -- It will save LOTS of headaches later on

2) Use modules for everything -- Don't try to cram it all into one large file. Break it up. Have your movemnt commands in one modules, fight commands in another, etc ...

3) plan for the future. Make it EASY to add features. More player information, room info, object info. No matter how much you plan when you start, theres always something you have forgotten.

I like using data dumper to dump hashes to text files and get tehm back again. It cuts down on a lot of coding, you don't have to parse any text files. In fact i put all my config stuff in a hash and dumped it to a file that gets loaded when the game starts.

Good luck ... i hopy you have more luck with it than i have ... I have been away from the project coding for another mud for so long that mine is prolly dead ...

Get something good going, RPG games in perl will rock.


Replies are listed 'Best First'.
Re: Re: Daft text adventure project
by Tiefling (Monk) on May 29, 2001 at 18:46 UTC
    Tell me about the data dumper, please, brother. The aforementioned hacker friend said that there was a capacity for hash-dumping, and if the first draft of the program is to retain the current way of handling the data, such a facility would be ideal. I've tried to find out about this before, and failed. (Don't say 'use Super Search', because I'm wasting office time on this thread already, and I don't have a home connection ... yet. I'll do a proper search for all these things later - I greatly appreciate the input of my fellow monks right now. Bless you all.)

    1) Ok, I believe you all about use strict. :-)
    2) This is clearly what I have to learn next.

    3) Absolutely. It struck me that I'm going to have to recode the room data by hand, because I'm going to want the olfactory, visual, auditory and tactile/environmental data of each room to be accessible in bits, to allow for the spells blindness and deafness, not to mention darkness and other environmental effects. Clearly, using a format that will enable me to add other such elements later without another re-write is essential.


      this is a real simple breakdown of the code ...

      its quite simple to do, and not very difficult to figure out :)

      to read a file:
      $filename = "$player_dir/$temp";

      to save a file:
      print FILE Dumper \%myhash;


Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://83942]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (1)
As of 2023-06-04 00:51 GMT
Find Nodes?
    Voting Booth?
    How often do you go to conferences?

    Results (17 votes). Check out past polls.