All Projects → guillaume-haerinck → Imac Tower Defense

guillaume-haerinck / Imac Tower Defense

Licence: mit
OpenGl 4.4 game made with Entity Component System

Programming Languages

cpp
1120 projects

Projects that are alternatives of or similar to Imac Tower Defense

Rigelengine
A modern re-implementation of the classic DOS game Duke Nukem II
Stars: ✭ 393 (+1303.57%)
Mutual labels:  game-2d, opengl, sdl2, entity-component-system
Simpleton Engine
What a stupid name for a library
Stars: ✭ 42 (+50%)
Mutual labels:  game-development, game-2d, opengl, sdl2
Rust Game Development Frameworks
List of curated frameworks by the **Game Development in Rust** community.
Stars: ✭ 81 (+189.29%)
Mutual labels:  game-development, opengl, entity-component-system
Entitas Csharp
Entitas is a super fast Entity Component System (ECS) Framework specifically made for C# and Unity
Stars: ✭ 5,393 (+19160.71%)
Mutual labels:  game-development, entity-component-system, design-pattern
Ore Infinium
Ore Infinium, Open Source multiplayer Terraria-inspired Sci-fi game, focused on technology, devices and researching. Written in Kotlin (JVM), LibGDX. Cross platform
Stars: ✭ 139 (+396.43%)
Mutual labels:  game-2d, opengl, entity-component-system
Openage
Free (as in freedom) open source clone of the Age of Empires II engine 🚀
Stars: ✭ 10,712 (+38157.14%)
Mutual labels:  game-development, opengl, entity-component-system
Entitas Cpp
Entitas++ is a fast Entity Component System (ECS) C++11 port of Entitas C#
Stars: ✭ 229 (+717.86%)
Mutual labels:  game-development, entity-component-system, design-pattern
Yage
Simple game engine, written in C++
Stars: ✭ 7 (-75%)
Mutual labels:  game-development, opengl, entity-component-system
Simple2d
🎮 Simple, open-source 2D graphics for everyone
Stars: ✭ 390 (+1292.86%)
Mutual labels:  game-development, opengl, sdl2
Etengine
Realtime 3D Game-Engine with a focus on space sim. Written in C++ 14
Stars: ✭ 408 (+1357.14%)
Mutual labels:  game-development, opengl, entity-component-system
Hybridrenderingengine
Clustered Forward/Deferred renderer with Physically Based Shading, Image Based Lighting and a whole lot of OpenGL.
Stars: ✭ 563 (+1910.71%)
Mutual labels:  opengl, sdl2
Entt
Gaming meets modern C++ - a fast and reliable entity component system (ECS) and much more
Stars: ✭ 6,017 (+21389.29%)
Mutual labels:  game-development, entity-component-system
Ecs
LeoECS is a fast Entity Component System (ECS) Framework powered by C# with optional integration to Unity
Stars: ✭ 578 (+1964.29%)
Mutual labels:  game-development, entity-component-system
Svelto.ecs
Svelto ECS C# Lightweight Data Oriented Entity Component System Framework
Stars: ✭ 605 (+2060.71%)
Mutual labels:  game-development, entity-component-system
Player
RPG Maker 2000/2003 and EasyRPG games interpreter
Stars: ✭ 585 (+1989.29%)
Mutual labels:  game-development, game-2d
Silk.net
The high-speed OpenAL, OpenGL, Vulkan, and GLFW bindings library your mother warned you about.
Stars: ✭ 534 (+1807.14%)
Mutual labels:  game-development, opengl
Openspades
Compatible client of Ace of Spades 0.75
Stars: ✭ 769 (+2646.43%)
Mutual labels:  opengl, sdl2
Renderpipeline
Physically Based Shading and Deferred Rendering for the Panda3D game engine
Stars: ✭ 814 (+2807.14%)
Mutual labels:  game-development, opengl
Pmtech
Lightweight, multi-platform, data-oriented game engine.
Stars: ✭ 478 (+1607.14%)
Mutual labels:  opengl, entity-component-system
Ouzel
C++ game engine for Windows, macOS, Linux, iOS, tvOS, Android, and web browsers
Stars: ✭ 607 (+2067.86%)
Mutual labels:  game-development, opengl

Imac Tower Defense

An OpenGL 4.4 game made with Entity-Component-System design pattern.

This is a student project for the French engineering school IMAC. If you're a french-speaker, you might consider to have a look at the post-mortem (it has a lot of images) inside the doc folder.

The structure of this project is being improved in my next C++ game Roll Goal. The main changes are : improved state machine with the pushdown automaton structure, the replacement of most events by singleton components, a render queue for the renderrer and an more elaborate and maintenable structure for rendering (materials, layers, ...).

Logo Projet

Table of Contents

Features

Getting Started

Documentation

Additional info

SpriteSheet

