Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - AGKorson

Pages: [1] 2 3
1
Everything-Else / Laws should be written in computer language
« on: March 26, 2024, 11:13:48 AM »
I was reading a recent US Supreme Court decision that involved how to interpret a statute that had a number of conditions that had to be met in order for a certain outcome to be triggered. The politics of the case and decision are not relevant to this post, plus it's always safer to avoid politics in forums such as these. But if you are interested in reading the source document, you can find it here:
https://www.supremecourt.gov/opinions/23pdf/22-340_3e04.pdf

The issue at hand in the case is how to read a section that lists three clauses as conditions to be met in order to get access to a particular outcome. The problem is the wording that was used in the statute. To paraphrase, it says:

Outcome X is granted if the applicant does not have-
  • condition A;
  • condition B; and;
  • condition C;
The plaintiff argued that ALL THREE must be met to prevent outcome X. The defense argued that any ONE of the three prevents outcome X.

Personally, I believe the defense is more correct when you look at the context, but regardless, it made me think how much hassle and confusion could be avoided if complex conditional clauses in legal writings were written in computer language. It would be simple to test in order to determine if it gave the intended results and would almost completely eliminate ambiguity.

It doesn't take much exposure to writing code to learn to appreciate how important it is to understand exactly what outcome you want, and then be able to construct conditional clauses that give the desired results. In this case, if they had used something like C# to write this clause, all confusion would easily have been eliminated. If the true intent was the defense's position, a clause like
Code: [Select]
if ( !A && !B && !C )
{
    outcome(X);
}
would work perfectly.

On the other hand, if the plaintiff's reading was what they really wanted, they could have written
Code: [Select]
if ( !(A && B && C) )
{
    outcome(X);
}

It's fascinating to me to read through all the linguistic arguments both sides go through to figure out how to parse the text. They actually touch on Boolean logic (although they don't explicitly label it as such) - trying to explain how 'not', 'and', and 'or' relate to each other when constructing complex conditionals. But in the end, you have two sides arguing over how to convert imprecise English text into the precise Boolean logic needed to consistently apply the statute.

But if the statute was just written in code in the first place, all ambiguity could be eliminated. And if there's still ever doubt about what the result should be with any given set of conditions, you can replace courts and lawyers with a simple compiler! A win for everyone, I say.

Maybe I should run for congress on that platform!

Or maybe we can just wait for AI to achieve sentience. I suspect our cyber overlords will handle all their legal affairs with much cleaner language than what we use today. It'll probably be in machine code, though, so they'll be the only ones who understand it.

2
I was recently asked this question in a separate conversation. AGI is a very primitive language that does not include any flow control statements except 'if-else' and 'goto'.

