Author Topic: WinAGI keeps inserting uncompilable characters into logic files?  (Read 14802 times)

0 Members and 1 Guest are viewing this topic.

Offline Scavenger

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.
« Last Edit: April 30, 2016, 12:00:40 PM by Scavenger »



Offline Collector

Re: WinAGI keeps inserting uncompilable characters into logic files?
« Reply #1 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.
KQII Remake Pic

Offline AGKorson

Re: WinAGI keeps inserting uncompilable characters into logic files?
« Reply #2 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.


Offline lance.ewing

Re: WinAGI keeps inserting uncompilable characters into logic files?
« Reply #3 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?


Offline AGKorson

Re: WinAGI keeps inserting uncompilable characters into logic files?
« Reply #4 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?

Offline lance.ewing

Re: WinAGI keeps inserting uncompilable characters into logic files?
« Reply #5 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.

Offline AGKorson

Re: WinAGI keeps inserting uncompilable characters into logic files?
« Reply #6 on: March 12, 2017, 07:33:20 PM »
On the Game menu, choose 'Settings', then choose the Logics tab:

Offline lance.ewing

Re: WinAGI keeps inserting uncompilable characters into logic files?
« Reply #7 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.

Offline AGKorson

Re: WinAGI keeps inserting uncompilable characters into logic files?
« Reply #8 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?

Offline Collector

Re: WinAGI keeps inserting uncompilable characters into logic files?
« Reply #9 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.
KQII Remake Pic

Offline AGKorson

Re: WinAGI keeps inserting uncompilable characters into logic files?
« Reply #10 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.

Offline lance.ewing

Re: WinAGI keeps inserting uncompilable characters into logic files?
« Reply #11 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.

Offline Collector

Re: WinAGI keeps inserting uncompilable characters into logic files?
« Reply #12 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.
KQII Remake Pic

Offline AGKorson

Re: WinAGI keeps inserting uncompilable characters into logic files?
« Reply #13 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.

Offline lance.ewing

Re: WinAGI keeps inserting uncompilable characters into logic files?
« Reply #14 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.
« Last Edit: March 14, 2017, 03:59:23 PM by lance.ewing »


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

Page created in 0.043 seconds with 24 queries.