Author Topic: C# AGI Interpreter  (Read 5400 times)

0 Members and 1 Guest are viewing this topic.

Offline lance.ewing

Re: C# AGI Interpreter
« Reply #45 on: January 19, 2019, 01:25:13 PM »
Okay, that parsing issue is now fixed.

The text in one of the text windows was wrapped differently. I thought I had that working properly, but I'll need to take another look and see why this particular one isn't right.

And I've found the cause of this text window issue as well. When Roger searches the dead body of Vohaul, the message that is displayed has two spaces between two of the words (as stored in the LOGIC resource), but when it renders it to screen, it removes one of the spaces so that only one space is rendered between these two words.

Offline Collector

Re: C# AGI Interpreter
« Reply #46 on: January 19, 2019, 09:08:01 PM »
I did spend quite a bit of time looking at DDP and MUMG because they do some unusual things, unusual when compared with the core set of AGI v2 games.
The booter version of DDP? The "DOS" version floating around on the internet is actually a hacked version of the booter that crashes at points when you press certain keys like escape.
KQII Remake Pic

Offline lskovlun

Re: C# AGI Interpreter
« Reply #47 on: January 20, 2019, 01:52:02 AM »
The booter version of DDP? The "DOS" version floating around on the internet is actually a hacked version of the booter that crashes at points when you press certain keys like escape.
There is a DOS version according to NewRisingSun here.

Offline lance.ewing

Re: C# AGI Interpreter
« Reply #48 on: January 20, 2019, 04:50:14 AM »
The booter version of DDP? The "DOS" version floating around on the internet is actually a hacked version of the booter that crashes at points when you press certain keys like escape.
There is a DOS version according to NewRisingSun here.

No, not the original booter version, although I know the booter version is available on the Wayback Machine. According to that information from NewRisingSun, it appears that I have the rare DOS 1.50 version of DDP, since that is the version that comes up in the game. I can't remember now where I got it from, but the file timestamps indicate that I've had it for at least 8 years, which isn't long after I joined sciprogramming.com. I just tried downloading the DDP version on Al Lower's web site and that doesn't currently work with my Interpreter straight off. It doesn't like the OBJECT file, so I replaced it with the OBJECT file from the version I have. That allowed the game to start up properly, but after I viewed the game version within the game, it fell over with an error that I haven't investigated yet. So still a bit of work to do then for that version of DDP. NewRisingSun says that one is the Amiga data files running on a DOS Interpreter. Is there also a hacked version of the booter available? It wouldn't surprise me.
« Last Edit: January 20, 2019, 04:53:52 AM by lance.ewing »

Offline lance.ewing

Re: C# AGI Interpreter
« Reply #49 on: January 20, 2019, 07:47:26 AM »
I just tried downloading the DDP version on Al Lower's web site and that doesn't currently work with my Interpreter straight off. It doesn't like the OBJECT file, so I replaced it with the OBJECT file from the version I have. That allowed the game to start up properly, but after I viewed the game version within the game, it fell over with an error that I haven't investigated yet.

The AGI Interpreter used by the version on Al's site is 2.272. I think my Interpreter is not compatible with early versions of the original Interpreter at this stage, so that is probably a good test case. I know that various things changed between the versions that I am not yet accounting for.

Offline Collector

Re: C# AGI Interpreter
« Reply #50 on: January 20, 2019, 09:56:50 AM »
Perhaps my memory is wrong and I was thinking of the hacked Amiga version, not booter. I would be interested in seeing the DOS 1.50 version.

This does bring up a question of how hard would it be to add support for AGI games from other platforms? Then there are the fan games that have memory or stack issues that will run in NAGI, but not the original interpreters.
KQII Remake Pic

Offline lance.ewing

Re: C# AGI Interpreter
« Reply #51 on: January 22, 2019, 02:17:56 AM »
I doubt that I would extend the Interpreter to support other platforms. At the moment I see it as covering all of the DOS AGI V2 and V3 games. Not sure if I'll extend it to AGI V1. There seems little point. One of the main goals was to integrate it with Visual AGI, i.e. run a game created within Visual AGI. That requirement doesn't need to support many different versions of platforms I don't think.

