Author Topic: [SOLVED] Graphic bug and AI slower speed  (Read 2057 times)

0 Members and 1 Guest are viewing this topic.

Offline Nightblade

[SOLVED] Graphic bug and AI slower speed
« on: January 22, 2020, 03:44:45 PM »
Hello

I'm on window 10 using SMAC/SMAX + Scient Patch 2.1 + PRACX 1.10 and the Smac CPU Fix (to avoid the game eating 100% of cpu).

I noticed that very often during the AI turn, big black squares will appear.
By example from there (click thumbnail for full size) :

when you can see the explored area

During the AI turn :

there are now black screen around what were already explored areas (and my bases names still can be seen in those black squares)

As soon as i move around the map , the display will fix itself
Additionally PRACX allow zoom in/out, so i noticed if instead of leaving the default zoom as it is with my mousewheel i either zoom in or zoom out and pla like this, this "black square" display bug will not happen during an AI turn.

Any solution other than playing either zoomed in or out ?
« Last Edit: January 23, 2020, 11:35:06 PM by Nightblade »

Offline bvanevery

  • Emperor of the Tanks
  • Thinker
  • *
  • Posts: 6370
  • €659
  • View Inventory
  • Send /Gift
  • Allows access to AC2's quiz & chess sections for 144 hours from time of use.  You can't do without Leadship  Must. have. caffeine. -Ahhhhh; good.  Premium environmentally-responsible coffee, grown with love and care by Gaian experts.  
  • Planning for the next 20 years of SMACX.
  • AC2 Hall Of Fame AC Text modder Author of at least one AAR
    • View Profile
    • Awards
Re: Graphic bug
« Reply #1 on: January 22, 2020, 04:12:59 PM »
Haven't heard of SMAC CPU Fix before.  I wonder how that works and if there's a downside.

Try installing a clean copy of the game in a brand new custom directory.  Then install Scient Patch 2.1.  Do you have no problems?  Then it's not Scient Patch per se, although something could be interacting with it.

Then install PRACX 1.10.  Do you have no problems?  Then it's not that.  Although, since PRACX does mess with graphics, it's not going to shock me if this is the culprit.

If PRACX wasn't the problem, then install SMAC CPU Fix.  Bet you see the problem now.

Your workarounds: Scient's patch can be valuable for some things but you don't have to have it.  I don't play with or support any of the unofficial patches in my modding work.  I don't get bit with bugs often enough to feel that patches are warranted.  As you can see, they can come with their own bugs, especially when you stack up a lot of unofficial patches that have no testing history together.

I doubt this is going to turn out to be a problem with Scient anyways though.  Even if it does, Scient is still around and in principle, the problem could be tracked down and fixed.  So I doubt you have to give up Scient if you don't want to.  I'm just saying, don't feel *compelled*.  People like me play the straight official game just fine.

IMO you don't need PRACX for anything.  You can task switch just fine with CTRL-ALT-TAB.  Yes I had to learn a new keystroke to do that, but that's better than installing a patch that might give me new problems.  The only real value add I remember from PRACX is some extra tile visualization stuff, and that's not important to me.  I mean, I know this game like the back of my hand, I don't need assists.

I'm saying, PRACX is very easy to give up.

I wouldn't ever install something billing itself as a "SMAC CPU Fix" unless I was actually experiencing demonstrable CPU slowdowns.  I'm using 11 year old business class laptops and haven't noticed any such thing.  I typically play on Huge maps, not larger.  I have noticed some late game lockups on 126x252 maps, which I define as Giant maps, but these were not accompanied by any CPU slowdowns.  So I do have to wonder, what problem this is meant to solve.  It's not something I'm seeing in ordinary play.  YMMV, but don't go worrying about patches unless you actually have a problem.

Offline Nightblade

Re: Graphic bug
« Reply #2 on: January 23, 2020, 05:14:18 PM »
Thanks for replying.

Before going to experiment with reinstallation i was wondering why when i was zooming in or out (and stayed like this) the bug wasn't happening during the AI turn.

