Another possible solution for the Artillery screen issues?

SPWaW is a tactical squad-level World War II game on single platoon or up to an entire battalion through Europe and the Pacific (1939 to 1945).

Moderator: MOD_SPWaW

Post Reply
User avatar
Riitaoja2
Posts: 208
Joined: Wed Feb 10, 2016 12:57 pm

Another possible solution for the Artillery screen issues?

Post by Riitaoja2 »

Realising that the cpu AFFINITY fix does not work for all I have been looking into alternative ways to fix the Artillery screen unresponsiveness in SPWAW.

During my searching I came across a peculiar little program called "Battle Encoder Shirase" or "BES" for short. Now the name is very confusing but it is basicaly a utility that allows the user to select any running program and limit the ammount of CPU power it uses.

In my testing I found that if I limit the ammount of CPU power mech.exe is using the artillery screen becomes more responsive. This seems logical since SPWAW is probably using way more cpu power than it needs and with modern processors the game is running too fast and this ultimately leads to the problems we are experiencing.



The website for BES is here:
http://mion.faireal.net/BES/

And you will want to click on the download link for version "Ver. 1.6.2":
http://mion.faireal.net/archive/BES/bes_1.6.2.zip



Now the way to run the game with BES is to first start the game from mech.exe or through DxWnd if you prefer.
-Then when SPWAW is running hit on the Windows key or Alt+tab to get back to desktop and minimize SPWAW.
-Then start BES.EXE and from the BES main window Click on "Target..."
-From the "Which process would you like to limit?" screen select mech.exe and click "Limit this" and Click "yes" on the confirmation. (if you can not see mech.exe in the list you may need to start BES.EXE with admin rights)

Now by default BES will limit Mech.exe to run on -33 percent cpu power and with a Sleep/Awake cycle of 100 milliseconds.
I found that this default value did not help so I started to edit the values using the "Contol..." option.

For my computer a value of -70 percent with Sleep/Awake cycle of 10 milliseconds was appropriate. However these values probably need to be adjusted to suit the CPU on each different computer.
-Then leaving BES running in the background you can go back to SPWAW with Alt+tab or by clicking on the minimized icon on the task bar. If the artillery screen is not working well you can go back to BES with Alt+tab and edit the options more.

What I found was that if the Sleep/Awake cycle is too high I got choppy sounds. And if the cpu limit value was too high the game started to lag. And if it was too low then the artillery screen remained unresponsive.

Even after finding the correct values for my computer I was not able to completely eliminate the artillery screen unresponsiveness but it did help noticeably and made it at least tolerable with just the occasional need to re-click.


Image
Attachments
BES_Control.gif
BES_Control.gif (21.39 KiB) Viewed 528 times
User avatar
Major_Mess
Posts: 478
Joined: Sun Feb 08, 2004 4:28 pm
Location: The True North. Strong and Free

RE: Another possible solution for the Artillery screen issues?

Post by Major_Mess »

Ah Ha!!!!

This is too cool R2.

Synchronicity.[:)]

A few days ago I started looking for software that could select the core-affinity for a program.
I've got a list of them now, I'll be looking at them today (hopefully).

But while I was snooping around I also came upon this BES prog.

I D/L'ed it and ran it on my dual-core machine.

When I set the Slider at -50% (my first experiment) the game stuttered (mouse/sound ... everything)
I kept the Target Sleep/Awake Cycle at 100 m/secs.
After adjusting the Slider to -20% the Game runs fine, the Arty Screen works as it should.

Be careful with the Slider, it doesn't work the way you think it should.

From the prog.
NOTE: You will specify a negative percentage here. For example −25% means that the target will only get 75% of the CPU time it would normally get. By going to −30%, −35%, −40%,… you will THROTTLE MORE, making the target SLOWER.

And from their read.me, concerning the Target Sleep/Awake Cycle
... you can tweak the sleep/awake cycle (frequency) of BES, in milliseconds. This may be handy for example when you want to throttle a game process while keeping the visual smooth. Try a smaller value like 40 in such a case, instead of the default value, 100. Notice, a 40-millisecond cycle means that the visual can be redrawn, in theory, 25 times a second, allowing a 25-fps movie to play without being jumpy. Do not use a too small value, though (the smaller it gets, the less accurate control you get).

