ADRIFT Forum


The place to discuss the ADRIFT Interactive Fiction toolkit

ADRIFT Vs ?

The place to chat about ideas, writing, this forum, or anything related to Interactive Fiction that isn't specific to ADRIFT.

Please also visit the Interactive Fiction Community Forum for further discussions.

Re: ADRIFT Vs ?

Postby ralphmerridew » Wed May 14, 2014 5:12 pm

The four examples saabie's working on were doable in Inform 6. (The changing text is possible, but it's not nearly as clean as I6.) It's not a matter of what's been added; it's the complete design of the language.

The code for ADRIFT's "OneOf" function is written in C#, and is stored in Runner. In order to be able to produce a similar function, a person has to be Campbell Wild. Games that require the new OneOf won't work on old versions of Runner.

The code for Inform 7's "say one of" is written in Inform, and is stored in the game file. Any capable programmer can write their own tweaks to it. Games that require the new "say one of" will work just fine in old interpreters.
Bloodhounds can make you laugh and cuss in the same breath. They are endearing, faithful, and can sling drool ten feet in any direction. -- Virginia Lanier
User avatar
ralphmerridew
 
Posts: 2491
Joined: Fri Dec 13, 2002 11:56 pm
Location: Missouri

Re: ADRIFT Vs ?

Postby David Whyld » Wed May 14, 2014 5:38 pm

Lazzah wrote:Seeing as how Inform 7 (2006) has been around for more than twice as long as ADRIFT 5 (2011), it comes as no surprise that I7 "can do more" than ADRIFT 5. I am sure that, given another 5 years of developement, ADRIFT 5 will be capable of matching I7's performance, if not popularity.


Performance? Maybe. But I think you're kidding yourself that ADRIFT will ever match Inform's popularity.

In fact at one time it might have done just that, but then V5 came out and suddenly everyone stopped using it.
David Whyld
 
Posts: 6518
Joined: Sat Dec 18, 2004 5:15 pm
Location: United Kingdom

Re: ADRIFT Vs ?

Postby Lazzah » Wed May 14, 2014 6:18 pm

David Whyld wrote:
Lazzah wrote:Seeing as how Inform 7 (2006) has been around for more than twice as long as ADRIFT 5 (2011), it comes as no surprise that I7 "can do more" than ADRIFT 5. I am sure that, given another 5 years of developement, ADRIFT 5 will be capable of matching I7's performance, if not popularity.


Performance? Maybe. But I think you're kidding yourself that ADRIFT will ever match Inform's popularity.

Actually, David, I meant to say "if not IN popularity." :blush:
OUT NOW: The Lost Children
Current W.I.P.: Magnetic Moon
Also available: The Axe of Kolt, The Spectre of Castle Coris, The Fortress of Fear, Die Feuerfaust - The Fist of Fire
User avatar
Lazzah
Moderator
 
Posts: 2000
Joined: Thu Mar 31, 2011 4:54 am
Location: London, England

Re: ADRIFT Vs ?

Postby saabie » Thu May 15, 2014 8:22 am

Here is a quick demo I knocked up.
ColorAndPrice.taf
(17.61 KiB) Downloaded 66 times

It has non-repeating random values - Go into the third room and keep pressing the button.
It has a sorted list of objects - Pick up a few things and check your inventory.
It does the check for valuable objects when you enter a room.
Examining an object will give its value (if it has one)
It has a featureless white cube that you can name - use "name cube fred"
Note: This was thrown together quite quickly, so don't expect it to be perfect :P

I am not saying that ADRIFT is easier or better than I7 when trying to do unusual things with it, I'm only saying that its possible.
Nor am I saying that ADRIFT could not be better, I have lots of outstanding enhancement requests for things I do think need improving.
The examples in my demo above could certainly be easier to do if ADRIFT had direct access to individual list elements, or if there were sorting functions, but it still only took 2 or 3 tasks to do each of the features that were asked for.

