ihhub / fheroes2 Goto Github PK
View Code? Open in Web Editor NEWfheroes2 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
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
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"
If user doesn't have files from original game (or demo version), nothing happens and application just closes immediately after startup.
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.
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.
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 ()
.
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.
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).
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.
In README we need to include copyright information, a description of project, compilation instructions and committing instruction.
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.
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.
We should include license and readme files into deployment packages to give an ability for end users to have some needed information about the project.
We would like to add static analysis job as a part of continuous integration. Most likely we go with Travis-CI as this platform supports concurrent job execution.
We have multiple places with FIXME
comment. These functions/places we need to fix wit correct logic.
Not every version of Linux OS is compatible with each other so it's better to specify which version of OS is used for deployment.
Rename Free Heroes II into Free Heroes of Might and Magic II everywhere in source code. Simple as it is.
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.
We must add a support of The Price of Loyalty add-on to original game support.
We make deployment on Github Releases but we do not include helper scripts to download demo version of the game and for package installation needed in MacOS and Linux.
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.
We don't want unnecessary files to be committed by mistake so an existence of .gitignore file makes sense for us.
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));
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:
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.
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.
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.
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
.
We do not have campaign support in the game which is a big drawback from original game. We must have it.
Necromancer castle has an empty space instead of tavern so it's incorrect to show black tile with "disable building" instead.
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.
Titles in in-game settings locate at incorrect positions in comparison with original game.
And here is current state of game:
What is needed to be done:
Music
, Effects
and etc at the top of image tile, not at the bottomInterface: 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.
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:
<iostream>
"army.h"
Currently we use a short list of compilation flags and many warnings might be hidden from us. We need to find all possible compilation warnings as they might lead to serious application errors.
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"
If fheroes2.cfg
is not in same directory as application there is no sound. We create default settings for all options presented in configuration file.
We would like to add MacOS support for Travis-CI compilation to trace portability of our changes.
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.
On world map if user selects a resource by mouse right click the game always shows resource instead of particular resource type as gold, wood or mercury. We must show particular type.
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.
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.
There is no animation for resource collection and disappearance on MacOS with SDL 2.
As we use makefile as current compilation tool we need to explain users how exactly build the application including the need of required packages for it.
There is no animation for building construction in castles for MacOS with SDL 2.
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.
We have compilation of the project on AppVeyor for SDL 1.2. We would like to have the compilation for SDL 2 as well.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.