1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-14 10:12:59 +02:00
Commit Graph

648 Commits

Author SHA1 Message Date
Ivan Savenko
503b87561e Converted all h3 banks to rewardable, remove most of hardcoded checks 2024-09-12 12:11:18 +00:00
Ivan Savenko
ce4548718c
Merge pull request #4544 from IvanSavenko/map_settings
Per-map game settings
2024-09-10 00:03:10 +03:00
Ivan Savenko
a58e209cbd
Merge pull request #4490 from godric3/fix-campaign-hero-placeholder
Fix campaign hero placeholder
2024-09-09 23:39:20 +03:00
Ivan Savenko
ff8d36c350 It is now possible to define game settings in rmg template 2024-09-05 15:16:28 +00: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
Ivan Savenko
a72715ad31
Merge pull request #4563 from SoundSSGood/vcmiScrolls
Improvements to the artifact creation
2024-09-05 17:10:13 +03:00
SoundSSGood
7466d7452d vcmiscrolls 2024-09-05 15:51:45 +03:00
SoundSSGood
b06426ac43 CMap removed from CArtifactSet level 2024-09-04 15:12:40 +03:00
Laserlicht
0280254810 tarnum icon 2024-08-31 22:05:36 +02:00
Laserlicht
36914682a5
Merge branch 'develop' into chronicles_installer 2024-08-31 16:18:52 +02:00
Laserlicht
2fef4b5d69 voice override 2024-08-31 14:17:25 +02:00
Laserlicht
46c169d20f chr loading 2024-08-31 12:39:23 +02:00
Ivan Savenko
82c37573fa Removed save compatibility with 1.4
All save compatibility checks targeting 1.4 saves have now been removed.
Saves from 1.5 can still be loaded in 1.6

Implemeted few TODO's in serialization that were postponed to avoid
breaking save compatibility in MP for 1.5.X releases.

Fixed missed case for loading black market object from 1.5 saves
2024-08-29 18:51:53 +00:00
Ivan Savenko
20d5b33ea6 Remove marketModes as member
marketModes are now generated in runtime and are not a member of
IMarket. Was not a bad change, but towns load buildings before town type
is randomized, leading to case where market modes are not actually known
when building is added to town (like random towns with market built)

Since altar requires CArtifactSet for work, IMarket will now always
contain it, but it will only be accessible if market supports altar
mode.
2024-08-27 14:07:00 +00:00
Ivan Savenko
11e8b04ac5
Merge pull request #4463 from SoundSSGood/IMarket-refactoring
IMarket refactoring
2024-08-26 22:48:23 +03:00
godric3
355bf4ec3e read reservedCampaignHeroes from vmaps 2024-08-22 16:52:35 +02:00
K
18a69dfeb5 move CMap::isInTheMap to the header file and make it inline 2024-08-22 14:27:01 +02:00
K
3a27725fcb Optimize CMap::isInTheMap
replace x >= 0 && x < size by (unsigned)x < size

By converting signed coordinate to unsigned number, negative values became
very large positive ones, larger than every positive signed number and
therefore also bigger than the map size. As a result check against size
also implicitly checks if coordinate is negative.

Compiler cannot do this transformation automatically because it doesn't
know that map dimensions are always positive.

The change shrinks isInTheMap from 19 instructions to 11 on x86.
2024-08-22 11:39:24 +02:00
SoundSSGood
58bb2b58e3 IMarket suggestions
Co-authored-by: Ivan Savenko <saven.ivan@gmail.com>
2024-08-20 18:49:48 +03:00
SoundSSGood
39bb6d5f39 IMarket now able to store artifacts 2024-08-20 18:49:47 +03:00
Ivan Savenko
350749a1a6 Removed no longer used netpacks 2024-08-14 14:13:50 +00:00
Ivan Savenko
26fdaacbe5 Map and town events are now processed on start of player turn instead of
on start of new day, in line with H3
2024-08-14 14:13:50 +00:00
Ivan Savenko
5523e08cb7 Players affected by event is now stored as std::set instead of bitmask 2024-08-14 14:13:49 +00:00
Ivan Savenko
97f1a310df Fix miscellaneous issues discovered by Sonar 2024-08-12 18:26:30 +00:00
Ivan Savenko
4aa73b40c9 Split CTownHandler into smaller chunks 2024-07-21 18:21:48 +00:00
Ivan Savenko
1aa391fdf8 Split CGeneralTextHandler file into 1 file per class form
All text processing code is now located in lib/texts.
No changes other than code being moved around and adjustment of includes

Moved without changes:
Languages.h           -> texts/Languages.h
MetaString.*          -> texts/MetaString.*
TextOperations.*      -> texts/TextOperations.*

Split into parts:
CGeneralTextHandler.* -> texts/CGeneralTextHandler.*
                      -> texts/CLegacyConfigParser.*
                      -> texts/TextLocalizationContainer.*
                      -> texts/TextIdentifier.h
2024-07-20 12:55:17 +00:00
Ivan Savenko
2d3734656d Fix test 2024-07-19 12:17:06 +00:00
Ivan Savenko
2020d96070
Merge pull request #4071 from IvanSavenko/fix_rng_syncronization
[1.6] Fix potential desync if client uses different stdlib with different random number generators
2024-07-19 13:08:09 +03:00
Alexander Wilms
434371195d JsonNode constructors: Take fileName as argument
* Don't print JSON in JsonParser::parse() in case of errors
2024-07-17 13:50:59 +02:00
Ivan Savenko
1c63fefe02 Moved banks randomization to server-side with client netpack 2024-07-16 13:13:39 +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
fd04320815
Merge pull request #4267 from IvanSavenko/sonar_fix
Fixed new issues detected by SonarCloud
2024-07-16 12:23:08 +03:00
Ivan Savenko
3134d8383c
Merge pull request #4207 from Laserlicht/map_format_additional
[1.6] Map format additional infos
2024-07-16 12:15:58 +03:00
Ivan Savenko
c00a1e1b0c Fixed new issues detected by SonarCloud 2024-07-15 07:46:40 +00:00
Ivan Savenko
6b8f94e6e7 Merge remote-tracking branch 'vcmi/master' into develop 2024-07-11 17:43:44 +00:00
K
d3c198678c
reorder fields to shrink struct TerrainTile from 96 to 80 bytes
When I was playing a very large map, computer's turn took up to 2 minutes and that give me time to fire up perf and profile the code while waiting.

I noticed that 1.7% of time was spent in function CPathfinderHelper::getNeighbors and half of that on a single load from an array backing multi_array of TerrainTiles. That signals the CMap::terrain is too big to fit in CPU caches.

This patch reorders fields in TerrainTile struct, shrinking it from 96 bytes to 80 bytes and hopefully helping to keep more tiles in the cache and speeding things up a little bit.
2024-07-07 12:53:29 +00:00
Laserlicht
02bd52041b extend map format 2024-06-29 13:13:59 +02:00
Tomasz Zieliński
d7a4ea9f32 Draw random artifact as an atomic operation 2024-06-24 20:06:50 +02: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
Ivan Savenko
3bea383b59 Merge branch 'vcmi/beta' into 'vcmi/develop' 2024-06-21 12:58:36 +00:00
Ivan Savenko
c68f2da977 Fix initialization of gold pile from random resource with fixed amount 2024-06-17 20:08:07 +00:00
Andrey Filipenkov
bf832d4b13 fix building editor with Apple Clang 15 2024-06-13 06:38:15 +03:00
Ivan Savenko
df83fa33a1 Merge branch 'vcmi/master' into 'vcmi/develop' 2024-05-31 09:34:21 +00:00
Ivan Savenko
5d6470e527
Merge pull request #4025 from IvanSavenko/shared_ptr_lib
[1.6] Use shared_ptr for library entities
2024-05-30 19:14:06 +03:00
Ivan Savenko
49138e3de9 Fixes Adrienne starting without Inferno spell in campaign 2024-05-29 14:28:36 +00:00
Ivan Savenko
7461df161c lib now uses shared_ptr for entities. Removed manual memory management. 2024-05-17 15:04:05 +00:00
Ivan Savenko
84bc6c42db Added 'Serializeable' base class for classes serializeable by pointer 2024-05-16 18:40:59 +00:00
Ivan Savenko
0ce78cae06
Merge pull request #3926 from IvanSavenko/optimize_map_list_load
[1.5.1] Improve performance of parsing of map headers for map list
2024-05-11 21:56:58 +03:00
Ivan Savenko
31401e219f Fix possible crash on nullptr dereference 2024-05-11 13:19:07 +00:00
Ivan Savenko
3acc1f1845 Improve performance of parsing of map headers for map list 2024-05-10 14:30:39 +00:00