140 Commits
Author SHA1 Message Date
Ivan Savenko 30458c35ce Fixes for issues Sonar view as 'critical' 2026-06-19 12:54:08 +03:00
Ivan Savenko 628b1572d1 Removed most of deprecated/undesired Lua API methods 2026-06-12 17:49:06 +03:00
Ivan Savenko 0ec357a878 Added Lua docs exporter 2026-06-12 17:49:06 +03:00
Ivan Savenko 91269f7ed5 Implemented patching of Lua spell effects by mods 2026-06-10 10:19:16 +03:00
Ivan Savenko 40ebce8da3 Fix discovered regressions 2026-06-03 16:46:55 +03:00
Ivan Savenko 4683343455 Added AI-generated tests for all UnitEffect's 2026-06-03 16:41:46 +03:00
Ivan Savenko 4e968a4cb7 Migrate teleport effect to Lua 2026-06-03 16:41:45 +03:00
Ivan Savenko 80ee758753 Remove STRONG_INLINE macro 2026-05-28 22:59:31 +03:00
Ivan Savenko ca03be65fc Merge pull request #7323 from IvanSavenko/scripting
[1.8] Lua scripting support part 2
2026-05-28 22:32:13 +03:00
George King 1d309b99d0 Code cleanup and review 2026-05-27 14:46:30 +02:00
Ivan Savenko 35fd1d4975 Reorganize lua spell effects in more extensible for
- Added spell effect hanlder instead of global registry
- Removed script handler, in favor of module that injects itself into
the lib
2026-05-26 19:21:12 +03:00
Ivan Savenko cb95d5e654 Lua script now must return a table with provided class 2026-05-26 19:20:48 +03:00
Ivan Savenko 07eee98dd3 Fix build 2026-04-30 18:00:56 +03:00
Ivan Savenko af1db8ff19 Fix sonar, remove no longer used code 2026-04-30 18:00:56 +03:00
Ivan Savenko fa386bf089 Cleanup code, update docs, fix build 2026-04-30 18:00:55 +03:00
Ivan Savenko d556dd1590 All but 4 summon effect test now pass
- Added logging support for Lua
- Added exporting of enums to Lua
- Added few more missing pieces to support summon spell effect
2026-04-30 18:00:38 +03:00
Ivan Savenko 6ad93dd3eb Reworked Lua API type safety
- pushing type that is derived from type registered in Lua will now
correctly push type known to Lua
- Methods of types stored on stack as shared pointers now actually load
this as shared pointer
- It is now possible to return types other than Json from Lua function
2026-04-30 18:00:38 +03:00
Ivan Savenko 32630a95b3 Implement resolving string -> entity for Lua 2026-04-30 18:00:38 +03:00
Ivan Savenko f2076069b7 Moved all Lua-related code into lua module, instead of weird split
between library and lua module
2026-04-30 18:00:37 +03:00
Ivan Savenko 826db7e548 Lua refactoring part 1
- Scripting module and lua dependency are now required.
- Script context pool now only exists in gamestate
- removed unused pools from client and server
- scripts are now registered in pools on start instead of lazy
registering with caching
2026-04-30 18:00:30 +03:00
Ivan Savenko de98e6c39c First attempt at using Lua for actual spell effect 2026-04-30 17:45:10 +03:00
Ivan Savenko 78f34c5a1d Fix SPELLCASTER bonus regressions
Fixed 1.7.2 regression of spellcaster logic when casting non-random
spells.

