1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00
Commit Graph

225 Commits

Author SHA1 Message Date
8efa7911b7 Implemented "Allied Adventure Map AI" option 2023-07-03 14:34:53 +03:00
d1e5a347ff Refactoring of campaign handler: rename types and use strong typing 2023-06-26 17:15:59 +03:00
6a08a96d0c Added createObject call as wrapper around NewObject netpack 2023-06-23 13:42:08 +03:00
87fcfa4add Removed excessive pathfinder includes 2023-06-21 12:00:44 +03:00
982a2723de Fix missing change 2023-06-08 09:49:28 +02:00
86f5d6de69 vcmi: modernize headers 2023-04-30 13:35:54 +03:00
7db67a3101 int3 now has proper hasher function 2023-04-20 22:04:24 +03:00
7a5775a9f9 vcmi: use std::optional 2023-04-17 00:43:13 +03:00
dfa2e2a349 Merge beta into develop 2023-04-11 19:37:35 +03:00
c0b90432cb Change callback interface 2023-04-10 05:40:03 +04:00
e440343921 Bypass initial version of spell callback 2023-04-10 04:34:24 +04:00
1d6192ca62 Shut down the thread for tactic phase properly 2023-04-08 22:52:46 +04:00
11b237a23c vcmi: massive refactoring v1 2023-04-05 22:33:12 +03:00
9f8aa25297 Backpack limit part4 (Using cheats, buying) 2023-03-21 12:14:33 +02:00
e23766280f Backpack limit part2 (Pick up, Dig up, Object rewards) 2023-03-21 12:14:33 +02:00
4617ce10e5 vcmi: allow showing more than one components in infobar
Up to 8, AFAIK. So, we can show multi-reward in infobox now.
One issue remain - cannot dynamically choose components size
based on text size.
2023-03-11 21:41:57 +03:00
4501036a04 Basic version of hero movement on map. Removed old code. 2023-03-05 17:48:02 +02:00
cb3fd24ec0 Fixes after merge, move removeGUI to Client class 2023-01-11 17:11:44 +01:00
8a8716ce8a Pass loaded game over network too 2022-09-29 21:33:44 +04:00
7ee4fca120 Pass whole gamestate over network 2022-09-28 23:15:05 +04:00
ff635edc0b wrap all library code into namespace if VCMI_LIB_NAMESPACE is defined
preparation for having client and server in a single process
2022-09-24 15:55:21 +03:00
7e6ed0583c disable all scripting code when configuring without scripting modules 2022-09-21 19:31:42 +03:00
30b879ae5d Fixed: duplicated bonusing building. Improved: opposite bonus propagation 2021-09-12 14:30:54 +03:00
25d9ea1ddf Feature: Opposite Side Limiter 2021-09-04 14:15:38 +03:00
ecaa9f5d0b Entities redesign and a few ERM features
* Made most Handlers derived from CHandlerBase and moved service API there.
* Declared existing Entity APIs.
* Added basic script context caching
* Started Lua script module
* Started Lua spell effect API
* Started script state persistence
* Started battle info callback binding
* CommitPackage removed
* Extracted spells::Caster to own header; Expanded Spell API.
* implemented !!MC:S, !!FU:E, !!FU:P, !!MA, !!VR:H, !!VR:C
* !!BU:C, !!BU:E, !!BU:G, !!BU:M implemented
* Allow use of "MC:S@varName@" to declare normal variable (technically v-variable with string key)
* Re-enabled VERM macros.
* !?GM0 added
* !?TM implemented
* Added !!MF:N
* Started !?OB, !!BM, !!HE, !!OW, !!UN
* Added basic support of w-variables
* Added support for ERM indirect variables
* Made !?FU regular trigger
* !!re (ERA loop receiver) implemented
* Fixed ERM receivers with zero args.
2021-02-14 19:05:43 +03:00
a05ae78e67 Fixed lots of warnings.
Disabled the following (for MSVC only) that couldn't (or shouldn't) be fixed.

