Giter Site home page Giter Site logo

symphony-of-empires / symphony-of-empires Goto Github PK

View Code? Open in Web Editor NEW
128.0 7.0 18.0 614.74 MB

Symphony of the Empires is a RTS strategy game and map game.

License: GNU General Public License v3.0

C++ 64.29% CMake 0.98% Shell 0.20% CSS 3.68% C 30.86%
game strategy game-engine multiplayer map map-game gamedev lua rts-game rts

symphony-of-empires's Introduction

Symphony of the Empires

Screenshot_2022-04-24_00-50-26

Want to contribute or are interested in the development of the game? See our discord https://discord.gg/44QuvuDmCS

This is an open source RTS game engine; created to be very mod friendly and flexible for everyone's needs.

Features:

  • Custom RTS game engine and framework
  • Flexible & customizable UI
  • Dynamic texture and audio management
  • Lua scripting for events
  • Support for multiple mods
  • Heavy usage of multithreaded code

Documentation

Documentation can be found at: https://symphony-of-empires.github.io/docs

Download

If you're looking for the game you can find download links on: [https://symphony-of-empires.com/downloads.html]. Make sure to download the latest version before reporting any bugs.

Building

Required to build:

  • git
  • SDL2 and SDL2-ttf
  • OpenGL (GL and GLU)
  • GLEW
  • libassimp
  • CMake 3.24

If you lack any of the prerequsites below you can use cmake -DE3D_VENDORED=1 for building them instead. Lua will always be built, since many package managers do not supply Lua 5.4 and backwards compatibility isn't a thing that should be dealt with.

Windows: On msys2, simply run the following after setting up the initial msys environment:

pacman -S mingw-w64-x86_64-SDL2_ttf mingw-w64-x86_64-SDL2 mingw-w64-x86_64-glew mingw-w64-x86_64-glm mingw-w64-x86_64-zlib mingw-w64-x86_64-assimp mingw-w64-x86_64-intel-tbb

Or if you have a 32-bit computer:

pacman -S mingw-w64-i686-SDL2_ttf mingw-w64-i686-SDL2 mingw-w64-i686-glew mingw-w64-i686-glm mingw-w64-i686-zlib mingw-w64-i686-assimp  mingw-w64-i686-intel-tbb

For Visual Studio, you have to first get vcpkg, and install it

git clone https://github.com/Microsoft/vcpkg
.\vcpkg\bootstrap-vcpkg.bat  -disableMetrics

Debian-based: sudo apt install -y libsdl2-dev libsdl2-ttf-dev libtbb-dev libglew-dev libglm-dev libassimp-dev

Arch-based: pacman -S sdl2 sdl2_ttf glew glm tbb assimp

NetBSD:

pkgin in SDL2 SDL2_ttf assimp lua54 glew MesaLib glu libatomic threadingbuildingblocks
# The NetBSD libc already contains libdl within it, however libraries expect libdl to be a file
# and they will fail linking if said file is missing, making it a symbolic link is just a workaround
[ -e /usr/lib/libdl.a ] || ln -s /usr/lib/libc.a /usr/lib/libdl.a
[ -e /usr/lib/libdl.so ] || ln -s /usr/lib/libc.so /usr/lib/libdl.so

Yuzu/Ryujinx: Install devkitpro for aarch64, then sudo dkp-pacman --sync switch-dev switch-mesa switch-glad switch-glm switch-sdl2 switch-sdl2_ttf

If you simply want to play the game on Debian run: ./quick_build.sh

Building

The build with these commands once all the dependencies are met:

# In Linux, macOS, NetBSD, etc

# Use this for a normal build
mkdir -p build && cd build
cmake -DE3D_BACKEND_OPENGL=1 ..
cmake --build .

# Alternatively use this for a debug build
mkdir -p build && cd build
cmake -DE3D_BACKEND_OPENGL=1 -DCMAKE_BUILD_TYPE=RelWithDebInfo ..
cmake --build .

Visual Studio tutorial (by Erik)

  • Clone the repo with git clone --recursive --depth 1 https://github.com/symphony-of-empires/symphony-of-empires. If you need the git history, then you should remove the --depth 1 flag

  • Open the repo in Visual Studio

  • Now select the build mode

