Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

While you are quite right that using a complete, fully functional game engine is a good idea for most projects, you may be overlooking a few crucial points:

  • Writing a game engine is a very valuable experience.
  • Writing an old school text adventure game from scratch is quite a lot of fun.
  • Many geeks who write games don't actually play them. They just like coding them. (At least thats my personal experience when i write games).

Btw, another very good adventure game engine/IDE is Inform7. You basically describe the scenes, objects and interactions in more or less plain english and it "compiles" it into a working text adventure. I must admit, it's not completly to my liking (quite challenging to do some standard stuff). Here's an experiment i cobbled together a few months ago:

"Wizard" by "Rene Schickbauer" maximum score is 10; Section 1 - The Farm Kansas Prairie is a room. "You are in the middle of the Kansas Prairie +. Nothing but grey skies and brown grass to see, expect for Uncle Hen +ry's farm to the east." Uncle Henry's Farm is east of Kansas Prairie. "The farm looks quite ol +d. Three of the five buildings are already collapsing and the main ho +use is badly in need of a new roof. Only the small shed north of you +seems well maintained." A plough is fixed in place in Uncle Henry's Farm. "A lonely plough re +sts in the middle of the yard." The description is " It looks ancient + and rusty, and it probably hasn't been moved for ages, since rust st +ains the ground around it." Instead of taking the plough, say "I'm not a horse. This is far to hea +vy to move for a human." A shed is fixed in place in Uncle Henry's Farm. The description is "Th +is shed serves as the entrance to the storm shelter." A main house is fixed in place in Uncle Henry's Farm. The description +is "This is the main house of the farm. As well serving as squalid li +ving quarters, kitchen and moonshine distillery, it is also the hen h +ouse. The roof is rather leaky, but on the plus side, Uncle Henry can + grow his psychedelic mushrooms in the attic." A haystack is fixed in place in Uncle Henry's Farm. "At the west side +of the yard, you see a small haystack." The description is "Rotten as + it may look, this hay will be the only source of food for Uncle Henr +y's two horses this winter." Instead of taking the haystack, say "Well, i heard of searching for a +needle in a haystack. But taking the whole haystack with me seems kin +d of pointless." Instead of searching the haystack: if the needle is in Smurg begin; now the player has the needle; say "Amazingly, you find a sharp needle in the haystack!"; award 10 points; otherwise; say "You spent hours riffling through the haystack. But you fi +nd nothing else."; end if; Section 1 - Shed and Shelter The Inside shed is north of Uncle Henry's Farm. "This is a very *small +* shed. There is a door on the south and a ladder leading down to the + storm shelter." The Storm shelter is a room. "This massively build storm shelter will +survive any storm! The three meter thick walls of concrete and the ma +ssive, sliding steel door make sure of that." The shelter door is a locked door. The shelter door is down from the I +nside shed and up from the Storm shelter. The description is "This is + a massive, sliding steel door. It is nearly twenty centimeters thick + and damn near unbreakable. There is a keyhole on the left side of th +e door frame." Report opening the shelter door: if the player is in the Inside shed begin; say "You pull with all your might. Slowly, the heavy steel doo +r starts sliding silently into its doorframe." instead; otherwise; say "You press the red button labeled 'Open door' and the door + swishes open, just like the one on Kirk's bridge." instead; end if; Report closing the shelter door: if the player is in the Inside shed begin; say "You push on the door with all you got. Slowly, the heavy +steel door starts closing until it shuts with a mighty bang." instead +; otherwise; say "You press the green 'Close door' button and the door slam +s shut in less than a second." instead; end if; Understand "lock [something]" as locking keylessly. Locking keylessly +is an action applying to one thing. Check locking keylessly: if the noun is open, say "You must close [the noun] first." instea +d; if the noun is not a door, say "[The noun] is not something you ca +n lock." instead; if the noun is locked, say "[The noun] is already locked." instead +; if the player carries the needle and the player is in the Inside s +hed, try locking the noun with the needle instead; if the player is in the Inside shed, say "You can't lock the door +from this side without some sort of key!" instead. Carry out locking keylessly: now the noun is locked. Report locking keylessly: if the player is in the Inside shed begin; say "You fiddle with the needle in the key hole for a few minu +tes. Then you give up, slam your steel capped boot into the door fram +e and [the noun] locks with rather pleasing 'clonk'." instead; otherwise if the player is in the Storm shelter; say "You flip over the deadbolt on [the noun] and it locks wit +h a satisfying 'clunck'."; otherwise; say "You lock [the noun]."; end if; Understand "unlock [something]" as unlocking keylessly. Unlocking keyl +essly is an action applying to one thing. Check unlocking keylessly: if the noun is not a door, say "[The noun] is not something you ca +n lock." instead; if the noun is unlocked, say "[The noun] is already unlocked." ins +tead; if the player does not carry the needle and the player is in the I +nside shed, say "You can't unlock the door from this side without som +e sort of key!" instead. Carry out unlocking keylessly: now the noun is unlocked. Report unlocking keylessly: if the player is in the Inside shed begin; say "You fiddle with the needle in the key hole. After a few m +inutes you manage to unlock [the noun]." instead; otherwise if the player is in the Storm shelter; say "You flip over the deadbolt to unlock [the noun]."; otherwise; say "You unlock [the noun]."; end if; Report unlocking: if the player is in the Inside shed begin; say "You fiddle with the needle in the key hole and unlock [th +e noun]." instead; end if; Section 998 - Play area limitations Instead of going nowhere: if the player is in Kansas Prairie begin; say "The Kansas Prairie is vast and stretches seemingly foreve +r into the horizon. You don't want to get lost!"; otherwise if the player is in Uncle Henry's Farm; say "Uncle Henry told you not to go there!"; otherwise; say "You bump into an invisible wall."; end if; Section 999 - Hidden Objects Smurg is a room. A needle is in Smurg. It unlocks the shelter door. The description is +"A sharp needle. It looks new."

Not everything in this (rather badly designed) example works as expected, it's quite a mess and some things i did are needlessly complicated. But hey, i am a Perl guy. Explaining something to a computer in plain english lacks style ;-)

"You have reached the Monastery. All our helpdesk monks are busy at the moment. Please press "1" to instantly donate 10 currency units for a good cause or press "2" to hang up. Or you can dial "12" to get connected directly to second level support."

In reply to Re^2: Perl Moo. by cavac
in thread Perl Moo. by Dipseydoodle

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (5)
As of 2024-04-23 07:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found