Author Topic: Visual AGI  (Read 3528 times)

0 Members and 1 Guest are viewing this topic.

Offline Collector

Visual AGI
« on: December 08, 2022, 01:08:14 PM »
I have created a GitHub repository for it and have sent out invites. For the time being I am keeping it private, at least until it is complete/presentable. There is still more that needs to be cleaned up, but want the two of you to have access. The Pic and View editors are mostly functional. The logic editor mostly needs to have the back end from the AGI Library hooked into it. The other editors are mostly placeholders from my old SCI Developer project. These can be modified or replaced as needed.

I stripped out the DOSBox debug in anticipation of using Agile, instead. If a debugger build of Agile becomes a reality, it would be an ideal replacement.

While I have replaced all of the Registry entries with settings/XML, I need to go through that to find and fix any issues with that.


KQII Remake Pic

Offline Collector

Re: Visual AGI
« Reply #1 on: December 11, 2022, 06:13:20 PM »
Ignore the project management functions. It was broken from stripping out the SCI stuff. I'll have to fix it when I get more time. For the time being just use the open game.
KQII Remake Pic

Offline lance.ewing

Re: Visual AGI
« Reply #2 on: December 15, 2022, 07:40:44 AM »
Sorry for not replying sooner. I am very interested in this, but finding it hard to find free time at the moment. All my personal hobbies are on hold for a bit. I was moving house and now travelling. Should be free again early next year when I hope to get back to all these projects.

Offline vafada

Re: Visual AGI
« Reply #3 on: December 15, 2022, 04:24:44 PM »
Favor, can you update the README on how to build the project?

I'm not a C# / .NET expert..... I cloned the repo and Visual Studio is complaining its can't find the DLL for the dependencies...

particually these harcoded paths:

<Reference Include="FastColoredTextBox">
      <HintPath>..\..\Sierra\AGI\AGI Developer\AGI Developer\Resources\DLLs\FastColoredTextBox.dll</HintPath>
    </Reference>
    <Reference Include="FastColoredTextBoxPlugin">
      <HintPath>..\..\Sierra\AGI\AGI Developer\AGI Developer\Resources\DLLs\FastColoredTextBoxPlugin.dll</HintPath>
    </Reference>
    <Reference Include="Gif.Components">
      <HintPath>..\..\Sierra\AGI\AGI Developer\AGI Developer\Resources\DLLs\Gif.Components.dll</HintPath>
    </Reference>
    <Reference Include="i00BindingList">
      <HintPath>Resources\DLLs\i00BindingList.dll</HintPath>
    </Reference>
    <Reference Include="i00SpellCheck">
      <HintPath>..\..\Sierra\AGI\AGI Developer\AGI Developer\Resources\DLLs\i00SpellCheck.dll</HintPath>
    </Reference>
    <Reference Include="Microsoft.VisualBasic" />
    <Reference Include="RichTextBoxEx">
      <HintPath>..\..\Sierra\AGI\AGI Developer\AGI Developer\Resources\DLLs\RichTextBoxEx.dll</HintPath>
    </Reference>

Offline Collector

Re: Visual AGI
« Reply #4 on: December 15, 2022, 06:08:10 PM »
Those are the reference DLLs. If you did not get the zip of the DLLs go back to the repo and download the zip. It is under "Visual-AGI/Visual AGI/Resources/DLLs/". They did not get uploaded with the first upload. Unzip them there. I am not sure why it is including the two higher up directories. They  from the project's base folder. From the solution explorer they should be in the "AGI Developer\Resources\DLLs\" path. They don't really need to be included in the project, just added to the references. I was trying to include them so you wouldn't have to track them down. Let me know if you have anymore trouble getting it to build.

That reminds me, I should also include the FastColoredTextBox SyntaxHighlighter script that has my AGI, SCI and NSIS script Highlighting.
KQII Remake Pic

Offline lance.ewing

