Author Topic: C# AGILE  (Read 86678 times)

0 Members and 1 Guest are viewing this topic.

Offline Collector

Re: C# AGI Interpreter
« Reply #120 on: October 21, 2022, 09:42:43 PM »
In my branch when correction (4:3) is turned off the width remains the same and only the height reduces to 8:5 ratio. If the problem is that the the window becomes taller than the display's height. Easy enough to add a check to prevent that.
KQII Remake Pic

Offline lance.ewing

Re: C# AGI Interpreter
« Reply #121 on: October 22, 2022, 12:56:13 AM »
I've got it all working quite nicely now, both in full screen mode, and window mode.

This pull request describes and shows the changes:

https://github.com/lanceewing/agile/pull/12
https://github.com/lanceewing/agile/pull/12/files

The magic is mostly happening in the new AdjustGameScreen method. The description text in the pull request describes what it is doing.

I have attached a new build with those changes from the associated feature branch. I haven't merged it to master yet, as not sure if this behaviour is what people prefer. Give it a go to see what you think.

@MusicallyInspired, this build also has the noise channel fix. The SQ2 broom sweeping sounds much better now.

Offline Collector

Re: C# AGI Interpreter
« Reply #122 on: October 22, 2022, 07:07:19 AM »
Works pretty well for aspect correction. What about doing the same thing for an 8:5 ratio for no aspect correction? we could add a stretch item to the context menu that would allow the user to stretch the window to any dimensions they want. This could allow the old behavior to completely fill the screen in full screen mode.
KQII Remake Pic

Offline lance.ewing

Re: C# AGI Interpreter
« Reply #123 on: October 22, 2022, 03:53:27 PM »
So your proposal is to support three different modes, 4:3, 8:5, and stretch? Yeah, that should be straight forward, I just need to add an extra bit of calculation code into that AdjustGameScreen method for when aspect correction is turned off, and it would only do that if the stretch option is also turned off. Do you think the 8:5 mode would get much use?

I was playing through KQ2 yesterday (over half way so far) and its quite nice being in the 4:3 mode. That's what I'm preferring as a user, in fact I am wondering now whether it is better if a completely clean install of AGILE (with no preferences saved yet) should maybe start in the 4:3 mode from the beginning. It is the original look, as you say, so seems to make sense to start like that.

I'll start adding the 8:5 calculation to my branch now.

Edit: I've just been having a look. I think to implement the Stretch mode, we will need to change the tick boxes to work more like radio buttons. What I mean is that we wouldn't be able to support unchecking an option, e.g. unchecking Aspect Correction On. Currently when the user does that, it is assuming that the Aspect Correction Off option should be automatically checked in response, as there are only two options, but with the introduction of Stretch, then it won't be able to do that. So I think unchecking would be ignored, and changing modes would require clicking the new mode to switch to.

Edit 2: I have an initial version of it working locally. I have noticed that when I repeatedly switch between the 4:3 and 8:5 modes, the window gets smaller on each iteration. I'm going to make it a bit smarter so that this doesn't happen.

Edit 3: Found the bug. AdjustGameScreen was checking current window dimensions when deciding whether to adjust the width or height rather than the screen dimensions. That is obviously wrong. Should have it fixed in a couple of minutes.
« Last Edit: October 22, 2022, 04:59:59 PM by lance.ewing »

Offline lance.ewing

Re: C# AGI Interpreter
« Reply #124 on: October 22, 2022, 05:42:35 PM »
Those changes are now complete and I think working quite well. I've pushed the changes to the same pull request, so you can see them here:

https://github.com/lanceewing/agile/pull/12/files

A new build of AGILE from that code is attached for you to test out.

I'll now get back to my playthrough of KQ2  :)

Offline Collector

Re: C# AGI Interpreter
« Reply #125 on: October 22, 2022, 05:57:09 PM »
The checked state of the aspect items would be a rather trivial thing to do. Just clicking one item would uncheck either of the other two. Checking stretch would uncheck aspect correction and no aspect correction. There is no radio button options available in a Winforms context menu strip, but if you look at my code for the click event of the context menu items you'll see that it unchecks the other if checked. The same logic can easily be expanded to three items to make them behave like radio buttons.

I have added an aspect bool to the settings file to remember checked states between sessions. Would have to modify this setting to include stretch. Maybe a string instead that holds the name of which option was last selected. I have added a full screen option to the context menu and have changed the settings to retain screen metrics only if exiting in windowed mode in my build. I have not uploaded this to my GitHub repo, yet.
KQII Remake Pic

Offline lance.ewing

Re: C# AGI Interpreter
« Reply #126 on: October 22, 2022, 06:54:02 PM »
The checked state of the aspect items would be a rather trivial thing to do. Just clicking one item would uncheck either of the other two. Checking stretch would uncheck aspect correction and no aspect correction. There is no radio button options available in a Winforms context menu strip, but if you look at my code for the click event of the context menu items you'll see that it unchecks the other if checked. The same logic can easily be expanded to three items to make them behave like radio buttons.

Yeah, the above describes exactly how I implemented it. You can see it if you scroll to the bottom of the page showing the file diffs:

https://github.com/lanceewing/agile/pull/12/files

I have added an aspect bool to the settings file to remember checked states between sessions. Would have to modify this setting to include stretch. Maybe a string instead that holds the name of which option was last selected.

Yeah, that would be good. I was thinking that it would need this setting.

I have added a full screen option to the context menu and have changed the settings to retain screen metrics only if exiting in windowed mode in my build. I have not uploaded this to my GitHub repo, yet.

Adding full screen to the context menu is another good feature.

Have you tried my new build yet (attached to my previous message)? Is it now behaving like you'd expect, with regards to 4:3, 8:5, and stretch modes?

Offline Collector

Re: C# AGI Interpreter
« Reply #127 on: October 23, 2022, 06:53:26 AM »
Yes, I've tried it. I still need to get my repo on GitHub sorted out.
KQII Remake Pic

Offline Collector

Re: C# AGI Interpreter
« Reply #128 on: October 24, 2022, 06:59:27 PM »
I announced it on the SHP forums to see if we can get a few new testers. http://sierrahelp.com/forums/viewtopic.php?f=86&t=6124
KQII Remake Pic

Offline lance.ewing

Re: C# AGI Interpreter
« Reply #129 on: October 25, 2022, 07:29:24 AM »
Cool, thanks. I see that you've added the Fullscreen option to that one, and incorporated my changes as well. Do you have the code in your repo yet? I would like to merge back some of the features I don't have yet.

I hadn't mentioned it so far, but I finished the playthrough of KQ2. I found a couple of bugs along the way, one of which is fixed on my master branch.

Offline Collector

Re: C# AGI Interpreter
« Reply #130 on: October 25, 2022, 09:13:09 PM »
I have been fighting GitHub and finally think I have sorted through whatever issues I was having. Somehow I did not find it as intuitive as Bitbucket with Atlassian's SourceTree. I have made a pull request.
KQII Remake Pic

Offline lance.ewing

Re: C# AGI Interpreter
« Reply #131 on: October 25, 2022, 09:41:33 PM »
Thanks, I'll take a look. I assume you have noticed "Mark Yu" getting quite involved in the project. I first noticed him when he forked the repo a few weeks back, and since then he has submitted a few pull requests and been involved in discussions with me with regards to some of the outstanding issues. You can see them under the Issues page in github. He discovered an interesting character encoding issue in KQ2, with the sign behind the tree that promotes other games. Turns out the AGILibrary wasn't treating characters as CP437 when coverting the bytes to a string, so none of the extended characters were rendered properly. The promo in question was using the 0xFF (non-breaking space), which AGILE was rendering as "?". I'm about to merge a fix for that one. After that, all extended characters will render properly in AGI text mode (and even the graphics mode actually, but I know that the original AGI interpreter didn't render extended chars properly in graphics mode; only text mode).

I'm then going to review one of his pull requests, the one that fixes the SQ promo easter egg seen through the hole in KQ2. I discovered that bug during my KQ2 playthrough, raised the Issue, and Mark discovered the cause and a fix a few hours later. Turns out it is related to an issue I "fixed" when I played MH2 back in 2019, but my "fix" seems to have introduced a different bug. Looking back at my fix, it looks more like a workaround, so I might revisit that fix to see exactly what the issue in MH2 was, as I can't remember now, and I didn't create a Bitbucket issue at the time, or put enough detail into the commit comment. I guess that rediscovering it will involve temporarily reverting some code back to how it was back then, playing MH2 for a bit, and then hopefully rediscovering what the issue was.



Offline lance.ewing

Re: C# AGI Interpreter
« Reply #132 on: October 25, 2022, 10:26:03 PM »
I have been fighting GitHub and finally think I have sorted through whatever issues I was having. Somehow I did not find it as intuitive as Bitbucket with Atlassian's SourceTree. I have made a pull request.

I've just been reviewing it. It looks like the pull request was initially reverting some of my recent changes to the AnimatedObjects and Defines classes. I know that you wouldn't have made those changes, so I think it must be another merge conflict resolution bug. I've fixed both and pushed back to your repo, so they are no longer in the pull request.

Offline lance.ewing

Re: C# AGI Interpreter
« Reply #133 on: October 28, 2022, 07:38:40 PM »
@Collector, I have just merged some changes to add the "Loading" message while a game is being decoded. Now when AGILE first starts up, it shows the AGILE window immediately and then goes into the logic of selecting the game folder and decoding the game. While the game is being decoded, a message is displayed within the middle of the AGILE game screen (in the AGI font) saying "Loading... Please wait". I implemented this by doing what we were discussing earlier, i.e. moving the game folder selection and decoding into the AgileForm class.

The changes are showing in this PR:
https://github.com/lanceewing/agile/pull/23/files

Offline Collector

Re: C# AGI Interpreter
« Reply #134 on: October 29, 2022, 05:40:12 PM »
Made one slight addition. I added a call to AdjustGameScreen after the form gets last settings for the
context menu aspect correction to sync Agile's window with selected aspect setting.
KQII Remake Pic


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

Page created in 0.079 seconds with 22 queries.