Giter VIP home page Giter VIP logo

ihhub / fheroes2 Goto Github PK

View Code? Open in Web Editor NEW
2.5K 51.0 352.0 105.27 MB

fheroes2 is a recreation of Heroes of Might and Magic II game engine.

Home Page: https://ihhub.github.io/fheroes2/

License: GNU General Public License v2.0

Makefile 0.32% C++ 96.75% C 0.10% Python 0.11% Shell 0.36% Batchfile 0.18% CMake 0.37% PowerShell 0.36% Inno Setup 0.11% Java 1.34%
homm2 cpp game-development game-engine game strategy-game turn-based-strategy homm-ii heroes-of-might-and-magic-ii heroes-2

fheroes2's Introduction

fheroes2

fheroes2 is a recreation of the Heroes of Might and Magic II game engine.

This open source multiplatform project, written from scratch, is designed to reproduce the original game with significant improvements in gameplay, graphics and logic (including support for high-resolution graphics, improved AI, numerous fixes and user interface improvements), breathing new life into one of the most addictive turn-based strategy games.

You can find a complete list of all of our changes and enhancements in its own wiki page.

Download and install

Please follow the installation guide to download and install fheroes2.

Github Downloads

Copyright

All rights for the original game and its resources belong to former The 3DO Company. These rights were transferred to Ubisoft. We do not encourage and do not support any form of illegal usage of the original game. We strongly advise to purchase the original game on GOG or Ubisoft Store platforms. Alternatively, you can download a free demo version of the game. Please refer to the installation guide for more information.

License

This project is licensed under the GNU General Public License v2.0.

Initially, the project was developed on sourceforge.

Contribution and Development

This repository is a place for everyone. If you want to contribute, please read more here.

To build the project from source, please follow this guide.

Build Status Bugs Code Smells Duplicated Lines (%)

To assist with the graphical asset efforts of the project, please look at our graphical artist guide.

If you would like to help translating the project, please read the translation guide.

Donation

We accept donations via Patreon, PayPal or Boosty. All donations will be used only for the future project development as we do not consider this project as a source of income by any means.

Donate Donate Donate

Contacts

Follow us on social networks: Facebook or VK. We also have a Discord server to discuss the development of the project.

Facebook VK Discord

FAQ

You can find answers to the most commonly asked questions on our F.A.Q. page.

fheroes2's People

Contributors

a1exsh avatar andrey-starodubtsev avatar arthusppp avatar asturielua avatar big4billy avatar dimag0g avatar districh-ru avatar effektus avatar eos428 avatar felix642 avatar github-actions[bot] avatar idshibanov avatar ihhub avatar joyinko avatar kant2002 avatar kazhuu avatar laserlicht avatar mr-bajs avatar nad-sk avatar oleg-derevenetz avatar qarkai avatar roxterat avatar shprotru avatar stisen1 avatar tau3 avatar undef21 avatar vasilenkoalexey avatar vincent-grosbois avatar zahadumgoth avatar zenseii 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  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

fheroes2's Issues

Add campaign support

We do not have campaign support in the game which is a big drawback from original game. We must have it.

Modify Luck::String() and Luck::Description() functions to do not recreate objects for every call

In src/fheroes2/kingdom/luck.cpp file we have two functions:

const char* Luck::String(int luck)
const char* Luck::Description(int luck)

These function contain arrays of strings which are created every time when we call one of these functions. First of all we want to return const std::string instead of const char *. Second thing is we must make such arrays as static to avoid memory reallocation and this array must be std::string.
Plus remove default:break; as it does nothing.

Add screenshots in readme file

We have readme file. This project is game development project so it is wise to have 1-2 screenshots in readme file. Please use only map which is provided in demo version of original game.
Please put png file(s) into files/images directory and display image before Copyright title.

Spell book is displayed in semi transparent way

In original game spell book is displayed above all other information in hero view window:

spell_book_original

while in current implementation we see that the book is semi transparent which is wrong. We must fix it:

spell_book_current

Partial trick to remove this semi transparency is to click on any of book tabs.

