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

Mod-Modders Guide to Fall Further

Discussion in 'Fall Further' started by xienwolf, Sep 25, 2008.

  1. Valkrionn

    Valkrionn The Hamster King

    Joined:
    May 23, 2008
    Messages:
    14,450
    Location:
    Crestview FL
    Connection routes. Allowed them to trade over desert as if it was Ocean (Sephi's idea), but hills interfered.

    How would I add that list?
     
  2. xienwolf

    xienwolf Deity

    Joined:
    Oct 4, 2007
    Messages:
    10,589
    Location:
    Location! Location!
    Getting full on traderoutes over the terrain is something I have never looked into before. Off the top of my head I would imagine it fairly involved, but the basic gist is that you are out of where I have played, so I can't contribute too much for pointing you in the right direction, just fix snippets you might post. Which would of course be hard to do now since you don't know precisely where the issue pops up.
     
  3. Valkrionn

    Valkrionn The Hamster King

    Joined:
    May 23, 2008
    Messages:
    14,450
    Location:
    Crestview FL
    Think we're confused here; I mean the 'Can trade over X terrain' tag, as used in Optics for Ocean. Doesn't add trade routes themselves, but allows resources to connect up, connects cities, and connects empires if they are connected by desert.
     
  4. xienwolf

    xienwolf Deity

    Joined:
    Oct 4, 2007
    Messages:
    10,589
    Location:
    Location! Location!
    Right, and that is also used to determine trade routes and blockade and things along those lines. Simply acting like you have a road/river to the plot to connect the bonus only (and not to enable a traderoute, and thus not enable diplomacy trade of physical items) is fairly simple set of code, but the stuff to determine what traderoutes are active for a city and which ones to utilize I haven't really looked at too deeply, as it hasn't concerned me too much yet.
     
  5. Valkrionn

    Valkrionn The Hamster King

    Joined:
    May 23, 2008
    Messages:
    14,450
    Location:
    Crestview FL
    Question: What is the difference between the following two lines?

    stream->Write(&m_iProximityMemoryDecayDelay);
    stream->Write(m_iProximityMemoryDecayDelay);

    The second is the typical one, with an & only being in the read section; However, some code (including some of yours) shows the & in the write section as well.
     
  6. xienwolf

    xienwolf Deity

    Joined:
    Oct 4, 2007
    Messages:
    10,589
    Location:
    Location! Location!
    The & shouldn't be in the write section. The difference is that the first one (with &) tells you WHERE the information is. The second one tells you WHAT the information is. So when reading, you tell it where to put the information, but when writing, you need to tell it what to write.

    Nasty bugs if you use the wrong one in the wrong location. (aka - I messed up with copy/paste!)
     
  7. Valkrionn

    Valkrionn The Hamster King

    Joined:
    May 23, 2008
    Messages:
    14,450
    Location:
    Crestview FL
    Ah, okay. Will fix it then. :lol:

    Second, unrelated question: What in the hell is the difference between iAsset and iPower? :confused: We're planning to clean up units/buildings/everything, and part of that is assigning intelligent Power values to units so the AI will wage war properly; However, we aren't quite sure what the difference is here. I think one is for tactical strategy, and the other is for empire-wide score?
     
  8. xienwolf

    xienwolf Deity

    Joined:
    Oct 4, 2007
    Messages:
    10,589
    Location:
    Location! Location!
    I had only looked for units in detail, but as I recall Asset was only used in deciding which unit to disband if you are cutting costs for your army upkeep. Power is used for deciding tactical stances, like which continent to go defensive in and which one to warmonger.
     
  9. Sephi

    Sephi Deity

    Joined:
    Jan 25, 2009
    Messages:
    2,927
    don't know if this is still a useful report.

    Noticed that in FF style WoC modular loading Readpass2 arrays arent't loaded correctly.

    Basically first an array is initialized with GC.getNumSpellInfos() size, then later a second one is initialized that is bigger size and from the first one the information is copied. but GC.getNumSpellInfos() has a higher value now, so a smaller array is copied into a bigger one and the result seems to be that just random information is loaded for the last elements (well this is my theory for the loading behavior I observed).

    Moving the tag to readpass3 circumvents this problem, I just wonder if it can be fixed easily.
     
  10. xienwolf

    xienwolf Deity

    Joined:
    Oct 4, 2007
    Messages:
    10,589
    Location:
    Location! Location!
    Curious. I'd have to glance at how it is handling things, but it ought to be initializing an array which is 1 larger, copying the old, and then replacing the final element with the data that just loaded. But if there isn't a set of commands to initialize the new element in the array properly, that would cause issue.
     
  11. Sephi

    Sephi Deity

    Joined:
    Jan 25, 2009
    Messages:
    2,927
    thanks. Took a look at the code but couldn't figure something out quickly. Will keep it in mind.

    another question. I want to add a folder to the Modules folder that is loaded last (so that it overwrites everything). Do I need to put it first or last in the MLF file?
     
  12. xienwolf

    xienwolf Deity

    Joined:
    Oct 4, 2007
    Messages:
    10,589
    Location:
    Location! Location!
    Last item listed in the first MILF file (so the one in Modules itself, not in any subfolder, unless that subfolder is also last in all MILFs above it)

    If you wanted to be ABSOLUTELY certain that it is ALWAYS loaded last, you could hardcode it to check a special "PostModules" folder which is in Assets after the modules are all loaded.

    Doing that would be in CvXMLLoadUtility::LoadGlobalClassInfo. You would have to bulk copy and slightly modify everything from about here on down...

    Code:
    			if (gDLL->isModularXMLLoading())
    			{
    				std::vector<CvString> aszFiles;
    				gDLL->enumerateFiles(aszFiles, CvString::format("modules\\*_%s.xml", szFileRoot));  // search for the modular files
    
    
     
  13. Valkrionn

    Valkrionn The Hamster King

    Joined:
    May 23, 2008
    Messages:
    14,450
    Location:
    Crestview FL
    :lol:
     
  14. xienwolf

    xienwolf Deity

    Joined:
    Oct 4, 2007
    Messages:
    10,589
    Location:
    Location! Location!
  15. Sephi

    Sephi Deity

    Joined:
    Jan 25, 2009
    Messages:
    2,927
    some update on the readpass issue. I have tested the excludepromotions and replacepromotions tags, which are readpass2 in several modules and they work fine. So I think the bug is in the copynondefaultsreadpass2 code for the projectsneeded tag. IIRC TC01 commented in his FF Frozen module that projects do not work modular and I have the same experience.
     
  16. Valkrionn

    Valkrionn The Hamster King

    Joined:
    May 23, 2008
    Messages:
    14,450
    Location:
    Crestview FL
    Alright, question for you Xienwolf. ;)

    Snarko managed to find the cause of the ~1/2 second lag after moving a unit. Turns out it's in the interface python, a loop through promotions and pushing them to the front.

    Thing is, we have no idea why it's needed. Commenting them out removes the lag, doesn't appear to affect the interface at all...

    Here's the commented out block, and the region of code immediately around it. There's an identical codeblock about 2k lines further in...

    Code:
    		pPlot = CyInterface().getSelectionPlot()
    
    #		for i in xrange(gc.getNumPromotionInfos()):
    #			szName = "PromotionButton" + str(i)
    #			szName2 = szName + "Duration"
    #			szName3 = szName + "Quantity"
    #			screen.moveToFront( szName )
    #			screen.moveToFront( szName2 )
    #			screen.moveToFront( szName3 )
    		
    		screen.hide( "PlotListMinus" )
    		screen.hide( "PlotListPlus" )
     
  17. hbar

    hbar Constant

    Joined:
    Feb 6, 2008
    Messages:
    1,307
    Location:
    Wisconsin
    This is literally all you needed to do to get me to play RifE again (and FF if it ever necro's).

    :goodjob: :woohoo: :D :king: :thumbsup: :love: :clap: :worship: :bowdown: :hatsoff:

    That delay was an irrational but soul-crushing game killer for me. I will tolerate raging hill giants and immortal-strength sabertooths; I can handle inept AI and horrific balance issues; I can even handle constant teaser posts and huge delay between releases ;). But that half-second delay just killed my enjoyment wherever it cropped up.
     
  18. Valkrionn

    Valkrionn The Hamster King

    Joined:
    May 23, 2008
    Messages:
    14,450
    Location:
    Crestview FL
    I know exactly what you mean; Grey Fox hated it too.

    The code that causes it is actually in ALL versions of FfH, so it would be a good thing for other modders to comment out as well... As far as we can see, it serves absolutely no purpose. Nothing changed when removing it.
     
  19. xienwolf

    xienwolf Deity

    Joined:
    Oct 4, 2007
    Messages:
    10,589
    Location:
    Location! Location!
    At some point while working on the interface the panel for the units kept slipping in front of the promotions when updated, so I had to move the promotions back in front of the panel. Apparently whatever was causing that issue is no longer an issue if commenting it out didn't cause your promotions to become invisible. So take it out and keep it out :) Good catch.
     
  20. Valkrionn

    Valkrionn The Hamster King

    Joined:
    May 23, 2008
    Messages:
    14,450
    Location:
    Crestview FL
    Nope, promotions are perfectly visible.

    And it's Snarko's catch, not mine. Just happy that delay is gone now. :lol:
     

Share This Page