Regarding fan made games and memory issues, in theory my Interpreter should be able to play all of the fan made games without any such issues, because it doesn't have the same memory limitations. So it is a bit like NAGI in that regard. It would certainly allow you to run a game that would not work in the original Interpreter. Not sure if that is a good or bad thing. It would probably be quite difficult to exactly match the original AGI Interpreter's memory management and restrictions.

Offline Collector

Re: C# AGI Interpreter
« Reply #52 on: January 22, 2019, 09:41:42 AM »
You have a point about AGI1 games. I am not sure if I even have any outside of what may be on some of my booter disks. I do have a copy of the 2nd IBM release of the original KQ, but wouldn't that be GAL, more than purely AGI? I wish I had a means of extracting the files from my booter disks.
KQII Remake Pic

Offline lance.ewing

Re: C# AGI Interpreter
« Reply #53 on: January 22, 2019, 02:36:40 PM »
AGKorson is helping me with an issue in KQ4 to do with effective Y calculation of fixed priority objects that I will hopefully have resolved later today. Thanks Andrew for identifying the issue.
...
Next game I want to try playing through to the end is KQ4.

Andrew's suggestion on how to fix the effective Y issue did indeed fix the problem I was having with one of the dwarves in the mine.

I've started playing through KQ4 and I'm now up to about a third of the way through I'd say. I discovered another bug in the room with the pool and cupid. It wouldn't understand it when I said "get bow". Turns out that I hadn't properly implemented the "AND" part of "if" statements, in that I hadn't put in the shortcut break out when it encounters the first condition that is false. So what it was doing was evaluating everything in the AND. Normally that wouldn't have mattered, but some test conditions have side effects, "said" being the one in this case. There were multiple "get bow" said tests in the room script, and it believed it had already matched the input with an earlier test, but actually it should never have tested that particular "said". All I was missing was a "break" in one of my for loops. That fixed the issue and I was able to progress.

Offline lance.ewing

Re: C# AGI Interpreter
« Reply #54 on: January 25, 2019, 04:55:31 PM »
I just noticed the attached priority screen from PICTURE 57 in KQ4AGI (the witches cave).

Offline lskovlun

Re: C# AGI Interpreter
« Reply #55 on: January 25, 2019, 07:44:55 PM »
Hmmm, how does that even work?

Offline lance.ewing

Re: C# AGI Interpreter
« Reply #56 on: January 26, 2019, 04:35:41 AM »
Not sure if this is what you mean, but since all of those blue control lines are drawn above the black control line, then there is no way that they can affect ego or the witch that chases her. Their base line would stop at the black control line and not go any higher. So one of the game developers (John Hamilton I assume) must have thought it would be fun to put some control line graffiti in that area of the priority screen. I've seen other not so obvious examples of this in other rooms. For example, in room 110, I can see CHRIS written in black control lines within one area, which would be Chris Hoyt. There is something else written in another area on that priority screen but I can't make it out. - Also in room 26, one of them has written "HI" in one area. - I wonder how many other Sierra games have examples of this.

Offline lance.ewing

Re: C# AGI Interpreter
« Reply #57 on: January 26, 2019, 04:46:10 AM »
I've started playing through KQ4 and I'm now up to about a third of the way through I'd say.

I have now finished playing through to the end of KQ4. So that I could get through as quickly as possible, I've been following video walkthroughs. In this particular case, it was a walkthrough that got the maximum or 230 points.

I did find another blocking bug along the way. Actually it was blocking in more ways than one. It blocked my progress getting further in the game, and it was to do with the rendering of a blocking control line. I had a bug in my add.to.pic implementation to do with the rendering of the control box that prevented the ghost boy from climbing the ladder. So I fixed that then was able to play through to the end.

