Resources under Unique Features

Issue #172 new
joseasoler repo owner created an issue

It would be better if these resources did not appear at all. A solution needs to be found.

Comments (8)

  1. Tasunke Witka

    I'd say its a good idea, just make sure that the mana/resource provided is recorded both in the Civpedia and in the tooltip ...

    But recording it in Civilopedia (text files) is more important imho.

  2. joseasoler reporter

    Since it seems that the game engine calls CvPlot::GetBonus directly to get the artwork to use, in order to hide bonuses we would need to make a new version of this method to be called in the 154 times in which the DLL uses it. The only other option is to write up the most ugly and unholy of hacks in CvPlot::GetBonus, in order to read the call stack directly when we know that the bonus is being granted by a unique feature. If the code detects that the call comes from outside the DLL, it will blatantly lie to it by saying that there is no bonus. See: http://www.xs-labs.com/en/blog/2011/04/20/c-call-stack-windows/

  3. lfgr

    I guess the second one would also disable the bonus markers (the little circles with an arrow pointing at the plot), which isn't advisable in my opinion.

  4. joseasoler reporter

    Both of the proposed solutions would hide it, as it would be impossible to discriminate the purpose of the call. The first solution just does it in a less hacky way, but it would also expose to the outside of the DLL a method that returns "no bonus" in this particular case. It is somewhat infuriating to have those bonuses shown in unique features, but since I wasn't particularly inclined to implement these hacks, I guess that we will have to live with this problem.

  5. lfgr

    You're right.


    I think there are some improvements that change the artwork of a bonus if placed on them (farms on rice? Camps at least move the animals. Can't check at the moment), so maybe this could be used to make the bonus disappear.

  6. joseasoler reporter
    • changed version to 0.5.0

    That's an awesome idea, I didn't think of that. After following the thread a bit it seems that it is possible to define alternate artwork for specific improvement/bonus combinations in CIV4PlotLSystem.xml, which would allow to hide the bonuses when one of the unique "features" is above them. Now I just need a way to define "no art" in there but there must be some option to do that.

  7. joseasoler reporter
    • removed version

    Cannot be done this way either. It works with those bonuses because they are flat.

  8. Log in to comment