Re: Visual AGI
« Reply #5 on: January 03, 2023, 05:59:54 AM »
I initially had the same issues that vafada did. I expected that after cloning the repo, the solution and projects would load and run without any manual fiddling, but like him, I'm not familiar with how dependency management works in Visual Studio, so am not familiar with what experienced C#/.NET coders would expect after cloning a git repo for a .NET project. When I set up the AGILE project, I assumed I had to add the DLL files into the github repo, under the subfolders of the main project that it was loading them from, so that hopefully the project would load and run straight off. Probably a misguided assumption but it seemed to work and felt cleaner at the time. I'd be happy to be educated by our C# experts out there. For all I know, adding DLLs for dependencies to the repo might be a big no no and there is instead some dependency management step that should be added and running as part of the project build, similar to how node and java do things.

Anyway, I managed to get Visual AGI to run by putting the DLL files in the locations that it was looking for them (as shown in vafadas earlier post), i.e. by creating the folders to match. This was a quick hack for me locally, as I didn't want to make any major changes to the project files, in case you were tidying it up still Collector. It has allowed me to start the application and start playing around with it.

I started by loading KQ1 and then opening up a PICTURE and then a VIEW to play around. I then tried opening GR, which is an AGI V3 game. I suspect that in the past, this wouldn't have worked for Visual AGI, but after the changes to the AGI Library introduced by AGILE to support AGI V3, it looks like it is working to some degree now. It shows some error messages, but it does then show the VOLs with resources under them. Some may be missing (I haven't checked that yet) but I was able to open up PICTURE.10, which was the one that vafada reported the picture rendering issue for a while back and that we then fixed. I was pleased to see that the PICTURE is rendering fine in Visual AGI now as well, so that shows that Visual AGI has picked up the AGI Library fixes that have been added over the past few months.
« Last Edit: January 03, 2023, 06:02:51 AM by lance.ewing »

Offline Collector

Re: Visual AGI
« Reply #6 on: January 03, 2023, 10:22:26 AM »
I am far from a C# expert myself. I don't code professionally. All of the references should be found in a zip in the Visual-AGI/Visual AGI/Resources/DLLs/ folder. They just need to be unzipped in the same folder for the project to find them. There are a number of items that the compiled project uses, like templates and tools for project management. They are zipped in the "Output" folder.

I have been working on the project management. These have been pushed to the repo. Some of the project management I cannot fix until we set a standard on the logic scripting. I like the idea of using Sierra's, but there is an argument to be made for cross IDE compatibility. Part of the project management requires the IDE to extract information from the logic scripts.
KQII Remake Pic

Offline Collector

Re: Visual AGI
« Reply #7 on: January 18, 2023, 05:52:40 PM »
I am working on the syntax highlighting for the logic editor. It was set to flag "//" for comments like AGI Studio did, but the leaked AGI code and WinAGI uses a left bracket to designate a comment, so I changed it for consistency.

I probably don't have all of the keywords included. Is there a list of all of the AGI keywords somewhere. I don't want to leave anything out.
KQII Remake Pic

Offline AGKorson

Re: Visual AGI
« Reply #8 on: January 19, 2023, 10:15:27 AM »
I am working on the syntax highlighting for the logic editor. It was set to flag "//" for comments like AGI Studio did, but the leaked AGI code and WinAGI uses a left bracket to designate a comment, so I changed it for consistency.

I probably don't have all of the keywords included. Is there a list of all of the AGI keywords somewhere. I don't want to leave anything out.

The list isn't long - 'if', 'else', 'goto'.

And for compiler processing tokens, you'll need #define, #message, and #include. 

In WinAGI, I also treat the canon AGI command names as keywords.

That's it. AGI is not a complicated language.

The syntax highlighter I built for WinAGI recognizes five types of tokens - comments, keywords, strings, identifiers (i.e. define names) and normal (everything else- numbers, punctuation). That seems to work well. For comments, WinAGI also allows the double-slash, but it's deprecated. I'm toying with the idea of adding support for the #action and #test keywords to allow renaming of commands in the same way that original Sierra compiler did, but I haven't done it yet. Perhaps in a later release.