image

  • Let it load and then you should be able to pick configuration up top
  • If that doesn't work, then try reconfiguring the cache

image

  • Lastly select SymphonyOfEmpires.exe as the startup item

image

  • Now you can build the project

image

Running

In order to run the game you just need to run it via the command line or left-click the executable: ./SymphonyOfEmpires If the server crashes and the port needs to be re-aquired do the following under *NIX systems: fuser -k 1836/tcp

Coding style

4-spaces are used, tabs should be replaced with 4-spaces too. All functions, members and variables follow a snake_case convention; whereas the object-typenames and types should be done as CamelCase.

Object declaration

Class members on declarations should be ordered, starting by the private section, followed by the protected section, to finally conclude on the public section. Each section should first start by the "main-constructor", followed by copy-constructors and any variant of the constructors; after it, follows the destructor of the object. Then follows the main methods of the object. Methods don't need to have a specific order. After the methods all the remaining member data is appended. Members don't need to have a specific order.

In short - all functions for classes should be conformed as this:

class Foo {
    // private constructors/destructors
    Foo(const Bar&);

    // followed by private methods
    int add_cmpxchg(int&&);

    // finally by the private data
    int secret_value;
protected:
    // constructor, copy-constructor & variants, destructor
    Foo(const Bar*);

    // methods
    int add_cmpxchg_sse3();

    // members
    int stuff;
public:
    Foo();
    // here should be any variant of constructor function prototypes
    ~Foo();

    // rest of the functions
    explicit int add(int&, int&);

    // and finally the data
    int value;
};

Blocks

Simply put:

while(a) {
    if(b) // stuff...
    else if(c) // stuff...

    // yes "single line" or brace-less ifs
    if(d < 0) increment_d(&d);
}

Naming convention

Classes, Structs, Types and Typenames are named in PascalCase, while variables, struct/method members and functions are declared using snake_case. Enum members and macros are declared in SCREAMING_SNAKE_CASE.

struct FooBar {
    FooBar() = default;
    ~FooBar() = default;

    int method() {
        return 0;
    }

    template<typename T1 = int, typename T2 = int>
    int add(T1 a, T2 b) {
        return a + b;
    }
public:
    int member;
    int test_thing;
    bool is_attack;
};

symphony-of-empires's People

Contributors

aintdatcap avatar bence657 avatar ceronyon avatar coderguy57 avatar dressupgeekout avatar ehwhoami avatar eitan-j avatar griffin-lora avatar ihatetrains avatar lappn99 avatar makkkkus avatar mountain-zippped avatar penguinmangaming avatar pyroflarex avatar veeetooorrr avatar wlarusfromdaspace avatar wxwisiasdf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

symphony-of-empires's Issues

Add Vulkan support

Better said than done, as previously mentioned on #51 the current client code heavily relies on OpenGL.

Province ownership tracking is inconsistent

Province ownership can currently be deduced in several ways, most notable:

  1. Each Province class has an std::vector<Nation*> owners member, which supposedly tracks which nations own (parts of) the province.
  2. Each Nation class has an std::vector<Province*> provinces member, which supposedly tracks which (parts of) provinces this nation owns.

However, these two are highly inconsistent. Asking a nation which provinces it owns tends to give a list of several provinces, but checking the converse finds that most provinces claim to be unowned.

It also seems that each province has a size_t owner_id which keeps track of which nation owns it, but nation ids are stored as a uint16_t, which has a much shorter range of allowed values (for example, the default values for PROVINCE_DISPUTED and PROVINCE_NO_OWNER are both out of range for nation ids).

Leaders for units

Generals and navy generals that commands a unit, they can be transferred to other units and so forth.

  • The player may recruit a leader from any POP type, their name would then be derived from the culture they come from
  • A leader may be a general or admiral (technically no difference between them)
  • They should have some randomized stats which gets higher when the literacy is high and they would also be boosted by technology and inventions

Game loop is independent of client loop.

The main game loop (which hosts the economy, pop growth, etc) is run as:

run = 1;
while(run) {
    LuaAPI::check_events(world.lua);
    world.do_tick();
}

