THIS TOPIC IS OBSOLETE!
Brute Force is no longer using these launchers - topic archived
In this topic I want to explain the difference between batch and executable launcher.
Long story short, the Tiberian Sun engine (on which RA2 and YR are based) utilizes only one core of the CPU.
If your CPU has, for example, 4 cores numbered from 0 to 3, the game's main process (gamemd.exe) will typically run on the first core (0),
which is usually the most heavily used core in your system. The batch launcher operates the game in this manner.
To gain a slight performance boost, we can force the game process to run on a different core.
This can be achieved by modifying the 'affinity' and 'priority' of the process using Windows Task Manager.
Alternatively, you can utilize the bf_launcher.exe that I have created specifically for this purpose.
Here is a snippet of the source code:
int main() {
std::ios_base::sync_with_stdio(false);
std::system("title Mbnq's Brute Force Launcher");
std::system("cls");
// Displaying the header
std::cout << "*********************************************************\n";
std::cout << "* *\n";
std::cout << "* Command & Conquer Yuri's Revenge - Brute Force Mod *\n";
std::cout << "* *\n";
std::cout << "* mbnq.pl 2024 *\n";
std::cout << "* *\n";
std::cout << "*********************************************************\n\n";
std::cout << "https://www.moddb.com/mods/cc-brute-force\n";
std::cout << "https://github.com/mbnq/RA2YRBF\n\n";
std::cout << "Welcome back commander!\n\n";
std::cout << "Status:\n";
// Check for the existence of yuri.exe
std::ifstream file("yuri.exe");
if (!file) {
std::cout << " Game files cannot be found!\n";
std::cout << " Place me (bf_launcher.bat) in your Yuri's Revenge dir\n";
std::cout << " (in folder with yuri.exe) first!\n\n";
std::cout << "Press any key to quit...\n";
system("pause > nul");
return 1;
}
// Check for and execute BFConsole.exe if it exists
std::ifstream debugFile("debug\\BFConsole.exe");
if (debugFile) {
std::cout << " Starting the game...\n";
system("start Syringe \"gamemd.exe\" %* -NOLOGO -LOG -LOG-CSF -b=38");
std::cout << " BFConsole found! Starting with delay...\n";
Sleep(10000);
system("cd debug\\ && BFConsole.exe debug.log");
}
else {
std::cout << " Starting the game...\n";
system("start Syringe \"gamemd.exe\" %* -NOLOGO -b=38");
std::cout << " Trying to use mind tricks...\n";
Sleep(10000);
std::wstring processName = L"gamemd.exe"; // Process name
DWORD_PTR affinityMask = 14; // 0b1110 - Use CPU 2, 3, and 4
DWORD processID = FindProcessId(processName);
if (processID == 0) {
std::wcerr << L" Didn't work.\n";
return 1;
}
HANDLE hProcess = OpenProcess(PROCESS_SET_INFORMATION, FALSE, processID);
if (hProcess == NULL) {
std::wcerr << L" OOI Not Found.\n";
return 1;
}
if (!SetProcessAffinityMask(hProcess, affinityMask)) {
std::wcerr << L" Yuri's mind trick's wasn't good enough.\n";
CloseHandle(hProcess);
return 1;
}
std::wcout << L" Worked, Yuri is my master.\n";
CloseHandle(hProcess);
Sleep(10000);
}
return 0;
}
Edited by: mbnqpl