Slight refactoring of AI code to simplify logic related to SPELLCASTER.
As a side effect - AI should now be better at selecting spells if unit
has multiple spells to cast.
2026-02-20 17:40:27 +02:00
Ivan Savenko 0a843505b7 Added persistent flag to spells for non-removable effects 2026-01-27 18:22:26 +00:00
Ivan Savenko a0b69d79f0 NKAI2 performance improvements
Performance improvements to functions that are called a lot by AI:
- simplify math in BuildAnalyzer
- remove complex randomization in NodeStorage
- Fix excessive copying in Creature::cost
- Generate list of all resources in ResourceTypeHandler once
2025-12-18 19:06:34 +02:00
Laserlicht d808bd6412 introduce toResourceType 2025-09-15 00:08:18 +02:00
Laserlicht b6e8731329 code review 2025-07-08 10:34:11 +02:00
Laserlicht 9bfe3a8195 max range for spellcaster 2025-06-25 15:50:31 +02:00
Ivan Savenko a305ed28bb Support for loading custom bonuses, slightly less hardcoded Skeleton
Transformer
2025-06-15 14:36:29 +03:00
Laserlicht 4e73f7d90f shared_mutex replace boost 2025-02-28 16:01:11 +01:00
Laserlicht 7dfb499edf replace boost locks with std 2025-02-28 15:25:58 +01:00
Ivan Savenko 9d7c4a60e0 Added support for configuring which language channels are visible to
player in lobby
2025-01-27 17:19:14 +00:00
Ivan Savenko 40bff74195 Use small vector for unit list 2025-01-10 18:58:46 +00:00
MichalZr6 8c3a417527 Cleanup 2025-01-06 23:18:20 +01:00
MichalZr6 a99274d72e BattleHexArray - new container for BattleHexes 2025-01-06 23:18:18 +01:00
Ivan Savenko 73d1675ae3 Code cleanup, fixes to discovered regressions 2025-01-05 15:41:42 +00:00
Ivan Savenko 05397e2aaf Caching of bonuses that are requested with different durations 2025-01-04 15:09:50 +00:00
Ivan Savenko 16cfb51f3e Initial version of new bonus caching system 2025-01-04 15:09:50 +00:00
Ivan Savenko 4e5d44bc9c Merge pull request #5149 from vcmi/fix_visitablePos_calls
Fix visitable pos calls
2024-12-25 13:45:51 +02:00
Ivan Savenko 6da58a6871 Fixes excessive logging causing RMG slowdown
- Do not apply formatting on log entries that will be discarded due to
high log level
- Do not log incorrect access to visitablePos due to its numerous use by
RMG
2024-12-23 21:24:00 +00:00
Ivan Savenko 56d5911452 Optimized getMovementRange method - caching, faster route for 0 turns 2024-12-21 14:43:08 +00:00
Ivan Savenko 3dd4fa2528 Reduce usage of pointers to VLC entities
Final goal (of multiple PR's) is to remove all remaining pointers from
serializeable game state, and replace them with either identifiers or
with shared/unique pointers.

CGTownInstance::town and CGHeroInstance::type members have been removed.
Now this data is computed dynamically using subID member.

VLC entity of a town can now be accessed via following methods:
- getFactionID() returns ID of a faction
- getFaction() returns pointer to a faction
- getTown() returns pointer to a town

VLC entity of a hero can now be accessed via following methods:
- getHeroTypeID() returns ID of a hero
- getHeroClassID() returns ID of a hero class
- getHeroType() returns pointer to a hero
- getHeroClass() returns pointer to a hero class
2024-10-10 12:28:08 +00:00
Ivan Savenko c0f5c7c0ea Replace pointer with reference in pack apply functions 2024-10-07 14:59:46 +00:00
Laserlicht e6cb87abac cast only on self 2024-09-28 17:32:53 +02:00
Laserlicht 0aaafc4c8a cast without skip 2024-09-14 15:10:24 +02:00
Ivan Savenko 8225eb454e Added GameSettings to gamestate, potentially allowing to define game
settings per map (or in random map template)
2024-09-05 15:16:27 +00:00
godric3 c34956e912 introduce getModScope method toEntity class and subclasses 2024-08-10 16:08:04 +02:00
Ivan Savenko 34b6eaa25e Integrating changes from PR #4251 - add logging for rng 2024-07-16 15:31:58 +00:00
Ivan Savenko 63bcf7d83c Replaced most of usages of CRandomGenerator with vstd::RNG in library 2024-07-16 13:13:07 +00:00
Ivan Savenko 60a51e98de Remove usage of std::function from CRandomGenerator 2024-07-16 13:13:07 +00:00
Alexander Wilms 02e429e973 Fix typos using https://github.com/crate-ci/typos
Changes were reviewed manually
2024-06-24 03:47:19 +02:00