This is encouraging, I'd like to have some testers give this a whirl ... I've got a few trying it out at my end.

Wouldn't it be nice if this solved the problem ....... but if it doesn't I'll be working on looking at the programs listed below.
____________

Here's the list of programs that I'll be testing on my dual-core.
Any that look promising I'll post on here for further testing with newer machines.

- THG Task Assignment - A Tom's Hardware tool - he used to be solid .. didn't he?
- Advancedrun V1.02 - a new prog from Nirsoft - gonna look hard at this one.
- PriFinitty64_1.00
- CPU_Control
- Runwithaffinity
- Forcecore 1.2
- ImageCFG
- WinAFC 0.9.2 - a command line program. Last on the list cuz I know nothing about command line instructions.

The problem as I see it is determining the last physical core, and more importantly finding out the hex #, or whatever is needed to identify it to whatever program is used.
What will be needed is a nice seamless way of getting and applying that info into the install process.
Anyhoo, that bridge to be crossed soon enough, after the above gets sorted out first.



Hey!! R2, I've got a Question for you.
How did we determine that it is the last physical core that SPWaW needs to run on? I ask because I never payed much attention to any of that cuz I didn't need to know it until now.

Last night I was playing around with PriFinitty64 on my dual-core machine and I found that the artillery screen worked fine using either core. (As shown with my success using the single core toggle in DxWnd).
That's dual-core though.

_________________________

We're getting closer.

[:D][:D][:D][:D][:D]
_________________________

A thought.
The Artillery Screen is the only Screen that has itty-bitty buttons, and it's also the only Screen that causes grief.
I have to find someone that can:
- open up the mech.exe
- find the Arty Screen
- re-do the graphics >>>bigger buttons (21 lines used - buttons can be about half-again in height IMHO - see attached)
- re-map the buttons
- compare with other screens and adjust whatever is needed to make the buttons work like on every other screen.

That shouldn't be too hard? Eh?

Depending on how the above works out, I'll find someone on another board that I frequent. Over there they won't be so worried about "fixing" things.


cheers

Major Mess

Image
Attachments
MyDream.jpg
MyDream.jpg (157.49 KiB) Viewed 527 times
Click below. You know you want to!!


Image
User avatar
Riitaoja2
Posts: 208
Joined: Wed Feb 10, 2016 12:57 pm

RE: Another possible solution for the Artillery screen issues?

Post by Riitaoja2 »

When I set the Slider at -50% (my first experiment) the game stuttered (mouse/sound ... everything)
I kept the Target Sleep/Awake Cycle at 100 m/secs.
After adjusting the Slider to -20% the Game runs fine, the Arty Screen works as it should.

Be careful with the Slider, it doesn't work the way you think it should.
Indeed it depends on the computer. For my machine the value of -70 and a sleep/awake cycle of 10ms was optimal. There is unfortunaltely no universal value that works for every machine.


- THG Task Assignment - A Tom's Hardware tool - he used to be solid .. didn't he?
- Advancedrun V1.02 - a new prog from Nirsoft - gonna look hard at this one.
- PriFinitty64_1.00
- CPU_Control
- Runwithaffinity
- Forcecore 1.2
- ImageCFG
- WinAFC 0.9.2 - a command line program. Last on the list cuz I know nothing about command line instructions.
That is an impressive list. However these are mainly prgrams that provide a user interface for setting up the cpu affinity/program priority. However I never found much use for them since we already have a graphical user interface for swithching cpu affinity built in Windows itself in the task manager.
Image
Also with the command promt one can input the affinity commands.

From those programs the only one I have used is ImageCFG. However that program is mainly usefull for burning in affinity information directly in the .exe file. This is fine if all you need to do is set up one affinity value that will work for all computers. For example many games are happy with the affinity 1 setting. SPWAW seems to be the only exception.


The problem as I see it is determining the last physical core, and more importantly finding out the hex #, or whatever is needed to identify it to whatever program is used.
What will be needed is a nice seamless way of getting and applying that info into the install process.

