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

133 Commits

Author SHA1 Message Date
Konstantin
7a5775a9f9 vcmi: use std::optional 2023-04-17 00:43:13 +03:00
Konstantin
7bfb37df4d vcmi: modernize lib/rmg 2023-02-14 02:50:39 +03:00
Ivan Savenko
1e37e66e6c Replaced Terrain::BORDER and WRONG with NONE 2023-01-10 20:09:09 +02:00
Ivan Savenko
4f3ea0d1d9 Renamed Terrain.h/cpp -> TerrainHandler.h/cpp 2023-01-10 00:01:35 +02:00
Ivan Savenko
e1799379dd Terrain/Road/River handler are now in compileable state 2023-01-10 00:01:35 +02:00
Ivan Savenko
1468f6aded Converted terrainTypeHandler into proper handler class 2023-01-10 00:01:35 +02:00
Nordsoft91
785787e454
Merge branch 'develop' into interface-builder 2022-12-24 21:56:29 +04:00
nordsoft
53b2f68560 Serialize template 2022-12-14 04:37:11 +04:00
nordsoft
5d1b5b6c9c Throw an exception if empty zone is generated 2022-12-06 15:07:16 +04:00
Tomasz Zieliński
f386f42166 Merge remote-tracking branch 'origin/develop' into terrain-rewrite
# Conflicts:
#	lib/Terrain.cpp
#	lib/Terrain.h
#	lib/battle/CBattleInfoEssentials.cpp
#	lib/rmg/ObstaclePlacer.cpp
#	lib/rmg/RiverPlacer.cpp
2022-09-27 07:50:17 +02:00
Tomasz Zieliński
2bd30556a3 Store TerrainType by havlue and handle by reference 2022-09-26 09:17:55 +02:00
Andrey Filipenkov
ff635edc0b wrap all library code into namespace if VCMI_LIB_NAMESPACE is defined
preparation for having client and server in a single process
2022-09-24 15:55:21 +03:00
Tomasz Zieliński
6aaf77812b Changed logic for zone placement.
Now every zone can be surface, underground, or both. This is separate from water <-> land distinction.

Iand type is now a combination of flags and can take multiple values: "type": ["LAND", "WATER", "SURFACE", "SUB", "ROCK"]. In nothing is specified, terrains get LAND | SURFACE flags by default.

