A custom 2D game engine and sandbox game built from scratch with C++ and SDL3, designed to create a Terraria-style experience with a strong focus on performance and accessibility.
This project aims to create a fully-featured 2D sandbox game engine that can run smoothly on a wide range of hardware, from low-end to high-end systems. Built from the ground up without relying on existing game engines, it includes:
- A lightweight, high-performance game engine core
- Efficient tile-based world system using TMX format
- Optimized rendering pipeline for smooth gameplay
- Cross-platform compatibility through SDL3
- Minimal hardware requirements for maximum accessibility
- C++17
- SDL4
- TinyXML (for TMX map parsing)
- Make (for building)
-
Install required dependencies:
sudo apt-get update sudo apt-get install -y build-essential libsdl3-dev
-
Clone the repository (if not already cloned)
-
Build the project:
make
-
Run the game:
./survivalProject
src/- Source codeAssets/- Asset managementCamera/- Camera systemCharacters/- Player and character logicCore/- Core engine componentsGraphics/- Rendering and texture managementInputs/- Input handlingMap/- Map loading and managementObject/- Game object systemPhysics/- Collision detectionTimer/- Game timing
assets/- Game assetsfonts/- Font filesmaps/- Game maps in TMX formatsprites/- Sprite sheets and textures
- Performance First: Optimized to run smoothly on a wide range of hardware
- Terraria-inspired Gameplay: Sandbox mechanics with exploration and building
- Efficient Rendering: Custom rendering system designed for 2D tile-based worlds
- Low System Requirements: Playable on older and less powerful computers
- Modular Architecture: Clean, maintainable codebase for easy extension
- Cross-platform: Built with SDL3 for broad system compatibility
This project is open source and available under the MIT License.
- SDL3 for the multimedia library
- TinyXML for XML parsing