There is another bug I noticed, I think to do with the follow.ego implementation. Pretty much any character that tries to chase ego just seems to randomly move, more like a wander, but not even that. Every step seems to be randomly placed, like its doing some kind of weird dance. I hadn't noticed any follow.ego issues in other games so far. I plan to go back and confirm that its working in earlier games, and if so, then take a closer look at the KQ4 LOGIC scripts for the rooms where this happens to see what is going on.

p.s. I just tried out two more of the KQ4AGI easter eggs, the "beam me up" one and the "rap kq" one.
« Last Edit: January 26, 2019, 04:56:37 AM by lance.ewing »

Offline lance.ewing

Re: C# AGI Interpreter
« Reply #58 on: February 10, 2019, 12:41:54 PM »
There is another bug I noticed, I think to do with the follow.ego implementation. Pretty much any character that tries to chase ego just seems to randomly move, more like a wander, but not even that. Every step seems to be randomly placed, like its doing some kind of weird dance. I hadn't noticed any follow.ego issues in other games so far. I plan to go back and confirm that its working in earlier games, and if so, then take a closer look at the KQ4 LOGIC scripts for the rooms where this happens to see what is going on.

This bug is now fixed. It turns out that my Interpreter was updating the stopped flag too often. It should only update it when the step time counter hits zero. It was correctly updating the animated object's position on the counter hitting zero, but for updates to the stopped flag, it was doing this on all values of the step time counter. The result was that it thought the animated object was stopped (i.e. hadn't moved) in the current cycle (which is true, but is of no relevance if it hasn't tried to update the animated object's position in that cycle). This lead to the seemingly random movement, because the follow ego logic chooses a random direction if the animated object is stopped by something. So my Interpreter was mistakenly thinking it had been stopped when it hadn't and therefore making it select a random direction to avoid whatever had supposedly stopped it.

I also fixed two other bugs I found in KQ4: One of these was in any room with a zombie. The whole game slowed down to a complete halt for about 10 seconds whenever the first zombie came out of the ground. Turns out this was due to the Logic script trying to start the same sound 20 times in a row. I assume that in the original AGI interpreter, this didn't have any impact on performance, e.g. perhaps it just immediately started playing the sound again from the start with no noticeable effect, but in my Interpreter, it generates the WAVE file data on the fly before playing a sound and doing this 20 times in quick succession was slowly things down to a crawl. I considered caching generated sounds, which perhaps I might still do for the current room. For now I've got a check in there that if it tries to play a sound that is already playing, it just leaves it playing and does nothing. This fixes the issue in the zombie rooms.

The other issue was in the KQ4 Help screen. It was being displayed with a black background where the original game has a white background. This was being caused by a difference in how the background colour is used when switching to the text screen. The original Interpreter sets the text attribute value using the currently set background and foreground, and then uses the background part of the text attribute when clearing the screen. I changed my Interpreter to do the same and now this issue is also resolved.

There is only one other issue I know of now that affects KQ4, and also SQ2, in fact it is possible that it affects all games but so far I have only observed it in those two games. For some reason the "Save game" option in the menu stops responding after a while. All other menu options continue to work. I had a similar issue a while back that affected a number of menu options, but this new issue seems to affect only the "Save game" option. That will be the next issue I try to track down.

Offline lance.ewing

Re: C# AGI Interpreter
« Reply #59 on: February 10, 2019, 05:13:05 PM »
There is only one other issue I know of now that affects KQ4, and also SQ2, in fact it is possible that it affects all games but so far I have only observed it in those two games. For some reason the "Save game" option in the menu stops responding after a while. All other menu options continue to work. I had a similar issue a while back that affected a number of menu options, but this new issue seems to affect only the "Save game" option. That will be the next issue I try to track down.

And now this issue has also been resolved. The issue was that the Interpreter wasn't re-enabling all menu items when restoring or restarting after death. I also noticed that I wasn't setting the RESTART flag on a restart, which meant that the credits and story weren't being skipped for games that use that flag.


SMF 2.0.14 | SMF © 2017, Simple Machines
Simple Audio Video Embedder

Page created in 0.125 seconds with 23 queries.