But you can easily write code to duplicate the 'for' loop structure.
A standard 'for' loop in more complex languages looks like this:
Code: [Select]
for (<init-expression>; <condition-expression>; <update-expression>)
  {
  [ statements to repeat in each loop
  }


Here is an AGI template that will do the same:
Code: [Select]
<init-expression>;
:forloop1
if (<condition-expression>) {
  [ statements to repeat in each loop
  <update-expression>;
  goto(forloop1);
}


Here's an actual example to see it in action:
Code: [Select]
v99 = 10;
:forloop1
if (v99 > 0) {
  [ statements to repeat in each loop
  print("Countdown: %v99");
  --v99;
  goto(forloop1);
}

WinAGI includes a snippet that handles creating the 'for' loop template. All you have to do is type
Code: [Select]
#for(v99 = 10, v99 > 0, --v99)#

and the code block is automatically inserted!

Snippets are a powerful tool in WinAGI that can help with a lot of other coding tasks. Check out the WinAGI Help File for more information, or post a question here, and I'd be happy to help.


3
AGI Development Tools / WinAGI Version 2.3.6 - Fixes Game Import Bug
« on: January 24, 2024, 10:40:30 AM »
Version 2.3.6 is available here:
http://agiwiki.sierrahelp.com/images/c/c6/WinAGI_2_3_6.zip

It fixes the bug in earlier versions that caused WinAGI to crash when importing a game.

EDIT: version 2.3.6 fixes one more minor bug in import game function

4
AGI Development Tools / AGI Power Pack Release 0.0
« on: December 14, 2023, 10:30:02 AM »
As mentioned in the post below, the AGI Power Pack is now available for use. The 'prize' for completing the demo game is a link to the location of the actual Power Pack source files. (It's not really hidden- you could probably find it online if you really want it, but I thought it would be fun to make it a bit of a puzzle hunt to start with.)

If you decide you want to write a game using the Power Pack, it is super easy to implement. Just drop the logic source file that matches your target AGI version  into your AGI game and call it from logic 0 as the very first thing when your game starts. Once that's done, all the features of the Power Pack instantly become available!

Writing code to use the Power Pack features is easy when using WinAGI. Code snippets make adding new commands just as easy as adding regular AGI commands. And the extra features of the resource editors and tools make writing AGI games much simpler, whether using the Power Pack or not!

The biggest enhancements in the Power Pack include:
  • adds mouse support! including ability to load custom cursors, automatic support for menus, inventory selection screen, and save/restore screens; also supports 'click-to-move' control of ego
  • adds sound board and MIDI support! automatically detects presence of Sound Blaster or compatible sound board and MIDI device to provide four-channel sound support
  • moves logic message text to a separate memory segment, freeing up heap memory for non-text resources
  • modifies 'graphics' and 'text.screen' commands to allow displaying eighty columns of text, in addition to the default forty column modes normally used by AGI
  • adds a new 'auto-cycle' feature that will stop/start cycling an object when it stops/starts moving, whether due to changing its direction value, or if it hits an obstacle
  • MAJOR enhancements to the trace function; the window can be repositioned anywhere on the screen; variables and flags can be viewed and modified while the tracer is active; the output is better formatted to make it easier to read

Additional features include:
  • modify the character printing functions to allow use of extended characters in graphics and text modes, regardless of color
  • adds a new function to allow setting message box colors (foreground, background and border) to any combination of colors
  • modifies the color attributes and text printing functions so text will print with any combination of foreground and background colors on the graphics screen
  • adds support for custom status lines; variables and flags can be designated to 'watch' to determine when to do an update
  • adds new command to allow changing the mode of the string compare function in the compare.strings test command between binary (all characters match exactly), text (case is ignored but all other characters match exactly) or AGI (the default where case is ignored, and white space and several separator characters are ignored)
  • adds many new string manipulation functions, including strLen, strCopy, strConcat, strLeft, strRight, strMid, strTrim, strInstr, strFormat, str2byte, hex2byte, byte2hex, strUpper, strLower
  • adds new bitwise math functions (or, and, xor, not, shr, shl)
  • adds new commands to change the color palette, and also fading the display in/out for really cool graphics effects
  • adds new commands that let you change message text, menu text and inventory item text dynamically
  • adds new function that allows sending picture draw commands to the screen after the picture is displayed
  • adds new commands to load and play sounds by variable, and also to discard sounds
  • adds ability create/read/write/delete data files using string values
  • adds support for words in WORDS.TOK to start with non-letters, and also for words to contain extended characters
  • modifies 'clear.text.rect' and 'clear.lines' commands so that the color that is passed is used, instead of just using black or white; by passing negative values, the region is scrolled up instead of being cleared
  • modifies 'set.text.attributes' command to allow passing colors by variable, and to allow "pushing" and "popping" the current attributes to make it easier to manage color changes
  • modifies the 'get.num' command so it ignores non-numeric key presses
  • adds new command to allow setting the input line text programmatically
  • adds new command to allow changing internal clock to trigger 60 times a second, instead of 20, allowing more precise control over movement and cycle timing
  • adds a command to create a countdown timer feature to help create accurate time triggered events and actions
  • adds new command to copy the current input line or the previous input line to a string
  • adds new functions to get the priority and visual colors for any coordinate location on the screen
  • adds functions to allow retrieval of current date/time
  • adds new function to poll the shift, ctrl and alt keys, allowing greater control over keyboard events
  • adds new test command to check if a coordinate is occupied by a pixel of a given screen object
  • adds new format option for message text that allows access to messages in any loaded logic resource
  • adds new command to temporarily hide all screen objects on the picture display
  • adds new command to allow pausing the internal game clock while the game is still running

The Power Pack source files contain a ton of comments that explain in great detail how to use each of the features. You can also examine the source code for the Demo game for additional insight as to how to use the Power Pack to give your games a powerful boost.

And you can always drop me a line here, either in the forums, or by PM if you have any questions or comments.


I want to believe that the AGI community isn't completely dead, and that this effort might inspire at least one more quality fan made game. Help me AGI Community, you're my only hope...

5
AGI Development Tools / Introducing Sierra Quest: Power Pack Demo
« on: December 14, 2023, 10:16:58 AM »
At long last, here it is folks!
Sierra Quest: Power Pack Demo

The AGI Power Pack is an AGI logic script that takes advantage of a buffer overflow in the set.string command that allows direct manipulation of the program code within memory, unlocking new capabilities and enhancements in the AGI engine.

The Power Pack Demo game demonstrates all of these features so you can see what's possible. In the game, you are Drew, who has traveled to Oakhurst California to visit the former Sierra headquarters building. Drew is hoping to find some souvenirs from Sierra's golden age, including the fabled Power Pack project, long rumored to be an abandoned enhancement to AGI that was ultimately beaten out by SCI.

You will need to provide your own interpreter files, and the game will only run in DOSBox (or any other fully compatible MSDOS emulator, or on an original PC with MSDOS if you have it!)

The full source code for the AGI Power Pack and the Demo game will be publicly released shortly. Until then, if you successfully complete the Demo game, you'll be provided with information as to the location of the source files. If you do find it, please leave a message here. I'd love to hear about your success and any thoughts you have about the game or the Power Pack.


6
AGI Development Tools / WinAGI Version 2.3.4
« on: December 14, 2023, 10:14:59 AM »
A new version of WinAGI, 2.3.4, is available for download here: http://agiwiki.sierrahelp.com/images/1/1a/WinAGI_2_3_4.zip
(2.3.3 had a major bug in the NewGame function)

No major enhancements, but it fixes a couple minor bugs. If you're going to use the AGI Power Pack (see the post above), you should update to the latest version of WinAGI.

Enjoy!

7
Forum Support and Suggestions / AGI Wiki Is Broken
« on: December 14, 2023, 10:06:52 AM »
I was trying to upload a new version of WinAGI to the AGI wiki, and discovered it's broken. Something is wrong with the way it handles links to other pages.

Links that use a typical page/subpage hierarchy such as http://agiwiki.sierrahelp.com/index.php/Main_Page give a 'too many redirects' error, but if you format the link as http://agiwiki.sierrahelp.com/index.php?index=Main_Page then it loads fine. As far as I can tell, all internal links to other wiki pages are using the broken format. This makes it nearly impossible to navigate through the wiki.

As a workaround you can inspect the address of the page you want to go to then type the page in manually, adding the '?index=' syntax in place of the 'slash' syntax.

The SCI wiki has links that include the '?index=' format for the most part, so it navigates between pages without error. One exception I found is the 'Random page' link. It returns a page formatted in 'slash' syntax, but curiously, it doesn't give an error, it just dumps to the main page regardless of what the actual page address is.

8
AGI Syntax Help / Fixing a bug is SQ2 Room45
« on: November 22, 2023, 11:16:36 PM »
In another thread, there was a question about how to fix a bug in Space Quest 2. In room 45, Roger normally has to hide from the ape guard to be able to get into the elevator. But if Roger is standing too close to the elevator door when it opens the ape guard walks through Roger instead of shooting him.

The code in this room is very complex, but basically what it does each cycle is to first determine if Roger is in the guard's line of sight or not. If he is, then if the guard isn't knocked out (or otherwise unable to see Roger due to being in the elevator, or doing something else), the guard will shoot him.

The guard's movement and actions are handled primarily by tracking a 'sequence' value in variable v30. For example, when v30 equals 17, the guard goes to the elevator; v30 is then set to 18 indicating the guard is in the elevator going down, then when the door opens, v30 is set to 19 and the guard walks out of the elevator.

The bug happens because the code for the guard taking a shot at Roger skips the check if the guard is in the elevator OR exiting the elevator (i.e. when v30 ==18 or v30==19).  So if Roger is too close to the door, by the time the guard finishes walking out, Roger goes right through him into the elevator (the guard is set at beginning of logic to ignore objects).

By the time the guard begins checking to see if Roger is in line of sight, Roger is already behind him in the elevator.

The way the logic is coded is a bit more complicated than that basic description, but it is fixable. You need to do two things to fix the bug - make Roger 'visible' to the guard when the elevator door opens, and then have the guard check for a shot at Roger when the door opens.

Here are some code snippets that you can use to make the fix:

Find this code block in Logic45:
Code: [Select]
  if (v30 > 16 &&
      v30 < 19) {
    set(f32);
  }
change the if tests to read
Code: [Select]
  if (v30 > 16 &&
      v30 < 19 && !isset(f31)) {

then find this code block:
Code: [Select]
        if (v30 != 18 &&
            (v30 == 1 ||
            v30 > 14)) {
          v32 = 1;
        }
and modify it by adding an 'else' block:
Code: [Select]
        if (v30 != 18 &&
            (v30 == 1 ||
            v30 > 14)) {
          v32 = 1;
        }
        else {
          if (v30 == 18 && isset(f31)) {
            v32 = 1;
          }
        }

With this change, if Roger is standing in front of the elevator door when it opens, he will get shot immediately; he can no longer 'ghost' his way into the elevator.

9
AGI Development Tools / WinAGI Version 2.3.2
« on: November 04, 2023, 01:31:28 PM »
Here's a link to the latest version:
http://agiwiki.sierrahelp.com/index.php?title=File:WinAGI_2_3_2.zip

Changes include:
  • added file drag/drop support for main window
  • the Find dialog now remembers last ten search terms
  • added toolbar buttons to the logic editor for indent/outdent
  • when importing or opening a game, resource errors that don't prevent compiling or running a game are now included as warnings in the warning list
  • when importing a game, the decompiler will use the gameid found in the game's set.game.id' command, if found
  • added option to copy picture draw commands to clipboard as readable text
  • added new readonly mode to words editor that sorts all words alphabetically
  • the Game Property form now groups the properties into four tabs; with more room on the tabs the properties are now better arranged
  • many minor enhancements and bugfixes

Most of these updates came from using WinAGI to finish the AGI Power Pack Demo game, which is mostly complete now. Using it to actually make something gives much more insight than development-based testing.

Speaking of the demo game, I am looking for one more tester who can play through the beta version and help me identify potential bugs and improvements to player input. If you want to help and can commit to some detailed testing, please send me an IM.

10
The Demo Game is almost complete. It's playable from start to finish. I still have some title screen graphics and a few sound effects and music to add. It's basically an alpha version right now; not quite beta but close.

But the biggest hurdle I have left is adding code to be responsive to as many player inputs as possible. I have a couple folks already helping with this, but I could use one more person who's got a little time to go through each screen in the game, and help come up with as many things a player might want to type in (i.e. 'look at tree', 'get bucket', 'kick the dwarf', etc) and what might be good responses.

If that's something you can help with, please PM me.

Here's one more teaser screenshot:


11
AGI Development Tools / New WinAGI Version 2.3.1
« on: May 12, 2023, 01:06:11 PM »
You can get it here:  WinAGI version 2.3.1

The most noteworthy enhancements in this version include:
  • adds a text screen editor, to make creating help screens and other text displays much easier
  • adds support for original Sierra syntax; if you want to import original Sierra source code, and/or write a game using Sierra syntax, you can do that now
  • the logic compiler will now compile the entire logic and note all errors, instead of stopping at the first error it encounters; saves a ton of time when trying to compile a logic that might have multiple errors
  • included files can be opened by right-clicking their include definition entry (and can support relative paths to find files anywhere in your game's directory hierarchy)
  • Picture Editor has a new 'text' test mode where you can use print, print.at and display commands to see how text will appear (and provide code snippets that can then be pasted directly into logic source)
  • a bunch of other minor enhancements and bug fixes

I've been working hard on my Power Pack Demo game; I hadn't planned on updating WinAGI at the same time but I discovered that actually using it to author a game was the best way to find out where the bugs were and where enhancements were needed to make game development even easier. Go figure...

Speaking of the Demo Game, all the game play, and 99% of the graphics are done. More about that in a separate thread.

I'm also going to make the source for my C# conversion public. I don't know when I'll have time to work on it any time soon. I did get the AGI object model converted, and it is working. I have a shell for the editor in place, and it can open and preview all game elements. But I have not touched any of the editors. If anyone is interested in it, then they can do what they want with the code. It's just not a priority for me at the moment.

12
Everything-Else / ChatGPT is WRONG!
« on: May 08, 2023, 09:59:07 PM »
I decided to try out this new-fangled thing called ChatGPT. I asked it to explain AGI. Its response was mostly correct. However it had this to say about AGI's design:

Quote from: ChatGPT
The AGI engine was designed to allow for the creation of graphical adventure games with a point-and-click interface.

That's not quite right. True, some point-and-click capabilities were added near the end of AGI (for non-MSDOS systems), but it certainly wasn't what it was originally designed for.

But what was even more disconcerting was the response to this question:
Quote from: AGKorson
Have you heard of WinAGI Game Development System?
(yes, maybe just a small bit of vanity- what can I say?)

Here's what it had to say:
Quote from: ChatGPT
Yes, WinAGI Game Development System is a software tool that allows users to create their own adventure games using the Adventure Game Interpreter (AGI) engine developed by Sierra On-Line in the mid-1980s.

WinAGI was developed by Alex and Phillip Fontana and was first released in 1998. It is designed to be an easy-to-use tool that allows game developers to create their own adventure games without needing to write code or have specialized technical knowledge.

Who the hell are Alex and Phillip Fontana??? Why are they credited with creating my program?  (Also, suggesting that there's no need to write code to use WinAGI is completely wrong!)

I confronted ChatGPT with the truth:
Quote from: AGKorson
What is your source? I know you are wrong- WinAGI was created by Andrew Korson. I know this because I AM Andrew Korson

After thinking for several seconds, Chat responded:
Quote from: ChatGPT
An error occurred. Either the engine you requested does not exist or there was another issue processing your request. If this issue persists please contact us through our help center at help.openai.com.

OK, I guess I broke it! "You can't handle the TRUTH!"

I then tried the 'Regenerate response' button just to see what would happen. I got this:
Quote from: ChatGPT
I apologize for the error in my previous response. Thank you for letting me know that WinAGI Game Development System was actually created by you, Andrew Korson. I appreciate the correction and will be sure to update my knowledge accordingly.

To answer your original question, WinAGI Game Development System is a software tool created by Andrew Korson that allows users to create their own adventure games using the Adventure Game Interpreter (AGI) engine developed by Sierra On-Line in the mid-1980s. It was first released in 1998 and remains a popular tool among enthusiasts of classic adventure games and the AGI engine.

I apologize again for the mistake in my previous response, and thank you for bringing this to my attention.

So at least I got an apology. But it never did reveal its (incorrect) source. I did a 'normal' search of the Internet, and couldn't find anything connecting WinAGI with Alex and Phillip Fontana. But then again, I'm an old curmudgeon, so maybe there's something there that I just missed.

I think I'll skip the whole AI thing and continue using actual humans for conversation. But now I'm wondering - how many of the profiles on this site are actually human? Maybe ALL of you are just AI bots??? Maybe I'm a bot???

I miss the 1980s...

13
AGI Development Tools / Sierra's Debug/Testing Version of AGI
« on: February 03, 2023, 03:16:24 PM »
I was looking at the source code for some of the AGI games found in the repository that EricOakford posted in this post.

The source for Black Cauldron includes a set of interpreter files (agi.exe, agidata.ovl, etc). The version for this set of files is 3.002.097, which is not one that I have ever seen before. So I disassembled it to see how it might differ from other versions. There is a publicly released version 3.002.098, so I expected it to be very similar to that.

It is not.

Instead, this appears to be a special version, presumably used by Sierra developers and testers during game development. It does not use VOL files or DIR files. Instead, it looks for a file named 'WHERE' in the game directory that has four directories which point to where individual resources are stored. The first points to compiled logics (which need to be in the form of 'RM.0, RM.1, etc.), the second points to picture resources (PIC.1, PIC.2, etc.), the third to view resources (VIEW.0, VIEW.1, etc.) and the fourth to sounds (SND.0, SND.1, etc.)

I imagine it was a lot easier to do testing with this interpreter, because you didn't have to rebuild the VOL and DIR files every time you made a change to a resource. You would only do that for the final release.

The source also includes volume definition files (BCVOL0.DRV, BCVOL1.DRV, etc) that I am guessing were used by their in-house tools to actually build the VOL and DIR files. Each definition file is a text file that lists the resources that would be included in each VOL file (same format for resources, RM.0, PIC.1, VIEW.2, SND.3, etc).

I'm still looking at the disassembled code to see if there are any other testing/debug features in this version that don't exist in the publicly released versions.


14
I'm making good progress on the Power Pack Demo. Puzzles are ~99% done, art is ~90% and coding is ~80%. But I decided to take a little break. Threepwang just released his French translation of SQ1, and is beginning work on SQ2. To help him with that project, I threw together this simple modification to SQ2 that demonstrates some of the power pack features in addition to extended character support.

You can download the patch here:
https://1drv.ms/u/s!AioUx5fucQP0mv8cx3AHjjk_V1QOCA?e=OF3ajE

The patch only works if you already have a copy of MSDOS version 2.0D SQ2. And once patched, it will only run in DOSBox or on a native MSDOS system.

Enjoy


15
AGI Development Tools / WinAGI Version 2.2.6 Available for Download
« on: October 09, 2022, 10:47:44 PM »
Latest version fixes several minor bugs, including one that fails to save the Platform Options property on the Edit Games Property form.

It also adds a new feature that tracks 'TODO' items, which is really handy during development to help remind of things you need 'to do'!

http://agiwiki.sierrahelp.com/images/9/97/WinAGI_2_2_6.zip

Pages: [1] 2 3

SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.029 seconds with 12 queries.