Quest 5.0 (split topic from: new user with a question)
Alex
28 Nov 2009, 19:04Freak
28 Nov 2009, 20:15Have you taken the time to study compiler design?
Alex
28 Nov 2009, 22:59It doesn't compile games exactly, but scripts are loaded when the game starts into various class instances, so they are not "interpreted" as such once the game is running (you could in theory create games using pure C#). Expressions are handled using the FLEE library which compiles them to .net code in the background.
Anyway this is kind of more detail than I wanted to go into right now... I'll set up a dedicated Quest 5.0 forum in the near future and hopefully there will be a very early, hand-coding-only, no-visual-editor, no-support-for-existing-Quest-games version available early in the new year.
Freak
29 Nov 2009, 16:28What sort of games are you writing as sample Quest code?
Alex
29 Nov 2009, 17:22
msg ("Hello there " + player.name)
could be represented in C# by something like
new MsgScript(new Expression<string>("\"Hello there \" + player.name"))
FLEE compiles the expression to .net IL, but the MsgScript is just an object with an IScript interface.
So essentially we're still not compiling script commands, just interpreting, but without the overhead of "actually" interpreting while the game is running.
We implement object properties at a level above .net properties. "Undo" is built in right from the beginning.
Freak
29 Nov 2009, 19:46msg <first $func1(#var1#)$, then $func2(#var2#)$>
or the equivalent?
And again, what sorts of complex things are you doing in your example games for Quest 5?
Alex
29 Nov 2009, 21:10
Will the specification at least document the exact behavior of such code as
msg <first $func1(#var1#)$, then $func2(#var2#)$>
or the equivalent?
Quest 5.0 doesn't do in-lining - to write the above you'd write something like:
msg ("first " + func1(var1) + " then " + func2(var2))
The logic determining how the expression is evaluated is entirely within FLEE: http://www.codeplex.com/Flee/
And again, what sorts of complex things are you doing in your example games for Quest 5?
Depends what you mean by "complex". But currently Quest 5 does some "simple" things that Quest 4 can't do, such as undo, manipulating lists, and using local variables. The core library is written in ASL itself and supports fairly basic functionality at the moment - no more complex than Quest 4 can handle, but the fact that it's written in ASL means it will be easily extensible to do things that are hard in Quest 4. For example, dealing sensibly with objects that are out of reach of the player, and implementing light sources - these will be built-in to the Quest 5 core library, and implemented in ASL.
Freak
29 Nov 2009, 23:05For example, how much of Museum of Inform ( http://ifarchive.org/if-archive/infocom ... Museum.inf ) could you do?
How much do you have working right now?
(It looks like you're still treating expressions as a special case of the .asl parser, which doesn't fill me with confidence.)
Alex
29 Nov 2009, 23:33Expressions aren't special cases - they are everywhere in ASL. Here are some examples:
foreach (obj, GetObjectsInScope("Visible")) {
msg ("You can see: " + obj.name)
}
if ((a and b) or (c and d) or (somenumber * 3 > somethingelse)) { .... }
foreach (obj, somelist + anotherlist + SomeFunctionReturningAList(AnotherFunction(blah + foo))) { .... }
MyCustomFunction(a, b, c+d)
player.parent = GetRandomRoom(GetNearbyRooms(player.parent))
someobject.take => {
msg ("Blah blah")
someobject.counter = someobject.counter + someotherobject.someproperty
}
Overcat
01 Dec 2009, 23:14Freak
02 Dec 2009, 03:33For the code you just posted, which portions are passed to FLEE?
Also:
How much of the program do you have working at this point?
What would the distribution format for one of those look like?
Alex
02 Dec 2009, 13:03
foreach (obj, GetObjectsInScope("Visible")) {
msg ("You can see: " + obj.name)
}
if ((a and b) or (c and d) or (somenumber * 3 > somethingelse)) { .... }
foreach (obj, somelist + anotherlist + SomeFunctionReturningAList(AnotherFunction(blah + foo))) { .... }
MyCustomFunction(a, b, c+d)
player.parent = GetRandomRoom(GetNearbyRooms(player.parent))
someobject.take => {
msg ("Blah blah")
someobject.counter = someobject.counter + someotherobject.someproperty
}
As for how much currently works, all of the above code would work, if you'd defined the various functions. It is the core library itself which needs developing at this stage, and so far I have that supporting fairly basic functionality (take, drop, printing room descriptions, fairly simple object scopes - taking into account open containers, but not handling transparency or surfaces yet).
The file format is called ASLX and looks a bit like this:
<asl version="500">
<include ref="English.aslx"/>
<include ref="Core.aslx"/>
<game name="Test ASLX Game"/>
<function name="myfunction" parameters="something, blah" type="string">
return (something + blah)
</function>
<object name="lounge">
<start/>
<object name="sofa">
<prefix>a</prefix>
<look>Just a sofa.</look>
<take type="script">
msg ("Test: " + myfunction("one", "two"))
</take>
</object>
<exit name="east" to="hall"/>
</object>
<object name="hall">
<exit name="east" to="kitchen"/>
<exit name="west" to="lounge"/>
</object>
<object name="kitchen">
<object name="sink">
<look>Just an ordinary sink</look>
</object>
<exit name="west" to="hall"/>
</object>
</asl>
Freak
02 Dec 2009, 18:03I expect "include" statements and the like to be in the "development format" (like .inf or .t).
Alex
02 Dec 2009, 19:14There will be something like the .cas format for Quest 5 but it will probably be just a compressed and encrypted .aslx with the libraries included - it's not something I've thought too much about yet.
Freak
02 Dec 2009, 22:34slackers_inc
12 Dec 2009, 22:36What exactly does no visual editor mean? Am I going to have to learn C#? Also, what does no-support-for-existing-Quest-games mean? Does it mean a game created with Quest 4.1.1. won't work with 5.0?"I'll set up a dedicated Quest 5.0 forum in the near future and hopefully there will be a very early, hand-coding-only, no-visual-editor, no-support-for-existing-Quest-games version available early in the new year."
Alex
13 Dec 2009, 15:30So a game for Quest 4.x will work with Quest 5.0, just not in the initial preview version.