Giter Site home page Giter Site logo

fheroes2enh's People

Contributors

ciplogic avatar cipriankhlud avatar ihhub avatar kamiccolo avatar lucasw avatar rkurbatov 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

fheroes2enh's Issues

Directory Structure

After building fheroes2, what is the intended directory structure suppose to look like?

Vampire Lord number of units during battle

I tried fheroes2enh, played with Necromancers and in battles number of vampire lords changes a lot. For example I have 8 vampire lords, they hit 10 battle dwarves, and count of vampires goes down to 4 even before dwarves retaliate. At the end of the battle I don't lose vampire lords but still there is something wrong there.

Fix override compilation warning

While compiling on MacOS we see a lot of overrides a member function but is not marked 'override' [-Winconsistent-missing-override] warnings which is bad to have at first place as the project is not big.

Mac OS High Sierra Compile Errors

Firstly thank you working for enhance version ๐Ÿ‘!
I tried to build it in Mac OS X High Sierra(10.13.3) with SDL 1.2.15(installed by brew), copied Data and Maps dirs from original HOMM II, and it succeeded:

[100%] Linking CXX executable fheroes2
[100%] Built target fheroes2

although with some warning(overridden virtual function is here), not a big deal I though :)

then I try to open in terminal(./fheroes2) and it show these errors:

00:14:23: [ERROR] open: Couldn't open fheroes2.bin
00:14:23: [ERROR] open: Couldn't open fheroes2.bin
00:14:23: [ERROR] open: Couldn't open fheroes2.bin
00:14:23: [ERROR] open: Couldn't open fheroes2.bin
00:14:23: [ERROR] SetLangEnvPath: translation not found: en.mo
libc++abi.dylib: terminating with uncaught exception of type Error::Exception
[1] 94582 abort ./fheroes2

00:14:23: [ERROR] SetLangEnvPath: translation not found: en.mo

Fixed this by change fr lang in cfg file, I think it should load en language by default?

> 00:14:23: [ERROR] open: Couldn't open fheroes2.bin
I searched it in original HOMM II files, but no luck. so where I can get fheroes2.bin file?

Im not not good at the compile jobs, but love this game. Thanks!

Updated:

Using CLion to build the project, "Couldn't open fheroes2.bin" error disappear. And show this:

fheroes2(4899,0x7fff94593340) malloc: *** mach_vm_map(size=140414087675904) failed (error code=3)
error: can't allocate region
set a breakpoint in malloc_error_break to debug
libc++abi.dylib: terminating with uncaught exception of type std::bad_alloc: std::bad_alloc

List wheeling bug

Using latest version
In New Game or Options interface, mouse wheel up/down never stops
mouse wheel up moves to the top of the list

Buffered file reading

First of all, great job in recreating the original engine - I appreciate technologies used, namely CMake and SDL. This is why I could easily cross compile your engine to PSP using psptoolchain.

Problem is, PSP has 32, and in later models, 64 MB of RAM, thus causing throwing bad alloc when loading the AGG file which is around 40 MB (loading program into memory already takes 19 MB).

Do you plan creating a buffered file reader, so to not load whole AGG file into memory, but rather chunk-by-chunk? It would make this memory spike when loading assets much smaller, thus actually allowing to play on memory constrained platforms.

Mac OS - Game starts, doesn't load

There's a weird problem when starting the game right after compilation, where the binary starts and the window comes up, but nothing loads inside. I remember that I successfully compiled + ran the game some while ago, but now it seems like it just freezes. I compiled it using Apples clang++ compiler, with libraries from homebrew. I also had to change the TARGET_LINK_LIBRARIES variable in the "CMakeLists.txt" file by appending the original line with: -L/usr/local/lib -lSDLmain -lSDL -lpng.

See attached screenshot. The CPU works at ~20% utilization. Any ideas about what might be going on?

image

Rebalance

I accidentally provided this PR into the main repo instead of the local one and it was merged: #21

It has pretty strong game rebalance that I'd wanted to be discussed.

The main source for the PR is this patch: https://www.celestialheavens.com/forum/7/8724 with some my additions.

MAIN IDEAS

MIGHT fractions are weak and not usable. The typical scenario is to get a warlock hero as the main spellcaster, barbarian as a scout, sorceress as a naval scout and ignore knight if possible. Necromancers are good to get a huge pack of skeletons for the long game. This has to be changed: knights and barbarians cannot become good casters, but they can have good crude force abilities lost by MAGIC fractions. Necromancers and sorcerers should be more versatile.

Unit stats are changed a little bit. Almost all knight and some barbarian units are buffed, warlock and wizard units are nerfed with 6-tier unit amount decreased. Now they simply don't replenish without well and become more valuable in terms of loss. We can make well as a requirement for 6 tier or change well behavior so it increases the population of tiers 1-5 only.

PRIMARY SKILLS

Primary skills are mostly the same. Initial skill points are changed for wizards (0/0/2/3 instead of 0/1/2/2) and sorcerers (0/1/2/2 instead of 0/0/2/3). Wizards need more magic points from the very beginning while sorcerers rely more on defense.