ralphmerridew wrote: The code for ADRIFT's "OneOf" function is written in C#, and is stored in Runner. In order to be able to produce a similar function, a person has to be Campbell Wild. Games that require the new OneOf won't work on old versions of Runner
But you can now write your own functions, including replacements for the general functions.
They do have some limitations yes, but you can always use an action to run another task if you need something more complicated.
ralphmerridew wrote: The code for Inform 7's "say one of" is written in Inform, and is stored in the game file. Any capable programmer can write their own tweaks to it.
Which is the whole point. ADRIFT is not for programmers, its for interactive fiction writers.
Its still by far the fastest system for quickly drawing a map of a game world and populating it with objects, and those objects can be doors or lockable containers or beds or chairs or lights that automatically illuminate a dark room when you enter it.
Quite complex interactions can be setup by spending no more than a few seconds ticking boxes on each objects property page.
But the biggest advantage of ADRIFT is that you don't have to stop and think HOW to do something.
In other IF systems you have to type out each function in full on the keyboard, which not only takes longer, but is more error prone.
In ADRIFT if you tick the boxes to make a container that a character can go inside of then you know it will always work first time.
If you need to type in several lines of commands to do the same thing, then it is much more likely that there will be a typo or you have written something the wrong way around, which means a lot more time in testing and debugging.

The more complex features of ADRIFT are not meant for the average user, they are there so that other people can write a library that they can then import into their game, adding more properties that they only need to tick or set to a value.
Other systems do the same thing, people write libraries that add extra features and other people use them, such as the code for Inform 7's "say one of" function.

