Skip to content

Commit 4fc5ebd

Browse files
committed
Add VS2022 build instructions and update CLion and MSVC guide, and minor fixes
1 parent 8561f24 commit 4fc5ebd

File tree

4 files changed

+122
-109
lines changed

4 files changed

+122
-109
lines changed

Asset/Localization/localization_contribution.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,14 @@ Sections Included:
2121
- **FR**: [French](https://github.com/TheSuperHackers/GeneralsGamePatch/pull/2639)
2222
- **ES**: [Spanish](https://github.com/TheSuperHackers/GeneralsGamePatch/pull/2538)
2323
- **IT**: [Italian](https://github.com/TheSuperHackers/GeneralsGamePatch/pull/2539)
24-
- **KO**: [Korean](https://github.com/TheSuperHackers/GeneralsGamePatch/pull/2540)
25-
- **ZH**: [Chinese Traditional](https://github.com/TheSuperHackers/GeneralsGamePatch/pull/2541)
2624
- **BP**: [Brazilian Portuguese](https://github.com/TheSuperHackers/GeneralsGamePatch/pull/2542)
2725
- **PL**: [Polish](https://github.com/TheSuperHackers/GeneralsGamePatch/pull/2543)
28-
- **RU**: [Russian](https://github.com/TheSuperHackers/GeneralsGamePatch/pull/2544)
29-
- **UK**: [Ukrainian](https://github.com/TheSuperHackers/GeneralsGamePatch/pull/2628)
3026

3127
1.2.1 **Arabic & RTL Languages**: Arabic and other Right-to-Left (RTL) languages are currently compiled with an error
3228
when used in the game. This issue will be fixed soon. If you would like to help resolve this issue or test the upcoming
3329
fix, please let us know in the comment section of the
3430
*AR: [Arabic](https://github.com/TheSuperHackers/GeneralsGamePatch/pull/2546) localization edit*.
31+
More info in [Adding RTL markers in RTL localization for GameTextCompiler](https://github.com/TheSuperHackers/GeneralsGamePatch/discussions/2659).
3532

3633
1.3 **Leave Comments on Edits**: You can reply to existing comments or review the changes yourself. To do so, click on
3734
the **Files changed** tab under the pull request title. If prompted, press **Load diff** to view the changes (if an
@@ -43,7 +40,7 @@ implement. This helps us process the change faster.
4340

4441
1.5 **Non-English Localization**: If you contributed to non-English localization (e.g., Polish), please also check these
4542
two branches for text changes in all languages:
46-
**[United States English](https://github.com/TheSuperHackers/GeneralsGamePatch/pull/2535)** and **[Missing text lines](https://github.com/TheSuperHackers/GeneralsGamePatch/pull/2571)**.
43+
**[United States English](https://github.com/TheSuperHackers/GeneralsGamePatch/pull/2535)** and **[Missing text lines](https://github.com/TheSuperHackers/GeneralsGamePatch/pull/2571)**.
4744

4845
## 2. Working on Existing Languages
4946

@@ -55,10 +52,13 @@ changes already commented on in the file:
5552

5653
2.2 **Editing Tools**: I use **[Notepad++](https://notepad-plus-plus.org/downloads/)** for editing files. If you're
5754
using Linux or macOS, you can use similar programs that offer the same features as Notepad++.
55+
It is **required** to use **UTF-8** text format to avoid compatibility issues across different platforms and text
56+
editors. Ensure that your editor is set to save files in UTF-8 encoding to maintain proper character representation
57+
and prevent any potential issues with special characters.
5858

5959
2.3 **Translation Tools**: I use
60-
**[Google Translate](https://translate.google.ca/?hl=en&tab=TT&sl=auto&tl=en&op=translate)** for quick translations,
61-
but I recommend using your language dictionary in some cases. I personally use **[Multitran](https://www.multitran.com/)**
60+
**[Google Translate](https://translate.google.ca/?hl=en&tab=TT&sl=auto&tl=en&op=translate)** for quick translations,
61+
but I recommend using your language dictionary in some cases. I personally use **[Multitran](https://www.multitran.com/)**
6262
for this.
6363

6464
2.4 **Grammar Checking**: For additional grammar checks, I use **[Free Grammar Checker](https://languagetool.org/)**.

SourceCode/Builds/build_with_clion_vc6_toolchain.md

Lines changed: 20 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,23 @@
55
1. **CLion** installed and configured.
66
2. **Microsoft Visual C++ 6.0 (VC6)** installed (assuming it’s installed in the
77
default directory).
8-
3. **CMake** installed and configured.
9-
4. **Source code** of the project cloned from the TheSuperHackers repository.
8+
3. **Source code** of the project cloned from the TheSuperHackers repository.
109

1110
## Step 1: Setting Up the Toolchain in CLion
1211

13-
1. Open **CLion** and go to **File** -> **Settings** -> **Build, Execution,
12+
1. Open the cloned folder in **CLion** and go to **File** -> **Settings** -> **Build, Execution,
1413
Deployment** -> **Toolchains**.
1514
2. Add a new **Toolchain** by clicking the **+** button.
1615
3. Select **System** as the Type (not Visual Studio).
17-
4. Next to the toolchain name, add the **environment** file by clicking the
16+
4. Rename the toolchain to **Visual Studio 6**
17+
5. Next to the toolchain name, add the **environment** file by clicking the
1818
**+** button and pointing to the following file:
1919

2020
```text
2121
C:\Program Files (x86)\Microsoft Visual Studio\VC98\Bin\VCVARS32.BAT
2222
```
2323

24-
5. Set the paths for the tools:
24+
6. Set the paths for the tools:
2525
- **Build Tool**: Choose the `NMAKE.EXE` file from VC6. For example:
2626

2727
```text
@@ -39,39 +39,31 @@
3939
4040
## Step 2: Configuring the CMake Profile
4141
42-
1. Go to **File** -> **Settings** -> **Build, Execution, Deployment** -> **CMake**.
43-
2. In this window, select the CMake profile you want to configure (if there
44-
isn’t one, create a new one).
45-
3. Choose the **Toolchain** you created in the previous step (VC6 Toolchain).
46-
4. Choose the **Generator** as `NMake Makefiles`.
47-
5. Under **CMake options**, add the following generate settings:
42+
1. In Cmake profiles, enable the profiles you want to use, like vc6, vc6dgb, vc6int, vc6prof.
4843
49-
```text
50-
-G "NMake Makefiles"
51-
```
44+
## step 3: Configuring the installation path
5245
53-
Be careful not to set `Preset`, as it will override the generator settings.
54-
6. Add the build directory path under **CMake Build Directory**:
46+
1. In the target application options, do the following:
5547
56-
```text
57-
C:\Users\User\Documents\CLion\CnC_Generals_Zero_Hour\build\vc6
58-
```
48+
- Set Program arguments with your favorite arguments,like `-win, -quickstart, -nologo`.
49+
- Set Working directory to the game directory.
50+
- Check the run as administrator option.
51+
- In 'Before launch' section, add a new 'install' step.
52+
- To avoid duplication build, remove the 'Build' step.
53+
- Save the configuration, and you are ready to build and run the project.
5954
60-
## Step 3: Compiling and Running the Project
55+
## Step 4: Compiling and Running the Project
6156
62-
1. Now, click the **Build** button in CLion.
63-
2. CLion will start the build process using the VC6 (x86) toolchain.
64-
3. Once the build is successfully completed, a **zerohour.exe** file will be generated.
65-
4. You need to copy the **zerohour.exe** file to the appropriate game directory in order to run the game.
57+
1. Now, click the **Build** button in CLion, or click **Install** in build menu.
58+
2. CLion will start the build/install process using the VC6 (x86) toolchain.
59+
3. Once the build is successfully completed, a executable file will be generated (and installed in the game directory).
6660
6761
---
6862
6963
## Notes
7064
71-
- **Visual C++ 6.0 (VC6)** only supports C++98, so avoid using modern C++ features.
7265
- Working with VC6 requires some adjustments, so it’s always a good idea to check
73-
that the toolchain is working
74-
properly.
66+
that the toolchain is working properly.
7567
- You can add Release and Debug profiles in CLion to build the project in
7668
different configurations.
77-
- Admin rights might be required to run VC6 tools, so make sure to run CLion as an administrator.
69+
- Admin rights might be required to run VC6 tools, so make sure to run CLion as an administrator if needed.

SourceCode/Builds/build_with_msvc22.md

Lines changed: 81 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,87 @@
1-
# Building and Compiling C&C Generals on Visual Studio 2022
1+
# Building and Compiling C&C Generals & Zero Hour on Visual Studio 2022
22

3-
## Prerequisites
4-
5-
1. **Install Visual Studio 2022**
6-
- Ensure that the necessary C++ development components, including MFC, are installed.
7-
8-
2. **Obtain the C&C Generals Source Code**
9-
- Clone or download the source code repository: [TheSuperHackers - GeneralsGameCode](https://github.com/TheSuperHackers/GeneralsGameCode.git).
10-
11-
3. **Install C&C Generals (Steam Version)**
12-
- The game installation is required to access the necessary asset files.
13-
14-
## Build Steps
15-
16-
### 1. Open the Project in Visual Studio 2022
17-
18-
- Launch Visual Studio 2022 and open the solution file `Code/RTS.sln`.
19-
20-
### 2. Select and Compile the Required Projects
21-
22-
- In the **Solution Explorer**, locate the following projects:
23-
- `RTS`
24-
- `WorldBuilder`
25-
- Right-click each project and select **Build**.
26-
- Ensure the build process completes without errors.
3+
This guide will walk you through the process of basic setup and compilation of the C&C Generals and Zero Hour source
4+
code using Visual Studio 2022.
5+
For build using solutions and more advanced build configurations, see below.
276

28-
### 3. Copy Required Game Files from Steam
29-
30-
- Navigate to your C&C Generals Steam installation directory, typically:
31-
32-
``` text
33-
C:\Program Files (x86)\Steam\steamapps\common\Command and Conquer Generals Zero Hour\
34-
```
35-
36-
- Copy all necessary `.BIG` files into the `Run` folder of your compiled project:
37-
38-
``` text
39-
EnglishZH.big
40-
INIZH.big
41-
SpeechZH.big
42-
W3DZH.big
43-
(Other required files)
44-
```
45-
46-
- Copy the entire `Data` folder to the `Run` folder as well.
47-
48-
### 4. Configure Paths Correctly
49-
50-
- Ensure that the `Run` folder within your build directory contains all required game assets.
51-
- If necessary, configure the **working directory** in Visual Studio:
52-
1. Right-click on the `RTS` project.
53-
2. Navigate to **Properties****Debugging**.
54-
3. Set `Working Directory` to your `Run` folder.
55-
56-
### 5. Run the Game or World Builder
7+
## Prerequisites
578

58-
- After compiling, navigate to the `Run` folder.
59-
- Launch `RTSD.exe` or `worldbuilder.exe`.
9+
1. **Visual Studio 2022**
10+
11+
- Ensure that the necessary C++ development components, **including MFC**, are installed.
12+
13+
>[!WARNING]
14+
> You must have the MFC components installed to compile the source code.
15+
<!-- markdownlint-disable-next-line -->
16+
2. **Obtain the Source Code (Step 1)**
17+
- Clone or download the source code
18+
repository: [TheSuperHackers - GeneralsGameCode](https://github.com/TheSuperHackers/GeneralsGameCode.git).
19+
20+
## Steps
21+
22+
### 1. Clone and prepare the project
23+
24+
- Clone the repository to your local machine.
25+
- Open the folder in Visual Studio 2022.
26+
- Wait for Visual Studio to generate the necessary cmake files.
27+
28+
### 2. Build the Project
29+
30+
- Select you favorite build configuration:
31+
- `Build Windows build` for a release build.
32+
- `Build Windows Debug build` for a debug build.
33+
- `Build Windows Internal build` for an internal build.
34+
- `Build Windows Profile build` for a profile build.
35+
36+
>[!TIP]
37+
> For more information on the different build configurations, see the [Build Configurations](build_configurations.md)
38+
page.
39+
40+
- Select the target you want to build:
41+
- `generalsv.exe` to build the base Generals.
42+
- `generalszh.exe` to build Zero Hour.
43+
44+
- Build the project by clicking on the `Build` menu and selecting `Build`.
45+
- The compiled executable will be placed in the `build/<win32 build type>/<game name (Generals/GeneralsMD)>/<build configuration>`
46+
folder. Example: `build/win32dgb/GeneralsMD/Debug`
47+
- Install the game executable in the game directory by clicking on the `Install` in `Build` menu. This will copy the
48+
executable to the retail game directory.
49+
50+
## Additional Steps
51+
52+
### Build through Cmake target view
53+
54+
- In the Solution Explorer, click on 'switch view' and select 'CMake Targets View'.
55+
- Expand the 'Genzh' project and right-click on the target you want to build.
56+
- Select 'Build' to compile the target.
57+
58+
### Build using command line
59+
60+
You need to install cmake and ninja to build the project from the command line.
61+
62+
- In the developer command prompt, open the settings to add the x86 environment terminal.
63+
64+
>[!Tip]
65+
> Alternatively, you can open the x86 Native Tools Command Prompt from the start menu, and navigate to the project
66+
directory in the terminal then run the commands below.
67+
68+
- In the pop-up window, click on the 'Add' and set the following: (assuming default installation path)
69+
- Name: `x86 Native Tools Command Prompt`
70+
- Shell Location: `C:\Windows\System32\cmd.exe`
71+
- Arguments: `/k "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars32.bat"`
72+
- Now you can open the new terminal from the terminal dropdown list.
73+
- Run the following commands to build the project:
74+
- Choose the build configuration:
75+
- `cmake --workflow --preset win32` for Release build.
76+
- `cmake --workflow --preset win32dgb` for Debug build.
77+
- `cmake --workflow --preset win32int` for Internal build.
78+
- `cmake --workflow --preset win32prof` for Profile build.
79+
- Install the game executable in the game directory (assuming that the build was successful):
80+
- `cmake --install build/<preset name>`
81+
- To build a specific target:
82+
- Run `cmake --build build/<preset name> --target <target name>`
83+
- Example: `cmake --build build/win32 --target z_generals`
84+
- Or: `cmake --build build/win32 --target g_generals`
6085

6186
## Troubleshooting
6287

SourceCode/Builds/build_with_msvc6.md

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -52,23 +52,19 @@ Installation of tools and software that are needed for compilation.
5252

5353
## Clone
5454

55-
> **_NOTE:_** The source code you clone is from the WIP from OmniBlade.
55+
Clone the code from TheSuperHackers
5656

57-
Clone the code from WIP OmniBlade -> TheSuperHackers
57+
`git clone https://github.com/TheSuperHackers/GeneralsGameCode.git`
5858

59-
`git clone https://github.com/OmniBlade/CnC_Generals_Zero_Hour.git`
60-
61-
`cd CnC_Generals_Zero_Hour`
62-
63-
`git switch blade/cmake-build`
59+
`cd GeneralsGameCode`
6460

6561
## Compilation
6662

6763
This steps you need to repeat every time after a reboot of your computer.
6864

6965
### Option 1: Activate your VS6 Compiler Environment
7066

71-
Execute the setup build environment script. In your cmd type this.
67+
Execute the setup build environment script. In your cmd type this. (assuming default installation path)
7268

7369
`"C:\Program Files (x86)\Microsoft Visual Studio\VC98\Bin\VCVARS32.bat"`
7470

@@ -106,21 +102,21 @@ set CXX=C:\<VS6_INSTALL_PATH>\VC98\Bin\CL.exe
106102
set MSVCDir=C:\<VS6_INSTALL_PATH>\VC98
107103
```
108104

109-
### Compiling
110-
111-
`cmake --preset vc6`
112-
113-
`cd build\vc6`
105+
### Build the project
114106

115-
`nmake`
107+
Run the following command by the type of build you want to create.
116108

117-
You will find a bunch of files in `build\vc6` and a file called `zerohour.exe`
109+
- `cmake --workflow --preset vc6` for a release build.
110+
- `cmake --workflow --preset vc6dgb` for a debug build.
111+
- `cmake --workflow --preset vc6int` for an internal build.
112+
- `cmake --workflow --preset vc6prof` for a profile build.
118113

119-
Copy `zerohour.exe` of the build folder to your game path.
114+
You will find a bunch of files in `build\vc6\<game name>` and a file called `generalszh.exe` or `generalsv.exe`.
120115

121-
## Start the game
116+
### Install the game executable
122117

123-
Double click `zerohour.exe` inside the Zero Hour path.
118+
Run `cmake --install build\<vc6 build type>`, this will copy the executable to the retail game directory, or you can
119+
copy it manually.
124120

125121
## Troubleshooting
126122

0 commit comments

Comments
 (0)