|
| 1 | +# Building and Compiling C&C Generals on Visual Studio 2022 |
| 2 | + |
| 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. |
| 27 | + |
| 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 |
| 57 | + |
| 58 | +- After compiling, navigate to the `Run` folder. |
| 59 | +- Launch `RTSD.exe` or `worldbuilder.exe`. |
| 60 | + |
| 61 | +## Troubleshooting |
| 62 | + |
| 63 | +- **Missing DLLs?** Ensure that all required dependencies are installed. |
| 64 | +- **Game not launching?** Verify that all necessary `.BIG` files are correctly placed. |
| 65 | +- **Build errors?** Check Visual Studio settings and dependencies for any issues. |
0 commit comments