1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-30 08:57:00 +02:00
Commit Graph

178 Commits

Author SHA1 Message Date
karliss
ad2c429d8f CMake: unittest improvements (#447)
* Convert TestConfig to proper test environment.
* Copy test data to build directory.
* Get test recognized by ctest, but disable gtest discovery. Allowing ctest to run each test individually isn't currently practical because it is 50 times slower.
2018-04-15 18:02:31 +07:00
Arseniy Shestakov
74e5c5bf05 CGameHandler: rename CPackForClient argument and add network logging 2018-04-04 14:24:32 +07:00
Arseniy Shestakov
ac66fc7f42 Full rework of pre-game interface and networking
New features for players:
* Loading for multiplayer. Any save could be used for multiplayer.
* Restart for multiplayer. All clients will restart together.
* Loading from single save.
* Hotseat mixed with network game. Multiple players per client.
* Now connection to server could be cancelled.
* Return to menu on disconnections instead of crashes.
* Restoring of last selected map, save or campaign on next run.

TLDR on important changes in engine code:
* UI: work with server separated from UI
* UI: all explitic blitting replaced with IntObject's
* UI: all new code use smart pointers instead of DISPOSE
* Gameplay always start through lobby controlled by server.
* Threads receiving netpacks now shared for lobby and gameplay.
* Campaigns: heroes for crossover now serialized as JsonNode.
2018-04-04 14:24:26 +07:00
Henning Koehler
02b5a5e830 Make bonus stacking configurable + fix duplicate propagation/inheritance (#433)
Addresses several related problems:
* Propagation / unpropagation of duplicate bonuses is inconsistent, causing bugs
* Duplicate bonuses never stack, which is not always intended behaviour (e.g. multiple copies of resource generating artifacts)
* Different bonuses always stack, which is not always intended behaviour (e.g. Angel + Archangel morale bonuses)

This is addressed as follows:
* Duplicate bonuses are never eliminated during propagation/inheritance.
* Unpropagation eliminates only a single copy of duplicated bonus
* Bonus receives a new field stacking that determines stacking behaviour:
* * empty string = no stacking with duplicates (default)
* * "ALWAYS" = stacks with duplicates & everything else
* * some other value = no stacking with bonuses with same stacking value
Also Morale/Luck window now hides non-stacking bonuses.
2018-03-27 14:54:58 +07:00
AlexVinS
9d108d59db Redone RMG template serialization using JSON serializer, added tests 2018-03-10 19:36:19 +03:00
AlexVinS
b2faf30d0d [tests] Moved JsonComparer to own file 2018-03-05 21:26:00 +03:00
AlexVinS
f126a34a5e Fixed https://bugs.vcmi.eu/view.php?id=2904 2018-03-04 11:15:24 +03:00
AlexVinS
5ea1888a14 Summon effect fixes. 2018-03-03 20:37:49 +03:00
Alexander Shishkin
8b002ad774
Issue2888 (#421)
Fixed issue 2888
* Merged AFTER_ATTACK & BEFORE_ATTACK cast modes.
* Introduced new caster class for creature ability usage
* Added few tests
2018-03-02 13:22:51 +03:00
AlexVinS
2b49df2cab [Spells] Do not use Unit State in heal effect 2018-02-20 13:19:01 +03:00
AlexVinS
2add0e443e [Spells] Added "summonByHealth" option to Summon effect
* with summonByHealth on, effect power (levelPower * SP) treated as HP
* default behavior (effect power = amount) not changed
* tests included
2018-02-20 08:08:34 +03:00
AlexVinS
8220053864 Cleanup 2018-02-09 20:52:56 +03:00
AlexVinS
0b70baa95e Spells configuration version 2 (effect-based)
* Indirect spell effects loading
* Json serializer improvements
* spell->canBeCastAt do not allow useless cast for any spell
* Added proxy caster class for spell-created obstacles
* Handle damage from spell-created obstacles inside mechanics
* Experimental GameState integration/regression tests
* Ignore mod settings and load only "vcmi" mod when running tests
* fixed https://bugs.vcmi.eu/view.php?id=2765 (with tests)
* Huge improvements of BattleAI regarding spell casts
* AI can cast almost any combat spell except TELEPORT, SACRIFICE and obstacle placement spells.
* Possible fix for https://bugs.vcmi.eu/view.php?id=1811
* CStack factored out to several classes
* [Battle] Allowed RETURN_AFTER_STRIKE effect on server side to be optional
* [Battle] Allowed BattleAction have multiple destinations
* [Spells] Converted limit|immunity to target condition
* [Spells] Use partial configuration reload for backward compatibility handling
* [Tests] Started tests for CUnitState
* Partial fixes of fire shield effect
* [Battle] Do HP calculations in 64 bits
* [BattleAI] Use threading for spell cast evaluation
* [BattleAI] Made AI be able to evaluate modified turn order (on hypothetical battle state)
* Implemented https://bugs.vcmi.eu/view.php?id=2811
* plug rare freeze when hypnotized unit shots vertically
* Correctly apply ONLY_MELEE_FIGHT / ONLY_DISTANCE_FIGHT for unit damage, attack & defense
* [BattleAI] Try to not waste a cast if battle is actually won already
* Extended JsonSerializeFormat API
* fixed https://bugs.vcmi.eu/view.php?id=2847
* Any unit effect can be now chained (not only damage like Chain Lightning)
** only damage effect for now actually uses "chainFactor"
* Possible quick fix for https://bugs.vcmi.eu/view.php?id=2860
2018-02-08 11:37:21 +03:00
Dydzio
38d836d1a5 Update project files to Visual Studio 2017 2018-01-13 16:33:49 +01:00
Michał Kalinowski
26a222ac62 Change JsonType to enum class (#393)
Change enum JsonType to enum class JsonType
2017-11-27 00:18:18 +03:00
Dydzio
ea17b0f458 Major overhaul of VS related files 2017-08-19 15:58:55 +02:00
Dydzio
e3ba491fa1 Use multi-core compile by default, fix VCMI_client path 2017-08-19 13:27:24 +02:00
Arseniy Shestakov
40af43c46e CMake: massive rework for Mac build and other improvements
- macOS: RPATH-related code all removed or disabled
- macOS: new osx/CMakeLists.txt to run some install-code running after all subdirectories
- Assets copying into the runtime output directory implemented for Mac and Linux development
2017-08-16 16:10:07 +03:00
Arseniy Shestakov
7dca95c8cc CMake: multiple improvements for builds and project generation
- Change default build output directory name from "build" to "bin"
- Implement new function vcmi_get_cmake_debug_info
- Link client with SDL2main on Windows and disable debug console
- Remove all old MinGW-specific options since they outdated and MXE work fine
- Set AUTOGEN_TARGETS_FOLDER for better Xcode and Visual Studio projects
- Remove useless vcmitestFiles custom target for less garbage in project files
2017-08-16 16:10:07 +03:00
Arseniy Shestakov
56f89270db macOS: full rework of Mac packaging process
- Most of outdated CMakeLists code removed.
- All Mac-specific code is removed include Sparkle support and vcmibuilder app.
- DMG buidling reimplemented using macdeployqt command.
2017-08-16 16:10:07 +03:00
Arseniy Shestakov
193f492b99 CMake: cleanup, project generation and other improvements
- Use EXCLUDE_FROM_ALL for FuzzyLite and GoogleTest to avoid inclusion of unneded headers and libraries into installers.
- Set minimum CMake version only in main CMakeLists.txt
- Set project name only in main CMakeLists.txt
- Visual Studio: add assign_source_group function to generate proper filesystem tree
- Visual Studio: set PROJECT_LABEL so generated projects have same names binaries on Windows
- Visual Studio: enabled USE_FOLDERS for projects grouping. This also possibly affect other IDEs.
- Added add_subdirectory_with_folder function to make sure 3rd-party libraries are affected by USE_FOLDERS.
2017-08-16 16:10:07 +03:00
AlexVinS
15138c23de Finished conversion to new logging API
* removed logger streams
* (float3|int3)::operator() -> (float3|int3)::toString(), it was too ugly and confusing.
2017-08-11 23:06:27 +03:00
AlexVinS
046e1a7c29 Prepared JsonNode for new logging API. 2017-08-11 16:27:42 +03:00
Arseniy Shestakov
21074e13c3 macOS: always change working directory for launcher and server
This make relative paths work properly when launched from DMG or from different directory.
2017-08-09 01:33:12 +03:00
AlexVinS
2d31d5710f [tests] Reduced code duplication 2017-08-03 15:56:45 +03:00
AlexVinS
12b42f4495 Improved map format tests 2017-08-03 13:50:54 +03:00
AlexVinS
2e2642ef7a [C::B] test project update 2017-07-20 15:46:40 +03:00
FeniksFire
d84ecb6fb2 Tests improvement
Delete our logger from tests.
Make correction.
2017-07-19 17:04:57 +02:00
FeniksFire
587f59e93a Migrating "CHealthTest" from boost to googlemock and googletest. 2017-07-18 21:04:57 +02:00
FeniksFire
704eeb25b2 Add googletest as submodule 2017-07-18 16:49:50 +02:00
FeniksFire
a71c9d0751 Migrating from boost test to google test. 2017-07-18 16:49:05 +02:00
AlexVinS
ef73f416dc fixed resurrection corner case 2017-07-17 02:50:38 +03:00
ArseniyShestakov
b52cfe5283 Code style: use parentheses for creating heap-based objects (#344) 2017-07-16 12:58:05 +03:00
ArseniyShestakov
ea0ceb1805 Merge pull request #323 from vcmi/CStackTweaks
CStack tweaks
2017-07-15 00:42:08 +03:00
AlexVinS
df13851176 fixed wrong battle result 2017-07-14 23:43:03 +03:00
Arseniy Shestakov
f1e5797834 Code style: move or add licensing information on top of every file 2017-07-14 01:26:03 +03:00
AlexVinS
f1d35dd3f2 [c::b] update 2017-07-12 15:43:03 +03:00
AlexVinS
3bc082a1c5 Reduced code duplication in CHealthTest 2017-07-10 09:30:23 +03:00
AlexVinS
de01a797a6 added more tests 2017-07-09 22:31:00 +03:00
AlexVinS
2d0613b40b Added some CHealth tests. 2017-07-09 22:15:06 +03:00
Victor Luchits
30cc2f6a01 Change the output path for cmake so all files go into the same root directory 2017-07-07 13:08:53 +03:00
Victor Luchits
271fcb746d We need zlib headers for minizip, which comes in through the filesystem 2017-07-04 03:31:13 +03:00
AlexVinS
4f8c7bd4bb CStack refactoring
* removed all occurrences of attackerOwned
* Use BattleSide enum
* more tweaks
2017-07-01 19:17:08 +03:00
Arseniy Shestakov
fb19a3a068 CMake: update all CMakeLists to include actual sources and headers
This make it easier to use project with newer CMake and Qt Creator.
I decided against using GLOB since we don't rename files that much.
2017-06-29 02:03:37 +03:00
FeniksFire
4113bdab01 Moving some files from lib to the battle subdirectory. 2017-06-26 15:26:08 +02:00
AlexVinS
02ae95aca3 Fixed random map format test crash 2017-06-14 12:40:46 +03:00
AlexVinS
c82afe7156 switch CMapService API to ResourceID 2017-06-04 22:42:48 +03:00
FeniksFire
039e3842fc Aesthetic changes in BattleHex (#303) 2017-05-29 10:33:34 +03:00
AlexVinS
a85b4cf2a5 * WIP on event condition format
* Hero portrait serialization
* Fix town spells serialization

* Added support for float exponential part in Json
* Added support for int64 in Json
* Added basic Hero definitions serialization
* Added rumors serialization
* Advanced player info serialization.
* Added Disposed heroes serialization, (!) not covered with tests yet
* Added Local event serialization
* Added Pandoras box serialization
* Added Seer hut reward serialization
* Added CQuest serialization
* Added API for map object instance names serialization.
* Added random dwelling options serialization
* Advanced town options serialization
* Advanced hero options serialization
* More map format tests
* A lot of fixes, cleanup and refactoring
2017-05-27 00:23:19 +03:00
DjWarmonger
20700495c0 Merge branch 'develop' of https://github.com/vcmi/vcmi into develop 2017-03-02 10:59:34 +01:00
DjWarmonger
84bdc5c994 Compilation fixes for MSVS.
Apparently it doesn't like structs converted to class, needs more investigation.
2017-03-02 10:58:14 +01:00
AlexVinS
0b50976de1 [C::B] build fixes 2017-02-22 00:39:13 +03:00
FeniksFire
49e32325c4 Uncommend code fragment and make simple protect from error. 2017-01-31 19:55:43 +01:00
FeniksFire
de7184d68d Making unit tests for BattleHex and some estetic improvements. 2017-01-29 16:38:13 +01:00
DjWarmonger
80d5f7b4a4 Updated project files to MVS 2015 (in fact, it's trivial). 2016-12-12 19:14:45 +01:00
AlexVinS
204ee37ae4 boost/program_options has only 2 uses, and unlikely will be used more -> removed form Global.h. 2016-11-28 21:38:17 +03:00
AlexVinS
36598d8695 Fixed CID 1197474, CID 1366358 2016-11-28 19:35:33 +03:00
AlexVinS
4ef1956779 Fixed CID 1366320 2016-11-25 22:39:44 +03:00
Arseniy Shestakov
cb3d6a24e7 Cmake: cleanup for commit hash in build version
Since it's available in lib we don't need to include it everywhere.
2016-10-27 17:01:29 +03:00
Vadim Markovtsev
da1c9cf249 Fix rebuilding everything on HEAD change 2016-10-23 16:56:53 +02:00
Vadim Markovtsev
d0beb27197 Add git commit hash into the version string 2016-10-23 15:45:47 +02:00
AlexVinS
3f075e391a ERM convert logging 2016-08-29 19:49:52 +03:00
Alexander Shishkin
5e5ce0bb09 Merge pull request #203 from vcmi/logFormat
boost::format support for CLogger
2016-08-29 17:32:44 +04:00
AlexVinS
439aeecc8b [c::b] re-enabled PCH, tested with GCC 5.3. (Older versions may not work) 2016-08-18 13:40:35 +03:00
AlexVinS
36c44c2ce7 projects update 2016-08-13 16:57:11 +03:00
AlexVinS
72f79a3ad7 Draft boost::format based log proxy. 2016-08-13 16:57:09 +03:00
AlexVinS
379331fc73 [tests] Relaxed logging 2016-08-11 11:07:04 +03:00
AlexVinS
8e3e574900 Fix map object appearance serialization 2016-02-26 02:03:14 +03:00
AlexVinS
d2f04332d0 Load object appearance and pos before addNewObject call, it is required for block-visit calculation.
Added a test for tile block-visit.
2016-02-24 00:44:17 +03:00
AlexVinS
dc5ad7d7b3 Make string instance names persistent 2016-02-22 19:26:42 +03:00
AlexVinS
15a4a11560 Tweak tests 2016-02-21 22:25:31 +03:00
AlexVinS
a4b6d34ebe Advance map header serialization 2016-02-21 22:13:20 +03:00
AlexVinS
53b5587c2e Advance map header serialization 2016-02-21 21:21:22 +03:00
AlexVinS
ec760632a6 Advance Json serializer
* added bool, numeric and string support
* added some enum support
* PoC implementation of logical id condition
* Refactoring
2016-02-15 12:21:39 +03:00
AlexVinS
800f32c4cb Fix few cases of tempOwner initialization. 2016-02-14 12:13:30 +03:00
AlexVinS
a59f0c23ce Dedug tweaks 2016-02-13 17:16:00 +03:00
AlexVinS
fb17914ae5 Debug tweaks 2016-02-10 08:59:24 +03:00
AlexVinS
6977fc3a14 Move test filesystem creation to global fixture 2015-12-05 12:37:37 +03:00
AlexVinS
126a821960 Tweak tests setup. 2015-12-05 12:37:37 +03:00
AlexVinS
e7359c9a36 Serialize tempOwner 2015-12-05 12:37:35 +03:00
AlexVinS
2d5a366e6c Implemented (basic) object construction and placement
* contain refactoring of RMG and class handling (will be more)
2015-12-05 12:36:42 +03:00
AlexVinS
9cc3dae5fe Started working on objects serialization 2015-12-05 12:36:42 +03:00
AlexVinS
f5b348a1d1 Formatting 2015-12-05 12:36:35 +03:00
AlexVinS
3af255d1b9 Implemented terrain serialisation
* with test
2015-12-05 12:36:34 +03:00
AlexVinS
3d63a97cf9 Fix TriggeredEvent check 2015-12-05 12:36:33 +03:00
AlexVinS
b828f8fa9b Added checks fro terrain 2015-12-05 12:36:32 +03:00
AlexVinS
a3c3f935b9 Advance map checks 2015-12-05 12:06:53 +03:00
AlexVinS
11af00bcdf Start working on Triggered Events 2015-12-05 12:06:50 +03:00
AlexVinS
b683c29b6e Added modification time to zip.
* it is required to consider archive valid (by some tools)
2015-12-05 12:06:49 +03:00
AlexVinS
f6e2cd16ed Fix header.mapLevels saving 2015-12-05 12:06:48 +03:00
AlexVinS
0cc7213a27 WiP on zip serialization
(-) still not works correctly
2015-12-05 12:06:47 +03:00
AlexVinS
f2164abf1b Wip on zip serialize fixes 2015-12-05 12:06:45 +03:00
AlexVinS
27a29bd035 Start implementing actulal json serialization 2015-12-05 12:06:44 +03:00
AlexVinS
580263201a Cleanup old tests 2015-12-05 12:06:43 +03:00
AlexVinS
1a8faeb0b9 Start implementing map saver 2015-12-05 12:06:42 +03:00
AlexVinS
8f209b17b6 Few more checks 2015-12-05 12:06:39 +03:00
AlexVinS
3d265f94dc Update projects 2015-12-05 12:06:39 +03:00
AlexVinS
a2b4b8a6de Fix filename 2015-12-05 12:06:38 +03:00
AlexVinS
0798ef4b2a Advance MapComparer 2015-12-05 12:06:36 +03:00
AlexVinS
0cc47f00c5 Advance map format simple test 2015-12-05 12:06:35 +03:00