Level 10+ points are distributed more evenly because magic becomes more important on later stages:

L1 percentage L10+ percentage
Knight 35/45/10/10 25/25/25/25
Barbarian 55/35/5/5 25/25/25/25 (was 30/30/20/20)
Sorceress 20/15/32/33 (was 10/10/30/50) 25/20/25/30 (was 20/20/30/30)
Necromancer 20/20/30/30 (was 15/15/35/35) 25/25/25/25
Warlock 15/15/40/30 (was 10/10/50/30) 20/20/30/30
Wizard 15/15/35/35 (was 10/10/40/40) 20/20/30/30

Secondary skills are changed more. There are 14 secondary skills with Necromancy not available to all except for Necromancers and Warlocks and Leadership not available to Necromancers only thus every fraction can select among 13 skills and warlocks - among 14. Now every fraction has 2 skills not provided during skill points selection with experience growth.
That's also uneven because these skills can be obtained from witch hut (except for Necromancy). A simple solution is to enable Necromancy so that it can be learned by any fraction. Another approach is to generate in a hut a new skill among available for every new hero to support diversity :)

Knights now cannot learn Necromancy and Mysticism. Initial skills are same - Ballistics and Leadership. Archery probability increased.
Barbarians now cannot learn Necromancy and Eagle eye. Initial skills changed to Pathfinding and Scouting instead of advanced Pathfinding. Estates probability decreased, Pathfinding - increased.
Sorceress now cannot learn Necromancy and Leadership. Initial skills changed to Wisdom and Luck instead of basic Wisdom and advanced Navigation. Navigation was completely useless on the maps without sea while sorceress should become more might and luck oriented. Ballistics and Navigation probability decreased, Luck probability increased.
Necromancer now cannot learn Leadership and Scouting. Initial skills are same - Wisdom and Necromancy. Ballistics probability decreased, Diplomacy - increased.
Warlock now cannot learn Archery and Luck. Serious nerf. There is only one weak shooter in the army so no need for that.
Initial skills are basic Wisdom and basic Eagle Eye instead of advanced Wisdom and Scouting. Ballistics (much) and Scouting probability is decreased, Eagle Eye, Leadership and Estates increased.
Wizard now cannot learn Necromancy and Ballistics. They have lots of shooters and can rely on magic (Earthquake). Archery and Estates probability is increased.

Further changes are possible with even more biased secondary skills points distribution to make fraction heroes less universal and allow different strategies.

Also, stats for some skills are changed to make them more valuable.

Scouting now has 3 cells radius on an advanced level (was 2) and 5 on expert (was 3) just like in Heroes III.
Eagle eye now has 25%/40%/65% probability to recognize spell rather instead of 20/30/40 values.
There are ideas to make some skills even more valuable but they require more code changes, not just numbers.
Necromancy algorithm should be changed and take into account not only number of killed units but their stats to
prevent huge necro army gross after fights with peasants and other tear-1.
Ballistics and Archery can allow the hero to manage ballista and turrets just like in Heroes 3.
Diplomacy should be rewritten, the current price of joinable units is a way too high.

Now unit and building changes

KNIGHTS

Almost all units are buffed with little cost increase. High tear buildings are less expensive.

Peasant growth increased 12 => 26 (totally 36 with well and farm), gold cost decreased 20 => 15, speed increased: very slow => slow. If that's not enough I'd added some special ability to this unit to make it valuable. Halflings and centaurs are shooters, sprites are flying and enemies don't retaliate, goblins are strong, skeletons are used en masse and only peasants are useless. Any ideas?

Archer/Ranger hitpoints increase: 10 => 11

Pikemen/Veteran Pikemen hit points, damage and cost increase: 15/20 => 16/21, 3-4 => 3-5, 200/250 => 210/260

Swordsmen/Master swordsmen hit points, damage and cost increase: 25/30 => 26/31, 4-6 => 4-7, 250/300 => 260/310

Cavalry/Champion hit points and cost increase: 30/40 => 35/45, 300/375 => 340/415. Heroes 3 improvements with attack bonus based on path champion rode is also possible.

Paladin/Crusader hit points increase: 50/65 => 60/75 with Paladin cost increase 600 => 675 (Crusader is still 1000).

Cathedral wood cost decrease - 5000/20/20 => 5000/10/20

Upgraded Cathedral cost decrease from 5000 gold, 10 wood, 10 crystal to 3500 gold, 10 wood, 5 crystal.

Fortifications cost decrease from 1500 gold, 5 wood, 15 ore to 1500 gold, 0 wood, 10 ore.

Knights should be more mighty units that rely on Ballistics, Archery, and Leadership, having fortified castles.

BARBARIANS

Except for Ogres units are stronger or/and cheaper.

Goblin growth is increased from 10 to 12 (totally 22 with well and garbage)

Orc hitpoints increase 10 => 11

Wolf defence increase 2 => 3 with increased cost 200 => 210

