induktio / thinker

AI improvement patch for SMACX.
https://discord.gg/XdFuwWzzku
GNU General Public License v2.0
67 stars 10 forks source link

mouse scroll behaviour bug cause possibly found #60

Open ramseysparrow opened 5 months ago

ramseysparrow commented 5 months ago

Firstly, a huge thank you for polishing one of my favourite games up to ying-yang – it's an amazing experience.

Beyond your countless AI improvements, the simple ability to scroll-zoom and mouse-drag around smoothly from PRAX is the single most groundbreaking change to how the game feels moment to moment.

I experience inconsistent behaviour with it, though, and have read a few related issue reports from others here and in PRAX, but I don't think the cause was fully narrowed down, so here's what I found:

Goes without saying, if there is a way to fix that, the perfect Alpha Centauri experience completes. A shortcut for toggling global/detailed minimap and for zooming it in-out would be double-plus-good ;)

induktio commented 5 months ago

Good thing to find this small oversight in the mod. 👍

This was related to the earlier issues where the mod didn't determine correctly when the world map has focus. Looks like it can be fixed with a couple of small changes on map_is_visible() function. This is updated in Mar 20 build, so the mouse wheel zoom should only activate when the world map is visible and any units should not be moved by the mouse wheel.

ramseysparrow commented 5 months ago

Thats right, i remember other threads mentioning the focus issue in relation to dialogue option menus, though never in relation to the minimap mode.

Just to confirm Im understanding this right - are you saying the minimap issue is something you will look into fixing in the future, or something that you already have fixed (you mention today’s date - march 20th)? Apologies, Im not sure if I got your meaning in that part!

ramseysparrow commented 5 months ago

I believe I figured it out: you're referring to the dev builds, newest one dated today. Will give it a try and report. Thanks.

ramseysparrow commented 5 months ago

Salutations, brother @induktio. I have tested your newest patch and can confirm that the issue has been fully fixed. I believe your coding principles and my humanitarian ideals will complement each other nicely. Let us form a pact of friendship and explore this planet together.

induktio commented 5 months ago

Hehe, it's possible there are still some rare situations where the map visibility is not detected correctly. The code could still use some cleanup if there's a better way to do it, so have to think about it.

ramseysparrow commented 5 months ago

Its been smooth sailing so far, but i will let you know if i run into any exceptions.

ramseysparrow commented 5 months ago

Hi again. It seems that when using governor in bases, the priority buttons don't highlight as you select them, making it difficult to know what mode the base's governor is in.

Playing smac in smacx mode with prax. I initially decided to give prax a pass to keep things simple, but the ability to see tiles yield overview is just too convenient.

ramseysparrow commented 5 months ago

Almost forgot – some shortcuts such as 'show flatten terrain' don't seem to work either and can only be executed from the menu.

induktio commented 5 months ago

Governor buttons not highlighting is intended behaviour since they have no special emphasis for Thinker AI, as mentioned in Details.md. For me the shortcut for flattened terrain seems to work, is there something else to this? Sometimes there's an inconsistent issue where Alt+T doesn't work for Thinker's menu at startup, but it works when immediately restarting the game again. The cause for this issue is somewhat unknown as it is hard to replicate consistently. Would be useful if there's any ideas on how to patch that issue.

ramseysparrow commented 5 months ago

"…and they are automatically deselected in the interface". Though I have actually read through the details.md, it seems that went past me somehow. Good to know, thanks.

About keyboard shortcuts, all I can say is that the one I mentioned seems consistently not to work for me when using Thinker+PRAX with SMAC-in-SMACx setting enabled. It's hardly a deal breaker but this being a place to mention every and al such glitches, here it is.

One other thing I had happen since was an apparent glitch in the unit designer menu - I created a unit there, a first generation foil, I believe, deleted it and tried creating it again but it would not appear in the base construction menu. As above, just reporting possible weirdness, never in a complain-mode.

By the way the AI is so effing agressive in this mod, seeding bases like maniacs and constantly harassing me with threats for payments and vendettas. They all appear to be total psychopaths now, haha.

ramseysparrow commented 5 months ago

To add to that, I find that while shortcut for showing patrols (shift + p) works fine, the same for base autoforwarding does not – just like the show flattened terrain command it only works from the menu rather than from a shortcut. No idea why.

induktio commented 5 months ago

The issue with those other keyboard shortcuts does not seem reproducible without further information. Random shortcuts should not just stop working in the game unless the mods map them to other functions. Something about the system/hardware configuration? Does it occur when either only the original game or original game+PRACX is running? Could even try reinstalling the game and other usual troubleshooting steps.

ramseysparrow commented 5 months ago

Hard to think of. Windows 11, 11gen intel cpu, rt6800xt, 64gb ram with m4 nvme. GOG version of SMACx installed via Galaxy.

In my testing the issues aren't present in Vanilla nor with PRAX installed, and only appear when Thinker is added. Does installation order of Thinker and PRAX make a difference? I'll let you know if I notice anything else.

ramseysparrow commented 5 months ago

Ok, so I have now done some fundamental testing and found the pattern. Surprise surprise, the cause is the crossfire engine executive. I don't know what changes crossfire engine had brought, but seeing as both PRAX and Thinker utilise it as the base, the pattern seems to make sense. I've done several rounds of clean installs to make sure all of this is correct. Test results below.


Keyboard shortcuts affected: show flat terrain, show autoforward routes Keyboard shortcut issues present YES / NO ?

vanilla, terran.exe > NO vanilla, terranx.exe > YES

terran.exe (+thinker) > NO terranx.exe (+thinker) > YES thinker.exe > YES

terran.exe (+PRAX) > YES terranx.exe (+PRAX) > does not start at all

induktio commented 5 months ago

I'm not sure what do you mean by terran.exe since it is not possible to use Thinker with this binary as it would start the game without expansion. Only terranx.exe for Alien Crossfire is supported even when using smac_only mode. Game version menu (Ctrl+F4) will always show if Thinker has been loaded in the game. You can use PRACX with terran.exe but it also has a separate dll for this purpose. To know if PRACX has been loaded, one would need to check the Menu button on world map since PRACX always adds an extra menu entry there. Anyway if this bug also appears on the original game, there's some chances it has been mentioned on other forums, but not sure now. It's still not reproducible without some further details though.

ramseysparrow commented 5 months ago

Yes, I'm aware of everything you just mentioned and I'm not only analyzing thinker here, but rather all possible scenarios starting from the simplest ones at vanilla level. The bottom line is that it's the crossfire version of the game (vanilla, thinker, prax, thinker+prax version, it doesn't matter) that causes these two shortcuts to not be working. So it's not Thinker that's at fault.

I would struggle to think of how my individual hardware could affect this. Only thing coming to my mind is that perhaps other people did not use shortcuts for those two much and it could have gone unnoticed.

All in all that's about as much detail as I can possibly give. It's a strange one for sure.