Community

AGI Programming => AGI Development Tools => Topic started by: Scavenger on April 29, 2016, 03:04:42 PM

Title: WinAGI keeps inserting uncompilable characters into logic files?
Post by: Scavenger on April 29, 2016, 03:04:42 PM
I'm trying to mess around with WinAGI, because sometimes you just wanna create a really old game with a really old engine. (its view editor is one of the best ones I've seen as well, it's so easy to animate in!). The syntax isn't too hard (though I have no idea how to do blocking actions, i.e waiting for an action to complete before continuing with a script), but I have a real problem with WinAGI's logic editor.

Whenever I work in the AGI syntax, writing a "{" character keeps placing vertical tabs (ASCII 11 - the little male symbol) around it, and then the compiler won't  compile it until I fiddle around blindly in the editor to make those vertical tabs vanish. The BASIC syntax does at least compile, but I really hate BASIC, being a C programmer. Is there anyone who knows why this is happening, how I can make it stop, or how to fix it? I've been looking into the source code but I can't see where it ignores whitespace, nor can I get Visual Basic 6.0 working on my machine so I could recompile it.
Title: Re: WinAGI keeps inserting uncompilable characters into logic files?
Post by: Collector on April 29, 2016, 10:24:58 PM
WinAGI does not like newer versions of Windows. I had at one point tried to port it to dotNET and then C#, but it so dependent on a bunch of VB garbage like the VB power pack and other things that I quickly realized that it would take more effort to port it to something more modern than it was worth. The sad thing is that there are no AGI IDEs that do not have some issue on modern Windows.
Title: Re: WinAGI keeps inserting uncompilable characters into logic files?
Post by: AGKorson on March 12, 2017, 05:06:34 PM
I'm trying to mess around with WinAGI, because sometimes you just wanna create a really old game with a really old engine. (its view editor is one of the best ones I've seen as well, it's so easy to animate in!). The syntax isn't too hard (though I have no idea how to do blocking actions, i.e waiting for an action to complete before continuing with a script), but I have a real problem with WinAGI's logic editor.

Whenever I work in the AGI syntax, writing a "{" character keeps placing vertical tabs (ASCII 11 - the little male symbol) around it, and then the compiler won't  compile it until I fiddle around blindly in the editor to make those vertical tabs vanish. The BASIC syntax does at least compile, but I really hate BASIC, being a C programmer. Is there anyone who knows why this is happening, how I can make it stop, or how to fix it? I've been looking into the source code but I can't see where it ignores whitespace, nor can I get Visual Basic 6.0 working on my machine so I could recompile it.

Hi there. I'm the creator of WinAGI. I've been away from the AGI scene for ten or so years, but recently have been playing around with WinAGI again. I've never heard of the editor adding extra characters before- what version of WinAGI are you using? what version of Windows are you running? I'd like to be able to duplicate that to see what's going on.

I have an updated version of WinAGI that fixes a whole bunch of issues that were in the last version (1.1.22). I will probably make that available for download soon. As far as I can tell, it seems to work just fine on Windows 10. But if there's a major issue with the editor, I'd like to make sure it's addressed before I release this update.

Title: Re: WinAGI keeps inserting uncompilable characters into logic files?
Post by: lance.ewing on March 12, 2017, 06:48:03 PM
Hi Andrew. Great to see you back in the AGI community. I too was away from the scene for a long time, perhaps 12 years in my case, between about 1999 to 2010. I hope we see more people like us returning.

I was playing around with WinAGI recently. I'm really impressed with how much effort and commitment obviously went in to it. Would love to see it fully usable on modern Windows versions. When I tried it recently (version 1.1.22), I had issues with the editors for the OBJECT and WORDS.TOK files. The text was very small, such that I couldn't read it. I didn't check to see if there was an option to increase the size. I assumed it was probably an issue with running on Windows 8.1. Is this something that you think a new release could resolve?

Title: Re: WinAGI keeps inserting uncompilable characters into logic files?
Post by: AGKorson on March 12, 2017, 06:56:35 PM
Hi Andrew. Great to see you back in the AGI community. I too was away from the scene for a long time, perhaps 12 years in my case, between about 1999 to 2010. I hope we see more people like us returning.

I was playing around with WinAGI recently. I'm really impressed with how much effort and commitment obviously went in to it. Would love to see it fully usable on modern Windows versions. When I tried it recently (version 1.1.22), I had issues with the editors for the OBJECT and WORDS.TOK files. The text was very small, such that I couldn't read it. I didn't check to see if there was an option to increase the size. I assumed it was probably an issue with running on Windows 8.1. Is this something that you think a new release could resolve?

Hi Lance, I've been watching your efforts on this site for the past couple weeks, and that's what got me back into the game, so thanks for that!  ;D

