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.

Messages - AGKorson

Pages: [1] 2 3 ... 17
AGI Syntax Help / Re: 1400 pictures?
« on: December 03, 2023, 09:56:20 PM »
If it's just pictures, I think I could create a Power Pack function to allow more than 256. The directory would be the trickiest part- you'd need another DIR file with a custom format. Repurposing VIEWDIR might be an option, if views aren't being used - you could easily double the number of views to 512.

Or (more preferable to me) embed the DIR information in a normal resource. That'd make it easier to allow greater than 512 pictures. Picture 0 is perfect for this, as it's rarely used in games.

For resources other than pictures (I'm looking at you, logics), I'm not sure there's an easy answer - AGI just isn't built to support more than 256 resources because they use byte values for resource numbers. (Pictures are the exception, because nothing else interacts with them, so custom functions would be relatively easy to write.)

You could allow for more than 255 rooms relatively easily using standard AGI code. Use a variable to track a 'page' value; each page can then hold 255 rooms. When a new room is loaded, use the page number and currentRoom number to run the correct code. Depending on complexity of code, you might still be limited, trying to fit enough code for multiple pages into each logic.

The priority screen option wouldn't really work, because when it's shown, the interpreter pauses the game. Without a hack of some kind, you couldn't interact with the priority screen.

Everything-Else / Re: A Curious Facebook Suggestion
« on: November 26, 2023, 11:07:54 AM »
Also the OBJECT file- how could I forget that? Beginning with version 2.411 (including all v3 interpreters), the OBJECT file is encrypted with 'Avis Durgan'.

Everything-Else / Re: A Curious Facebook Suggestion
« on: November 24, 2023, 09:50:25 PM »
Compression in AGI v3 came in two flavors, a version of LZW for logics, sounds and views, and a special compression (that converted 8 bit color values into 4 bit nibbles[ since only 4 bits are used to define colors]).  AGI v3 can read both compressed and uncompressed resources, as determined by the header (if uncompressed file size in header was equal to compressed size, AGI assumes no compression). When loading a logic, if the resource is compressed, AGI assumes the message section is NOT encrypted. If the logic is NOT compressed, then the same decryption as in v2 (using Avis Durgan) is applied.

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) {
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.

AGI Syntax Help / Re: Object failing to cycle?
« on: November 22, 2023, 09:40:39 AM »
If you're bored and want to look into an AGI bug:

In logic45 of SQ2 you can either sling a rock at the ape or lure him down and sneak into the elevator. Normally you would hide behind the elevator until the ape exits and then sneak around to enter the lift, but you can just walk through the guard and trigger the exit script without getting caught. You do get caught if you're more obvious. Below a certain y or something as he exits.

Threepwang loves having these bugs fixed in his translations and you might enjoy solving something like this.

I'm on it! Like stink on poo!

The game is afoot!

Once more, unto the breach!

Hold the mayo!

wait - never mind, keep the mayo...

AGI Syntax Help / Re: Object failing to cycle?
« on: November 17, 2023, 02:24:12 PM »
I was bored this morning, and decided to poke around in some of the old posts for anything that might be interesting. I saw this old post, and thought I'd add some insight as to what was the original problem.

Looking at cluadehuggins' code, the most likely cause of his problem is failing to reset flag f52. Without seeing the entire source code file, I can't say for sure, but if f52 does not get reset, then in every cycle, the gelnath object will be reset to cel 0 - it'll never get a chance to cycle.

When using flags to initiate blocks of code like this, you have to make sure to reet the flag so the block only runs one time.

AGI Development Tools / WinAGI Version 2.3.2
« on: November 04, 2023, 01:31:28 PM »
Here's a link to the latest version:

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' 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.

AGI Development Tools / Re: Errors when compiling KQ3 with WinAGI
« on: August 23, 2023, 09:43:58 PM »
OK, thanks. My bad- I misunderstood and thought you meant the actual game files were made public.

I wonder what happened when the game was compiled by Sierra that caused sound36 to get truncated from what was in the source files...

AGI Development Tools / Re: Errors when compiling KQ3 with WinAGI
« on: August 23, 2023, 01:15:22 AM »
Excuse me for butting in, but have you guys looked at the version of that sound in the now-public KQ3 repository? If I am doing this right, it is bigger and also not broken - but not being an AGI guy, I can't tell for sure.
Can you share a link to that? I've never heard of a public repository for AGI games. The KQ3 version I have is 2.14, dated 3/15/88, and the files I used to find the sound36 issue come from disk images of my original 5.25 disks. I wonder what version is in that repository?

AGI Development Tools / Re: Errors when compiling KQ3 with WinAGI
« on: August 23, 2023, 01:06:30 AM »
The version of KQ3 that I have (Version 2.14  3/15/88, as noted in Logic0) specifically calls the ignore.objs on the cat object in that room.

The room is Logic5. During first run of Logic5, it loads Logic104, which contains all code related to the cat. There's roughly a 1 in 3 chance the cat will appear. If it does, the cat is assigned to screen object o13. Immediately after running Logic5, the command
Code: [Select]
ignore.objs(o13);is called. So all other objects, including ego, ignore the cat and can walk through it. Curiously, this appears to be the only room where the cat is set to ignore objects.

I don't know why that's so.

Are you sure your version (unmodified) does NOT ignore the cat in that room? Because there is no way that editing a sound can affect a logic in that way.

AGI Development Tools / Re: Errors when compiling KQ3 with WinAGI
« on: August 16, 2023, 12:34:52 AM »
Well, you are quite right, Sound 36 in KQ3 is definitely odd! I looked at it closer, and discovered that it IS a valid resource, at least in the sense that the entry in the SNDDIR file does in fact point to a resource in VOL.1 that can be loaded by the MSDOS interpreter. Track 0 of that resource is what you hear in the game (as you described).

HOWEVER, that resource has bad pointers for tracks 1, 2, and 3. All three of those tracks have starting and/or ending locations well beyond the end of the resource, meaning they don't point to any valid data.  Track 0 is 757 bytes long (151 5-byte notes, with trailing FF-FF marker). But the resource is 1035 bytes long. There are ~280 bytes of extra data; they contain notes that are nearly identical to the first 48 notes of track 0, but with slightly different duration and volume settings. I'd guess it's remnants of a previous version of the sound.

Logic 7 is where that sound gets used. It works in MSDOS because only track 0 is played. The bad data for the other tracks are never accessed so you never know there's a problem. The Sierra interpreter is full of examples where badly formatted resources run OK due to bugs and such.

WinAGI detects the bad track data and assumes the sound is no good. That's why it gives the invalid resource error. I assumed the error was an invalid pointer in SNDDIR (there are several Sierra games where I've seen that) but turns out I was wrong! Now that I understand what's going on I can update WinAGI to better handle this situation.