So i started to think about the game resolution (as pracx is doing things on that) , after adding a Disabled=1 in the pracx section of the ini and seeing no changes, i decided to try something else.
Once ingame i went to game -> pracx (as pracx add a section there) and decided to change the resolution that by default had been set for me to 1920x1080 and change it to 1024x768 (closer if i remember well to Alpha Centauri native resolution).

Relaunched SMAX to have this change actually applied (and it did) , i then loaded my saved game, let the AI play turn after turn and noticed : no graphic bug, me happy :D

So it really looks like this graphic bug is linked to the fullscreen resolution that pracx is setting for me.

Still will experiment with reinstall to see if the game can play faster without pracx as when i had an older potato computer and window xp i remember the AI was playing faster.
I wonder if the cpu fix (that solve the game using too much CPU due to its old code style and modern OS not liking that much and so working your cpu fans too hard) play a role in this too, would be sad if yes as i'm not really willing to let the game work my cpu much more than it should

Offline Nightblade

Re: Graphic bug
« Reply #3 on: January 23, 2020, 07:30:18 PM »
Some update

The AI slow play is sadly due to the cpu fix, i reinstalled only SMAC/SMAX and the Scient 2.1 patch , launched " terranx.exe " and the AI played as fast as in my memories from when i was playing the game on my older window xp powered potato computer.

Then i re-added the cpu fix files (the launcher.exe and launcher.dll) then launched " loader.exe -e terranx.exe " , the AI -noticably- moves its unit slower and the game takes more time to do things.

Very sad, as you can see on the ressource monitor screenshot below, the CPU usage taken by SMAX is much better when using the cpu fix (to the left without the cpu fix and to the right with it) so it does not overwork your CPU , its heat and its fans.


I reported this slower AI issue on the author github in case he may have an idea on how to fix that while keeping the extremely nice cpu % usage reduction.

Offline bvanevery

  • Emperor of the Tanks
  • Thinker
  • *
  • Posts: 6370
  • €659
  • View Inventory
  • Send /Gift
  • Allows access to AC2's quiz & chess sections for 144 hours from time of use.  You can't do without Leadship  Must. have. caffeine. -Ahhhhh; good.  Premium environmentally-responsible coffee, grown with love and care by Gaian experts.  
  • Planning for the next 20 years of SMACX.
  • AC2 Hall Of Fame AC Text modder Author of at least one AAR
    • View Profile
    • Awards
Re: Graphic bug
« Reply #4 on: January 23, 2020, 08:29:51 PM »
You don't need PRACX to solve screen resolution issues.  You need "DirectDraw=0" in your Alpha Centauri.ini.

The CPU "fix" sounds like a case of getting what you pay for.  What you should try to do, if you haven't already, is set your computer to passive cooling.  It's under the advanced power settings.  If the system starts to overheat, it will just cut the CPU usage to 80% or 50% or whatever is appropriate to prevent the overheating.  At least, that's what's supposed to happen.  I don't think it's foolproof on Windows 10.  I've got both of my 11 year old business class laptops set to that. 

Offline Nightblade

Re: Graphic bug
« Reply #5 on: January 23, 2020, 09:53:14 PM »
I already had DirectDraw=0

DirectDraw=0 does not prevent the bug to happen if i have pracx and have pracx setting the resolution to its maximum by default. The only solution is to either NOT have pracx or have pracx and set the resolution to 1024x768 in game->pracx options when ingame.

For the cpu problem, changing the w10 cooling policy is a rather bad idea when you have some high performance demanding software (most modern ones are) as performance in those applications will very noticably degrade.

And having to change that just for one game, that sounds overkill.
I just hope the cpu fix author will find a way to fix the slower AI issue that unfortunately comes with it, the loader.ini has some options
MessageWaitTimeMinMs=1
MessageWaitTimeMaxMs=10
MessageWaitTimeThresholdMs=250
MessageProcessingTimeThresholdMs=50
that i suppose tinkering with may help in this AI slowness problem but as the explanations of how the cpu fix works :
https://github.com/vinceho/smac-cpu-fix/issues/1
Does not really help me to know what each of those variables do and how good/bad it would be to increase/decrease them, i'll avoid experiment with them as i value my cpu life time a bit and prefer to let that work to the professionals :D