I haven't noticed that issue (small text in some editors). I'm running Windows 10 on a Surface Pro, and don't have easy access to Windows 8 for testing. I'll take a look at the coding for those editors though, to see how I manage the fonts. I'm guessing it's something that I can either fix, or provide an option for users to choose whatever font and font size they want.

Do the font options in the logic editor let you pick options that make it readable?
Title: Re: WinAGI keeps inserting uncompilable characters into logic files?
Post by: lance.ewing on March 12, 2017, 07:20:46 PM
Actually, now that I look deeper (I was specifically checking something with the OBJECT and WORDS.TOK editors when I noticed the font issue), it seems that pretty much all the editors involving text are affected by this. The Logic editor is also affected, as is the Global Defines and Customize Tools Menu. Probably others as well. I'm still searching for the font options that you mentioned in the Logic editor. Can't seem to find them.

I also have a Surface Pro 4 tablet with Windows 10 on it, but I'll admit I didn't try it on there until now. Usually my girls are in possession of that device, and they're usually using it to draw pictures or build simple games in Scratch. As they're now in bed, I've just installed WinAGI on it and can see that the issue does not  affect the tool on that device.

For Windows 8.1, I'm running it under Virtual Box. My desktop machine is Linux, so for Windows tools I use Virtual Box. I wasn't able to update that to Windows 10 back when there were free upgrades as whenever I tried to upgrade  it kept telling me that the upgrade wasn't supported on my hardware, which was a bit annoying.
Title: Re: WinAGI keeps inserting uncompilable characters into logic files?
Post by: AGKorson on March 12, 2017, 07:33:20 PM
On the Game menu, choose 'Settings', then choose the Logics tab:
Title: Re: WinAGI keeps inserting uncompilable characters into logic files?
Post by: lance.ewing on March 12, 2017, 07:38:18 PM
That's interesting. The font size was set to 4! Really weird. I hope it wasn't me that set that to 4 at some point in the past. I can't think why I would have done that though. Does it default to a particular size?

Anyway, that seems to have fixed it for all of the other editors as well, so thanks for that. There probably isn't much to fix then. What I could do if you like is try to install it cleanly again and see if it defaults to 4.
Title: Re: WinAGI keeps inserting uncompilable characters into logic files?
Post by: AGKorson on March 12, 2017, 10:21:59 PM
OK, I looked at the code, and here's the story. On the settings page, font sizes 8,9,10,11,12,14,16 are available to choose, but you can actually type any value in and WinAGI will use it. My thinking was I didn't want to limit users if they really wanted to choose crazy settings.That value is then stored in the registry for next time WinAGI opens.

When WinAGI starts, it looks for settings (which should be in registry). If it can't find them, (such as first time it runs) it loads defaults. For font size, the default is 10pt. If it does find settings in registry (anytime after first run) all settings get a validation check (in case registry got corrupted or something else went wrong). For font size, if a setting found in registry is less than 4pt, WinAGI uses 4pt, and if greater than 72pt, it uses 72pt.

It sounds like something happened to the registry settings; it read something so it didn't use default of 10pt, but what it found was less than 4pt so it limited it to 4pt.   

I'm thinking of reducing the band of acceptable font sizes to 8-16 and not letting users pick sizes outside that band. I really can't see anybody wanting to intentionally choose something outside that. That would at least keep things readable in case registry has a problem.

Assuming you didn't intentionally set the size to a low number, I'm not sure why WinAGI couldn't read your registry settings correctly. If you close and re-open, does it go back to 4pt, or does it now remember correctly what value you chose?
Title: Re: WinAGI keeps inserting uncompilable characters into logic files?
Post by: Collector on March 12, 2017, 11:37:07 PM
If you are updating it for modern systems what about moving the settings from the registry to an XML settings file in the user's AppData folder? If I remember correctly WinAGI was in VB. If you have migrated it to dotNET this would be trivial.
Title: Re: WinAGI keeps inserting uncompilable characters into logic files?
Post by: AGKorson on March 13, 2017, 11:33:44 AM
I'll have to do a bit of research to learn more about XML. I did do a conversion of WinAGI to .NET back in 2008 or so, but the differences in were so huge- even basic (no pun intended) syntax going from VB6 to VB.NET was altered significantly. I basically gave up and haven't given it much thought since. I have some immediate things I want/need to fix, so I plan on staying with VB6 for at least one more release. But after that  I think it might be a good time to revisit the possibility of moving it. It'll give me the opportunity to learn something new. I think C# is something I could pick up if I spend some time on it.
Title: Re: WinAGI keeps inserting uncompilable characters into logic files?
Post by: lance.ewing on March 13, 2017, 01:27:20 PM
If you did decide to do the conversion to C#, you could make use of the AGI Library that (correct me if I'm wrong Collector) came originally from Visual AGI. I'm using it to load and decode the data for my C# interpreter. It has a lot missing, and I've been adding to it as I go along, but it would give you a good headstart. One of the benefits you'd get is that you'd be able to run my interpreter within the memory of your application. I'm hoping to add breakpoint support at some point with an interface that an IDE could use to step through the code.
Title: Re: WinAGI keeps inserting uncompilable characters into logic files?
Post by: Collector on March 13, 2017, 07:07:05 PM
You do not need to directly deal with XML for your settings file in .NET.

