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

Quick Modding Questions Thread

Discussion in 'Civ4 - Creation & Customization' started by kiwitt, Jan 27, 2010.

  1. Dancing Hoskuld

    Dancing Hoskuld Deity

    Joined:
    Jul 5, 2004
    Messages:
    23,539
    Gender:
    Male
    Location:
    Canberra, Australia
    GlobalDefines.xml
    Code:
        <Define>
            <DefineName>NUM_CORPORATION_PREREQ_BONUSES</DefineName>
            <iDefineIntVal>5</iDefineIntVal>
        </Define>
    
     
    Zeta Nexus likes this.
  2. Zeta Nexus

    Zeta Nexus Deity

    Joined:
    Jan 23, 2014
    Messages:
    3,934
    Gender:
    Male
    Location:
    In a constant brainstorm...
    Wow! That worked! Thanks!

    Any idea/reason why I should keep that value low? Do you think 16 is still a safe number?
     
  3. Dancing Hoskuld

    Dancing Hoskuld Deity

    Joined:
    Jul 5, 2004
    Messages:
    23,539
    Gender:
    Male
    Location:
    Canberra, Australia
    It is used to make the dll faster and less memory hog by giving it a limit to expect. C2C has 25 in a number of them!
     
    Zeta Nexus likes this.
  4. Leoreth

    Leoreth 心の怪盗団 Moderator

    Joined:
    Aug 23, 2009
    Messages:
    34,399
    Gender:
    Male
    Location:
    Leblanc
    Does anyone know if there's a way to check if two given plots are bordered by the same (i.e. connected) river? I don't mind corner cases like different tributaries of a larger river being considered "the same" even though neither city is downstream from the other.

    From the looks of it there is CvPlot::getRiverID, but that seems to be used during map generation and seems useless after that. Is it possible at all?
     
  5. bluepotato

    bluepotato Warlord

    Joined:
    Dec 11, 2018
    Messages:
    234
    I'd try using the isNOfRiver and isWOfRiver functions. For example, if your plot and its northern neighbor both return true for isWOfRiver, that probably means they are connected. There are quite a few cases to cover, but I don't know of a simpler method.

    On another note: is there a way to create bink (.bik format for wonder movies) video files on Linux? FFmpeg can decode bik files with audio, but can not encode them. The RAD encoder doesn't seem to work with wine at all, and the only encoder I've found for Linux (here) can't encode audio. I even tried mixing audio with a bik file generated by this, but RAD tools isn't willing to accept it as a valid file.
    Maybe there is an online encoder somewhere? Or are there some other Windows encoders that I should try with wine?
     
  6. Zeta Nexus

    Zeta Nexus Deity

    Joined:
    Jan 23, 2014
    Messages:
    3,934
    Gender:
    Male
    Location:
    In a constant brainstorm...
    How many videos are we talking about? I can convert you some mp4 files to bik if that is good enough for you.
     
  7. bluepotato

    bluepotato Warlord

    Joined:
    Dec 11, 2018
    Messages:
    234
    It's just one small video I quickly cut together from an appropriate youtube video after finding a wonder I wanted to add. Would be great if you converted it!
     

    Attached Files:

  8. Zeta Nexus

    Zeta Nexus Deity

    Joined:
    Jan 23, 2014
    Messages:
    3,934
    Gender:
    Male
    Location:
    In a constant brainstorm...
  9. bluepotato

    bluepotato Warlord

    Joined:
    Dec 11, 2018
    Messages:
    234

    Attached Files:

  10. Zeta Nexus

    Zeta Nexus Deity

    Joined:
    Jan 23, 2014
    Messages:
    3,934
    Gender:
    Male
    Location:
    In a constant brainstorm...
    On it...

    I thought it was too big but RAD tools have no option to scale down the size. At least I didn't find it.
     
  11. Zeta Nexus

    Zeta Nexus Deity

    Joined:
    Jan 23, 2014
    Messages:
    3,934
    Gender:
    Male
    Location:
    In a constant brainstorm...
    Using the smaller mp4 resulted with the same size bik file :eek: Very strange.
    I'll try some more things later today.
    I want to solve it :king:
     
    bluepotato likes this.
  12. Leoreth

    Leoreth 心の怪盗団 Moderator

    Joined:
    Aug 23, 2009
    Messages:
    34,399
    Gender:
    Male
    Location:
    Leblanc
    Oh that's a good idea, basically A*-ing your way along the river between the two plots? That could work, thanks.
     
  13. Set

    Set Warlord

    Joined:
    Mar 31, 2010
    Messages:
    271
    Does anyone have an idea as to how to disable road pillaging? I don't really want to mess around with the DLL and was hoping to pull if off in the XML or through Python.
     
  14. f1rpo

    f1rpo plastics

    Joined:
    May 22, 2014
    Messages:
    800
    Location:
    Germany
    For most map scripts (those that don't override CvMapGenerator::addRivers), river ids do seem to persist. To actually make them useful beyond map generation, I guess one would indeed have to (re-)trace rivers and (re-)assign river ids at game start so that they're available for all map scripts and scenarios. Or ignore river ids and look for a path on the fly. :think: Rivers could change throughout the game (e.g. through WB), so river ids would have to be kept up to date ...
    CvPlot::isRiverConnection should already have this covered. Usage example from CvPlot::isTradeNetworkConnected:
    pPlot->isRiverConnection(directionXY(pPlot, this))
    And I guess depth-first search. I've implemented one in the DLL before; don't know if that's any help: GitHub.com/f1rpo/AdvCiv/.../CvMap.cpp#L1304
     
  15. Leoreth

    Leoreth 心の怪盗団 Moderator

    Joined:
    Aug 23, 2009
    Messages:
    34,399
    Gender:
    Male
    Location:
    Leblanc
    Right, maybe I missed something with river IDs, but it seemed like it's not as simple as "plot A and plot B are on the same river IFF A.riverID == B.riverID". Iirc, only one "side" of the river will have the ID, and may be overriden when one tile is passed by multiple rivers that are placed consecutively by the map generator (I think).

    But yeah, something like isTradeNetworkConnected for river connection only is basically what I need. I've been looking for an O(1) solution but I guess I have to build one if that's really needed.

    By the way, for context, I have been thinking about limitations for Hydro Plants (because they are really powerful compared to other sources of Power, especially in my mod where unhealthiness from power is based on power consumption, and there are a lot more buildings that consume power). One idea would be to only allow one Hydro Plant per river, and only for rivers of a certain length. Of course, that would require a way to identify rivers in some way.
     
  16. f1rpo

    f1rpo plastics

    Joined:
    May 22, 2014
    Messages:
    800
    Location:
    Germany
    Oh, I see; there could be multiple rivers per tile, one touching every corner in the worst case. Then a single river id is really no use, would need a container and maybe a class "River" ... :sad:
    All I can think of is USE_CANNOT_HANDLE_ACTION_CALLBACK=1 and then to check in cannotHandleAction (CvGameUtils.py) whether the given action is a mission of type MISSION_PILLAGE etc.
     
    Leoreth likes this.
  17. Zeta Nexus

    Zeta Nexus Deity

    Joined:
    Jan 23, 2014
    Messages:
    3,934
    Gender:
    Male
    Location:
    In a constant brainstorm...
    Well... I decided to create a new one from scratch.
    It's only a combination of 2 pics and the music extracted from your video. The size is down to 4,9MB.
    Let me know what you think of it.
    https://www.dropbox.com/s/ib86z314testh9d/naqshe_rostam.bik?dl=0
     
  18. bluepotato

    bluepotato Warlord

    Joined:
    Dec 11, 2018
    Messages:
    234
  19. Zeta Nexus

    Zeta Nexus Deity

    Joined:
    Jan 23, 2014
    Messages:
    3,934
    Gender:
    Male
    Location:
    In a constant brainstorm...
    You are welcome :thumbsup:
     
  20. Zeta Nexus

    Zeta Nexus Deity

    Joined:
    Jan 23, 2014
    Messages:
    3,934
    Gender:
    Male
    Location:
    In a constant brainstorm...
    Could someone explain how iFlankingStrength works in Unitinfos?
     

Share This Page