Page 1 of 2

AGI Interpreter February 2025 Update

Posted: Sun Feb 16, 2025 8:22 am
by Manannan
CommanderX16 February 2025 AGI Update
I have an update regarding my CX16 AGI Interpreter.
shortExport.gif
shortExport.gif (2.37 MiB) Viewed 14304 times
Over the past few months, I have completed three major tasks:

-Implementation of double buffering: The 3D effect mentioned in my previous post requires redrawing of sprites. To prevent this redrawing from occurring within an IRQ, double buffering was implemented, eliminating sprite flicker.
-Implementation of NPC movement routines: As shown in my GIF, the fairy, wolf, and bridge troll now move. They also remain within the boundaries set by the game.
-Implementation of sprite garbage collection

Focus for the Next Few Months
Developing a more efficient dynamic sprite memory allocator:
My current allocator is highly inefficient, as it allocates sprites in fixed sizes of either 32x32 or 64x64. With double buffering now in place, sprite memory requirements have significantly increased.

I have a C implementation of an allocator that works with blocks based on the smallest sprite size (8x8). If a sprite is larger, it is assigned multiple blocks. I will translate this into assembly code and replace my existing allocator.

Fixing object placement bugs:
There are several issues with object placement in the game. In particular, when the player walks into the moat or transitions to a new screen, objects are sometimes positioned incorrectly, and the Z-ordering is not always handled properly.

The current implementation lacks key logic, and I plan to reference known interpreters such as Lance Ewing’s Agile to improve accuracy.

Re: AGI Interpreter February 2025 Update

Posted: Thu Feb 20, 2025 7:17 am
by WauloK
Very cool! I can't wait to see the final product! :)

Re: AGI Interpreter February 2025 Update

Posted: Thu Feb 20, 2025 1:44 pm
by Manannan
WauloK wrote: Thu Feb 20, 2025 7:17 am Very cool! I can't wait to see the final product! :)
Thanks for the encouragement :)

Re: AGI Interpreter February 2025 Update

Posted: Fri Mar 07, 2025 6:03 am
by Xiphod
Thanks for the update, and the screen shots - the fairy, troll, and the well!!! Good memories.

Still, I want to HEAR this game, someday ^.^ (oh, we can dual X16 it, use serial card to cue another X16 to play the audio with a few command bytes :P )

Re: AGI Interpreter February 2025 Update

Posted: Fri Mar 07, 2025 10:39 pm
by Manannan
Xiphod wrote: Fri Mar 07, 2025 6:03 am Thanks for the update, and the screen shots - the fairy, troll, and the well!!! Good memories.

Still, I want to HEAR this game, someday ^.^ (oh, we can dual X16 it, use serial card to cue another X16 to play the audio with a few command bytes :P )
Hi Xiphod,

Glad I could take you back to good old days :).

In terms of getting sounds implemented, here are the next three things I was planning to work on

- Fix Sprite Allocator
- Replace the object placement and movement code with the one in Lance Ewing's Meka
- Sound

The current object placement code is the cause of many bugs, and the game will never be fully playable until I have replaced it.

However if it would make for a better demo I could swap two and three? Is that your motivation?

Thanks

Re: AGI Interpreter February 2025 Update

Posted: Fri Mar 07, 2025 11:36 pm
by cosmicr
Xiphod wrote: Fri Mar 07, 2025 6:03 am Thanks for the update, and the screen shots - the fairy, troll, and the well!!! Good memories.

Still, I want to HEAR this game, someday ^.^ (oh, we can dual X16 it, use serial card to cue another X16 to play the audio with a few command bytes :P )
The PSG is perfect for playing AGI sounds - I got it working when I was writing my interpreter. Very authentic sounds identical to the Tandy 1000. Really looking forward to seeing this all come together!

Re: AGI Interpreter February 2025 Update

Posted: Sat Mar 08, 2025 10:55 am
by Xiphod
Manannan wrote: Fri Mar 07, 2025 10:39 pm However if it would make for a better demo I could swap two and three? Is that your motivation?
Well, I put it this way: the AGI support on the CoCo3, they never managed audio support. So it would be nice to see that it is something an 8-bit system could pull off (via delegating to a support chip).

