1
0
mirror of https://github.com/vcmi/vcmi.git synced 2026-04-24 19:54:52 +02:00

213 Commits

Author SHA1 Message Date
Boris Nagaev b05c0f8e6d Normalize local relative include directives
Normalize quoted local relative include directives to remove redundant
path segments while preserving relative includes.

This applies the normalizer across the tree and updates 108 includes in
64 files, including cases where paths inside lib/* redundantly used
../../lib/... and now correctly use ../... .

These paths compiled before because include resolution normalized them,
but they were longer and harder to audit.
2026-03-26 20:15:25 -05:00
Ivan Savenko 8e71d54c63 Allow mods to provide save and map compatibilty
Now `compatibilityIdentifers` field is supported for all game entities.
As result it is now possible for mods to provide compatibility support
for loading mods and saves made with older version of the mod.

Also, added docs to specify what exactly breaks saves with mods updates
and ways to avoid that
2026-02-01 12:27:00 +02:00
Ivan Savenko 52114284ad Fix RMG picking wrong template as most-specific for terrain if template
is allowed for all land terrains
2026-01-15 22:21:54 +00:00
Ivan Savenko e3e0767a56 Merge pull request #6619 from Laserlicht/battlefields
[1.7.2] Battlefield background for different layers + allowing to define named layers
2026-01-10 12:00:01 +02:00
Tomasz Zieliński 587b5f53c4 Fix duplicated portal ID 2026-01-06 18:41:37 +01:00
Laserlicht 55db00dfb5 support battlefields per layer / random per object 2026-01-03 18:57:44 +01:00
Ivan Savenko a655661a2e Fix issues with object customization in rmg
Fixed several issues with resolving identifiers of map objects when
banning or overriding rmg properties of map objects.

Syntax should now be way simple and more readable, e.g:
```json
"bannedObjects" : {
	"randomArtifactRelic" : true,
	"hota.mapobjects:townGate" : true,
	"cartographer" : {
		"cartographerLand" : true
	}
}
```

Objects with customized rmg properties are not implicitly banned - to
prevent default rmg properties from having an effect.

In addition, it is now possible to ban or customize objects even without
explicit mod dependency, similar to how object bans work in 1.7. If
corresponding mod is not active, object ban/customization will be
ignored.

See changes in docs in this PR for docs.

Resolved issues:

- Fixes #5554
- Fixes #5556

NOTE: old (1.6) rmg templates will work as before, however changed
format will be reported by validation - please update mods either before
or after 1.7 release
2025-11-24 18:25:15 +02:00
Ivan Savenko da9ba62110 Merge pull request #6209 from Laserlicht/kingdomoverview_res
Kingdomoverview additional mines
2025-10-07 11:47:44 +03:00
Ivan Savenko 19ff1a224c Merge pull request #6193 from MichalZr6/mod_incompability_errors
Rework handling some errors and uncought exceptions
2025-10-05 12:15:17 +03:00
Laserlicht 46619f35fe load mine image in kingdom overview 2025-10-04 17:14:24 +02:00
Michał Zaremba ea261ae48f Rework handling some errors and uncought exceptions 2025-10-01 11:00:56 +02:00
Laserlicht 21bc568e59 moddable amount for mines 2025-09-29 02:00:04 +02:00
Laserlicht c9d866aed8 texts for mine 2025-09-29 01:39:50 +02:00
Laserlicht 5ae4db60e3 add mines support 2025-09-28 22:47:41 +02:00
Ivan Savenko c469c6c31e Merge pull request #6136 from Laserlicht/resource
Configurable resources
2025-09-28 21:51:10 +03:00
Laserlicht 5da8a7a4dc use resolveidentifier 2025-09-28 19:17:39 +02:00
Laserlicht d808bd6412 introduce toResourceType 2025-09-15 00:08:18 +02:00
Laserlicht 40062d7755 resource translation 2025-09-14 16:17:55 +02:00
Laserlicht a3a234f8e0 kingdom overview dwellings for mods 2025-09-02 02:58:55 +02:00
Ivan Savenko 78b39688c5 Improvements for json validation for mods
- Implemented validation for `targetCondition` in spells
- Implemented validation for `mapObject` in towns/heroes
- Fixed validation of zone connections in RMG
- Added workarounds to prevent assertions triggering on invalid mods
- Erase 'base' entries from json before validation (but after applying
them to derived keys)

Should have no effect on mod behavior/support, but may cause new
detections for mods that were broken in either 1.6 or 1.7
2025-08-05 19:40:18 +03:00
Ivan Savenko 283230eb4e Add description for University using H3 string 2025-07-26 21:09:16 +03:00
Ivan Savenko b3167a44ee Move MarketInstanceConstructor class to a separate file 2025-07-21 19:38:24 +03:00
Ivan Savenko f58d08e563 Support for banned game entities in random map templates
The following entities can now be banned in a random map template
definition:
- Hero
- Artifact
- Spell
- Secondary skill

The ban follows the same rules as banning via the map settings in the
map editor.

It is also now possible to bypass dependencies and access identifiers
from mods that are not dependencies when defining:
- Banned entities in random map templates
- the chance of a hero class appearing in a tavern of a specific faction
- the chance of a spell appearing in a mage guild of a specific faction
- the chance of a hero class receiving a secondary skill

For this to work, the identifier must be specified in full, e.g.
`modName:objectName`. If the specified mod is not active, the game will
silently ignore this entry.

This behaviour is not affected by mod load order. It is possible to use
this format to access a mod that has not yet been loaded.
2025-07-14 00:18:11 +03:00
Ivan Savenko 46072a1d60 Merge pull request #5896 from IvanSavenko/code_reorganize
Split large source files into smaller files per 1 class
2025-07-08 10:47:13 +03:00
Ivan Savenko 8721bdd728 Split CCreatureSet file on .h/.cpp per class basis 2025-07-07 19:12:31 +03:00
Ivan Savenko 2ad186130f Split MapDefines file on .h per class basis 2025-07-07 18:16:42 +03:00
Ivan Savenko ee72338c4d Add check for invalid map objects edits (e.g. dwellings) in mods 2025-07-05 19:49:16 +03:00
Ivan Savenko e35ac0b1e5 Merge pull request #5733 from MichalZr6/mapeditor_fixes
Mapeditor fixes for various crashes
2025-06-16 17:15:29 +03:00
Ivan Savenko 463c404a83 Use bonus only as shared_ptr to avoid memory corruption 2025-06-16 16:22:21 +03:00
Michał Zaremba ebe746d0cf Integrate EditorCallback into mapeditor
EditorCallback being set up with std::unique_ptr stored in MapController.
2025-06-15 23:47:08 +02:00
Ivan Savenko a842dfb3c4 Support for defining new campaign regions in mods, for hota h3c 2025-06-15 17:01:29 +03:00
Ivan Savenko 54a46b77a9 Extract library entity randomization logic to separate class 2025-05-19 18:51:42 +03:00
Ivan Savenko 4d4da0454f map objects hierarchy now uses IGameInfoCallback 2025-05-14 18:33:20 +03:00
Ivan Savenko 6f20235d07 Merge CPrivilegedInfoCallback into CGameInfoCallback 2025-05-14 13:42:20 +03:00
Ivan Savenko 716da918f8 Completely remove IGameCallback class
- CClient now inherits directly from CPrivilegedInfoCallback, like
IGameCallback did before. However CClient no longer needs dummy
implementation of IGameEventCallback
- CGObjectInstance hierarchy now uses CPrivilegedInfoCallback for
callback. Actual events can only be emitted in calls that receive
IGameEventCallback pointer, e.g. heroVisit
- CGameHandler now inherits directly from both CPrivilegedInfoCallback
and IGameEventCallback as it did before via IGameCallback
2025-05-14 13:39:41 +03:00
Ivan Savenko a13ab8f013 Merge pull request #5707 from IvanSavenko/dwelling_fix
Fixes for handling of oversized map dwellings
2025-05-14 11:52:40 +03:00
Ivan Savenko 35644da2b7 Reogranize callback-related classes on 1 file = 1 class basis 2025-05-12 22:07:09 +03:00
Ivan Savenko cb70cc48d6 Fixes for handling of oversized map dwellings
- Marked large version of H3 Unicorn's Glade as not usable for random
dwelling replacement
- Shifted oversized dwellings - that have at most 2x2 as blocked tile,
but have non-blocked tile column will now be placed correctly
- This fixes incorrect random dwelling replacement of the only oversized
H3 dwelling - Portal of Glory
- Game will now detect & report invalid dwelling templates from mods
- Updated docs to clarify dwellings format
2025-05-12 18:01:46 +03:00
Ivan Savenko 6b6199d3a4 Implemented giving bonuses to commanders 2025-05-07 22:49:22 +03:00
Ivan Savenko 62e774c91e Add new rewards for configurable objects 2025-05-06 17:28:11 +03:00
Ivan Savenko 283adc37d7 Unit stack rebalancing rework
- CStackInstance::count is now private with accessor methods
- CStackInstance::experience renamed to totalExperience and now stores
total stack experience (multiplied by stack size) to reduce rounding
errors
- CStackInstance::totalExperience is now private with accessors methods
- stack experience is now automatically reallocated on stack management
- Removed buggy BulkSmartRebalanceStacks pack, that mostly duplicates
BulkRebalanceStacks
- Renamed BulkSmartSplitStack to BulkSplitAndRebalanceStack to drop
unclear "smart" in name
- Reworked split-and-rebalance logic to correctly reallocate stack
experience
2025-05-01 18:18:30 +03:00
Ivan Savenko dca5a099d5 Remove compat code for old banks, fixes crash on loading old mods 2025-04-29 12:15:04 +03:00
Ivan Savenko 63d00b080e Removed pointer to army from StackInstance 2025-04-27 14:57:30 +03:00
Ivan Savenko c02a8a84fd Stacks of armed instance are now unique_ptr 2025-04-27 14:57:30 +03:00
Ivan Savenko 0ada2a5ebd Map objects now use shared_ptr (game) 2025-04-27 14:57:30 +03:00
Ivan Savenko 2b286378e8 Remove logic for banks in 1.5 format 2025-03-19 08:02:39 +00:00
Ivan Savenko 8f074490a7 Merge branch 'master' into 'develop' 2025-02-27 21:15:42 +00:00
Ivan Savenko f04cac4101 Fix format string 2025-02-27 10:15:23 +00:00
Ivan Savenko b372cc84e9 Avoid crash if object has same name as on provided in compatiblity
identifiers field
2025-02-25 15:26:16 +00:00
Ivan Savenko 645b95ba02 Renamed LibClasses * VLC to GameLibrary * LIBRARY 2025-02-21 16:54:56 +00:00