Use wget for Linux to download demo version

Curl is not installed by default for Linux OSes so current script to download demo version of the game does not work. We need to use wget for such purpose. A good solution would be to create 2 separate script files: one for MacOS, another one for Linux.

Make map editor as a separate compilation step

We compile only main application without taking into consideration compilation of map editor which is based on Qt. We need to compile editor as well as a part of continuous integration. We could do this for Travis-CI which supports Qt installation.

Display commit message in Windows deployment

Currently we deploy compiled application on Windows to Github Releases from AppVeyor. We set the description of the deployment as "Windows build" but we need to set last commit message as the description which makes more sense for us.

Set correct paths to headers for all files without inclusion of directories for project

Right now we use project settings (make or VS project) to set include directories which are presented. This make source code browsing messy as we don't have proper file structure connection within project.
For example:
File game.cpp has an inclusion #include "ground.h". ground.h file doesn't exist within the same directory as game.cpp which leads to confusion. Instead we need to have #include "../maps/ground.h"

Remove src/tools/palette_h2.h file

We have the same file in src/tools/palette_h2.h and src/fheroes/agg/palette_h2.h files. We want to remove code duplication so we remove file in tools and use another file in src/tools/icn2img.cpp file.

SDL2 support for Travis-CI

Currently we compile the project based on SDL 1.2 but we have an internal support of SDL 2. We would like to add compilation for SDL 2.0 on Travis-CI for Linux and MacOS.

Sort headers in alphabetic order in files

It's good to have a standardised code style. A good practice is have sorted list of header inclusion for easier navigation between files. We would like to sort header inclusions for all files within src/fheroes2/objects and src/fheroes2/dialog directories.

Sorting header must be done in this way:

  • C++ headers like <iostream>
  • project headers like "army.h"

Make monster parameters to be stored in configuration file

We store monster parameters as hardcoded values within the code (src/monster/monster.cpp) file. This is bad as we do not give a flexibility for future changes/modification of the game. We need to store such data in a configuration file.

Remove sub-revision of application

Right now we show that the version of the application is 0.6.000. While last 000 comes from SVN revision which is no longer the case. We should remove it.

Zip files before deployment on Travis

Recently we implemented deployment on Travis-CI for Linux and OSX. We ship executable files as it is. We need to zip them to reduce file size and as well to comply with security of some browsers.

Labels in in-game settings locate at incorrect position

Titles in in-game settings locate at incorrect positions in comparison with original game.

Here is original game:
settings_original

And here is current state of game:
settings_current

What is needed to be done:

  1. Move labels Music, Effects and etc at the top of image tile, not at the bottom
  2. Keep another label showing the status of each setting. For example: Interface: Good should be split into Interface above the setting image and Good below interface setting.

Start point to dig into is void Dialog::DrawSystemInfo(const Rects & rects) function in src/fheroes2/dialog/dialog_system.cpp file.

Install packages for MacOS in Travis-CI not via brew

Currently we use brew install for package installation for MacOS on Travis-CI. It leads to a very long job run time (~10 minutes). We would like to reduce run time for such job via usage of add-on option in Travis-CI.

Replace (void) by empty () statement

Not sure what was an intention behind but original code is filled with functions containing void as input parameter. This brings no value to code and just complicates reading. We want to remove replace by empty parameter function code as ().

Remove duplicated header file inclusion

We have multiple warnings caught by static analyser regarding duplicated header file inclusions:

