Paralellise update gamestate & modifiers#741
Conversation
05a9419 to
45a7c59
Compare
44c0e3b to
18d03f0
Compare
| break; | ||
| case work_t::COUNTRY_TICK_BEFORE_MAP: | ||
| for (CountryInstance& country : work_bundle.countries_chunk) { | ||
| country.country_tick_before_map( |
There was a problem hiding this comment.
doesn't this call manage_national_stockpile which ultimately can call add_buy_up_to_order (for example), which is thread safe, but will make the order of the contents of buy_up_to_orders relative on the speed at which the threads in the pool finish (and their number), meaning that the order in which they are resolved in GoodMarket::execute_orders will vary based on timing, meaning that deterministic lockstep will not hold for multiplayer?
There was a problem hiding this comment.
The market doesn't care about ordering.
There was a problem hiding this comment.
Ah, fascinating. I assumed that you were trying to replicate the v2 economy, where items are drained from the market in order (specifically in rank order) and nations later in the order simply can't get anything. Doing equal division is also what version 1.0 of PA did, and for the same reasons (it makes it possible to parallelize the economy). Since this was the one big difference between the PA economy and the V2 economy in 1.0, I imagine that your economy system will behave a lot like the 1.0 PA economy. So be warned that this creates some substantial differences in gameplay.
45a7c59 to
1fac069
Compare
e396ef5 to
1e3a0c2
Compare
1fac069 to
8d985e8
Compare
1e3a0c2 to
fb5cc3e
Compare
153f1c7 to
71daf85
Compare
8d985e8 to
7b58a30
Compare
71daf85 to
2b3344b
Compare
Stacked on top of #739
Note updating adjecencies inside the country is commented out.
This really should've never been placed there as recalculating it is expensive and can't be multithreaded easily.
Also the outcome rarely changes. It can only change when provinces change owner or our capital changes province.