PDA

View Full Version : CPUAffinity?


Icetech
04-02-2021, 01:10 PM
So i have a friend that gets lag playing on 99, if he manually sets the cpuaffinity to all it runs perfect.. there used to be a setting in eqclient.ini which was "CpuAffinity=-1" that would force EQ to work on all cores without having to do it every time you start the game..

does that not work on 99 or do i have the syntax wrong?

K-EAVKR
04-02-2021, 02:30 PM
I don't know if that works on P1999. But also the syntax slightly wrong. You need:

CpuAffinity0=-1

Each core needs to be specified starting with 0

Icetech
04-02-2021, 02:33 PM
bah.. thanks

K-EAVKR
04-02-2021, 02:58 PM
Let us know if it helped at all. I have a multicore processor as well, but I am not currently experiencing any sort of lag.

Icetech
04-02-2021, 03:09 PM
My buddy said that didn't work but he added "-affinity 1 -high" to the shortcut and that worked....

His system is crazy laggy on 1 core.. weird..

K-EAVKR
04-02-2021, 03:58 PM
I was mistaken on the functionality of CpuAffinity0=-1. The first number (there needs to be a number) describes the client instance. So in this case it would be instance #1 of eqgame.exe.

The number after the equal sign denotes the core to use. A negative one (-1) tells the client go ahead and manage what core to use on its own. Specifying 0-x tells the client to use that core only.

Example:
CpuAffinity0=-1 [Instance 1 of eqgame.exe and let it decide how to handle what core to use]
CpuAffinity0=2 [Instance 1 of eqgame.exe and use core #3]

I've tried this and it doesn't seem to make a difference as you have described. But I also had no issues to begin with.

Sorry if this lead to any confusion. Thinking about it more now I'm pretty sure the modern eq client has multicore support or at least knows how to deal with it or else more people would be having performance issues all over. The affinity thing seems like a bandaid for people with very specific issues or multiple clients (the latter obviously doesn't apply to p99)

Icetech
04-02-2021, 04:07 PM
naw, no biggy... he seems to be running smooth now so not gonna mention it :) thanks for the help!

Detoxx
04-02-2021, 05:23 PM
C:\Windows\System32\cmd.exe /c start "eq" /affinity 1

This is the only way Ive been able to make it run on one affinity and also not have to set it every time you load the game.

Put this before the quotations in your Target when you right click your shortcut and go to properties.

This also, coincidentally, fixed my graphic freeze issue.

Icetech
04-02-2021, 07:31 PM
thanks

digush
08-17-2022, 07:38 PM
this is the batch file i use to launch EQ
it's slightly modified a bit, but this works if you have a 4-core CPU with hyperthreading thus having 8-threads.
so if you have a 4-core CPU without hyperthreading (4 threads) you will have to edit the batch file to handle precisely 4 threads.
if you have an 8-core CPU with hyperthreading (16 threads) you will have to edit the batch file to handle precisely 16 threads. you get the jist.


For this particular batch file to work:
1)inside your Environment Variable in the Windows Operating System
you have to set(or create) a variable:
-Variable_Name to "eqgame"
-Variable_Value to "C:\YOUR_EQ_DIRECTORY\eqgame.exe"

..if this variable(eqgame) does not exist, create it(it gets created when you install EQ)
.....One example: it might not exist if you moved a backed-up EQ directory to a fresh windows install