The fix that I posted here:
tm.asp?m=4060116
already does all of that with the "SPWAW_Arty_FIX_v22_dxwnd.cmd" script. Basicaly it checks how many cores the users computer has and then also checks if hyper-threading is used. Then it launches SPWAW with the appropriate AFFINITY value. If you open that .cmd file you can study the code. The code is also listed in this post:
fb.asp?m=4043994
However as has been noted even this is not working for all users.

The way the cpu cores are numbered is in binary. so cores 1,2,3,4 would be 1, 10, 100, 1000 in binary. However the AFFINITY command only accepts hexadecimals so you need to convert the binary numbers to hex. You can use the windows calculator in programer mode for that. First select BIN and type in the binary number then when you click HEX it converts the number to a hexadecimal that you can then use with the affinity command.

As said I have already done all of that in the automated script.


Hey!! R2, I've got a Question for you.
How did we determine that it is the last physical core that SPWaW needs to run on? I ask because I never payed much attention to any of that cuz I didn't need to know it until now.
Well basicaly trial and error. For my dual core intel cpu the only way to run SPWAW was with the last core. Running with the first core did not fix it. Also I have had positive results with four other multi-core machines all of them set up to run using the last cpu core.
Last night I was playing around with PriFinitty64 on my dual-core machine and I found that the artillery screen worked fine using either core. (As shown with my success using the single core toggle in DxWnd).
That's dual-core though.
That is interesting. Do you know what type of CPU your computer has? You should be able to find this out from Windows control panel / System menu.



A thought.
The Artillery Screen is the only Screen that has itty-bitty buttons, and it's also the only Screen that causes grief.
I have to find someone that can:
- open up the mech.exe
- find the Arty Screen
- re-do the graphics >>>bigger buttons (21 lines used - buttons can be about half-again in height IMHO - see attached)
- re-map the buttons
- compare with other screens and adjust whatever is needed to make the buttons work like on every other screen.

That shouldn't be too hard? Eh?
The buttons can be redone by simply editing the SHP files. No need to edit mech.exe for that. I will take a look at the shp files and see what I can do about the size of the buttons there.
User avatar
Riitaoja2
Posts: 208
Joined: Wed Feb 10, 2016 12:57 pm

RE: Another possible solution for the Artillery screen issues?

Post by Riitaoja2 »

ORIGINAL: Riitaoja2
The buttons can be redone by simply editing the SHP files. No need to edit mech.exe for that. I will take a look at the shp files and see what I can do about the size of the buttons there.

Well not quite. It turns out the lower buttons in the artillery screen have their own area and do not adjust to the increased size too well. The spotter icons, etc get covered. [:(]


Image


EDIT:
I enlarged the buttons as much as possible without overlapping the other buttons and uploaded the modified shp files here:
tm.asp?m=4073603



Attachments
enlarged_buttons.gif
enlarged_buttons.gif (57.6 KiB) Viewed 527 times
sami heimola
Posts: 421
Joined: Mon May 08, 2000 8:00 am
Location: kouvola finland

RE: Another possible solution for the Artillery screen issues?

Post by sami heimola »

Thanks Riitaoja[:)]. I made test with DxWnd and BES and I had to set 30 as value until choosing targets worked faster than earlier[:D]. Not so much delay between choosing targets than earlier! Awesome.
That deafult 33 had no effect what comes to artillery menu's function...

