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

DLL edit request

Discussion in 'Civ4 - Creation & Customization' started by Civciv5, Mar 5, 2016.

  1. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,677
    I changed MAX_PLAYERS due the request here, but I didn't test it. I'm not confident that it works at all. Some people claim it does, some claim it doesn't. Some claim the issue is a limitation of number of LeaderHeads. It would be nice to know what is actually the limitation, but there is some limitation.

    I have been thinking about one claim, which is that it is the number of LeaderHeads in the start game menus. If it can handle an unlimited amount of LHs during the game, but only a fixed number early on, the problem could be avoided by always returning a fixed string for LH graphics unless a game is in progress. That way all leaders would have the same graphics in the menu (not ideal), but they will look correctly ingame and there is no limitations for the XML editors to violate. It could be explored to show the correct LH for as many leaders as possible if this approach is actually implemented. Part of the problem is that the select leader menu is placed in the exe and not within reach for us. However it asks the DLL for xml data, meaning clever DLL edits can fake the LHs as needed.

    It's not top priority for me though. I think even 50 players seems like quite a lot. M:C currently has the limit set to just 32. The higher the number, the more CPU power and memory is used even if the players aren't even used in the current game. Unlike most classes, the there is actually allocated an instance for each player even when they aren't in use. They are also looped when checking all players and arrays storing data for all players also allocates data for unused players. Savegames too saves data for unused players. All this combined mean adding more players than you need is a waste.
     
  2. nci

    nci Chieftain

    Joined:
    Apr 7, 2016
    Messages:
    51
    It is impossible to create a colony with this DLL, or any other modded DLL I found for that matter, except this. But that DLL allows only 34 civilizations + 6 colonies, that is 40 civilizations total - not enough. 50 civs plays pretty well on huge world, but when you play for Portugal and/or get Astronomy early, it is essential to settle on empty islands - at least to prevent other advanced civilizations from doing it. It is fun, but also leads to too much micro-management in later stages; just giving those cities away to existing civilization is not an option, it will likely become too powerful, while creating a colony which will remain your vassal is about the best possible option, in my opinion.
     
  3. isenchine

    isenchine Empress

    Joined:
    Oct 18, 2010
    Messages:
    1,774
    Location:
    Brussels, Belgium
    Quoting Lt. Bob:
    BtS rules:

    1) Colonies can only be created if a slot is still available - nothing new in Lt. Bob's Mod I think.

    2) Colonies can only be created if the team has not been in the game before - I think that this is the only noticeable change in Lt. Bob's Mod.

    Adding other Civilizations is another issue - that has not to be addressed by the number of players in the dll.
     
  4. nci

    nci Chieftain

    Joined:
    Apr 7, 2016
    Messages:
    51
    There definitely is some problem because I tried playing with 48 out of 50 (unique) civilizations I have, and was still unable to create a colony.
     
  5. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,677
    I managed to get the source for v4 of that mod. Seems like the links to v5 and v6 are dead. It looks like a nasty hack though. What it does is modifying CvPlayer::getSplitEmpireLeaders(), which is the right place, but it doesn't add anything. Instead it just removes the check to see if the player has been in use before.

    In vanilla, a colony can be formed from an empty player and once it is dead, that player slot is blocked for the rest of the game. A new split would use another slot and at some point you will run out of slots and be unable to form more.

    That mod removes the check to see if the player has been used before, which mean dead players can be reused. This totally breaks game history. When you game ends, you get this map thing where you see when each city was placed and stuff. Say we have player A starting in 4000 BC and dies in 1000 BC. In 500 AD player B splits out of another player and B is placed in the same player slot. The history then think B started in 4000 BC, did all the events A did, died out and suddenly became active again.

    We could sacrifice the history for this feature if we like. Not great, but at the same time it's not game breaking either. It's worse that whoever declared war on A actually declared war on the slot, meaning B starts by being at war. The political attitude towards other players is also reused and there is the history of events (you attacked us) and stuff like that. If you want to reuse a slot, you really need to clean it up first and the mod you link to doesn't do that, at least not in v4.

    Also by removing the check for isEverAlive(), it seems to miss a quite fundamental issue because the check is removed, not replaced with isAlive(). This mean I'm not 100% sure it will never overwrite existing players in the game.

    The DLL from this thread has 77 player slots. If you have 50 players, you get room for an additional 27 (or 26 depending on where you place barbarians). They will not be reused, but you have so many extra slots that reusability is less of an issue.

    I wonder what would happen if MAX_PLAYERS is set to something really high like 200. That should provide enough slots to eliminate the issue of not being able to reuse slots. The question is if something bad happens at the high ID players. If playerID is stored as a signed byte, the limit from that would be 127.
     
  6. nci

    nci Chieftain

    Joined:
    Apr 7, 2016
    Messages:
    51
    Bottom line, in order to play with 50 civs and up to 27 colonies, I need to have total 77 unique civs installed, right?
     
  7. isenchine

    isenchine Empress

    Joined:
    Oct 18, 2010
    Messages:
    1,774
    Location:
    Brussels, Belgium
    Yes (with BtS rules exposed before).

    Tell us how it works. We're still interested to see what is the real limit of players in game, if it's 62 or else.
     
  8. nci

    nci Chieftain

    Joined:
    Apr 7, 2016
    Messages:
    51
    I'm using this DLL with combination of dacubz145 mods. I have 50 civs and open slot for colonies from the start. My workers are red dots, otherwise seems to work OK. Quite annoying, though.
     
  9. isenchine

    isenchine Empress

    Joined:
    Oct 18, 2010
    Messages:
    1,774
    Location:
    Brussels, Belgium
    OK, hope you'll be able to have additional colonies then.

    The red dots aka pink blobs are a sign that the game cannot find the art. The units have a proper entry in XML/Art/CIV4ArtDefines_Unit.xml but the art is not located at the path specified in there. If you can't fix this, try to revert to the BtS art.

    Note: if they didn't have a proper entry in the Art Defines file, the game would simply crash.
     
  10. nci

    nci Chieftain

    Joined:
    Apr 7, 2016
    Messages:
    51
    I would like to have 50 civilization slots pre-filled with AI players whenever I select Huge world size while starting a new single-player custom game; manually choosing 50 players to be AI civilizations every single time I start a new game is very annoying and tiresome. How do I achieve this goal?
     
  11. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,677
    In the xml file GameInfo\WorldInfo.xml, there is the tag iDefaultPlayers. Vanilla has this set to 11. Presumably you can set it to 50 and get what you want.
     
  12. Baron03

    Baron03 Baron

    Joined:
    Nov 7, 2010
    Messages:
    303
    I'm running into a similar problem I think.

    I originally compiled the dll to a mod that I am making in bts to allow a total of 62 non barbarian civs, but since there is a limit to the unique leader heads discussed above, can I make multiple civilizations use the same leader head file? They only use seven graphics files anyway (the seven static icons from Chinese unification warlords)

    I know Embryodead made his Sengoku mod allowing for more than 45 civs available at the civ selection screen. At 62 I still get a runtime error.
     
  13. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,677
    I read about an issue where there is a limit to how many LHs you can have in the new game menus. However once the game actually starts, that limit mysteriously goes away. This means there should be a mod out there (forgot which one), which assigns the same leader to multiple players and then on game start, most of those change into leaders, which are unreachable from the start menu.
     
  14. Baron03

    Baron03 Baron

    Joined:
    Nov 7, 2010
    Messages:
    303
    So there is a mod/utility allowing more which allows more civs to display on the scenario civ selection menu by changing leader heads in use?

    My mod worked fine with 46 (before I added to 62) what is the normal limit for civs in the selection screen with unique leader heads available?
     
    Last edited: Mar 20, 2017
  15. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,677
    Looks like the limit is in the exe, meaning there is nothing we can do about that limit and I don't know what the limit is.
     
  16. Baron03

    Baron03 Baron

    Joined:
    Nov 7, 2010
    Messages:
    303
    Looks like the limit is 51 playable civs for me.
     
  17. nci

    nci Chieftain

    Joined:
    Apr 7, 2016
    Messages:
    51
    For me, limit is 60-something. I frankly only have 60-something civs total, otherwise I'd try to push it all the way to 77 just for kicks.
     

Share This Page