2)Also need to change the following line in the batch file accordingly:
- SET _AppFolder=C:\YOUR_EQ_DIRECTORY (this is EverQuest's Home)











<<START Launch_Titanium_Affinity.BAT>>

@@ECHO OFF

REM This only works up to Minimum of 1 and Maximum of 8 Cores(Threads?)
REM It picks a random CPU core between 1 and the Maximum and runs Everquest on that CPU core

setlocal
SET _AppFolder=C:\YOUR_EQ_DIRECTORY
SET _AppName=EVERQUEST
SET _AppEXE=eqgame.exe
SET _AppParams=patchme
SET /a _MaxCPU=8
SET /a _rand=%RANDOM%*%_MaxCPU%/32768+1
SET _affinity=0x01
IF %_rand% EQU 2 SET _affinity=0x02
IF %_rand% EQU 3 SET _affinity=0x04
IF %_rand% EQU 4 SET _affinity=0x08
IF %_rand% EQU 5 SET _affinity=0x10
IF %_rand% EQU 6 SET _affinity=0x20
IF %_rand% EQU 7 SET _affinity=0x40
IF %_rand% EQU 8 SET _affinity=0x80



start /affinity %_affinity% eqgame patchme
endlocal


<<END Launch_Titanium_Affinity.BAT>>



credits:

https://wiki.project1999.com/Players:Technical/Affinity
https://www.youtube.com/watch?v=hgFuYs-okjY

khandman
08-18-2022, 02:36 PM
I use the below from a batch file.

C:\Windows\System32\cmd.exe /C Start /affinity 1 N:\Games\Project1999\eqgame.exe patchme

VII
09-04-2022, 12:17 AM
i have a 12 core 24 thread cpu, how does this work for me? just change maxcpu=24? can i still keep it at 6? to limit which cores it can use?

digush
09-04-2022, 12:39 PM
setlocal
SET _AppFolder=C:\YOUR_EQ_DIRECTORY
SET _AppName=EVERQUEST
SET _AppEXE=eqgame.exe
SET _AppParams=patchme
SET /a _MaxCPU=24
SET /a _rand=%RANDOM%*%_MaxCPU%/32768+1
SET _affinity=0x01
IF %_rand% EQU 2 SET _affinity=0x02
IF %_rand% EQU 3 SET _affinity=0x04
IF %_rand% EQU 4 SET _affinity=0x08
IF %_rand% EQU 5 SET _affinity=0x10
IF %_rand% EQU 6 SET _affinity=0x20
IF %_rand% EQU 7 SET _affinity=0x40
IF %_rand% EQU 8 SET _affinity=0x80
IF %_rand% EQU 9 SET _affinity=0x100
IF %_rand% EQU 10 SET _affinity=0x200
IF %_rand% EQU 11 SET _affinity=0x400
IF %_rand% EQU 12 SET _affinity=0x800
IF %_rand% EQU 13 SET _affinity=0x1000
IF %_rand% EQU 14 SET _affinity=0x2000
IF %_rand% EQU 15 SET _affinity=0x4000
IF %_rand% EQU 16 SET _affinity=0x8000
IF %_rand% EQU 17 SET _affinity=0x10000
IF %_rand% EQU 18 SET _affinity=0x20000
IF %_rand% EQU 19 SET _affinity=0x40000
IF %_rand% EQU 20 SET _affinity=0x80000
IF %_rand% EQU 21 SET _affinity=0x100000
IF %_rand% EQU 22 SET _affinity=0x200000
IF %_rand% EQU 23 SET _affinity=0x400000
IF %_rand% EQU 24 SET _affinity=0x800000

start /affinity %_affinity% eqgame patchme
endlocal



this should work if you have 12 cores and 24 threads

digush
09-04-2022, 12:43 PM
the point of all this is to choose a random thread out of the 24 threads that you have so EQ isn't always running on thread "7" or some hard-coded thread#

so u mite run the batch file once and it'll select thread #3
then you close EQ run the batch file and it'll select thread#18

keeps it random as possible to give your cores a chance to take a break between EQ sessions

VII
09-04-2022, 02:30 PM
understood. it seems that since i’m running eq as admin the batch needs to run cmd.exe as admin as well to have to set affinity. was extra lines can i add to run cmd.exe in the batch as admin?

currently if i run the batch as you’ve written my affinity on eqgame.exe is still all cores enabled. if i uncheck run as admin in eqgame.exe properties, then your batch works as intended. but i was to keep eq in compatibility mode which requires admin.

mcoy
09-04-2022, 09:55 PM
understood. it seems that since i’m running eq as admin the batch needs to run cmd.exe as admin as well to have to set affinity. was extra lines can i add to run cmd.exe in the batch as admin?

currently if i run the batch as you’ve written my affinity on eqgame.exe is still all cores enabled. if i uncheck run as admin in eqgame.exe properties, then your batch works as intended. but i was to keep eq in compatibility mode which requires admin.

Create a shortcut to the batch file, and in the advanced properties of the shortcut, set it to run as admin:

https://imgur.com/oTS3p3Z.jpg

-Mcoy