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
Andrej Dudenhefner
f0fc58b118
add wouldResist mock method
2025-12-11 11:21:15 +01:00
Ivan Savenko
98c8ef373c
Merge pull request #6362 from ahammond/fix/hero-recruitment-assertion
...
Fix assertion crash in hero recruitment
2025-12-04 17:46:26 +02:00
Michał Zaremba
841f725220
Fix Mechanics tests
2025-11-30 18:53:14 +01:00
Andrew Hammond and Claude
4d2aef1605
Refactor test infrastructure: extract reusable GameStateTest base class
...
Extract game initialization boilerplate from HeroRecruitmentTest into a
reusable GameStateTest base class for testing netpacks and game state.
Created test/game/GameStateTest.h with:
- Fully initialized game state with test map loading
- Server callback implementation for applying netpacks
- Mock services and event callbacks
- Configurable startTestGame() supporting custom maps
- Common test utilities (SetUp, TearDown, apply, etc.)
Refactored test/game/HeroRecruitmentTest.cpp to:
- Inherit from GameStateTest instead of duplicating setup code
- Remove 100+ lines of boilerplate
- Focus on hero recruitment test logic
This makes writing new netpack tests much simpler - just inherit from
GameStateTest and call startTestGame(). No need to reimplement game
initialization, server callbacks, or mock setup.
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-11-26 12:39:25 -08:00
Andrew Hammond and Claude
951e19beb3
Fix assertion crash in hero recruitment
...
Move ID validation assertion after addNewObject() call to ensure the hero has an ID assigned before checking. Add comprehensive tests validating hero recruitment ID assignment behavior.
🤖 Generated with [Claude Code](https://claude.com/claude-code )
Co-Authored-By: Claude <noreply@anthropic.com >
2025-11-25 19:34:17 -08:00
Ivan Savenko
e4497284a1
Compilation of most of AI's is now optional
2025-11-23 22:48:34 +02:00
Ivan Savenko
c42f72a0f4
Add workaround for failing tests
2025-11-23 21:23:49 +02:00
Mircea TheHonestCTO
5c6f2faebb
Merge branch 'develop' into feature/nullkiller2
2025-11-19 17:47:18 +01:00
Andrej Dudenhefner
497995c11f
add BattleEnded pack which happens after BattleResultsApplied and losing heroes are removed
2025-11-14 12:48:46 +01:00
Mircea TheHonestCTO
00c93c7b6a
Merge branch 'develop' into feature/nullkiller2
2025-10-28 22:30:39 +01:00
Ivan Savenko
7b6d9bd404
Try to fix failing tests in some configurations
2025-10-24 13:01:41 +03:00
Ivan Savenko
3bec32ac14
Try to fix tests not running on some presets
2025-10-24 11:24:37 +03:00
Mircea TheHonestCTO
1a30c7bf49
adjusted ResourceTraderTest.cpp after develop merge
2025-10-03 16:50:30 +02:00
Mircea TheHonestCTO
d43accfd95
Merge branch 'develop' into feature/nullkiller2
2025-10-01 17:56:58 +02:00
Laserlicht
7d1e661e6f
mithril removal
2025-09-16 02:07:25 +02:00
Laserlicht
d808bd6412
introduce toResourceType
2025-09-15 00:08:18 +02:00
Laserlicht
acd067e587
remove CObjectHandler
2025-09-14 21:34:32 +02:00
Mircea TheHonestCTO
6df299d892
ResourceTrader improvements and testing finished
2025-09-12 08:08:18 +02:00
Mircea TheHonestCTO
1b5cacfc13
ResourceTrader improvements and testing WIP
2025-09-10 01:42:56 +02:00
Mircea TheHonestCTO
e7e88533cb
fix vtable / cmake for NK2 testing
2025-09-09 03:46:18 +02:00
Mircea TheHonestCTO
39af301f55
fix CI build
2025-09-08 18:14:32 +02:00
Mircea TheHonestCTO
aea43de201
extract trading logic into ResourceTrader, test preparation WIP
2025-09-08 16:44:26 +02:00
Mircea TheHonestCTO
44ef0c02ef
fix nullkiller2 .cpp includes for testing
2025-08-24 13:43:28 +02:00
Mircea TheHonestCTO
39b2474051
fix RecruitHeroBehaviorTest.cpp #include
2025-08-24 12:12:08 +02:00
Mircea TheHonestCTO
484c1e9598
test CMakeLists.txt adjustments for Nk2
2025-08-24 10:54:09 +02:00
Mircea TheHonestCTO
58543f23cf
refactoring RecruitHeroBehavior + test sample; renamed more Nullkiller variables consistently
2025-08-24 09:12:34 +02:00
Ivan Savenko
118029b2ba
Merge pull request #5964 from Laserlicht/levels
...
multilevel support
2025-08-14 11:03:42 +03:00
Ivan Savenko
e28242497f
Enable few more tests, remove workaround
2025-08-04 15:55:08 +03:00
Ivan Savenko
de56d8cf32
Enable spell condition tests
2025-08-04 13:10:58 +03:00
Ivan Savenko
d98b7b93e0
Restore UnitStateMagicTest's
2025-08-04 12:49:35 +03:00
Ivan Savenko
be2cb93201
Fix BattleFake logic, re-enable tests that depend on it
2025-08-04 12:24:47 +03:00
Ivan Savenko
5e7724bf9a
Fix failing tests - regression from some time ago?
2025-08-04 12:24:20 +03:00
Ivan Savenko
1d2d189e4a
Add tests for bonus system propagation, fix discovered issues
2025-08-04 12:23:38 +03:00
Laserlicht
ecfe09f6b1
multilevel support
2025-08-01 02:21:44 +02:00
Ivan Savenko
241da5937d
First semi-working version of antilag for hero movement
2025-07-19 18:04:20 +03:00
Ivan Savenko
52da332640
GameHandler now uses GameConnectionID instead of connection pointers
2025-07-19 18:04:20 +03:00
Ivan Savenko
55bd4bc8bf
Support for custom cursors for adventure map spells
2025-07-11 16:06:21 +03:00
Ivan Savenko
e12765dca0
Fix sonar warnings, convert spaces -> tabs
2025-07-09 17:52:51 +03:00
Laserlicht
b6e8731329
code review
2025-07-08 10:34:11 +02:00
Laserlicht
13a2b8781e
Merge branch 'vcmi:develop' into max_range_spell
2025-07-03 23:25:06 +02:00
Ivan Savenko
c250ca6e49
Merge pull request #5847 from IvanSavenko/movement_fix
...
Fix incorrect movement gain from objects like Rally Flag
2025-06-30 11:59:04 +03:00
Laserlicht
9bfe3a8195
max range for spellcaster
2025-06-25 15:50:31 +02:00
Ivan Savenko
4181514c3f
Fix incorrect movement gain from objects like Rally Flag
...
Checked all possible places that can change move points - looks like all
of them expect absolute values
2025-06-24 16:25:15 +03:00
Ivan Savenko
1e3e2f665c
Remove strange & unused double-selector logic
2025-06-24 12:06:23 +03:00
Ivan Savenko
0ad4e80c7d
Rework and simplify logic of attaching heroes to bonus system
2025-06-17 14:37:25 +03:00
Ivan Savenko
2d80443d8f
Merge pull request #5739 from IvanSavenko/battleai_fix
...
Fix handling of double-wide creatures by BattleAI
2025-05-25 11:26:01 +03:00
Ivan Savenko
1666a5a7e5
Prefer dynamic_cast to unsafe static_cast, fix Sonar
2025-05-23 14:17:43 +03:00
Ivan Savenko
fa6bf02b6e
Renamed mocked file to represent change in inheritance
2025-05-23 14:17:43 +03:00
Ivan Savenko
d4e886257d
Remove unused file
2025-05-23 14:17:43 +03:00