Offline bvanevery

  • Emperor of the Tanks
  • Thinker
  • *
  • Posts: 6370
  • €659
  • View Inventory
  • Send /Gift
  • Allows access to AC2's quiz & chess sections for 144 hours from time of use.  You can't do without Leadship  Must. have. caffeine. -Ahhhhh; good.  Premium environmentally-responsible coffee, grown with love and care by Gaian experts.  
  • Planning for the next 20 years of SMACX.
  • AC2 Hall Of Fame AC Text modder Author of at least one AAR
    • View Profile
    • Awards
Re: Graphic bug
« Reply #6 on: January 23, 2020, 10:19:36 PM »
Why hold on to PRACX if it's causing you a problem though?  I don't get it.  It's not that important for anything.  It gives some different resource icon displays, and there was 1 other visualization thingy I think.  I mean, you can go to that project and file a bug report I suppose, but I'm not sure it's being actively developed.

Quote
And having to change that just for one game, that sounds overkill.

Guess that depends how often you alternate between titles.  I only do SMAC for the most part.  My laptops are ancient and decrepit, so it didn't even occur to me to think about the performance demands of a current 3D title.

Nevertheless, I don't believe I've got any excessive CPU usage on my laptops.  There's certainly nothing I've noticed as a player of SMAC.  Then again I've got my systems on passive cooling, so maybe I wouldn't notice.  I suppose I could look at what my CPU usage is... but I'm a bit wondering about how that would be done, since changing context to view the CPU usage, changes what's running at the time.

Hmm, maybe your real difficulty with high CPU usage is you're running PRACX.  Or PRACX + Scient.  Who knows?  It's a different subject of "what to track down", compared to your original post.

Offline Nightblade

Re: Graphic bug
« Reply #7 on: January 23, 2020, 11:27:08 PM »
I am not hanging to pracx, i was just testing around with it, i have no problem not using it, scient 2.1 with the bug and the crash fixing is the only one i need.

Now from my various tests the cpu problem isn't linked to pracx.
SMAC/SMAX use some codes that were working perfectly in XP (and lesser as i had SMAC working on 98 without a problem) time , they weren't using too much CPU.

But with time both OS and CPU changed the way things are managed for various reason, so a piece of code that had no problem in XP time could lead into having some problem in newer OS and newer CPU, that's exactly and unfortunately what happens with SMAC/SMAX.
And it was exactly the same problem with Civ2 too (as there were the same problematic for modern OS/CPU piece of codes used in both games) that on modern OS/CPU can eat a very lot of CPU .

that's what the cpu fix loader is supposed to do : change the old code problematic and cpu hungry on modern os/cpu by a code that wouldn't be like that (the TTOP patch for Civ2 integrate such fix and it works great for Test of Time CPU use).

It seems after tinkering against my best judgement ( :D ) i finally found a working solution.
As i thought previously it was indeed going to involve tweaking the settings in the loader.ini

By default those 2 lines in the loader.ini file :
MessageWaitTimeMinMs=1
MessageWaitTimeMaxMs=10

if set to
MessageWaitTimeMinMs=0.5
MessageWaitTimeMaxMs=1

Will result in no noticable AI speed (thinking/moving) difference between using the cpu fix or not.
And will only slightly improve the cpu use from using the default loader.ini setting.

After closing everything uneeded i load with "terranx.exe" then load a save (and with the loader.exe and loader.dll deleted) so i could observe better the cpu use on playing a dozen of turn (well letting the AI play with me setting every unit on hold)
Result :


Now after adding the loader.exe and the loader.dll and launching "loader.exe -e terranx.exe" then load the same save as previously , let it play a dozen of turn without me doing anything.
Result as expected :

But unfortunately the AI is noticably slower at everything than without using the cpu fix.

Then after modifying the 2 lines i mentionned up there in that post, i launch again SMAX with "loader.exe -e terranx.exe " then load the same save as previously , let it play a dozen of turn without me doing anything.
Result :

As expected slightly higher CPU usage (but still much lower than without the cpu fix) and very interestingly : the AI is as fast as everything as it was when not using the cpu fix.