The only workaround I can suggest is to not do a full game compile; if you just compile dirty logics, the other resources (pics, views, sounds) are left alone. Or you could manually extract the resource from the VOL file, fix it in a hex editor, then import it back into sound 36. Or, you can just use the repaired sound file that I've attached to this thread. I'll make it a priority to do some kind of patch in the next version of WinAGI that can deal with this problem.

You also helped me find another bug in WinAGI - when compiling, all ResourceIDs are stored in a list so they can be used as defines. But when a resource gets deleted, its ResourceID isn't removed from the list. That leads to the odd behavior you are seeing. I'll fix that for the next version.

Sound 36 is definitely needed in KQ3. It works in original MSDOS interpreter even though it has bad data in it. WinAGI sees the bad data and considers it an invalid resource. I need to update WinAGI to allow corrupt sounds as long as there's enough good data to play in MSDOS. A repaired version of Sound 36 is attached that you can use to continue working on the game in WinAGI current version.

AGI Development Tools / Re: Errors when compiling KQ3 with WinAGI
« on: August 14, 2023, 05:24:11 PM »
LOL! I see what happened! The correct syntax for conWAGI is to put the wag file first, THEN the switches. So you should use
Code: [Select]
"C:\Program Files (x86)\WinAGI GDS\conWAGI.exe" AGI.wag /c
When I did my quick test, I didn't realize the arguments were backwards! Later, looking more closely I realized the problem.

So, try it again with the correct syntax. (Note you'll still need to remove the bad sound36, or the console will give you the same 'invalid sound resource' error as the windowed version.)

AGI Development Tools / Re: Errors when compiling KQ3 with WinAGI
« on: August 14, 2023, 04:48:51 PM »
Hi rzil,

KQ3 does in fact come with an invalid sound resource #36 in it. Sierra quite often shipped games with orphaned resources, or resources with bad pointers (that's the case here). The MSDOS interpreter is very forgiving of these kinds of errors - as long as the game doesn't try to access them, it happily runs the rest of the game.

WinAGI on the other hand (and I believe AGI Studio has similar behavior) is able to identify the bad pointer for sound 36 and mark it as invalid. As long as there's an invalid resource, WinAGI will not compile a game. That's the error you're seeing. The correct action is to remove the invalid resource (as you did).

I suppose I could have instead wrote the game compiler to ignore any invalid resources and compiling the rest (providing feedback to the user). But no one's ever suggested that's a feature that would be desirable. Not sure I would want to do that even if asked. I'd have to think about it.

Regarding the error from the console, I'll have to look into it. I didn't get a lot testers to look at the console app, so it's possible (probable?) that there are some errors still lurking about. A quick check of the app in my test environment shows the same behavior you're describing. So something is definitely wrong.  I'll take a look at it tonight and let you know what I find, and if there's a temporary fix available.

I'll be releasing version 2.3.2 when I finish my demo game, hopefully in the next month or so. I'll definitely include a fix for this once I figure it out.

thx for the bug report!

If I've given you something to laugh about, that's a good thing. The world needs more laughter.

You're welcome.

I should also point out that WinAGI actually DOES NOT include indent/outdent as context menu options either - I thought it did, but then realized I never actually added it. It's been at the bottom of the 'TODO' list for a very long time.

So I guess this is still true:
Quote from: AGKorson
A good UI offers multiple options.

Maybe I'll add it in the next update...

Pages: [1] 2 3 ... 17

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

Page created in 0.024 seconds with 20 queries.