Nightinggale
Deity
- Joined
- Feb 2, 2009
- Messages
- 5,381
It could be cool if the new CivEffects had a tag that could affect __________It could be cool if the new CivEffects had a tag that could affect ImmigrationWeight for a Unitclass. You could easily have Civics, Techs, Fathers, or Traits that adjust immigration chance for a unitclass up or down!![]()
I totally agree and this is likely a place where the game will expand wildly once CivEffects are fully implemented.
I was thinking of yields earlier today. I had a plan to "reverse" the yields, meaning it would start with virtual yields and then modders can add cargo yields to the end. However given that the game expects the virtual yields last, that might be lots of work.About all the new abstract yields and combination yields my head is kind of spinning from all the proposed combinations.But I think the most natural way to control behavior of abstract and combination yields would be from tags in YieldInfos.xml. They would not be the same for all mods so it's best to avoid hardcoding where possible, though I guess some of their core behaviors (ie what yield controls border expansion, what yield triggers an immigrant, what yield controls "Rebel Sentiment" slider, etc) would require hardcoding to a given Yield to be feasible.
We can't simply set the yields entirely in XML for performance reasons. One solution I have been thinking of is to cache the index of YIELD_HAMMERS in CvGlobals and then use an enum to access virtual yields. Getting a virtual yield would then be calling an inline function, which returns the cached index for hammers + enum argument. This would hardcode the order, but would also be quite fast.
Another solution would be to have an array in CvGlobals and the virtual yield enum would then be the index in that array. It would be a bit slower, but still fairly fast. This array would then need to be filled with XML data.
To be honest I'm actually in favour of the hardcoded order based on C++ coding and performance reasons. Maybe the yield XML would need some bools to tell what they should act like and the DLL will assert if XML and DLL goes out of sync.
I'm not really sure how useful a virtual yield would be if the DLL doesn't provide a special meaning for it. After all, it will be just a yield and it can't be loaded onto units or anything like that. I can't think of a good use for it without some sort of DLL hardcoding.
I like the 1 plot spread approach, but so far I haven't got a clue on how to implement it. I don't really like the 2 plot radius approach though.In the case of Culture (or whatever the border-expanding combo yield would be) the gameplay role may be relatively limited at 1-plot city radius, but could become more interesting if you have 2-plot city radius with gradual border expansion one tile at a time a la Civ5. Or if you stay at 1-plot city radius but let cities progress through several "Culture Levels" (Struggling->Prosperous->Legendary etc) a la Civ4, where maintaining high local Culture Level can grant some benefit.
To be honest I never looked in those files. However having a file of hidden CivEffects, which can be easily triggered by events seems like the way to go. The game is changing towards controlling as much as possible with CivEffects meaning the more different aspects of the game, which can use them, the higher the XML modder freedom becomes.This is a good idea for Events, but could be even more versatile if you take advantage of the existing options in EventTriggerInfos.xml and EventInfos.xml to control the behavior of applying and removing a CivEffect.