4003: not enough actual parameters for macro 'identifier'
4250: 'class1' : inherits 'class2::member' via dominance
4251: 'type' : class 'type1' needs to have dll-interface to be used by clients of class 'type2'
4275: non dll-interface class 'type1' used as base for dll-interface class 'type2'
2020-10-04 02:20:18 -07:00
38fd05f655 Minor fix: apply Monday bonuses to heroes who have slept overnight 2020-09-28 01:32:33 +03:00
4b5910c2f4 VCAI performance improvements
* Node graph initialization optimized.
* Fixed "Unathorized obstacle access".
* Pathfinding tracing disabled with ifdef.
* Misc bonus calculation optimizations.
* Removed timestamp from log lines. Date formatting eats too much CPU.
* Paths for all heroes in Client are now cached
2019-01-17 10:50:56 +03:00
74e5c5bf05 CGameHandler: rename CPackForClient argument and add network logging 2018-04-04 14:24:32 +07:00
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
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
fc3b8b2c87 Refactoring: replace macro with variadic templates on client-side
Big thanks to @mwu-tow for helping me with this.
2018-02-05 08:14:01 +03:00
da117e9255 Code style: remove void from constructors without arguments 2018-01-13 11:51:47 +03:00
805b5215de Client threading tweak 2017-11-16 14:15:43 +03:00
f1e5797834 Code style: move or add licensing information on top of every file 2017-07-14 01:26:03 +03:00
09df2dcfbb fixed possible race condition 2017-07-12 19:40:14 +03:00
2c525fc76e Attempt to fix headless tests crash. 2017-07-12 17:02:25 +03:00
bd27636cd9 Merge pull request #316 from FeniksFire/improvingTheBattle
Refactoring.
2017-06-28 19:55:03 +03:00
4113bdab01 Moving some files from lib to the battle subdirectory. 2017-06-26 15:26:08 +02:00
eeff7ee315 Few minor code improvements
* All command line options now case insensetive.
* SDL_VIDEO_X11_DGAMOUS unused in SDL2 so it's removed.
* Added current year into the --help output for client and server.
* Moved DO_NOT_START_SERVER into session settings.
2017-06-26 04:56:28 +03:00
1a60c1a94b Shared memory refactoring and command line control options
Now client accept following options:
 --disable-shm - disable shared memory usage
 --enable-shm-uuid - use UUID for shared memory identifier
UUID is useful when a lot of clients starting simultaneously.
Needed for testing and was easier to implement than alternatives.
2017-06-06 07:30:16 +03:00
18161d3688 Client: implement spectator mode via command-line options
If running with --spectate/-s CPlayerInterface will appear even without human players.
Following command-line options also available:
 --spectate-ignore-hero
 --spectate-hero-speed=N
 --spectate-battle-speed=N
 --spectate-skip-battle
 --spectate-skip-battle-result
Boolean options can also be changed in runtime via client console:
 set spectate-ignore-hero on / off
Spectator mode also:
 - Work with --onlyAI option when starting game or loading saves.
 - Allow to use any cheat codes.
 - Give recon on towns and heroes.
2017-06-06 07:30:16 +03:00
d95c74941b Client: add onlyAI option support for saved games
When --onlyAI option used all human players will be replaced with AIs during loading.
2017-06-06 07:30:16 +03:00
6642816b1e Client: server port and testing options cleanup
Now we only pass port as ui16 instead of std::string
2017-06-04 08:49:23 +03:00
5b76c3f4eb Rebase of codebase changes for refactored serializer
Some of newer fixes not yet merged there and save compatibility a bit off.
2016-10-27 18:12:20 +03:00
4bcc43d3d0 Fix Mantis #2234
CPlayerInterface instances were removed from CClient::playerint with
clear() and finish() was not called on each. Added multiple insurance.
2016-10-22 16:22:00 +02:00
23b7a803b6 cleanup 2016-10-01 20:07:36 +03:00
1cbe9e1b8b Client: add donotstartserver option. Alternative way to start a game
Option is useful for server profiling also let me test MP over network and much more.
Also there is issues with boost::interprocess on some systems under Windows and this is the way to bypass them.
2016-09-16 20:01:44 +03:00
ef05a56e49 cleanup 2016-08-30 05:13:45 +03:00
9fd1cff090 Refactoring: always use std prefix for shared_ptr, unique_ptr and make_shared
Long time ago it's was used without prefix to make future switch from boost to std version easier.
I discusses this with Ivan and decide to drop these using from Global.h now.

This change wouldn't break anything because there was already code with prefix for each of three cases.
2015-12-29 05:43:33 +03:00