Nightinggale
Deity
- Joined
- Feb 2, 2009
- Messages
- 5,282
I'm actually finishing up on rewriting precisely techs and civics (among other things).Both concepts could be transfered from what has already been developped in Medieval Conquest mod. And for the matter I actually like a lot the idea to designate civics as "decrees". But anyway, I know the required developments would be huge so I'm not pressuring anyone on that!
What was used in M:C and was planned for RaR: (vanilla BTS approach) can be described with this single example:
Question: can the player use unit 7?
- look up UnitInfo for unit 7
- get UnitClass (say it's 3)
- get civilizationType from player
- get civilizationInfo for said type
- get unit overwrite array in that civ info
- get unit for UnitClass 3
- check that this unit is 7 (or an instant False reply)
- get all techInfos (loop)
- foreach, check that the player has the tech and if it allows said unit. Sum up all allow values
- the player can use the unit if the allow is positive or allow and max allow value in xml are both 0
- ask player for allowUnit array
- look up index 7
- unit is allowed if number is greater than 0
This is just one tag. There is more than a hundred tags, which works this way, each with unique code in CvPlayer as well as in places where it's used. This means it has code in almost all files and I haven't even mentioned the entire system build into it to figure out when to update the caches and ensure that caches using caches as input will also be updated when needed. I started on this in 2015 and it's not ready for release yet. It has become playable, but there are still a few "this needs to be done before release" and then a lot of stability testing.
Due to the size of this, both in terms of time invested and simply the amount of lines in the code, I say moving it to RaR is not really an option. However the goal of M:C is to made it possible for as many mods as possible to use the DLL (removing the need to move code around), which mean it's not unfeasible to convert RaR into using the M:C DLL file, hence gaining access to the same features. Sure there are some RaR only features, but most if not all are on the wishlist for M:C and they are easier to move. Still not a task, which can be done in a weekend though.
Last edited: