Skip to content

Latest commit

 

History

History
148 lines (106 loc) · 3.73 KB

README.md

File metadata and controls

148 lines (106 loc) · 3.73 KB

SgCity

Tile based 3D city builder maked from scratch with OpenGL.

Codacy Badge

Current Features

  • Runs on Windows and Linux
  • A fixed time step game loop which process input events, update and render game objects
  • Logging, Exceptions, Assertions
  • OpenGL renderer
  • Event system
  • ImGui based menus
  • Configurable with a config.ini
  • A skybox for a nice background
  • A camera that allows us to move freely
  • Terrain manipulation (raise and lower)
  • Tile selection
  • Different tiles for residential, commercial, industrial and traffic zones
  • The game determines if zones are connected, e.g. with a road.
  • A road network can be built.
  • Animated water surfaces
  • Loads 3D models made in Blender (so we can load plants, trees, buildings etc.)

Next

  • Select buildings via menu
  • Align game objects to the grid and highlights the tiles in color
  • A complete city with simple gameplay
  • Heightmap based terrain creation
  • Load and save the city

Build

Requirements

Platforms

  • Win
  • Linux

Build instructions

Win

First, install the Conan package manager locally.

As this project relies on multiple 3rd-Party Libs, I created a conanfile.txt with all the requirements.

[requires]
glfw/3.3.5
glew/2.2.0
glm/0.9.9.8
spdlog/1.9.2
imgui/1.86
assimp/5.1.0

[generators]
premake

My favor build configuration tool for Windows is Premake5. Premake5 can generate Makefiles and Visual Studio Solutions with a single description file for cross-platform projects. Download Premake5 to your preferred location.

Complete the installation of requirements for the project running:

$ conan install conanfile_win.txt -s build_type=Debug

or

$ conan install conanfile_win.txt -s build_type=Release

followed by:

$ premake5 vs2019

Linux

First, install the Conan package manager locally.

If you are using GCC compiler >= 5.1, Conan will set the compiler.libcxx to the old ABI for backwards compatibility. You can change this with the following commands:

$ conan profile new default --detect  # Generates default profile detecting GCC and sets old ABI
$ conan profile update settings.compiler.libcxx=libstdc++11 default  # Sets libcxx to C++11 ABI

As this project relies on multiple 3rd-Party Libs, I created a conanfile.txt with all the requirements.

[requires]
glfw/3.3.5
glew/2.2.0
glm/0.9.9.8
spdlog/1.9.2
imgui/1.86
assimp/5.1.0

[generators]
cmake

Complete the installation of requirements for the project running:

$ conan install conanfile.txt -s build_type=Debug --build missing

or

$ conan install conanfile.txt -s build_type=Release --build missing

If the following error occurs: ERROR: opengl/system: Error in package_info() method, line 80, then pkg-config must be installed first.

$ mkdir build
$ cd build
$ cmake ..
$ make
$ cd src/bin
$ ./SgCity

License

SgCity is licensed under the GPL-2.0 License, see LICENSE for more information.