1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Feedback: Buildings and Wonders

Discussion in '[MAC+WIN] Civ4 - History Rewritten' started by Xyth, Jul 16, 2011.

  1. platyping

    platyping Sleeping Dragon

    Joined:
    Oct 22, 2010
    Messages:
    4,626
    Location:
    Emerald Dreams
    Did some in game testings and fixed some C&P errors.

    1) Changed Fake Palace Building Class back to RECIPROCITY
    2) Changed city to pCity in onCityBuilt
    3) Fix onPlayerChangeStateReligion
    4) Removed RECIPROCITY from onCivicChanged
    5) Rewrite replaceBuildingInCapital as replacePalaceInCapital

    For now, it should be working, so time to look into corps and chopping.

    P.S.
    Now i hate BUG :D
    BTS I can just change python in game without errors.
    BUG gives tons of error msgs.
     
  2. Xyth

    Xyth History Rewritten

    Joined:
    Jul 14, 2004
    Messages:
    4,054
    Location:
    Aotearoa
    Thanks! I'm learning a lot from all of this.

    Don't worry about the Refund Corporation Spread Costs bit too much (it uses getSelectedUnit), unless there's a simple solution. Unlike Colonists I don't feel a great need to retain that bonus for the Financial trait and will probably just replace it with something else.

    Yeah, it's great to play with but it makes modding a fair bit trickier.
     
  3. Xyth

    Xyth History Rewritten

    Joined:
    Jul 14, 2004
    Messages:
    4,054
    Location:
    Aotearoa
    Why did you decide to reinstate BUILDINGCLASS_PALACE_RECIPROCITY in the end?
     
  4. platyping

    platyping Sleeping Dragon

    Joined:
    Oct 22, 2010
    Messages:
    4,626
    Location:
    Emerald Dreams
    because monarchy wasnt giving it happiness when both are palace class.
    maybe tested wrongly, but minor issue not a big problem later.

    The refund corp i cant be bothered to read either.
    It is more of the civic benefits which is worth looking at later.
     
  5. Xyth

    Xyth History Rewritten

    Joined:
    Jul 14, 2004
    Messages:
    4,054
    Location:
    Aotearoa
    I wonder if it wouldn't be easier to scrap the fake Palace altogether and implement the bonus via changeBaseYieldRate in the capital instead.
     
  6. platyping

    platyping Sleeping Dragon

    Joined:
    Oct 22, 2010
    Messages:
    4,626
    Location:
    Emerald Dreams
    You can also use setBuildingYieldChange or setBuildingCommerceChange though like what I did with Bolshoi
    Base Yield will be hard, because you cannot keep track of original capital unless you store it somewhere.
     
  7. Xyth

    Xyth History Rewritten

    Joined:
    Jul 14, 2004
    Messages:
    4,054
    Location:
    Aotearoa
    True. Lets stick with the fake Palace then.

    I had an attempt at altering CvMainInterface.py again, so it would only show the effect of the Pyramids for Workers and Labourers, and not Settlers and Colonists. It didn't go well. I've attached it, do you think you could take a look? I really appreciate it, interface stuff confuses me no end.
     

    Attached Files:

  8. platyping

    platyping Sleeping Dragon

    Joined:
    Oct 22, 2010
    Messages:
    4,626
    Location:
    Emerald Dreams
    Maybe later, just an additional check.

    1) Changed TribalIsland in HR to use xrange
    2) Scrap Fake Palace
    3) Merge State Religion Yield Civics (No more looping when there is no civics for production and commerce)
    4) Added SRYC check onCityAcquired
    5) Fixed onPlayerChangeStateReligion logic error after merging yesterday
    6) Fixed onImprovementBuilt indentation error after reordering of codes
    7) Rewrite Scripdata onGameStart to activate Civic effects directly on turn 0
    8) Created Fake Wonder granting Free Fake Buildings for each Fake Building Trait
    9) Merged Free Building Traits into Free Wonder Traits and remove those codes
     
  9. stoferb

    stoferb Prince

    Joined:
    Aug 17, 2011
    Messages:
    309
    One thing I remember from my game is that I kept building castles into the modern era for the espionage points and trade. I wonder if it's meant to be that way that you can keep building castles even though you have tanks and bombers. Though I liked that castles were actually useful economically, especially in the aristocracy civic where it nets you a few hammers and espionage points aswell as commerce.
     
  10. platyping

    platyping Sleeping Dragon

    Joined:
    Oct 22, 2010
    Messages:
    4,626
    Location:
    Emerald Dreams
    After pressing OK for more than 100 times to error messages after I made a python change in game, (In the end, I press ctrl alt del) I have successfully removed BUG from HR...

    So don't ask me to edit this file again lol
     
  11. platyping

    platyping Sleeping Dragon

    Joined:
    Oct 22, 2010
    Messages:
    4,626
    Location:
    Emerald Dreams
    1) Fixed undefined pUnitType in def AI_unitUpdate, CvGameUtils
    2) Shift Chopping Bonus to onPlotFeatureRemoved
    Don't understand why chopping bonus is always 2/3 of what is stated in BuildInfos.xml but just left it as it is
    No description for Timber in game, so not sure of its purpose, so just left it as it is
    3) Merged Extra City Yield Traits

    Thats all for today

    Have you decided about Olympics and Incapacitation?
     
  12. Xyth

    Xyth History Rewritten

    Joined:
    Jul 14, 2004
    Messages:
    4,054
    Location:
    Aotearoa
    Great solution for Reciprocity. Tidy, and a lot of scope for future expansion. I like having fake wonders place the fake buildings too. I liked your implementation of the Olympic Games better and settled on it appearing for 5 turns of every 20. What's the decision to be made with incapacitation?
     
  13. platyping

    platyping Sleeping Dragon

    Joined:
    Oct 22, 2010
    Messages:
    4,626
    Location:
    Emerald Dreams
    Code:
    if pWinner.getUnitType() in HR.Unit.Incapacitate:
    	if not pLoser.isDead():
    Does this work? When will the defeated unit not be dead? :shifty:
     
  14. platyping

    platyping Sleeping Dragon

    Joined:
    Oct 22, 2010
    Messages:
    4,626
    Location:
    Emerald Dreams
    Looking at the corp codes I can forsee 2 issues already :D
    1) If it is possible to have 10 corps in 1 city it is screwed.
    When number of corps > 9, you get a 3 digit number

    2) No codes onCityAcquired... city changes hands, foreign corp status changed, civic affecting city also changed
    Especially if HQ changes hands worse.
     
  15. Xyth

    Xyth History Rewritten

    Joined:
    Jul 14, 2004
    Messages:
    4,054
    Location:
    Aotearoa
    If it successfully withdraws from combat.


    A few other notes:

    • Inquisitions: that code was merged in mostly unchanged in the very early days of HR. I have no idea what half of it does. I plan to review and simplify it all at some point.
    • Chopping: I'm not sure where that 2/3 comes from. I have a feeling I looked up BTS chopping mechanics somewhere and that was part of it, but I could be wrong. I'll try find out.
    • Timber is a strategic resource that gives a bonus to production speed of certain units and buildings. The code is there because I want the resource to be destroyed if the Forest/Jungle its placed on is chopped (makes no sense to have Prime Timber on bare grasslands, for example). Chopping and destroying a Timber resource will give a production bonus in addition to what the city receives for the forest or jungle feature.
    • Upgrade costs: I decided to go for an additive model. Borrowed code from your Leonardo's Workshop to do it.
    • I plan to upload a public beta of 1.20 later today.
     
  16. Xyth

    Xyth History Rewritten

    Joined:
    Jul 14, 2004
    Messages:
    4,054
    Location:
    Aotearoa
    I've set up competition between HR's corporations so that the absolute most any city can have is 5.

    I suspect that's because HR didn't use 'Foreign Corporations have no effect' or 'No Foreign Corporations' for a while and thus I felt it didn't need anything there. (HR now uses the former but not the latter). Been a while since I've looked at my corporations code though, I'll have a review and try and work out what I was thinking :p
     
  17. platyping

    platyping Sleeping Dragon

    Joined:
    Oct 22, 2010
    Messages:
    4,626
    Location:
    Emerald Dreams
    1) onCombatResult is triggered only when X killed Y in combat.
    Not triggered for interceptions
    Not triggered for air combat
    Not triggered for withdrawals

    2) Inquisitions... Lazy to read atm

    3) For BTS, 30 in BuildInfo = 30 in game, modified by GameSpeed and Tech.
    So I am also curious where it came from lol

    4) Timber. In other words, since Timber can only spawn on Forest or Jungle, I can simply merge it into the chopping bonus code and just remove timber if present.

    5) I thought of something that will... screw up all your corp civics.
    Corp needs Resource to be active.
    Losing a resource will deactivate it, yet again no checks for that.
    Only way I can think of is player script data.
     
  18. Xyth

    Xyth History Rewritten

    Joined:
    Jul 14, 2004
    Messages:
    4,054
    Location:
    Aotearoa
    Ah bugger. Possible via onCombatLogCalc or onCombatLogHit perhaps? I want the Blowgunner to incapacitate its opponent regardless of whether the Blowgunner wins or dies or withdraws.

    Yeah, don't bother. Ultimately I want to get rid of the Holy Office entirely and have Inquisitor availability tied to the Fundamentalism civic, but that's a project for another time.

    Just remove it I guess. Can put it back later if we find out it had a purpose.

    Yes, but removing it should also give an extra production bonus, in addition to that obtained from the Forest or Jungle being cleared. And also the message alerting that the resource has been destroyed.

    I'm not too worried about that, at least in terms of the health/happiness/production/commerce effects. Presence in a city is enough, the effects can occur regardless of whether the corporation is currently active or not.
     
  19. platyping

    platyping Sleeping Dragon

    Joined:
    Oct 22, 2010
    Messages:
    4,626
    Location:
    Emerald Dreams
    1) Blowgunner
    A) BG died
    Doing something to the victor when unit died in combat is easy. Used it in some of my promotions like Fear, Despair, Retribution
    B) BG withdrawn
    However, pretty much impossible to do anything on withdrawals. Those 2 don't help much.
    C) BG won
    What is there to do? :D
    Rival already dead, you still wanna torture his corpse?

    3) The issue is that the actual chopping production in game is really 2/3 of BuildInfo stated value.
    Even the hover text on the Worker also displayed 2/3... So had to include the 2/3 as well during calculations

    4) Question is whether the timber production should be boosted with the Chopping Civic :D

    5) I decided to ignore Corps totally, since
    A) You are gonna remove the refund thingy anyway
    B) Leave it till release of beta
     
  20. platyping

    platyping Sleeping Dragon

    Joined:
    Oct 22, 2010
    Messages:
    4,626
    Location:
    Emerald Dreams
    Since you are gonna release the beta, I leave the rest till released.

    Known Issues:
    1) Blowgunner codes, withdrawal does not work
    2) Corporation onCityAcquired, no check done
    3) UN Resolution screw up State Religion, no check done
    4) Leonardo Upgrade codes, I assumed you did the changes yourself already
    5) Olympics, change the pedia text to reflect the new Olympics?

    Last Update for you:
    1) Shifted Timber to onPlotRemoveFeature as well
    2) Found easier way to get exact feature production, no need to check game speed, adjusted by distance from city as well
    3) Timber destroyed message (with button) now displayed to all who players with vision over the timber plot, beside the city owner who gets the boost, if any.
    4) Timber production currently, not boosted by Civic
     

Share This Page