ParadoxGameConverters / EU4ToVic2

Converts EU4 games into a Vic2 mod
MIT License
46 stars 34 forks source link

Province parser uses incorrect buildings. #106

Closed woggy closed 4 years ago

woggy commented 7 years ago

As noted in https://forum.paradoxplaza.com/forum/index.php?threads/the-eu4-to-v2-converter-development-thread.707362/page-229#post-23176465

The EU4Province parser/class definition (EU4Province.cpp, starting around line 223) is still using EU3 strings for building names. As a result, forts aren't being converted properly, and other buildings are probably a bit funky as well. (A lot of the strings are the same, but many are not.)

IohannesIohannium commented 7 years ago

The buildings currently in EU4 are (𝖚 means the former can be upgraded to the latter): -barracks, 𝖚 training_fields -regimental_camp, 𝖚 conscription_center -courthouse, 𝖚 town_hall -dock, 𝖚 drydock -fort_15th (Castle), 𝖚 fort_16th (Bastion), 𝖚 fort_17th (Star Fort), 𝖚 fort_18th (Fortress) -marketplace, 𝖚 trade_depot, 𝖚 stock_exchange -plantations (Manufactory) -shipyard, 𝖚 grand_shipyard -temple, 𝖚 cathedral -textile (Manufactory) -tradecompany (Manufactory) -university -weapons (Manufactory) -wharf (Manufactory) -workshop, 𝖚 counting_house

Then we have the native buildings, that do not update: -native_ceremonial_fire_pit -native_earthwork -native_fortified_house -native_great_trail -native_irrigation -native_longhouse -native_palisade -native_storehouse -native_sweat_lodge -native_three_sisters_field

It should be noted, however, that M&T adds new buildings, which are not listed here and may affect populace.

In my opinion, some of these should be converted to the Vic2 buildings. More specifically, I suggest the Fortress (fort_18th) should become a Lvl-1 Fort in Vic2, a drydock or a grand_shipyard to a Lvl-1 Naval Base, training_fields or conscription_center to a Lvl-1 Railroad, and the manufactories to Vic2 factories, specifically: textile to Fabric Factory, wharf to Clipper Shipyard, weapons to Small Arms Factory, plantations to Canned Food Factory and tradecompany to Luxury Furniture Factory/Winery (if RGO). This way, we cover the basic starting Vic2 in a senseful way, rather than simply giving random starting factories.

As well, I propose dynamically determining the population classes upon buildings. E.g.: if you have a stock_exchange, add a 5% capitalists. E.g. 2: you have a Cathedral, you should add a 5% Clergymen. I don't know if this is in the code already or not, but it'd make a fine change.

kratostatic commented 7 years ago

Yeah, most what you've described is what should be happening currently (the buildings converting across directly and the adding of pops), so all that needs to be done is update the buildings - quite a lot of the names hadn't actually been changed since EU3toVicky2...

The training field/conscription centre suggestion is interesting - I don't think it's what we do now but it does make sense.

The factory stuff is a fair bit more complicated than just converting manufacturies to factories - basically the number of manufacturies each country has is totalled and then factories assigned based on these totals and the trade goods available to each country in each province. If we just converted manufacturies to factories there would be a silly number of factories at game start in Vicky.

woggy commented 7 years ago

Commenting on What Is Happening with extant code.

We're in pretty much the same situation with railroads as forts right now - a converted save has ones pulled from the default history files and nothing else. There is code to put a railroad in the capital of sufficiently-western uncivs, but it's not actually placing any at the moment, due to the railroad reform being far enough down the list that it's never getting picked. There is no code at all for placing railroads in civilized countries, not even a broken placeholder like the fort code.

Based on the parallel EU3 code I think it makes sense to convert fort_17th and fort_18th to level 1 Vicky forts - the EU3 code transforms levels 4-6 of a six-level system, so grabbing the two top levels now that we've only got four.

(Naval bases look to be doing the Right Thing already, at least based on a cursory glance at the debug log.)

Idhrendur commented 7 years ago

Railroads are intentionally not placed in civilized nations, as they are actually quite rare in default 1836 Vic2. The exact numbers on pop changes are different than suggested, but the idea is roughly the same. There's extensive research in the forum threads into pop composition, including graphs. I'd highly recommend review it before changing anything.

As noted, forts were supposed to be where level 4-6 forts in EU4 become level 1 forts in vic2. Of course, the fort system has changed (multiple times? I can't remember) since that was implemented.

Likewise naval bases, anything above shipyard should convert to a level one base (and there should only be one per state).

There's some documentation (and links to the relevant forums posts) on the wiki here: https://github.com/Idhrendur/paradoxGameConverters/wiki/EU4-To-Vic2%3A-Pop-Compositions

See also railroads: https://github.com/Idhrendur/paradoxGameConverters/wiki/EU4-To-Vic2%3A-Railroads Shipyards: https://github.com/Idhrendur/paradoxGameConverters/wiki/EU4-To-Vic2%3A-Shipyards Factories: https://github.com/Idhrendur/paradoxGameConverters/wiki/EU4-To-Vic2%3A-Factories Forts (just links at the moment): https://forum.paradoxplaza.com/forum/index.php?threads/the-eu4-to-v2-converter-development-thread.707362/page-74#post-18137456

woggy commented 7 years ago

I'm fine with there being very few railroads in a converted save - what I'm objecting to is pulling the ones that do exist from the unmodded V2 history. There's no guarantee that will make any sort of sense (though unless the world has gone quite off the rails, it's likely to be Close Enough?)

Idhrendur commented 7 years ago

Yeah, I agree that's strange. I can't recall putting that in, but I could be wrong (and it could be a side effect of borrowing code from a different converter, too).

kratostatic commented 7 years ago

I've seen most of the graphs to do with pops and so on already (I'd missed the railroad discussion) and I wasn't planning to mess with any of those unless I have good reason!

And yeah, the unmodded V2 history railroads should be removed. Aren't some in the USA? There's no way they'll be a great power at the start of most converted games!

woggy commented 7 years ago

The vanilla files have Lv1 railroads in: Berlin, Dusseldorf, Nuremburg, Brussels, Antwerp, St Petersburg, Liverpool, Manchester, Cleveland, Charlotte, Wilmington, Richmond, Philadelphia, Newark, New York, Boston, New Bedford, and Pittsfield. Not just some, that's most of the starters in the USA.

IohannesIohannium commented 7 years ago

We could adopt the same logic we used until now for factories to railroads as well. This way, we ensure they exist like they historically should but not as widespread as the average EU4 game would make them look like.

IohannesIohannium commented 7 years ago

About buildings in EU4, the 1.23 update will add two new buildings (codes' names unknown still). They are the Farm Estate and the Mill, some early game manifacturies, the first for grain, livestock, and wine, the second for paper, gems, tropical wood, glass, and chinaware. (Source: https://forum.paradoxplaza.com/forum/index.php?threads/eu4-development-diary-7th-of-november-2017.1053654/)

I suggest: -having a Farm Estate on a province gives a +2% of farmers of the primary culture of the owner-country -having a Mill on a province gives a +2% of craftsmen of the primary culture of the owner-country