Yes, the library comes from Visual AGI. As Lance noted it is missing a lot, specifically for the logic and sound. I managed to get the source to the project and have updated and expanded it. I have added all of the missing editors except for the sound. Once the AGI library is fleshed out the IDE will mostly need the compiler and sound editor. The source included a sound editor, but it never got ported to C# from C++. The task of porting is probably beyond my capabilities. I could call the C++ build of the sound editor from the IDE, but it is an MDI application. That would mean that it would open independent from the main program and not as a child window like all of the other editors.

I was wanting to use Lance's C# interpreter with it to natively run and debug the developer's game directly from the app rather than having to call DOSBox.

Here is a thought. If you don't really want to port WinAGI to .NET you could do one more final update of it in VB6. Then if you were willing to tackle learning C# you could contribute to Visual AGI for a more modern IDE.
Title: Re: WinAGI keeps inserting uncompilable characters into logic files?
Post by: AGKorson on March 14, 2017, 11:41:03 AM
Not a bad idea. Once I finish this release, I'll take a look at Visual AGI to see if I can help. The WinAGI compiler is pretty good, and I could probably port that to C# fairly easily (he says without any training or experience). I also have a sound editor in WinAGI, which could serve as a starting point for a sound editor.  But I'm getting ahead of myself - got to focus on WinAGI for now.
Title: Re: WinAGI keeps inserting uncompilable characters into logic files?
Post by: lance.ewing on March 14, 2017, 03:17:48 PM
I also didn't know C# before starting out on the interpreter, but I guess I have the benefit of about 19 years commercial Java programming, which is a similar (although also different in places) syntax. It is certainly a lot more similar than VB is to C#. Once upon a time, BASIC was the only language I knew and that was before VB came out. Started out with Commodore BASIC, then moved to GW BASIC (which came with DOS 3.3), then QBASIC (which came with one of the later DOS versions), and then a bit of VB when I was in University. I wouldn't remember any VB now though. I haven't used it since probably about 1995. It would have changed a lot since then in any case.

Back to the topic in discussion though, it would be fantastic if you could help out with Visual AGI when you're ready. I still haven't officially started working on the IDE itself. What I've currently done is to fork from Collector's repo and to build a separate sub-project within my fork of his repo for building the Interpreter. At some point I'll request Collector to add it back in to the main project. I did this fork initially because I wanted to make sure I'd learnt the language before being let loose on the real thing, but I've probably gone beyond that point now. In hindsight perhaps I should simply have created a feature branch for my work within his repo.
Title: Re: WinAGI keeps inserting uncompilable characters into logic files?
Post by: Collector on March 14, 2017, 09:27:34 PM
I had a look at WinAGI a while back and played around with porting it to dotNET. I have ported some VB stuff to dotNET to port to C# since it is not too hard going from VB.NET to C#. However, WinAGI  uses something like an old VB powerpack that would have required more work to remove that dependency than I was willing to mess with. I try to have little to no VB reliance in my C# code as possible.
Title: Re: WinAGI keeps inserting uncompilable characters into logic files?
Post by: AGKorson on March 15, 2017, 02:36:21 PM
It does use some of the common controls, which require a separate OCX. And the text editor is a custom control that I wrote, as VB doesn't have a built in rich text editor that could provide the functionality I needed.

But those aren't the real reasons this would be difficult to port to dotNET. The real problem is that there are so many changes from VB6 to dotNET, even simple things like how screens are updated, how toolbars work, how interactions with mouse and keyboard are processed. If I really wanted to port it, I'd probably be better off writing all the user interface parts from scratch using the original as a guide. Some of the routines behind the scene also would require significant work, as dealing with classes and objects changed drastically too.

On the plus side, there are a lot of things in dotNET (VB, C# or any of the languages) that are significant upgrades in capabilities that would eliminate a lot of the things I had to do by making API calls or other programming tricks to get VB to do some of the 'high performance' things. While I feel good that I was able to leverage VB6 to create a really good tool, it would be nice if I could do those things using built-in features.

Anyway, I'm always looking for a good challenge, and I think now is the time to dive into C# and finally learn it. So helping with Visual AGI is something I think I have interest in.

(As a side note, when I first began working on WinAGI, I originally had "VisualAGI" as the title. But then I found the other "Visual AGI" program that was in progress, so I decided to choose a different name. While I used AGI Studio as the starting point, my goal all along was to create an environment that 'felt' like any other Visual Studio developer tool. So the possibility of bringing some of WinAGI's features to the new Visual AGI feels like coming back full circle.)
Title: Re: WinAGI keeps inserting uncompilable characters into logic files?
Post by: lance.ewing on March 15, 2017, 04:58:14 PM
When WinAGI starts, it looks for settings (which should be in registry). If it can't find them, (such as first time it runs) it loads defaults. For font size, the default is 10pt. If it does find settings in registry (anytime after first run) all settings get a validation check (in case registry got corrupted or something else went wrong). For font size, if a setting found in registry is less than 4pt, WinAGI uses 4pt, and if greater than 72pt, it uses 72pt.

It turns out that there was more than just the font size that was configured strangely. I suspect that the settings in the registry must have been corrupted because there was quite a lot of settings that were different from the defaults and set to rather obscure values. I would not have changed much if anything from the defaults and yet the resource list was turned off, the tab size was set to 1, the max screen objects set to 1, all zoom levels set to one, almost all checkboxes turned off (although strangely one checkbox that was enabled was the Visual Basic syntax, which I wouldn't have turned on).

I was able to click the Defaults option though and that has restored everything to how it should be. I wonder if there is some way of detecting that something has corrupted the settings and to prompt the user if they want to restore the defaults instead.
Title: Re: WinAGI keeps inserting uncompilable characters into logic files?
Post by: Collector on March 15, 2017, 04:59:54 PM
For updating it I added it into an SCI0 IDE that Gumby and I were working on, but that has mostly stopped since Phil released the new version of SCI Companion and Gumby has not been around much for sometime. I was hoping that an infusion from new people like Lance would get it going again. Anyway, this is a peek at the IDE from when I had just started to add AGI to it. You can see earlier versions of the AGI Pic and View editors at the bottom.

I might split out the SCI from it and have just AGI unless Gumby take an interest in it again.

http://www.sierrahelp.com/Temp/SCIDev.html
Title: Re: WinAGI keeps inserting uncompilable characters into logic files?
Post by: Collector on March 15, 2017, 05:08:39 PM
When WinAGI starts, it looks for settings (which should be in registry). If it can't find them, (such as first time it runs) it loads defaults. For font size, the default is 10pt. If it does find settings in registry (anytime after first run) all settings get a validation check (in case registry got corrupted or something else went wrong). For font size, if a setting found in registry is less than 4pt, WinAGI uses 4pt, and if greater than 72pt, it uses 72pt.

It turns out that there was more than just the font size that was configured strangely. I suspect that the settings in the registry must have been corrupted because there was quite a lot of settings that were different from the defaults and set to rather obscure values. I would not have changed much if anything from the defaults and yet the resource list was turned off, the tab size was set to 1, the max screen objects set to 1, all zoom levels set to one, almost all checkboxes turned off (although strangely one checkbox that was enabled was the Visual Basic syntax, which I wouldn't have turned on).

I was able to click the Defaults option though and that has restored everything to how it should be. I wonder if there is some way of detecting that something has corrupted the settings and to prompt the user if they want to restore the defaults instead.

I had a similar problem with corrupted settings that prevented the WinAGI from starting properly. I had to track down where it was in the registry and delete the entries to fix it. The AGI-SCI Developer preferences file can be deleted from the options and then close close/reopen it. It will (re)create the file with defaults when starting if the file is not found.
Title: Re: WinAGI keeps inserting uncompilable characters into logic files?
Post by: lance.ewing on March 15, 2017, 05:36:21 PM
The Settings dialog window does have a Defaults button for setting everything back to the default state. When I pressed that, everything was resolved, so I didn't have to locate the registry entry.
Title: Re: WinAGI keeps inserting uncompilable characters into logic files?
Post by: lance.ewing on March 15, 2017, 05:38:40 PM
I might split out the SCI from it and have just AGI

That sounds like a good idea. Would you call the AGI-only project Visual AGI? Or AGI Developer?
Title: Re: WinAGI keeps inserting uncompilable characters into logic files?
Post by: Collector on March 15, 2017, 06:03:17 PM
I would have to think about it. There are several differences between the two, so they are not really the same outside of the library, which I have added to. Even the pic and view editors have significant differences. Certainly I would want to be sure that Joakim Möller and Gustaf Wennerholm receive their due credit for what is borrowed from their old Visual AGI project.

However I am not going to finish separating the two until if and when people are ready to contribute. I might just disable the SCI part.
Title: Re: WinAGI keeps inserting uncompilable characters into logic files?
Post by: Kawa on March 15, 2017, 07:10:30 PM
AGI Companion :D