So in the end problem solved, i can happily play SMAX at full speed without a worry about CPU being eaten alive :)


Offline bvanevery

  • Emperor of the Tanks
  • Thinker
  • *
  • Posts: 6370
  • €659
  • View Inventory
  • Send /Gift
  • Allows access to AC2's quiz & chess sections for 144 hours from time of use.  You can't do without Leadship  Must. have. caffeine. -Ahhhhh; good.  Premium environmentally-responsible coffee, grown with love and care by Gaian experts.  
  • Planning for the next 20 years of SMACX.
  • AC2 Hall Of Fame AC Text modder Author of at least one AAR
    • View Profile
    • Awards
Re: [SOLVED] Graphic bug and AI slower speed
« Reply #8 on: January 24, 2020, 01:45:56 AM »
I checked that the Balanced power profile on my laptop had active cooling.  Then I switched to it.  No overheating, fan never came on.  BTW this destroyed my Power Saver plan, it doesn't exist anymore for some weird reason.  So anyone else reading this, if you switch stuff it could be annoying.  There are ways to get it back, but I'm not going to bother for now.
CPU usage
CPU usage

I started Task Manager, then started SMAC.  Set up an AI only game, let it run for a bit.  CTRL-ALT-TAB allowed me to make a window of the 2 tasks right next to each other, showing the CPU usage in miniature.  It was consistently 60%.  The rise in the graph is from when I activated the task switching to see the results and make the screenshot.

Official GOG 2.0.2.23 binary, no patches.  My *.txt only mod, which shouldn't matter really.  DirectDraw=0 in Alpha Centauri.ini.  Fast movements, fast battle resolution.

Intel Core 2 Duo.  P9600 @ 2.54 GHz each core.  4 GB RAM.  1280x800 resolution.  Intel integrated graphics, nothing fancy.

Windows 10 Pro, version 1909, OS build 18363.535.  No special compatibility stuff set up. 

My laptop is from 2008.  Is your machine a lot older than that?  You talked about Windows XP; maybe your machine is very old.  My CPU is 64-bit.

If your machine isn't silly old, maybe you've just got a bad graphics driver.  I believe I'm using something Microsoft cooked up, because historical drivers didn't prove to be that well behaved IIRC.  It's been awhile.  It was good to get my old laptops working on Windows 10, but at some point I lost energy for fighting various issues.  I know that my driver has a bad OpenGL implementation, it's not even 2.0.  Some games choke and die on that, as they fail to test for something really old.

Offline Nightblade

Re: [SOLVED] Graphic bug and AI slower speed
« Reply #9 on: January 24, 2020, 03:25:24 PM »
What you're looking at is the averaged cpu usage that's why it's constant, check the ressource monitor (on the bottom of your task manager "Performance" tab) to see what each core is working when playing SMAX, as SMAX is only using one core you'll see that one core is overworking in comparison to the other one.

Anyways, your averaged cpu use does not look very different than my averaged one , it's normal if you don't use the cpu fix.

With the cpu fix it would be much lower, so you would be able to use other applications in the same time without the CPU going too high.

My machine is fine, it's SMAX that was not coded with modern OS/CPU in mind that's all.
Anyways, with the cpu fix and the corrected settings everything works great now and the cpu usage is much lower.



Offline bvanevery

  • Emperor of the Tanks
  • Thinker
  • *
  • Posts: 6370
  • €659
  • View Inventory
  • Send /Gift
  • Allows access to AC2's quiz & chess sections for 144 hours from time of use.  You can't do without Leadship  Must. have. caffeine. -Ahhhhh; good.  Premium environmentally-responsible coffee, grown with love and care by Gaian experts.  
  • Planning for the next 20 years of SMACX.
  • AC2 Hall Of Fame AC Text modder Author of at least one AAR
    • View Profile
    • Awards
Re: [SOLVED] Graphic bug and AI slower speed
« Reply #10 on: January 24, 2020, 06:11:26 PM »
Here's what I got just before my game crashed.   :D  That game kept doing that for some reason.  Might have been related to a bunch of units that kept moving in a long loop between the same squares.  The loop breaker failsafe would eventually trigger, but maybe that chews up CPU or causes crashes.  Dunno.  AI vs. AI only game, go figure.  Not typical of AI vs. AI test runs I've done, but not unheard of either.