Offline Collector

Re: Visual AGI
« Reply #9 on: January 19, 2023, 12:56:17 PM »
Thanks. I had forgotten 'goto'. I had already added the commands as keywords. I have added them as they are in the LSL source with its Pascal casing instead of the AGI Studio all lower case with a '.' inbetween. (i.e. 'AddToPic' instead of 'add.to.pic'). What is still missing are '#define' and '%include', etc. I didn't think that # or % were special characters in RegEx, but then I suck at RegEx. Didn't you say you were using the FastColoredTextBox control for your C# project? It would be nice to have the syntax highlighting be the same between IDEs.

I am trying to decide about the scripting. Whether to use the AGI Studio script ('*.txt' or '.*lgc') or something that matches what we know the original from Sierra was like, with its '*.cg', '.*', and '.h' source files. right now I am leaning towards the Sierra.

I don't know if Visual AGI will ever get into a usable shape, but I want as much cross compatibility with other AGI IDEs as possible. I would like for it to have the ability to open and edit games previously developed in WinAGI and/or even AGI Studio. I have Visual AGI using XML for the project file. It can import AGI Studio's game.ini projects. I want to add the ability to import  'wag' projects, too.
KQII Remake Pic

Offline AGKorson

Re: Visual AGI
« Reply #10 on: January 20, 2023, 03:18:21 PM »
I do plan on using FCTB, but I haven't done much with it, other than to mod it to handle DOS code pages. C# work is back burnered until I finish the Power Pack.

As for having syntax highlighting the same, I assume you're not referring to colors and font styles, but to the different types of tokens and code elements? I agree that would be good to do. I think the five token types I mentioned are probably sufficient, but would be happy to discuss potential changes.

For script default extensions, I prefer the ".lgc" for logics. For included files, I am planning to switch to ".h", away from ".txt". But of course, any IDE needs to be flexible enough to allow users to use whatever they want for filenames and extensions.

For the names of commands that your compiler will recognize, I think it would be better to stick with the 'canon' spelling/formatting, at least for the default. It's compatible with several original game source code files (not all), and it's been in use for years by the fan community. Instead of using different command name/format, I suggest adding support to your compiler for renaming commands (i.e. support the %action and %test processor keywords).

That's what I'm doing with WinAGI. So there will be a default name for commands, but authors will have the ability to rename them if they want to. I'm modifing WinAGI's compiler to identify all processor keywords from CG.EXE. So it will be able to compile original Sierra source code as well as code written to target 'fan syntax'. That mod (along with huge list of bug fixes and enhancements) will be released when the Power Pack Demo game is realeased. Hopefully not too long from now - I have all the coding done to finish the game from start to finish. I just need to add sounds, finish opening/closing scenes with credits, and polish all the in game text responses. And then testing... I'm hoping for some time in early spring.

Offline Collector

Re: Visual AGI
« Reply #11 on: January 20, 2023, 07:31:08 PM »
It's not yet complete, of course, but I can share my SyntaxHighlighter.cs, which is the only thing from FCTB that I have modified, so far. I have also added support for SCI and NSIS to it. You can look it over to see if I there is anything that should be added. Most of it is in 'InitAGIRegex()' and 'AGISyntaxHighlight'

I gathered commands names from the Larry source. I assume that your list of processor keywords from CG.EXE was just from extracting the strings from the compiler. If it was more involved I would like to see your list.

What I had in mind for backwards compatibility was to add a script converter, much like the option in SCI Companion to convert from Studio script to Sierra script. I might need to have a reverse function for exporting a game to AGI Studio or WinAGI. I have modified the XML project file to save all of the information in a WAG file for easy conversions between the two. Now I have to go through the source to have Visual AGI handle all of the reads and writes to it.


On a side note, I was going through the old fan tool 'AGI Base Logic Generator'. It has its original C++ source, which no longer compiles with newer versions of VS. My C/C++ skills are very limited, so I am attempting to recreate it in C# with the intent to add its functionality into Visual AGI for starting new logics. I have all of its forms recreated and the coding looks like it is little more than string manipulation.
KQII Remake Pic

Offline AGKorson

Re: Visual AGI
« Reply #12 on: January 20, 2023, 10:34:18 PM »
It's not yet complete, of course, but I can share my SyntaxHighlighter.cs, which is the only thing from FCTB that I have modified, so far. I have also added support for SCI and NSIS to it. You can look it over to see if I there is anything that should be added. Most of it is in 'InitAGIRegex()' and 'AGISyntaxHighlight'
I can do that. Send me an invite on github and I'll take a look.

I gathered commands names from the Larry source. I assume that your list of processor keywords from CG.EXE was just from extracting the strings from the compiler. If it was more involved I would like to see your list.
I did a full disassembly, not just string extraction. So the list is 100% accurate. I posted the details in another thread, and also added a wiki page for it.

Which reminds me, the agiwiki doesn't display the command help pages correctly anymore. The syntax highlighter code seems to be missing/broken. About four years ago, I had a conversation with you about updating the highlighter definition file and sent you an update, but I don't recall it ever being implemented. The discussion and file are still on the wiki.

What I had in mind for backwards compatibility was to add a script converter, much like the option in SCI Companion to convert from Studio script to Sierra script. I might need to have a reverse function for exporting a game to AGI Studio or WinAGI. I have modified the XML project file to save all of the information in a WAG file for easy conversions between the two. Now I have to go through the source to have Visual AGI handle all of the reads and writes to it.
That's a good idea. It shouldn't be too hard to implement. If you have any questions about the structure/purpose of the wag file or any properties, just let me know.

On a side note, I was going through the old fan tool 'AGI Base Logic Generator'. It has its original C++ source, which no longer compiles with newer versions of VS. My C/C++ skills are very limited, so I am attempting to recreate it in C# with the intent to add its functionality into Visual AGI for starting new logics. I have all of its forms recreated and the coding looks like it is little more than string manipulation.
I remember that tool. It inspired me to add the room template function to WinAGI. If you want, I could share my room template function code with you- you might find it useful.

Offline Collector

Re: Visual AGI
« Reply #13 on: January 21, 2023, 04:23:46 PM »
Use your email at charter for the invite?

As to the broken highlighting on the Wiki I posted some of what happened in another thread. In the move to the new server they messed up PHP versions to the point that the Wikis were completely broken. Their support was worthless, so I had to fix it myself. You are a little limited with what you can do with just cPanel and FTP access and with no root access.The only way that I was able to get the Wikis to be usable was to upgrade them. I had put that off because they were already the latest version supported by the old SyntaxHighlight_GeSHi extension. The new version requires the Pygments package to be installed on the server and the hosting service will not install it without moving me to a dedicated server and a huge increase in my hosting fees. I am thinking about moving to another hosting service when it is time to renew.

Most of what is in the wag file is pretty self explanatory. It is all in my redesigned XML I couple of things I will probably not be using, but have included them so they don't get lost during importing or exporting. One question. Is the inclusion of the CRCs in the wag to track altered resources/files?

I want to finish my C# recreation of BLG first. When I am ready to implement its functionality into VAGI I would be curious to see your code, especially if you have ported it to C# for your new project.
KQII Remake Pic

Offline AGKorson

Re: Visual AGI
« Reply #14 on: January 22, 2023, 07:47:15 PM »
Use your email at charter for the invite?
Yes, that works.

Most of what is in the wag file is pretty self explanatory. It is all in my redesigned XML I couple of things I will probably not be using, but have included them so they don't get lost during importing or exporting. One question. Is the inclusion of the CRCs in the wag to track altered resources/files?
That's correct. But just for logic source code changes. Not any other resources. It tracks whether the saved source code matches what was used for last compile. That lets you easily determine which logics need to be recompiled.


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

Page created in 0.062 seconds with 22 queries.