Skip to content

Commit f62475e

Browse files
authored
Merge pull request #4 from alexapostolu/basic-camera
Added camera pan and zoom
2 parents 3701b36 + e2e6842 commit f62475e

File tree

195 files changed

+69682
-51
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

195 files changed

+69682
-51
lines changed

.gitignore

+1-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,4 @@
33
out/
44

55
# Visual Studio files
6-
CMakePresets.json
7-
8-
# SDL
9-
external/SDL2/
6+
CMakePresets.json

CMakeLists.txt

+15-5
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,27 @@
11
cmake_minimum_required(VERSION 3.10)
22
project(kingdoms)
33

4-
set(CMAKE_CXX_STANDARD 11)
4+
set(CMAKE_CXX_STANDARD 17)
55
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/out/build")
66

77
# Add the include directory
88
include_directories(${PROJECT_SOURCE_DIR}/include)
99

1010
# SDL2
1111
set(SDL2_DIR ${PROJECT_SOURCE_DIR}/external/SDL2)
12-
set(CMAKE_PREFIX_PATH ${SDL2_DIR})
13-
find_package(SDL2 REQUIRED)
14-
include_directories(${SDL2_INCLUDE_DIRS})
12+
include_directories(${SDL2_DIR}/include)
13+
14+
# SDL2_image
15+
set(SDL2_image_DIR ${PROJECT_SOURCE_DIR}/external/SDL2_image)
16+
include_directories(${SDL2_image_DIR}/include)
17+
18+
# SDL2_ttf
19+
set(SDL2_ttf_DIR ${PROJECT_SOURCE_DIR}/external/SDL2_ttf)
20+
include_directories(${SDL2_ttf_DIR}/include)
21+
22+
# SDL_FontCache
23+
set(SDL_fontcache_DIR ${PROJECT_SOURCE_DIR}/external/SDL_FontCache)
24+
include_directories(${SDL_fontcache_DIR})
1525

1626
# src directory
17-
add_subdirectory(src)
27+
add_subdirectory(src)