While the client-side thread is completely separate from this (see main.cpp lines 28-35). As it stands, this means a few things:

  1. The client cannot pause or otherwise interact with the main loop. This means for example that there is no way to build in a pause button in the client, as this cannot affect the main loop.
  2. The game loop does not ask the client whether or not it should start, rather, it just starts running as soon as the client starts (or even before that!). This means that if the client wants to present the player with something like a main menu, or an option to load an earlier save, the game will start running in the background nonetheless. As soon as you hit "new game", the game isn't "new" anymore, because the game has already been ticking in the background.
  3. When the client is closed, the main loop is still running, meaning that the only way to close the application correctly is to kill it from a command prompt or terminal. (Conversely, the main loop does wait for the client to close after it is done running, but there is still nothing that can cause the main loop to stop apart from a system interrupt). This is wrong, the client can close the game via extern std:atomic<int> run;.

Map modes

Shouldn't be hard to do
Use framebuffer to draw to the div_sheet_tex

Main menu

  • Load the "core" essential UI stuff
  • Have some image as background
  • Be able to connect to a server or do a multiplayer game (in such case a server is automatically started)

Technology tree

  • Have categories for technologies (Strategies, Military, Naval, Social, Political and Economic)
  • Add some inventions
  • Add some technologies
  • Strategies technologies's research is boosted by watfare
  • Naval, Military and Economic research can be boosted by a university building which employs Educated people
  • An University building for Economic, Naval and Military research
  • Social research is boosted by emigration
  • Economic research can also be boosted by economic activity
  • Military and Naval have to be researched, Economic may be optionally researched or let to be grown
  • Allow to share technologies between allies via treaties (this also means losers of a nation may get their tech stolen by the winners)

Dynamic music system

[Client-side]

The music system will basically play music [no shit sherlock], but should also have "event-themes" which can only play in certain circumstances [for example, prussian music when playing prussia]

Ideologies and Politics

  • Have POPs be aligned to certain ideologies (which would be a pointer, nullptr to indicate no alignment)
  • Each policy change would decrease/increase militancy on POPs whose views aligns most or less with those of the changed policy
  • A revolt due to an ideology shift resets militancy of the new ruling ideology's followers and gives them 5.0 life satisfaction and 5.0 everyday satisfacion and 5.0 luxury satisfaction to all of them, while the others have an increase, depending on how radical where the political changes
  • Parliament should be an insitution where aristocrats elect/reject bill propositions who aligns with their views, aristocrats with low con would accept almost any policy the player proposes, while high con aristocrats would reject, and may try to impose their own
  • Executive parliament is just a version of the parliament for stuff like declarations of war or treaties or building stuff and etc
  • State coups which basically would overthrow the goverment without a civil war and have the same effects as a won revolt
  • 3-way or even 4-way civil wars, where the countries would have a ref_name of country_name+n, where +n is an integer that would be allocated by the server when a new party comes - when a +n postfix nation stops existing it should be removed immediately from the game - the game due to the way the engine works would treat these civil war nations as independent nations so it means they can ally with foreingers

Have a standard endianess on networking

Right now if somehow SoE gets ported to a MIPS machine and then i try to connect to a x86 box i will surely get a lot of errors regarding endianess in the serializer.

CDCS map export

SOE will have Map export this is an issue to track that progress

Damage buildings due to bellic conflicts

Basically in order to repair damaged buildings (damaged buildings underperform depending on how severe the damage is) - it requires a random set of materials to be supplied.

  • Those random materials should only be one of the ones used to originally build the building

Map enhancements

  • #90
  • Diagonal borders
  • Better and thicker borders
  • Diagonal tiles
  • Different borders against water/sea
  • 3D terrain?

Client metadata (profile picture and username)

Basically the client would supply the server an image of the user along with the username, this should be required before being able to select a country.

This could be used by the server to identify and also ban/kick users.

Users can have any username they want - even duplicate usernames - provided that there isn't another user with the same name on the server we want to connect to.

Update to modern OpenGL

Anything higher than 2.2+ would suffice - the current client code heavily relies on GL lists and state-machine stuff that would surely cause issues when trying to port to a newer environment.

Mod management

A mod manager that would be capable of running multiple mods without conflict and also have "dependencies" so code duplication is reduced.

  • Have mods which can run atop of other mods
  • Have a launcher to select mods to run

AI

Currently no AI

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.