The CoCo3 could do multi-channel audio (see CoCoTracker, playing MODs at like 8KHz), but it's difficult to pull off (adapting the channel data to the 6-bit DAC, so there is a load process where that adaptation process is probably using a lot of RAM -- I don't think it's real time computed).

One special thing to me on the early Sierra games was the subtle background audio effects (like birds chirping). Specifically, here's an example of the original KQ1 PCjr version (1min 49 seconds in). Seems many later versions didn't include that background audio effect.
<https://www.youtube.com/watch?v=v5DSFvWrNWA&t=102s>


And for inspiration, here's an easter egg in KQ4 (notice the hamburger in space!)
kq4spoof.jpg
kq4spoof.jpg (110.02 KiB) Viewed 12017 times

Re: AGI Interpreter February 2025 Update

Posted: Sun Mar 09, 2025 6:33 am
by Manannan
Xiphod wrote: Sat Mar 08, 2025 10:55 am
Manannan wrote: Fri Mar 07, 2025 10:39 pm However if it would make for a better demo I could swap two and three? Is that your motivation?
Well, I put it this way: the AGI support on the CoCo3, they never managed audio support. So it would be nice to see that it is something an 8-bit system could pull off (via delegating to a support chip).

The CoCo3 could do multi-channel audio (see CoCoTracker, playing MODs at like 8KHz), but it's difficult to pull off (adapting the channel data to the 6-bit DAC, so there is a load process where that adaptation process is probably using a lot of RAM -- I don't think it's real time computed).

One special thing to me on the early Sierra games was the subtle background audio effects (like birds chirping). Specifically, here's an example of the original KQ1 PCjr version (1min 49 seconds in). Seems many later versions didn't include that background audio effect.
<https://www.youtube.com/watch?v=v5DSFvWrNWA&t=102s>


And for inspiration, here's an easter egg in KQ4 (notice the hamburger in space!)
kq4spoof.jpg
I have never heard those sounds before having only played the game on later DOS PC's.

The input to my program is the standard DOS version of the game, which lacks these sounds.

I will have to put some effort into obtaining a version of the game with sound effects (maybe Apple II) and modifying my program to be able to read the files.

Re: AGI Interpreter February 2025 Update

Posted: Sun Mar 09, 2025 6:57 am
by Xiphod
I seem to remember these sounds in the original Tandy version also (which had a 3-voice audio).

I might be mis-remembering, but as I recall King's Quest was an "in secret" launch title for the PCjr. IBM had Sierra do NDA's even about it. Then when it launched, IBM used their typical (gray) product covering, making it look really boring. The whole PCjr barely lasted a year before they gave up, and King's Quest was essentially forgotten about for about 2-3 years until it was relaunched for the Tandy 1000 (then maybe also Apple2, Amiga and other platforms).

In that same PCjr link, the audio is in other outdoor scenes, like around 33:00 or 36:30 (also sounds of water/waves).

Re: AGI Interpreter February 2025 Update

Posted: Mon Mar 10, 2025 9:04 am
by Manannan
Xiphod wrote: Sun Mar 09, 2025 6:57 am I seem to remember these sounds in the original Tandy version also (which had a 3-voice audio).

I might be mis-remembering, but as I recall King's Quest was an "in secret" launch title for the PCjr. IBM had Sierra do NDA's even about it. Then when it launched, IBM used their typical (gray) product covering, making it look really boring. The whole PCjr barely lasted a year before they gave up, and King's Quest was essentially forgotten about for about 2-3 years until it was relaunched for the Tandy 1000 (then maybe also Apple2, Amiga and other platforms).

In that same PCjr link, the audio is in other outdoor scenes, like around 33:00 or 36:30 (also sounds of water/waves).
Thanks. I managed to obtain the Tandy version. I will take a look

I have no idea how different the file layout is.

Once I do then I can work out how big a change is needed.