CPU core usage then crash
CPU core usage then crash

For fun I left my Firefox browser minimized while playing.  This is actually a frequent pattern of mine when I'm writing up After Action Reports.

Both cores are getting utilized about the same amount.  This isn't what you predicted.

Offline bvanevery

  • Emperor of the Tanks
  • Thinker
  • *
  • Posts: 6370
  • €659
  • View Inventory
  • Send /Gift
  • Allows access to AC2's quiz & chess sections for 144 hours from time of use.  You can't do without Leadship  Must. have. caffeine. -Ahhhhh; good.  Premium environmentally-responsible coffee, grown with love and care by Gaian experts.  
  • Planning for the next 20 years of SMACX.
  • AC2 Hall Of Fame AC Text modder Author of at least one AAR
    • View Profile
    • Awards
Re: [SOLVED] Graphic bug and AI slower speed
« Reply #11 on: January 25, 2020, 05:15:28 AM »
I checked that the Balanced power profile on my laptop had active cooling.  Then I switched to it.  No overheating, fan never came on.  BTW this destroyed my Power Saver plan, it doesn't exist anymore for some weird reason.  So anyone else reading this, if you switch stuff it could be annoying.  There are ways to get it back, but I'm not going to bother for now.

Actually, now I'm getting fan and overheating.  Even though I set my Balanced plan to Passive Cooling.  Just playing SMAC.  I did do a Visual Studio compilation earlier, but that's been off for a long time now.  I also took a break and killed SMAC at one point, did web browsing briefly.  Wasn't blowing fan then.  It's odd that I never had a problem with my Power Saver plan.  There must have been more to it than just passive cooling.

So, now I'll have to try to get it back.  It's supposed to just be typing a magic incantation in an elevated command prompt.

Hm, maybe try a reboot first.  Maybe it isn't too smart about switching from active to passive cooling.  Unfortunately that didn't help.  Also checked CPU dual core performance.  Both cores are going around 60% as usual, but now I've got a hot hard drive and passive cooling.  Hmm, hot hard drive.  Balanced must be doing something stupid with that.

Got the command to work.  Had to click "show additional plans", that tripped me up.  Upon activating Power Saver plan, hard drive immediately calmed down and laptop noticeably started getting cooler.  Rah rah Microsoft.
« Last Edit: January 25, 2020, 05:54:04 AM by bvanevery »

 

* User

Welcome, Guest. Please login or register.
Did you miss your activation email?


Login with username, password and session length

Select language:

* Community poll

SMAC v.4 SMAX v.2 (or previous versions)
-=-
24 (7%)
XP Compatibility patch
-=-
9 (2%)
Gog version for Windows
-=-
103 (32%)
Scient (unofficial) patch
-=-
40 (12%)
Kyrub's latest patch
-=-
14 (4%)
Yitzi's latest patch
-=-
89 (28%)
AC for Mac
-=-
3 (0%)
AC for Linux
-=-
6 (1%)
Gog version for Mac
-=-
10 (3%)
No patch
-=-
16 (5%)
Total Members Voted: 314
AC2 Wiki Logo
-click pic for wik-

* Random quote

Look at any photograph or work of art. If you could duplicate exactly the first tiny dot of color, and then the next and the next, you would end with a perfect copy of the whole, indistinguishable from the original in every way, including the so-called 'moral value' of the art itself. Nothing can transcend its smallest elements.
~CEO Nwabudike Morgan 'The Ethics of Greed'

* Select your theme

*
Templates: 5: index (default), PortaMx/Mainindex (default), PortaMx/Frames (default), Display (default), GenericControls (default).
Sub templates: 8: init, html_above, body_above, portamx_above, main, portamx_below, body_below, html_below.
Language files: 5: index+Modifications.english (default), TopicRating/.english (default), PortaMx/PortaMx.english (default), OharaYTEmbed.english (default), Aeva.english (default).
Style sheets: 0: .
Files included: 50 - 1568KB. (show)
Queries used: 38.

[Show Queries]