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

674 Commits

Author SHA1 Message Date
Ivan Savenko
4260726e4b Provide encoding information to maps & campaigns loaders 2023-03-05 17:39:27 +02:00
Konstantin
7bfb37df4d vcmi: modernize lib/rmg 2023-02-14 02:50:39 +03:00
Konstantin
0627e1ecaa vcmi: remove unused variables from lib/rmg 2023-02-12 19:11:24 +03:00
Konstantin
cf56f7ccce vcmi: remove unused-but-set-variables 2023-01-26 23:49:00 +03:00
Ivan Savenko
47c1803c42 Finalization of refactoring:
- Entity interface now has getNameTranslated & getNameTextID methods
- Entity interface no longer has getName method
- removed (most) usages of normalizeIndentifier workaround method
- all moddable objects have identifier in form of mod:name
- all moddable object register strings in form of mod.type.name
2023-01-20 15:18:36 +02:00
Ivan Savenko
05a1d7c6e3 All text for factions/towns/building are passed through translator 2023-01-20 15:18:36 +02:00
Ivan Savenko
388ed88b5d All artifact strings now pass through translator 2023-01-20 15:18:36 +02:00
Ivan Savenko
707de75ac0 Cleared up formatting 2023-01-17 22:58:22 +02:00
Ivan Savenko
e48bd39b9c Moved road & river handlers into a separate file 2023-01-11 15:17:24 +02:00
Ivan Savenko
1e37e66e6c Replaced Terrain::BORDER and WRONG with NONE 2023-01-10 20:09:09 +02:00
Ivan Savenko
8c2b1d74be Removed unused code 2023-01-10 20:07:22 +02:00
Ivan Savenko
4f3ea0d1d9 Renamed Terrain.h/cpp -> TerrainHandler.h/cpp 2023-01-10 00:01:35 +02:00
Ivan Savenko
f51b3bca57 use JsonKey or NameTranslated instead of ambiguos Name 2023-01-10 00:01:35 +02:00
Ivan Savenko
7c7ae26e67 Map/Road/River identifiers are now private members 2023-01-10 00:01:35 +02:00
Ivan Savenko
64885bdf6b Better names for terrain parameters. Support for new movement sounds. 2023-01-10 00:01:35 +02:00
Ivan Savenko
2de3178158 Fixed game startup 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
Ivan Savenko
7a35bcc812
Merge pull request #1221 from IvanSavenko/warnings_fix
Fix remaining compiler warnings
2022-12-29 21:51:55 +02:00
Nordsoft91
785787e454
Merge branch 'develop' into interface-builder 2022-12-24 21:56:29 +04:00
Ivan Savenko
eb20a4b208 Merge remote-tracking branch 'vcmi/develop' into warnings_fix 2022-12-23 14:40:45 +02:00
nordsoft
b1f2c7aed4 Team alignments implemented 2022-12-17 08:19:16 +04:00
nordsoft
d93e844609 Use roads names instead of their filenames 2022-12-17 04:54:01 +04:00
nordsoft
f27a40dd34 Support roads and teams customization in engine 2022-12-17 03:52:40 +04:00
nordsoft
fc7f1dbc5a Fix template selection 2022-12-14 05:23:21 +04:00
nordsoft
53b2f68560 Serialize template 2022-12-14 04:37:11 +04:00
Ivan Savenko
db2a40600d Fixed some of the warnings detected by CI run 2022-12-08 23:20:42 +02:00
Ivan Savenko
fb6b3c31e8 Renamed UNUSED -> MAYBE_UNUSED macro to match c++17 attribute name 2022-12-07 18:06:47 +02:00
Ivan Savenko
3219e322ae Fixed all non-silenced gcc/clang warnings 2022-12-07 18:05:47 +02:00
Andrii Danylchenko
89f0cc66e8
Merge pull request #1213 from IvanSavenko/clone_fix
Fix crash on casting clone on modded creature
2022-12-07 17:34:52 +02:00
Ivan Savenko
2cbe6bcb47 Added common method to get names of hardcoded mod scopes 2022-12-07 15:18:19 +02:00
nordsoft
5d1b5b6c9c Throw an exception if empty zone is generated 2022-12-06 15:07:16 +04:00
nordsoft
625c18a889 Fix #3234 2022-11-18 04:05:35 +04:00
nordsoft
d5403d3eb9 Merge remote-tracking branch 'upstream/develop' into cpp-map-editor 2022-10-17 01:39:11 +04:00
nordsoft
4cb31ea912 Merge remote-tracking branch 'upstream/develop' into cpp-map-editor 2022-10-08 23:24:57 +04:00
Tomasz Zieliński
8c481dff46 Fix incorrect templates for mines in HoTA 2022-10-08 12:42:10 +03:00
Andrey Filipenkov
aa217236b3 check amount of artifacts on hero when checking requirements of a quest that requires artifact(s)
fixes case when 2 or more identical artifacts are required
2022-10-01 09:28:32 +03:00
Tomasz Zieliński
127d7ec40b Fixed asserts (only for debug build) 2022-09-29 21:10:44 +02:00
Tomasz Zieliński
20c102e648 Remove T prefix from new typedefs 2022-09-29 11:44:46 +02: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
f804f8a326 Store RiverType by value, handle by reference 2022-09-26 09:51:36 +02:00
Tomasz Zieliński
2bd30556a3 Store TerrainType by havlue and handle by reference 2022-09-26 09:17:55 +02:00
Tomasz Zieliński
4ea57ea7fc A variety of suggested style tweaks 2022-09-25 09:33:56 +02:00
nordsoft
d32898b39b Merge remote-tracking branch 'upstream/develop' into cpp-map-editor
# Conflicts:
#	CMakeLists.txt
2022-09-25 00:58:43 +04: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
0b56778e00 Fix for compatibility in rewrite 2022-09-23 20:01:54 +02:00
Tomasz Zieliński
a5077245a8 Merge remote-tracking branch 'origin/develop' into terrain-rewrite
# Conflicts:
#	lib/Terrain.cpp
#	lib/Terrain.h
2022-09-23 20:01:13 +02:00
Tomasz Zieliński
ebe45d512d Moved roads and rivers to TerrainTypeHandler, by analogy to TerrainType. 2022-09-23 16:24:01 +02: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
nordsoft
89d0de53da Merge remote-tracking branch 'upstream/develop' into features/cpp-map-editor
# Conflicts:
#	.github/workflows/github.yml
#	launcher/modManager/cmodlist.cpp
#	lib/CModHandler.cpp
#	lib/CModHandler.h
2022-09-22 17:09:47 +04:00
Andrii Danylchenko
b4d3445559
Merge pull request #971 from kambala-decapitator/fix-warnings
Fix most project warnings
2022-09-22 16:05:32 +03:00
Andrii Danylchenko
3d3c513603
Merge pull request #929 from Nordsoft91/branch-merge-versioning
Mods versioning [part 3]
2022-09-22 14:56:20 +03:00
Andrey Filipenkov
c9c79887a7 remove unused variables 2022-09-22 11:54:10 +03:00
Tomasz Zieliński
494b0f0226 First version that compiles 2022-09-21 11:34:23 +02:00
Tomasz Zieliński
b20f649521 stash 2022-09-19 16:13:58 +02:00
nordsoft
c348c1a053 Revert "Load template name from user settings"
This reverts commit 73cc606ee2.

