My readers know I'm an avid video gamer, and I've been reading the reviews for Skyrim, the latest Elder Scrolls game with great interest. One of the more interesting facts I read this week was that the game would support infinite, randomly generated quests. While these quests will - probably - be somewhat simple - it is an interesting concept and probably something that was fun to code.
So with that being said, your Friday Puzzler is to create this concept. No, I'm not asking you to build a RPG. Not at all. Rather, I'm asking you to simply generate a quest description in text. You can go serious...
Travel to the mount of San'tooth and find the evil necromancer Lord Maelneborn. Slay him and bring back the Amulet of Kings so that peace be returned to the kingdom.
Or not so serious...
Travel to the mount of the Slightly Lemon-Scented Peaks of Fred. Slay the not-terribly-evil-just-a-bit-lazy accountant Bob and bring back the Sword of Copy and Paste+1.
As always, this should be fun, quick, and please use pastebin to share your code. You can paste the results in the comment though.
Archived Comments
This one was fun! Reminded me of the quest giver in the old MUDs I used to play.
http://pastebin.com/WJSt60W2
<cfset oQuest = createObject("component","quest").init()/>
<cfoutput>#oQuest.generateQuest()#</cfoutput>
On a video game note: Ray, you gonna be playing any SWTOR?
I've got SWTOR pre-ordered. Can you run your code a few times and post the results? (Yes, I'm being lazy.)
Got the CE pre-ordered myself. Playing the beta this weekend, very excited :).
Here's some output:
Brave adventurer! There is a terrible threat to our kingdom. You must find and slay Tim. They were last seen near The Galaxy of Terror. Find them, slay them and untold riches shall be yours!
My Friend! I'm glad you are here. Could do me a favor? I need you to deliver Super Robot Gloves to my good friend King BadGuy The 3rd in The Zone of No Return. KTHXBAI!
Psst. Come closer. I have heard tale of Sword of 10000 Truths. Rumor has it that it is located in Teddy Bear Junction. All that's left is for someone to claim it!
Greetings! I was wondering if you could do me a favor. My good friend Tim has crafted Sword of 10000 Truths for me. Could you travel to Mt Death and get it for me?
Not quite as elegant as some but still a lot of fun:
http://pastebin.com/ECQsBL93 (cfm page)
http://pastebin.com/VgMevdqe (cfc)
Random text generated:
Travel to the mount of the Copy and Paste of Bob. Slay the 404 not found Bob and obtain the armor of Buffer Overflow +9.
Journey to the village of the Slightly Moistened of Joe. Destroy the Buffer Overflow James and steal the gauntlets of 404 not found +3.
Travel to the valley of the Butress of Cunning of Bill. Fragment the Butress of Cunning James and steal the gem of Buffer Overflow +2.
Not exactly random but pretty funny:
http://pastebin.com/WJSt60W2
Couple of outputs:
Don Patrick Tosney it has recently come to our attention that Seth Balboa has been stealing Our Money. You must Destroy Seth Balboa to ensure the safety of Our Money. We are all counting on you Patrick Tosney, do not let us down!
Stop John Platts before it is too late and he Destroy you. John Simmonds , it is vital for The Gold that you do not fail!
There has been a raid on The Swag by the dastardly Peter Kilgallon. The people have chosen you, Don Kurt Platts as their champion. Lambast all comers on the road to Lambast Peter Kilgallon!
copy and paste skills not great here is my link:
http://pastebin.com/b6MSUgxQ
a very fun exercise. not the most elegant or random....
result:
"Skip to Walmart and find Michele Bachmann. Noogie her and bring back Boyzoid's Cooler so that civil unrest can be returned to the Round Table."
http://pastebin.com/6YgBNny5
http://pastebin.com/aTNFnukC
I am using AngularJS and ColdFusion. You can submit stories (like a madlib) and will save these to a JSON file and then randomly generate Quests from all the user submitted entries:
Example that I just refreshed:
Travel to the city of New York and slay Herman Cain.
Retrieve the ColdFusion and restore balance to the lives of the Mistborn!
You can see a working web version of mine here:
http://cfmumbojumbo.com/que...
Nice use of Angular there. :)
Thanks, Ray! I love how easy and slick the two way databinding in AngularJS is. See how the text fills out in the preview section as you type? That would have taken a fair amount of boilerplate JS to do from scratch. As well as the datavalidation.
Nice....Tim...