Ogre Lords are weaker (60 HP => 55 HP) and cheaper (500 => 475) - this tier 4 unit was too powerful

Trolls/War Trolls are cheaper: 600/700 => 575/650

Cyclops are stronger: 80HP => 85HP while

Pyramid is cheaper: 6000 gold, 20 ore, 20 crystal => 6000 gold, 10 ore, 20 crystal.

Coliseum is also cheaper: 2000 gold, 10 ore, 10 wood => 1500 gold, 5 ore, 5 wood

SORCERESS

Nature castle units are tougher and powerful mostly. Shooters are always a target.

Sprite growth is increased 8 => 10 (totally 20 with well and garden)

Dwarfs/Battle Dwarfs are cheaper: 200/250 => 190/235

Elfs/Grand Elfs are more powerful: 4/5 attack => 5/7 attack and stronger (15HP => 16HP)

Greater Druids has more HP (25 => 26) while

Upgraded Stonehenge is more expensive 1500 gold, 5 ore => 2000 gold, 5 ore

Unicorns are tougher (40 HP => 45 HP) while more expensive (500 => 515)

Rainbow is changed in the price: 1500 gold, 10 crystals to 1500 gold, 5 mercury, 5 crystals

If more buff is required, Archery can become initial skill instead of Luck

WARLOCKS

Warlocks are much weaker now.

Cave now requires 5 ore additionally to 500 gold.

Gargoyle defence is decreased (7 => 6) though

Crypt is less expensive now: 1000 gold, 10 ore => 1000 gold, 5 ore.

Griffin is more expensive: 300 => 320

Hydra is less expensive: 800 => 775

Green/Red/Black Dragons have basic growth set to 0, totally 2 in case well is built. 1 less dragon per week.
Additionally hit points decreased. Red dragon: 250 => 240, Black dragon: 300 => 280.

Green tower is less expensive: 15 000 gold, 30 ore, 20 sulfur => 13 000 gold, 30 ore, 20 sulfur while

Red/Black tower upgrade is more expensive: 5000 gold, 5 ore, 10 sulfur => 6000 gold, 5 ore, 10 sulfur. Total black
tower price is the same, but green dragons are more usable now with red/black nerf.

Dungeon cost is much increased. Additionally to 3000 gold, 5 wood and 10 ore you should pay 3 units of each rare resource.

On the other hand, stupid Scouting is removed and Eagle Eye is more useful (instead of Wizards library).

WIZARDS

Halflings cost increased: 50 => 55.
Boar damage increase: 2-3 => 2-4. Blessing is as also good on them now.
Roc defence is increased: 7 => 8
Upgraded Ivory Tower is less expensive: 4000 gold, 5 wood, 5 ore => 3000 gold, 5 wood, 5 ore

Most changes are about Giants/Titans. Their basic growth is set to 0, so only 2 of them are provided by well. 1 less big guy per week.

Giants are more usable with HP growth: 150 => 155 and less expensive Cloud Castle: 12 500 gold => 7 500 gold, while same 5 ore, 5 wood and 20 gems.

Titans are less tough now: 300 HP => 280 HP while less expensive: 5000 gold, 2 gems => 4500 gold, 2 gems. But

Upgraded Cloud Castle is hell pricy: 12 500 gold => 16 500 gold additionally to 5 ore, 5 wood, 20 gems.

All of this makes wizard a little bit stronger on the early game while little bit weaker on late game.

NECROMANCERS

Changes here are most discussable.

Skeletons are cheaper: 75 => 70 that allows buying more in light of possible Necromancy nerf instead of raising them.

Zombies are faster: Very slow => Slow

Both Zombie/Mutant Zombie defence increased: 2 => 3 while price decreased: 150/200 => 140/190.

Mummy/Royal Mummy defence increased: 6 => 7

Upgraded Mansion is cheaper: 4000 gold, 5 wood, 10 crystals, 10 gems => 3500 gold, 5 wood, 10 mercury, 5 crystals.

Lich hit points increased 25 => 30 with defence decreased 12 => 11

Both Lich/Power Lich are less expensive 750/900 => 650/750 and

Upgraded Mausoleum is too: 3000 gold, 5 ore, 5 crystal => 2500 gold, 5 ore, 5 sulfur.

Bone Dragon nerfed with both HP: 150 => 140 and higher price: 1500 => 1600.

Laboratory is also more expensive: 10 000 gold, 5 mercury => 12 000 gold, 10 mercury.

COMMON BUILDINGS

Mage guild upgrade price is changed:

Lvl 2 - 1000/5/5/4 rare => 1500/5/5/2 rare - more gold, less rare resources.
Lvl 3 - 1000/5/5/6 rare => 1500/5/5/4 rare
Lvl 4 - 1000/5/5/8 rare => 2000/5/5/6 rare
Lvl 5 - 1000/5/5/10 rare => 2000/5/5/8 rare

Shipyard is less wood-dependent: 2000 gold, 20 wood => 2000 gold, 15 wood.

SPELLS

Fireball/Fireblast/Cold ring require less SPs 9/15/9 => 8/14/8 and have stronger damage ratio: 10 => 13.

