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

I'd like to make a modmod, but don't know how to do it...

Discussion in 'Rhye's and Fall Modmods' started by MrBanana, Aug 15, 2010.

  1. MrBanana

    MrBanana Chieftain

    Joined:
    Jan 18, 2010
    Messages:
    380
    Location:
    Toronto
    Basically, what I'm thinking of is taking the added unit classes, promotions, buildings, and resources found in RFCEurope and RFC Sword of Islam. It would add on to the RFC Epic or Marathon momod. I think this modmodmod (oh man:eek:) would be really fun for me.

    But I have very little idea how to go abut doing this. I have learned from overhearing to change the python and xml and all that jazz, but I need a bit of guidance. I know there is RFC DoC, but he's is going for epic realism, while I'm just going for more complexity. I've got 3 weeks before schools starts, which then it'd be harder to work on it. Then again, I don't think it would be that hard, copypasta-ing stuff from other peoples' mods.
     
  2. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    It might be harder than you think to add content to RFC. But please don't take this a any kind of definite word on any of this.

    What you're basically looking to do is to import XML entries and art from other mod-mods. The thing is, though, that while the game itself reads the XML present dynamically and sets up the game accordingly, Rhye has pretty much cemented what content should be in the mod (for very practical reasons). This is done in two places, or so I've come to believe.

    Firstly, the C++ code in the DLL reads the XML entries and sets up all the units, buildings and whatnot. All these types of things are enumerated for indexing by the game, but Rhye might have hard-coded the exact lineup used in RFC. If this is true, then you need to use a set of files collectively known as the SDK, edit in the entries you wanna add, and then compile a new version of the DLL file. This requires some knowhow but on the other hand I know people who have succeeded on their first try. (I haven't even tried it myself, yet.)

    Secondly, a large part of the mod is programmed in Python, and Rhye uses constant variables to reference all the different types of content in the mod. You can view this yourself in the Consts.py file. While you don't need to have constants for anything - the numerical index value works just the same - there are constants that state the exact number of indexed types. The mod won't work properly if you don't at the very least alter these values so that the rest of the code can access everything.

    An example of this would be a piece of code that checks all Tech types - by looping their index values. But as long as the constant iNumTechs is equal to the value 91 no additional Techs will of course ever be included. This will probably brake the mod at some juncture, because the logic of the whole thing will start to crumble with unforeseen results.

    So you might need to add things in 3-4 four places in order to be able to add one single piece of content to the mod. But others should be able to give you a clearer description on how to actually do this. Personally I've ever only managed to change units and buildings and whatnot - and not add any of my own. But I'm confident that I will be able to do any of these things once I need to do so.
     
  3. embryodead

    embryodead Caliph

    Joined:
    Jan 1, 2003
    Messages:
    5,179
    Location:
    basement
    As Baldyr said, in RFC, builiding, unit and tech indices are hardcoded in the DLL, making simple things like adding buildings and units very complicated. You'd have to:
    - copy building's entry to ArtDefines_Buildings XML
    - copy buidling's entry to BuildingInfos XML
    - add new index to Const.py, move all other indices, including plague & embassies
    - add new index to CvRhyes.h, move all other... as above
    - recompile the DLL

    all stuff has to be added in the correct order, i.e. a building after other buildings, a wonder after other wonders, mixing them up in the list will cause various bugs/issues.

    This requires XML, Python and C++ coding w/ SDK set up. And since both RFCE and SoI are "total conversion" mods, the stuff isn't compatible with RFC and copypasting won't work except for the XML part. If all of this is completely new to you, I'd suggest setting up more a realistic goal first, like adding new content to BTS or non-RFC mods, which is much easier, but it can still take a while learn XML.
     
  4. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    Ouch, then it was just as bad as I thought. :p

    Well, then it will be my mission to learn how to change this setup and make RFC more accessible for modding. :D I have the rest of my life to reach this goal, after all. :lol: One day I will have amassed enough programming skill to do it, and also have the time to complete the task.
     
  5. Crossphazer

    Crossphazer Chieftain

    Joined:
    Jul 21, 2008
    Messages:
    697
    Location:
    Montréal
    Is simply adding more Unique Units (based on pre-existing units) easier? Because I'd like to try to give civs more UUs (like landsknetchs for Germany) and was wondering if it would be difficult.
     
  6. Baldyr

    Baldyr "Hit It"

    Joined:
    Dec 5, 2009
    Messages:
    5,530
    Location:
    Sweden
    Yeah, that wouldn't be much work. But again - someone else can give you a more detailed game-plan.
     
  7. embryodead

    embryodead Caliph

    Joined:
    Jan 1, 2003
    Messages:
    5,179
    Location:
    basement
    Correct, units are actually only indexed in Python, so it's easier: XML + Consts.py update. Doesn't matter if it's UU or not.

    Map, civs, buildings, wonders and techs are hardcoded in the DLL.
     
  8. Crossphazer

    Crossphazer Chieftain

    Joined:
    Jul 21, 2008
    Messages:
    697
    Location:
    Montréal
    Thanks for the info!
     

Share This Page