From 9566d25ceeaa49ca42a93bbaef5578983ab443b8 Mon Sep 17 00:00:00 2001 From: Bilal Kahraman <45990633+bilalkah@users.noreply.github.com> Date: Thu, 19 Dec 2024 21:23:00 +0300 Subject: [PATCH] Add licence, update readme (#22) --- LICENSE | 21 +++++ README.md | 146 +++++++++++++++++++++++++++--- app/CMakeLists.txt | 2 +- app/main.cpp | 2 +- images/game_view_with_mp5.png | 3 + images/game_view_with_shotgun.png | 3 + images/minimap.png | 3 - images/screenshot1.png | 3 - images/screenshot2.png | 3 - images/screenshot3.png | 3 - 10 files changed, 164 insertions(+), 25 deletions(-) create mode 100644 LICENSE create mode 100644 images/game_view_with_mp5.png create mode 100644 images/game_view_with_shotgun.png delete mode 100644 images/minimap.png delete mode 100644 images/screenshot1.png delete mode 100644 images/screenshot2.png delete mode 100644 images/screenshot3.png diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..47e098e --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Bilal Kahraman + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 8949ded..12f9058 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,138 @@ -# Project-Wolfenstein +# Wolfenstein Project -## Views from the game +Welcome to the Wolfenstein project! This README provides an overview of the game's features, setup instructions, and how to contribute to the development. Dive into a dynamic and immersive world built using **C++** and **SDL**, where you'll experience real-time combat and a rich environment. -![](images/screenshot1.png) -![](images/screenshot2.png) -![](images/screenshot3.png) -![](images/minimap.png) +## View from the game + +
+ + +
+ +--- + +## Features + +### Core Gameplay +- **Dynamic Combat**: Engage in fast-paced action using a variety of weapons. +- **Pathfinding with A***: Enemies dynamically navigate the environment using the A* algorithm. +- **Player Interactions**: Smooth controls for movement and combat. + +### Environment +- **Static Maps with Dynamic Elements**: Navigate a static map populated with dynamic objects and enemies. + +### Enemy Behavior +- **State Design Pattern**: Enemies utilize a flexible state system with the following behaviors: + - Idle + - Walk + - Attack + - Pain + - Death + +### Weapons +- **State Design Pattern**: Weapons use states for the following functionalities: + - Loaded + - OutOfAmmo + - Reloading +- **Synchronized Execution**: All weapon and enemy animations are synchronized with the main game clock to maintain fluid gameplay. + +--- + +## Technical Highlights + +- **Pathfinding and Navigation**: A* algorithm is used for efficient enemy movement and navigation. For more details on the implementation, see my [path-planning](https://github.com/bilalkah/path-planning) project. +- **Ray Casting with DDA**: The Digital Differential Analyzer (DDA) algorithm is used for efficient ray casting, creating realistic field of view. +- **Templates and Type Traits**: Advanced template programming ensures modular and reusable code. +- **Instant State Transitions**: Transitions between states happen instantly, ensuring smooth gameplay. + +--- + +## Setup Instructions + +### Prerequisites +1. **C++ Compiler**: Ensure you have a modern C++ compiler (C++17 or higher). +2. **SDL Library**: Install SDL for rendering, sound, and input handling. + +### Build Instructions +1. Clone the repository: + ```bash + git clone https://github.com/bilalkah/wolfenstein --recurse-submodules + cd wolfenstein + ``` +2. Install dependencies: + ```bash + ./scripts/install_deps.sh + ``` +3. Build the project using `cmake` or your preferred build system: + ```bash + ./scripts/compile.sh # or you can your own way to build + ``` +4. Run the executable: + ```bash + ./build/bin/wolfenstein + ``` + +--- + +## How to Play + +- **Movement**: Use `W`, `A`, `S`, `D` to move around. +- **Attack**: Use `Left Click` to attack enemies. +- **Select Weapon**: Use `Left Arrow`, `Right Arrow`, and `Space` to navigate and select your weapon. + +--- + +## Contribution Guidelines + +We welcome contributions! Here are a few ways you can help: + +1. **Report Bugs**: Submit issues on the GitHub repository. +2. **Suggest Features**: Share your ideas to improve gameplay. +3. **Write Code**: Fork the repository and submit a pull request with your improvements. + +### Development Workflow +1. Create a new branch for your feature: + ```bash + git checkout -b feature-name + ``` +2. Commit your changes: + ```bash + git commit -m "Description of changes" + ``` +3. Push the branch and open a pull request: + ```bash + git push origin feature-name + ``` + +--- + +## Troubleshooting + +### Common Issues +1. **Performance drops**: + - Use caching mechanism to prevent extensively running pathfinding algorithm. + - Optimize pathfinding algorithms to enemies do not block each other. +2. **Better to have**: + - Collision check with static and dynamic objects +--- + +## Future Plans + +- Expand maps and introduce new enemy types. + +--- + +## License + +This project is open-source and available under the MIT License. See the `LICENSE` file for details. + +--- + +## Contact + +For questions or feedback, reach out at: +- Email: kahramannbilal@gmail.com +- GitHub: [bilalkah](https://github.com/bilalkah) + +Enjoy the game and happy coding! -## Install dependencies and build -```batch -./scripts/install_deps.sh -./scripts/compile.sh -``` \ No newline at end of file diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index 082902d..400cc0b 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -1,5 +1,5 @@ add_executable(${EXECUTABLE} main.cpp) -target_compile_definitions(${EXECUTABLE} PRIVATE DEBUG=1) +target_compile_definitions(${EXECUTABLE} PRIVATE DEBUG=0) target_link_libraries( ${EXECUTABLE} game diff --git a/app/main.cpp b/app/main.cpp index 1232560..dbdc29a 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -13,7 +13,7 @@ int main() { using namespace wolfenstein; - GeneralConfig config(800, 600, 0, 20, 120, 15.0, ToRadians(60.0), false); + GeneralConfig config(1200, 900, 0, 20, 120, 15.0, ToRadians(60.0), false); Game game(config); game.Run(); diff --git a/images/game_view_with_mp5.png b/images/game_view_with_mp5.png new file mode 100644 index 0000000..da6b639 --- /dev/null +++ b/images/game_view_with_mp5.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f5dd03a3c25ba6f8fdd145ec4cb64b7f667f30a527a2ffe3b51d2f46d2ed700b +size 517129 diff --git a/images/game_view_with_shotgun.png b/images/game_view_with_shotgun.png new file mode 100644 index 0000000..a6ffc6c --- /dev/null +++ b/images/game_view_with_shotgun.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d0b7ce3a6c873fe79f52b6daee1591dc351efd46e08d6c94e3c43522edf666ba +size 625817 diff --git a/images/minimap.png b/images/minimap.png deleted file mode 100644 index 7d36889..0000000 --- a/images/minimap.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:64636c9f52392812f354096839f6c1682d94d3c60a1b7920ea1ab5becb432b5f -size 14696 diff --git a/images/screenshot1.png b/images/screenshot1.png deleted file mode 100644 index 83b088f..0000000 --- a/images/screenshot1.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f4d35c33ae2c47cf21027099f709c19b47f325d44188c23dc15b1010a2c9825b -size 2150992 diff --git a/images/screenshot2.png b/images/screenshot2.png deleted file mode 100644 index f621d4f..0000000 --- a/images/screenshot2.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:15eb8e5b35434110dcdce127e0ebb59b9334529d8f8db98f077de1ab5674566f -size 2602201 diff --git a/images/screenshot3.png b/images/screenshot3.png deleted file mode 100644 index 1c05ee0..0000000 --- a/images/screenshot3.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d4f56e6c70abab427d55af04f1a0537c3f5178b179bb1bc4cd432c38c52725d7 -size 2152048