edit.Works even better with 25[:'(] Thanks once again!
User avatar
Riitaoja2
Posts: 208
Joined: Wed Feb 10, 2016 12:57 pm

RE: Another possible solution for the Artillery screen issues?

Post by Riitaoja2 »

Thats good to hear Sami!
Try playing around with the Target sleep/awake cycle value too.
User avatar
Major_Mess
Posts: 478
Joined: Sun Feb 08, 2004 4:28 pm
Location: The True North. Strong and Free

RE: Another possible solution for the Artillery screen issues?

Post by Major_Mess »

Hi R2:

How ya doin?
The fix that I posted here: ... ... As said I have already done all of that in the automated script.


Yeah, I figured that's what it did, at the time I was thinking more of a small program that would have a simple GUI to show us what we want to know.
Since then I've spent some time, and prolly damaged some brain-cells by learning a little bit about processors and affinity and all that stuff and I realize that what I was needing isn't needed at all.

Sooooooo, according to the Internet:
- Hyper-Threading is not a concern with only one core running. That's a relief cuz I figured that could be what's borking the game.
- Apparently, the physical cores of a processor are the odd numbered ones. eg: A 4 core processor with 2 physical cores will be numbered like this:
Core 0 - physical core #1 (cpu#1)
Core 1 - logical core #1 (cpu#2)
Core 2 - physical core #2 (cpu#3)
Core 3 - logical core #2 (cpu#4)

I think that's how it goes.
My brain hurts just typing this out.

- Any of those programs I listed above will easily set affinity, but there's a better more MS way of doing it.
(and I realize that this is just a variation of the *.cmd file you made for us ....)

Check out this link, one of many that show this method >> HERE!!

So I grabbed my wife's laptop and using the instructions above I set the target for the short-cut to:
C:\\Windows\System32\cmd.exe /C START "SPWaW 2016" /high /affinity # "C:SPWaW 2016\mech.exe"

Using the calculator in the link above I tried setting the affinity for:
- the 2nd physical core only.
- the 1st physical core only.
- the 2nd physical core with the 2nd logical core.
- the 1st physical core with the 1st logical core.

I tried every possible combination ........... with absolutely no positive results.
I also reset the priority switch and re-ran my tests, and as advised on other sites I also removed that switch and did it all again. Nada, Zilch ..... no noticeable improvement.
I know that the i5 processors in laptops are different than the desktop, and maybe (probably) I did something wrong somewhere along the line.
But I dunno.


I'm in waaaay over my head on this.[:@]


Time to call in the experts.



MM

Image
Attachments
laptop.jpg
laptop.jpg (36.62 KiB) Viewed 526 times
Click below. You know you want to!!


Image
User avatar
Major_Mess
Posts: 478
Joined: Sun Feb 08, 2004 4:28 pm
Location: The True North. Strong and Free

RE: Another possible solution for the Artillery screen issues?

Post by Major_Mess »

That is interesting. Do you know what type of CPU your computer has?


I can hear you laughing from way over there.
It's old .... I know.


THAT's why I'm so interested in sorting this goofy Artillery Screen out before I upgrade.

MM

PS: I'll DL the BES program for the laptop today, and try that out.
I'll let you know how it goes.
I've had one response on testing BES on a i5, and it works!!!

Maybe this BES will be the answer.

cheers

Major Mess

Image
Attachments
Capture.jpg
Capture.jpg (25.73 KiB) Viewed 526 times
Click below. You know you want to!!


Image
User avatar
Major_Mess
Posts: 478
Joined: Sun Feb 08, 2004 4:28 pm
Location: The True North. Strong and Free

RE: Another possible solution for the Artillery screen issues?

Post by Major_Mess »

Hmmmmmmmm,

The dev for DxWnd has contacted the author of BES_1.6.2 and has been given permission to integrate the two tools.

Hmmmmmmmmmm



cheers

MM
Click below. You know you want to!!


Image
User avatar
Riitaoja2
Posts: 208
Joined: Wed Feb 10, 2016 12:57 pm

RE: Another possible solution for the Artillery screen issues?

Post by Riitaoja2 »

I am suprised that the affinity fix did not work for the I5-4200U processor. Maybe it has something to do with it beign a laptop. The affinity value my automated scrip would have given for that processor would have been "AFFINITY 4". Or alternatively if manualy setting up the affinity from task manager it would have been the third core (or #2 as the numnbering starts from 0).

About the AMD A4-3420. It is interesting to hear that the AMD dual core processor worked with either core selected. Just goes to show that the processor can act very differently depending if they are Intel or AMD.

Overall I would agree with you that using BES is probably the better solution. There is probably no reliable formula to determine the correct Affinity value for each different cpu out there. Not to mention that some cpu's do not seem to work with any affinity value.

Great news about the DxWnd - BES integration.
Post Reply

Return to “Steel Panthers World At War & Mega Campaigns”