src/fheroes2/battle/battle_arena.cpp:35: 'spell_storage.h' already #included in 'src/fheroes2/battle/battle_arena.h'
src/fheroes2/battle/battle_only.cpp:33: 'heroes_recruits.h' already #included in 'src/fheroes2/battle/battle_only.h'
src/fheroes2/battle/battle_tower.cpp:26: 'battle_troop.h' already #included in 'src/fheroes2/battle/battle_tower.h'
src/fheroes2/heroes/route.cpp:27: 'direction.h' already #included in 'src/fheroes2/heroes/route.h'
src/fheroes2/heroes/skill.cpp:26: 'gamedefs.h' already #included in 'src/fheroes2/heroes/skill.h'
src/fheroes2/kingdom/kingdom.cpp:26: 'castle.h' already #included in 'src/fheroes2/kingdom/kingdom.h'
src/fheroes2/kingdom/kingdom.cpp:27: 'heroes.h' already #included in 'src/fheroes2/kingdom/kingdom.h'
src/fheroes2/kingdom/world.cpp:29: 'kingdom.h' already #included in 'src/fheroes2/kingdom/world.h'
src/fheroes2/monster/monster.cpp:32: 'payment.h' already #included in 'src/fheroes2/monster/monster.h'

We need to remove duplicated header file inclusions from source files. Simple as that.

Remove all inline word usage

Nowadays compiler are smart enough to decide which function should be inlined. Keyword inline makes no sense with this. We would like to remove it everywhere in code (it's in 17 lines of code).

Sort headers in alphabetic order in few files

It's good to have a standardised code style. A good practice is have sorted list of header inclusion for easier navigation between files. Here is a list of files which need such change:

src\fheroes2\army\army_bar.cpp
src\fheroes2\army\army_bar.h
src\fheroes2\army\army_troop.cpp
src\fheroes2\army\army_troop.h
src\fheroes2\army\army.cpp
src\fheroes2\army\army.h

Sorting header must be done in this way:
C++ headers like <iostream>
project headers like "army.h"

Optimise Monster Monster::Rand(level_t level) function

This function locates in src/fheroes2/monster/monster.cpp file. Here we allocate an array every time which is resource waste. Additionally, GetLevel function of the same class must be static so then we don't need to create an object of this class just to call this function. Furthermore, this function could contain just a map, then the call of this function would be even faster.

Make compiled application on Unix OS executable

We ship out application without making it executable for end user. We have to use chmod command before putting the application into deployment package. Travis-ci yaml needs to add one line to do such.

Number of monsters is displayed in black box

Number of monsters is displayed in black box which is in original game doesn't exist. Black colour must be a transparent color instead.
A start point for fixing this issue is to look into void ArmyBar::RedrawItem(ArmyTroop & troop, const Rect & pos, bool selected, Surface & dstsf) function in src/fheroes2/army/army_bar.cpp file.

This is a line responsible to set text information:

Text text(GetString(troop.GetCount()),(use_mini_sprite ? Font::SMALL : Font::BIG));

creature_count_current

No titles for spell book tabs

In original game we could see names of spell book tabs while in current implementation we display only "Open book" which is incorrect because book is opened.

Look, for example, under the cursor.:
image

and this how it should be:
image

Continuous deployment of project

We would like to have an ability for continuous deployment of project for some storage to give an ability for end user to avoid compilation burden.

Visual Studio compilation support

We could like to add Visual Studio compilation support as many developers use this IDE. We could use AppVeyor as CI-CD platform for compilation.

Add a script of downloading demo version of original game

We would like to simplify the work of developers so providing scripts to automatically setup development environment is essential part of productive work.
We would like to add a script to download demo version of the game, unzip archive and put needed file to correct location.
This task is divided by 2 parts:

  • script for Unix (Linux and MacOS) OS
  • script for Windows

Remove unused functions

In src/fheroes2/heroes/heroes.h and src/fheroes2/heroes/heroes.cpp files we have these functions:

    int			GetAttack(void) const;
    int			GetDefense(void) const;
    int			GetPower(void) const;
    int			GetKnowledge(void) const;

which inside call these functions:

    int			GetAttack(std::string*) const;
    int			GetDefense(std::string*) const;
    int			GetPower(std::string*) const;
    int			GetKnowledge(std::string*) const;

we see no point to have first bunch of functions as we can simply set default value for second bunch of functions as NULL.

Show creature information in recruitment building

In original game player could right or left mouse click to show creature information in recruitment building:

creature_recruitment

information looks like this:
creature_rectuitment_info

Right now we do not have such ability in the game and we would like to have it.

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.