To build ZetaGlest for the first time:
- Download Git for Windows (or make sure it is installed), and make sure that
git
is in thePATH
environment variable. To check, opencmd
and writegit
. If you get anot recognized
error, then continue with step 1, otherwise skip to step 2. Usuallygit.exe
is located inC:\Program Files\Git\bin
after installation. To add it toPATH
, right-click onThis PC
->Properties
->Advanced system settings
->Advanced
tab ->Environment Variables
, and underSystem variables
double-click onPATH
, and add the path togit
as a listing and clickOK
. - Go to the target directory and clone this repository by running the following command in the command prompt:
git clone https://github.com/ZetaGlest/zetaglest-source.git
(or if you have your own fork, replace the first "ZetaGlest" in the URL with your GitHub username). - Make sure Visual Studio 2015 or 2017 is installed, and that Windows 8.1 SDK and Windows Universal CRT SDK are included in the installation. Make sure to have the latest toolset installed for your Visual Studio version. If Visual Studio is installed in a different directory than the default, run the following command before running the script:
SET ProgramFiles(x86)=dir
wheredir
should be replaced with the directory containing the Visual Studio installation, usuallyProgram Files (x86)
. If Windows is 32-bit, omit the(x86)
part. - Run
setup.bat
in/mk/windows
. - The built binaries will be found in the corresponding Visual Studio version and platform selected in
/mk/windows
. - Run and enjoy! :)
Project overview:
-
glest_game
is the executable game binary -
libglest
is a shared static library for ZetaGlest's components -
g3d_viewer
is a.g3d
model viewer -
map_editor
is a ZetaGlest map editor and viewer. ZetaGlest maps are stored in the.gbm
and the.mgm
formats. -
libstreflop
is a cross-platform float processing library to ensure rounding is the same across machines -
g2xml
converts.g3d
ZetaGlest 3D models into a readable XML formatted layout
Side-note for developers who want to debug:
To be able to run ZetaGlest from within Visual Studio using the debugger, you need to:
- Set
glest_game
as the startup project. - Right-click
glest_game
->Properties
->Debugging
and changeWorking Directory
to$(SolutionDir)$(TargetName)\
Do this also forg3d_viewer
andmap_editor
.
Configuration in Visual Studio must be left as Release
, and it must match the project architecture as otherwise it won't compile. The settings involved are the following:
Although the configuration must be set as Release
, one can still use debugging options by making the following changes in the project properties.
To manually emulate Debug
:
Inline Function Expansion: Disabled
Enable Intrinsic Functions: No
Favor Size Or Speed: Neither
Preprocessor: DEBUG instead of NDEBUG
To manually emulate Release
:
Inline Function Expansion: Any Suitable
Enable Intrinsic Functions: Yes
Favor Size Or Speed: Favor fast code
Preprocessor: NDEBUG instead of DEBUG