I'm not sure why ralphmerridew used the I6 demo "Balances" as an example of what I7 can do, but here is the code for the featureless white boxes in that demo.
adrift Code: Select all
Class  FeaturelessCube
  with number 0 0 0 0,   ! There's room for 8 bytes of text in these 4 entries
       description "A perfect white cube, four inches on a side.",
       parse_name
       [ i j flag;
            if (parser_action==##TheSame)
            {   for (i=0:i<8:i++)
                    if ((parser_one.&number)->i
                        ~= (parser_two.&number)->i) return -2;
                return -1;
            }
            for (::i++)
            {   j=NextWord(); flag=0;
                if (j=='cube' or 'white' ||
                    (j=='featureless' or 'blank' &&
                           ((self.&number)->0) == 0)) flag=1;
                if (j=='cubes')
                {   flag=1; parser_action=##PluralFound; }
                if (flag==0 && ((self.&number)->0) ~= 0)
                {   wn--;
                    if (TextReader(0)==0) return i;
                    for (j=0: j<8: j++)
                        if ((self.&number)->j ~= cube_text_buffer->j)
                            return i;
                    flag=1;
                }
                if (flag==0) return i;
            }
       ],
       article "a",
       short_name
       [ i; if (((self.&number)->0) == 0) print "featureless white cube";
            else
            {   print "~";
                while (((self.&number)->i) ~= 0)
                    print (char) (self.&number)->i++;
                print "~ cube";
            }
            rtrue;
       ],
       plural
       [;   self.short_name(); print "s";
       ],
       baptise
       [ i; wn = the_named_word;
            if (TextReader(1)==0) return i;
            for (i=0: i<8: i++)
                (self.&number)->i = cube_text_buffer->i;
            self.article="the";
            print_ret "It is now called ", (the) self, ".";
       ],
  has  scored;
 
!  Copies word "wn" from what the player most recently typed, putting it as
!  plain text into cube_text_buffer, returning false if no such word is there
 
[ TextReader flag point i j len;
 
   if (flag==1 && from_char~=to_char)
   {   for (i=from_char, j=0:i<=to_char && j<7:i++)
       {   cube_text_buffer->j = buffer->i;
           if (buffer->i ~= ' ' or ',' or '.') j++;
       }
       for (:j<8:j++) cube_text_buffer->j = 0;
       from_char=0; to_char=0;
       rtrue;
   }
 
   for (i=0:i<8:i++) cube_text_buffer->i = 0;
   if (wn > parse->1) { wn++; rfalse; }
   i=wn*4+1; j=parse->i; point=j+buffer; len=parse->(i-1);
 
   for (i=0:i<len && i<7:i++) cube_text_buffer->i = point->i;
 
   wn++; rtrue;
];
 

If "%Player%>Held.Count <= I" is rocket science then I think that makes the above 11-dimensional quantum mechanics :?
saabie
 
Posts: 821
Joined: Fri Aug 12, 2011 2:07 am
Location: Adelaide, South Australia

Re: ADRIFT Vs ?

Postby Campbell » Thu May 15, 2014 8:34 am

saabie wrote:Here is a quick demo I knocked up.
Nice job! :thanks:
ADRIFT Developer developer.
User avatar
Campbell
Site Admin
 
Posts: 4569
Joined: Sun Jun 23, 2002 11:05 am
Location: Edinburgh, Scotland

Re: ADRIFT Vs ?

Postby David Whyld » Thu May 15, 2014 8:36 am

saabie wrote:But the biggest advantage of ADRIFT is that you don't have to stop and think HOW to do something.


That's only true to a certain degree. The basics? Sure. That's just straightforward. But when you get to the more complex stuff - that old chestnut %Player%>Held.Count <= being a perfect example - it's not like anyone who isn't already a programmer is going to understand how that works.

The same goes for Inform. The basics are very easy to get to grips with, the more complex stuff isn't, but the natural language approach means that it's still easier to understand than the likes of %Player%>Held.Count <= in ADRIFT. In Inform, it'd be

[number of objects held by player]


which is simple and straightforward. You don't need to be a programmer to understand it.

The thing is, Saabie, you're a programmer so you don't see this issue from the non-programmer's point of view, which is what ADRIFT has always been aimed at.
David Whyld
 
Posts: 6518
Joined: Sat Dec 18, 2004 5:15 pm
Location: United Kingdom

Re: ADRIFT Vs ?

Postby Campbell » Thu May 15, 2014 8:45 am

[count objects held by player]
[number of objects held by the player]
[number objects held by player]
[count the objects held by player]
[how many objects held by player]

I could go on. You have to remember the exact syntax. That's ok for the things you use a lot, but if it's something new then you're going to have to look up the exact way to write it. This is something I see again and again when people use Inform - they've written a command that looks sensible, but the compiler expects it to be written in a very specific format.
ADRIFT Developer developer.
User avatar
Campbell
Site Admin
 
Posts: 4569
Joined: Sun Jun 23, 2002 11:05 am
Location: Edinburgh, Scotland

Re: ADRIFT Vs ?

Postby David Whyld » Thu May 15, 2014 9:59 am

How does that differ from ADRIFT? Remembering

[number of objects held by player]


is always going to be easier than remembering

%Player%>Held.Count <=


At least the former makes sense to the non-programmer.

In a way it’s quite ironic that ADRIFT, a system aimed at non-programmers, has %Player%>Held.Count <= where Inform, a system generally aimed at programmers, has [number of objects held by player].
David Whyld
 
Posts: 6518
Joined: Sat Dec 18, 2004 5:15 pm
Location: United Kingdom

Re: ADRIFT Vs ?

Postby saabie » Thu May 15, 2014 10:19 am

David Whyld wrote: H ow does that differ from ADRIFT? Remembering
[number of objects held by player]
is always going to be easier than remembering
%Player%.Held.Count

But you don't need to remember it :)
You just need to know that if you type "Player." then a menu pops up that gives you all of the options, along with a description of what they do.
saabie
 
Posts: 821
Joined: Fri Aug 12, 2011 2:07 am
Location: Adelaide, South Australia

Re: ADRIFT Vs ?

Postby Lazzah » Thu May 15, 2014 11:08 am

saabie wrote:
David Whyld wrote: H ow does that differ from ADRIFT? Remembering
[number of objects held by player]
is always going to be easier than remembering
%Player%.Held.Count

But you don't need to remember it :)
You just need to know that if you type "Player." then a menu pops up that gives you all of the options, along with a description of what they do.

As a non-programmer, I have to reluctantly admit that the Inform7 way of doing things looks much more user-friendly than the ADRIFT5 way.
(Sorry Campbell :blush: )
I am sorry to say that I avoid anything more complex than %Player%.Held.Count like the plague and I even have this expression (and others) saved in a dummy task so I can open the task and copy and paste the expression into the restriction as I need it, rather than have to remember to type %Player%. first. I also tend to use the older functions like %CharacterName[%character%]% in message texts rather than the new expressions. I know I am not the only Drifter who sticks to the "old" way of doing things as I do.
OUT NOW: The Lost Children
Current W.I.P.: Magnetic Moon
Also available: The Axe of Kolt, The Spectre of Castle Coris, The Fortress of Fear, Die Feuerfaust - The Fist of Fire
User avatar
Lazzah
Moderator
 
Posts: 2000
Joined: Thu Mar 31, 2011 4:54 am
Location: London, England

Re: ADRIFT Vs ?

Postby Campbell » Thu May 15, 2014 11:53 am

Lazzah wrote:As a non-programmer, I have to reluctantly admit that the Inform7 way of doing things looks much more user-friendly than the ADRIFT5 way.
(Sorry Campbell :blush: )

If you prefer that way, why not create a Text Override like so, and stick it in your library:

adrift Code: Select all
Original text: [number of objects held by player]
Replacement text: %Player%.Held.Count

Once you've done that, you'll never have to type the function in again.
ADRIFT Developer developer.
User avatar
Campbell
Site Admin
 
Posts: 4569
Joined: Sun Jun 23, 2002 11:05 am
Location: Edinburgh, Scotland

Re: ADRIFT Vs ?

Postby Lazzah » Thu May 15, 2014 12:52 pm

Campbell wrote:
Lazzah wrote:As a non-programmer, I have to reluctantly admit that the Inform7 way of doing things looks much more user-friendly than the ADRIFT5 way.
(Sorry Campbell :blush: )

If you prefer that way, why not create a Text Override like so, and stick it in your library:

adrift Code: Select all
Original text: [number of objects held by player]
Replacement text: %Player%.Held.Count

Once you've done that, you'll never have to type the function in again.

Great idea, but - if you'll excuse my ignorance - how exactly do I "stick it in my library"? OK, I how how to export the gamefile as a module and open it using Notepad. Do I copy and paste that piece of text into the module and save it again? Is that what you are talking about? If so, where in the module would I "stick it"? If not, then how do I "stick it in my library"?
OUT NOW: The Lost Children
Current W.I.P.: Magnetic Moon
Also available: The Axe of Kolt, The Spectre of Castle Coris, The Fortress of Fear, Die Feuerfaust - The Fist of Fire
User avatar
Lazzah
Moderator
 
Posts: 2000
Joined: Thu Mar 31, 2011 4:54 am
Location: London, England

Re: ADRIFT Vs ?

Postby Campbell » Thu May 15, 2014 1:36 pm

  • Go to Settings > Libraries, and deselect all selected Libraries. Click OK
  • Create a New adventure (say No to the Would you like to set libraries question)
  • Create the text override as above
  • Select Export > Module from the menu. Save the file as, e.g. MyLibraryExtensions.amf
  • Please refer to the Creating Libraries section of this help section. Edit the file you saved in Notepad, and trim out the unrequired bits, and save. You should end up with a file that looks something like this:
    adrift Code: Select all
    <?xml version="1.0" encoding="utf-8"?>
    <Adventure>
        <Version>5.0000314</Version>
        <LastUpdated>2014-05-15 14:27:06</LastUpdated>
        <TextOverride>
            <Key>mylib_NumberOfObs</Key>
            <OldText>[number of objects held by player]</OldText>
            <NewText>
                <Description>
                    <DisplayWhen>StartDescriptionWithThis</DisplayWhen>
                    <Text>%Player%.Held.Count</Text>
                </Description>
            </NewText>
            <LastUpdated>2014-05-15 14:25:42</LastUpdated>
            <Created>2014-05-15 14:25:42</Created>
        </TextOverride>
    </Adventure>
  • Go back to Settings > Libraries. Re-check any libraries that were previously selected, and click Add New Library and select your new file. Click OK.
Now, whenever you create a new game or edit a previously saved game, it will import anything in your new library by default.

Alternatively, skip all that and simply save the above text as a module, and include as a new library.
ADRIFT Developer developer.
User avatar
Campbell
Site Admin
 
Posts: 4569
Joined: Sun Jun 23, 2002 11:05 am
Location: Edinburgh, Scotland

Re: ADRIFT Vs ?

Postby Lazzah » Thu May 15, 2014 2:09 pm

Hi Campbell,

Thanks for taking the time to explain all that lot. However, either I have done something wrong or it just doesn't work. :cry:

I did what you said and I created a library file, etc. I put [number of objects carried by player] <=0 as the expression to be evaluated into the restriction of a CLAP HANDS (Completion text "You clap your hands with glee!") task with a failure message of "You need both hands free.". When I ran the game and I typed CLAP HANDS, the response was "You need both hands free." The PC was carrying no objects at the time.

If it's all the same to you, I will stick with my copy/paste method, it's less hassle. :whistle:
OUT NOW: The Lost Children
Current W.I.P.: Magnetic Moon
Also available: The Axe of Kolt, The Spectre of Castle Coris, The Fortress of Fear, Die Feuerfaust - The Fist of Fire
User avatar
Lazzah
Moderator
 
Posts: 2000
Joined: Thu Mar 31, 2011 4:54 am
Location: London, England

Re: ADRIFT Vs ?

Postby Campbell » Thu May 15, 2014 3:08 pm

Sorry, text replacements don't (yet) work with expressions.
ADRIFT Developer developer.
User avatar
Campbell
Site Admin
 
Posts: 4569
Joined: Sun Jun 23, 2002 11:05 am
Location: Edinburgh, Scotland

PreviousNext

Return to General IF

Who is online

Users browsing this forum: No registered users and 2 guests

cron