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

89 Commits

Author SHA1 Message Date
62cb5412ff CGameState::map is now a private, unique_ptr with accessors 2025-03-08 14:05:14 +00:00
9f713a0914 Rename int3::valid to isValid for consistency 2025-03-03 10:46:00 +00:00
645b95ba02 Renamed LibClasses * VLC to GameLibrary * LIBRARY 2025-02-21 16:54:56 +00:00
2362c6da21 Fixes for multiple new issues from Sonar 2025-02-21 15:57:39 +00:00
0548f325e4 Merge branch 'master' into 'develop' 2025-02-21 13:59:34 +00:00
7823dd3945 Block pathfinder from allowing to interact with heroes standing on
another visitable object
2025-02-06 14:18:18 +00:00
ec970c7b22 Support for configuring minimal cost for moving between tiles
- Added `movementCostBase` parameter to game config that defines minimal
amount of movement points that will be spent when moving from one tile
on another while offroad (and cost of Fly / Town Portal spells)
- Added `BASE_TILE_MOVEMENT_COST` bonus type that allows modifying
`movementCostBase` on per-hero basis

Example usage for hota-like pathfinding skill
```json
"tileCostReduction" : {
	"type" : "BASE_TILE_MOVEMENT_COST",
	"val" : -15
}
```
2025-02-03 22:52:33 +00:00
32391dc7a9 Pathfinder cache is now stored separately per playerBlocked
- human player will now use pathfinder settings from config (as before)
- nullkiller AI will now use its own, modified settings
- added option to configure NKAI usage of monolith to config
- fixed pathfinder costs not updating on receiving levelup
2025-01-23 15:28:44 +00:00
ced98f4698 Fix pathfinding reducing tile cost by only 1 point 2025-01-22 11:05:07 +00:00
699709adf0 Fix not accounting for movement points limit on land bonuses 2025-01-09 19:34:24 +00:00
73d1675ae3 Code cleanup, fixes to discovered regressions 2025-01-05 15:41:42 +00:00
83b9a8d750 Fixes for regressions 2025-01-04 15:09:50 +00:00
dea1eba20b Rework and optimize turnInfo used by pathfinder 2025-01-04 15:09:50 +00:00
65fc50d33b Simplified building ID logic
- Replaced overcomplicated and broken math on dwelling ID's with fixed
enum
- Fixed broken 2nd upgrades and 8th dwelling
- Removed no longer used enumeration values from building ID's
2024-12-25 19:16:21 +00:00
95a07ee5cb Use bonus system cache whenever possible 2024-12-21 18:47:11 +00:00
ab45c58e26 Use small_vector for bonus list to reduce allocations 2024-12-21 14:43:08 +00:00
94981076a2 Do not aquire pointer to Terrain type multiple times 2024-12-21 14:43:08 +00:00
08fbcd5239 TerrainTile now uses identifiers instead of pointers to VLC 2024-10-30 16:22:11 +00:00
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
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
a481f07daf PlayerState now stores all objects owned by player 2024-08-28 12:51:27 +00:00
K
462c79e190 remove never used code in CBonusSystemNode
Method CBonusSystemNode::getAllBonuses have 'root' parameter which is never
set to anythig else than nullptr. This patch removes the parameter and all
code that depends on it as preparatory work for further bonus system
optimization.
2024-08-25 14:15:21 +02:00
683c363946 NKAI: whirlpool 2024-07-21 17:20:54 +03:00
04a81fee87 Reduce size of CGPathNode and AIPathNode 2024-07-15 07:49:04 +00:00
6b8f94e6e7 Merge remote-tracking branch 'vcmi/master' into develop 2024-07-11 17:43:44 +00:00
1468abb8a0 Remove excessive copies of large objects 2024-07-03 21:14:22 +00:00
40f17d654d Use containers with pre-allocations to improve pathfinding speed 2024-07-03 18:06:56 +00:00
02e429e973 Fix typos using https://github.com/crate-ci/typos
Changes were reviewed manually
2024-06-24 03:47:19 +02:00
df83fa33a1 Merge branch 'vcmi/master' into 'vcmi/develop' 2024-05-31 09:34:21 +00:00
3847e3e2b4 Better comments, remove dead code 2024-05-28 13:43:16 +00:00
f7989f6dcb Allow landing on guarded tiles when flying in from guarded tile 2024-05-23 19:01:30 +00:00
ac047d0d6d Fixed handling of original game rules pathfinding 2024-05-23 19:01:30 +00:00
0a3cfea017 Simplify code 2024-05-23 19:01:30 +00:00
d7f5d24b99 If original movement rules are on, it is not possible to attack guards
from visitable object directly
2024-05-23 19:01:30 +00:00
ef29c47408 Added GUARDED state to distinguish from blocked visitable 2024-05-23 19:01:30 +00:00
84bc6c42db Added 'Serializeable' base class for classes serializeable by pointer 2024-05-16 18:40:59 +00:00
157443c1df #3876 - allow to embark after battle for AI pathfinder 2024-05-05 13:52:57 +03:00
75aae66858 Fix off-by-one error - turnLimit 1 should work after 1st turn, not 2nd 2024-04-26 12:44:42 +03:00
017fb204a1 NKAI: remove 5th dimension 2024-03-24 09:32:54 +02:00
2ea78a5883 Fix float comparisons
Replace this "==" with a more tolerant comparison operation.
Floating point numbers should not be tested for equality cpp:S1244
2024-02-14 23:30:29 +01:00
678cacbd25 Remove more redundant virtual specifiers
`grep -nr "virtual " | grep -v googletest | grep " override" | grep -v overriden > ../redundant_virtual.txt`

```python
import os

with open("../redundant_virtual.txt") as f:
    for line in f:
        print()
        line: str = line.strip()
        print(line)
        tmp = line.split(":",2)
        file = tmp[0].strip()
        code = tmp[-1].strip()
        print(file)
        print(code)
        new_code = code.replace("virtual ", "", 1)
        # https://superuser.com/a/802490/578501
        command = f"export FIND='{code}' && export REPLACE='{new_code}' && ruby -p -i -e \"gsub(ENV['FIND'], ENV['REPLACE'])\" {file}"
        os.system(command)
```
2024-02-13 15:21:30 +01:00
ad602573ff Merge pull request #3600 from dydzio0614/sod-fly
Fix SoD fly mechanics
2024-02-11 12:26:20 +02:00
522cb571b3 Remove redundant virtual specifiers
`grep -nr virtual | grep -v googletest | grep override > ../redundant_virtual.txt`

```python
import os

with open("../redundant_virtual.txt") as f:
    for line in f:
        print()
        line: str = line.strip()
        print(line)
        tmp = line.split(":")
        file = tmp[0].strip()
        code = tmp[-1].strip()
        print(file)
        print(code)
        new_code = code.replace("virtual ", "", 1)
        # https://superuser.com/a/802490/578501
        command = f"export FIND='{code}' && export REPLACE='{new_code}' && ruby -p -i -e \"gsub(ENV['FIND'], ENV['REPLACE'])\" {file}"
        os.system(command)
```
2024-02-10 20:46:13 +01:00
fd9810adf4 Working SoD version of fly 2024-02-07 19:27:02 +01:00
365fedc7e8 Merge branch 'develop' into sod-fly 2024-02-03 20:40:32 +01:00
dbf53d78ba Fix invalid logic which made AI not attack guards 2024-01-24 06:20:46 +01:00
0c1664dbe7 NKAI: various AI fixes after tests in headless 2024-01-20 22:55:30 +02:00
6b760089a4 Merge pull request #3473 from IvanSavenko/const_lib
[1.5] Remove non-const global variables from library
2024-01-20 19:22:46 +02:00
1f7e53a609 Code style fixes 2024-01-19 21:21:23 +02:00
e67e4430ba Removed most of non-const static fields in lib. Reduced header includes. 2024-01-19 13:55:22 +02:00