Features

To-do list

  • [x] Integrate ECS system
  • [x] Load & play spritesheet
  • [x] Load, validate and interpret .itd files
  • [x] Load map as a grid
  • [x] User interface
  • [x] Play audio
  • [x] Object picking
  • [x] Construction system
  • [x] Monster path following
  • [x] Attack system
  • [x] Projectiles
  • [x] Waves system
  • [x] Banking system
  • [x] Switch levels
  • [x] Attack with raycasting
  • [x] Mirror towers
  • [ ] Level design
  • [ ] Tutorials

Getting Started

Prerequisites

You must install CMake and a C++ compiler which handles C++ 14. More on the compiler on the next sections.

The project need your graphic card driver to be up to date, as it is using OpenGL 4.4 core profile (released in 2013, so it should be fine).

Linux

The recommended compiler is g++, minimum version required is g++ 6.1, which is included by default on many linux distribution. You can update it with :

sudo apt-get install build-essential

You will also need the OpenGl and SDL2 packages.

sudo apt-get install libsdl2-dev
sudo apt-get install libglu1-mesa-dev mesa-common-dev

Windows

The recommended compiler is MSVC. To install it you will need Visual Studio (which is not VSCode) and select the C++ development package during installation. The MingW compiler will work as well if you prefer to use it.

Screenshot

Build

The CMakeLists.txt file ensure that the project will work on Linux and Windows platforms.

You can build and launch the project in many different ways, we covered a few of them :

Option 1: Bash (Linux only)

Go to this folder with a terminal, and enter those commands.

cmake .
make
./bin/imac-tower-defense

It means that you are genererating a Makefile, then using it to build the project, and finally running the binaries from the current working directory (needed to find assets).

Option 2: Visual Studio (Windows only)

From Visual Studio 2017, you don't need to generate a visual studio project with cmake. You can simply open visual studio, browse the toolbar to File->Open->Cmake... and select the CMakeLists.txt at the root of this directory. From this point, you have to make sure that you are using a x86 build configuration, and running the imac-tower-defense target. If everything is done, simply press f5 or click on the green arrow at the top.

Screenshot

If you add files, you will need to re-generate the cache for a successfull build. To do so, right click on CMakeLists.txt and use Generate Cache for imac-tower-defense

Screenshot

Option 3: VSCode

You will need the CMakeTools extension from vector-of-bools. If you want to change the source code, I highly recommend using the C/C++ extension from Microsoft and the CMake extension from twxs.

Screenshot

From this point, when you will open the repository folder with VSCode, it will prompt you to configure the projet. You must select a x86 kit, for exemple the Visual Studio Community 2017 - x86 kit. Once the configuration is done, you can compile the project by pressing f7. The .exe file will be outputed in build/Debug folder. You can launch it by pressing f5, but make sure to pick your operating system.

Screenshot

Launch

Before launching the compiled binaries, make sure that the working directory is set to this folder, or the shaders files and images will not be found by the program. If you are unsure about how to do it, just copy the builded files to this folder before launching them. (by default, they will be in the bin/Debug folder).

Documentation

Philosophy

The project follows the Entity Component System design pattern. It has been made possible with the great ENTT library.

Our game is concieved as a state machine, and works like this architecture :

Event publisher

Folder structure

Folder Description
src Source code
main.cpp Entry point of the game
components Struct of data for entities
component-factories Creation of complex components
entity-factories Classes used to build entities
events Struct of data defining event types
graphics Wrapper classes for OpenGL objects
gui User interface logic
logger Error and log handlers for the game
services Functionalities needed anywhere, like playing a sound
systems Update the game and the entities based on their components (all the game logic is there)
core Constants, Game state machine and map loading
game-states The different states of the game (title menu, in-level, game over, ...)
level Read .ITD and .PPM files, and construct a graph from them
res Ressources loaded at runtime
audio Musics and sound effects used accross the game
fonts Fonts used accross the game
gui XAML files describing the view for each user interface
images Images and spritesheets used by the game
levels .ITD and .PPM describing the levels of the game
shaders GLSL shaders used by openGL for rendering
doc Documentation
lib Dependencies

Dependencies

  • OpenGL - The graphic API used
  • GLM - The opengl maths library
  • SDL2 - The library used to create a valid OpenGl context
  • ENTT - The ECS framework
  • SPDLog - Logging lib
  • NeosisGUI - GUI WPF lib for end users
  • Imgui - Immediate mode GUI lib for debugging
  • Debugbreak - Cross-platform code breakpoint header
  • StbImage - Load images
  • FMOD - Load and play adaptative audio
  • Box2D - 2D Physics library

Useful articles

Inspired by

Authors

  • Jules Fouchy - Processing star

  • Cyrielle Lassarre - Designer of the worlds

  • Guillaume Haerinck - Coding maniac

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].