# Conflicts:
#	lib/rmg/CRmgTemplateStorage.cpp
#	lib/rmg/CRmgTemplateStorage.h
#	mapeditor/windownewmap.cpp
2022-09-19 02:46:01 +04:00
Nordsoft91
60264aae29
Apply suggestions from code review
Co-authored-by: Andrey Filipenkov <decapitator@ukr.net>
2022-09-19 01:18:17 +04: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
nordsoft
1b6f4a5cf3 Rebase on develop 2022-09-17 17:43:59 +04:00
Nordsoft91
e4ac0d4370
Editor prerequisites [part 2] (#889) 2022-09-17 14:04:01 +03:00
DjWarmonger
3d2dc2335b Switch ObjectTemplate to shared_ptr<const> (#870) 2022-09-11 16:13:53 +03:00
nordsoft
cf9314507b Fix crash in rmg 2022-09-11 11:31:27 +03:00
DjWarmonger
f81d869b4a Mine roads (#808)
* Create dirt roads to mines if there are no roads in a zone.
2022-09-11 11:31:27 +03:00
nordsoft
670bca2fdb Randomly shuffle required objects to avoid patterns 2022-09-11 11:31:27 +03:00
Nordsoft91
8f0dcf928c Fix problems with water zone (#784) 2022-09-11 11:31:27 +03:00
Nordsoft91
e028875fe3 Fix RMG bug with incorrect town placement (#779)
* Fix RMG bug with incorrect town placement
* Readability tweak
2022-09-11 11:31:27 +03:00
Nordsoft91
454889598f Improve treasure placement logic (#775)
Improve treasure placement logic (#775)
2022-09-11 11:31:27 +03:00
Nordsoft91
1451385a9b Fix problem with empty areas (#772)
* Fixes for obstacles and treasures
2022-09-11 11:31:27 +03:00
Nordsoft91
2edf9ef3a4 Fix for sealed-off treasures (#771)
Fix for sealer-off treasures
2022-09-11 11:31:27 +03:00
Nordsoft91
4bd0ff680a Random map generator refactoring (#762)
random map generator refactoring and improvements
2022-09-11 11:31:27 +03:00
Andrii Danylchenko
4b4cc3cf4b battlefields in VLC and custom bonuses for terrain patches 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
5054ee011a Rmg water support (#751)
* Roads added to shipyard
* Load general rmg parameters from config
* Fix issue with default zone guard
* Move magic numbers related to balance to randomMap.json
2022-06-11 18:40:24 +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
Nordsoft91
a8265c7052
[0002285] Implement feature with extra resources near mines (#742)
* RMG: clear start position
* [0002285] some heaps of resources are placed nearby mines
* Fix leak in case of inability to place resource
* Fix indentation according to vcmi style
* Add constant for random amount of resources
* Code review fixes
2022-05-23 13:08:36 +03:00
Konstantin
c6b198ce14
Warning fix (I moved C++17 and CI to another branch) (#739)
* clang warning fixes
* use CMake 3.10 due to MXE CI does not have 3.13 yet

Co-authored-by: Konstantin <rilian@niisi.ras.ru>
2022-05-19 15:14:50 +03:00
Andrii Danylchenko
8b11b42aaf Fix RMG to place special dwellings like elemental conflux 2022-04-09 10:57:24 +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
Dmitry Orlov
55b3f0b24c Fix: Map objects sometimes do not increment primary skills for some heroes 2021-02-13 00:24:14 +03:00
Dmitry Orlov
3cb0dfb143 Fix: RMG issues: 1) hota 2) assertions 2020-10-25 01:03:32 +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
laikh
edc1d06f4e Random Map Generator Option: Allow having more computer only players than human/computer players
Remove unused variable humanPlayersCount and function getHumanOnlyPlayerCount()
2020-07-07 19:45:53 +08:00
Michał Kalinowski
ac6b477aa2 Simplify statements
-Simplify return statements across the code
2019-03-31 09:43:14 +03:00
Alexander Shishkin
b00e935e4d
Warnings fixes (#538)
Warnings fixes
* Suppress `missing-braces` for Clang
* Fixed many C4275 warnings
* Fixed almost all Clang/GCC warnings
* Silence most frequent MSVC warning.
* Fixed some pessimizing-move warnings
* Fixed some unused capture warnings
2019-01-19 13:52:02 +03:00
Michał Janiszewski
7be9aa4868 Prevent shadowing of function arguments by local vars 2018-10-29 16:56:14 +01:00
Alexander Shishkin
f563712782
fix formatting
Co-Authored-By: godric3 <godric3@users.noreply.github.com>
2018-10-28 16:36:11 +01:00
godric3
7ded9dbda8 Fix crash when generating random map with random number of players 2018-10-27 18:18:08 +02:00
DJWarmonger
273802c92c I have no idea what I'm doing 2018-07-26 12:14:29 +02:00
Johannes 'josch' Schauer
95bec98936
lib/rmg/CRmgTemplateZone.cpp: Remove a variable that was introduced in 2016 but never used 2018-04-19 15:07:21 +02:00
Johannes 'josch' Schauer
56fefca806
lib/rmg/CRmgTemplateZone.cpp: Add parenthesis to make operator precedence unambiguous 2018-04-19 15:06:26 +02:00
Arseniy Shestakov
ac66fc7f42 Full rework of pre-game interface and networking
New features for players:
* Loading for multiplayer. Any save could be used for multiplayer.
* Restart for multiplayer. All clients will restart together.
* Loading from single save.
* Hotseat mixed with network game. Multiple players per client.
* Now connection to server could be cancelled.
* Return to menu on disconnections instead of crashes.
* Restoring of last selected map, save or campaign on next run.

TLDR on important changes in engine code:
* UI: work with server separated from UI
* UI: all explitic blitting replaced with IntObject's
* UI: all new code use smart pointers instead of DISPOSE
* Gameplay always start through lobby controlled by server.
* Threads receiving netpacks now shared for lobby and gameplay.
* Campaigns: heroes for crossover now serialized as JsonNode.
2018-04-04 14:24:26 +07:00
AlexVinS
9d108d59db Redone RMG template serialization using JSON serializer, added tests 2018-03-10 19:36:19 +03:00
AlexVinS
26aad17295 Actually copy zone data from map generator template
* fixes https://bugs.vcmi.eu/view.php?id=2482
2018-03-05 17:05:48 +03:00
Nikolay Shalakin
3795985de9 Eliminate warnings / errors. Pull request #388 2018-02-11 15:17:14 +03:00
Michał Kalinowski
26a222ac62 Change JsonType to enum class (#393)
Change enum JsonType to enum class JsonType
2017-11-27 00:18:18 +03:00
DJWarmonger
8f42cdea67 Refactoring: use private pointer to CMapGenerator 2017-11-03 21:03:51 +01:00
AlexVinS
0868164147 (int) -> static_cast<int> 2017-08-12 15:43:41 +03: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
ArseniyShestakov
9d9c026c85 Code style: serialize everything on own lines for easier debugging (#357) 2017-07-31 16:35:42 +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
ArseniyShestakov
a4c0ad94b1 Code style: remove default value hints in definitions (#342)
Some are outdated and this is something IDE are useful for.
2017-07-15 14:08:20 +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
Arseniy Shestakov
dbcd79c48a Code cleanup: remove double and unneded semicolons 2017-07-12 22:01:10 +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
DJWarmonger
346d2ac588 Possible fix for #2681. 2017-05-27 14:57:45 +02:00
AlexVinS
a85b4cf2a5 * WIP on event condition format
* Hero portrait serialization
* Fix town spells serialization

* Added support for float exponential part in Json
* Added support for int64 in Json
* Added basic Hero definitions serialization
* Added rumors serialization
* Advanced player info serialization.
* Added Disposed heroes serialization, (!) not covered with tests yet
* Added Local event serialization
* Added Pandoras box serialization
* Added Seer hut reward serialization
* Added CQuest serialization
* Added API for map object instance names serialization.
* Added random dwelling options serialization
* Advanced town options serialization
* Advanced hero options serialization
* More map format tests
* A lot of fixes, cleanup and refactoring
2017-05-27 00:23:19 +03:00
DjWarmonger
73c62f1b4c Restore cut ring around main town. 2016-12-21 22:23:55 +01:00
DjWarmonger
4b3a878c00 Fix for passability. 2016-12-21 13:37:19 +01:00
DjWarmonger
a0596ebecf Add clearance under town to ensure passability. 2016-12-21 10:43:24 +01:00
DjWarmonger
cc452bdfa9 Improved road routing so they can go under any passable object. 2016-12-21 10:10:37 +01:00
DjWarmonger
f78b524731 - Remove obstacle in front of player-owned towns
- Allow obstacles to touch town object
2016-12-20 15:23:47 +01:00
DjWarmonger
e37c35e439 Zone guard will cause object be placed as far away from it as possible in both zones. 2016-12-20 11:58:39 +01:00
DjWarmonger
ee3aec55f2 Correct implementations of A* algorithm. Seemingly fixes #2496, it's also faster. 2016-12-15 16:29:23 +01:00
DjWarmonger
63d33a1e7c Extract priority queue construction for reuse. 2016-12-15 12:58:16 +01:00
DjWarmonger
4102546977 Corrected road generation - they will be straight whenever possible. 2016-12-15 12:36:47 +01: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
AlexVinS
5a3854a8de Fixed CID 1288852, CID 1243202 2016-11-25 16:51:31 +03:00
AlexVinS
db40e125eb Fixed CID 1243181, CID 1197449, CID 1366374, CID 1366377, CID 1366359 2016-11-24 21:56:30 +03:00
dydzio
5c07e1c432 Minor typo fixes 2016-11-10 11:51:47 +01:00
Vadim Markovtsev
c696746017 Fix some compilation warnings 2016-10-28 08:07:05 +02:00
AlexVinS
42e7128acc Fixed possible use-after-free crash with artifacts registration in RMG. 2016-09-08 14:48:48 +03:00
AlexVinS
6dc47a2de0 Fixed use-after-free crash with quests registration in RMG.
* code taken from PR #200
2016-09-08 14:48:46 +03:00
Arseniy Shestakov
452e28d183 Remove some useless includes found by cppclean
This of course was tested and shouldn't break anything
2016-08-26 04:42:16 +03:00
DjWarmonger
dea39b8497 Complete solution for Subterranean Gate placement. 2016-08-15 21:37:38 +02:00
DjWarmonger
7600f8cf08 Quick fix - stop spawning Subterranean Gates at the edge of the map. 2016-08-14 08:36:15 +02:00
DjWarmonger
f995756973 First part of Subterranean Gates rework. Fixes #http://bugs.vcmi.eu/view.php?id=2450 2016-08-13 19:48:44 +02:00
DjWarmonger
8186fcae99 Removed some legacy code, work in progress. 2016-08-13 12:42:45 +02:00
DjWarmonger
452027cd8d Handle ObjectInfo via pointer to avoid expensive copy. 2016-08-11 10:49:19 +02:00
DjWarmonger
2410f0af61 - WeightedRule optimization - part 1
- comments, style
2016-08-11 07:49:08 +02:00
DjWarmonger
2bffd4e5c1 Moar optimization! 2016-08-09 13:40:46 +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
08dccb4cc3 Use binary search for roulette wheel. TODO: implement in other places. 2016-08-08 22:16:31 +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
AlexVinS
57e588cba1 attempt to fix travis build 2016-07-28 13:15:19 +03:00
DjWarmonger
5a1383fea8 Correct implementation for previous fix. 2016-07-25 18:37:42 +02:00
DjWarmonger
d9556332e1 Hopefully fixed zone guards misplaced due to paths connecting at acute angles. 2016-07-24 18:15:23 +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
aecf834cc1 Fixed placing of close objects #2447. Some additional refactoring. 2016-07-12 11:42:03 +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
8ceceb897e Fixed zones falling into negative cordinates. Should fix "assert(size)" crashes. 2016-07-10 14:32:45 +02:00
DjWarmonger
fb3adf762a Improved zone placer - zones on different levels are allowed to overlap completely. 2016-07-10 13:32:33 +02:00
DjWarmonger
f139b70279 Changed Subterranean Gate placement algorithm - now they are meant to be equidistant from both zone centers. 2016-07-10 12:29:48 +02:00
DjWarmonger
a66893af28 Fixed bug with Subterranean Gates:
Failed to connect (-1,-1,-1) with center of teh zone.
2016-07-10 10:11:29 +02:00
DjWarmonger
cfacd1adc3 Random template format change:
Tempaltes now can have optional "name" parameter for different names than identifier.
2016-06-06 11:30:51 +02:00
DjWarmonger
4101cabc22 Hidden unnecessary log. 2016-06-05 10:25:52 +02:00
DjWarmonger
053b342721 Minor optimization for object selection. 2016-06-05 10:18:10 +02:00
DjWarmonger
8f1fba9551 Merge pull request #146 from vcmi/feature/VCMIMapFormat1
Ok let's try it.
2016-03-01 07:49:54 +01:00
DjWarmonger
fba1e86091 An experiment - instead of hard limit function use modulo wrap-around for zone placement. Should be more logical and give zones more space. 2016-02-23 12:11:25 +01:00
AlexVinS
150fcc9422 Merge remote-tracking branch 'remotes/origin/develop' into feature/VCMIMapFormat1 2016-02-15 13:39:00 +03:00
AlexVinS
4d9058e412 Whitespace cleanup. (No code changes.) 2016-02-15 13:34:37 +03:00
AlexVinS
800f32c4cb Fix few cases of tempOwner initialization. 2016-02-14 12:13:30 +03:00
AlexVinS
0c21efb202 Start integration of map format into engine 2016-02-09 20:20:03 +03:00
AlexVinS
a00dbd3dd1 Merge remote-tracking branch 'remotes/origin/develop' into feature/VCMIMapFormat1
Conflicts:
	lib/CMakeLists.txt
	lib/VCMI_lib.cbp
	lib/filesystem/CFileInputStream.cpp
	lib/filesystem/CZipLoader.cpp
	lib/rmg/CRmgTemplateZone.cpp
	vcmi.workspace
2016-02-08 10:17:25 +03:00
DjWarmonger
441c94d56c Remove log for Seer Huts. 2016-02-06 15:11:56 +01:00
AlexVinS
6e205a58b4 Merge remote-tracking branch 'remotes/origin/develop' into feature/VCMIMapFormat1
Conflicts:
	lib/VCMI_lib.cbp
	lib/filesystem/CZipLoader.cpp
	lib/filesystem/CZipLoader.h
	lib/mapObjects/CGTownInstance.cpp
2016-02-04 10:27:51 +03:00
DjWarmonger
327e95407e - Compile fixes part 1
- Project settings for MSVS
2016-01-27 21:08:08 +01:00
AlexVinS
89d986fc6a Merge remote-tracking branch 'remotes/origin/develop' into feature/VCMIMapFormat1
Conflicts:
	lib/CArtHandler.h
	lib/mapObjects/MiscObjects.cpp
2016-01-24 15:39:41 +03:00
DjWarmonger
ac730a591c Fixed large treasure piles sometimes being uncovered. 2016-01-13 20:03:25 +01:00
DjWarmonger
8c5f93dd8f Little refactoring for object placement. 2016-01-13 19:17:12 +01:00
DjWarmonger
dd1fc47c93 Workaround for Seer Hut offset. They seem to work fine now. 2016-01-08 21:51:55 +01:00
DjWarmonger
d840fb40eb Fixed crashes with RMG Seer Huts. Now they are functional. 2016-01-08 21:14:57 +01:00
AlexVinS
37d0dad70a Merge branch 'develop' into feature/VCMIMapFormat1
Conflicts:
	lib/CArtHandler.cpp
2016-01-01 20:28:52 +03:00
Arseniy Shestakov
9fd1cff090 Refactoring: always use std prefix for shared_ptr, unique_ptr and make_shared
Long time ago it's was used without prefix to make future switch from boost to std version easier.
I discusses this with Ivan and decide to drop these using from Global.h now.

This change wouldn't break anything because there was already code with prefix for each of three cases.
2015-12-29 05:43:33 +03:00
AlexVinS
2d5a366e6c Implemented (basic) object construction and placement
* contain refactoring of RMG and class handling (will be more)
2015-12-05 12:36:42 +03:00
Ivan Savenko
faa7cbff18 Fixed gcc/clang warnings 2015-12-04 01:17:43 +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
Ivan Savenko
f9d9a38e53 Fixed gcc warnings 2015-12-02 20:59:38 +02:00
ArseniyShestakov
2276af70dc PreGame: avoid crashing on random map options
Options is still broken, but at least we shouldn't crash there.
2015-11-25 07:25:44 +03:00
Vadim Markovtsev
e4b1ef1405 Add "override" to virtual overriden methods 2015-10-13 21:05:36 +03:00
DjWarmonger
f81b46088a Fixed #2218 2015-09-29 11:01:59 +02:00
DjWarmonger
6b45f323ea Fixed logic regression from previous commit. 2015-09-23 21:38:16 +02:00
AlexVinS
f24f744f4b Fix a few warnings 2015-08-19 23:02:37 +03:00
DjWarmonger
237d3f2624 Refactoring: random spells 2015-08-12 16:40:08 +02:00
DjWarmonger
e9654ef487 Fixed issue when player starting towns were wiped. 2015-07-18 20:14:45 +02:00
DjWarmonger
f9781ffb47 Creature abilities won't spawn in random Pandora Boxes. 2015-06-10 14:27:53 +02:00
DjWarmonger
3f1bc7e21c One more case for Subterranean Gates 2015-06-04 09:42:39 +02:00
DjWarmonger
927dfa5565 Added correct connections for Subterranean Gates 2015-06-04 09:02:56 +02:00
DjWarmonger
63d6cf168f - Solved problems with sealed-off objects for once and all.
- Refactoring
2015-06-03 21:57:22 +02:00
DjWarmonger
923437bf76 Corrected offset check for required objects. 2015-06-03 19:38:53 +02:00
DjWarmonger
55c1a7eade Clear unused tiles to make more space for roads. 2015-06-03 15:16:11 +02:00
DjWarmonger
e21b2d9cbd Attempt to use A* algorithm for required objects. 2015-06-02 20:29:37 +02:00
DjWarmonger
a68b58d969 - Use straight paths for some connections
- More fixes for template schema
2015-06-02 16:40:32 +02:00
DjWarmonger
8b1641d498 Generate main towns for zones with no player present. 2015-06-02 09:30:56 +02:00
DjWarmonger
1389ae0ea3 Fix Travis build 2015-06-02 07:01:38 +02:00
DjWarmonger
c6f714db9c Fixed generation of CPU teams. 2015-06-01 21:57:43 +02:00
DjWarmonger
34a59a2788 - Fixed issues with number of players selection
- Added new template for testing multiple players
2015-05-27 18:58:14 +02:00
DjWarmonger
6890ae9f02 - Fixed improper use of playersCount. Now RMG can generate maps up to 8 players, with CPU players only as well.
- Fixes for template scheme
2015-05-27 11:30:46 +02:00
DjWarmonger
4e25d74e74 CRmgTemplateStorage now inherits from IHandlerBase 2015-05-26 15:12:24 +02:00
DjWarmonger
e08a1f32bd Some more fixes, updated changelog. 2015-05-25 20:04:24 +02:00
DjWarmonger
c6291412d7 Fixed one case of missing roads. 2015-05-25 19:44:03 +02:00
DjWarmonger
a0ed8e0d6d An attempt to straighten roads. 2015-05-25 19:25:48 +02:00
DjWarmonger
353f6dc32e Roads are generated between all nodes. 2015-05-25 19:11:44 +02:00
DjWarmonger
3ec91c550e Correct road nodes iteration 2015-05-25 19:00:00 +02:00
DjWarmonger
fe6fa895c3 More or less working RMG roads. 2015-05-25 18:06:17 +02:00
DjWarmonger
2c88ddf5ed Something works it seems 2015-05-25 17:47:32 +02:00
DjWarmonger
6d502ef1a1 Implemented A* algorithm to draw shortest roads - but not correct roads yet. 2015-05-25 16:37:57 +02:00
AlexVinS
6448bc6a50 [gcc] fix build 2015-04-12 08:25:53 +03:00
DjWarmonger
a0840100df Different fractalization algorithm that enforces cycle generation. 2015-04-11 13:46:17 +02:00
DjWarmonger
69c58c6c25 Experiment: fractalize RMG zones before placing important objects. The downside is that it won't be possible to draw road as straight line anymore. 2015-04-11 12:47:41 +02:00
AlexVinS
84a2623c37 more experiments 2015-04-03 07:06:29 +03:00
AlexVinS
27c46c83d6 describe roads placement in log 2015-04-03 05:50:02 +03:00
AlexVinS
76193c4c5c More experiments WIP. 2015-04-03 05:47:22 +03:00
AlexVinS
eb60d9737f more sensible road placement 2015-04-03 05:47:20 +03:00
AlexVinS
4c4ad480c5 added experimental usage of roads 2015-04-03 05:47:01 +03:00
Ivan Savenko
eef45b5ae8 Fixed warnings 2015-03-31 00:55:37 +03:00
DjWarmonger
ed33d99ac7 Silenced some more logs. 2015-03-28 22:17:45 +01:00
DjWarmonger
a0f534146c Fixed underground Lava terrain. 2015-03-28 22:03:38 +01:00
DjWarmonger
999c2a92e0 Inverted approach - first generate rock all over, then free accessible tiles. 2015-03-28 21:13:22 +01:00
DjWarmonger
9515d51bd2 Generate underground tunnels first to get a bit more of them. 2015-03-28 20:09:54 +01:00
DjWarmonger
a0d9ae4849 Refactoring - create underground rock for whole level at once. 2015-03-28 18:56:28 +01:00
beegee1
e9b7044c9b Fix mantis #1859, unknown pattern in underground 2015-03-28 16:41:26 +01:00
ArseniyShestakov
783dcfea2e CMapGenOptions: fix crash when computer only limit is used
Currently when there is computer only players set resetPlayersMap may try to change settings for more than 8 players which obviously cause crash.
Now if any of "players and computer limit" or "computer limit" is set to random we automatically set total limit to 8 players.
2015-03-14 22:19:24 +03:00
DjWarmonger
a1da08f802 Disabled Seer Huts for 0.97c. 2015-03-12 10:45:24 +01:00
DjWarmonger
a832b7efee Fixed #2026 2015-03-12 10:08:10 +01:00
DjWarmonger
f894abe494 Unified interface for object template. 2015-03-12 08:31:30 +01:00
DjWarmonger
cf74969603 Fixes, logging for Seer Huts 2015-03-11 22:17:35 +01:00
DjWarmonger
61071c46e1 Fixed monster amounts in Pandora Box. 2015-03-11 19:21:58 +01:00
DjWarmonger
3cc9705bfe Minor tweak. 2015-03-11 16:54:42 +01:00
DjWarmonger
01390e0c2c Optimization for random treasures. 2015-03-11 16:19:03 +01:00
DjWarmonger
ec879046ca Merge pull request #93 from ArseniyShestakov/feature/pathfindingTeleports
Okay let's do this!
2015-03-10 09:04:25 +01:00
DjWarmonger
f32849a73e Attempt to compile refactored spells in MSVS. 2015-03-09 19:24:45 +01:00
ArseniyShestakov
c9eba40fe6 Updated CGTeleport and new CGMonolith / CGSubterraneanGate / CGWhirlpool
Now CGTeleport is not publicly available handler, but generic class for teleport channels usage.
Teleport channels are stored as part of information about the map.
2015-03-08 16:11:23 +03:00
DjWarmonger
6ace53d8b9 Functional RMG Seer Huts, still there are some mysterious bugs. 2015-03-01 13:26:54 +01:00
DjWarmonger
9453250e0f Spawn quest arts in nearby zones. 2015-03-01 10:20:49 +01:00
DjWarmonger
67ab90616d Seer Huts with exp / gold rewards. 2015-03-01 09:46:09 +01:00
DjWarmonger
dd887eb929 Fixes for Seer Huts. 2015-03-01 09:07:43 +01:00
DjWarmonger
4f1d96e5e8 Seer Huts part 2. 2015-02-28 22:37:04 +01:00
DjWarmonger
607375a9bc Generate Seer Huts with creature rewards 2015-02-28 21:14:45 +01:00
AlexVinS
685deddac1 Start spell-relatet files reorganisation
* moved existing files to separate directory
-> todo: split mechanics
2015-02-26 08:39:48 +03:00
AlexVinS
a3f2667376 Remove some deprecated fields from CSpell
* now only new SpellScholl API is used
(!) untested
2015-02-26 08:39:43 +03:00
DjWarmonger
c5e772eb78 Fixed issue which created large empty areas on two-level maps. 2015-02-25 19:34:02 +01:00
DjWarmonger
0acae7a708 Additional adjustment of zone positions to ensure balanced zone sizes. 2015-01-16 19:28:27 +01:00
DjWarmonger
ba604f4e43 Implemented "junction" zone type. 2015-01-16 17:39:16 +01:00
DjWarmonger
b7386250e9 Fixed fractalized paths inside zones. 2015-01-16 09:40:11 +01:00
DjWarmonger
fe180335de Important fix that prevents treasures from sealing off, adding too many blocked tiles. 2015-01-15 11:21:29 +01:00
DjWarmonger
9f05f53e65 Corrected monster agressiveness #2034 2015-01-10 10:23:58 +01:00
DjWarmonger
c22c3cdd80 Merge branch 'develop' of https://github.com/vcmi/vcmi into develop 2015-01-08 07:15:26 +01:00
AlexVinS
8deee7610c CMapGenerator.cpp: remove unused variables 2015-01-03 01:04:42 +03:00
DjWarmonger
7055357996 Fixed spell scroll generation #2024 2015-01-02 23:01:14 +01:00