README.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -10,40 +10,40 @@ If you want to get playing, checkout the [Play](#play) section on how to install
1010
4. [Other](#other)
1111
4. [Technical Information](#technical-information)
1212

13-
### Play <a name="play"></a>
13+
### Play
1414

15-
Download the executable (`exe`) and the dynamic library `sdl.dll` from the Releases page. Extract the zip folder. Then click on the exectuable file and start playing!
15+
Download the executable (`exe`) and the dynamic library `sdl.dll` from the Releases page. Extract the zip folder. Then click on the executable file and start playing!
1616

17-
### Build Source <a name="build-source"></a>
17+
### Build Source
1818

1919
Download, and then run the cmake.
2020

21-
### About Game <a name="about-game"></a>
21+
### About Game
2222

23-
This game is supposed to be a replica of the mobile game [Kingdom of Zenia](https://www.facebook.com/ZeniaGame/). It's similar to early versions of Clash of Clans, but instead of your army attacking an enemy's base, it's your army attacking an enemy's army, with high emphisis on troop to troop interaction. It's also similar to the mobile game Battle Legions, however Battle Legions does not have a "base" gameplay feature. Kingdom of Zenia shares some commonality with the Rise of Kingdoms games, but comparing those two is like comapring Clash of Clans with Rise of Kingdoms.
23+
This game is supposed to be a replica of the mobile game [Kingdom of Zenia](https://www.facebook.com/ZeniaGame/). It's similar to early versions of Clash of Clans, but instead of your army attacking an enemy's base, it's your army attacking an enemy's army, with high emphasis on troop to troop interaction. It's also similar to the mobile game Battle Legions, however Battle Legions does not have a "base" gameplay feature. Kingdom of Zenia shares some commonality with the Rise of Kingdoms games, but comparing those two is like comparing Clash of Clans with Rise of Kingdoms.
2424

2525
There were some issues with the game I think, as it had some balancing issues and the late game progression was not as exciting. However, no mobile game ever came close to the amount of fun I had playing Kingdom of Zenia. The graphic design, sound design, gameplay mechanics, and game design are amazing. I plan to recreate this game, and fix those issues by adding more user interactivity (more info below).
2626

2727
**Platforms**
2828

29-
I plan to release this game first for Windows as I am developing it on Windows. And then once I create a working release for it, then I will port it to Andriod on the Play Store. If that goes well, then I will set up a server and develop multiplayer features so you can battle other people.
29+
I plan to release this game first for Windows as I am developing it on Windows. And then once I create a working release for it, then I will port it to Android on the Play Store. If that goes well, then I will set up a server and develop multiplayer features so you can battle other people.
3030

3131
**How to keep players engaged in a base building game**
3232

33-
Keeping players engaged is important. For a base building game that has minimal user interaction (the only user interaction that requires strategy is deploying troops when you attack, and even then it's minimal strategy and you only do it once per attack), players that have maxed out there base will eventually get bored. So Clash of Clans solved this issue by adding more troops and more Town Halls. I want to go a different route with Kingdom of Zenia. Instead of focusing on addiiton content, I will focus on the user interaction. I believe adding just a little bit more user interaction can keep a base building game enternaing just as well as adding more troops and more Town Halls.
33+
Keeping players engaged is important. For a base building game that has minimal user interaction (the only user interaction that requires strategy is deploying troops when you attack, and even then it's minimal strategy and you only do it once per attack), players that have maxed out there base will eventually get bored. So Clash of Clans solved this issue by adding more troops and more Town Halls. I want to go a different route with Kingdom of Zenia. Instead of focusing on addition content, I will focus on the user interaction. I believe adding just a little bit more user interaction can keep a base building game entertaining just as well as adding more troops and more Town Halls.
3434

35-
The upside to focusing on user interaction is I don't have to spend hours on Blender modelling all the new troop and building designs haha. In addition, it is easier to maintain the original feel of the game. In Clash of Clans, a TH16 Root Rider, Electro Rider, and Pixel King attack feels a lot different than a TH5 Giant, Ballon and Wizard attack. Whether that is a good or bad thing I don't know, but for Kingdom of Zenia I want to keep the same feeling that a low level attack has comapred to a high level attack. If there won't be as many troop options, then this will have to come from user interactivity.
35+
The upside to focusing on user interaction is I don't have to spend hours on Blender modelling all the new troop and building designs haha. In addition, it is easier to maintain the original feel of the game. In Clash of Clans, a TH16 Root Rider, Electro Rider, and Pixel King attack feels a lot different than a TH5 Giant, Balloon and Wizard attack. Whether that is a good or bad thing I don't know, but for Kingdom of Zenia I want to keep the same feeling that a low level attack has compared to a high level attack. If there won't be as many troop options, then this will have to come from user interactivity.
3636

37-
I plan to do this by first allowing the user to select a group of troop and mobalize them elsewhere and change their target. I will also allow the user to control a special "hero" troop. In addition, for each battle, there will be strategic structures, for example a small tower with groud troops at the base and archers at the top. In this case, your groud troop must first defeat the enemy's group troops, before spending time climbing up the stairs to the enemy's archers. Meanwhile, your archers can target their archers instantly. This has some implications, first the single player AI must be advanced. Secondly, I need to get he right perspective to ensure the important fights are not blocked by structures (maybe allowing camera panning?). This also means a player's base is two parts. Non defensive and defensive. Defensive is the defending troops and structures their troop will fight on against an incoming attack. And the non defensive is everything else, resourse collection, town hall, barracks, etc.
37+
I plan to do this by first allowing the user to select a group of troop and mobilize them elsewhere and change their target. I will also allow the user to control a special "hero" troop. In addition, for each battle, there will be strategic structures, for example a small tower with ground troops at the base and archers at the top. In this case, your groud troop must first defeat the enemy's group troops, before spending time climbing up the stairs to the enemy's archers. Meanwhile, your archers can target their archers instantly. This has some implications, first the single player AI must be advanced. Secondly, I need to get he right perspective to ensure the important fights are not blocked by structures (maybe allowing camera panning?). This also means a player's base is two parts. Non defensive and defensive. Defensive is the defending troops and structures their troop will fight on against an incoming attack. And the non defensive is everything else, resource collection, town hall, barracks, etc.
3838

39-
### Other <a name="other"></a>
39+
### Other
4040

4141
Right now, the main user interaction is controlling a single troop in battle. I wonder if there is any other gameplay mechanics I can add that require user interaction.
4242

43-
I also wonder if I could combine the "spontaneity" and "open worldness" of Age of Empires with this base building game.
43+
I also wonder if I could combine the "spontaneity" and "open world" of Age of Empires with this base building game.
4444

4545
There's this upcoming third person Steam game called [Kingmakers](https://store.steampowered.com/app/2109770/Kingmakers/), it's not released but I think it's also army vs army, and you get to be a soldier in the battle, so that's tons of user interaction, and it seems like it'll be super fun.
4646

47-
### Technical Information <a name="technical-information"></a>
47+
### Technical Information
4848

49-
Made using C++ and [SDL 2.30](https://github.com/libsdl-org/SDL/releases/tag/release-2.30.3). Models made using Blender. Developed on Visual Studio using CMake.
49+
Made using C++ 17, [SDL 2.30.3](https://github.com/libsdl-org/SDL/releases/tag/release-2.30.3), [SDL_ttf 2.22.0](https://github.com/libsdl-org/SDL_ttf/releases/tag/release-2.22.0), and [SDL_image 2.8.2](https://github.com/libsdl-org/SDL_image/releases/tag/release-2.8.2). Models made using Blender. Developed on Visual Studio using CMake.

assets/farmhouse.png

1.94 MB
Loading

external/.gitkeep

Whitespace-only changes.

external/SDL2/BUGS.txt

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
Bugs are now managed in the SDL issue tracker, here:
3+
4+
https://github.com/libsdl-org/SDL/issues
5+
6+
You may report bugs there, and search to see if a given issue has already
7+
been reported, discussed, and maybe even fixed.
8+
9+
10+
You may also find help at the SDL forums/mailing list:
11+
12+
https://discourse.libsdl.org/
13+
14+
Bug reports are welcome here, but we really appreciate if you use the issue
15+
tracker, as bugs discussed on the mailing list may be forgotten or missed.
16+

external/SDL2/COPYING.txt

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
Simple DirectMedia Layer
3+
Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4+
5+
This software is provided 'as-is', without any express or implied
6+
warranty. In no event will the authors be held liable for any damages
7+
arising from the use of this software.
8+
9+
Permission is granted to anyone to use this software for any purpose,
10+
including commercial applications, and to alter it and redistribute it
11+
freely, subject to the following restrictions:
12+
13+
1. The origin of this software must not be misrepresented; you must not
14+
claim that you wrote the original software. If you use this software
15+
in a product, an acknowledgment in the product documentation would be
16+
appreciated but is not required.
17+
2. Altered source versions must be plainly marked as such, and must not be
18+
misrepresented as being the original software.
19+
3. This notice may not be removed or altered from any source distribution.
20+

external/SDL2/README-SDL.txt

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
Please distribute this file with the SDL runtime environment:
3+
4+
The Simple DirectMedia Layer (SDL for short) is a cross-platform library
5+
designed to make it easy to write multi-media software, such as games
6+
and emulators.
7+
8+
The Simple DirectMedia Layer library source code is available from:
9+
https://www.libsdl.org/
10+
11+
This library is distributed under the terms of the zlib license:
12+
http://www.zlib.net/zlib_license.html
13+

external/SDL2/README.txt

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
Simple DirectMedia Layer
3+
4+
(SDL)
5+
6+
Version 2.0
7+
8+
---
9+
https://www.libsdl.org/
10+
11+
Simple DirectMedia Layer is a cross-platform development library designed
12+
to provide low level access to audio, keyboard, mouse, joystick, and graphics
13+
hardware via OpenGL and Direct3D. It is used by video playback software,
14+
emulators, and popular games including Valve's award winning catalog
15+
and many Humble Bundle games.
16+
17+
More extensive documentation is available in the docs directory, starting
18+
with README.md
19+
20+
Enjoy!
21+
Sam Lantinga (slouken@libsdl.org)

0 commit comments

Comments
 (0)