fiziwig wrote:
What was I thinking? I mean, if there's on thing the world does not need it's yet another IF authoring language. Yet still I'm working on one. Why?
1. Because it's fun. (And that should be justification enough.)
2. Because of the special challenges of my chosen platform.
Hey Gary,
Your basic idea is fairly sound and yes, building a new IF platform is fun. I have some VB.NET code laying around where the only requirement is to have fun trying to create a viable platform in VB.NET. Maybe someday I'll get back to it...
For Textfyre, I have a Glulx engine with a different IO layer and the whole thing is called FyreVM. This was created by vaporware in about 80 hours, which I still find astonishing. Since then I have managed to wrap the engine with a simple state manager and run it on a web server and I called this Zifmia. Then I moved to implementing something useful with this technology.
At first I had the idea of calling "save" after every turn and storing the save files on disk or in a database. But after playing around, I realized it was no more expensive to simply store a binary serialized version of the engine, in a database. As it happens, I'm using Eloquera, a free object database.
So the logic is:
1. user starts game
2. if user has running session, load it and present most recent turn data
3. if user is starting a new session, create the session and present the first turn data
NOTE: A session is the data structure for all of the play of a particular game. I plan to allow one session per game per user when the system is released publicly.
4. user enters a command into the browser
5. ajax call is made to server, sending session identifier and command
6. server loads session, deserializes engine, executes command, saves session, returns turn-data back to browser
7. browser places turn-data in appropriate CSS DIV tags
NOTE: the response turn-data in FyreVM/Zifmia comes in name/value pairs, so the room name is in the LOCN value and MAIN contains the main text response. Other keys include SCOR, TURN, TIME, HINT, HELP, TITL, CHAP, etc.
You can play around with alpha code at beta.textfyre.com, running the demo of Cloak of Darkness. I still have some design tasks to complete, mostly around how to handle displaying and accessing historical turns as well as displaying branches, since the user can "go back" and enter an alternate command at any past "turn". Branching is managed within a session.
NOTE: I do use an MD5 hash routine to prevent storing engines that are identical more than once...thanks to Zarf for that idea...
Anyway...this may give you something to think about as you work on your system...
David C.