Author Topic: Introducing agikit  (Read 64 times)

0 Members and 1 Guest are viewing this topic.

Offline natbudin

Introducing agikit
« on: February 20, 2021, 01:46:26 PM »
Hey AGI fans!  I'm pleased to introduce something I've been working on.  It's called agikit, and it's the beginnings of a cross-platform development toolchain for AGI.  agikit is written in TypeScript and aims to provide an extensible, flexible, open-source platform for building AGI development tools.  It is very, very early stage right now.  :)

NPM page:
Github repo:

Itís super early stage, itís not yet compatible with WinAGI, AGI Studio, or other similar tools, but: it can decompile and recompile Kingís Quest I, and the result runs in ScummVM.

Why do this, particularly when good IDEs are already out there?  Part of the reason was just nostalgia; I used to make AGI fan games back in high school and I wanted to revisit it now that I'm older and know more about software development.  Additionally, I wanted it to be possible to develop AGI games on non-Windows platforms and using your choice of text editor.  This isn't intended in any way to compete with the excellent tools that exist, but rather, to open up the world of AGI development to a wider audience.

Another big reason for this is that I wanted to learn about how compilers really work by building one, so the resulting app here is quite different from how Qt AGI Studio works, in that it does AST generation, control flow analysis, optimization passes, etc.  One interesting result of this is that the code it generates can't (yet) be decoded by Qt AGI Studio, because it can potentially reorder blocks in a way that doesn't guarantee that conditionals contain all their sub-statements in the assembled LOGIC resource.  I'm hoping to add an option to generate AGI Studio-compatible LOGIC resources in a future release, probably as a post-compilation reordering pass through the assembly code.  (I'm unsure whether all of this applies to WinAGI or not, because I don't have access to a Windows machine to try it on, but if someone would be willing to let me know, I'd greatly appreciate it!)

Right now all this compiler infrastructure doesnít actually amount to much, because the script language it compiles is very structurally similar to the binary LOGIC format, but because it does these things, it should be possible to greatly extend it to include stuff like functions, loops, and even variable types AGI doesnít natively support.  It also should make it easier to build a language server so someone could (for example) write AGI games in Visual Studio Code with full auto-completion and code navigation support.

Aside from this limitation, there are several other big ones right now that I hope to fix soon:

  • Only supports AGI version 2 for now
  • Doesn't fully support the LOGIC syntax in the standard:
    • Doesn't yet understand operators such as ==, <, >, +=, etc
    • #define (and therefore named variables) isn't yet supported
    • Probably other stuff
  • Doesn't decode or compile OBJECT files yet
  • Doesn't compile WORDS.TOK yet

As you can see, it is nowhere near ready for use, but overall Iím pretty pleased with how itís turned out so far!  I'd love any feedback folks have.

Offline Collector

Re: Introducing agikit
« Reply #1 on: February 21, 2021, 07:50:30 PM »
I saw your name and was wondering if you were the same natbudin that did a couple of fan AGI games. Welcome. There are a few from the old AGI crowd that has reemerged here, Peter Kelly, Lance Ewing, and Chris Cromer. Andrew Korson has been fairly active here, too.
KQII Remake Pic

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

Page created in 0.089 seconds with 24 queries.