Chain lightning is made level 5 spell and requires more SPs: 15 => 200

Hypnotize is made level 4 spell instead (discussable)

Mirror Image is less expensive: 25 => 20

Other spells made more "expensive" in terms of SP:

Animate Dead: 10 => 15

Resurrect: 12 => 13

Resurrect true: 15 => 20

Blind: 6 => 7

Holy Shout: 12 => 14

Elemental Storm: 15 => 20

Meteor Shower: 15 => 18

Armageddon: 20 => 30

Dimension Door: 10 => 22

Further ways to improve spell system.

Some castles should not have some spells available like Bless/Holy Word/Holy Shout for Necromancers (useless) and Armageddon for Warlocks (too strong).
Due to availability of the standard level 1 spell for every magic fraction (Haste/Curse/Bless/Stoneskin) corresponding castle should either have that level 1 spell in Mage Guild or not have it for every fraction castle. That allows more even spell distribution.

No install target

Hello, I would like to write AUR package for Archlinux, alas there is no install target generated.

I am no cmake expert, but I added it, it required only few additional lines at the bottom of the CMakeLists.txt file.

install(TARGETS fheroes2 DESTINATION bin)
if (LINUX)
    install(FILES fheroes2.desktop DESTINATION share/applications)
    install(FILES fheroes2.cfg DESTINATION share/${PROJECT_NAME}/data)
endif()

I could open merge request, but first I wanted to ask if you thought about renaming cmake's project name from fheroes2 into, for example, fheroes2-enh? That would allow to have original fheroes2 implementation installed alongside. And this repository lacks .desktop file and project icon, these would have to be added as well.

segfault without having game resources downloaded

Plain clone, build, run procedure segfaults on missing resources. I guess, it's not really nice behaviour.

Valgrind dump:

$ valgrind --leak-check=full --track-origins=yes ./fheroes2 
==13426== Memcheck, a memory error detector
==13426== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==13426== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==13426== Command: ./fheroes2
==13426== 
03:16:49 PM: [ERROR]	SetLangEnvPath:  translation not found: en.po
03:16:49 PM: [ERROR]	GetMaxMode:  GetMaxMode: no modes available
03:16:49 PM: [ERROR]	Open:  Couldn't open dejavusans.ttf
==13426== Invalid read of size 8
==13426==    at 0x5545E9A: TTF_SizeUNICODE (in /usr/lib/x86_64-linux-gnu/libSDL_ttf-2.0.so.0.10.1)
==13426==    by 0x5547219: TTF_RenderUNICODE_Blended (in /usr/lib/x86_64-linux-gnu/libSDL_ttf-2.0.so.0.10.1)
==13426==    by 0x40ED44: FontTTF::RenderUnicodeChar(unsigned short, RGBA const&, bool) const (in /home/zilvinas/Compile/fheroes2enh/build/fheroes2)
==13426==    by 0x43D81B: AGG::LoadTTFChar(unsigned int) (in /home/zilvinas/Compile/fheroes2enh/build/fheroes2)
==13426==    by 0x43DC2E: AGG::LoadFNT() (in /home/zilvinas/Compile/fheroes2enh/build/fheroes2)
==13426==    by 0x43E39B: AGG::Init() (in /home/zilvinas/Compile/fheroes2enh/build/fheroes2)
==13426==    by 0x5591C1: main (in /home/zilvinas/Compile/fheroes2enh/build/fheroes2)
==13426==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==13426== 
==13426== 
==13426== Process terminating with default action of signal 11 (SIGSEGV)
==13426==    at 0x6245428: raise (raise.c:54)
==13426==    by 0x62454AF: ??? (in /lib/x86_64-linux-gnu/libc-2.23.so)
==13426==    by 0x5545E99: TTF_SizeUNICODE (in /usr/lib/x86_64-linux-gnu/libSDL_ttf-2.0.so.0.10.1)
==13426==    by 0x5547219: TTF_RenderUNICODE_Blended (in /usr/lib/x86_64-linux-gnu/libSDL_ttf-2.0.so.0.10.1)
==13426==    by 0x40ED44: FontTTF::RenderUnicodeChar(unsigned short, RGBA const&, bool) const (in /home/zilvinas/Compile/fheroes2enh/build/fheroes2)
==13426==    by 0x43D81B: AGG::LoadTTFChar(unsigned int) (in /home/zilvinas/Compile/fheroes2enh/build/fheroes2)
==13426==    by 0x43DC2E: AGG::LoadFNT() (in /home/zilvinas/Compile/fheroes2enh/build/fheroes2)
==13426==    by 0x43E39B: AGG::Init() (in /home/zilvinas/Compile/fheroes2enh/build/fheroes2)
==13426==    by 0x5591C1: main (in /home/zilvinas/Compile/fheroes2enh/build/fheroes2)
==13426== 
==13426== HEAP SUMMARY:
==13426==     in use at exit: 201,281 bytes in 1,258 blocks
==13426==   total heap usage: 14,839 allocs, 13,581 frees, 3,328,539 bytes allocated
==13426== 
==13426== 18 bytes in 2 blocks are definitely lost in loss record 20 of 475
==13426==    at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==13426==    by 0x629B489: strdup (strdup.c:42)
==13426==    by 0x6F9B596: ??? (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==13426==    by 0x6F9C5B4: _XimSetICValueData (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==13426==    by 0x6F97B68: _XimLocalCreateIC (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==13426==    by 0x6F7D652: XCreateIC (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==13426==    by 0x4E79BCC: ??? (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.4)
==13426==    by 0x4E7AB71: ??? (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.4)
==13426==    by 0x4E6C405: SDL_VideoInit (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.4)
==13426==    by 0x4E43E6B: SDL_InitSubSystem (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.4)
==13426==    by 0x4E43EE3: SDL_Init (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.4)
==13426==    by 0x40E4DE: SDL::Init(unsigned int) (in /home/zilvinas/Compile/fheroes2enh/build/fheroes2)
==13426== 
==13426== 192 (16 direct, 176 indirect) bytes in 1 blocks are definitely lost in loss record 439 of 475
==13426==    at 0x4C2FD5F: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==13426==    by 0x6F831FC: ??? (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==13426==    by 0x6F83770: ??? (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==13426==    by 0x6F8504E: ??? (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==13426==    by 0x6F8587B: _XlcCreateLC (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==13426==    by 0x6FA265F: _XlcDefaultLoader (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==13426==    by 0x6F8CE4D: _XOpenLC (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==13426==    by 0x6F8CF87: _XlcCurrentLC (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==13426==    by 0x6F8CFBD: XSetLocaleModifiers (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==13426==    by 0x4E79AF6: ??? (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.4)
==13426==    by 0x4E7AB71: ??? (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.4)
==13426==    by 0x4E6C405: SDL_VideoInit (in /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0.11.4)
==13426== 
==13426== 192 (16 direct, 176 indirect) bytes in 1 blocks are definitely lost in loss record 440 of 475
==13426==    at 0x4C2FD5F: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==13426==    by 0x6F831FC: ??? (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==13426==    by 0x6F83770: ??? (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==13426==    by 0x6F8504E: ??? (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==13426==    by 0x6F8587B: _XlcCreateLC (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==13426==    by 0x6FA265F: _XlcDefaultLoader (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==13426==    by 0x6F8CE4D: _XOpenLC (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==13426==    by 0x6F8D05A: _XrmInitParseInfo (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==13426==    by 0x6F74D3F: ??? (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==13426==    by 0x6F7835D: XrmGetStringDatabase (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==13426==    by 0x6F54D13: ??? (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==13426==    by 0x6F54FBD: XGetDefault (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==13426== 
==13426== LEAK SUMMARY:
==13426==    definitely lost: 50 bytes in 4 blocks
==13426==    indirectly lost: 352 bytes in 8 blocks
==13426==      possibly lost: 0 bytes in 0 blocks
==13426==    still reachable: 200,879 bytes in 1,246 blocks
==13426==         suppressed: 0 bytes in 0 blocks
==13426== Reachable blocks (those to which a pointer was found) are not shown.
==13426== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==13426== 
==13426== For counts of detected and suppressed errors, rerun with: -v
==13426== ERROR SUMMARY: 4 errors from 4 contexts (suppressed: 0 from 0)
Segmentation fault (core dumped)

Fheroes2 merge

Hi @ciplogic,

I see that your project is suspended. Will you consider merging it with another fheroes2 project? If the work is totally stopped would you mind to maybe give a link to that project so players would be happy to get an latest version of this cool game?

Windows "silent" installer/zipped version of the engine?

I notice that the Windows Installer version exists for the engine. Is there also a zip version of the engine (without the installer part) or at least a non-interactive/unnatended installation support? or is that on roadmap for future versions.

Linker failure for MacOS

After compilation I am having linker error:

[  1%] Linking CXX executable fheroes2
ld: library not found for -lpng

which means that description should explicitly state the need of this library.

Error: attempt to subscript container with out-of-bounds index 0

Built on debian sid. Trying to run the resulting binary gives me:

/usr/include/c++/8/debug/vector:417:
Error: attempt to subscript container with out-of-bounds index 0, but 
container only holds 0 elements.

Objects involved in the operation:
    sequence "this" @ 0x0x55ed94072420 {
      type = std::__debug::vector<int, std::allocator<int> >;
    }
Aborted

This happens both in release and debug builds.

Extract resource

Hi its possible extract resource like map trees and other and convert them to png or jpeg. I d like create tiles and tileset from that.

cmake_minimum_version is set to quite high one.

cmake_minimum_version is set to 3.8 and apparently, build itself works with even 3.5 and probably lower versions of CMake. I'd suggest keeping it as minimal as possible for Ubuntu <=16.04, etc users to be able to build the game itself without much of the hassle.

Cannot build due to missing SDL headers

I'm trying to build this engine, but I get errors about missing SDL headers. Here is how I invoke the build process:

cd /path/to/repo/fheroes2enh-1.01
cmake .
make

The error I get is

/path/to/repo/fheroes2enh-1.01/src/engine/audio_mixer.cpp:49:10: fatal error: SDL_mixer.h: No such file or directory
 #include "SDL_mixer.h"
          ^~~~~~~~~~~~~
compilation terminated.

I looked into the offending line and the issue is the way the file is being included:

#include "SDL_mixer.h"

I have to change it to

#include <SDL/SDL_mixer.h>

to get it to find the header.

I am a C person, not a C++ person, but I always thought including headers worked the same in both. The former inclusion instructs the compiler to search for the header in the same directory as the source file, while the latter instructs the compiler to search for a file named SDL_mixer.h in a directory named SDL, which is in some standard location the compiler knows about.

What is the reason for using your strange way of including the headers of a library? Or did I invoke the build process wrongly?

Gameplay improvements

Add an option to the config which gives one an ability to disable and enable your exclusive gameplay improvements (the thing with movement points and boat, especially).

Assets from full game

Hello

Any way to use the assets from the full game?

  • Music in CD Audio (with opera they call it)
  • Maps

Add screenshots in the README

I think people will be more interested in testing this re-implementation and maybe collaborate with some code if you show the current state of this port.

Why balance change was added?

Shouldn't be an option to have rebalancing compare to original game? Who decided that such rebalance is correct? Is it just a personal opinion?

Segmentation Fault while casting Lightning Bolt on Ghost in the Graveyard

Casting Lightning Bolt on a Ghost in the Graveyard causes Segmentation Fault.

Backtrace:

#0  0x000000000041a752 in Surface::SetPixel4 (this=0x9750a0 <Display::Get()::inside>, x=-342, y=0, color=65535)
    at /home/zilvinas/Compile/fheroes2enh/src/engine/surface.cpp:509
#1  0x000000000041a990 in Surface::SetPixel (this=0x9750a0 <Display::Get()::inside>, x=-342, y=0, pixel=65535)
    at /home/zilvinas/Compile/fheroes2enh/src/engine/surface.cpp:552
#2  0x000000000041d7ac in Surface::DrawLine (this=0x9750a0 <Display::Get()::inside>, p1=..., p2=..., color=...)
    at /home/zilvinas/Compile/fheroes2enh/src/engine/surface.cpp:1207
#3  0x00000000004c7e9d in RedrawSparksEffects (src=..., dst=...) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_interface.cpp:4205
#4  0x00000000004c8158 in Battle::Interface::RedrawTroopWithFrameAnimation (this=0xb07150, b=..., icn=599, m82=126, pain=true)
    at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_interface.cpp:4256
#5  0x00000000004c4c9e in Battle::Interface::RedrawActionLightningBoltSpell (this=0xb07150, target=...)
    at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_interface.cpp:3513
#6  0x00000000004c161c in Battle::Interface::RedrawActionSpellCastPart1 (this=0xb07150, spell=..., dst=54, caster=0xd6caf0, name="Ranloo", targets=...)
    at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_interface.cpp:2915
#7  0x0000000000482b62 in Battle::Arena::ApplyActionSpellDefaults (this=0x7fffffffd4d0, cmd=..., spell=...)
    at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_action.cpp:697
#8  0x000000000048059d in Battle::Arena::ApplyActionSpellCast (this=0x7fffffffd4d0, cmd=...) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_action.cpp:168
#9  0x0000000000480364 in Battle::Arena::ApplyAction (this=0x7fffffffd4d0, cmd=...) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_action.cpp:95
#10 0x0000000000488cfd in Battle::Arena::TurnTroop (this=0x7fffffffd4d0, current_troop=0xad80d0)
    at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_arena.cpp:358
#11 0x000000000048939c in Battle::Arena::Turns (this=0x7fffffffd4d0) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_arena.cpp:446
#12 0x00000000004cec44 in Battle::Loader (army1=..., army2=..., mapsindex=1699) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_main.cpp:79
#13 0x00000000005a7813 in BattleHeroWithMonster (hero=..., army=..., dst_index=1699) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/heroes/heroes_action.cpp:778
#14 0x00000000005b3bd8 in ActionToCaptureObject (hero=..., obj=192, dst_index=1699) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/heroes/heroes_action.cpp:2334
#15 0x00000000005b32c9 in ActionToAbandoneMine (hero=..., obj=192, dst_index=1699) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/heroes/heroes_action.cpp:2249
#16 0x00000000005a7452 in Heroes::Action (this=0xd6caf0, dst_index=1699) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/heroes/heroes_action.cpp:652
#17 0x00000000005ce2c4 in Heroes::MoveStep (hero=..., index_from=1698, index_to=1699, newpos=true)
    at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/heroes/heroes_move.cpp:489
#18 0x00000000005ce557 in Heroes::MoveStep (this=0xd6caf0, fast=false) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/heroes/heroes_move.cpp:533
#19 0x00000000005cf792 in Heroes::Move (this=0xd6caf0, fast=false) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/heroes/heroes_move.cpp:849
#20 0x000000000057763b in Interface::Basic::HumanTurn (this=0x9759a0 <Interface::Basic::Get()::basic>, isload=true)
    at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/game/game_startgame.cpp:912
#21 0x000000000057624e in Interface::Basic::StartGame (this=0x9759a0 <Interface::Basic::Get()::basic>)
    at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/game/game_startgame.cpp:585
#22 0x00000000005737ec in Game::StartGame () at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/game/game_startgame.cpp:72
#23 0x000000000055935e in main (argc=1, argv=0x7fffffffe128) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/game/fheroes2.cpp:291

Yet, another backtrace from casting Lightning Bolt on Dwarves:

#0  0x00007ffff666c428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
#1  0x00007ffff666e02a in __GI_abort () at abort.c:89
#2  0x00007ffff6faf84d in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3  0x00007ffff6fad6b6 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4  0x00007ffff6fad701 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5  0x00007ffff6fad919 in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6  0x000000000040e6cd in Error::Except (func=0x67ddf0 <Surface::SetPixel(int, int, unsigned int) const::__FUNCTION__> "SetPixel", 
    message=0x19fba50 "out of range: x: 800, y: 462, width: 800, height: 600") at /home/zilvinas/Compile/fheroes2enh/src/engine/error.cpp:29
#7  0x000000000041aaab in Surface::SetPixel (this=0x9750a0 <Display::Get()::inside>, x=800, y=462, pixel=65535)
    at /home/zilvinas/Compile/fheroes2enh/src/engine/surface.cpp:562
#8  0x000000000041d7ac in Surface::DrawLine (this=0x9750a0 <Display::Get()::inside>, p1=..., p2=..., color=...)
    at /home/zilvinas/Compile/fheroes2enh/src/engine/surface.cpp:1207
#9  0x00000000004c7e9d in RedrawSparksEffects (src=..., dst=...) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_interface.cpp:4205
#10 0x00000000004c8158 in Battle::Interface::RedrawTroopWithFrameAnimation (this=0x1639fd0, b=..., icn=599, m82=126, pain=true)
    at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_interface.cpp:4256
#11 0x00000000004c4c9e in Battle::Interface::RedrawActionLightningBoltSpell (this=0x1639fd0, target=...)
    at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_interface.cpp:3513
#12 0x00000000004c161c in Battle::Interface::RedrawActionSpellCastPart1 (this=0x1639fd0, spell=..., dst=54, caster=0xd6cad0, name="Ranloo", targets=...)
    at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_interface.cpp:2915
#13 0x0000000000482b62 in Battle::Arena::ApplyActionSpellDefaults (this=0x7fffffffd660, cmd=..., spell=...)
    at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_action.cpp:697
#14 0x000000000048059d in Battle::Arena::ApplyActionSpellCast (this=0x7fffffffd660, cmd=...) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_action.cpp:168
#15 0x0000000000480364 in Battle::Arena::ApplyAction (this=0x7fffffffd660, cmd=...) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_action.cpp:95
#16 0x0000000000488cfd in Battle::Arena::TurnTroop (this=0x7fffffffd660, current_troop=0x160d7c0)
    at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_arena.cpp:358
#17 0x000000000048939c in Battle::Arena::Turns (this=0x7fffffffd660) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_arena.cpp:446
#18 0x00000000004cec44 in Battle::Loader (army1=..., army2=..., mapsindex=1185) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_main.cpp:79
#19 0x00000000005a7813 in BattleHeroWithMonster (hero=..., army=..., dst_index=1185) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/heroes/heroes_action.cpp:778
#20 0x00000000005a82b7 in ActionToMonster (hero=..., obj=152, dst_index=1185) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/heroes/heroes_action.cpp:883
#21 0x00000000005a7151 in Heroes::Action (this=0xd6cad0, dst_index=1185) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/heroes/heroes_action.cpp:506
#22 0x000000000059b74d in RedrawGameAreaAndHeroAttackMonster (hero=..., dst=1185) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/heroes/heroes.cpp:1504
#23 0x000000000059b881 in Heroes::ActionNewPosition (this=0xd6cad0) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/heroes/heroes.cpp:1523
#24 0x000000000059bef1 in Heroes::Move2Dest (this=0xd6cad0, dst_index=@0x7fffffffdce0: 1258, skip_action=false)
    at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/heroes/heroes.cpp:1640
#25 0x00000000005ce24b in Heroes::MoveStep (hero=..., index_from=1259, index_to=1258, newpos=true)
    at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/heroes/heroes_move.cpp:481
#26 0x00000000005ce557 in Heroes::MoveStep (this=0xd6cad0, fast=false) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/heroes/heroes_move.cpp:533
#27 0x00000000005cf792 in Heroes::Move (this=0xd6cad0, fast=false) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/heroes/heroes_move.cpp:849
#28 0x000000000057763b in Interface::Basic::HumanTurn (this=0x9759a0 <Interface::Basic::Get()::basic>, isload=false)
    at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/game/game_startgame.cpp:912
#29 0x000000000057624e in Interface::Basic::StartGame (this=0x9759a0 <Interface::Basic::Get()::basic>)
    at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/game/game_startgame.cpp:585
#30 0x00000000005737ec in Game::StartGame () at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/game/game_startgame.cpp:72
#31 0x000000000055935e in main (argc=1, argv=0x7fffffffe128) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/game/fheroes2.cpp:291

Also, save file next to the graveyard. To reproduce, enter it and cast lightning bolt:
https://drive.google.com/open?id=1jBq8fS8rjBBoCSIQ3F3_46EL9F_QpDnW

HOMM2 Campaign support?

I tried yesterday the engine but I could not figure out why the campaign was not appearing the the game menu. Is this a known issue or something I'm missing?

I'm trying to use the DOS version 1.1 of the game.

Rare xcb_io assertion error while retreating

Once couple of times I get the following while fighting the same darn ghost in the graveyard and trying to retreat:

[New Thread 0x7fffefadd700 (LWP 3174)]
02:45:18 AM: [ERROR]	SetLangEnvPath:  translation not found: en.po
[xcb] Unknown sequence number while appending request
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
fheroes2: ../../src/xcb_io.c:161: append_pending_request: Assertion `!xcb_xlib_unknown_seq_number' failed.

Thread 1 "fheroes2" received signal SIGABRT, Aborted.
0x00007ffff666c428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
54	../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff666c428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
#1  0x00007ffff666e02a in __GI_abort () at abort.c:89
#2  0x00007ffff6664bd7 in __assert_fail_base (fmt=<optimized out>, assertion=assertion@entry=0x7ffff5a5397f "!xcb_xlib_unknown_seq_number", 
    file=file@entry=0x7ffff5a5392b "../../src/xcb_io.c", line=line@entry=161, function=function@entry=0x7ffff5a53dc0 "append_pending_request") at assert.c:92
#3  0x00007ffff6664c82 in __GI___assert_fail (assertion=0x7ffff5a5397f "!xcb_xlib_unknown_seq_number", file=0x7ffff5a5392b "../../src/xcb_io.c", line=161, 
    function=0x7ffff5a53dc0 "append_pending_request") at assert.c:101
#4  0x00007ffff59e0eef in ?? () from /usr/lib/x86_64-linux-gnu/libX11.so.6
#5  0x00007ffff59e19c8 in _XReply () from /usr/lib/x86_64-linux-gnu/libX11.so.6
#6  0x00007ffff59dd48d in XSync () from /usr/lib/x86_64-linux-gnu/libX11.so.6
#7  0x00007ffff7b6ddca in SDL_UpdateRect () from /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0
#8  0x00007ffff7b6dfe6 in SDL_Flip () from /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0
#9  0x000000000040d7e3 in Display::Flip (this=0x9761c0 <Display::Get()::inside>) at /home/zilvinas/Compile/fheroes2enh/src/engine/display.cpp:62
#10 0x00000000004888d1 in Battle::Arena::Arena (this=0x7fffffffd4b0, a1=..., a2=..., index=1699, local=true)
    at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_arena.cpp:314
#11 0x00000000004ced3c in Battle::Loader (army1=..., army2=..., mapsindex=1699) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/battle/battle_main.cpp:76
#12 0x00000000005a7a03 in BattleHeroWithMonster (hero=..., army=..., dst_index=1699) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/heroes/heroes_action.cpp:778
#13 0x00000000005b3dc8 in ActionToCaptureObject (hero=..., obj=192, dst_index=1699) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/heroes/heroes_action.cpp:2334
#14 0x00000000005b34b9 in ActionToAbandoneMine (hero=..., obj=192, dst_index=1699) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/heroes/heroes_action.cpp:2249
#15 0x00000000005a7642 in Heroes::Action (this=0xd6cb50, dst_index=1699) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/heroes/heroes_action.cpp:652
#16 0x00000000005ce4b4 in Heroes::MoveStep (hero=..., index_from=1698, index_to=1699, newpos=true)
    at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/heroes/heroes_move.cpp:489
#17 0x00000000005ce747 in Heroes::MoveStep (this=0xd6cb50, fast=false) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/heroes/heroes_move.cpp:533
#18 0x00000000005cf982 in Heroes::Move (this=0xd6cb50, fast=false) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/heroes/heroes_move.cpp:849
#19 0x000000000057782b in Interface::Basic::HumanTurn (this=0x976ac0 <Interface::Basic::Get()::basic>, isload=true)
    at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/game/game_startgame.cpp:912
#20 0x000000000057643e in Interface::Basic::StartGame (this=0x976ac0 <Interface::Basic::Get()::basic>)
    at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/game/game_startgame.cpp:585
#21 0x00000000005739dc in Game::StartGame () at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/game/game_startgame.cpp:72
#22 0x00000000005594ae in main (argc=1, argv=0x7fffffffe128) at /home/zilvinas/Compile/fheroes2enh/src/fheroes2/game/fheroes2.cpp:307

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.