104 Commits

Author SHA1 Message Date
ShnitzelX2 9f04352004 remove obsolete DEFAULT_REGION external option
remove overmapbuffer::get_default_settings()
2026-09-14 13:21:19 -04:00
Matthew Richmond 9020833ece Stabilize test state resets and highway debug logging (#88577)
* Stabilize test state resets and highway debug logging

* tests: widen melee damage tolerance

* ci: retry overmap coverage

* ci: retry shader compile
2026-09-08 15:08:34 +02:00
Maleclypse 92d96df1ce Update overmap_test.cpp (#88532) 2026-09-07 18:22:16 -04:00
RenechCDDA da2aaffffd Add quick setup option to clear map 2026-06-22 15:07:51 -04:00
dumb-kevin ce95db8a8d Call Item_factory::find statically in overmap_test
- replace item_controller->find with Item_factory::find at three call sites
- silences readability-static-accessed-through-instance
2026-05-09 10:02:29 +04:00
thaelina a8dd97e8f6 Moved MEGACITY, CITY_SIZE, and CITY_SPACING options into city_settings object for region_settings to control 2026-03-24 02:03:59 -05:00
dumb-kevin f3e7aecf3e Add filtered generation attempt for unobserved terrains
After normal generation attempts, if terrains are still unobserved, run
one more attempt with a custom overmap_special_batch containing only the
specials that produce those terrains. With other specials removed from
contention, remaining ones get all 144 sectors to themselves.

Adds get_terrain_type_ids() accessor on overmap_special to support
building the terrain-to-special reverse map needed for this.
2026-03-21 19:37:44 +04:00
dumb-kevin af91c0bfcd Fix crash from uninitialized highway connections on overmap scroll
Default highway_connections to invalid instead of zero. Treat zero and
invalid neighbor connections as missing data and drop the connection
rather than firing debugmsg (which crashes imgui mid-render).
2026-03-18 12:48:27 +04:00
dumb-kevin 6be607e377 Skip redundant overmap generation when all terrains found
Build a set of expected terrain types before generation and
erase entries as they are observed. When the set empties, skip
remaining attempts. Saves up to 2/3 of generation time on
seeds where all terrains appear early.

Also simplifies the post-generation missing-terrain check by
reusing the pre-built set instead of recomputing it.
2026-03-15 10:47:13 +04:00
dumb-kevin 38afd0aa9b Add overmap generation determinism test
Generates a 2x2 cluster of overmaps three times from the same RNG
state and verifies tile-for-tile identity.
2026-02-27 14:42:05 +04:00
thaelina 1cc10ca876 Update tests for upcoming old lab removals (#85246) 2026-02-11 16:48:39 +01:00
salartarium 2dd7e400fa Merge pull request #85034 from salartarium/patches
Fix typos in code and comments
2026-01-30 21:50:41 -06:00
carambola 6f9373a80c Add tests for overmap flag string consistency and location flags (#84424)
* 在 item_pocket 测试里补了多弹种的 ammo_restriction 覆盖,
并验证弹匣不能混装不同弹种

* 把 ammo_test_45 改成了 ammo_45 并同步替换所有引用,
符合 clang-tidy 的命名规则。

* 已调整顺序:ammo_45 现在在 ammo_test_9mm 前面,满足排序规则

* Update item_pocket_test.cpp

* Update item_pocket_test.cpp

* Update item_pocket_test.cpp

* 新增 overmap 旗标与 JSON 一致性相关测试
2026-01-05 22:55:09 -06:00
ShnitzelX2 247ee14986 move highway intersection grid into a generic class
moves highway grid settings to external options because they aren't supported per-region
2025-12-01 00:03:40 -05:00
ShnitzelX2 7a8a02708e Implement new region settings (#83033)
* set default region external options

* remove highways in aftershock, isolation-protocol

neither mod should have them, aftershock because of intersection generation over ravines

* region settings c++: replace old classes/structs with new

* add finalization for weather_generator
2025-09-30 08:22:47 +02:00
Kevin Granade 9c88bc85dc Replace placeholder map_data_summaries with real data as needed
Marks submaps when they are edited outside of mapgen

Upon unloading marked submaps from the reality bubble,

write their data to a corresponding map_data_summary.
2025-09-27 15:30:05 -07:00
ShnitzelX2 f7d7d46d0e highway bugfixes and improvements
- road maps reveal highways
- highways will not end within one intersection
- bends will not egregiously overlap intersections in tight overmap corners
- fallback 4-way intersection
2025-07-11 15:17:29 -04:00
ShnitzelX2 3f33ee082a Highways, JSON portion (#81550)
* PERPENDICULAR_CROSSING flag for roads

forces any connection to be non-parallel

* highway mapgen

* highway omt/specials

* highway map settings

* highway mods data

* highway docs

* Update overmap_terrain_coverage_whitelist.json

* OMT coverage test ignores highways

* regional settings cpp

* oter_travel_cost_type highway
2025-07-04 11:57:35 +02:00
Procyonae 8205c72435 Allow city specials to use OVERMAP_UNIQUE (#81017)
* Allow city specials to use OVERMAP_UNIQUE

* Add an extra clear in a funky test

* Remove test_anthill from mutable_overmap_placement bc it expects it to be placed 51+ times on one overmap despite having OVERMAP_UNIQUE?
2025-06-07 20:31:38 -05:00
moxian 7a3ef1495b Aggressively whitelist terrain for overmap_terrain_coverage test (#79711)
* Aggressively whitelist terrain for overmap_terrain_coverage test

* clang-tidy
2025-02-18 12:38:55 +01:00
moxian c44d65a8ae Run IWYU again to pick up the changes 2025-02-11 13:02:19 -08:00
moxian e2f7aaf95f Modernize c headers (stddef.h -> cstddef &co)
Code size:
includes:
$ cat obj/tiles/*.inc | wc
 278247  556494 17375710
$ cat tests/obj/tiles/*.inc | wc
 163745  327490 10307041

post-processed source (clang -E):
./make_preproc.sh src/
65903054 170378741 2049783477
./make_preproc.sh tests/
38434408 100326802 1215849078
2025-02-10 13:56:09 -08:00
moxian 2ee44002fd Mechanically IWYU the tests
python3 ~/github/include-what-you-use/iwyu_tool.py -j5 -p build $( find
src/ tests/ -maxdepth 1 -name '*.cpp' | grep -v -f
tools/iwyu/bad_files.txt )  --  -Xiwyu --comment_style=long -Xiwyu -
-max_line_length=1000 -Xiwyu --cxx17ns -Xiwyu
--mapping_file=../tools/iwyu/cata.imp   | tee out/iwyu/f-a-01.txt >
/dev/null

followed by

cat out/iwyu/f-a-02.txt | python3
~/github/include-what-you-use/fix_includes.py --reorder --nosafe_headers

followed by manual fixups of <stddef.h> -> <cstddef> and similar.

tests/generic_factory_test.cpp gets mangled very badly (IWYU bug) so
it's excluded from the list.

Code size:
includes:
$ cat obj/tiles/*.inc | wc
 288068  576136 17898260
$ cat tests/obj/tiles/*.inc | wc
 167044  334088 10465766

post-processed source (clang -E):
./make_preproc.sh src/
68567896 177775140 2134075721
./make_preproc.sh tests/
39341957 102891720 1243323710
2025-02-10 00:46:57 -08:00
Clarence "Sparr" Risher 8b27b967ae Replace point constants with static class members 2024-11-26 10:14:26 -05:00
PatrikLundell 73ab67b220 rebase 2024-11-22 13:33:49 +01:00
PatrikLundell e7d5faa494 Silenced compiler warnings 2024-11-08 14:52:17 +01:00
PatrikLundell 8f19d8e971 typified map.h + dependents, end of first pass (#76888) 2024-10-07 13:23:18 -07:00
Maleclypse f5f95564b2 Merge pull request #74169 from PatrikLundell/3D_mapgen
3D mapgen
2024-06-19 12:16:13 -05:00
Procyonae 59b112ecae Add a variety of marine plants (#74271)
* Add a variety of marine plants #71844

* Ocean bed tweak

* Kelp forest mutable

* Kelp patch extra

* Coverage test blacklist

* Fix accidently using an outdated version of the ocean bed rates

* Realised it should probably be a regional furniture but until #73602 is done that'd be a pain

* Update coverage test message to reflect JSONification of whitelist

* Identical str and str_pl -> str_sp

* Temporarily disable OCEAN omts counting as missing for overmap_coverage_test

---------

Co-authored-by: fairyarmadillo <94415528+fairyarmadillo@users.noreply.github.com>
2024-06-07 15:08:15 -05:00
PatrikLundell e6c5d7716a Added cleanup for unsaved submaps 2024-06-06 11:20:12 +02:00
PatrikLundell fd8941a7b0 missed the changed test file 2024-05-30 16:59:00 +02:00
Kevin Granade cd16df06de Adjust the overmap test to remove some failure modes and make it more robust 2024-04-27 23:51:37 -07:00
Kevin Granade c6baa453b0 Item demographics test and gun appearance rate rebalancing. (#73037)
* Labpocalypse Now, remove and reduce a bunch of legacy lab spawns

* Massive overhaul of overmap generation test to add item demographics analysis

* Uniqueify some exodii spawns that were way too common

* Dial down microlab occurrence rates

* Tune up some misc oter type and extra spawn ratios

* Overhaul core gun spawning item groups

* Extensive tweaks to gun spawns in various mapgen
2024-04-21 22:25:23 -05:00
Kevin Granade f4fcb89370 Refactor overmap test so it can run repeatedly in the same area.
This allows us to get enough samples within an area small enough to not break because of the distance from origin based overmap generation adjustments.
2024-03-22 17:51:53 -07:00
PatrikLundell f7e64c68d6 Made tinymap load take a tripoint_abs_omt parameter instead of untyped tripoint (#72145)
* Made tinymap load use omt coordinates (and thus alignment)
2024-03-19 19:32:24 -07:00
Binrui Dong a0e437066d JSONize overmap_terrain_coverage test whitelist 2024-02-02 10:23:57 +08:00
Procyonae 013c2d51e4 Couple of mapgen CI fail fixes (#71383)
* Update bridges.json

* Update overmap_test.cpp
2024-02-01 10:29:12 -06:00
I-am-Erk fed496b68b Adds an ocean. (#70070)
* Update overmap.cpp

* Update overmap.cpp

* Adds freshwater "ocean".

* Do it properly, fine.

* oh copy paste, you fickle minx.

* Update overmap.cpp

* Update lake.json

* remove outdated test line

* fix compiler errors

* typo

* add to mods

* fix freshwater beaches

still no sand :(

* adjust tests, hopefully stop them failing

Also tweaks an urbanosity error I noticed during bug testing

* Update tests/overmap_test.cpp

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update overmap_test.cpp

* Update overmap_test.cpp

* I just want the tests to pass. Pass, tests

* Update overmap_test.cpp

* remove override fix since it caused an error I am tired

* Update data/json/furniture_and_terrain/terrain-liquids.json

Co-authored-by: Procyonae <45432782+Procyonae@users.noreply.github.com>

* Update overmap_test.cpp

alphabetize

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Procyonae <45432782+Procyonae@users.noreply.github.com>
2023-12-10 12:15:23 -06:00
LISPCoC 6d53c72128 add _bandit_drug_lab 2023-10-31 18:33:50 +09:00
chichit1044 9f910f0d6d Vitrification (#66917)
* Add files via upload

Vitrifaction event alpha. Currently doesn't spawn in overmap generation. To test, spawn overmap special "quiet_farm" and enter either of the overmap tiles by crossing the boundary on foot.

TODO:

-set multiple spawn locations for glass totems
-adjust light levels
-create more welcoming terrain (i.e. allow a clear path with no more than one point of passing over glass grass)
-palatteswap at least one set of tileset sprites to make it less visually garbage

* Rename vitrified_snippets.json to data/json/vitrifaction/vitrified_snippets.json

* Rename vitrified_items.json to data/json/vitrifaction/vitrified_items.json

* Rename vitrified_farm_palatte.json to data/json/vitrifaction/vitrified_farm_palatte.json

* Rename vitrified_farm .json to data/json/vitrifaction /vitrified_farm .json

* Rename vitrifaction_effects.json to data/json/vitrifaction /vitrifaction_effects.json

* Rename vitrifaction_effect_on_condition.json to data/json/vitrifaction /vitrifaction_effect_on_condition.json

* Rename overmap_vitrified_terrain.json to data/json/vitrifaction /overmap_vitrified_terrain.json

* Rename overmap_vitrified.json to data/json/vitrifaction /overmap_vitrified.json

* Rename unvitrified_farm.json to data/json/vitrifaction /unvitrified_farm.json

* Rename terrain-vitrified.json to data/json/vitrifaction /terrain-vitrified.json

* Rename talk_vitrified.json to data/json/vitrifaction /talk_vitrified.json

* Rename furniture-vitrified.json to data/json/vitrifaction /furniture-vitrified.json

* Rename vitfrified_trait.json to data/json/vitrifaction /vitfrified_trait.json

* Rename vitrified_farm_palatte.json to vitrified_farm_palatte.json

* Rename vitrified_items.json to vitrified_items.jso

* Rename vitrified_snippets.json to vitrified_snippets.json

* Add files via upload

* Rename vitrified_items.jso to vitrified_items.json

* Delete data/json/vitrifaction  directory

* Update vitrified_items.json

* Linted

* Corrected file/folder names

* Linted vitrified_farm.json

* Update data/json/vitrification/vitrification_effect_on_condition.json

Co-authored-by: TheShadowFerret <99621099+TheShadowFerret@users.noreply.github.com>

* Update data/json/vitrification/vitrified_items.json

Co-authored-by: TheShadowFerret <99621099+TheShadowFerret@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: TheShadowFerret <99621099+TheShadowFerret@users.noreply.github.com>

* Update data/json/vitrification/furniture_vitrified.json

Co-authored-by: MNG-cataclysm <58958654+MNG-cataclysm@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: TheShadowFerret <99621099+TheShadowFerret@users.noreply.github.com>

* Update furniture_vitrified.json

* Update overmap_vitrified.json

* Update overmap_vitrified.json

* Update talk_vitrified.json

* Update terrain_vitrified.json

* Update unvitrified_farm.json

* Update vitrification_effect_on_condition.json

* Update vitrification_effects.json

* Update vitrified_farm.json

* Update vitrified_farm_palette.json

* Update vitrified_items.json

* Update vitrified_snippets.json

* Apply suggestions from code review

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: TheShadowFerret <99621099+TheShadowFerret@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* General grammar and syntax update; double spacing.

Co-authored-by: Procyonae <45432782+Procyonae@users.noreply.github.com>

* Committing suggestions. Again.

I think trying to use git browserside is its own special circle of hell.

Co-authored-by: Procyonae <45432782+Procyonae@users.noreply.github.com>

* committing suggestions again, again.

github dot com I am begging you; please just show me all the suggestions the first time.

Co-authored-by: Procyonae <45432782+Procyonae@users.noreply.github.com>

* github PLEASE

Co-authored-by: Procyonae <45432782+Procyonae@users.noreply.github.com>

* Update furniture_vitrified.json

* Update overmap_vitrified_terrain.json

* Update vitrification_effect_on_condition.json

* Update vitrification_effect_on_condition.json

* Update vitrified_farm.json

* Update vitrified_farm_palette.json

* Update vitrified_snippets.json

* Last syntax tweaks.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Made time limit a little more generous.

* Apply suggestions from code review

Co-authored-by: Procyonae <45432782+Procyonae@users.noreply.github.com>

* the last of the single spaces has been slain. finally, there can be peace.

* spawn chance and city radius tweaked

* spelling fixes

* apparently ellipses will always fail double space checks.

* double friggin' spaces. the same one, even.

* last try to make it spawn properly before I just whitelist it

* Update overmap_test.cpp

* Update tests/overmap_test.cpp

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update overmap_test.cpp

* Update overmap_test.cpp

* Update overmap_vitrified_terrain.json

* Update overmap_vitrified.json

* Update unvitrified_farm.json

* Update vitrification_effect_on_condition.json

* Update overmap_test.cpp

* Update overmap_test.cpp

* Update overmap_test.cpp

* Create modinfo.json

* Rename data/json/vitrification/furniture_vitrified.json to data/mods/chichitech/vitrification/furniture_vitrified.json

* Rename data/json/vitrification/overmap_vitrified.json to data/mods/chichitech/vitrification/overmap_vitrified.json

* Rename overmap_vitrified_terrain.json to overmap_vitrified_terrain.json

* Rename talk_vitrified.json to talk_vitrified.json

* Rename terrain_vitrified.json to terrain_vitrified.json

* Rename data/json/vitrification/unvitrified_farm.json to data/mods/chichitech/vitrification/unvitrified_farm.json

* Rename data/mods/chichitech/overmap_vitrified_terrain.json to data/mods/chichitech/vitrification/overmap_vitrified_terrain.json

* Rename data/mods/chichitech/talk_vitrified.json to data/mods/chichitech/vitrification/talk_vitrified.json

* Rename data/mods/chichitech/terrain_vitrified.json to data/mods/chichitech/vitrification/terrain_vitrified.json

* Rename data/json/vitrification/vitfrified_trait.json to data/mods/chichitech/vitrification/vitfrified_trait.json

* Rename data/json/vitrification/vitrification_effect_on_condition.json to data/mods/chichitech/vitrification/vitrification_effect_on_condition.json

* Rename data/json/vitrification/vitrification_effects.json to data/mods/chichitech/vitrification/vitrification_effects.json

* Rename data/json/vitrification/vitrified_farm.json to data/mods/chichitech/vitrification/vitrified_farm.json

* Rename data/json/vitrification/vitrified_farm_palette.json to data/mods/chichitech/vitrification/vitrified_farm_palette.json

* Rename data/json/vitrification/vitrified_items.json to data/mods/chichitech/vitrification/vitrified_items.json

* Rename data/json/vitrification/vitrified_snippets.json to data/mods/chichitech/vitrification/vitrified_snippets.json

* Update modinfo.json

* Update modinfo.json

* Update modinfo.json

* Update overmap_test.cpp

* Apply suggestions from code review

Co-authored-by: Procyonae <45432782+Procyonae@users.noreply.github.com>

* Update talk_vitrified.json

* Update talk_vitrified.json

* Update modinfo.json

* Update data/mods/chichitech/vitrification/talk_vitrified.json

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Rename data/mods/chichitech/vitrification/furniture_vitrified.json to data/json/furniture_and_terrain/furniture_vitrified.json

* Rename data/mods/chichitech/vitrification/terrain_vitrified.json to data/json/furniture_and_terrain/terrain_vitrified.json

* Rename data/mods/chichitech/vitrification/vitrification_effect_on_condition.json to data/json/vitrification_effect_on_condition.json

* Rename data/mods/chichitech/vitrification/talk_vitrified.json to data/json/talk_vitrified.json

* Rename overmap_vitrified.json to overmap_special_vitrified.json

* Rename overmap_vitrified_terrain.json to overmap_vitrified_terrain.json

* Rename unvitrified_farm.json to unvitrified_farm.json

* Rename vitrified_farm.json to vitrified_farm.json

* Rename data/mods/chichitech/vitrification/vitfrified_trait.json to data/json/mutations/vitfrified_trait.json

* Rename data/mods/chichitech/vitrification/vitrification_effects.json to data/json/vitrification_effects.json

* Rename data/mods/chichitech/vitrification/vitrified_farm_palette.json to data/json/mapgen_palettes/vitrified_farm_palette.json

* Rename data/mods/chichitech/vitrification/vitrified_items.json to data/json/items/vitrified_items.json

* Rename data/mods/chichitech/vitrification/vitrified_snippets.json to data/json/snippets/vitrified_snippets.json

* Delete data/mods/chichitech directory

* Update overmap_test.cpp

* Update vitrified_items.json

* Update overmap_test.cpp

* Apply suggestions from code review

Co-authored-by: Maleclypse <54345792+Maleclypse@users.noreply.github.com>

* Update vitrified_farm.json

---------

Co-authored-by: Procyonae <45432782+Procyonae@users.noreply.github.com>
Co-authored-by: TheShadowFerret <99621099+TheShadowFerret@users.noreply.github.com>
Co-authored-by: MNG-cataclysm <58958654+MNG-cataclysm@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Maleclypse <54345792+Maleclypse@users.noreply.github.com>
2023-07-24 23:01:54 -05:00
Maleclypse 938d39a086 Whitelist Deserter Bandit camp from overmap_test.cpp (#66320)
* Whitelist Deserter Bandit camp

* Update overmap_test.cpp

* Fix ordering

* Update overmap_test.cpp

* Update overmap_test.cpp
2023-06-22 08:32:25 -03:00
Alexey 8f13236a08 Better diagnostics for overmap_terrain_coverage test (#66306) 2023-06-20 22:51:31 -04:00
Clarence "Sparr" Risher f93cbc35a6 Refactor city.cpp/.h out of overmap.cpp/.h 2023-03-31 18:47:42 -04:00
Bence 287b22f36e Attempts to fix marina spawns (#63771)
* attempts to fix maina spawns - attempt 1

* attempt 2
2023-02-25 12:55:56 -08:00
John Bytheway 54989b8347 Flush mapbuffer in overmap_terrain_coverage (#59488)
To prevent all the test maps from consuming too much memory,
periodically flush the loaded maps to disk.
2022-07-26 00:58:49 -04:00
John Bytheway 53a6cd9050 Apply auto transformations
Use the new clang-tidy check to replace all the auto variable types with
explicit types (where it makes sense to do so).
2022-07-01 07:11:27 -04:00
David Seguin 7f135269c2 Add gas station roof OMTs to test whitelist (#58442) 2022-06-17 07:53:10 -07:00
David Seguin 8b9d421c7f Add new marina roof OMTs to test whitelist (#57663) 2022-05-16 12:14:12 -03:00
Eric c3cf86e22a Update overmap_test.cpp (#57127) 2022-05-15 09:13:05 -07:00
Kevin Granade cb11ca5e3a Merge pull request #53913 from jbytheway/reeneable_mapgen_test
Reeneable mapgen test
2022-01-04 07:00:00 -08:00