Commit graph

22 commits

Author SHA1 Message Date
barrulus
e669549390 Fix population aggregation system to eliminate double-counting
- Fixed core issue where cells.pop and burg.population were both being counted
- Changed aggregation logic across all modules to use either burg OR cell population, never both
- If cell has burg: count only burg population (represents all people in that area)
- If cell has no burg: count only cells.pop (represents scattered population)

Files modified:
- modules/burgs-and-states.js: Fixed state population aggregation
- modules/ui/provinces-editor.js: Fixed province population aggregation
- modules/dynamic/editors/cultures-editor.js: Fixed culture population aggregation
- modules/dynamic/editors/religions-editor.js: Fixed religion population aggregation
- modules/ui/biomes-editor.js: Fixed biome population aggregation
- modules/ui/zones-editor.js: Fixed zone population calculations (2 locations)
- modules/military-generator.js: Redesigned military generation to use only burg populations

Military system changes:
- Removed rural military generation (all forces now come from settlements)
- Only burgs with 500+ people can maintain military forces
- Military strength based on actual burg population (2.5% mobilization rate)

Result: Population totals now consistent across all CSV exports (~2M total vs previous 40x discrepancy)
2025-08-13 18:54:32 +01:00
Azgaar
05de284e02
Refactor layers rendering (#1120)
* feat: render states - use global fn

* feat: render states - separate pole detection from layer render

* feat: render provinces

* chore: unify drawFillWithGap

* refactor: drawIce

* refactor: drawBorders

* refactor: drawHeightmap

* refactor: drawTemperature

* refactor: drawBiomes

* refactor: drawPrec

* refactor: drawPrecipitation

* refactor: drawPopulation

* refactor: drawCells

* refactor: geColor

* refactor: drawMarkers

* refactor: drawScaleBar

* refactor: drawScaleBar

* refactor: drawMilitary

* refactor: pump version to 1.104.00

* refactor: pump version to 1.104.00

* refactor: drawCoastline and createDefaultRuler

* refactor: drawCoastline

* refactor: Features module start

* refactor: features - define distance fields

* feat: drawFeatures

* feat: drawIce don't hide

* feat: detect coastline - fix issue with border feature

* feat: separate labels rendering from generation process

* feat: auto-update and restore layers

* refactor - change layers

* refactor - sort layers

* fix: regenerate burgs to re-render layers

* fix: getColor is not defined

* fix: burgs overview - don't auto-show labels on hover

* fix: redraw population on change

* refactor: improve tooltip logic for burg labels and icons

* chore: pump version to 1.104.0

* fefactor: edit coastline and lake

* fix: minot fixes

* fix: submap

---------

Co-authored-by: Azgaar <azgaar.fmg@yandex.com>
2024-09-20 12:20:27 +02:00
Azgaar
dfa3813f04 feat: set min brush size to 1 2024-08-23 02:33:45 +02:00
Azgaar
d4aef4920c
Slider-input web component (#1109)
* feat: slider-input web component

* feat: slider-input web component - Brush size

* feat: slider-input - statesGrowthRate

* feat: slider-input - units editor

* feat: slider-input - dissalow invalid numbers

* chore: pump version to v1.99.05

* chore: pump version to v1.99.05

---------

Co-authored-by: Azgaar <azgaar.fmg@yandex.com>
2024-08-22 13:35:36 +02:00
Azgaar
12fad8fd8f feat(religions): editor UX update and cleanup, increase religions number to generate 2023-03-21 22:41:50 +04:00
Azgaar
218887b435 feat(religions editor): debouce center dragging 2023-03-19 15:46:53 +04:00
Azgaar
3ce0481a49 feat(religions editor): enhance UI paddings 2023-03-19 14:39:48 +04:00
Azgaar
13e247ed9c feat(religions editor): sync religion center circle style with culture one 2023-03-19 14:09:38 +04:00
Alexander James
47ef8d938b
Religions live update UX (#915)
* preparatory bugfixes

* restructure religion generator for extensibility

* Add culture-like update functions and UI

* Syntax / Typo

* PR Versioning

* Relig Editor UI: hide on brush, limit -> potential

* add / remove Culture creates / removes Folk religion

* Religions UX: stable abbr, Folk non-selectable type & not separately removed

* Folk religions follow cultures through regeneration; extinct religion centers draw, folk centers are immutable and do not

* style

* regenerate bugs fixing

* when cultures regenerate a different number

* ability to lock culture in a easy-defined set

fixes uncaught error in commit dada419 from PR #910

* what is locked folk?

* New Map ignores old locked things

* No auto-update of religion on culture regeneration

* typo

* Bugfixes

* Refactor toward modern style

* Prepare to lock - Further refactor

* Complete locked religions functionality

* Prepare for live updates

* Editors fixing + re-versioning

* Fix merge snafu

* Bugs, toungue-twisting

* indexing bugfix

* Manual Add prefers to create missing Folk

* Locked origin regen; deterministic expansion

* version update; fix add wild folk

---------

Co-authored-by: A C James <james.ander31@gmail.com>
Co-authored-by: Azgaar <maxganiev@yandex.ru>
2023-03-19 02:57:59 -07:00
Azgaar
d40cab2e28 fix: clean cultures on regeneration, v1.89.07 2023-02-19 18:11:07 +04:00
Azgaar
dada419f20
Add the ability to lock states, provinces, cultures, and religions: refactoring (#910)
* Add the ability to lock states, provinces, cultures, and religions (#902)

* Add the basis for locking everything, code and test the culture locking

* Got the religion generator working, but not the tree. There are cycles being generated

* Religions work now, including the tree view

* Got the states and provinces working as well, all good and ready

* Refresh the province editor when regenerating

* Implement the versioning steps

* Fix the state naming and color changing even when locked

* The fix did not work with loaded maps, fix that too

* Fix a few more bugs and address the PR feedback

* Fix the state expanding event when they're locked bug

* Implement some logic to ignore state being locked when regenerating provinces directly.

* refactor(#902): start with states regenertion

* refactor(#902): locked states cells to be assigned on start

* refactor(#902): lock state - keep label

* refactor(#902): lock provinces

* refactor(#902): regenerate states - update provinces

* refactor(#902): regenerate cultures

* refactor(#902): regenerate religions

Co-authored-by: Guillaume St-Pierre <gstpierre01@gmail.com>
Co-authored-by: Azgaar <maxganiev@yandex.com>
2023-01-08 03:38:52 -08:00
Azgaar
4ab0311d01 fix: hierarchy-tree - make sure nodes have parents not removed 2023-01-02 16:21:13 +03:00
Azgaar
6cd2419f10 feat(charts): remove on dialog close 2022-06-24 15:51:10 +03:00
Azgaar
03b556ae86 feat(charts): pump version to 1.87.00 2022-06-23 23:11:57 +03:00
Azgaar
434907fa9e feat(hierarchy tree): animate on update 2022-06-12 22:21:34 +03:00
Azgaar
6e5e570c90 feature(hierarchy tree): dynamically load, control dialog 2022-06-12 00:22:39 +03:00
Azgaar
b9a578e0be style(hierarchy tree): buttons style 2022-06-09 23:47:39 +03:00
Azgaar
127eafb656 feat(hierarchy tree): UI buttons to remove origin, zoom 2022-06-09 00:21:02 +03:00
Azgaar
182c6d558d fix: religions and cultures are not highlightable from editor 2022-06-08 21:12:31 +03:00
Azgaar
9215a01548 fix: religion editor toggles culture layer on 2022-06-08 11:53:30 +03:00
Azgaar
2c592a062d refactor: religion editor 2022-06-06 22:32:34 +03:00
Azgaar
221079321f refactor: load religions editor dynamically 2022-06-06 02:09:38 +03:00