Non-surface zones will default to DIRT, and non-underground zones will default to SUBTERRA.
2022-09-22 18:23:31 +02:00
Tomasz Zieliński
494b0f0226 First version that compiles 2022-09-21 11:34:23 +02:00
DjWarmonger
7ba271edf1
Rotation rebase2 (#912)
* Instead of [x][y][z] coordinates, map will be stored as [z][x][y].
* Nullkiller AI can get it too.
* Use boost::multi_array instead of nested vectors
* In MapHandler too
* Rotate foreach algorithms, too
* VCAI gets rotated, too
2022-09-18 17:39:10 +03:00
Nordsoft91
4bd0ff680a Random map generator refactoring (#762)
random map generator refactoring and improvements
2022-09-11 11:31:27 +03:00
Nordsoft91
aaa07e4d2e New terrain support - part 1 (#755)
Initial support of new terrains
2022-09-11 11:31:26 +03:00
Nordsoft91
5c1a66ab69 Rmg water support (#745)
* RMG: water support and refactoring
* Fix seers hut bug
2022-06-11 18:40:24 +03:00
Nordsoft91
9d06e51631
Place proper towns in underground (#743)
Implement feature of proper town selection in underground and surface
* Some minor refactoring of rmg
2022-05-28 16:03:50 +03:00
AlexVinS
ecaa9f5d0b Entities redesign and a few ERM features
* Made most Handlers derived from CHandlerBase and moved service API there.
* Declared existing Entity APIs.
* Added basic script context caching
* Started Lua script module
* Started Lua spell effect API
* Started script state persistence
* Started battle info callback binding
* CommitPackage removed
* Extracted spells::Caster to own header; Expanded Spell API.
* implemented !!MC:S, !!FU:E, !!FU:P, !!MA, !!VR:H, !!VR:C
* !!BU:C, !!BU:E, !!BU:G, !!BU:M implemented
* Allow use of "MC:S@varName@" to declare normal variable (technically v-variable with string key)
* Re-enabled VERM macros.
* !?GM0 added
* !?TM implemented
* Added !!MF:N
* Started !?OB, !!BM, !!HE, !!OW, !!UN
* Added basic support of w-variables
* Added support for ERM indirect variables
* Made !?FU regular trigger
* !!re (ERA loop receiver) implemented
* Fixed ERM receivers with zero args.
2021-02-14 19:05:43 +03:00
John Bolton
a05ae78e67 Fixed lots of warnings.
Disabled the following (for MSVC only) that couldn't (or shouldn't) be fixed.

4003: not enough actual parameters for macro 'identifier'
4250: 'class1' : inherits 'class2::member' via dominance
4251: 'type' : class 'type1' needs to have dll-interface to be used by clients of class 'type2'
4275: non dll-interface class 'type1' used as base for dll-interface class 'type2'
2020-10-04 02:20:18 -07:00
AlexVinS
9d108d59db Redone RMG template serialization using JSON serializer, added tests 2018-03-10 19:36:19 +03:00
Nikolay Shalakin
3795985de9 Eliminate warnings / errors. Pull request #388 2018-02-11 15:17:14 +03:00
DJWarmonger
8f42cdea67 Refactoring: use private pointer to CMapGenerator 2017-11-03 21:03:51 +01:00
AlexVinS
15138c23de Finished conversion to new logging API
* removed logger streams
* (float3|int3)::operator() -> (float3|int3)::toString(), it was too ugly and confusing.
2017-08-11 23:06:27 +03:00
AlexVinS
143ff682bc Logging cleanup 2017-08-10 21:59:55 +03:00
AlexVinS
85e952f25f Logging cleanup 3 2017-08-10 20:17:10 +03:00
AlexVinS
61e241308d Logging cleanup 2017-08-10 19:52:05 +03:00
Arseniy Shestakov
cdd9dbc7f1 Code style: avoid some ambiguous else if indentation
If some code intentionally want to break else if to achieve specific indentation there must be braces.
2017-07-19 03:42:26 +03:00
Arseniy Shestakov
f1e5797834 Code style: move or add licensing information on top of every file 2017-07-14 01:26:03 +03:00
DJWarmonger
4d1fb67594 Sanity check for Coverity #1366290.
(Vector should never be empty, especially for chosen zone).
2017-05-27 21:37:05 +02:00
AlexVinS
609c6f81bd Fixed a few CWE-457 2016-11-27 22:37:41 +03:00
DjWarmonger
56b201e7e8 Fixed CID 1366289 and 1366290. 2016-11-25 19:32:54 +01:00
Vadim Markovtsev
c696746017 Fix some compilation warnings 2016-10-28 08:07:05 +02:00
DjWarmonger
7f0b852449 Huge optimization based on profiling - cut generation time by almost half (Jebus XL+U). 2016-08-09 10:12:13 +02:00
DjWarmonger
7db2fc6d25 Fixes. Works correctly only for player factions configured in RMG options. 2016-08-06 12:16:13 +02:00
DjWarmonger
f980de7107 Place starting zones on surface/underground depending on player faction - first draft. 2016-08-06 10:04:03 +02:00
DjWarmonger
40f28778c2 Minor optimization, saves few seconds. 2016-07-14 14:24:11 +02:00
DjWarmonger
7d7b51d0db Generated zones can now have different sizes depending on template. 2016-07-13 10:35:31 +02:00
DjWarmonger
1d8fb01f46 More even distribution of surface / underground zones + refactoring. 2016-07-13 07:54:52 +02:00
DjWarmonger
ac68dca328 Fixed zone placer so it now correctly evaluates found solution. 2016-07-12 21:23:45 +02:00
DjWarmonger
e1e520f0a2 Removed "growing" zones which don't fit the rest of algorithm. Zones are now better connected on complex maps. 2016-07-11 15:44:24 +02:00
DjWarmonger
c3cbe89e2a Last improvement: attract zones and push them bakc in separate steps. 2016-07-10 18:16:32 +02:00
DjWarmonger
87ef3701aa Probably better fitness function. 2016-07-10 16:37:54 +02:00
DjWarmonger
fb3adf762a Improved zone placer - zones on different levels are allowed to overlap completely. 2016-07-10 13:32:33 +02:00
Ivan Savenko
c3ce4b25df Removed all #include's of CMap.h from headers.
To all - please, avoid #include's in headers as much as possible
This kills incremental build compile times
2015-12-02 21:05:10 +02:00
DjWarmonger
0acae7a708 Additional adjustment of zone positions to ensure balanced zone sizes. 2015-01-16 19:28:27 +01:00
DjWarmonger
75d407b59a Last improvements - zones on simpler maps should not be smashed. 2014-12-23 18:16:53 +01:00
DjWarmonger
53b3ea8d97 Final update for zone placer. 2014-12-23 14:26:14 +01:00
DjWarmonger
0dbfee0edb Final shape of algorithm 2014-12-23 13:49:07 +01:00
DjWarmonger
990e38e961 Fixes for placement. 2014-12-23 12:42:59 +01:00
DjWarmonger
868d2f61ee New zone placement algorithm 2014-12-23 11:39:41 +01:00
DjWarmonger
0e34775770 Important fix. 2014-12-23 10:42:01 +01:00
DjWarmonger
875bfb025e Better fitness function(s) 2014-12-22 23:35:19 +01:00
DjWarmonger
b52eeb2263 Remember "best" placement at right moment. 2014-12-22 21:47:19 +01:00
DjWarmonger
067b56dda4 Zone placer will remember the best solution, not the last generated. 2014-12-22 21:33:37 +01:00
DjWarmonger
d280b0ac9f Cleaned some logs. 2014-11-01 09:52:56 +01:00
DjWarmonger
b61b79b458 For 0.97 release: generate full underground to avoid many issues 2014-10-31 18:47:10 +01:00
DjWarmonger
dd0033b5a4 Zones will now not bounce off map edges too much, should allow more space in the middle of a map. 2014-10-31 17:55:47 +01:00
DjWarmonger
afaf74a05b Improved zone sizes for two-level maps. 2014-10-31 13:37:23 +01:00
DjWarmonger
7ac3713d32 Significantly improved zone graph placement. 2014-10-31 12:58:55 +01:00
beegee1
c1ac95b288 - fixed Clang compiler warnings 2014-08-04 20:36:00 +02:00
DjWarmonger
3acbda75ef Restored old function signature for sanity. 2014-07-27 13:59:53 +02:00
DjWarmonger
b99d6f862d Improved gravity algorithm. Now zones will start as small and inflate until they fill the map. 2014-07-26 10:02:33 +02:00
DjWarmonger
866cd6f540 Allow underground zones to connect more easily. Regression: Obstacles spawn at zone boundaries. 2014-07-07 18:01:15 +02:00
DjWarmonger
f3ccdc8a21 Even distribution for surface / underground zones. 2014-07-06 10:43:30 +02:00
DjWarmonger
9cfbbb2048 Merge underground maps with develop. There is a serious issue with rendering rock tiles, which may cause crash. 2014-07-05 15:22:53 +02:00
DjWarmonger
05c2a4e716 Better gravity-based algorithm. 2014-07-04 11:51:28 +02:00
DjWarmonger
d4d3f1a568 More tweaks. 2014-07-04 09:54:55 +02:00
DjWarmonger
d118fbffe8 Correct placement of subterranean gates. 2014-07-03 17:24:28 +02:00
DjWarmonger
60a5c764b8 Correct zone placement & sizing for underground maps. 2014-07-03 12:28:51 +02:00
DjWarmonger
37463a3e45 Zone position will be moved to its center of mass. 2014-06-01 21:01:18 +02:00
DjWarmonger
690f4a650a Even better zone shapes. 2014-05-28 21:11:10 +02:00
DjWarmonger
c627aa608a Merge branch 'develop' of https://github.com/vcmi/vcmi into RMG 2014-05-28 19:34:12 +02:00
DjWarmonger
8f033a7834 Golden ratio for smoother zone shapes. 2014-05-25 13:30:47 +02:00
AlexVinS
c40c79fa94 Make gcc happy 2014-05-25 13:02:15 +04:00
DjWarmonger
69457dbd75 - Implemented some really nice gravity-based algorithm
- Fixed zones placed outside the map (causing various bugs)
2014-05-25 06:20:02 +02:00
DjWarmonger
b9de3875d9 - Attempt to move zones away from map boundaries
- Tweaking algorithm parameters
- Refactorings
2014-05-24 18:39:58 +02:00
DjWarmonger
d2fd71d087 Zone shapes & terrains work nicely. 2014-05-24 14:06:08 +02:00
DjWarmonger
27dcf70b1a Randomized center positions of zones. 2014-05-24 12:42:06 +02:00
beegee1
39d3102905 - Fixed compilation errors on clang
- Removed compiler warnings of unused variables
2013-11-16 09:17:19 +00:00
beegee1
a13d72b636 - Fixed GCC warning
- Small refactoring
- Added RPM spec to SVN again (it's better to keep it there :) )
2013-08-19 18:20:11 +00:00
beegee1
1ac328635a - Added handler classes CRmgTemplateStorage and CTerrainViewPatternConfig to LibClasses
- Re-organized CMapGenerator
- Created CZone and CTemplate objects in the heap and used pointers
- Added stub classes CZoneGraphGenerator and CZonePlacer (include warnings of unused variables, please ignore them)
- Fixed CRandomGenerator bug that always the same number was produced
- Better structure of Visual Studio project files with using filters
- Updated project files (VS, CMake)
- Excluded compiler warning mismatched-tags (false positive)
- Fixed a bug when compiling with unit tests enabled
2013-08-17 12:46:48 +00:00