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

[BtS]40 civs-allows colonies AND 34 civs

Discussion in 'Civ4 - Mod Components' started by Lt. Bob, Jul 30, 2007.

  1. Lt. Bob

    Lt. Bob Chieftain

    Joined:
    Jul 26, 2007
    Messages:
    70
    Proving that either I should be getting paid for this, or I have too much time on my hands: I figured it out!

    I have attached a 34 player worldbuilder save which works with every civilization in play (Feel free to modify the save to your hearts desire) and for those of you interested in what the problem is a 40 player test save and an explaination below.

    The problem is caused by the LeaderName strings in the worldbuilder save. The more players in the game the shorter the names have to be. In the 34 civ save I have here the names are still inteligible and distinguishable from one another. In the 40 civ save I've posted, the names seem to be limited to an average of three characters (kind of makes it hard to know who's who.

    My educated guess is that the leadernames are stored in some sort of shard memory structure which has plenty of space for 18 players but not nearly enough for >34. This is a fairly common programming method to save memory. For the non programmers out there let's say these 11 underlines signify the structure used to store the names in the game
    _ _ _ _ _ _ _ _ _ _ _ You can put in three names like Bob, Sam, and Jan
    B o b _ S a m _ J a n
    two like Billy and Jamie,
    B i l l y _ J a m i e
    or even four like,
    B o _ M o _ J o _ D o
    and fill up the same space (Although I don't think Do is a name :)). It works okay for 2-3 names, but try to fit six in there and you're in trouble. Put too many names in and you'll either overflow your space, or collide the names, either way causing trouble.
    If you want to see what I'm talking about firsthand load up the 40 civ save I have here. It works but you'll notice that I named all the leaders ABC. Exit the game and load up the 40civTest worldbuilder save into notepad. Find and replace the LeaderName=ABC lines with LeaderName=ABCD. Now load up the file in civilization and it'll crash.

    From the perspective of fixing it, I'm not sure that will happen. From Firaxis' point of view, the system works fine. 18 players aren't going to run into a problem so the default game doesn't have an issue. I think the easiest solution is like I did in the 34 player save I provided, just shorten the names to something still recognizable. That or only ever play on randomly generated maps. :)
     

    Attached Files:

  2. Gunner

    Gunner Emperor

    Joined:
    Aug 21, 2004
    Messages:
    1,389
    Location:
    Goochland, VA
    Good work Lt. Bob! You really are dedicated to this. I hope Firaxis decides to address it at some point.
     
  3. Lt. Bob

    Lt. Bob Chieftain

    Joined:
    Jul 26, 2007
    Messages:
    70
    Thanks! Like I said above though I'm not sure Firaxis will fix it. Design decesions like this can be a real pain to change because a lot of stuff depends on the old (current) way of doing it. We can hope though. Maybe Firaxis will support > 18 players in their next addon and fix it then. Where's my cross fingers emoticon?
     
  4. Gunner

    Gunner Emperor

    Joined:
    Aug 21, 2004
    Messages:
    1,389
    Location:
    Goochland, VA
    I wonder if you should report it in the bug reports forum or something like that?
     
  5. The Navy Seal

    The Navy Seal Emperor

    Joined:
    Aug 4, 2006
    Messages:
    1,693
    Gender:
    Male
    Location:
    North Carolina
    Can you provide the source for it?
     
  6. Lt. Bob

    Lt. Bob Chieftain

    Joined:
    Jul 26, 2007
    Messages:
    70
    If you mean for making the 34civs work in worldbuilder? There isn't any, other than that wbsave file. All I did was mess with the names untill they played well together :).
    If you mean the 40 civ mod itself I've recompiled a new version of the mod which contains the latest fixes from solver's unofficial patch and included the source file in the rar. Notes about the changes I made are noted in both the readme in the rar and in the spoiler below

    edit: link removed because of newer version - see first post

    Spoiler :
    I've changed three files. You can find them in the 40civs21Source.zip under the 40civs folder. I've marked all my changes with a comment of my name (Mikel) so they should be pretty easy to find. If you use my changes in another mod, I'd appreciate a byline in your readme/notes. NOTE: The three source files included here contain other changes by solver and thus may not compile without additional files. My code changes can be copy pasted and work just fine though.
    CvDefines.h - Changed the define value for max players from 18 to 40
    CvCity.cpp - Added code for governing a colony - uses a value in xml to decrease colony costs on a continent with a gov center (versilles/forbidden palace)
    CvPlayer.cpp - Modified the SplitEmpire code to allow colonies to spawn as teams already in play.

    An important note: The CvCity.cpp changes request a new value in your GlobalDefines.xml if the following code is not in your xml file the value will fallback to 0.
    Code:
    	<Define>
    		<DefineName>GOVERNED_COLONY_MULTIPLYER</DefineName>
    		<fDefineFloatVal>1</fDefineFloatVal>
    	</Define>
    A 1 for the value disables it making gameplay EXACTLY the same as default. I think that a value of 0.667 improves gameplay, feel free to adjust it to whatever you prefer.
     
  7. Liambane

    Liambane Rome's Praetorian

    Joined:
    Aug 14, 2007
    Messages:
    288
    Location:
    West Roman Empire, Italy.
    Lt. Bob you are GREAT!

    I didn't know how my mod that is an earth map works with 31 civs and crush in a RUNTIME ERROR since i put 32 civs! (my core is able to support 50 civs) and now, reading this thread i know WHY!

    Do you guys will think that someone can fix this BIG problem????
     
  8. Lt. Bob

    Lt. Bob Chieftain

    Joined:
    Jul 26, 2007
    Messages:
    70
    Glad I could help. If the problem comes from what I think it does I don't think anybody is going to be able to fix it anytime soon if at all.

    On another note, here's a new version of my mod which adds a new option to alter the way the game deals with global warming. Instead of turning tiles to deserts it will add fallout to the tile instead. I didn't like that there was no way to reverse the effects of "global warming" so this way you can at least clean it up. This version also includes the latest changes from Solver's unoffical patch (through today 08-16-07)
    To turn this option on grab the new 30 version of 40civs and then modify your globaldefines.xml file. Add 100 to your current GLOBAL_WARMING_PROB value and it'll work. My changes detect when you set the value over 100, then calculate it as -100 that value. So <=100 is default game settings >100 uses my new method.

    DL Link: http://rapidshare.com/files/49429256/40CivsV30.rar.html
     
  9. Liambane

    Liambane Rome's Praetorian

    Joined:
    Aug 14, 2007
    Messages:
    288
    Location:
    West Roman Empire, Italy.
    Yes Lt. Bob, is like you said!!! :goodjob: :goodjob: :goodjob: :goodjob:
    I add a 32th civ, rename all the leaders with 3-letter name like JUL - MAO - LIN ecc... and i GOT THE MAP WORKS with 32 civs! So the problem was what you think! As you said I don't know if someone KNOW HOW to fix this, but i hope that someone will soon do that!

    Speaking abou my map, if you are interested in earth maps games just take a look... You will like FOR SURE!!! my MOD!!!!

    The thread is Earth 30 civs and 3 new resources BTS in pre-made maps and the MOD with the map is there:
     
  10. Lt. Bob

    Lt. Bob Chieftain

    Joined:
    Jul 26, 2007
    Messages:
    70
    I've been known to play an earth map from time to time. Britain rules all! I'll be sure to check it out. BTW your link in this thread is messed up, you must've copied it from your other post because it's abreviated with a ... in it that messes it up. :)
     
  11. Narn

    Narn Warlord

    Joined:
    Feb 6, 2006
    Messages:
    217
    never mind fixed a problem i had
     
  12. Xavier Von Erck

    Xavier Von Erck Warlord

    Joined:
    May 12, 2003
    Messages:
    144
    I really wish to use this as the lack of being able to spawn off colonies when civ limit is hit drives me nuts.

    However...

    I want nothing to do with Solver's "balance flavor" (I refuse to call that mess a patch). Is there any way to get this without having to have Solver's stuff forced upon? Great work making this happen otherwise!
     
  13. Lt. Bob

    Lt. Bob Chieftain

    Joined:
    Jul 26, 2007
    Messages:
    70
    Just grab V1 or V2 depending on whether or not you want the governed colony change. Neither of these versions include solvers changes.
    V2: http://rapidshare.com/files/46617955/40CivsV2.rar.html
    V1: http://forums.civfanatics.com/downloads.php?do=file&id=6225
     
  14. Xavier Von Erck

    Xavier Von Erck Warlord

    Joined:
    May 12, 2003
    Messages:
    144
    Thanks very much.
     
  15. Vanchelon

    Vanchelon Chieftain

    Joined:
    Aug 28, 2006
    Messages:
    73
    Location:
    Stockholm, Sweden
    Hey there,

    I have a question concerning the >18 civs mod, like yours.
    Will they work on existing games? (hit the 18 civ limit in a game, even tho quite a few civs have died off).

    Are you sorting a new one for solvers august 16th update? (He introduced a bug in the one previous to that where all colonies went independent after 10 turns or so).

    Edit: k it didnt work on my ongoing MP game :) Too bad, will have to reduce colony maintenance I suppose to compensate.

    Regards,
    Vanch
     
  16. Lt. Bob

    Lt. Bob Chieftain

    Joined:
    Jul 26, 2007
    Messages:
    70
    Version 3.0 actually includes solvers august 16th update which I believe is the latest version he has released.

    The change in the maximum number of players is what causes the incompatability with your save game. It's a global variable so the game is not happy when it's altered in progress. :) It's probably possible somehow to upgrade a save using a technique similar to modifying a worldbuilder save but I just tried opening a save in a hex editor and it's out of my skillset.

    Although once you have the mod upgrading versions with the same save game works no problem, I've done it multiple times.
     
  17. Kilim

    Kilim Chieftain

    Joined:
    Nov 1, 2005
    Messages:
    54
    Location:
    Westchester, NY
    Question:

    I just downloaded this and about to install with teh Extra Mod found here http://forums.civfanatics.com/showthread.php?t=234906

    Want to play with 34 Civs.
    Do I have to edit any files to make it run properly or just install and play?
    Got confused when I read soemthing about the Leadername strings you posted above.

    I tend to play Custom Games using tectonic Map Script, Gigantic Map with Extra Mod and Solver's fixes.
    1 thing missing is ability to have more than 18 Civs in play and hoping this will do it just fine :D

    So in short:
    Will I have to edit any other files for a Custom Game 34 Civ, or just install and play?
    FYI I play BtS.
     
  18. Lt. Bob

    Lt. Bob Chieftain

    Joined:
    Jul 26, 2007
    Messages:
    70
    To combine these two mods just copy the assest folder from my 40civs folder into the extra folder and you'll be good to go.
    As long as you play custom games with a map script you shouldn't have any issues with the leadernames.
    Have fun!
     
  19. Lt. Bob

    Lt. Bob Chieftain

    Joined:
    Jul 26, 2007
    Messages:
    70
    I just wanted to make a quick comment here. Somebody's comments got me looking into whether or not I had the latest Solver's updates in V3.0 I did some looking at file modification times and I just wanted to say that even though my dll is compiled earlier than the latest solver dll it actually contains the fixes from the latest 8-16 solver (the source code timestamps match).
    This discreptency seems to be caused by either timezones or an incorrect system clock. For clarification here's some data:
    his dll was compiled on (08-16-2007 7:02PM)
    mine was compiled on (08-16-2007 2:47PM)
    the kicker->I downloaded the rar that had his files in it on (08-16-2007 2:44PM)

    So to reiterate, either I can download files from the future (that would ROCK!) :) or the clock times just don't match on our computers. But V3.0 is up to date with the latest solver changes.

    I try to check his thread to see if he changes anything but if anyone notices a new change before I do, just post here and I'll add it in.
     
  20. Revolutionary

    Revolutionary Anarchy!

    Joined:
    Dec 13, 2003
    Messages:
    811
    Location:
    Fighting The Good Fight
    Finally! the wb save works!

    Lt. Bob you the man!

    This is going to save me so much time
     

Share This Page