Modmodding Q&A Thread

Could a new terrain feature potentially hide the undesirable gaps between land tiles, or is that not possible/ugly?

I thought about that as well. I think it is possible, but I'm afrraid it would look ugly. It will very likely not be a smooth transition.
 
ladies and gentlemen, how to limit city border to second circle?

now limit is 3:
Civ IV_ Beyond The Sword 17.07.2024 17_26_50.png



I want two (even on legendary):
Civ IV_ Beyond The Sword 17.07.2024 17_25_54.png
 
For a proper solution, you need to implement the limitation in the DLL.
 
Maybe you added a ton of culture for barbs by way of plot data over a very large area? I vaguely remember you can expand the size of a plot data.
 
They are entirely different formats. The best way to go about it is load the save, open world builder, and save it as a world builder file.

If you want to add a DoC scenario, that is not sufficient though. You also need to define the new scenario in Python similar to the files in Assets/Python/Scenarios.
 
They are entirely different formats. The best way to go about it is load the save, open world builder, and save it as a world builder file.

If you want to add a DoC scenario, that is not sufficient though. You also need to define the new scenario in Python similar to the files in Assets/Python/Scenarios.
Thank you so much!

(I'm making a large earth map for a mod I'm making, in part to learn how to make maps and mods. The plan is to make a giant earth map 100 x 180 or so, add the extra terrains and resources from DoC, if it's okay with you for me to use them, but instead of an RFC-type mod, it's a true start location map for all 34 BtS civs + the extra natives from Civ4Col)
 
Of course, I did not make most of the art in the mod (only some terrain types that are simple filters of existing types) and you are free to use all of its content.

In that case the above approach using world builder should mostly work - there is no difference between a scenario and a world builder file. There might be some small issues in that the world builder sometimes exports more than you would like, e.g. starting attributes of the different players. But those should be easy to fix manually in the file itself.

Also now that I am talking about this, you should also be aware that the scenario will have the same number of players as the game you exported.
 
Of course, I did not make most of the art in the mod (only some terrain types that are simple filters of existing types) and you are free to use all of its content.

In that case the above approach using world builder should mostly work - there is no difference between a scenario and a world builder file. There might be some small issues in that the world builder sometimes exports more than you would like, e.g. starting attributes of the different players. But those should be easy to fix manually in the file itself.

Also now that I am talking about this, you should also be aware that the scenario will have the same number of players as the game you exported.
Thank you. I assume that I can easily change the number of players with Notepad.
 
Yeah, the scenario file is pretty easy to edit with Notepad, only a bit tedious at times.
 
Yeah, the scenario file is pretty easy to edit with Notepad, only a bit tedious at times.
Thank you. Here is the map that I'm working on. The plan is to place all the rivers and mountains, and then create a mod with the DoC terrains and resources, import the map into there, and then place them.
 

Attachments

  • Civ4ScreenShot0994.JPG
    Civ4ScreenShot0994.JPG
    340.2 KB · Views: 76
  • Civ4ScreenShot0993.JPG
    Civ4ScreenShot0993.JPG
    350.8 KB · Views: 87
  • Civ4ScreenShot0992.JPG
    Civ4ScreenShot0992.JPG
    329.9 KB · Views: 104
  • Civ4ScreenShot0991.JPG
    Civ4ScreenShot0991.JPG
    325.9 KB · Views: 119
@Leoreth - I have made a new mod for my map - to add the DoC terrains and resources, I have copied in the entire Doc/Assets/XML/Terrain folder as well as Bonus, Feature, Improvement, and Terrain from the XML/Art folder, do you have any idea why when I try to use the editor with the DoC terrains, they are all mismatched? I try to place moorland, it looks like semidesert. I try to place semidesert, it looks like lagoon. What am I doing wrong?


I also included some more screenshots of my map in case anyone is interested in seeing it.
 

Attachments

  • Civ4ScreenShot1058.JPG
    Civ4ScreenShot1058.JPG
    379.5 KB · Views: 45
  • Civ4ScreenShot1057.JPG
    Civ4ScreenShot1057.JPG
    336.7 KB · Views: 49
  • Civ4ScreenShot1056.JPG
    Civ4ScreenShot1056.JPG
    378.5 KB · Views: 44
  • Civ4ScreenShot1055.JPG
    Civ4ScreenShot1055.JPG
    381.5 KB · Views: 43
  • Civ4ScreenShot1054.JPG
    Civ4ScreenShot1054.JPG
    386.7 KB · Views: 52
  • Civ4ScreenShot1053.JPG
    Civ4ScreenShot1053.JPG
    381.6 KB · Views: 44
  • Civ4ScreenShot1052.JPG
    Civ4ScreenShot1052.JPG
    381.2 KB · Views: 38
  • Civ4ScreenShot1051.JPG
    Civ4ScreenShot1051.JPG
    288.1 KB · Views: 46
  • Civ4ScreenShot1050.JPG
    Civ4ScreenShot1050.JPG
    330.9 KB · Views: 42
  • Civ4ScreenShot1049.JPG
    Civ4ScreenShot1049.JPG
    375.2 KB · Views: 43
  • Civ4ScreenShot1048.JPG
    Civ4ScreenShot1048.JPG
    340.2 KB · Views: 46
Do they look fine in civilopedia? If yes, your XML is probably correct.

Maybe there is some special code in the worldbuilder that skips a terrain/feature based on its ID so the terrain the worldbuilder thinks it is placing is one off from its actual ID.
 
I think it has something to do that DoC terrainXML also includes peaks and hills. They are elevation types rather than terrain types. They are also the only 2 with <bGraphicalOnly> set to 1. And the offset of the placed terrain and the resulting terrain is also 2.
I do not have access to the vanilla XML right now, so I can't compare the DoC xml with the vanilla xml.

IIRC hills and peaks are added to DoC/RFC terrains, so they can be shown in the pedia. They got the <bGraphicalOnly> tag so it does not effect any other gameplay.
The can easily be checked by looking if hills and peaks are also part of the vanilla terrainXML. If they are not, remove them from the terrainXML from your mod.

If that is not the reason, <bGraphicalOnly> could also be the culprit. IIRC this is not a vanilla XML tag, so the vanilla WB cannot deal with it properly.

Code:
        <TerrainInfo>
            <Type>TERRAIN_PEAK</Type>
            <Description>TXT_KEY_TERRAIN_PEAK</Description>
            <Civilopedia>TXT_KEY_TERRAIN_PEAK_PEDIA</Civilopedia>
            <ArtDefineTag>ART_DEF_TERRAIN_PEAK</ArtDefineTag>
...
            <bGraphicalOnly>1</bGraphicalOnly>
        </TerrainInfo>
        <TerrainInfo>
            <Type>TERRAIN_HILL</Type>
            <Description>TXT_KEY_TERRAIN_HILL</Description>
            <Civilopedia>TXT_KEY_TERRAIN_HILL_PEDIA</Civilopedia>
            <ArtDefineTag>ART_DEF_TERRAIN_HILL</ArtDefineTag>
...
            <bGraphicalOnly>1</bGraphicalOnly>
        </TerrainInfo>
 
I think it has something to do that DoC terrainXML also includes peaks and hills. They are elevation types rather than terrain types. They are also the only 2 with <bGraphicalOnly> set to 1. And the offset of the placed terrain and the resulting terrain is also 2.
I do not have access to the vanilla XML right now, so I can't compare the DoC xml with the vanilla xml.

IIRC hills and peaks are added to DoC/RFC terrains, so they can be shown in the pedia. They got the <bGraphicalOnly> tag so it does not effect any other gameplay.
The can easily be checked by looking if hills and peaks are also part of the vanilla terrainXML. If they are not, remove them from the terrainXML from your mod.

If that is not the reason, <bGraphicalOnly> could also be the culprit. IIRC this is not a vanilla XML tag, so the vanilla WB cannot deal with it properly.

Code:
        <TerrainInfo>
            <Type>TERRAIN_PEAK</Type>
            <Description>TXT_KEY_TERRAIN_PEAK</Description>
            <Civilopedia>TXT_KEY_TERRAIN_PEAK_PEDIA</Civilopedia>
            <ArtDefineTag>ART_DEF_TERRAIN_PEAK</ArtDefineTag>
...
            <bGraphicalOnly>1</bGraphicalOnly>
        </TerrainInfo>
        <TerrainInfo>
            <Type>TERRAIN_HILL</Type>
            <Description>TXT_KEY_TERRAIN_HILL</Description>
            <Civilopedia>TXT_KEY_TERRAIN_HILL_PEDIA</Civilopedia>
            <ArtDefineTag>ART_DEF_TERRAIN_HILL</ArtDefineTag>
...
            <bGraphicalOnly>1</bGraphicalOnly>
        </TerrainInfo>
Thanks! I find Terrain_Peak in vanilla XML, too, and deleting bGraphicalOnly just gives me dozens of XML errors.
 
Here is a list of correspondences between the terrains and what actually shows up (terrain name on left, graphic that shows up on right)
Savanna = salt lake
Salt lake = moorland
Salt flat = steppe
Moorland = semidesert
Steppe = fresh water lake
Semidesert = lagoon
Arctic coast = ??? (purple boxes, image attached)
Lagoon = ??? (some mix between ocean and hills)
Mash = ??? some mix between ocean and mountains)

The terrains in normal civ IV show up fine, though

Also, how do I make a pull request for DoC? I've compiled Industrial/Modern soundtracks for East Asia and the Middle East.
 

Attachments

  • Civ4ScreenShot1059.JPG
    Civ4ScreenShot1059.JPG
    246.5 KB · Views: 36
Last edited:
When you paint the plot, does it place the right tile type, but the graphics are wrong?
Or does it place the wrong tile type?

Pink graphics often indicate missing art files. Check if all art files are copied.

You could try to reorder the terrains in the XML by moving the hills and peaks to the bottom of the XML file in TerrainXML. (This maybe causes some issues with hills and peaks, but it can help finding the cause of this)
 
Does anyone know how to use Microsoft Visual C++ 2010 Express' profiler? I've checked the official documentation and any online posts I could find, but couldn't find details on the 2010 profiler. I can tell it's possible, as there's a build configuration called "Profile" in the CvGameCoreDLL project, and many calls to the PROFILE_FUNC() define scattered among the code.

I've implemented some new features in the DLL and want to see if can optimize them. Thanks!
 
Back
Top Bottom